Skip to main content

Module supervisor

Module supervisor 

Source
Expand description

The Swarm Supervisor: when a supervised agent ends a turn, a cheap judge model reads its recent conversation and either sends it a continuation or stops and tells the user why.

  • policy: the rules, pure: when a turn is judged, the limits, and what a verdict leads to.
  • judge: the prompt and the one reader of its reply.
  • message: the continuation the agent receives.
  • watcher: listens for completed turns and carries a decision out.

docs/specs/SPEC_SWARM_SUPERVISOR_2026_10_16.md.

Modules§

judge
The judge: one Haiku call through the ambient gateway that reads a supervised agent’s recent conversation and says whether to keep it going. Spec §3.3.
message
The continuation a supervised agent receives (spec §3.5): srv’s header, a fixed instruction for the mode, and the judge’s reason and next step, quoted so model text can neither add a line nor open a marker.
pacing
How fast the Supervisor continues, with no I/O: the wait between a turn’s end and its continuation, the fleet budget of continuations per hour, and which notice group a stop belongs to. Spec §6.2.
policy
The Supervisor’s rules, with no I/O: which turns are judged, the limits, and what each verdict leads to. Spec §3.2 and §3.4.
settings
The Supervisor’s settings: the master switch and the limits. Read from the live config when a decision is made, never from a snapshot taken at start, so a change in the Settings pane or by hand in settings.json applies to the next decision. docs/specs/SPEC_SWARM_SECTIONS_SUPERVISOR_SETTINGS_AND_KANBAN_2026_10_24.md §5, §6.2.
watcher
Carries the Supervisor’s decisions out: listens for completed turns on the broker, judges supervised panes’ turns, sends continuations, writes the state Swarm shows and sends the notifications (spec §3.2 to §3.7).

Structs§

Limits
When a run stops for the user (spec §3.4).
SupervisorDecision
One decision, newest last in SupervisorState::history.
SupervisorState
A supervised pane’s run state, mirrored to block meta supervisor:state after every decision (spec §3.6).

Enums§

SupervisorAction
What the Supervisor did after a turn, for the history.
SupervisorMode
How far the Supervisor keeps an agent going (spec §2).
SupervisorStatus
Where a supervised pane stands, as Swarm shows it.
Verdict
What the judge said about a turn.

Constants§

HISTORY_MAX
How many decisions the history keeps.
META_MODE
Block meta: the pane’s mode, "steady" or "drive"; absent is Off.
META_STATE
Block meta: the run state and recent decisions (SupervisorState), written by srv only, read by Swarm.

Functions§

is_supervised
Whether a pane is supervised now: a mode is set and the pane supports it. The notification router skips its generic “finished” notice for these, as the Supervisor sends its own (spec §3.7). Never while the master switch is off: a stored mode is not read then.
stopped_by_user
Whether the user stopped this pane’s turn within the grace window (backend::user_stop). The turn end it causes is never judged or continued: the user’s override wins (spec §3.4).
stopped_since
Whether the user stopped the pane at or after since_ms: what a continuation that waited checks, since the grace window is shorter than the wait.
supports
Whether the Supervisor can work on this pane at all: a Claude agent, whose conversation srv can read and whose CLI runs the judge (spec §2.1).