595ec187bc
The 'router' name was misleading — it's the always-on conversational front-end
(CHAT triage + STEERING into a running workflow), not a routing layer, and it's
distinct from InferenceRouter. Rename core:router -> core:talkie, package
com.correx.core.router -> com.correx.core.talkie, and RouterFacade/Config/State/
Repository/ContextBuilder/Projector/Reducer/Response -> Talkie*. Config section
[router] -> [talkie] (legacy [router] still read as fallback).
Persisted wire formats are preserved: ChatTurnRole.ROUTER and the
RouterNarrationEvent @SerialName("RouterNarration") stay, so existing event
logs still replay. RouterNarrationEvent the class is now TalkieNarrationEvent.
2.5 KiB
2.5 KiB
core/router — AGENTS.md
Purpose
Router facade and context assembly: builds the context pack delivered to each inference call, manages L3 cross-session memory retrieval, captures ideas from rubber-ducking sessions, and exposes RouterFacade as the primary entry point for the routing pipeline.
Ownership
CORREX kernel team.
Local Contracts
RouterFacade— primary entry point; orchestratesRouterContextBuilder, L3 retrieval, and narration trigger evaluation.RouterContextBuilder— assemblesContextPackfrom active session state, L3 memory hits, repo knowledge, ideas, and steering entries.RouterStaterebuilt fromRouterEventsviaRouterReducer+RouterProjector.RouterRepositorywrapsEventReplayer<RouterState>.RouterResponse— output fromRouterFacade: rendered context + routing metadata.RouterConfig— per-session router configuration (narration mode, L3 enabled, etc.).L3MemoryStore/RehydratableL3MemoryStore/InMemoryL3MemoryStore— L3 cross-session memory interfaces.RehydratableL3MemoryStoreusesL3MetadataRehydratorto restore from recorded events (Hard Invariant #9: L3 queries are recorded as events; replay reads the recorded hits, not the live index).L3Hit/L3MemoryEntry/L3Query— L3 retrieval types.IdeaReader/Idea/Ideas— readsIdeaCaptured/IdeaDiscardedevents to surface idea state as a context feed.WorkflowProposals/WorkflowSummary— proposal types for the workflow-propose panel.NarrationTrigger— evaluates whether narration should be emitted on this turn.- Hard Invariant #9: L3 retrieval queries are recorded as events at query time. During replay,
L3MetadataRehydratorrestores the recorded hits — the live ANN index is never queried.
Work Guidance
- Follow the standard Events→State→Reducer→Projector→Repository pattern (see
core/AGENTS.md). RouterReduceronly doesstate.copy(...).- L3 memory is non-deterministic at query time (ANN search). Always record the hits as events immediately and read those recorded events in all downstream/replay paths.
InMemoryL3MemoryStoreis for tests only; production wiring usesRehydratableL3MemoryStore.
Verification
./gradlew :core:router:test --rerun-tasks
Tests in testing/deterministic/ (RouterContextBuilderTest, RouterFacadeTest, RouterNarrationTest, RouterProjectorTest, L3MetadataRehydratorTest).
Child DOX Index
No child AGENTS.md (leaf module).