Expand description
L3 — the turn engine, M1: actor + turn tasks (commit-protocol.md).
One session actor per session is the sole committer to the log and the
owner of the projection ([actor]); turn tasks read actor-granted
snapshots at sample boundaries and propose entries ([turn]). Steers
admitted mid-turn are woven into the next sample (the conflict table’s
rebase row); interrupts travel out-of-band via a shared token; permission
asks are events carrying a oneshot reply.
Modules§
- hooks
- Extension hooks (M5). The engine consults a
Hooksimpl at two points in the tool phase — before a call runs and after it returns — scoped to the events actually used, not a 35-event schema (Delivery #5).
Structs§
- Engine
Config - Session
Deps - Session
Handle - Spec
Digest - A compaction digest computed speculatively during the turn, overlapping the summarize call with the turn’s own samples. Indices refer to the projection the digest was planned against; the projection only appends between folds, so they stay valid until the fold that consumes them.
Enums§
- AskReply
- A human’s answer to a permission ask. Widened from a
bare
boolso a denial can carry the reason to the model as tool-result feedback — a steer fused with a “no”. §2b (M4) extends this withAllowEdited/Respond; callers should treat it as non-exhaustive. - Engine
Event - Everything the surface renders.
Askcarries the reply channel — the surface (or an allow-rule upstream) is the human on the loop. - Outcome
- Session
Cmd - TurnEnd
- How a turn task ended: with a user-facing outcome, or asking the actor to compact and respawn a continuation (M2 mid-turn = terminate → compact → respawn, per commit-protocol).
Traits§
- Snapshotter
- Workspace snapshots around mutating tool batches (M3b shadow-git). Implementations run the actual snapshot off-thread; a slow or absent snapshotter must never wedge the turn.
Functions§
- needs_
continuation - Whether a projection ends on the model’s turn to speak (M4/#8): the last item is a user prompt or a batch of tool results the model never answered — i.e. an interrupted turn worth continuing on resume. A projection ending in an assistant item (or holding only instructions) is complete.
- spawn_
session