Expand description
Per-block turn-activity tracking (is a turn currently in flight, and
the last process exit code). Previously part of a larger “agent health”
detector that also did silence-based unresponsive detection; that
detection logic was removed (see
docs/specs/SPEC_REMOVE_AGENT_UNRESPONSIVE_DETECTION_2026_08_25.md) —
this struct keeps only the turn-active bookkeeping, which several other
subsystems depend on independently of the removed detector
(broker::process::lifecycle_from, the Swarm pane’s running/idle
badge, subagent-watcher reconciliation, muxspect describe).
It also keeps the turn ledger: the turn as the user sees it, which
can span several CLI passes (TurnLedger,
docs/specs/SPEC_AGENT_TURN_MODEL_AND_LIVE_STATUS_2026_10_08.md §3, §4.3).
active_turn stays per pass; the ledger is display data on top of it.
Structs§
- Agent
Turn Event - The
agentturnevent’s payload (mps_events::AgentTurn): the ledger, and its pane. - Pass
Stats - One finished pass’s figures, from its
resultframe. - Turn
Activity Tracker - Per-block turn-activity tracker.
- Turn
Activity 🔒Tracker Inner - Turn
Input - One input, as told to the tracker by the path that delivers it.
- Turn
Ledger - The turn as the user sees it: from leaving idle to returning to it with
nothing queued, over however many CLI passes that took (turn-model spec
§3.1, §4.3). Published as
agentturnon every change; the pane’s parser is typed against the generatedfrontend/types/rpc/TurnLedger.ts. - Turn
Provenance - What started the current turn, and whether anything else got in.
- Turn
Trigger - What started, or joined, a turn: its kind, and who or what, for display. Built by srv from what it wrote itself (the jekt marker it composed, the CLI’s task notification), never from message body text.
Enums§
- Pass
Start 🔒 - How a pass is starting, for the ledger’s join decision (§4.3).
- Trigger
Kind - What kind of thing started, or joined, a turn (turn-model spec §5.2).
Display data next to
TurnOrigin, which stays the security class. - TurnEnd
- Why a turn ended.
- Turn
Origin - Who delivered input to an agent (SPEC_AGENT_SELF_QUIT_2026_09_24.md §6.3).
Constants§
- ABSORBED_
CAP - At most this many inputs are listed on a turn (
TurnLedger::absorbed);inputskeeps counting past it. - HELD_
FLUSH_ JOIN_ MS - How long after a turn ended the pane’s flush of a message it held during that turn still joins it (§4.3, J3). The flush follows the idle push at once; this covers a slow round trip.
- TURN_
SETTLE_ MS - How long after a pass ends a turn that expects more (input arrived during the pass, or the CLI has a task notification queued) waits for its next pass before it counts as over (turn-model spec §4.3, J4). The CLI starts that pass within milliseconds; this is margin.
Functions§
- closed_
when_ lapsed - A settling ledger as it reads once its window lapsed with no next pass:
ended at its last pass.
Nonefor a ledger that isn’t settling. Sameseq: it is the same state, only now known to be over. - jekt_
sender 🔒 - The
FROM=of the[JEKT:…]marker srv puts at the head of every automated delivery (cron fires asFROM=cron). The input may be the plain text or the stream-json line carrying it, so the marker is looked for anywhere; only automated input is read this way. - ledger_
publisher - A publisher that sends the ledger as the persisted
agentturnevent onblock:<id>, so a pane mounting mid-turn gets it at once. - ledger_
transition - The change from one published ledger to the next, in words, for the
[turn]log:Nonewhen nothing worth a line changed (stats,seq).
Type Aliases§
- Turn
Ledger Publisher - Called with the ledger after every change, outside the tracker’s lock.