Skip to main content

Module health

Module health 

Source
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§

AgentTurnEvent
The agentturn event’s payload (mps_events::AgentTurn): the ledger, and its pane.
PassStats
One finished pass’s figures, from its result frame.
TurnActivityTracker
Per-block turn-activity tracker.
TurnActivityTrackerInner 🔒
TurnInput
One input, as told to the tracker by the path that delivers it.
TurnLedger
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 agentturn on every change; the pane’s parser is typed against the generated frontend/types/rpc/TurnLedger.ts.
TurnProvenance
What started the current turn, and whether anything else got in.
TurnTrigger
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§

PassStart 🔒
How a pass is starting, for the ledger’s join decision (§4.3).
TriggerKind
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.
TurnOrigin
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); inputs keeps 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. None for a ledger that isn’t settling. Same seq: 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 as FROM=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 agentturn event on block:<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: None when nothing worth a line changed (stats, seq).

Type Aliases§

TurnLedgerPublisher
Called with the ledger after every change, outside the tracker’s lock.