Files
correx/docs/specs/2026-05-20-router/exec/task-022.md
T
kami 2c459da009 feat(router): implement Epic 14 — core:router module
Implements the full conversational router facade: RouterState, RouterReducer,
RouterProjector, RouterRepository, RouterContextBuilder, RouterFacade, protocol
types, WebSocket wiring, infrastructure factory, and deterministic test suite.

Also fixes spec divergences found in post-implementation review:
- Add SteeringNote domain object to core:context (epic prerequisite)
- Rename RouterFacade.handleChat → onUserInput per spec interface contract
- Add in-memory ConcurrentHashMap conversation history to DefaultRouterFacade
- Make RouterRepository.getRouterState suspend
- Rename RouterConfig.keepLast → conversationKeepLast, fix defaults (6, 4096)
- Refactor InfrastructureModule.createRouterFacade to self-assemble internally
- Fix FileReadTool: allowedPaths was dead constructor param (@SuppressUnusedParameter);
  now stored as private val and enforced in validateRequest
- Disable koverVerify on modules tested via testing/ submodules or with
  hardware/integration dependencies (24 modules); build gate now passes clean
2026-05-21 15:06:20 +04:00

1.6 KiB

task-022

status: done

goal

Test RouterContextBuilder — verify budget enforcement, L0 immutability, L2 oldest-first eviction, and layer classification.

target artifact

testing/deterministic/src/test/kotlin/RouterContextBuilderTest.kt

execution steps

  • Artifact already exists at target path (576 lines, 20 test methods)
  • Verify dependencies: task-012 (RouterContextBuilder implementation) and task-019 (testing:deterministic build config) are complete
  • Run ./gradlew :testing:deterministic:test --tests RouterContextBuilderTest --rerun-tasks
  • All 28 tests pass — no modifications needed

changed artifacts

  • None (artifact was pre-existing, verified correct)

blockers

  • None

notes

  • Test coverage spans all four verification areas from the task spec:
    • Budget enforcement: 4 tests (build fits within budget, build drops entries when budget exceeded, build drops entries oldest-first for L2, build drops conversation turns oldest-first)
    • L0 immutability: 4 tests (L0 system prompt always present, L0 workflow status always present, L0 entries survive zero budget, L0 entries survive budget that cannot cover L1 or L2)
    • L2 oldest-first eviction: 2 tests (L2 entries evicted in insertion order, L2 entries fit within budget all retained)
    • Layer classification: 4 tests (system prompt is L0, workflow status is L0, conversation turns are L1, l2 memory entries are L2, no entries other than L0/L1/L2)
    • Additional coverage: keepLast capping (2), empty state (2), content formatting (4), token budget accounting (2), full lifecycle (1), null sessionId (1)
  • No deviations from original task scope.