Skip to main content

Module work_facts

Module work_facts 

Source
Expand description

Work facts: per running agent, what srv can already see or cheaply derive about what it is working on, so agents can find out who else is working on the same file, branch or topic (docs/specs/SPEC_AGENT_OVERLAP_AWARENESS_2026_10_10.md §3.1).

FactSource
goalthe line the agent set itself (live_phrase), else block meta term:ambient_summary, else term:last_prompt
todos, current tool, recent filesthe progress watcher (reactive::progress_watcher)
working folderbashwrap’s cwd state file, else the start folder (cmd:cwd)
repo, branch, uncommitted filesgit in that folder, cached (git)

Files are compared across clones as (repository, repository-relative path), since every agent has its own clone. Nothing here blocks anyone: the facts only inform, through WhoIsWorkingOn (matching) and the overlap notes an agent gets when it edits a file another agent is also changing (overlap, overlap_notes). What agents say they are working on (ClaimWork, claims) joins both.

Modules§

claims
Work claims, the pure half (docs/specs/SPEC_AGENT_OVERLAP_AWARENESS_2026_10_10.md §3.4): which claims touch a WhoIsWorkingOn question or an edited file, and how a claim reads. Claims themselves are stored by storage::work_claims; ClaimWork and ReleaseWork are server::work_facts_handlers.
coord
Coordination posts (docs/specs/SPEC_AGENT_COORDINATION_CHANNEL_2026_10_15.md): which posts a question matches, and how a post is shown to another agent. Storage is storage::coord_posts; the HTTP side server::coord_channel_handlers.
cross_channel
Other AgentMux channels’ agents’ work facts, on this computer: every other channel’s srv in the host-global registry is asked for its own agents’ facts (GET /api/v1/work-facts), concurrently, each with its own timeout, so one dead channel never stalls the caller (docs/specs/SPEC_AGENT_OVERLAP_AWARENESS_2026_10_10.md §3.2, §3.3). Used by WhoIsWorkingOn, ListConversations and the overlap notes.
git
The git half of an agent’s work facts: repository, branch and uncommitted files in its working folder.
live_phrase
The line an agent sets for itself: what it is doing now, in its own words.
matching
WhoIsWorkingOn: which other agents’ work facts touch a path, repository, branch or topic (docs/specs/SPEC_AGENT_OVERLAP_AWARENESS_2026_10_10.md §3.2). Pure, so every rule is tested without a running srv.
overlap
Overlap notes, the pure half (docs/specs/SPEC_AGENT_OVERLAP_AWARENESS_2026_10_10.md §3.3, file half): when an agent edits a file, which other agents have the same (repository, repository-relative path) uncommitted or edited it in the last EDITED_WINDOW_MS; the note that says so; and the rate limits that keep those notes rare. The runtime half (when to check, fetching facts, delivering) is overlap_notes.
overlap_notes
Overlap notes, the runtime half (docs/specs/SPEC_AGENT_OVERLAP_AWARENESS_2026_10_10.md §3.3, file half).
paths
Path and repository-name handling for work facts: one spelling for every path (forward slashes, no trailing slash), repository-relative paths so two clones of the same repository compare equal, owner/repo from a remote URL, and where bashwrap keeps an agent’s live working folder.

Structs§

BuildSlotHold
How long and why an agent has held the build slot.
FactFile
One file an agent changed recently.
WorkFacts
Everything known about one agent’s current work.

Constants§

RUNS_IN_CONTAINER
WorkFacts::runs_in of an agent that runs in a container.
RUNS_ON_HOST
WorkFacts::runs_in of an agent that runs as a process of this machine.

Functions§

build
Assemble one agent’s facts from what each source said.
build_slot_of
The build slot hold to show on the agent agent_id, when holder is that agent. The lock names its holder by AGENTMUX_AGENT_ID, the slug; the registry by name, so either may match. slug is only asked for while somebody holds the slot.
collect_local
The facts for every agent registered on this srv. Reads the store and the caches only, never git: call off the async workers.
conversation_summary
The facts as a ListConversations entry carries them (its work field): the first few files of each list and a checklist summary.
folder_of
The agent’s working folder (see paths::working_folder), from its block row. Reads the store: call off the async workers.
goal_of
The agent’s goal: the line it set itself (or the title of the task it claimed), else its generated title, else its last prompt.