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
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
# task-015
|
||||
|
||||
status:
|
||||
- done
|
||||
|
||||
## goal
|
||||
Add RouterResponseMessage data class (sessionId: SessionId, content: String, steeringEmitted: Boolean) as the egress protocol type for router responses.
|
||||
|
||||
## target artifact
|
||||
apps/server/src/main/kotlin/com/correx/apps/server/protocol/ServerMessage.kt
|
||||
|
||||
## execution steps
|
||||
- Add a new `@Serializable` nested data class `RouterResponseMessage` inside the `ServerMessage` sealed class in `ServerMessage.kt`, with fields: `sessionId: SessionId`, `content: String`, `steeringEmitted: Boolean`
|
||||
- Ensure `SessionId` is already imported (it is — already present on line 6)
|
||||
- No changes needed to `ProtocolSerializer.kt` — `encodeServerMessage` already uses polymorphic JSON encoding via the `classDiscriminator = "type"` config
|
||||
|
||||
## changed artifacts
|
||||
- `apps/server/src/main/kotlin/com/correx/apps/server/protocol/ServerMessage.kt` — add `RouterResponseMessage` data class
|
||||
|
||||
## blockers
|
||||
- None
|
||||
|
||||
## notes
|
||||
- Depends on task-008 (RouterResponse model in core/router) — that task provides the domain type; this task adds the egress protocol message type.
|
||||
- Non-goals: WebSocket handler logic (task-016), client message types (task-009).
|
||||
- Follows the same sealed-nested-data-class pattern already used by all other `ServerMessage` variants.
|
||||
Reference in New Issue
Block a user