fix(build): resolve three failing tests across integration and tui modules
SessionOrchestratorIntegrationTest: wire approvalRepository into OrchestratorRepositories constructor which gained the field in the kernel refactor. TambouiKeyMapperTest: correct ctrl-h to alt-h — the mapper has always placed ToggleApprovalOverlay under the Alt branch, not Ctrl. SessionOrchestrator.emit: replace substring(0,7) with take(7) to avoid StringIndexOutOfBoundsException when session IDs are shorter than 7 chars.
This commit is contained in:
@@ -60,8 +60,8 @@ class TambouiKeyMapperTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `ctrl-h maps to ToggleApprovalOverlay`() {
|
fun `alt-h maps to ToggleApprovalOverlay`() {
|
||||||
assertEquals(KeyEvent.ToggleApprovalOverlay, mapKey(TambouiKeyEvent(KeyCode.CHAR, KeyModifiers.CTRL, 'h'.code)))
|
assertEquals(KeyEvent.ToggleApprovalOverlay, mapKey(TambouiKeyEvent(KeyCode.CHAR, KeyModifiers.ALT, 'h'.code)))
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
+1
-1
@@ -646,7 +646,7 @@ abstract class SessionOrchestrator(
|
|||||||
// --- event emission ---
|
// --- event emission ---
|
||||||
|
|
||||||
internal suspend fun emit(sessionId: SessionId, payload: EventPayload) {
|
internal suspend fun emit(sessionId: SessionId, payload: EventPayload) {
|
||||||
log.debug("[session {}] emitting event, payload: {}", sessionId.value.substring(0, 7), payload)
|
log.debug("[session {}] emitting event, payload: {}", sessionId.value.take(7), payload)
|
||||||
eventStore.append(
|
eventStore.append(
|
||||||
NewEvent(
|
NewEvent(
|
||||||
metadata = EventMetadata(
|
metadata = EventMetadata(
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
import com.correx.core.approvals.ApprovalOutcome
|
import com.correx.core.approvals.ApprovalOutcome
|
||||||
|
import com.correx.core.approvals.ApprovalProjector
|
||||||
import com.correx.core.approvals.ApprovalStatus
|
import com.correx.core.approvals.ApprovalStatus
|
||||||
|
import com.correx.core.approvals.DefaultApprovalReducer
|
||||||
|
import com.correx.core.approvals.DefaultApprovalRepository
|
||||||
import com.correx.core.approvals.Tier
|
import com.correx.core.approvals.Tier
|
||||||
import com.correx.core.approvals.domain.DefaultApprovalEngine
|
import com.correx.core.approvals.domain.DefaultApprovalEngine
|
||||||
import com.correx.core.approvals.model.ApprovalContext
|
import com.correx.core.approvals.model.ApprovalContext
|
||||||
@@ -87,12 +90,17 @@ class SessionOrchestratorIntegrationTest {
|
|||||||
private val riskAssessor = DefaultRiskAssessor()
|
private val riskAssessor = DefaultRiskAssessor()
|
||||||
private val artifactStore = NoopArtifactStore()
|
private val artifactStore = NoopArtifactStore()
|
||||||
|
|
||||||
|
private val approvalRepository = DefaultApprovalRepository(
|
||||||
|
DefaultEventReplayer(eventStore, ApprovalProjector(DefaultApprovalReducer())),
|
||||||
|
)
|
||||||
|
|
||||||
private val repositories = OrchestratorRepositories(
|
private val repositories = OrchestratorRepositories(
|
||||||
eventStore = eventStore,
|
eventStore = eventStore,
|
||||||
inferenceRepository = inferenceRepository,
|
inferenceRepository = inferenceRepository,
|
||||||
orchestrationRepository = orchestrationRepository,
|
orchestrationRepository = orchestrationRepository,
|
||||||
sessionRepository = sessionRepository,
|
sessionRepository = sessionRepository,
|
||||||
artifactRepository = LiveArtifactRepository(eventStore, DefaultArtifactReducer()),
|
artifactRepository = LiveArtifactRepository(eventStore, DefaultArtifactReducer()),
|
||||||
|
approvalRepository = approvalRepository,
|
||||||
)
|
)
|
||||||
|
|
||||||
private val engines = OrchestratorEngines(
|
private val engines = OrchestratorEngines(
|
||||||
|
|||||||
Reference in New Issue
Block a user