debt(pre-router): resolved most of the technical debt that was noted while finishing epic-12 and epic-13.

This commit is contained in:
2026-05-16 14:55:45 +04:00
parent 2207a37549
commit f77efce10b
10 changed files with 107 additions and 43 deletions
@@ -0,0 +1,8 @@
package com.correx.core.kernel.orchestration
import com.correx.core.approvals.model.ApprovalDecision
import com.correx.core.events.types.ApprovalRequestId
interface ApprovalGateway {
fun submitApprovalDecision(requestId: ApprovalRequestId, decision: ApprovalDecision)
}
@@ -22,7 +22,7 @@ class DefaultSessionOrchestrator(
private val repositories: OrchestratorRepositories,
engines: OrchestratorEngines,
private val retryCoordinator: RetryCoordinator,
) : SessionOrchestrator(repositories, engines) {
) : SessionOrchestrator(repositories, engines), ApprovalGateway {
override val cancellations: ConcurrentHashMap<SessionId, AtomicBoolean> =
ConcurrentHashMap<SessionId, AtomicBoolean>()
@@ -82,7 +82,7 @@ class DefaultSessionOrchestrator(
cancellations.getOrPut(sessionId) { AtomicBoolean(false) }.set(true)
}
fun submitApprovalDecision(requestId: ApprovalRequestId, decision: ApprovalDecision) {
override fun submitApprovalDecision(requestId: ApprovalRequestId, decision: ApprovalDecision) {
val deferred = pendingApprovals[requestId]
?: error("No pending approval for requestId ${requestId.value}")
deferred.complete(decision)