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:
2026-05-24 23:11:17 +04:00
parent 14141f2f72
commit 850c6df743
3 changed files with 11 additions and 3 deletions
@@ -60,8 +60,8 @@ class TambouiKeyMapperTest {
}
@Test
fun `ctrl-h maps to ToggleApprovalOverlay`() {
assertEquals(KeyEvent.ToggleApprovalOverlay, mapKey(TambouiKeyEvent(KeyCode.CHAR, KeyModifiers.CTRL, 'h'.code)))
fun `alt-h maps to ToggleApprovalOverlay`() {
assertEquals(KeyEvent.ToggleApprovalOverlay, mapKey(TambouiKeyEvent(KeyCode.CHAR, KeyModifiers.ALT, 'h'.code)))
}
@Test
@@ -646,7 +646,7 @@ abstract class SessionOrchestrator(
// --- event emission ---
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(
NewEvent(
metadata = EventMetadata(
@@ -1,5 +1,8 @@
import com.correx.core.approvals.ApprovalOutcome
import com.correx.core.approvals.ApprovalProjector
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.domain.DefaultApprovalEngine
import com.correx.core.approvals.model.ApprovalContext
@@ -87,12 +90,17 @@ class SessionOrchestratorIntegrationTest {
private val riskAssessor = DefaultRiskAssessor()
private val artifactStore = NoopArtifactStore()
private val approvalRepository = DefaultApprovalRepository(
DefaultEventReplayer(eventStore, ApprovalProjector(DefaultApprovalReducer())),
)
private val repositories = OrchestratorRepositories(
eventStore = eventStore,
inferenceRepository = inferenceRepository,
orchestrationRepository = orchestrationRepository,
sessionRepository = sessionRepository,
artifactRepository = LiveArtifactRepository(eventStore, DefaultArtifactReducer()),
approvalRepository = approvalRepository,
)
private val engines = OrchestratorEngines(