Files
correx/core/sessions/AGENTS.md
T
kami d26f20c316 docs(dox): build out the DOX AGENTS.md hierarchy
Root Child DOX Index assembled, plus a per-module AGENTS.md across the tree
(core/*, infrastructure/*, apps/*, testing/*, and docs/examples/frontend/etc),
each following the DOX section shape: Purpose, Ownership, Local Contracts,
Work Guidance, Verification, Child DOX Index.
2026-06-28 20:43:27 +04:00

40 lines
1.8 KiB
Markdown

# core/sessions — AGENTS.md
## Purpose
Session lifecycle management: defines session state, status transitions, approval mode, bound profile/workspace, and the projector/reducer/repository stack for tracking active and historical sessions.
## Ownership
CORREX kernel team.
## Local Contracts
- `Session` — core session domain type with id, status, bound profile and workspace.
- `SessionState` rebuilt from `SessionEvents` via `DefaultSessionReducer` + `SessionProjector`.
- `DefaultSessionRepository` wraps `EventReplayer<SessionState>`.
- `SessionStatus` — enum of lifecycle states (e.g. PENDING, RUNNING, COMPLETE, FAILED).
- `ApprovalMode` — per-session approval policy binding (AUTO, MANUAL, etc.).
- `BoundAgentInstructions` / `BoundProfile` / `BoundProjectProfile` / `BoundWorkspace` — types capturing what was bound to the session at launch time; these are immutable once set.
- `SessionSummary` / `SessionSummaryProjector` — lightweight projection for listing sessions without full state replay.
- `SessionCounterProjection` / `SessionCounterState` — cross-session counter projection.
- `TransitionResult` — outcome type for session state transitions.
## Work Guidance
- Follow the standard Events→State→Reducer→Projector→Repository pattern (see `core/AGENTS.md`).
- `DefaultSessionReducer` only does `state.copy(...)`. No lifecycle decision logic in the reducer.
- Bound types (`BoundProfile`, `BoundWorkspace`, etc.) are immutable once written to the event log. Do not mutate them post-bind.
## Verification
```bash
./gradlew :core:sessions:test --rerun-tasks
```
Tests in `testing/projections/` (DefaultSessionReducerTest) and `testing/replay/` (SessionReplayTest, SessionEmptyReplayTest).
## Child DOX Index
No child AGENTS.md (leaf module).