Expand description
Muxqueue HTTP surface — slice 2 of
docs/reports/REPORT_UNIVERSAL_AGENT_WORK_QUEUE_2026_09_01.md.
POST /agentmux/work — enqueue POST /agentmux/work/claim — claim the next eligible item POST /agentmux/work/:id/heartbeat — extend a lease POST /agentmux/work/:id/complete — finish POST /agentmux/work/:id/release — give back GET /agentmux/work — list
The Kanban’s additions (cards, history, update/ask/submit, the next task)
are in work_tasks.rs (SPEC_WARDEN_KANBAN_2026_10_20.md). An :id may be
a task’s number (12) as well as its id.
Auth-gated by the same middleware as the cron and reactive routes.
Store choice: every handler uses state.work_store. In an installed or
task package build that is the always-global identity store, not
state.shared_store (cron’s place until it moves, SPEC_IDENTITY_STORE_SPLIT_2026_08_17.md
step 1b), and deliberately so: a per-channel queue would only ever mean
“any agent in this channel can pick it up”. A task dev build is the one
exception, with a work-store.db of its own (crate::registry::work_store),
so a test there never reads or changes the operator’s real queue.
Structs§
Enums§
- Filer 🔒
- Who files a task: a caller on this machine (its token says who it is and what it was asked), or an
agent of another machine, named
slug@machine, whose request the transport has verified.
Constants§
- DEFAULT_
LEASE_ 🔒MS - Default lease granted by a claim, and the window a heartbeat extends by. Deliberately short relative to a long agent turn: a claimant is expected to heartbeat, and a crashed one should return to the pool in about a minute rather than blocking the item for an hour.
Functions§
- after_
on_ 🔒board - Dependencies stay inside one board.
- claimed_
body 🔒 - The answer to a claim: the attempt (the fence), the card’s number and the
item, and
after, the tasks it starts after with their documents. A build claimed by an agent no unlock note reached (it was filed for anyone) finds its spec’s path here. - claimed_
reply 🔒 - The answer to a claim that took: the body above, after the claim’s title is written to the agent’s status line.
- claimer_
uid 🔒 - An Unattributed claimer’s UID: carried, else its block’s row, else
""(name path only). An attributed claim uses itsCaller’s UID instead — seehandle_work_claim. - count_
holder_ 🔒match - Count a holder check that matched by name — the row or the caller had no UID. Each is a holder that M5, which drops the name path, would refuse.
- enqueue_
core 🔒 - File a task (or a spec and its build). The one path for a local call and a remote operation, so a task filed from another machine is numbered, carded and noted exactly like a local one.
- enqueue_
one 🔒 - Enqueue one task with what it starts after (the row and the list in one transaction, so no claim takes it in between) and file its card.
- err 🔒
- file_
pair 🔒 - A feature as two tasks: its spec (or research), and a build that starts after it, for the same agent, filed and numbered together.
- filing_
board 🔒 - Which board a filing goes to, if its filer sees it and the target agent is on its list. An agent
of another machine (
slug@machine) is matched against the board’s agent list by that name. - handle_
work_ 🔒claim - handle_
work_ 🔒complete - handle_
work_ 🔒enqueue - handle_
work_ 🔒heartbeat - handle_
work_ 🔒list - handle_
work_ 🔒release - Returns the item’s RESULTING state alongside
ok(Codex P2 on PR #2902). A release on the item’s final allowed attempt parks it asfailedrather than reopening it, so a bare{ok:true}would let the caller report “handed back to the queue” for an item nobody can ever claim again. - holder_
result 🔒 - Shared shape for the three holder-only transitions. No match from the store means the caller is not the current holder OR its fence is stale — both are CONFLICT, not NOT_FOUND: the row usually still exists, it just moved on without this caller.
- holder_
uid 🔒 - The caller’s UID for a holder check (identity M4c-2, spec §6.5.9): the
token’s, or
""when Unattributed — the store then matches by name. - list_
items 🔒 list_view’s tasks alone, for the remotetasks.list.- list_
view 🔒 - The board’s tasks in
state(all when empty), newest first as the store gives them, each with its number and ref, which agents and the operator use. Withoutboard, the default board’s;alllists every board the caller sees.whois the caller’s id and UID, whose agent lists decide the boards it sees (none: all of them). The answer carries a line when more waits for the caller on other boards. - nothing_
to_ 🔒claim - The answer when an unnamed claim finds nothing. Only when the quota floor is what stood in the way does it say so.
- publish_
changed 🔒 - review_
for 🔒 - Whether a filing is held for the operator’s Accept: what the filer said, else (a spec-and-build pair) no, as in the operator’s “Spec first”. Left to the provenance default, a spec an operator asked for would wait for an Accept that never comes, and its build could not start.
- unclaimable_
board 🔒 - Why a named task can’t be claimed because of its board: one the claimer doesn’t see is as good as unknown, and an archived board’s tasks are read-only.