# task-006

status: done

## goal
Define `RouterState` as a serializable data class holding L2 memory, workflow status, and conversation history — the foundational domain type for all router projections.

## target artifact
`core/router/src/main/kotlin/com/correx/core/router/model/RouterState.kt`

## execution steps
- Create `core/router/src/main/kotlin/com/correx/core/router/model/` directory
- Create `RouterState.kt` with `@Serializable` data class and supporting types per epic-14 spec:
  - `WorkflowStatus` enum (`IDLE`, `RUNNING`, `PAUSED`, `COMPLETED`, `FAILED`)
  - `StageOutcomeKind` enum (`SUCCESS`, `FAILURE`, `CANCELLED`)
  - `TurnRole` enum (`USER`, `ROUTER`)
  - `RouterL2Entry` data class (`stageId`, `summary`, `outcome`, `timestamp`)
  - `RouterTurn` data class (`role`, `content`, `timestamp`)
  - `RouterState` data class (`sessionId`, `workflowStatus`, `currentStageId`, `l2Memory`, `conversationHistory`)
  - All fields use sensible empty defaults (`IDLE`, `null`, `emptyList()`)
- Compile `:core:router:compileKotlin` — succeeds
- Compile dependent modules (`infrastructure`, `apps:server`, `apps:cli`) — all succeed
- Run `:core:router:detekt` — clean

## changed artifacts
- `core/router/src/main/kotlin/com/correx/core/router/model/RouterState.kt` — new file

## blockers
- None

## notes
- `WorkflowStatus`, `StageOutcomeKind`, and `TurnRole` are defined locally in the router module (not imported from `:core:events`), keeping router types self-contained.
- `sessionId: SessionId` uses the domain type from `:core:events` (imported via dependency).
- `l2Memory` and `conversationHistory` have empty-list defaults; per the epic spec, conversation history is managed by `RouterFacade` directly in-memory and is not event-sourced.
- No reducer logic was implemented (explicitly out of scope per task non-goals).
- Kover coverage check is expected to fail until dependent tasks add tests, but compilation, detekt, and accessibility from all dependent modules are verified.
