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
goalblock 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.
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.
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§

FactFile
One file an agent changed recently.
WorkFacts
Everything known about one agent’s current work.

Constants§

META_LAST_PROMPT 🔒
The block meta key the agent pane writes the latest prompt to (frontend/app/store/swarm-line.ts, META_LAST_PROMPT).
SUMMARY_DIRTY 🔒
How many uncommitted and recent files a ListConversations entry shows.
SUMMARY_RECENT 🔒

Functions§

build
Assemble one agent’s facts from what each source said.
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.
folder_of_meta 🔒
goal_of
The agent’s goal: its generated title, else its last prompt.
status_of 🔒