Queue Markers

Every row in an agent:run (or agent:loop, or legacy agent:queue) component can carry a leading marker such as 🚧 or ☑️. agent-doc writes these markers. They show the row's durable lifecycle state, which agent-doc derives from its claim ledger, report receipts, and completion cells. They are never part of the row's work text: every parser strips them before it matches, claims, or strikes a row, so a marker change never retargets work. Editing a marker by hand does not change the state; the next projection repaints it.

Stable link for other pages: docs/guide/queue-markers.md#queue-markers.

Legend

Lifecycle markers are mutually exclusive: an executable head shows exactly one. The composite lost lifecycles retain the last proven phase before loss: ⚠️🟡 was claimed but never worker-bound, ⚠️🚧 had a concrete worker, and ⚠️☑️ retains both loss and recovered outbox evidence. The latter is urgent integration debt, never safe-to-delete state. 🙋 combines with a lifecycle marker (🙋🚧). The two pins set priority, not lifecycle.

A nesting group label — a row whose only job is to name the heads indented under it — is not a head and is not ready to run. It carries no 👀 and no 📥. The next projection removes a pending marker from a group label. A claim, report, or completion on that same row still projects. A sub-prompt child is part of its parent head, so it carries no lifecycle marker of its own either; a bare 📥 on a child is removed on the next projection. An operator pin on a child stays.

