Skip to main content

Module work_claims_handlers

Module work_claims_handlers 

Source
Expand description

HTTP side of work claims (docs/specs/SPEC_AGENT_OVERLAP_AWARENESS_2026_10_10.md §3.4):

  • POST /api/v1/work-claims: ClaimWork. Records (or renews) the caller’s claim on a path, branch or topic, and answers with who else is already working on it.
  • POST /api/v1/work-claims/release: ReleaseWork. Releases one of the caller’s claims, or all of them.

Claims are stored in the identity store (storage::work_claims), so every channel’s WhoIsWorkingOn and overlap notes see them. Nothing is ever locked: a claim only informs.

Structs§

ClaimParams
ClaimWork’s arguments, plus who is asking (agent, block: the MCP’s own AGENTMUX_AGENT_ID and block id; the request’s agent token wins).
ReleaseParams
ReleaseWork’s arguments: a claim id, or none for all of the caller’s.

Constants§

MAX_NAME 🔒
MAX_NOTE 🔒
The longest note, topic, path, branch and repository a claim keeps, in characters. Another agent reads them in its notes and answers.
MAX_PATH 🔒
MAX_TOPIC 🔒

Functions§

bad_request 🔒
claimer 🔒
Who is asking. A caller with a token is that token’s agent and nobody else: its registration is the one with its UID (never one a block or a name it sent points at), and with none its name is its own slug. Without a token: the registration found by block, then unique name (as WhoIsWorkingOn does), else the name it sent. None when there is no name at all.
handle_claim_work 🔒
POST /api/v1/work-claims: ClaimWork.
handle_release_work 🔒
POST /api/v1/work-claims/release: ReleaseWork.
nonempty 🔒
one_line 🔒
A claim’s free text as it is kept: one line (control characters and line breaks become spaces, whitespace runs collapse) of at most max characters. Marker quoting happens where the text is shown inside a system note (work_facts::overlap).