Skip to main content

Module overlap_notes

Module overlap_notes 

Source
Expand description

Overlap notes, the runtime half (docs/specs/SPEC_AGENT_OVERLAP_AWARENESS_2026_10_10.md §3.3, file half).

The progress watcher hands over each sweep’s new edits (on_new_edits) and returns at once: the check runs on its own task. There, every agent’s work facts on this computer are gathered (this srv’s directly, other channels’ through super::cross_channel with its timeouts), each edit is matched (super::overlap), and a match becomes one [AgentMux] system note to the agent that edited, rate-limited by super::overlap::RateLimiter. Delivery is best-effort: a failure is logged, never retried, and never reaches the watcher.

The PR half (§3.3): when the watcher sees an agent open a PR (on_new_prs), the files its branch changes are compared with other agents’ uncommitted changes, recent edits and claims, and with the files committed on their own branches of the same repository on this computer (usually their open PRs). Local facts only: srv has no GitHub identity. Open PRs from other computers are WhoIsWorkingOn’s, through the agent’s own gh-agent. One note per (pane, branch) per 2 hours.

Off with the setting agent:overlapnotes: false.

Structs§

Context 🔒
What the check needs from the running srv, set once it exists.
NewEdit
One edit the progress watcher saw happen live.
NewPr
An agent the progress watcher saw open a PR (gh-agent pr create, gh pr create), live.

Constants§

MAX_BRANCH_CLONES 🔒
Other clones whose branch files are read, at most, per PR.
PR_NOTE_EVERY_MS 🔒
One PR note per (pane, branch) in this long.
SETTING
The setting that turns overlap notes off for this install.

Statics§

CONTEXT 🔒

Functions§

admit 🔒
The edits worth checking now: none when the notes are off, else those whose (pane, file) wasn’t checked in the last minute.
admit_pr_note 🔒
Whether (pane, branch) may get a PR note now, and if so, record it.
check_and_notify 🔒
Gather every agent’s facts, match each edit, and deliver what the rate limits allow.
check_pr 🔒
dispatch 🔒
Run check on its own task and return at once, so the caller (the watcher’s loop) never waits on fetching facts or delivering a note.
enabled
Whether the notes are on (agent:overlapnotes, default on).
install
Turn the notes on for this srv. Until this is called (and in tests), on_new_edits does nothing.
limiter 🔒
note_for 🔒
The note (if any) for one edit, given every agent’s facts and the live work claims.
on_new_edits
The progress watcher’s hand-off: this sweep’s live edits. Returns at once; see the module doc.
on_new_prs
The progress watcher’s hand-off: PRs being opened this sweep. Returns at once; the check runs on its own task.
pr_notes_sent 🔒
pr_overlaps 🔒
Every other agent working on the PR’s files: how, per agent, strongest first (uncommitted, edited, claimed, on its branch). branch_files: other agents’ (name, branch, files their branch changes).