Queue rows are deliberately ordinary list rows, not GFM task-list rows. For an id-backed row such as - ⚠️ [#subagent:fix#1] do [#fix], the lifecycle marker and owner annotation describe the queue attempt; the checkbox lives on the referenced tracked-work row, for example - [ ] [#fix] ... in agent:backlog. Adding [ ] to the queue row would create a second completion surface whose state could disagree with the backlog. For the same reason the tracked-work row never carries a queue attempt marker (#backlogrowmarker): attempt state lives only on the queue row, and preflight strips any marker it finds on a backlog, review, or icebox row. A ☑️ left on a backlog row would keep reading as done after its queue row was consumed, while the item is still open. A lost generation keeps its prior phase as ⚠️🟡, ⚠️🚧, or ⚠️☑️. Older durable records without an explicit prior-phase field fall back to their worker binding; a bare orphaned or otherwise degraded visible record remains plain ⚠️. Reclaiming creates a new generation, which then projects 🟡 while reserved and 🚧 after queue start binds the replacement worker.

Failed (terminal) rows

A row agent-doc could not resolve ends as ~~❌ …~~ (#queuefail). It is a last resort: the agent first tries to resolve the row (land the fix, prove there is nothing to do, such as a no-op #address on a head with no unresolved review thread, no changes-requested review, and no failing or unfinished required check, or hand back the prompt-blocker structure with Evidence:). Only then does it run agent-doc queue fail <FILE> --item <row> --reason <why> --attempted <what was tried>.... The row's Response records the reason and every attempted resolution with **State:** ❌ Failed (terminal).. A failed row is struck, so it is never drained, dispatched, requeued, counted as open, or owed at closeout or Stop, and it needs no operator action. It is not ✅ completion: its text keeps the ❌, so a later identical row is not treated as a duplicate of finished work. To run it again, remove the strike and the ❌.

Marker[queue_icons] keyStateMeaning
👀seenseenAgent-doc has seen this prompt and has not yet emitted it in the prepare step. The prefix is the seen glyph 👀. Prepare replaces it with pending when it emits the prompt.
📥pendingpendingLive row with no claim, worker report, or completion evidence; ready to run.
⛔blockedblockedIts tracked item still waits on open work: a (stays open: blocked behind #a, #b) clause or an after=#id edge names an item still open in backlog, todo or review, or a stays-open blocker clause names only ids this document never tracked (an external blocker). ⟦blocked by a, b⟧ lists those ids. The row is held out of drain and subagent dispatch and returns to pending once every tracked blocker closes, the external clause changes, or the decision graph settles that external id (its linked pull request or issue is closed, or a decision names the id). A typed until=<kind>:<args> condition (time:, pr:merged, issue:closed) lists until-<kind> and returns to pending once the controller observes it true and records the observation as an agent-doc:until-met marker. ⟦agent=<name> unavailable⟧ instead says the row's stage harness (agent=) is unknown, not supported for a stage yet, or not installed: every claim would be refused, so the row is parked out of dispatch and returns to pending once the harness is available or agent= changes.
🟡claimedclaimedReserved for a worker by queue claim; no spawned worker is bound yet.
🚧runningrunningA spawned worker is bound to this exact claim by queue start and is still running. A worker that already ended is not this marker.
☑️reportedkeep: worker doneKeep this live row: the worker is done, not a live subagent. The harness recorded its hand-back, or queue report-complete already accepted it. When the hand-back is recorded but unreported, the coordinator owes queue report-complete for this generation, then integration, verification, and closeout. Do not delete it yet.
⚠️lostlostThe claim expired or was abandoned; retry only when durable evidence proves this exact attempt never started, otherwise reconcile it.
⚠️🟡lost_claimedlost + claimedThe attempt was lost while reserved for dispatch; the claimed state remains visible until durable evidence proves whether it started.
⚠️🚧lost_runninglost + runningThe attempt was lost after a worker was bound. Continue that same task automatically, including while a turn is in progress; if continue fails, retry it.
⚠️☑️lost_reportedlost + worker doneUrgent nonterminal debt: the attempt was lost and the worker is done. Either exact completion evidence was recovered, or the ended worker left a hand-back that is not reported yet. Run queue report-complete for that hand-back when it is still unreported, then integrate and close the row in this turn; never silently delete or retry finished work. Keep it open with explicit missing-response or integration debt when blocked.
🔄reconcilingneeds reconcileA binary completion cell whose recorded item is this row's own work is in the document, but no current claim or report receipt owns it. A longer line that only shares the tracked id is not this row. The row is held out of dispatch until the coordinator closes it (striking retires the cell) or reconciles it.
❔unknownunknownDurable queue state is unreadable or contradicts the row (for example a struck row with a live claim); diagnose it, do not redispatch.
⏭️skippedskippedIt was dispatched and came back unconsumed; the queue advanced past it to the next runnable head.
⏳awaiting_operatorawaiting operatorAgent work is finished and no worker holds it; it waits on an operator verdict ([operator-verify], a gated review, or an item that is itself an open operator request).
🙋operator_actionoperator actionA blocking operator request is open for this row. It combines with a lifecycle marker (🙋🚧) and links the request packet by its [#request-id].
📌prioritizedpinnedOperator priority pin (**pin** and :pushpin: are also accepted); the row keeps its position at the top tier.
📍agent_prioritizedagent pinAgent priority pin (*pin* and :round_pushpin: are also accepted); it sorts above unpinned rows, never above operator pins.
AnnotationMeaning
~~row~~Integrated, terminal queue history. A prompt tree is safe to delete only when every row in it is struck; any live row, especially ☑️, must remain.
❌Last resort after the agent tried to resolve the row and could not (agent-doc queue fail). It sits just inside the strike (~~❌ …~~) and the row's Response names the reason and each resolution it tried. Terminal: never re-dispatched or requeued, and nothing is owed on it at closeout or Stop. Not ✅ completion. It needs no operator action; to run it again, remove the strike and the ❌.
🗑️On the top-most row of a subtree that is safe to delete whole: every row in it is struck and none holds work (no open response, Todo, or waiting packet). Delete that row and everything indented under it. In a struck row it sits just inside the strike (~~🗑️ …~~). Re-derived every sync; never part of the row's work text.
🔒On a top-level row whose tree still holds work but already has a 🗑️ subtree under it: keep this row and cut only at the 🗑️ rows. It follows the row's lifecycle marker (🙋 🔒 …), or sits just inside the strike of a struck row. Not the 📌 priority pin. Re-derived every sync; never part of the row's work text.
▫️Ends a row agent-doc generated under a Waiting-on-you item (**Next:**, **Response:**, **Question:**, an offered choice, ...). It is rewritten every closeout and is never your answer or queue work: reply on your own line under the item, without the glyph.
[#<owner>#<N>]Owner and claim generation of the current attempt or report receipt, for example [#subagent:fix#2]. Metadata, not work identity.
⟦blocked by <id>, <id>⟧Follows the blocked marker and names the open items the row waits on (ids without #). Metadata, not work identity.
⟦agent=<name> unavailable⟧Follows the blocked marker when the row's stage harness is refused (unknown, not supported for a stage yet, or not installed). The row is parked out of dispatch until the harness is available. Metadata, not work identity.
⟦effect:N⟧Numbers live rows that have identical text, so each one is its own claimable effect.
⟦addressed-at:YYYY-MM-DDTHH:MM:SS.mmmZ⟧Durable UTC time when a closeout struck the row. Editors derive ①/②/③ and graded highlights for the newest three addressed rows; visiting a row clears only its transient highlight.
⟦<state> you: N · agent: N · done: N⟧On a Waiting-on-you item: its state and roll-up, recomputed every closeout from its packet and attempts. <state> is a live attempt's own marker (🚧, 🟡, ⚠️, 🔄, ☑️, ...), 🙋 while the operator owes an answer (shown once, by the head's 🙋 operator-action gate, so the token keeps only the counts: ⟦you: N · agent: N · done: N⟧), 📥 once the answer waits for an attempt, or ✅ when every row under the item is closed and only its Todo is open. you counts open operator asks, agent live attempts plus an answer waiting to be picked up, and done struck rows. Metadata, not work identity.
**Next:** <owner> — <action> (evidence: …)First child of a Waiting-on-you item: the single remaining action, whose it is (you or agent), and the packet row or attempt it was derived from. An open ask to you is named first, with the options offered for it, even while attempts are live; agent-owned work with no recorded activity for over a day ends with ⏰ stale. When no action can be derived it says so instead of inventing one. Rewritten every closeout; never queue work.
**Roll-up:** / **Subtree:** “<part>” — Next: <owner> — <action>, or 🗑️ deletableBeneath the Next row of a Waiting-on-you item with two or more decisions: the Roll-up row spells out the item's counts (you = open asks to you, agent = worker results not yet integrated plus answers not yet picked up, done = struck rows), and one Subtree row per decision says what that part needs: Next: you — <exact ask>, Next: agent — <action>, or 🗑️ deletable when every row in it is struck or integrated. Rewritten every closeout; never queue work.
⟦local⟧ / ⟦published⟧ / ⟦published+local⟧Worker-reported publication state: local changes (✎), published (⇧), or published and then changed locally again (⇧✎). Metadata, not work identity.
📫 / 📤Older spellings of the reported marker; normalized on the next projection write.
⟦<owner>#<N>⟧Older spelling of the owner annotation; normalized to [#<owner>#<N>].

Where the legend appears

The legend has one definition in the code (agent-doc-queue-icons), and three surfaces render it:

  • Help. agent-doc queue --help, plus the long help of queue claim, start, report-complete, release, claims, brief, repair-projection, and recover-lost. agent-doc queue legend prints it with your configured palette; --line prints the document line, and --markdown prints the table above.

  • Each document. When a document has a runnable-work component, agent-doc keeps one compact legend line as the last paragraph of agent:status:

    Queue markers: 👀 seen · 📥 pending · ⛔ blocked · 🟡 claimed · 🚧 running · ☑️ keep: worker done · ⚠️ lost · ⚠️🟡 lost + claimed · ⚠️🚧 lost + running · ⚠️☑️ lost + worker done · 🔄 needs reconcile · ❔ unknown · ⏭️ skipped · ⏳ awaiting operator · 🙋 operator action · 📌 pinned · 📍 agent pin · ▫️ generated row · 🗑️ delete this subtree · 🔒 keep (cut at 🗑️) · ~~done~~ safe to delete ([legend](…/queue-markers.md#queue-markers))
    

    New documents from the Claim Control Session template start with it. An existing document gets it on its next status write. Every status write replaces the line rather than adding another, so a document has at most one, and it follows your palette. When agent-doc adds a marker, the next preflight or agent-doc queue sync rewrites an older generated line to the current set in place; a Queue markers: line you wrote yourself (one that does not link this page) is never touched. To hide it, set queue-legend=off on the status marker: <!-- agent:status patch=replace queue-legend=off -->.

  • This page.

What ⛔ means

⛔ (blocked) means the row's tracked item cannot start yet, because other work it waits on is still open. agent-doc paints it with the open blocker ids, for example:

- ⛔ ⟦blocked by bossroom-sbx-provision⟧ do [#bossroom-stg-provision]

agent-doc derives the state from the tracked item the row names (do [#id]) in agent:backlog, agent:todo, or agent:review:

  • A stays-open blocker clause. The item text carries (stays open: blocked behind #a, #b). Every #id inside the clause is a candidate blocker. The clause must say it blocks (blocked, blocker), so a (stays open: ...) note about something else is not read as one.
  • An after=#id edge, or a nested ordered-list predecessor in the queue.

When the clause cites at least one id this document tracks or tracked (open or closed, including items moved to its done archive), a candidate blocks only while it names an item that is still open in this document's backlog, todo, or review. An id that is done, archived, or not an item here does not block: a PR number such as #749, or an id that moved to another document. So the row returns to 📥 on the first projection after its last open blocker closes.

A clause that cites no tracked id at all records an external or unknown blocker, such as (stays open: blocked behind #vendorfix; the vendor PR still lacks the file) written by a worker that could not finish. No agent can move that row, so it shows ⛔ ⟦blocked by vendorfix⟧ and stays blocked until someone edits the clause, the id becomes tracked work, you disregard it, or the decision graph settles that id (its linked pull request or issue is closed, or a decision names the id). A settlement releases only an external id; an open tracked item of the same id still blocks. All-digit ids (PR or issue numbers) never block (#gatedheadpending).

A claimed row also shows ⛔ when its worker stopped on a harness usage or credit limit (#harnessquotaexhausted). Nothing is running it and it is not lost: the attempt keeps its worker, worktree, and branch, and a plain re-claim is refused. agent-doc queue claims names the limit and the next step: resume the same worker after the reset, or queue release --requeue to dispatch the row on another harness with the partial branch in its brief. The block is recorded from the harness subagent-end hook when that hook sees the worker id and a known limit or a structured rate_limit, as well as from queue report-complete or queue report-quota-blocked.

A blocked row is held out of the queue:

  • A row blocked by a stays-open clause is deferred: no drain selects it, inline or supervisor, it is not counted as drainable, and session-check counts it with the deferred heads. A row blocked only by an after= edge keeps the dependency gate it already had: it is not counted as drainable while the prerequisite is open in the backlog, the queue orders the prerequisite first, and a head whose turn is already running is not preempted when a dependency is added.
  • queue_subagent_dispatch, session-check's "queue awaits subagent dispatch", and the subagents=N planner never offer it, so it does not take a slot from runnable work.
  • A row blocked by a stays-open clause is never marked ⏭️. It was never dispatched, so it cannot have come back unconsumed.

A live attempt still outranks it: a claimed, running, reported, lost, or reconciling row keeps that marker. ⛔ outranks ⏳, ⏭️, and 📥. agent-doc never edits the row's text or the tracked item: only the marker and annotation change. To unblock a row by hand, close the blocker or edit the clause in the tracked item. To disregard a blocker an agent invented without closing that work, run agent-doc queue disregard or add a disregard child line (#blockerdisregard). A real operator gate, a question that cites an upstream you still have to answer, and a harness permission prompt stay. The exact rule is in specs/07-orchestration-commands.md (#queueblocked, #blockerdisregard).

Why a long-running 🚧 row stays tracked

queue claim --ttl-secs limits only how long an unbound 🟡 reservation may wait for queue start. Once queue start binds a worker, there is no runtime timeout: an old heartbeat makes a refresh reminder due, but never changes the attempt to ⚠️, frees its pool slot, or offers its row to another worker. Tracking ends only on an authoritative report, an explicit release/requeue, a recorded harness stop, quota evidence, or queue-row closure. A harness end-freeze that records the worker's hand-back changes the visible marker from 🚧 to ☑️ (or ⚠️☑️ if the attempt is already lost) without releasing the claim: the worker is not running, and queue report-complete for that generation is still owed. Use queue freeze only after the harness has positively reported that the worker stopped.

When a ☑️ row closes

☑️ (reported) means keep this row: the worker is done, but nobody has integrated its result yet. The glyph comes from a Reported claim attempt (queue report-complete), a release receipt (queue release without --requeue), or a Running/Lost attempt whose harness end-freeze recorded a hand-back that queue report-complete has not consumed yet (#reportowedmarker). That last case keeps the claim Running and blocks dispatch; only the glyph changes, so 🚧 is not counted for a finished worker. The marker is output of those records, never evidence for itself (#managedlistnodrift): when a durable record says something else (a new claim on the same work, a lost attempt with no hand-back), the projection repaints the row from it. For an executable leaf, agent-doc never strikes a ☑️ row by itself and time never clears it. A ☑️ that no claim, receipt, or lineage record backs is kept, because retiring it would make finished work dispatchable again; agent-doc queue repair-managed-state and session-check name each such row so you can decide. You reopen a leaf by removing its ☑️ marker in the document. A structural parent is different: it owns no worker lifecycle, so agent-doc removes a stale parent marker and lazily derives its strike from the leaves (struck only while every leaf is struck). The coordinator closes a reported leaf in a closeout, and which close works depends on the row's shape:

Closure is not tied to the end of a harness turn. As soon as the coordinator has integrated and verified the delivery boundary authorized by the queue item (for example, a PR exists when PR delivery is the requested outcome, or the change is in the target branch when branch delivery is required), it should close the row immediately. For an id-backed row whose tracked item must remain open, queue consume --ack-id makes that strike visible mid-turn. A worker merely reporting or publishing a branch does not prove a stronger delivery boundary than the queue item authorized, so report-complete never auto-strikes.

Do not delete a live ☑️ row: it is the coordinator's integration/writeback debt. A struck row (~~row~~) is integrated terminal history and may be deleted. Automatic lifecycle projection never removes its strike, even if a claim remains or a descendant is live; only the operator can reopen it by removing the strike. For a nested prompt tree, wait until every parent and leaf is struck; if even one row remains live, the tree must remain in agent:run.

RowWhat strikes it
Free text (Setup … channel.)The coordinator's response quotes the row exactly as > **Queue prompt:** <row>, with no **Deferred:** line beside the quote. The row must also be in the turn's baseline, or be backed by its claim or release receipt. In a multi-item closeout, a quoted > **Queue response:** … immediately after the prompt makes that pair individually answer-bearing even when another prompt echo follows.
Id-backed, and the work is done (do [#id], [#id], #review [#id])--done <id> in the closeout (it resolves the backlog item or Todo and strikes the row). If the id no longer names an open backlog item, use agent-doc queue consume <FILE> --id <id>.
Id-backed, and the item must stay openagent-doc queue consume <FILE> --ack-id <id> [--ack-owner <OWNER#GENERATION>]. The backlog item or Todo stays open. For a backlog item, the id is also recorded as kept open, so session-check does not requeue the row. When several reported rows share the id, --ack-owner strikes one attempt's row and leaves the others (#ackidattemptfence). The struck row shows that the item is still open: ~~do [#id]~~ — auto-struck: acknowledged; backlog #id stays open: <reason>, with the reason taken from the item's (stays open: ...) clause. --ack-id refuses and leaves the row unstruck when the open item has no such clause (#acknoreason). If the answer finishes the item, close it with --done <id> instead, together with any parent it finishes.

A quote never closes an id-backed row; it needs one of the id commands. A leading tag such as #review is not the row's id: #review [#adr0043-publish] closes as adr0043-publish, the same id its claim uses.

There is no age-based expiry for ☑️: it remains until one of these explicit closeout paths succeeds. This keeps an unintegrated worker result from being silently discarded, but a successfully integrated row should be closed in the same coordinator cycle rather than left for a later timeout.

A valid ☑️ does not later become ⚠️ because its claim aged or its worker exited. If you see that transition, either queue release --requeue explicitly abandoned the reported attempt, or durable state needs reconciliation. Do not strike the row merely because it is lost: recover the worker result when it exists, otherwise requeue the unfinished work. A completion cell without a governing attempt projects as 🔄, not as proof that integration happened. The current coordinator-admission path selects valid reported rows even when no fresh worker row is drainable, but older orphaned state may still need agent-doc queue repair-managed-state <FILE> (dry-run first, then --apply).

agent-doc queue recover-lost <FILE> compares every Run and Loop with the document's baseline and Git history. A historical row is accounted for by a visible row or by an owning task ID in tracked work or Done. Completion strikes the row that owns the ID. The audit is read-only and reports historical restoration candidates for review.

These keep a ☑️ row open on purpose:

  • 🙋☑️: a blocking operator request is still open. The 🙋 stays until that request's Todo is checked off. You can answer on the row itself: append : <answer> after the [#subagent-operator-request-…] id, and the next closeout checks the Todo off. After that, the row closes the usual way. An answered request whose Todo is closed does not hold the row.
  • A **Deferred:** line next to the quote: the response says the work is still outstanding, so the row stays. A deferral counts only when the response states it: a phrase inside backticks or a code block is a quotation, and a phrase like "waiting on" counts only in the first bullet (or the first paragraph) after the quote, not in a later bullet about other work.
  • 🟡 / 🚧 on the same work: --id and --ack-id refuse a row whose worker is still running. Report or release that attempt first.
  • The worker reported that the work is blocked: do not close it with --done. Acknowledge the report with --ack-id <id>, which keeps the backlog item open. Name an open blocker in the item, as in (stays open: blocked behind #blocker). A clause that only names closed items blocks nothing, so a row queued again would be dispatched again. When the blocker closes, queue the item again with agent-doc backlog <FILE> requeue <id>.

The exact rules are in specs/07-orchestration-commands.md (#reportedrelease, #claimstrike, #taggedidhead, #ackkeepsopen, #ackidattemptfence) and specs/07-closeout-commands.md (#operatoractionstrike, #answeredrequeststrike).

What 🔄 means

🔄 (needs reconcile) means agent-doc found finished-work evidence for a row but cannot tie that evidence to a current attempt. The evidence is a binary-attested completion cell (the agent-doc-subagent-completion block that queue report-complete writes into agent:exchange). Nothing governs that cell: the row has no current claim and no report receipt. agent-doc does not offer the row as fresh work, because a worker may already have done it, and it does not mark it ☑️, because no exact attempt proves the report belongs to this row.

There are two usual causes:

  • A worker reported, its claim was released or pruned, and the row was never struck. Integrate the result and strike the row. Every strike path retires the row's completion cell and receipt, so the row closes cleanly.
  • A completion cell from an earlier row with the same text outlived that row, and a new row with that text now shows it. Under the strike-retirement rule (#strikeretires), every binary strike retires the cell. An operator's hand strike, or a strike made by a release before that rule, can still leave a cell that paints 🔄 on a later row with the same text. No command retires such a cell without also closing the new row, so ask the coordinator to reconcile it.

The exact rule is in specs/07-orchestration-commands.md (#queueworkevidence).

Waiting-on-you items

Closeout keeps open operator-owned Todo items in a Waiting on you group of the main run. Each item row is binary-owned; everything indented beneath it, up to the next item, is that item's packet: the generated Response, Choices and Next actions, your replies, and any worker attempt. A packet row is never queue work of its own. It never gets 📥, a q- id, a claim or a dispatch. Your reply is evidence for the item: it selects the item itself for one attempt, carrying your reply as its decision evidence. An offered choice (**label**: effect) is an option for you, never work.

Every row agent-doc generates in a packet ends with ▫️ (▫️ generated row in the legend), and that glyph is how agent-doc tells its rows from yours. It counts only as the last token of a row in the generated position: a labeled row (**Next:**, **Response:**, **Question:**, ...) directly under the item or under another generated row, or an option under the generated **Choices:** row. A line you type under the item, under a choice or under a generated row stays yours even if it happens to end in ▫️. Older documents also hid a <!-- agent-doc:reply --> comment on these rows; the next closeout rewrites them without it.

Each item row carries its state and roll-up right after its attempt projection, for example:

- 🙋 ⟦you: 1 · agent: 0 · done: 0⟧ [#approve-pr] Approve and merge PR #42.
- ⟦📥 you: 0 · agent: 1 · done: 0⟧ [#pick-port] Pick a port.
- ⟦☑️ you: 1 · agent: 3 · done: 2⟧ [#release-app] Release app access.
StateMeaning
🙋You owe an answer: the item's own ask, or an open request inside its packet.
📥You answered; no attempt has picked the answer up yet.
🚧 / 🟡 / ⚠️ / 🔄 / ☑️A worker attempt on the item or in its packet is live, in that lifecycle state; the agent owns the next step. ☑️ means a worker reported but its result is not integrated yet.
✅Every row under the item is closed; only its Todo is still open.

you counts open operator asks, agent counts live attempts plus an answer waiting to be picked up, and done counts struck rows in the packet. The token is recomputed on every closeout and never changes the item's identity.

The item's first child is its Next: row: the one remaining action, whose it is, and the evidence it came from, so the item rows and their Next: rows alone tell you where everything stands:

- 🙋 ⟦you: 1 · agent: 0 · done: 0⟧ [#approve-pr] Approve and merge PR #42.
  - **Next:** you — answer: Which reviewer should approve it? (evidence: Question) ▫️
- ⟦📥 you: 0 · agent: 1 · done: 0⟧ [#pick-port] Pick a port.
  - **Next:** agent — pick up your reply “use 8080” and attempt `#pick-port` (evidence: your reply) ▫️
- ⟦☑️ you: 0 · agent: 3 · done: 2⟧ [#release-app] Release app access.
  - **Next:** agent — integrate the reported results, then close the item or ask what remains (evidence: ☑️ `subagent:grant#1` and 2 more attempts) ▫️

The action is derived from the packet: a specific **Question:**, else an **Action:** that differs from the item's own text, else a plain request to reply under the item. When nothing can be derived the row says so rather than inventing a step. The row is binary-owned reply metadata, replaced on every closeout and never read back as evidence.

Closing a waiting item

When a waiting item's Todo closes, closeout moves the item's whole subtree (packet rows, choices, struck rows, and your replies) out of the queue and into agent:done, under one receipt line (#waitingarchive):

- 2026-11-04 archived waiting item `#approve-pr` (its Todo closed): `#approve-pr` Approve and merge PR #42. — its 4 rows moved here from the Waiting on you tree of queue `main` <!-- agent-doc:waiting-archive -->
  >   - ⟦📥 you: 0 · agent: 1 · done: 0⟧ [#approve-pr] Approve and merge PR #42. <!-- agent-doc:waiting-item -->
  >     - approved

Every archived line is the original line behind >, so nothing you typed is lost, and no quoted [#id] counts as completed work. When the Done section declares archive=, the next done-archive flush moves the entry into that file.

A rebuild never deletes operator text. A row that matches no open Todo item (no Todo id, a duplicate, or a struck head whose Todo is still open) but holds your text stays in the tree after the item it followed.

Older binaries re-copied whole option lists into **Closed by:** back-references, so one decision's choices appeared under its siblings. Closeout drops those verbatim copies (#closedbygraft): only generated option rows that duplicate a row shown elsewhere in the same item go; anything with your text beneath it stays.

Queue tree view

agent-doc queue tree FILE prints every queue as one line per row, with its state, and a summary (#queuetreeview):

9 items: 3 done · 1 waiting on you · 1 answered · 1 running · 1 needs integration · 1 open · 1 reply
queue main
   L2   ✓ done · Ship alpha [#q-alpha]
   L4   🚧 running · Build beta [#q-beta]
   L5   ☑️ needs integration · Fix gamma [#q-gamma]
   L8     🙋 waiting on you · [#ask] Approve the ask.  (you 1 · agent 0 · done 0)
  L15       ↳ reply · blue please

--open-only hides closed rows with their subtrees, --item ID shows one subtree, and --json prints the nodes editors read through the agent_doc_queue_tree_json FFI export (1-based line, inclusive end_line for folding, state, glyph, closed, rollup). Each node also carries queue_id, the same join key a claim uses (queue-id:q-…, id:…, or text:…), so a reader does not match a claim by the row's first tag or its truncated text. The view never writes the document.

Asking a subtree's status

To ask whether part of a queue still needs anything, add a child line status? under the row (or put [status?] on the row itself). A top-level status? asks about the whole queue. On the next preflight the binary answers from the queue tree, without a model turn (#treestatusquery):

- ~~do [#release]~~
  - 🙋 Approve the changelog
  - do [#publish]
  - ~~do [#build]~~
  - **Status:** snapshot — 1 you · 1 agent · 1 deletable · 0 need review ▫️
    - **Next: you:** “Approve the changelog” — answer the operator gate on this row ▫️
    - **Next: agent:** “do `#publish`” — pick up this queued item ▫️
    - **Deletable:** “do `#build`” — every row is struck and its response records no remaining work ▫️

(The Status rows replace the status? line, here typed as the last child.)

The Status rows are a snapshot: asking again replaces them, and you can delete them. A row the binary cannot classify (a skipped row, a response with follow-up actions of unknown owner) is listed under Needs agent review; ask status? deep instead to have one agent turn look at those rows.

To ask only whether one prompt item tree is deletable, add a child line deletable? (or put [deletable?] on the row). Preflight replaces it with one Status row, deletable — Safe to delete… or not deletable — Keep this prompt item: … is still open., naming some other open row. The question itself is not a reason to keep the tree open, and it never becomes a prompt.

agent-doc queue tree-status FILE --line N [--json] prints the same answer for the row on line N; editors read it through the agent_doc_queue_tree_status_json FFI export.

A pull-request or issue URL heading whose only children are %% … %% notes is a navigation heading. The queue never claims or runs it, so tree status does not list it as agent work.

When agent-doc's background check has seen that a heading's pull request merged or closed (or its issue closed), tree status lists the heading under Settled upstream with the exact command that strikes it:

Settled upstream (flag only; verify before striking):
  L277–L278 · https://github.com/acme/sdk/pull/100 — pull request merged (observed 2026-11-24); verify the work landed, then strike the heading with `queue consume --ack-text` and a `--summary`
            agent-doc queue consume 'session.md' --ack-text 'https://github.com/acme/sdk/pull/100' --summary 'MERGED 2026-11-24: acme/sdk#100 merged (upstream observation).'
A struck heading is then Deletable: `agent-doc queue delete-tree 'session.md' --line 273 --apply`.

Nothing is struck for you. A merge can mean the work under the heading is unblocked rather than done, so a heading with open rows under it is listed without a command until those rows are settled. Tree status reads the saved check results only; it never calls GitHub.

Editing one line

agent-doc queue edit FILE changes or deletes one line of a queue tree, such as a stale %% note under a row, without replacing the whole queue the way agent-doc patch FILE run --id main does. It writes through the editor like every other queue command, so the operator can keep typing.

Select the line in one of three ways:

  • --row ID: the row whose own id is ID (do [#ID], [#ID], or its generated [#q-…]). A follow-up that only names [#ID] as its origin is not that row.
  • --find TEXT: the one line that reads TEXT. Add --row ID to search only that row's subtree.
  • --line N: document line N. Add --expect TEXT so the edit refuses if rows above moved the line since you read it.

--id QUEUE searches one queue only. Text compares trimmed, with one leading list marker dropped, so - %% note %% and %% note %% name the same line.

--text TEXT keeps the line's indentation and list marker and replaces the rest. --delete removes the line; a line with nested children refuses (use queue delete-tree). The binary refuses an edit that would add or remove a component marker, and one that changes the text of a row a worker is claimed for. --dry-run prints the change without writing it.

agent-doc queue edit FILE --row q-7174ad2918b2 \
  --find '%% GH #435 stays open until it is verified on the Coder host. %%' \
  --text '%% closed 2026-11-24; tracked in GH #442 %%'

Cleaning up a finished tree

Three commands close or remove rows that an audit found done or moot. Each one is a dry run unless it says otherwise, and each writes through the editor, like every other queue command:

  • agent-doc queue delete-tree FILE --line N [--apply] deletes the subtrees that tree-status --line N lists as Deletable. A line on no row selects the whole queue. The binary works out the deletable subtrees again when it writes, so a row that is open, waiting on you, owed by the agent, or needing review is never deleted.
  • agent-doc queue consume FILE --ack-text '<row text>' --summary '<evidence>' strikes one row and attaches the summary as its response. This includes a note-only URL heading, with or without a generated [#q-…] id, for example --ack-text 'https://github.com/acme/sdk/pull/403' --summary 'MERGED 2026-11-24.'. Without --summary the binary refuses to strike a note row.
  • agent-doc queue prune-duplicates FILE [--apply] [--keep-copy ID@QUEUE] also removes extra copies of one do [#id] head that sit in different queues. It keeps the copy that holds the worker claim. Otherwise it keeps the copy in the queue the backlog's queue= attribute names, or the queue --keep-copy names. The backlog item stays open, and a copy with child rows stays.

Custom palettes

Each prefix can be overridden in [queue_icons] in ~/.config/agent-doc/config.toml (see Configuration). Built-in spellings stay readable, so changing a prefix never strands an existing document. The help output always shows the defaults; queue legend and the document line show the configured palette.