Skip to main content

Module quiet_watch

Module quiet_watch 

Source
Expand description

A leader is told when an agent that owes it work has gone quiet (docs/specs/SPEC_LEADER_TOLD_WHEN_AN_AGENT_GOES_QUIET_2026_11_21.md, phase 1).

An agent is watched while it owes work: it holds a claimed Kanban task (not on hold, not waiting on an answer), or it is a spawned worker that has not reported to its leader since the leader last messaged it. It is quiet when it has done nothing for the quiet time: no output, no message sent, no update of a task it holds. A sweep every 30 seconds reads that from memory (no model call, no poll of the agent): an agent between turns gets one nudge (a system turn) and, five minutes after it, its watchers are told; a turn that is still running and has written nothing for the longer running time gets its watchers told, with no nudge.

The decision (Watch::step) is pure, so the timeline is tested with a fake clock; sweep reads the stores and the controllers and delivers.

Structs§

Limits
The three times, from settings.
Mute
A leader’s mute of one agent: its quiet clock is stopped until until_ms, then runs again from there.
OwedTask
A task an agent holds.
QuietView
An agent that is quiet now, as the Swarm and the Kanban show it (the quiet group of the live facts).
Reading
What the sweep read about one agent that owes work.
Watch
The quiet episodes of the agents that owe work, by agent.

Enums§

Action
What a quiet agent is owed.

Constants§

MAX_MUTE_MINUTES
The most minutes a leader may mute one agent for.
SETTING_QUIET_ESCALATE_MINUTES
How long after the nudge (or, for a running turn, after its quiet time) the watchers are told, in minutes.
SETTING_QUIET_MINUTES
The quiet time of an agent between turns, in minutes; 0 turns the whole feature off.
SETTING_QUIET_RUNNING_MINUTES
The quiet time of a turn that is running, in minutes.

Functions§

ask_answered
Whether an urgent ask is answered: the recipient messaged the sender since (replied_ms), updated or completed a task it named (a held task that moved since), or none of the tasks named is waiting on it any more (done, handed elsewhere or cancelled). Pure.
callable
Whether an agent in this state can be called quiet: it is working or idle. A question waiting for the user, an agent that cannot run (stopped, failed, limited, signed out) and one with no state are told another way.
claimed_by_holder
The claimed tasks of every holder, keyed by the holder’s uid, or name:<lowercased claimed_by> when the holder’s uid is not known: the key the Swarm’s facts use. A task on hold, waiting on a question, in review, done or open is not claimed and is not here.
holding_for_quota
Whether the agent holds on purpose while quota mode is tight: it set its own waiting status line (the leader’s note would only cost the leader a turn to read “idle by design”). The clock is stopped for as long as that line is its current one and the mode stays tight.
install
Start the sweep. Called once from main, beside worker_notes::install.
leads
Whether caller leads target (both agent uids): it is the lead of the target’s seat, which for a spawned worker is the agent that spawned it. Only a lead may mute.
limits_from
The limits in extra, or None when the feature is off (agents:quietminutes of 0 or below).
mute
Mute def_id for minutes (1 to MAX_MUTE_MINUTES) from now_ms, replacing an earlier mute of it.
mute_of
The mute of def_id in force at now_ms, if any.
owed_by
The tasks the agent def holds.
paused_activity
What the agent’s status line and a mute add to its clock (unix ms; 0 for nothing). A new status line is something the agent did, so it counts at the time it was set. A waiting line with its time, and a mute, stop the clock: while one is in force the agent counts as active now, and when it ends the clock runs again from its end.
quiet_body
The note to a watcher about the quiet agent name.
quiet_view
def_id as the last sweep found it, when it was quiet.
read_claimed
Every claimed task, on every board and with no row limit, read once for a sweep or a note: a limit on the board’s rows would cut off the oldest, which are the tasks of the agents that have been quiet longest. Empty when the read fails.
sweep
One look at every agent that owes work.
unmute
Lift the mute of def_id; whether there was one in force.
watcher_panes
The panes that watch the agent def_id: its seat’s lead and its spawned-worker leader (when open on this machine), and the open pane of each agent that filed a task in filers. Never its own pane, each once.