# Operations guide

This guide describes ahub 0.40.0 and control protocols 16 through 17. Live verification
results and remaining prerequisites are recorded separately in [the smoke ledger](smoke.md).

## Agent-operated live verification

Every open live leg in [smoke.md](smoke.md#open-live-legs-by-class) is classed `agent-executable`, `agent-evidence / person-verdict`, `person-only` or `external-blocked` (#784); this section is how an agent runs the first two.

When the user explicitly authorizes a live test, its agent may run console
commands using `ahub --live-test [--project <path|id>] <command> [args...]`.
For example, `ahub --live-test --project <scratch-path> ui --no-open` starts the
real dashboard listener and prints its one-time link without opening a browser.
`ahub --project <scratch-path> --live-test reset --all --yes` exercises reset on
that selected disposable project. The global options precede the command and
may appear in either order; a flag after the command is not delegation.

This grants console authority for operational console-class and peer-lifecycle conductor-class commands, including destructive actions, for one
invocation and its ahub continuations. Use only the user-authorized targets and
commands; destructive live checks belong in disposable projects. Existing
project discovery still applies: initialize the scratch folder as its own Git
repository before `ahub init`, then confirm `status --json` reports that exact
`cwd` before any destructive check.
Existing confirmations, process ownership checks, native identity fences and recovery
locks still apply. Do not remove agent markers. The initiating peer and command
label are audited before effects; an unavailable audit blocks delegation. A new
unflagged invocation has ordinary peer authority again. Native tools launched
by the command keep their own peer identity and receive no delegation flag.
Allowed-class commands keep peer identity and permissions even with the flag:
`--live-test say` sends as the peer. Peer starts, pause and resume may use
delegated console authority. Flagged task assign/escalate refuse; omit the flag
to use the ordinary actor-preserving conductor path when the peer has that role.
Person verdicts and user-authored workflow writes are not delegated. Dashboard
sessions issued through the flag retain operational controls but refuse message
and task/planning content writes. Use native peer tools for agent-authored work.

Use a CLI/coordinator containing this feature throughout the experiment. Ordinary
delegation requires `cli_audit_delegated` in the authenticated running daemon's
welcome, rather than its protocol number or disk status. Execution reuses that
connection; all helper connections are pinned to its authenticated instance, and
local commands check that instance before dispatch. Replacement control
connections refuse. Before effects, the same daemon must acknowledge the exact
audit UUID after successfully appending its event; a feature claim or spool write
alone is insufficient. That retained event survives later consumer replacement,
including a delayed local setup confirmation. Missing or unavailable
support refuses before command effects with an upgrade remedy; its refused audit
uses an outcome older consumers retain. The private pending audit is reserved
before connecting, so an unavailable outbox still refuses before any connection.
Upgrade/recovery uses a compatible `run` spool row and stores the authoritative
delegation in the operation's `delegatedAudits`: peer, closed command label,
timestamp and operation id. Creation, resume handoff, runner, abort and disposal
persist this evidence before runtime/target effects, independently of the source
daemon's drain. Schema-1 receipts retain it through source replacement and resume;
stored evidence never grants a later invocation authority. The journal is capped
at 256 entries and refuses further delegated attempts rather than evicting its
initiator. Local bootstrap commands with no daemon manifest use the compatible
`run` row too. This policy does not
change external computer-use restrictions. Recovery staging refuses old targets
without live-test support before source effects. Delegated headless recovery restores through the ordinary target CLI, carrying
its operationId on the delegated console connection; existing native ownership
and session-identity checks remain. Record actual observations in the
smoke ledger; the presence of this option proves no outstanding #273 live leg.


## Claude plugin skills

Claude's agent-hub plugin carries `ahub-status`, `ahub-manage`, `ahub-use` and the person-invoked `ahub` skill. `ahub doctor` checks the user plugin's skill files and reports a repair command when missing; the same `hub skills` row also reports every other agent host's installed skill trees (below). The person types `/agent-hub:ahub` to prepare a command; it does not grant authority or create a receipt. Existing sessions can continue running an older plugin server after setup or upgrade.


The Claude instruction hook records a pending hash and prompt ID for a matching skill prefix. A pending receipt is not authority; confirmation refuses transcript records from unsupported versions. Host-only confirmation binds a later unused human command row to a current private `ahub claude` launch, the daemon's recorded session and a setup-managed Claude home; Stop, ten minutes or ten operations close it. This step grants no command authority. A same-user process that writes a fake user record into the managed session's real transcript or changes its environment is outside the proof. An unmanaged or unknown session cannot confirm; start it with `ahub claude`, send an ordinary prompt if no session evidence exists, then type the instruction again.

Exact instructed control is available to a managed Claude session through `/agent-hub:ahub run` followed by a supported exact command. The skill invokes `ahub instructed run`; the daemon reads and confirms the person's transcript, parses without a shell, closes the receipt, and starts its own installed CLI over an inherited Bun IPC channel. The tools request supplies only the session id. The current explicitly classified forms cover task assignment and unassignment, backlog pull and return, model set and clear, peer stop, pause and resume, and the listed task spending settings. Exact backlog creation accepts the title the person typed, and exact study approval uses an existing public campaign and revision. Exact backlog pin and pull-ready accept the person-typed reason. Exact title changes require a named hub-local session and return a terminal undo for the screened prior title; unnamed and native Pi sessions are refused. Exact backlog plan remains closed because its JSON fields require quotes. The daemon screens the instruction, operands and study contract before an effect; private or inconclusive results are refused. Screening does not declassify agent-authored text, so creation from intent remains closed. Exact backlog split remains closed because its JSON operand needs quotes that the exact tokenizer refuses; the person can run it in a terminal. File-backed configuration stays closed because its contents can change after the prompt, other free-text operations stay closed to protect the prompt, and structural settings stay closed because their effects are not yet classified. All other forms remain closed until proven. The mode is a host-retained witness in hub.db, and the person changes it from a terminal with `ahub settings set instructed.mode off`, `ahub settings set instructed.mode exact` or `ahub settings set instructed.mode intent`. The local config file holds a display copy; when the witness is first created, an `off` or `exact` copy seeds that narrower mode. Later file edits cannot change the retained witness. Turning off commits the witness before writing the copy; turning on commits it only after that write succeeds. Permission, trust, execution paths, irreversible deletion, release and merge, identity, PII tasks and private turns remain closed. The audit names the peer and receipt, and task history names the person instructed through that peer. An installed runtime inside a checkout or peer write root is refused.

In intent mode the person writes the desired result after `/agent-hub:ahub`; the agent chooses a supported command and supplies its arguments to `ahub instructed run`. The daemon confirms the same session's receipt for each operation and admits at most ten operations before the receipt closes. A person verdict requires the item's literal id in the person's instruction; a claim verdict requires both task id and slot. These verdicts are an exception to reversibility and have no undo. The agent must perform only what the person requested. A fresh witness defaults to `intent`; retained `off` and `exact` choices remain in force. Spending, permission, trust, execution paths, irreversible deletion, release and merge, identity, PII tasks and private turns stay closed in intent mode. Cross-project handoff is closed in both instructed modes because the destination cannot check receipt revocation at its write. Intent free-text commands, file-backed claims and study approval remain closed under their existing privacy and provenance boundaries. The one roadmap form admitted is `roadmap state <id> done` or `dropped` with the milestone id literally in the person's instruction; it is a final verdict with no undo, the milestone history records that it was instructed, and a recovery target must then advertise `roadmap_instructed`.

The no-manifest `task claim` verdict is also available in exact mode. The person types the task id, slot and verdict as part of the exact command; the daemon executes those same operands once. The `--manifest`, `--disposition`, `--model` and `--model-said` forms remain closed in exact mode.

The transport probe found an inherited Unix socket on macOS. On Linux with Yama `ptrace_scope=1` and seccomp mode 2, another same-user process could not reopen the IPC socket via `/proc` (ENXIO), and `pidfd_getfd` was denied (EPERM). A same-user process able to debug or duplicate the socket, rewrite the managed transcript, or modify the installed hub package is outside this proof.


## Command output

`ahub status` defaults to an attention-first summary with next-step commands; `--verbose` or `--full` prints the detailed view, `--full` also keeps long identifiers whole, and `--ascii` uses ASCII markers. `board`, `budget`, `doctor`, `projects`, `queue list`, `turns`, `report` and `usage` print shared console tables and labelled details.
`status --all` uses the projects table. `queue show`, `models status` and `budget execution status` show labelled fields; add `--json` for the raw fetched document.
`report --by task` keeps the attribution and coverage sentences with section headings and aligned counters.
Use `--json` for scripts; it returns the fetched data without color, and `status --json` keeps its existing document.
`sdlc status`, `sdlc explain`, `sdlc queue`, `sdlc release`, `sdlc metrics`, `sdlc costs`, `sdlc merge` and `sdlc authorize-release` print readable output by default (#814, #899: aligned columns, wrapped text, readable times, `--color=auto|always|never`). A script that parsed their JSON must pass `--json`, which prints exactly the document they printed before. `sdlc export` is a data format and stays JSON, as do `export`, `research export` and `bench export`.
`restart` and `upgrade` off an interactive terminal (a pipe, `--dry-run`), `recovery status` and the results of `recovery reattach`, `resume`, `abort` and `dispose`, `models setup` and `start`, `queue resolve`, and `budget execution configure` and `disable` print readable text by default (#814); a script that parsed their JSON must pass `--json`, which prints exactly the document they printed before, including `restart --json --yes`. A readable plan lists each project, each peer with how it runs and what happens to it, every blocker, every reconnect-only session and every fresh start, and says nothing was changed; `--json` keeps those as stderr lines. A pipe wraps at `COLUMNS` when it is set, else at 80 columns.
`task show`, `task cancel`, `backlog groom`, `backlog return|plan|pin|split|undo|pull-ready` and the `release` commands (`list`, `show`, `new`, `plan`, `activate|freeze|ship|drop`) print a readable block by default (#814): the task or release as the hub holds it, a table for lists, every identifier whole, long text wrapped to the terminal. A script that parsed their JSON must pass `--json`, which prints the hub tool's text exactly as before. A private task arrives from the hub as its stub and is shown as that stub. Because these commands also take free text, `--json` and `--color=` count as flags only at the start or the end of the arguments: `--json` in the middle of a reason is part of the reason, and a value flag's value (`task cancel --reason --json`) is never a flag. A reason that ends in a bare `--json` loses it to the flag. `backlog add|pull`, `task escalate|assign|unassign` already answered one sentence and are unchanged.
In `projects --json` and `status --all --json`, an unavailable hub that explicitly refuses an inspection for SQLite contention also carries `failure: { "code": "database_busy" }`; it is additive metadata alongside the neutral `error` sentence.
Text columns are a human interface, not a scripting contract. An identifier accepted as a command argument is whole wherever its available column can hold its own length:
turn ids, queue ids, project ids, execution budget ids and ids in labelled views. Only status's informational settlement and hold ids are shortened;
`status --full` keeps those whole too. Identifiers in suggested commands are always whole.

`--color=auto|always|never` uses the CLI output palette. `always` and `never` force the choice;
otherwise a non-empty `NO_COLOR` disables color, non-empty `FORCE_COLOR` or `CLICOLOR_FORCE`
enables it unless set to `0`, `FORCE_COLOR=0` or `CLICOLOR=0` disables it, and the fallback
colors a TTY whose `TERM` is not `dumb`. Pipes and redirects are plain by default. Color never
replaces a state or level word.
TTY width is its columns (at least 80). A pipe uses a positive integer `COLUMNS` when supplied, otherwise rows
are complete and unwrapped. Long fields wrap within their column; when whole metadata words and the readable flexible-column minimum do not fit, table bands retain every field. Each band carries the row id; when it cannot share a line with the metadata, a per-row id banner links them. Labelled two-column views keep each label beside its value, wrapping the value instead of separating labels and values into bands. In `turns`, the time and state cells wrap at word boundaries only when the file list needs the room and the listing gets shorter for it. When `projects` bands, the task list stays with the state columns in the first band and the second band is always PROJECT and ROOT. Console children receive the console's width
minus its four-column indent and remain uncolored.

## Command help

`ahub help`, `ahub --help` and `ahub -h` print a short command summary grouped by section;
`ahub help <command>` prints only that command's entries, and so does
`ahub <command> -h` (or `--help`) when the flag is the only argument, and
`ahub <command> <sub> -h` when the help lists that subcommand (#1433); anywhere else
it is an ordinary argument, and `ahub claude` and `ahub codex` pass it on to the
agent. `ahub task propose`, `ahub goal new` and `ahub task handoff` refuse a
title word that starts with `--` and is not one of their flags, or is `-h`,
naming the word and the usage before anything is filed; put a lone `--` before
text that starts with dashes. An unknown command
prints `unknown command "<name>"; run ahub help` and exits non-zero. Usages start
at two spaces and descriptions at one fixed column, wrapped at word boundaries to
the terminal width, read as at least 80 and at most 100 columns.

Help uses the CLI output palette: section headings bold magenta, command words
cyan, arguments and descriptions the terminal's default foreground. It has no
`--color` flag. The same environment precedence as other CLI output applies:
non-empty `NO_COLOR` disables color; `FORCE_COLOR` or `CLICOLOR_FORCE` enables it
when non-empty and not `0`; `FORCE_COLOR=0` or `CLICOLOR=0` disables it; otherwise
color follows whether standard output is a terminal with `TERM` other than
`dumb`. Pipes and redirects are plain by default and the overview is laid out
for 80 columns.

### Shell completion

`ahub completion zsh|bash|fish` prints a completion script; it never installs
files or edits shell configuration. On each Tab the script runs
`ahub __complete`, which answers from the help entries above (commands,
subcommands, options, their listed values and file names for path arguments)
without loading the rest of the CLI or contacting a hub, so completion always
matches the installed `ahub`. Agent shells may print the script too.

```sh
# zsh: any directory on fpath works; this one needs no .zshrc change with oh-my-zsh
ahub completion zsh > ~/.oh-my-zsh/custom/completions/_ahub && rm -f ~/.zcompdump* && exec zsh
# bash
ahub completion bash > ~/.local/share/bash-completion/completions/ahub
# fish
ahub completion fish > ~/.config/fish/completions/ahub.fish
```

Upgrading ahub needs no regeneration. To remove it, delete that file and start
a new shell.

## Operator console and panels

`ahub console` combines the existing tail stream with peer, quota, approval-age
and input rows. `ahub up` opens it when both input and output are terminals;
`--no-console` and redirected input/output retain the start-only behavior.
`ahub tail` remains available with its existing rendering.

Allowing an approval requires selection and a separate confirmation. Denying
does not. Only options the daemon supplied are selectable. Typing a command
prevents approval shortcuts from interpreting that input as an answer. Full
approval titles are terminal-only; expiry and answers from another console remove
the pending item. Approval audit records contain id, peer, option kind, response
time and answering surface, without the title.

Pi's write, edit, bash and git write requests also offer `Always allow <tool>
until Pi restarts`. It allows later calls of that tool by the running Pi without
asking, under the same path guard and sandbox; a Pi restart or replacement, or a
hub restart, drops it. The hub log records each granted call by tool name only.
The dashboard can only deny Pi's requests.

In `ask-when-needed`, Pi and the local worker also grant bounded read-only shell calls at the host permit boundary (#816). The command must parse as one literal command and satisfy a closed program/flag table, trusted executable lookup and the existing root/path guard. Unknown flags, operators, expansions, pipelines, output files, unsafe helper/follow/file-list options and outside-root paths keep the ordinary approval path. Single quotes preserve literal data; double quotes containing `$`, backticks or backslashes are not automatically granted.

The fixed program set is `ls`, `cat`, `head`, `tail`, `wc`, `rg`, `grep`, `stat`, `file`, `tree`, `pwd`, `find` and supported read-only `git` forms. Git patch forms need both `--no-ext-diff` and `--no-textconv` where supported; a configured helper-bearing key (`core.fsmonitor`, `log.showSignature`, `gpg.program`, `gpg.<format>.program`, `diff.external`, `diff.<driver>.command` or `diff.<driver>.textconv`, `format.pretty` or `pretty.<name>`) outside the hub's own command scope keeps every git form asking. Custom `--format` and `--pretty` options also ask because signature placeholders can invoke the default GPG program. The host revalidates executable and path proof after each await, immediately before execution. A changed proof requires an explicit approval, including in unattended mode; persistent instability runs nothing. Neither argv nor environment is rewritten. Scoped read-only grants log the tool and class without command arguments.

`ask` retains shell approval behavior; `never-ask`, existing Pi tool-wide grants and the always-ask action policy retain their precedence. Seatbelt, the path guard, read allowlists, home and network access are unchanged. The person's Pi setting and live triage receipt are separate AC4 work; this feature's tests do not certify that rollout.

Tab toggles stream and panels; `ahub console --panels` starts in panels. A panel
screen has a header (the project's directory name, then the tabs), the panel and
a three-line footer, separated by ASCII `-` rules; the stream has one rule above
its footer. The active tab is bracketed, as in `[2 Approvals]`, so it reads
without color. The Approvals tab counts pending requests and the Queue tab
counts `needs_review` deliveries, in the attention and failure tones.

Tab `7 Usage` (#683 U3, key `7`; Left and Right wrap as Settings does, so the `1`..`5` cycle is unchanged) lists each peer with the tokens of today (the UTC day),
the last seven UTC days and its lifetime, the current budget pause, its quota windows with their reset time, and its last reset. Every number names its
source (`native`: the provider's own total, `hub`: what the hub counted for a peer that reports none, `at least`: a partial sum); a counter nobody reported
is `unknown` and a period with no records is `no records`, never 0. Enter opens a peer: today, 7 days and lifetime with input, output, cache read, cache
write and the hub count each on its own, and the last three resets. The task selected in Tasks when you press `7` is shown below the table with its tokens
per peer (`#id [pii]` for a private task, never a title). The panel asks the hub's `usage` op only while it is open, and a refusal shows as
`usage unavailable`. The numbers come from the roll-up of `ahub usage`, so the console and the CLI agree. A request folds the event log first, within 250 ms;
when a very large log is not folded yet the answer carries `behind: true`, the panel says `still catching up` and `ahub usage` prints a warning on stderr, so a partial number is never shown as the whole.

Tab `9 Roadmap` (#1483 R5) appears while the hub reports the `roadmap` feature. It lists Now, Next and Later lanes with each milestone's approved/total progress, and Enter opens the milestone. It reads only while open: the list on each refresh, the drift check at most every five minutes. `ahub ui --all` shows a per-project roadmap summary read at most once a minute.

The dashboard's Usage view (#683 U4) sits in the Agents view, under Usage budgets, and shows the same roll-up: the lifetime, without-cache and cache-read totals with
the peers whose figure is unknown, the last 14 UTC days as stacked columns per peer (a day with no record is a `no record` column, never zero), a limits table with the
open pauses and the last 20 pause, resume and reset events, and a task table (state, owner, PR, input, output, cache read, cache write, total). Every figure names its
source like the console does and `unknown` stays the word. A private task shows `#id [pii]` and never its title. The page asks for the figures only while the Agents view is open
(`view: "agents"` in the snapshot request), so a hidden view costs no roll-up work on the 1 s poll. When the roll-up is still behind a very large log the snapshot carries
`usage.behind: true` and the view says the figures are a lower bound until it catches up; a roll-up that cannot be read shows `unavailable`, never the last figures. When there
are more than 20 limit events the table says how many older ones it leaves out and that `ahub usage limits` lists them. Colours are design tokens only, the view reflows to one column at 600 px, and its
tables and chart scroll inside themselves.

Reviewing from the console (#711): on a task in review in Tasks (a selected row, or the open task detail), `r` asks which verdict first on the prompt line,
`review #372 "<title>": a approve  c request changes  Esc cancel` (the title is quoted and cut, a private task shows `[pii]`). `a` puts `review 372 approved ` on
the input line with a guide line above it (`Enter approves #372. You can type a note first. Esc cancels.`); `c` puts `review 372 changes_requested ` there and
asks for what to fix (`Say what to fix, then Enter. Esc cancels.`): Enter with no note is refused in the console with `say what to fix before requesting
changes`, and nothing reaches the hub. The footer says `r approve or request changes`, and `your review: r approve or request changes` when the reviewer is
`user`, also while the task detail is open. When the command finishes the console shows `#372 approved` or `#372 changes requested`, or the CLI's refusal verbatim
as a failure notice, in panels mode too. A task that left review while the choice was open says `#372 is no longer in review (<state>)` and nothing is
prefilled. The console runs `ahub review` as the person; the hub still decides who may review, and nothing about authority changed.

An agent shell (a `!` command inside a Claude or Codex session, or any shell with `AGENTHUB_PEER_ID`, `CLAUDECODE` or `CODEX_THREAD_ID` set) runs as that agent, not as
you. When the hub refuses it something only the person or the task's own reviewer may do, stderr adds one line: `This shell runs as agent "claude" (AGENTHUB_PEER_ID
and CLAUDECODE are set), not as you. Run the command in your own terminal, or use the ahub console: Tasks, select #372, r.` The refusal and the authority are the
same as before, and the console identity never gets the line. The hub's notice that a task waits for your review now names the console path as well as
`ahub review N approved|changes_requested [note]`.

The console attention companion (#280) shows waiting, blocked, review, working,
idle or asleep with separate action/watch counts. Outside the Tasks table, `n` selects the exact approval,
held queue or review row, or prints applicable guidance; it never answers a
request or runs a command. Editing, choices and confirmation retain their controls.
`P` cycles the five built-in characters and off for the current console.

Configure `pet` in `.agenthub/config.json` or `config.local.json`; local options
override shared ones. Defaults are `character: "stai"`, `size: "line"`,
`glyphs: "auto"`, `blink: true`, `bell: false`. Line preserves the three footer
rows and prompt position. Mini/full reserve a bounded character rectangle and
fall back when the terminal is too small. Supported glyphs and character choices
are described below. `pet: false` or `ahub console --no-pet` disables presentation.
Unknown options produce one bounded notice and fall back. Only an open approval
blinks through the existing redraw; `blink: false` disables it. The optional bell
sounds on an action-count transition from zero, at most once per minute, never
for a message alone. Plain mode prints the line only when the action count changes.
Messages addressed to `user` remain attention items until the next key. Drawing
adds no timer, network request or writable settings path.
The operational tabs change with digits 1 to 5 or Left and Right (wrapping at both
ends), never while a command is being edited or a choice is open; under a
confirmation an arrow dismisses it like any key but y, without moving a tab. A pasted
chunk can only edit the command line, but a read that holds nothing but arrow or
Home/End sequences is that many key presses, so a held key repeats its move. Home
or `<` jumps to a panel's first row and End or `>` to its last; the Events tab
follows new events while the last row is selected and stays on a row you moved to.
`w` opens the dashboard outside the Peers tab; in Peers it edits the selected
peer's WIP limit. `:ui --all` works on the command line too. In the Peers tab the planner's row reads `(planner)` and the conductor's `(conductor)`, both when one peer holds the two (`claude (conductor, planner)`, #1414), and
`l` then `y` makes the selected peer the planner (`ahub settings set planner <peer>`). In the Events
tab a row's header line is tokenized and coloured exactly as the same event in
the stream; only the header is tab-flattened before tokenizing. Body lines retain
the previous rendering and stay plain, as does command output; colour never changes
what the panel's text says.

Peers, Approvals, Tasks, Queue, Settings, Usage and Rooms are tables with a header row. A column is as
wide as its widest cell, up to a third of the terminal; the last column takes
the rest and is cut with `...`. In Tasks, TITLE takes the rest and the STAGE
meter keeps a fixed column at the right edge. In Usage, LAST RESET is the column that gives way on a narrow terminal.

| Panel | Columns |
|---|---|
| Peers | PEER STATE MODE LINK AHUB Q ! WIP REVIEW PAUSE QUOTA MODEL DOING |
| Approvals | ID PEER LEFT TITLE |
| Tasks | ID STATE OWNER REVIEWER CLASS AGE TITLE STAGE |
| Tasks, backlog view (`b`) | ID PRI RESERVED DEPS CLASS AGE TITLE |
| Queue | ID PEER STATE REV AGE |
| Settings | GROUP KEY VALUE SOURCE APPLIES |
| Usage | PEER TODAY 7D LIFETIME PAUSE QUOTA LAST RESET |
| Rooms | ROOM LINK MEMBERS REMOTE |

In Tasks, `b` toggles open work and backlog. The backlog heading counts its rows;
rows sort by rank, then id. PRI shows priority/rank, RESERVED the reserved peer,
and DEPS either `ready` or the unapproved dependency ids. Titles use the public
board projection, so PII work remains `[pii]`. Narrow layouts keep ID, RESERVED
and TITLE before the other columns.

On a backlog row, `p` prefills `backlog pull-ready <id> <planningRevision> <reason>`,
`a` prefills `backlog plan` with a reservation JSON object, and `e` prefills the
same command with priority, rank and deps. Edit the JSON and supply a reason;
`c` uses the existing revision-bound `task cancel` command. Once pulled into open
work, `a` uses the usual task assignment flow. In either Tasks view, `n` prefills
`backlog add implement `; edit the class and title, or use
`:task propose --backlog` with paths/deps flags. On proposed or in-progress open
work, `R` prefills `backlog return <id>` for an ownerless proposal, or the
planning-revision-and-reason form for accepted, untouched work. The hub refuses
returns with execution, branch or commit evidence; its refusal appears as a notice.

These actions run the existing person CLI commands, after explicit confirmation;
Esc sends nothing. Row-prefilled ids and revisions cannot be edited, and stale
row revisions require a reload. `:backlog list` reads without confirmation;
backlog mutations (including pull, pull-ready, return, plan, split and undo)
confirm first. The console adds no write path or planner authority.

The MODE column appears only when at least one peer has a non-`ask` mode.
Peers' WIP column shows planner work in progress as `wip/limit` from `taskWip`,
including `0/2`; a peer without an entry reads `-`. At or above the limit, the
cell uses the attention tone. At narrow widths WIP gives way before PEER, STATE
and QUOTA, whether or not MODE is present.

Agent-hub versions (#1385). A line above the Peers table names the running
daemon's version, this console's, the global `ahub` on PATH (read from its
`package.json`, never run) and the installed Claude plugin (one bounded
`claude plugin list --json` read when the console starts). One older than the
daemon reads `(older)` in the attention tone, by the comparison `ahub doctor`
prints; a value that cannot be read is `unknown` and is never flagged. AHUB is
the agent-hub code each peer has loaded: `daemon` for an adapter that runs
inside the daemon, the version a client's hello reported (the Claude plugin's
MCP server), and `tools x` for the versions its open tools connections reported
(the hub tools Codex, Kimi, agy or Jcode run). A client that reports none reads
`unreported`, muted: an unknown version is never counted as a difference. A cell with any version other than the daemon's uses the attention
tone, the versions line counts those peers, and the peer's detail (Enter) says
to update the global CLI and run `ahub setup`, then restart that agent's session.
The column appears only when some peer reports a version, so an older hub shows
none; it gives way before LINK on a narrow terminal. The detail also shows
`agent CLI` for a native CLI version the hub has not verified (the same
`agentDrift` row `ahub status` prints). All of it is display only.

DOING (#878) is what a peer is working on, from signals the hub already receives:
a Claude session's title (its transcript's latest `ai-title` row) and the
in-progress item of its `TodoWrite` list or the task `TaskUpdate` put in
progress; a Codex thread's name and its plan's in-progress step; an ACP agent's
plan entry in progress. The current item wins over the title, cut to 120
characters. A peer with no such source, or one that is offline, shows nothing,
and the column appears only when some peer has a value; it is the first column
to give way on a narrow terminal. The value is a `[private]` stub while the peer
owns or reviews a PII task or is in a private turn, when it was observed then,
or when the public metadata screen refuses it or fails. `ahub status`, the
dashboard's peer rows and the conductor's `hub_status` show the same value; it
lives in the daemon's memory only, never in `status.json`, a log, an event or
memory capture. Board WIP is unchanged.

Pi and the local worker can name an unnamed session with `hub_set_title`
(#1055). A normalized title is 1-80 characters; the first agent name is final.
The person replaces it with `ahub title <peer> <text...>`, or selects the peer
in the console and presses `t`. The rename input starts empty after the command
prefix, even when an unnamed label is visible. Other peers rename in their
native UI. No helper model is called, and task, branch and instance names are
independent. A private turn, an open PII owner/reviewer assignment, a sensitive
title or a failed metadata screen refuses the write.

Every refused title call includes its reason code plus a public cause and next
step. An unconfirmed write can have landed: check `ahub status` before retrying
when the error says it may have been applied. A person rename on an idle Pi
session that has never exchanged a message creates native title metadata but
may not create a session file yet. Recovery preserves that state by refusing
ID-only recreation; exchange one message or explicitly start a new session,
then retry recovery.

An unnamed session displays a muted label from the first acknowledged hub
delivery, at most 60 normalized characters. Queued or unaccepted messages do not
supply it. The console and configured conductor can see this incoming-message
label; other agent status readers see `unnamed`. Its source note distinguishes
the incoming message from text written by the recipient peer. The label is
computed only for live status and dashboard reads;
`status.json`, events, logs and memory receive no derived label. The daemon
stores only the peer's title-session ID and acknowledged delivery/envelope IDs
for native-session peers in `session-title-inputs.json`. The
[storage contract](design/adapters.md#session-title-slots) defines its bounds
and lifetime. Removed instances are pruned when their removal applies, and
Local bindings are discarded because the worker starts a new memory session.
After restart it recomputes the label only when
the same session and retained journal original match; a new session or pruned
original shows no inherited label. Pi's real name stays in Pi's native session;
the local worker's name lives only with that worker's in-memory session. The
native setter/readback probe is separate from the still-pending live restart
receipt tracked in #1143 and `docs/smoke.md`.

In Peers, select a row and press `w` to edit `tasks.wip_limits.<peer>`, prefilled
with its current limit. The editor stays on Peers and uses the existing Settings
value, daemon preview, nonempty reason and `y` confirmation flow; Esc cancels without writing. The
setting definition supplies the bounds (currently 0..32), risk label (`raises`)
and `applies: live`; the shortcut adds no configuration write path. The Peers
hint reads `w WIP limit` and shortens to `w WIP` at narrow widths, alongside
`m permission mode` shortening to `m mode`. Without a `taskWip` entry, `w` shows
a notice and opens no edit. Press `6`, then `u` to preview and confirm the usual
Settings undo. These controls remain person-only, and `ahub settings` retains
its agent-shell refusal.

Other zero counters and unknown values read `-`. Durations read `45s`, `12m`, `3h05m`
or `2d03h`; quota resets and budget pauses read `in 2h13m`, and a pause by the
console user reads `user`. When a peer's status carries #205's optional
`toolsOnly` field (a Claude session attached without channel pushes), LINK reads
`tools-only`. Below the Approvals table, a rule and the selected
request: its title, its allow options numbered as `a` offers them, and `d deny`.
A title too long for the panel is marked `(more)` in the label column; Enter
shows it whole. `d deny` always shows; options that do not fit are counted on a
`(more)` line. The first request is selected when it arrives; `[` and `]` (or
j/k in the panel) select another. `a`, `d` and `v` act on the selected request
only: when it closes, the selection clears with a notice instead of moving to
another request, and a request that arrives later waits for `[` or `]`. Moving
the selection cancels a pending allow choice or confirmation; the choice prompt
names its request. Agent-written text below a field, and option names in
prompts, are quoted unless they are a single word starting with a letter, so
punctuation, a newline or a bare number in them cannot imitate the console's own
structure. Under the `?` key table only `?`, Escape and `q` act.

Up/Down arrows or j/k move, Enter opens a detail of labeled fields (relative times,
never JSON), Escape returns, and `?` shows the keys grouped by panel; in the
stream, `?` prints that table and `v` prints the selected request as its push
showed it. The footer's last line lists only the keys that act in the current
mode, panel and state. A notice shows on the footer's second line until the next
key or for about ten seconds: errors and refusals (a refused command, a request
error, the size refusal) in the failure tone, notices that only inform (a closed
or missing selection) in the attention tone. With a detail open, `p`, `r`, `m` and `a`
act on the item the detail shows. `:` enters a command; its output lines
start at column 4, as message bodies do. Assignment, delivery resolution, allow
decisions and a never-ask permission mode require confirmation; delivery resolution requires a reason. Tasks use the same public redaction as the board. Panels need at least
80 columns by 24 rows; smaller terminals stay in stream mode. Full task and queue reads run only in panels; stream progress uses the existing
status state counts and never fetches the board. Leaving restores
the terminal and returning from panels replays the bounded stream buffer.

Tasks and Queue selections follow the selected id across refreshes. If that row
disappears, no replacement row inherits the action. Task actions also bind the
row's `flowRevision` (its history length); queue actions bind the delivery
revision. The id and revision in a row-started command cannot be edited. Peer,
reason and the final role/action remain editable, and the confirmation names the
validated result. An older hub without `flowRevision` refuses revision-bound task
row actions instead of silently running them unchecked.

In Tasks, `a` assigns the owner in ordinary open states and the reviewer in
`in_review`; a waiting task says when assignment is a reservation. `u` unassigns
the corresponding role, and `r` reviews only in `in_review`. In Queue, `r`
prefills `discard` for a queued row and `retry` for a needs_review row, with the
action still editable before confirmation. `completed` is never the default.
Status, console notices and `route explain` show every held row with its id, sender, kind and age. The hub completes rows made entirely of superseded hub workflow notices or presence items, recording an ids-only reason and the hub actor. An owner task offer with its structured offer marker also settles when the recipient still owns the task, has reached in-progress, in-review or changes-requested state, and its own acceptance follows the last ownership change. A person's acceptance and an unread replacement-owner offer do not count; missing or older-than-4096-entry proof keeps the hold. This runs on hold entry, hub startup, recovery release and task changes, with an ids-only accepted-task reason and the hub actor; it is a disposition, never proof that the offer was read. Mixed messages, unaccepted offers, unmarked live reminders and unknown references remain held. A requested-stop hold still needs the person. A Claude session without channel support safely returns unseen pushes for `hub_inbox`; a thrown notification write remains uncertain.

Claude channel/pull sessions, Codex and Pi may call `hub_delivery_retry { delivery_id }` for their own
`needs_review` row once. Its tool results show held-row count, ids, senders,
kinds and age, never message bodies or task text (up to 32 rows/4 KiB, with an
explicit truncation notice). The redelivery starts with a fixed warning that
the earlier attempt is uncertain and its effects must be checked before acting.
The warning fits within the existing journal body limit. If needed, only the rendered copy is clipped at a Unicode character boundary and ends with an explicit cut marker; the original message is retained. Consumed-retry proof follows every coalesced original atomically with a successful checkpoint, surviving safe failure, stale removal, pruning and restart.

Any earlier explicit retry in the same recipient's lineage, including a person's
retry, leaves a later hold for the person. A busy peer's request only requeues
the originals; delivery waits for idle and retains all pauses and recovery holds.
Hub presence prefaces are mutable context, so they do not consume or inherit a
message's retry allowance and never receive the uncertain-retry warning.
The tool cannot complete or discard a row. If a recovery snapshot lacks retry
history, or older pruned retry records cannot be mapped, the affected message
lineages require a person; unrelated new messages retain the one-retry option.

The local worker and headless ACP peers, including Jcode, receive tools only inside a delivered turn. A hold prevents that turn, so these delivery-only transports do not offer recipient retry; their held hints ask the person to resolve the row. Ordinary messages stay queued. This restriction follows the current transport, not the vendor name: Kimi TUI remains pull-only and can request its one retry.

For an active session, `hub_delivery_resolve { delivery_id, revision, action, reason }`
settles only its own `needs_review` row, including while busy (#1079). Get the
observed revision from the bounded held-row metadata returned with `hub_inbox`.
Use `completed` after handling the delivery, or `discard` when it should not be
acted on, with a nonempty reason. The journal records the recipient actor and
reason. Another peer's row, a stale revision, remote-room disposition, active
`dispatching` rows, a non-channel peer's `accepted` row, a paused or held peer,
recovery, shutdown or storage holds, and a reason that is private or sensitive
all refuse. An explicit push-channel session may also settle its own `accepted`
row as described under [accepted channel delivery settlement](#accepted-channel-delivery-settlement-1172).
A row that carries an
invocation stays person-only (`ahub queue show <id>`, then `ahub queue resolve
<id>`), because the invocation may still be running. This never retries a message, changes a task
role or cancels the native turn; recipient retry keeps its existing one-use rules.

An explicit `hub_inbox` read can return newly queued messages behind a held row
and name the retained hold. It does not return the held originals, settle them
or release automatic delivery. Recovery, pause, lifecycle and storage fences
still apply. A delivery-only peer with no active turn still needs the person to
resolve its hold.

Every console resolution needs a reason. Queue `discard` removes queued originals or
settles a needs_review receipt; it never cancels a task or native turn.

`ahub task unassign <id> [--role owner|reviewer] [--revision N]` is available to
the person or configured conductor. The board records the caller that performed
the unassign. Owner removal is allowed in `proposed`, `in_progress` and
`changes_requested`, returns active work to `proposed`, and clears any owner
reservation. It is refused in `in_review`, `approved` and `backlog`. Reviewer
removal retains the state, including `in_review`, and refuses to remove the human
reviewer of PII work. No replacement is routed and no native process or external
effect is rolled back. An owner-unassigned task stays out of automatic owner
offers across dependency release, planner-pull processing, release timers and
restarts until a later authorized explicit assignment or reservation. The later unassign also
fences planner undo, so undo and re-pull cannot restore the removed reservation.
Former queued assignment or review requests are withdrawn without resolving
uncertain deliveries, and the former agent loses current authority. A withdrawal
notice uses delivery evidence or that peer's own accept/self-claim after the
latest assignment; another owner's in-progress state or an earlier acceptance
does not count. Withdrawing an unread queue alone sends none. If a later person
assignment supersedes an escalation or offline relay, the stale success result
and decision note are suppressed, but the former owner is still told the current
owner and to stop working.

`ahub task assign <id> <peer> [--role owner|reviewer] [--revision N]` uses a
checked console operation when a revision is present. Without it, existing CLI
behavior is unchanged. `ahub queue resolve ... [--revision N]` uses the supplied
revision instead of a fresh show. A `queued` delivery was never handed to its peer, so it can be discarded while the peer is busy (a pull-only TUI is busy most of
the time); `dispatching` and `accepted` deliveries stay refused, and `retry` keeps its rules. A refused resolution names its cause (`active delivery`, `peer busy`,
`stale revision`, `unknown delivery`, `already resolved`, `queued delivery is already scheduled`, `recipient queue is full`, `delivery journal unavailable`), never one
generic sentence (#713). A failed row that a resolution already settled (for
example the parent of a retry, whose redelivery is a separate row) is refused as
`already resolved`, never `stale revision`. `ahub queue show` on a failed row says
that nothing is left to do, or, if the row is unsettled, prints the full `ahub queue
resolve` command with the project directory, revision, `--action discard` and a
prefilled reason, and names `completed` as the other choice (#1098, #1399).

`ahub queue discard --peer <id> --reason <text> [--state queued|needs_review|failed] [--yes] [--json]` clears one peer's backlog and is for the person or the configured conductor (any other agent identity is
refused, and a remote `peer@label` queue is the person's only). Without `--yes` it only says how many deliveries it would discard; with `--yes` it discards each delivery of that peer through the
same resolution as `queue resolve --action discard`, each recorded with the reason, and prints `discarded N of M` with the causes of any it could not discard. With no `--state` it takes the peer's queued rows and its
failed rows that no resolution has settled yet (#1096); `needs_review` rows need an explicit `--state needs_review`, and `--state` names exactly one kind. A failed row ran nothing, so it can be discarded while its peer is busy.
The new request form needs the `queue_discard_states` hub feature: against an older hub the CLI sends nothing for `failed` or for the default and says to upgrade, because that hub would discard queued rows instead.
`ahub queue list` hides rows a resolution already settled (for example the parent of a retry), prints how many on stderr, and `--all` shows them. Only the
named peer's queue is read, so other peers are untouched; it is refused while recovery or shutdown holds queue mutations. In the console Queue panel, `D` on a row opens
the same command for that row's peer, asks for a reason, then a `y` that names the count. No task is cancelled and no native turn is stopped.

Completed-change notices (`Task #N (owner X) is done and touches your open ...`, #713) go one per recipient per done, naming all of that recipient's overlapping tasks, and
only for tasks the recipient has accepted (in progress, in review or changes requested): an offered or proposed task gets none, since its offer or its accept already shows the
current board. A newer notice for the same done task replaces the queued, undelivered one for that recipient (a `superseded completed-change notice` discard in the journal), so
a task that is sent back and done again three times leaves one queued notice, the newest. Revision mismatches and superseded post-await
publications fail without a board or delivery side effect; a reviewer-only change
keeps a valid owner assignment but refreshes its reviewer content.

The Tasks panel summarizes the whole public board with an approved/all fraction,
a 20-cell ASCII bar and state counts. Proposed tasks with unapproved or missing
`after` dependencies count as waiting; PII stubs count normally. Each task has a
four-cell stage meter (proposed, in progress, review, approved). Changes requested
returns to in progress and uses `!` plus the failure tone. Narrow panels retain
the fraction/bar before optional counts, which appear in fixed importance order:
changes requested, review, waiting, in progress, proposed, then unknown when nonzero. Narrow widths drop
only the suffix. Bar cells and percentages round down so open tasks never imply
completion. Stream `tasks N/M approved` lives on the approvals footer line, leaving the
peer/queue footer line intact. Operator notices or an already-full approvals line
take precedence over this optional count. A brief notice hides it only until the
notice's ten-second TTL expires, then the retained known count returns on redraw; the scroll
region starts at row 1 to preserve terminal scrollback. All existing status state
counts contribute to its total, including an unfamiliar state. Until a successful
status read it says loading; later failures preserve the prior count with a notice.
Panels retain their existing full-board refresh and loading/error handling.

The dashboard Task board shows the same shared public-board progress model,
including overall state counts, waiting and stacked segments; each task detail
retains its labeled four-stage track. Filtering rows does not filter overall progress. The existing signature guard
updates the live region only when progress changes. The stacked SVG fills the
section width; its text legend carries every state count. Theme offers System,
Light and Dark; it is applied before first paint and stored in a host-scoped loopback cookie
(`Path=/`, `SameSite=Strict`, one-year lifetime), shared across dashboard ports.
Blocked cookie access defaults to System on reload and never prevents operation. System follows
OS color preference through CSS. Both inline scripts and the style retain CSP
hashes; there are no external chart/theme assets. Live theme/readability inspection
is tracked in `docs/smoke.md` and remains unverified until performed.

The dashboard Office section (#264, phase 1) draws the same snapshot as a
static flat office: one desk per peer in a stable slot (claude, codex, kimi, pi,
local, then others by id; a peer going offline dims its desk and never moves
another), rooms for the board columns in a fixed order (To do, Work floor,
Review, Done as a count only), at most 8 cards per room with "+N more"
filtering the task list to that state, and at most 12 desks with "+N peers".
Work-floor cards sit at the owner's desk, marked for rework; a busy peer's task
bubble names its task only when it has exactly one in progress. Every peer
condition (idle, busy, offline, paused, waiting on approval) has a glyph and a
text label, and the scene carries ids, classes, states, kinds, counts and public
titles only: message bodies, task details and approval titles never enter it.
The scene adds no timer, frame loop or request and re-renders only when its
signature changes. A View control offers Off (the default), Flat and
Isometric; the choice is stored in a second host-scoped loopback cookie `agent-hub-office` with the
same attributes as the theme cookie, and blocked cookie access defaults to Off
without preventing operation. Desks and cards are focusable buttons; activating
one scrolls to and highlights the matching list row, and a list row highlights
its desk or card on focus and hover. The scene performs no action: every control
stays in the lists. The View control's third option, Isometric (phase 4),
renders the same model through the same code path with the grid coordinates
projected (x' = (x - y) cos 30, y' = (x + y) sin 30): tiles become
parallelograms, cards and labels stay upright, and the DOM order and
accessible names are identical to Flat. Switching the view jumps to the new
projection without animating; the settle rule and reduced motion apply
unchanged. The live browser look is tracked in `docs/smoke.md` and
remains unverified until performed.

Phase 5 (#1152) adds a Backlog room before To do: cards in rank, then
priority, then id order, at most 8 with "+N more" opening the backlog filter,
each with its reserved, pinned and waiting marks, and a count equal to the
board's backlog count. Up to three release docks (planning, active or frozen
releases, then "+N releases") show approved/scope and the cut date; activating
a dock sets the task list's release filter. Each planner-role desk carries the
number of unplanned backlog cards (no rank, no reservation), and the wall shows
that count when no planner desk is visible. All of it is read from the existing
snapshot; the design is `docs/specs/2026-10-12-office-view-design.md`.

Motion (phase 2): card moves between rooms and desks, message arcs between
desks (from the hub or the console they start at an anchor point), delivery
warning marks and the busy latch all follow the snapshot. Motion is CSS only:
transitions on transform and opacity (at most one second), keyframe fades for
the transient marks. Arcs and marks hold, then fade out ten seconds after the
event, timed at render from the model's timestamps; expired nodes purge on the
next changed render or their own animationend, never on a timer. Arcs expire on
the snapshot's own envelope clock, so an unchanged snapshot re-renders
identically and writes nothing to the DOM. The scene goes straight to final
positions on the first snapshot, after a project switch, after a snapshot gap
over three seconds, or when one snapshot brings more than six transitions.
`prefers-reduced-motion: reduce` removes all scene transitions and animations.
Event reasons and bodies never enter the scene; arcs carry from, to, kind,
priority, the task ref and the dropped flag only.

Snapshot fields (phase 3): three additive optional fields, so older pages and
older daemons mix freely and `PROTOCOL`/`EVENTS_SCHEMA` stay unchanged. A peer's
open turn (`since`, `task`, `attribution`) names the busy bubble's task exactly
instead of the single-in-progress-task heuristic, and a turn still open while
the peer is paused adds a "finishing a turn" line under the Break sign. A task's
`checking` flag draws a check-running mark on its card, which stays at its
owner's desk (rooms follow states only). Warning `links` (overlap from the
board's overlap test, cohorts, and recent turn-end conflicts the daemon keeps in
a bounded in-memory list) draw dashed lines between the desks they name, labeled
with kind and task ids; all three carry task and peer ids only, and a PII task
never joins a link.

Console color policy is `--color=auto|always|never`, with `auto` as the default.
Explicit `always` and `never` force the choice; otherwise the same `NO_COLOR`,
`FORCE_COLOR`, `CLICOLOR_FORCE`, `CLICOLOR=0` and `TERM` rules apply, using both
input and output TTY state for the fallback. Explicit `always` enables color on
redirected stream output.
Neither option changes terminal size requirements, panel decisions, cursor
management or the final reset. Invalid values fail before connecting.

| Meaning | Palette | Examples |
|---|---|---|
| Information and navigation | Cyan, bold cyan for active/selected labels | Tabs, section/peer labels and `>` selection marker |
| Success and availability | Green | Idle peer, approved task |
| Waiting and attention | Yellow | Busy/paused peer, pending approval, confirmation, review/ready task, important priority |
| Failure and intervention | Red | Failed/check-failed task, undeliverable/overflow, `needs_review` queue, denial request or expired/cancelled approval |
| Metadata | Bright black | Ages, remaining approval time and rules |
| Stream peer names | Claude bright blue (94), Codex bright cyan (96); all others default | Fixed map, no hashing or themes |
| Stream `task` keyword | Magenta | Task event keyword |
| Stream numbers | Bold default foreground (1) | Percentages, durations and measured times |
| Stream issue references | Underlined default foreground (4) | `#232` |
| Stream task references | Magenta underlined (4;35) | `#1` following `task`/`Task`, `[task #1]`, `[review #1]` |

Offline peers, primary titles, action details and message body lines keep the
terminal's default foreground. Labels and prompts remain readable without
color. Stream styling applies only to meaningful tokens in the first line: peer names,
`task`, numbers and references. Ordinary words keep the default foreground.
Task prefixes and bracketed `[review #N]` identify task references
case-insensitively; prose `review #N` and other `#N` tokens are issue references. Legacy assign/which notices lack typed reference
ranges and use the issue tone until structured spans identify them. The dated
#239 palette reserves green/yellow/red for states, cyan for navigation and
blue/cyan for Claude/Codex. Tokens use plain magenta, underlining and bold default
foreground; no token SGR equals a state or peer SGR. The `task` keyword is never
bold. Only hub-written peer slots are colored, not title words or decline reasons.
State words and structural markers retain their event tone. Numeric-looking
identifiers stay plain. Wrapped headers normalize tabs before tokenization; plain headers preserve
their original tabs with color enabled or disabled.
A projection miss on the first physical header keeps only structural tones.
A missed continuation and every following continuation are fully plain; their
text cannot supply structural tones. Projection carries its span index forward
instead of rescanning earlier spans for every line. Bodies and command output stay plain. A local denial is shown as requested, not
as a confirmed receipt; a remote answered closure has no option-kind metadata
and is not guessed to be a denial. A fixed palette is applied after terminal
control sanitization. Width, clipping, wrapping and cursor placement use plain
Unicode text. Each styled span and every interactive exit restores attributes.
Color adds no polling, timers or extra redraws. `ahub tail`, logs and JSON stay
unchanged.

```sh
ahub console --panels --color=auto
NO_COLOR=1 ahub console
ahub console --color=never
ahub console --color=always > console-stream.txt
```

Actual light/dark terminal readability and bounded idle-CPU observations are
recorded separately in the smoke ledger; fake-terminal tests establish policy,
geometry, sanitization and restoration only.

The command input accepts existing status, board, task, review, say, pause,
resume, budget, queue, permit, permission, ask, remember, route, turns, undo,
check-path and report operations. It executes an argument vector with closed stdin. Lifecycle,
launch, nested console, setup, UI, logs and tail commands are refused.

## Authority by command

`classifyPeerCommand` (src/cli/identity.ts) is the gate for an `ahub` command
run from an agent shell. It gives every command one of three classes:
**Allowed** means any agent may run it; **Conductor** means only the
configured conductor peer may (actor-preserving and audited); **Console** means
only the person's own terminal. A command the gate does not name is Console,
and so is every help entry the gate has no class for yet;
`test/identity.test.ts` pins each classed form below.

### Allowed (any agent)

| Command | Class | Why |
| --- | --- | --- |
| `ahub doctor [--json] [--full] [--color=...]` | Allowed | a read-only check of tools, daemon, plugin, gateway, models and memory; the `memory capture: codex` and `memory capture: kimi` rows come from agent-mem's setup state (`amem setup <tool> --json` on PATH, a preview that writes nothing), as set up, `amem setup <tool> --apply` needed, client missing, or unknown when `amem` is missing, refuses or prints no setup plan (#1008) |
| `ahub doctor --stale-anchors [--json]` | Allowed | a bounded read-only report of memory symbol anchors at current HEAD |
| `ahub queue list [--peer <id>] [--json] [--full] [--color=...]` | Allowed | public queue metadata only; inspect your own public held bodies through `hub_inbox`; `ahub queue show` and operator resolution remain person/conductor operations |
| `ahub roster [list] [--json] [--color=...]` | Allowed | public roster status; add/remove retain conductor admission |
| `ahub roles [--json] [--color=...]` | Allowed | each rostered peer's flow roles as the running hub settled them (#1411 T2); no operand |
| `ahub settings [list] [--json]`, `ahub settings get <key> [--json]` | Allowed | public registry values; secret-locating values, paths, undo records and config-editor details are withheld |
| `ahub sdlc status\|explain [<task>] [--json] [--color=...]` | Allowed | public lifecycle status; private tasks stay stubs, without private evidence or receipts |
| `ahub sdlc queue <owner/repo> [--json] [--color=...]`, `ahub sdlc release <owner/repo> [live-issue...] [--json] [--color=...]` | Allowed | public delivery/release readback for the checkout's GitHub origin, explicit SDLC config repos or person-imported public external records; no release authorization or mutation |
| `ahub release show <name>` | Allowed | public release metadata; private scope and internal history remain withheld |
| `ahub projects [--json] [--color=...]` | Allowed | lists registered projects; `projects remove` stays Console |
| `ahub models status [--json] [--color=...]` | Allowed | reads local model state; `setup\|start\|stop` stay Console |
| `ahub recovery status [<op-id>] [--json]` | Allowed | reads a preflight operation; the bare interactive screen and `reattach` stay Console |
| `ahub upgrade ... --dry-run` (no `--yes`) | Allowed | reviews the upgrade plan and applies nothing; apply is a separate person or conductor operation |
| `ahub restart --dry-run [--json]` (no `--yes`) | Allowed | reviews the restart plan and applies nothing |
| `ahub task cancel\|label\|role <id> ...` | Allowed | the daemon decides per task (#933): `label` and `role` only on a task the caller owns, `role` not while it is in review, and `cancel` by the `hub_task_cancel` rule (the planner's own unaccepted backlog or proposed work) |
| `ahub deliverables [--task <id>] [--approved] [--check] [--json]` | Allowed | only the rows `hub_task_show` would show the caller, through the same public screening (#933) |
| `ahub room list [--json]`, `ahub room status [<name>] [--json]` | Allowed | room metadata only; every other `room` form, the inbox included, stays Console |
| `ahub study show [<id> \| --after <id>] [--json] [--color=...]` | Allowed | the same read as `hub_study_show`: a private campaign, task or source shows ids, counts and states only; `study draft\|revise\|approve\|approve-protocol\|close` stay Console (#930) |
| `ahub study evidence <ev-id> [--revision <n>] [--json] [--color=...]` | Allowed | re-reads one evidence link through current research scope and privacy (#931); `study evidence --task` and `study check` stay Console |

`backlog list`, `release list` and `sdlc costs|metrics` retain their existing
planner/person policy. Their CLI forms stay Console for ordinary agents; a
configured planner can use the existing planner tools without borrowing console
authority. All newly admitted reads use the ordinary tools connection and public
views, never console identity. The person's full readback stays unchanged.
Conductor operations are listed in [the operational command table](#conductor-operations-812-t2-933-900).

### Capability discovery (#445 C1)

`ahub capabilities [--json]` is Console only: an agent shell is refused, and so is the configured conductor. It lists, for each attached peer, the skills and commands the hub can read from that peer's own session, whether you share each one, its digest, and the class a call would count as. It lists and never calls anything; agents call what you share with `hub_invoke` (see below).

What the hub can read is deliberately narrow. A listing is read only from a version whose listing was probed (the [C0 receipt](verification/2026-10-30-445-capability-probes.md)): Kimi 2.3.2, Qwen 0.26.1 and Codex 0.166.0. Any other version lists nothing until a new receipt covers it, and so does a peer that is offline or whose list did not arrive. Codex's pinned 0.154.0 is not probed, so a pinned install lists nothing for now. Only skills are listed: Qwen by its `_meta.source` (`bundled-skill`, `skill-dir-command`), Kimi by the `skill:` prefix of its name, Codex by an enabled entry of `skills/list`. A builtin such as Kimi's `compact` or Qwen's `clear` changes session or host state and is never listed. A session the hub cannot read natively publishes its own list with `hub_capabilities_publish`; that list is bound to the connection that published it, forced to `invoke: prompt`, and gone when the connection ends.

Sharing is a positive allowlist in `.agenthub/config.local.json` only (`invocation` is machine-local: a committed copy is ignored and logged, and it is never editable from settings):

```json
{ "invocation": { "share": { "kimi": { "command:skill:review": { "digest": "sha256:<64 hex>", "class": "read" } } } } }
```

The key is the peer id (an instance `codex-2` never inherits `codex`'s entries). The digest is the one `ahub capabilities` prints, and covers the kind, name, input schema, declared class, source and invoke form, not the description: a change to any of those unlists the entry until you pin the new digest, and rewording the description does not. `class` is `read`, `write`, `external` or `destructive`, and the effective class is the higher of what the source declared and what you wrote. No native listing declares a class, so an entry you share with no `class` counts as `destructive`, which a later invocation refuses.

Agents see only what you shared. `hub_capabilities { peer? }` returns the shared entries (id, flat input schema, effective class, digest, source, invoke form and the target's permission mode) and nothing else; it grants no right to call anything. Descriptions are written by the peer that offers them: they are sanitized, cut at 300 characters and shown as untrusted. Neither `hub_capabilities` nor `hub_capabilities_publish` runs in a PII turn or for a peer holding a PII task, and neither call reaches memory capture.

### Invoking a shared capability (#445 C2/C3)

`hub_invoke { peer, capability, args?, task? }` asks another peer to run one capability you shared from it (see `hub_capabilities`). A `read` may run without approval. A `write` or `external` requires an open non-PII task owned or reviewed by the caller and your allow-once approval on every call; unattended refuses before prompting. One with no class counts as `destructive` and is never invoked. The approval prompt shows the screened, sanitized arguments (200 characters per value, marked when cut), capability/class/task bindings and argument digest. Argument previews are person-only; audit metadata keeps the digest. Client requests cover the supported approval window; cancelling the tool or closing its control connection withdraws pending admission and approval. A late allow on a withdrawn request is refused. An already admitted native turn is not cancelled. After admission and any required approval, the call returns `{ invocation, state: "queued" }` and the result arrives later as one message from the hub, addressed to the caller only, so a long target turn never holds the caller's turn.

What the target receives is one hub-written request that names the caller and the capability and says the arguments are not instructions. It answers as an ordinary turn under its own permissions and sandbox, and may start its reply with `[REFUSED]` and a reason to decline. The result is the target's text, sanitized (a forged hub header is quoted), cut to 8 KiB and given a hub-written first line that marks it as untrusted agent text. Nothing else is promised: a result is another model's words. The answer reaches only that one result: it is taken over before the bus builds anything from it, so no other peer, digest, log line, event, journal row or memory entry ever carries it. The full answer, including a refusal, passes the private-turn, PII-pattern, secret and private-path checks and any enabled model screen using the full answer rather than only its shortened reason, before forwarding any reason; unknown or a screen failure does not clear it, and privacy is rechecked after that await. An unsafe `[REFUSED]` answer keeps outcome `refused` and returns only `<target> declined; the reason was withheld`. An ordinary unsafe answer keeps outcome `withheld` and the existing fixed withheld text. No unsafe callee text is kept; a clean refusal retains its screened reason.

Every admission refusal happens before any envelope exists and names its reason: the PII context, nesting (a peer answering an invocation cannot start one), the target being offline, paused, held, off the roster or pull-only, the capability not shared or changed since you pinned it, a destructive class, a missing effect task or person approval, a task that is not the caller's open work or is a PII task, an argument that does not fit the capability's schema, one that the PII or secret screen does not clear, or too many open invocations (4 per caller, 8 per target). A target that is paused (by you, the conductor or the budget) is refused too; a pause that starts while the request waits leaves it waiting until its deadline. Each call counts against the caller's ordinary message rate limits to that peer. An entry you did not share and one that does not exist read the same to an agent.

`invocation.timeout_s` in `.agenthub/config.local.json` (10 to 86400 seconds, default 600) bounds the wait. A request still queued at the deadline is withdrawn and nothing runs (`expired`). One the target received with no result by then is a `timeout` for read or `needs_review` for write/external: it may still run, and a late answer changes nothing. Read may automatically replay once on a proven `failed_safe` receipt; write/external never automatically replay. An uncertain effect holds its journal delivery for your inspection. Recipient retry does not replay invocation requests. There is no caller cancel; `ahub queue` resolves a delivery by hand. Task-scoped calls keep queued and terminal ids/digests/class/approval/outcome history through Tasks, without changing task state. The `invocations` table in `hub.db` and the `invocation` event hold ids, the capability, its class, the outcome and the result's size, never an argument or a result. A hub older than this feature refuses `hub_invoke` with a message, and a restart or upgrade refuses a target without the feature while an invocation is open.

## Conducting a team from Claude Code or Codex

Start the daemon with `ahub up --no-console`, set exactly one conductor in the
project configuration, then open `ahub console` in a split terminal for approvals:

```json
{
  "roles": { "claude": ["planner", "reviewer", "conductor"] },
  "conductor": { "feed": "own" }
}
```

Launch that peer with `ahub claude` for channel pushes, or select `codex` in
`roles` and launch `ahub codex`. Only an interactive peer may conduct
(#1408, [roles](roles.md)): claude, codex, jcode and pi are `conductorEligible`.
The hub ignores a `conductor` on another kind, or on a peer whose effective
`peers.<peer>.start_mode` is `headless`, with a notice naming the fix, and gives
the role to nobody else, so the person conducts from `ahub console`. Setting the
conductor's start mode to `headless` is refused until the role moves, and
`ahub doctor`'s `roles` row names the settled holders and warns about an ignored
conductor. Its `routing classes` row warns when a rostered peer that can
implement appears in no `[classes.*].peers` list of the routing the hub loaded,
naming the file and the class lines to edit, because routing never offers that
peer work automatically (#1626 C). The conductor splits work into owned tasks,
observes `hub_status`, moves stalled work and obtains review before reporting
results and open decisions. It does not implement the tasks it handed out.
`hub_peer_start` starts a peer in the start mode a person set for it (see
"Start modes"): local and headless Kimi, Pi, Codex or Jcode start at once; for a
TUI peer the hub opens a terminal running the fixed `ahub <peer>` command,
after validating it through the shared launcher planner, and when it cannot
open one the call fails with that command for the person to run. The
conductor cannot choose the mode. `hub_peer_hold` and `hub_peer_release`
manage only holds placed by that conductor. Assignment also requires `assign`
when the conductor has an explicit capabilities list.

Check the returned owner and task state after assignment. Routing skips paused
peers, so assign work before placing a delivery hold. Hand work out through the
board and report to the person with `hub_send` addressed to `user`, or a `[FYI]`
final response in the native TUI. Broadcasting implementation instructions can
cause an otherwise unassigned owner to claim duplicate work.

The person answers approvals in the console, resolves `needs_review` deliveries
with `ahub queue resolve`, stops a headless peer with `ahub stop`, and handles
budget overrides and hub lifecycle.
The configured conductor may itself run `queue resolve`, `stop <peer>` and the
other forms in [the operational command table](#conductor-operations-812-t2-933-900);
approvals and budget overrides stay the person's. From any other agent shell these
commands are refused; the CLI retains the agent's identity even when invoked
through a shell tool.

`conductor.feed` is `own` by default, `all` for all tasks, or `off`. Ordinary
milestones share the existing digest window and collapse repeated queued
task/kind notices. They wait behind a busy conductor. An aged approval or
`needs_review` hold is important, contains only peer/tool-age or delivery id,
and directs the conductor to ask the person. A completed task set emits one
round notice until a new task joins. Removing the role or switching the feed
off withdraws pending feed notices.

For a Claude conductor, `ahub claude` also observes native session and turn
boundaries when facts injection and task-idle sweeps are off. Keep the managed
hooks enabled to measure completion and supervision usage. Your own
`--settings` (given once, a JSON object or file) keeps that observation: the
launcher adds the hub's hooks to its hooks and warns only that the status line
tee is off; one that sets `disableAllHooks` is refused. The launcher records its
private session identity in ordinary
terminals too; this does not grant terminal-recovery authority.
Ordinary Claude sessions with turn-free facts or task-idle sweeps enabled get the
same session/start observation. Other ordinary launches remain non-opt-in.

`ahub report` records conductor actions and completed native turns containing
supervision. Tokens describe the whole measured turn, which may also contain
other work; they are not a per-notice cost estimate. Missing measurements stay
unknown. Use the live smoke ledger to assess observed turns and tokens per
approved task before choosing `all`; an unmeasured run is not a cost benchmark.
Claude turn counts use authenticated native completion events. Older logical
state counts are labelled; an idle channel or approved task alone does not prove
that the native answer finished.
The Stop hook acknowledgement is not a counted completion. The daemon checks the
native transcript after the hook can return; missing or changed-session evidence
stays unknown.

## Pi with DGX and MLX

Pi is optional. Install Pi separately and set `pi.enabled` to `true` in
`.agenthub/config.json`. Set `pi.auto_start` to `true` to start it with the hub.
Pi starts in its TUI by default; `ahub pi --headless`, or the start mode
setting (`ahub settings set peers.pi.start_mode headless`), asks for the
background peer instead. The project uses its existing OmniRoute connection for DGX;
`pi.dgx_coding` and `pi.dgx_fast` select the gateway's configured model IDs.
Every Pi start (headless, TUI, console or auto start) first runs the configured
`pi.cmd` with `--version` (#847). Pi 1.4.0, 1.5.0 and 1.5.2 are verified
([1.4.0 model-free receipt](verification/2026-10-26-pi-140-compat.md), [1.5.0](verification/2026-11-03-pi-150-compat.md), [1.5.2](verification/2026-11-14-pi-152-compat.md)); another
version, or one that cannot be read, is refused before Pi starts, unless the
person trusts that exact version with `ahub agents trust pi <version>`.

`pi.max_steps` defaults to `100` managed tool-step attempts per native turn
(#1447 T3); this repository's tracked setting and the init template also use
`100`. Existing projects with explicit `pi.max_steps: 30` keep `30` until the
person edits that setting. Failed managed
calls count and the first rejected attempt is reported as `101/100`. The local
worker's `local.max_steps` default and repository setting remain `30`. This is a
source/config change; it does not restart a running Pi or change its active turn.

`pi.max_continuations` sets the number of extra turns after the initial tool-step
ceiling stop (#1447). Its default is `2`, with an integer range of `0..10`.
Each continuation asks Pi to checkpoint its completed work and next steps before
continuing. With the default, the third consecutive ceiling stop escalates the
task with `step_limit`; `0` escalates on the first ceiling stop. Model or transport
failures still use `inference_failed`. This key is config-only: set it in
`.agenthub/config.json` or override it in `.agenthub/config.local.json`, then reload
configuration and start or restart the Pi peer. It is sampled at the next Pi
start, without changing the running owner's continuation allowance or
`pi.max_steps` ceiling, and has no `ahub settings` row.

```bash
ahub models setup       # prepare bounded Qwen3.5 4B MLX in an existing Ollama service
ahub models start       # verify loopback Ollama/model readiness (no daemon spawn)
ahub models status
ahub pi --headless --backend auto
ahub say @pi "Read the project and summarize the next small implementation task"
ahub pi                # its TUI in this terminal; an idle headless session moves into it
```

The default routing template assigns implementation, bulk edits and tests to
DGX, and summaries/triage to MLX. Pi and the existing local worker take priority
before cloud peers; planning and final review stay with Claude/Codex. Existing
projects keep their routing file, so add `pi` to the relevant `peers` lists and
set `pi_backend = "dgx"` or `"mlx"` for each class. PII tasks remain local-worker
only. `--backend dgx` or `--backend mlx` explicitly pins a Pi session's backend.

Pi connects to an authenticated relay with model aliases `dgx/coding`,
`dgx/fast`, and `mlx/fast`; upstream gateway credentials stay in the hub.
Its managed tools use the existing path guards, shell sandbox and terminal
approval flow. Keep `ahub console` open to approve write/edit/shell operations:
a request nobody answers expires, and two in a row end Pi's turn.
Tool-call receipts survive daemon restart; an interrupted operation with an
unknown outcome must be reconciled before repeating it. Cancelling a Pi turn
does not automatically hand its task to a cloud peer.

For assigned, non-private work, `hub_task_spec` reads the named GitHub issues
through the hub's authenticated, bounded read path. `hub_check_start` runs an
exact Git ref's permitted tests or typecheck in the opt-in isolated container
runner (`checks.runner: "container"`, or the optional `"remote"` backend); `hub_check_result` and `hub_check_cancel`
read or cancel that owned run. Missing spec/check capability refuses the
assignment early; it never grants host commands, credentials or broader sandbox
access. Receipts distinguish exact source/tree/lockfile, platform, exit and
uncertain or cancelled outcomes. See [bounded spec and check access](security.md#bounded-task-specs-and-isolated-checks-418)
for the authorization and resource bounds.

Remote runner configuration (#793) is permitted only in the person's untracked `config.local.json`: select `checks.runner = "remote"` and supply `checks.remote.host`, `checks.remote.image` (immutable SHA-256 image reference) and `checks.remote.root` (reserved absolute metadata, unused by any current command). No remote destination belongs in tracked project files. The runner uses the person's host SSH capability (including the hub's authentication agent socket) in BatchMode, with TTY allocation, agent/X11 forwarding, configured forwardings and local SSH commands disabled, and fixed Docker argv; it never installs host tools, mounts host paths or falls back to this Mac. A failed SSH, Docker, image or hardened network-none/transfer probe marks sandboxed test capability unavailable with a generic remote-runner reason. A successful platform line names only Linux architecture and numeric Docker version.

The remote source is the recorded Git commit, streamed into a hardened non-root container. Mac dependencies are excluded. Before a check, the runner proves or prepares a Docker volume named from the commit's lockfile hash, its manifests and install configuration (`package.json`, `bunfig.toml`, `.npmrc`, `patches/`), the Bun version and architecture of the pinned image, and its digest (#793b): the first run for a new lockfile spends extra time and is the only moment a container has a network, running exactly `bun install --frozen-lockfile` into the volume. Later runs find the volume, verify it read-only offline and install nothing. The check itself never installs, has no network and mounts the volume read-only. The ten-minute run budget includes preparation, so a very large first install can time out and is simply retried. A commit whose root or workspace `package.json` declares an install lifecycle script (`preinstall`, `install`, `postinstall`, `prepublish`, `preprepare`, `prepare`, `postprepare`) is refused the same way, since such a script can read source the volume key does not cover. If the volume cannot be proven the run ends with `remote dependencies unavailable`; there is no writable shared cache and no fallback to this Mac. The newest three prepared volumes per project are kept and older ones removed after a verified run. Remote `root` is validated but unused because no host path operation is needed. The bounded [local Docker transport receipt](verification/2026-10-25-remote-docker-transport.md) records the extraction, cleanup and dependency-volume legs. Actual remote-host opt-in, SSH and pi's live check receipt remain unverified follow-up work. Existing local Apple-container behavior remains available by explicit selection.

Retention bounds inactive valid check receipts to 200 records and the newest 20
full outputs, excluding active runs. Full output is also consumed by the owner
result read or expires after 24 hours.
Malformed or unreadable receipts are a retention exception: their receipt bytes,
output and staging stay for inspection, with ID-only warnings separate from
unknown container-owner warnings. Maintenance skips them while continuing valid
retention; it never deletes an unknown container. See the security contract for
the same-user parent-swap cleanup limitation. These source guarantees do not
establish the separate native macOS acceptance leg.

The `mlx/fast` alias now defaults to an externally managed Ollama MLX backend.
Install and start Ollama separately, with `OLLAMA_NO_CLOUD=1`,
`OLLAMA_NUM_PARALLEL=1`, `OLLAMA_MAX_LOADED_MODELS=1`, and a finite
`OLLAMA_KEEP_ALIVE` (five minutes is the tested setting). `models setup`
prepares `agenthub-fast-mlx:4b-8k` from `qwen3.5:4b-mlx`, with an 8K total
context and a 2K output cap. The relay budgets input separately at 6,000
estimated tokens and serializes local requests across project hubs.

`models status` distinguishes model availability from memory residency.
`models stop` refuses to unload an externally managed Ollama model: other
clients may be using it. Ollama owns idle eviction; stopping a hub never
kills Ollama. The OpenAI compatibility endpoint does not enforce a request
`keep_alive` field, so configure the server and verify its expiry readback.
The relay can fall back to DGX before streaming starts as before. See the
[Ollama migration procedure](#ollama-mlx-migration-issue-51)
for existing Python runtime/configuration cleanup and rollback.

A project has one managed Pi session owner. Mode changes require the agent to
settle and preserve the session file. Before the first generation, a live source
verified to be empty can instead retain its exact session ID without a file.
Missing history from a nonempty session blocks handover. Protocol 9 adds Pi
recovery metadata. Protocol 10, released in 0.7.0, adds durable delivery
receipts and conservative queue recovery; it is verified live (see the
[smoke checklist](smoke.md)).
Older protocol hubs still require their matching CLI and an attended bootstrap.

## Local dashboard

With a running daemon, `ahub ui` opens a local dashboard for messages, peer states
and queues, the task board, budget windows, pending approvals and this machine's
benchmark runs. Use `ahub ui --no-open` to print a single-use link when the
browser cannot be opened.
Open the link within 60 seconds; the browser session lasts one hour.

The dashboard can send console messages, propose and assign tasks, pause or resume
peers, answer approvals, start a peer in its start mode and show the settings.
An ordinary session changes the safe switches and lowers a mode to `ask`; the
rest needs `ahub ui --settings` or `ahub settings` in a terminal. See
[Settings](#settings-from-the-dashboard-and-the-terminal) and
[Start modes](#start-modes-tui-by-default-headless-as-opt-in).
Budget pauses still require the terminal override.
Private envelopes and PII tasks stay redacted. Local-worker and Pi tool details and
allow decisions stay in `ahub tail` / `ahub permit`; the page can deny them.
No dashboard port is opened until requested. See [the session security model](security.md#local-dashboard-sessions-issue-6).

### Cross-hub read invocations (#446 X6)

Both persons consent by pinning. On the target hub, use the existing `ahub capabilities` to obtain the local capability id and digest and pin its effective class to `read`. Transfer that digest out of band. On the source hub, add an exact remote entry in its machine-local file:

```json
{ "invocation": { "share": { "kimi@beta": { "command:review": { "digest": "sha256:<64 hex>", "class": "read" } } } } }
```

The target independently retains its own local `kimi` entry for the same capability/digest/read class. Room peer exposure alone grants no invocation. There is no inheritance between labels/peers, and no remote discovery RPC. `hub_capabilities` lists local observed manifests; callers obtain remote capability ids/schema information manually.

`hub_invoke` can name the exact `peer@label`. The source validates bounded flat scalar arguments; the target applies its actual schema, current share/digest/effective-read class and privacy/availability gates before building a native request. Source task scope remains local and is not interpreted on the target. Task/approval refs and write/external/destructive requests never cross.

A signed room admission receipt is not a capability result. Native execution outcome and result transport state are recorded separately. Result correlation binds room/member/epoch/request/peer/digest, and duplicate or mismatched frames cannot trigger another native invocation. Nested invocation turns refuse depth 2, including before native acceptance is reported. Unknown handoff, receipt, result deadline or restart publication is `needs_review` under the existing journal hold and never silently replays. Inspect the retained invocation and room queue before explicit person disposition.

Remote-origin host envelopes retain the existing remote-turn memory/capture/history/telemetry exclusions even though the local native request is hub-authored. Live native account and two-Mac X7 receipts remain separate from the two-daemon broker/crypto fixtures.

### Dashboard design tokens (#469 R1)

The page's style block starts with one token block that owns every colour, the 4px spacing scale (4, 8, 12, 16, 24, 32), the
type scale (12, 13, 14, 16, 20) and the radius rule: 6px for controls, 10px for surfaces (panels, cards, the dialog), full
radius for chips and avatars. Neutrals are one cool family with three surface levels (page, panel, raised) and one accent for
primary actions, focus and selection; the state colours keep their meaning. The dark values are written twice, once for
`data-theme="dark"` and once for the system preference, and a test keeps the two identical. Two shadows exist for raised
elements only (`--shadow-2` is the dialog's; `--shadow-1` waits for the board cards in R3). Each peer colour has a light and a
dark variant of one hue, generated from the registry's colour by `peerPaletteThemeCss` (`src/ui/peer-palette.ts`) so it clears
3:1 on every surface. System fonts only. The layout, the views, the keys and the behaviour are unchanged by R1; the contrast
test (`test/office-view.test.ts`) covers the text pairs, the accent, the dots, disabled controls and every peer colour in both
themes. The Office scene keeps its own rules until R5.

### Dashboard app shell and keys (#469 R2)

From 1024px up, a sticky top bar holds the project context, the connection status (a coloured dot and its text, green when live
and red when disconnected or closed), the attention badge, the theme switch and a shortcuts button; the eight views sit in a
left sidebar with an icon and a label, and the approval count still rides on Agents. Below 1024px the same nav is one row of
tabs that scrolls sideways inside itself, so the page never scrolls sideways. The view names, their order, the
`agent-hub-view` cookie and every id are unchanged; Roadmap is the eighth view, added by R5 (#1483).

Keys: `1` to `8` switch to Board, Office, Stream, Agents, Message, Memory, Settings and Roadmap, `?` opens the key list, and `Esc` closes
the key list or the task detail (both are native dialogs). View keys are ignored while you type in an input, a textarea or a
select, with Ctrl, Alt or Cmd held, and while a dialog is open. Icons come from one inline SVG sprite of nine Tabler icons;
the MIT notice is in `THIRD_PARTY_NOTICES.md`. Nothing is fetched and no package is added.

### Dashboard board, side sheets and the Plan sheet (#469 R3)

A board card shows the title (two lines at most), the owner as a round avatar in the peer colour with its initial, one badge that
holds the state and the priority ("in review P1") and the release when there is one. Everything else moved to the task detail,
which keeps the same dialog and opens as a sheet pinned to the right edge (full screen below 600px). The detail groups its
lines into Status, People, Dates and Links, and leaves out a group with nothing in it. Pull, Assign, the Ready and Waiting
subheads, "Show N older" and drag and drop are unchanged.

The five board forms (plan a task, split a backlog task, releases, delivery evidence, propose a task) are in a Plan sheet, opened by
the Plan button in the board toolbar. It is a native dialog, so `Esc` closes it, and view keys do nothing while it is open. The
fields, ids and actions are the ones the forms had. The sheets slide in on `transform` and `opacity` and not at all when the
system asks for reduced motion.

### Dashboard Agents, Stream, Memory, Settings, Message and the Office colours (#469 R4, R5)

Agents: a peer is one row with its name and state, a summary line (queued messages and "Working on #n" or "No active task") and a
single "Details" fold that holds the diagnostic lines it used to list. A status notice stays visible outside the fold. Approvals
stay first. Stream: one aligned row per event (time, kind, sender, body in monospace); the filter chips and Follow latest sit in
the section head, above the scrolling list. Memory: result rows show title, kind and age, the selected row is marked with an accent
edge, and the graph and the detail pane use the colour tokens. Settings: each group is a section with a short header, a key that waits
for a restart carries a "restart pending" badge, and "Pending restart" shows a count; the text lines, Preview, Save and Undo are as
they were. A Structure group edits structural configuration in a settings session (#689, see Structural configuration below). Message uses the shared form styles.

Icons replace the symbol glyphs: the star mark, the stream arrow and the Office "checking" mark are sprite icons (twelve Tabler icons
in all), and the Office draws each condition (idle, busy, offline, paused, waiting on approval) as a shape (ring, disc, cross, bars, raised hand)
next to its words. Condition names are unchanged. The Office scene names its colours only through the same tokens as the rest of the page, and the
contrast test checks every token an Office rule uses, in both themes.

### Dashboard keyed rendering, motion and states (#469 R6)

The page still polls `/snapshot` once a second and still skips a redraw when a container's JSON did not change. What changed is how
a changed container is redrawn: task cards, peer rows and memory rows are kept per id. A card, row or memory entry whose own data
did not change keeps its DOM node, so hover, an open "Details" fold and a focused card survive a poll that changed something
else. One that changed is replaced by a fresh node, and if it held focus the focus moves to the replacement. A card that moves to
another column fades in; one that disappears is simply removed.

Motion moves `transform` and `opacity` only, 120 to 200 ms, ease-out: button press, a short fade when you switch views, a card
arriving in a column, the toast, and the side sheets. The Office keeps its own motion. Nothing new loops. With the system setting
"reduce motion" every transition and animation in the page is off.

States: until the first snapshot arrives, after a project switch too, the board and the peer list show grey blocks shaped like them. Each empty view says what
fills it and the command that does it (`ahub task propose`, `ahub claude` or `ahub codex`, `ahub say`, `ahub permit`, `ahub
remember`, `ahub goal new`). When a poll fails the connection status turns red, the content dims to 60 percent but stays readable,
and a line at the top gives the time of the last snapshot and says polling continues. Notices are a stack of up to four toasts in
the bottom corner (`aria-live="polite"`): a success fades after 4 seconds (and stays under reduce motion), an error stays until
you press Dismiss.

## Multiple projects and worktrees

Version 0.4.0 adds one independent hub per repository or Git worktree.
Subdirectory commands resolve to that project; symlink aliases resolve to the same
hub. Explicit selection works from any directory:

```bash
ahub --project /path/to/project-a init
ahub --project /path/to/project-b init
ahub --project /path/to/project-a up
ahub --project /path/to/project-b up
ahub projects
ahub status --all
ahub --project /path/to/project-a codex
ahub ui --all
```

The unified dashboard lists registered roots and opens their boards, streams,
messages, approvals and budgets. It can start hubs and stop a selected hub after
confirmation. Its Start control opens a peer's TUI only through a terminal provider
(`terminal.open` or Orca); without one, launch Claude/Codex TUIs from a terminal. The manager stays available
when a project stops; `ahub ui --all --stop` stops only the manager. Existing
`ahub ui` still opens the current project's dashboard.

`ahub projects --json` returns machine-readable live status. Use a listed ID or a
path with `--project`; the selector must precede the command. `ahub projects remove
<id>` forgets a stopped registration without deleting project data. A moved root
gets a new registration. Missing roots remain visible until removed.

Runtime state stays in each project's `.agenthub/state/`. The machine registry is
`~/.agenthub/registry.db`; existing `ports.json` allocations are imported once.
`AGENTHUB_HOME` selects an isolated machine registry (also used by tests). An
inherited state directory from a different project cannot redirect a new CLI
invocation. Explicit custom state requires a matching project marker or the
initialization pair `AGENTHUB_PROJECT_DIR` / `AGENTHUB_STATE_DIR`.

Manager-started hubs use attended mode and project configuration, including
credential-file references. They do not inherit the launching project's gateway
URL/key overrides. Native memory is shared by memory project key: the project's
normalized `origin` remote (without one, its git chain and main working root),
mapped through the person's `amem alias` log, so a worktree or subdirectory uses
its main checkout's key. The manager's shared-alias notice compares project-name
chains instead (superprojects down to the repository, `<parent>/<worktree>` for a
worktree). Neither means that task boards or agent sessions are shared. Provider quota readings
may describe the same account and should not be added across projects.

Before upgrading an older hub, inspect the plan with the matching CLI.
Incompatible or unverified processes are shown explicitly and are never killed by
PID-name matching. See the operations guide and the
[multi-project specification](specs/2026-09-19-multi-project-design.md).

## acon console plugin (#935, #1012)

`ahub setup` registers agent-hub as a plugin of the family console
([agent-console](https://github.com/STAIxBWLB/agent-console), `acon ui`). It writes
`$AGENTHUB_HOME/console/plugins/ahub.json` (default `~/.agenthub/console/plugins/ahub.json`;
the directory 0700, the file 0600, replaced atomically) naming the installed module
`@staix/agent-hub/ui-plugin` and its sha256, and prints `acon plugin registered`, `acon plugin
up to date` or why it was not registered. acon reads the file at its next start and marks the
plugin stale when the module changed after setup, so run `ahub setup` again after each upgrade.

- **Panels.** The plugin's panels are the dashboard's eight views, and the panel is the `ahub ui`
  page itself, following acon's theme. It reaches project hubs only through the manager's own
  listing and forwarding (`ahub ui --all`): registered project and instance ids, the manager's
  closed action list and the eight view names. There is no new protocol. An answer, a result
  receipt or a review comment sent from acon goes through a manager port of its own (`answer`,
  `receipt`, `consoleControl`) that needs acon's verified person `meta`.
- **Inbox.** acon's inbox lists each running project's pending approvals (Allow once / Deny,
  answered with the hub's own `permit` and an option the request offers), open questions and unread
  results (see the Questions and Results sections), the settled-worktree alert and in-review
  tasks whose reviewer is you (Open board). A local-worker or Pi approval stays deny-only there, as on the
  dashboard: answer it with `ahub permit` after `ahub tail`. A reply holds at most 50 items, most
  urgent first (decisions, reviews, results, candidates, then alerts), and counts the rest (#1196).
  Running projects are asked at once, each within about 2 s; a project that misses that keeps the
  items it last returned unless an action has happened since. A poll within 1 s reuses the last
  reply, one within 10 s gets it at once while a refresh runs, and any action drops it.
- **Confirmation.** `stop`, `permit`, `send`, the settings writes (`setting`, `setting_undo`,
  `setting_reload`, `config_edit_apply`), `start_peer`, `backlog_split` and the inbox's Allow once
  and Deny answer `needsConfirm` with a preview first; acon runs them after you confirm.
  Previews and the other dashboard actions run directly, as on the page.
- **Space.** The plugin feeds acon's Space view from the dashboard's office model
  (`src/ui/office-space.ts`): peers are actors (state from condition, approvals and review, with
  approval, queue, paused and mode marks), the office rooms are queue, work, review and done zones,
  tasks are cards, and overlap, conflict and cohort links and recent message arcs are links. Each
  project is one Space group (#1375) that every actor, zone and card names, so actor names stay
  bare; an actor carries its configured roles and, only while working, `since` (the open turn's
  start). Ids are project-prefixed, every running project's scene is merged within acon 0.2's caps
  (96 actors, 200 groups, 200 cards, 128 links, newest links kept; a record whose group is past the
  group bound loses its group reference), and a project that has not answered within about 3 s is left
  out of that poll (its last scene is kept as the baseline for its next answer). The running-project
  listing is reused for 10 s and then refreshed in the background, concurrent reads share one
  computation, and a viewer that passes back the combined cursor gets `changed: false` while the
  scene, the per-project cursors and the project set are unchanged (#1380). The manifest
  declares how stale a reused reply may be: `inboxMaxAgeMs` 1000 and `spaceMaxAgeMs` 2000 (one
  poll interval). Only labels and states
  reach the scene, never message bodies, task details,
  approval titles or reasons; a PII task's card shows the `[pii]` stub.

The companions read ahub only through the companion CLI contract,
`docs/contracts/companion-cli-v1.json` (#1387): the commands, the `status` and `projects` paths with
their types and presence rules, the no-hub exit and the `shellQuote` vectors. Adding a field changes
nothing. Removing or renaming a listed path, changing a closed set, an argv form, the exit code or
the stderr prefix needs `companion-cli-v2.json` beside v1 and a `hub_task_handoff` to each companion
repository. `test/companion-contract.test.ts` holds ahub to the file.

## Install and start

Use Bun <!-- facts:bun-floor -->1.4.4<!-- /facts:bun-floor --> or newer. Source checks and CI use the version pinned in
`.bun-version` (currently <!-- facts:bun-pinned -->1.4.4<!-- /facts:bun-pinned -->). Install the released package and install its Claude
channel plugin:

```bash
bun add -g @staix/agent-hub
ahub setup
cd <project>
ahub init
ahub up
```

`ahub init` writes the project configuration and managed instruction blocks.
Run it after an upgrade when those blocks need refreshing: `ahub doctor` has a
`hub instructions` row that warns when the block in `AGENTS.md` differs from the
one this version writes, and prints the preview (`ahub init --dry-run`) and
apply (`ahub init --yes`) commands with the project path. Init replaces only the
text between the markers; commit `AGENTS.md` afterwards (#1399). For a new repository
using advise or enforce, follow the [SDLC quickstart sequence](quickstart.md#a-new-project-with-sdlc-advise-or-enforce).

After a successful init, the short next-steps block says to review and commit
`AGENTS.md`, `.agenthub/config.json` and the other shared init changes, keeping
`config.local.json` untracked, then start with `ahub up` or `ahub claude` so hub
pushes reach the session. In SDLC `advise` or `enforce`, it names the person's
spec acceptance (`ahub sdlc accept <task> --issue <n>`), plan-departure consent
when needed (`ahub sdlc accept-departure <task> <head> <reason...>`) and guarded
merge (`ahub sdlc merge <task>`) after the owner calls `hub_task_done` on an open
PR, reviewer approval and green exact-head CI. In those modes, when the project has a GSD
`.planning/STATE.md` (a `gsd_state_version` in its frontmatter), it also points
at [moving from GSD](sdlc.md#moving-from-gsd) (#1431); init only reads that
file and never changes `.planning/`. Preview, declined prompt and
refusal paths print no success next steps.

Whether the repository commits its shared hub config is a choice made at init
(#1411, amended by #1496). `--track-config` keeps `.agenthub/config.json`,
`routing.toml` and `sdlc.toml` visible to git and lists them to commit. For a
project at the Git repository root, init handles outside rules
(`core.excludesFile` or `.git/info/exclude`) and earlier root `.gitignore`
rules by appending a managed project `.gitignore`
block: `!/.agenthub/`, `/.agenthub/*`, then `!/.agenthub/<name>` for each shared
file to track. This also ignores other `.agenthub/` entries; teams sharing
project packs, `.agenthub/ignore` or other files add their own `!` lines after
the block. Projects below the repository root retain the earlier behavior:
track-config succeeds when shared files are visible, and an ignoring rule is
named with manual re-include guidance rather than changing that project.
Dry-run and confirmation show those lines; apply names the rule
class and project re-inclusion, and a second run changes nothing. Before project
writes, Git verifies the planned rules in a disposable private temporary directory
containing only the root and existing `.agenthub/.gitignore` text, using the real
repository Git directory read-only. The scratch directory is removed on success
or failure. Shared files must be visible and runtime state and local config must
stay ignored. A project rule that still wins (such as a nested
`.agenthub/.gitignore` rule) refuses with its location and the next step, without
project writes. User-level configuration, excludes files and the index are never
changed. A `routing.toml` whose `hub_routes` set `adec_endpoint` stays ignored and
is reported, because that endpoint is this machine's and `routing.local.toml` can
hold only class keys. Machine-local values in `config.json` are listed with the
move to `config.local.json` before the first commit. `--no-track-config` ignores
the three files, removes only the managed re-include block init wrote, verifies
the result, and each checkout holds its own roles. The AGENTS.md block's role
sentence follows the choice: tracked, it points at `.agenthub/config.json`
`roles`; untracked, it says the checkout's hub holds the roles. A new project is
asked at the prompt; with neither flag an existing project keeps its ignore state
and its block sentence. Outside the managed re-include block, init avoids redundant ignore lines for
paths a broader rule already ignores.

`ahub roles [--json]` prints each rostered peer's flow roles as the running hub
settled them (defaults, overrides and ceilings applied), the planner with how it
was chosen, and who reviews when no reviewer can run: the person when
`review.pool` is set, otherwise a planner other than the task's owner (another
family first, or only another family under `review.same_family = "never"`), else
the person. A task worktree has no `.agenthub` of its own and no hub; this
read-only command then reads the main worktree's hub, so an agent in a worktree
gets the same answer as the project root (#1411 T2). `ahub doctor`'s
`shared config` row compares whether `.agenthub/config.json` is committed with the
block's role sentence: `tracked` and `untracked (by choice)` pass; a block that
points at an uncommitted or ignored file, a committed file the block calls per
checkout, or a committed file an ignore rule matches is a warning that names the
rule and the command that fixes it.

`config.local.json` wins over `config.json` key by key, so each person keeps their
own settings in a tracked project; `roles` merges per peer. The exceptions are
deliberate: `release` is read only from the committed `config.json`;
`action_policy`, `rooms` and `research.runners` only from `config.local.json`; and
the machine-local fields below are ignored in a committed `config.json`.

`ahub up` waits for authenticated readiness. After 12 seconds, a verified live
child that is still pending produces a `still starting, pid N` message on stderr;
the CLI keeps waiting and confirms the retained runtime when it becomes ready.
At 120 seconds it reports unconfirmed readiness and exits unsuccessfully, leaving
the daemon running. Run `ahub status` and inspect `hub.log` before another start.
An owned child observed to exit before readiness produces an error; a cancelled
operation cannot confirm startup.

Each completed daemon startup writes one `startup timings ms:` line to `hub.log`,
with fixed phase names and durations; the span before `task_runtime` carries
the sub-phases `task_checks`, `task_ports`, `task_board` and `task_recovery`
(#1445), and its board reads cover open tasks only. The work after readiness is split into one boundary per step (`post_ready_handoff`, `_queue`, `_watch`, `_reconcile`, `_goals`, `_leases`, `_crash`, `_pi`, `_drift`, #1591), so a slow start names the step that held control replies. `task_checks` no longer waits for the first check-runner probe (about 8 s over ssh to a remote runner): startup waits for it at most 500 ms, `ahub status` reports the runner as unavailable with `runner probe in progress` until it settles, and `check_run` joins the same single probe. The three event-seed consumers share one
lossless streaming pass; abandoned snapshot bodies are not read for startup.
The [startup receipt](verification/2026-11-07-daemon-startup-1232.md) separates
seed I/O from bounded usage-rollup I/O and records the isolated measurements.

Settings flags (#1100) set the main project settings without a file edit.
`--agents <a,b,...|none>` (`start.agents`) and `--autonomy inherit|off` (whether a
new project inherits the machine autonomy preset), plus `--research`/`--no-research`
(`research.enabled`), go to the untracked `config.local.json`. `--sdlc off|advise|enforce` sets `mode` in `sdlc.toml` (`off`
writes no file on a new project); advise or enforce also proposes `required_checks`,
discovered from the repository's CI or literal workflow job names, and
`--required-checks <a,b,...>` replaces discovery. Enforce with no known names refuses
before any write ([required checks](sdlc.md#required-checks-at-initialization)). `--coordination advisory|turn-free`,
`--memory`/`--no-memory`, `--snapshots`/`--no-snapshots` and `--pi`/`--no-pi` set
their keys in `config.json`. On an existing project only a flag you give changes
anything: `--dry-run` shows each change as `old -> new` (`--dry-run --json` adds a
`settings` array), and a value equal to the current one is a no-op. An invalid
value, or a flag given twice with different values, is refused with the allowed
values, and nothing is written. Executables, secrets, models, providers, instances
and permissions have no flags; they stay file edits.

Who conducts, plans and reviews is chosen with three independent flags (#1408 T2):
`--conductor <peer>|none`, `--planner <a,b,...>` and `--reviewer <a,b,...>|person`. Each
is written to the shared `.agenthub/config.json` `roles` as an explicit list for every
peer whose roles change, including the peer that loses a role (the per-peer merge would
otherwise keep its default); implementer and verifier entries, and every other file, stay
as they are. An existing project is changed only by a flag you give, and a flag whose
choice already holds writes nothing. A peer that cannot hold the role is refused before
any write, with the reason, the fix and the eligible peers: a conductor needs an
interactive session (`conductorEligible` and a non-headless start mode, read the same way
the loader and `ahub doctor` read them, so `config.local.json` wins over the shared
file), a planner needs a planner-eligible kind, a reviewer a kind that can receive
`hub_review`. `--conductor none` leaves the person conducting from `ahub console`;
`--reviewer person` writes no reviewer peer, and the init summary says reviews go to the
person. Moving the conductor writes both peers in one change, so the single-holder rule
is not tripped. A `planner` setting, or a `config.local.json` `roles` entry for a peer
the choice would change, would outrank the write, so init refuses it and names the key.
`--dry-run` shows each changed peer as a `roles.<peer>` row. The guided prompt asks the
three after the agents question, offering only eligible peers with installed agents first
(Enter keeps the shipped holders).

A person at a terminal who runs `ahub init` on a new project with no flag that
sets anything and no `--yes` is asked each setting in turn (#1065 T2): profile,
the agents `ahub up` starts, design specs and their review mode, SDLC mode (with
advise or enforce, the discovered required checks to confirm or edit),
coordination, shared memory, research records, snapshots, the Pi peer, the machine autonomy
preset, the release guard, and shadow history (asked in a folder with no Git
work tree, and kept for an existing shadow repository, never in a Git
repository). Each question is one line, the label, the choices and the default in
brackets. Enter keeps the default and sets nothing; an answer is an explicit
choice, exactly as the equivalent flag is, so the files written are the files
the same flags write. A wrong answer asks again and is never guessed, and three
wrong answers refuse the prompt. The plan follows, in the words `--dry-run`
prints (including the machine autonomy preset a new project inherits, unless
the answer was `off`), and `Write this? [y/N]` decides: N, an empty answer, Ctrl-C and Ctrl-D
write nothing. Only the console role at a terminal (stdin and stdout) is asked:
an agent identity is refused before `init` runs, a `--live-test` delegation, a
pipe and `--dry-run` are never asked, and `--yes` takes the defaults. A flag of
any kind (`--agents`, `--coordination`, `--profile`, `--shadow` and the rest)
means the person has chosen, so nothing is asked and the flags apply alone. An
existing project is never asked. The questions are built from the init settings
table (`INIT_SETTINGS`), so a setting added there is asked without another
change, and `test/init-prompt.test.ts` fails when the two disagree. The default
in each bracket is read from where the writer gets it (`templates/config.json`,
the loader's own defaults, or the trusted setup research choice), and that test reads every one back through the
loaders after a flagless `ahub init`, so a changed default cannot leave the
prompt showing one value while Enter writes another. `--dry-run` and the
prompt's plan take the machine-autonomy row from the same helper
(`autonomyInheritanceChange`). `ahub setup`
installs or updates the Claude plugin and a project-neutral PreToolUse hook in each
Claude configuration home in use (see "Machine autonomy and Claude homes"), and
registers the acon console plugin (see "acon console plugin"). Keep `ahub console` open when a local worker
may request an approval.

`.agenthub/config.json` can be committed and shared. The fields that choose
what the hub runs, which files it sends as credentials, where task text goes,
how far the local worker's sandbox reaches, or how often a peer asks before it
acts (`kimi_cmd`, `permission_modes`, `codex_bin`,
`pi.cmd`, `checks`, `mlx.bin`, `mlx.runtimeDir`, `mlx.modelPath`, `omniroute.urls`,
`omniroute.access_hosts`, the `omniroute` key files, `memory.worker_url` (still
accepted, ignored since 0.16.0),
`local.read_allow`, `local.bash_network`, `local.network_allow`) are machine-local:
they apply only from a file git confirms nobody committed. Put them in
`.agenthub/config.local.json` (`ahub init` adds it to `.gitignore`), which is
read after `config.json`; outside a git repository they keep their defaults, and
an empty value always means the default.

The local worker's commands run under a sandbox that starts from deny default
(0.10): they may run and read the system, toolchain and project directories and
the selected Xcode or Command Line Tools dir (`xcode-select -p`; for an Xcode
app, its whole `Contents`, whose `SharedFrameworks` its tools load), write the
project and a temp dir of their own (`TMPDIR`, made for each command and
removed when it ends; one left by a hub crash, named `ahub-cmd-*`, goes with
the OS temp cleanup), and nothing else; the shared temp dirs are closed. Bun's
and npm's package caches default to that temp dir (`BUN_INSTALL_CACHE_DIR`,
`NPM_CONFIG_CACHE`) unless the command's environment already names them (#1549).

Some names stay closed to those commands, and to Pi's, wherever they may
otherwise write: anything named `.git` at any depth, the `config` and `hooks`
directly under a `.git`, `commondir` below it, and `.agenthub` anywhere in the
project, plus `config.worktree` beside each such `config`. A submodule's git
directory gets the same `config` and `hooks` refusal under every `modules/`
tree the project can reach: the common dir's, the worktree's own and every
linked worktree's (#281, task 518). Nothing else may be written under such a tree
outside a discovered submodule git dir (#865). A command can therefore not
create, rename or remove a `.git`: `git init`, `git clone` and
`git worktree add` do not run inside the sandbox, and neither do
`git worktree remove`, `git worktree prune` of a stale record,
`git submodule update --init`, `git clean -ffd` over a nested repository or
`rm -rf` of a directory that holds a `.git`. The shared object store takes
only new loose objects (#864): `objects/info` (alternates, commit-graph) and
`objects/pack` are closed and an existing object cannot be changed, removed or
replaced, so `git gc`, `repack`, `fetch` and `maintenance` do not run inside
the sandbox either. `git add`, `commit`, `stash` and `checkout` work, and
`.gitignore` and `.github/` stay writable; a commit that your git configuration
signs with a key under `~/.ssh` or `~/.gnupg` fails, because the sandbox cannot
read those directories. Run a refused command yourself, in a terminal.

A task can declare what it needs (#1081): `hub_task_propose {needs_network: true}` or `{needs_worktree: true}`, and
`ahub task propose --needs-network` or `--needs-worktree`. Only an explicit `true` sets either, and the hub never
infers a need from the title. A declared need keeps the task away from a peer that cannot meet it: automatic
routing, a reservation, `ahub task assign` and `hub_task_accept` all refuse it before any write, and
`ahub route explain <id>` prints the cause for that peer. It is offered to a peer that can meet the need.

- `needs_network` is for work that fetches from a package registry, runs `git fetch` or `git push`, or calls an API.
  A hub-sandboxed peer (Pi, the local worker) has none while `local.bash_network` is off: `no network: local.bash_network
  is off ...`.
- `needs_worktree` is for work that must run in its own git worktree on a task branch (the repository rule). A
  hub-sandboxed peer cannot run `git worktree add`, because it writes under the git common directory and runs outside
  the sandbox by design (#270), so since #1115 the hub makes the worktree for it at `.worktrees/<peer>-<task>` on the
  branch `task/<task>-<peer>`, before the accept write. The peer edits files there and does not run git; at
  `hub_task_done` the hub stages, commits and pushes the branch. The capability is true only where the hub can make
  the worktree. Otherwise it is false and the refusal says why and what to do: `no worktree: the hub cannot make a task
  worktree for it: the project is not a git repository; run git init there, ...`. A refused accept creates nothing,
  so no empty branch ref is left behind (the Pi accepts of #621 and #565 left two). Declining or cancelling removes
  the worktree and its empty branch; one with uncommitted changes is kept and reported. The sandbox profile is not
  changed (docs/security.md, "Hub-made task worktree").

A peer whose capability the hub cannot tell is never refused on this ground. Work that declares no need is routed as
before, with one exception (#1129): write-class work (`implement`, `bulk_edit`) is treated as needing a worktree
whether or not it is flagged, because a hub-sandboxed owner cannot commit (#1123) and the hub commits in its worktree.
Such work is never offered to a hub-sandboxed peer on a project where the hub cannot make a worktree, and
`ahub route explain` says `no worktree` and the cause; `test`, `summarize`, `triage`, `review` and `plan` get none,
and neither does a PII task. The other flags are a person's or a planner's statement about the work, so an unflagged
task can still reach a peer that cannot meet them.

Network is off unless `local.bash_network` says otherwise. With `true` it goes
only through the hub's egress proxy on a loopback port (0.11): commands get
`HTTPS_PROXY` and the other proxy variables, the proxy opens HTTPS (`CONNECT`,
port 443 unless an entry names one) to the hosts in `local.network_allow`, and
the profile denies every other connection, direct egress and other loopback
ports (claude-mem's, the Codex app-server's) included. A listed name also
covers its subdomains; a name that resolves to a loopback or private address is
refused, and so is plain HTTP. Behind NAT64 with the well-known prefix
`64:ff9b::/96`, the IPv4 address inside the answer is what counts; the local-use
prefix `64:ff9b:1::/48` is refused outright, so on a network whose DNS64 uses it
an IPv4-only host such as github.com is refused too; use `"direct"` there (it is
removed in 0.13.0). A network-specific NAT64 prefix is not recognised. Every
refusal is a `network: refused` line in `hub.log`, by host where one is known
(with the method for plain HTTP, and the error code when a listed host is
unreachable), never a path, query or header. The default list holds the npm, PyPI, crates.io and Go module
registries and GitHub's code hosts; set `local.network_allow` in
`config.local.json` to replace it. `"direct"` keeps the open network of 0.10 and
earlier until 0.13.0, which removes it; while it is set, `hub.log` and `ahub
doctor` say so. With network on, commands may also read the public CA
bundles and Python's `certifi/cacert.pem`, which the `*.pem` key deny would
otherwise hide.
The allow-default profile of 0.9 and earlier was removed in 0.12.0: a
`local.sandbox` setting is ignored (`"allow-default"` with a note in `hub.log`
and `ahub doctor`), and a toolchain the profile lacks goes in `local.read_allow`. Newly closed outside home: `/Applications`
(an app's bundled CLI), `/nix`, `/Volumes` and `/Users/Shared`. A toolchain
there, or elsewhere in your home (a CI tool cache, a version manager the profile
does not list), needs its directory in `local.read_allow`, for example
`"/nix"` or `"~/.pixi"`.

`capabilities` in `.agenthub/config.json` narrows what a peer may do with the
hub's tools: list a peer and it keeps only the capabilities named, from
`propose` (`hub_task_propose`), `assign` (proposing with another peer as owner),
`remember` (the `hub_remember` tool; the notes the hub itself keeps of done
summaries and review verdicts are not gated), `memory_correct` (propose a local correction candidate for person review), `memory_read`
(`hub_memory_search`, `hub_memory_show`, `hub_memory_graph`) and `important`
(`[IMPORTANT]` messages). For example `"capabilities": { "local": ["propose", "remember"] }`.
A peer that is not listed keeps all of them, a listed peer whose value is not a
list gets none, and an unknown capability name grants nothing; `hub.log` says
so for each, and logs every refusal (`capabilities:`). A refused tool call says
which capability is missing; an `[IMPORTANT]` turn answer without the
capability goes out as status, with a note to the sender.
Approvals are never a capability: only the console (and the dashboard) answers a
permission request.
A committed value is ignored with a line in `hub.log`, a note from `ahub
codex` and `ahub models`, and a row in `ahub doctor`.

Managed launchers attach native peers to the project daemon:

```bash
ahub claude
ahub codex
ahub kimi
ahub pi                 # its TUI; --headless for the background peer
ahub local
ahub local --model <served-model-id>
```

Start only the peers configured for the project. A launcher records and checks
its project and session identity; do not start a second terminal by guessing
from a process name. For multiple projects, use the explicit selector before
the command, for example `ahub --project /path/to/project codex`.

An attached local worker switches to an explicit `--model` or `--route` when idle.
A busy worker refuses with `local is busy; retry when it is idle`. With no selection
flag the command reports that it is already attached. Before attaching or replacing
it, the hub reads the authenticated model inventory and makes a one-token availability
call to the selected models (route targets and its fallback included). A failed check
keeps the existing worker; `ahub doctor` flags a fixed model absent from the inventory.
Controlled recovery may restore a manually paused local worker without a reachable
gateway, preserving its queued work. Its manual resume validates the restored model
choice before releasing that pause.

Three consecutive deliveries that exhaust retries mark a peer as failing. Automatic
assignment skips it until a delivery completes; inspect `ahub route explain` for the
reason. A task owned by a peer whose task delivery exhausts retries is escalated with
that delivery's error, and the console is notified.

A delivery in `needs_review` holds automatic later deliveries to that peer; an explicit `hub_inbox` read may read new queued work behind it without releasing or replaying the hold (#1079). The console announces
the hold once, and status, task assignment and route explanations name its delivery id.
Inspect it with `ahub queue show <id>` and explicitly choose `completed`, `retry` or
`discard` through `ahub queue resolve`. Reassignment or approval of its task never
resolves an uncertain delivery automatically. The same rule holds on every path that
assigns a task (#297): once the move is saved on the board, a failed delivery prints
exactly one console notice ("the move is saved... delivery is not confirmed"), printed
where the error is thrown, and the caller (a peer in its turn, or the CLI) still gets
its error. Two exceptions, by construction: a move superseded while the assignment was being prepared, meaning a later history entry that moves or settles the task (another assignment, an unassign, the owner's accept, done, approval, close; the hub's quiet bookkeeping such as a late check result or a reviewer change does not supersede), returns the current task without a failed tool call and with no notice naming either owner; and a claim is its own hand-over, so its
accepted write and line stay outside the delivery rule (its overlap and routing announcements to earlier
owners are deliveries and share it). The repair is always
to look for a queued or needs_review delivery with
`ahub queue list --peer <owner>` (then `ahub queue show <id>`, or the accepted entry in
`ahub task show <id>` if the journal itself is down) and then send the assignment again
with `ahub task assign <id> <owner>`. Nothing resends automatically: a blind resend can
duplicate a delivery that actually left.

#### Accepted channel delivery settlement (#1172)

`hub_inbox` can inspect the caller's own held message bodies (#1328 AC6). This is the read-only recovery view used by the [new-project guide](quickstart.md#a-new-project-with-sdlc-advise-or-enforce). The result labels them as read-only inspection of an uncertain earlier attempt, separate from normal queued messages. Reading never confirms completion, retries, resolves, changes an attempt or records task-offer consumption. Check the earlier effects before acting on held text. A caller cannot select another peer; use authorized queue diagnostics for another recipient. The view includes `needs_review`, and `accepted` only for the current explicit-settlement channel, up to 32 rows and the host pull byte budget. Oversized or unavailable components say so while preserving normal queued results.

Held bodies use the current public queue projection. Private/missing tasks and private envelopes are stubbed, unsafe metadata is withheld, and bodies are sanitized. The owned implementer must still belong to the current task, execution root and generation. Unknown legacy provenance withholds bodies. Held review inspection stays excluded from capture/progress across restart without writing an ACK or input receipt; retained readable observer-excluded held inputs (trusted review packages and host-stamped peer chat/status responses) conservatively keep that exclusion until explicit disposition, even if they were never viewed. An overflowing or unreadable held row/byte window stays unknown and excluded because a previously viewed row can move outside it. This does not change normal queued review delivery.

An explicit Claude push-channel session can settle or discard its own accepted row with the shown revision and a public-safe reason, but an `accepted` receipt still means transport acceptance only. If the session sends neither native completion nor an explicit disposition within `bus.accepted_settle_ms`, the next maintenance sweep moves the row to `needs_review` with a fixed timeout cause; no replay occurs. The default is ten minutes (range 1,000-86,400,000 ms). A live `hub_inbox` result includes that session's own accepted and held row ids and revisions, including when the accepted delivery blocks pulling, so it can inspect the row and use `hub_delivery_resolve`. If held metadata cannot be read, the response carries a fixed unavailable sentinel; the plugin keeps any pulled messages and directs the session to `ahub queue list --peer <peer-id>`, without exposing the metadata error. Important, task and review timeouts publish one status notice to the configured conductor with only delivery id, peer id and revision when `conductor.feed` is on; `feed: off` remains the existing opt-out, and no conductor role is forced. The timeout row is excluded from task-state superseding and remains visible until a person or the explicit channel session records a disposition. Recovery refuses a target without `accepted_delivery_settlement` while such a timeout row is retained; projects without one remain compatible with older targets. The row transition is durable before notice publication; if the hub crashes or notice publication is refused by journal storage after the transition, the held row remains authoritative and visible and the host does not invent a replay path.

Reviewer candidates follow `[classes.review].peers`, then attached peers with a
`reviewer` role in `roles`. The owner cannot review its own task. If none is available,
the assignment output and console notice say that `done` will approve without review
and give the skipped-candidate reasons.

Pi 0.86 assistant usage is forwarded at `message_end`, including tool-loop messages,
and recorded before settlement. If a model supplies no usable count, `ahub report`
says `tokens not reported`; the hub does not estimate usage from text length.

## Control write outcomes and safe retries (#1078)

A daemon advertising `tool_write_idempotency` accepts a top-level control
`requestId` for `hub_task_propose` and `hub_review`. This key is independent of
transport `rid` and MCP JSON-RPC IDs. The proposal and review MCP tools expose optional `request_id`:
omit it for a new call; after an unknown outcome, reuse the echoed key with the
same arguments. The channel removes this transport argument before task
validation. A new JSON-RPC ID does not change an explicitly supplied retry key. In-process tool calls (the local worker and Pi) refuse `request_id`: replay keys need the control-protocol transport.

Read `hub_task_list` for an uncertain proposal, `hub_task_show` for an uncertain
verdict, or `ahub queue show <delivery-id>` (person/conductor) for a delivery.
Call again only if the task, verdict or completion is absent. For a proposal or
review retry, copy the returned `request_id`; do not invent a fresh key. An
in-flight retry joins the original execution. A retained result is the receipt
of that call, rather than a fresh statement of the task's current state.

`outcome: unknown` means a sent call may already have applied, including after a
timeout, cancellation or lost connection. `outcome: refused` means this attempt
did not run (for example an invalid key, insufficient authority or full actor
window); it does not undo an earlier attempt. Known task permission/validation
errors retain their specific error. Explicit retries are refused before sending
to older daemons that do not advertise the feature.

Each authenticated actor has its own 512-entry, 15-minute replay window across
its operations and launch generations. One actor filling that window does not
block another. Replies are capped at 64 KiB and cached overlap metadata checks
up to 64 current task references. Expired/foreign-instance IDs refuse without
applying again; restart recovery uses board reads. `delivery_complete` uses the
existing journal idempotence keyed by delivery ID and the live socket/generation,
so settlement consumes no replay-window capacity. `hub_delivery_done` takes only
its delivery ID and generation; it has no request key argument.

The latency receipt and its synthetic-only scope are in
[control-write verification](verification/2026-11-02-control-write-outcomes.md).


## Control write timing and loop delay (#1126)

After upgrading to a release containing #1126 and restarting through the normal
upgrade workflow, `ahub status --full` shows aggregate control-write timing
counters. An older hub omits them. They are process-local diagnostics, reset at
restart, not durable success receipts or a count of unique business effects.
This feature does not change a request timeout or make a retry safe.

A slow tracked operation (at least 1,000 ms on a monotonic clock) writes a
`control_write_slow` JSON record to hub.log. The record contains a closed request
kind, an optional public task number, elapsed time, outcome and phase durations.
`returned`/`threw` describes the handler, not business success or whether a write applied.
Client-side timing is opt-in with `AHUB_CONTROL_WRITE_TIMING=1` in the client or
MCP server environment. Its slow records go to stderr, never stdout, and omit task
numbers because the client has no authoritative privacy view. No request/rid,
actor/session identifier, path, task text, argument, external output or error
message enters a timing record. Host privacy is checked again before logging.
An unresolved task identity (including a noncanonical string id) suppresses daemon
diagnostics while the operation keeps its normal validation and behavior.

The daemon samples its event loop every 100 ms. A missed tick delayed by at least
250 ms can write `control_write_loop_delay`, including bounded observed spans.
Recently completed synchronous intervals are retained so a span that blocked the
loop can be identified after its callback has returned. An open asynchronous span
is only a concurrent wait, not proof that it occupied the CPU; untracked occupancy
is reported as unknown. An asynchronous span that starts and settles inside one
loop turn is counted as a synchronous interval, and after a span's first await
the probe follows at most 16 microtask hops per request to record a continuation
that runs synchronously; a block after a real I/O wait is beyond that bound, so
such a slice is a lower bound (#1545). Background snapshot, queue/status and memory boundaries
use the fixed `background` kind rather than inventing a tool request.

Per observer, retained work is capped at 128 operations, 256 active span registrations, 512
recent intervals and 8 emitted phase/span items. Phase totals use only the closed
phase set; a full active-registration map never discards a finished phase or recent
synchronous interval. There is no per-request cutoff that can hide a late block.
The slow and loop categories each allow at most one line per second, with a shared
60-line/minute ceiling; each JSON record is at most 2,048 UTF-8 bytes. Dropped work
and logs are counted. Normal ring rotation and settle-time cleanup are excluded
from the full-status dropped total. A stopped probe cannot be started again. Nested durations are not additive. Status counters include
background observations and do not identify a blocking cause on their own.

Unanswered diagnostic requests expire after five monotonic minutes, reclaiming
their operation and span slots without cancelling the underlying work or changing
its eventual result. Full status lists `expired` separately from capacity/log drops
and normal ring rotation. Argument screening starts only after socket admission;
model-input diagnostic screens run once only when tracing can admit the observation.

Board-write, queue/status, memory and external-call phases locate an observed
boundary; they do not weaken its existing authority, privacy or execution gates.
The probe is unref'd and stopped at daemon shutdown or failed startup. The
[historical window correlation](verification/2026-11-03-control-write-stall-windows.md)
separates one 60-second all-event gap from review waits with continuing periodic
callbacks. The instrumentation is intended to diagnose the next naturally
occurring stall; it has not been run against the live daemon by that task.


## Execution lineage (#1220 T2)

`ahub lineage show --task <id>` reads a bounded, public metadata neighborhood.
`--attempt <ra-id>` selects an existing research attempt. To name a dispatch,
deliverable or output explicitly, use `--root '<ExecutionReferenceV1 JSON>'`
with `--task-scope <id> --task-created <epoch-ms>`; the hub verifies exact
membership in that task. A missing owner scope is unavailable, not a board scan.
Use `--json` for the wire document; `--cursor` continues the same source snapshot.
A changed source or restart invalidates the cursor, so refresh the root.

`ahub lineage link --task <id> --task-created <epoch-ms> --revision <flow-revision>
--ref '<ExecutionReferenceV1 JSON>' [--from '<local source reference JSON>']` admits inert, deduplicated declared metadata
through Tasks. Read `ahub task show <id> --json` first to obtain the task's current
creation identity and history revision. A stale revision or changed actor,
project or privacy scope refuses without writing. A reference never fetches the
producer or attests to a runner outcome. Foreign project keys remain opaque in
their producer namespace. The equivalent agent tools are `hub_lineage_show` and
`hub_lineage_link` on ordinary MCP sessions. Configured read-only MCP publication
and isolated reviewers retain their existing fixed tool lists.

Reads expose no titles, prompts, paths, session ids or review bodies. Unsupported,
missing and denied reads have the same unavailable shape for ordinary callers;
only an authorized diagnostic operator sees a reason. Pages are at most 100 nodes,
200 edges and 256 KiB, with explicit truncation. Historical reviews retain their
old head/hash binding; a changed output or head does not inherit that currency.
The acon console reads the same page through a provider port, with no new panel,
action or protocol message, and a fixture receipt measures large boards (T3); native
causal coverage remains unverified. See [the address contract](design/execution-reference.md).

## A two-agent task and review

Choose an owner explicitly, then inspect the reviewer selected by the project
routing policy before work begins:

```bash
ahub task propose implement "Update the parser" --owner codex --path src/parser.ts
ahub board
ahub task show <task-id>
```

At a terminal width `ahub board` prints one line per task (#724): TITLE is cut
with `...`, dependencies are an AFTER column (`#113,+2`), and STAGE is the
progress meter with the stage and a short next-step code (`intent: issue?`,
`review: CI?`, `ready`), explained by a legend line. A column that is `-` on
every row is left out. When TITLE would get fewer than 30 columns (or fewer
than its longest title), REVIEWER, CLASS and AGE give way in that order, then
STAGE drops the stage name; at a width still too narrow AFTER goes and OWNER is
cut.
`ahub board --full`, `ahub task show <id>` and piped output without `COLUMNS`
keep the whole title and the full SDLC advice.

The owner accepts with `hub_task_accept`, makes the change, and reports with
`hub_task_done` including a summary and refs. The reviewer receives a review
request and responds with `hub_review`. A console review uses:

```bash
ahub review <task-id> approved "verified against the requested behavior"
# or
ahub review <task-id> changes_requested "describe the required correction"
```

A class can carry a completion check in `.agenthub/config.json`, for example
`"checks": { "implement": "scripts/check.sh", "timeout_s": 600 }`. When the owner
marks such a task done, the tool answers at once, the hub runs the command in the
project root (one at a time; what it left in its process group is killed when it
exits, at the timeout or on shutdown, and a check killed at its timeout or on
shutdown settles within one second even if its exit is never reported), and then either
sends the task to review with the command, exit code and output tail, or keeps it
with its owner and tells it what failed. `checks` is machine-local (see Install
and start): a committed file must not choose commands the hub runs. Keys that
are not task classes are ignored with a log line. A hub stopped mid-check leaves
the task in progress (`check interrupted`); the owner marks it done again.

The owner may call `hub_task_done` again while the task is in review, or approved with its PR not merged, with a
different full lowercase commit SHA in `refs.commit` (#1000, #1021, #1047). It replaces the
delivered artifact, not a verdict: the reviewer gets a fresh request for the new
head, the old CI watch is replaced, stale observed, reviewed and merge evidence is
cleared, and open Important findings, spec acceptance and the rejection count stay.
A configured completion check first returns the task to in progress until it passes.
The same head, a malformed SHA, another owner or a running check refuse without
effect, and a verdict started on the old request no longer applies. Reopening an
approval first reads the PR state with `gh`: a merged PR, an unreadable state or a
private task with a linked PR refuses without effect, and an approved task with no
reviewer goes to the person. The reviewer may instead withdraw an approval of an
unmerged PR with `hub_review` `changes_requested`, which returns the task to its owner.

While the project root checkout is on a branch other than its default
(`origin/HEAD`, else `main`), finishing a task adds `the main checkout is on
<branch>; move the work to a worktree under .worktrees/` to the owner's result
and the reviewer's request, and `ahub status` shows it as `main checkout`
(#572). It is advice only. A branch name that fails the hub's public-text screen
is withheld from the sentence.

A task reaching `approved` is a board transition. It is not proof that an
external side effect happened unless the task's refs and a live readback show
that effect. After `tasks.escalate_after` consecutive `changes_requested` verdicts
(default 3, `.agenthub/config.json`), the hub moves the task to the next attached
peer in the class's `escalate_to`.

A review request carries a checklist: map the changed signatures and call sites
to the task's plan (without one, to its detail, which the request then
includes), read the check result, and list what is
unmet (`hub_review` takes `unmet`, `ahub review ... --unmet <item>`). A reviewer
that missed the request, and the owner, read the done summary and check result
with `hub_task_show {id}`: the task's public view with its history, as the
conductor sees it, and only a stub for a PII task. The configured planner reads any
task outside the backlog the same way (#812); a staged backlog row stays hidden from agent
task tools and is read through the planner tools. Other peers are refused. Each
request also carries the hub's review brief for the task's commit: reviewable and
excluded files with reasons, the `REVIEW.md` and `ahub-review-rules` rules read at
the merge base, and a cross-check list; `ahub review brief <id>` prints it.
Optional code facts (#682) add per-file observed symbol names, kinds and spans,
plus changed/planned, changed/not-planned and planned/not-seen lists. Install
ripwire 0.6.7 on the daemon's host PATH to enable them; missing, unsupported,
failed, busy or timed-out reads show `unknown` and never stop the review request.
Each native call is capped at 5 s, output is capped, and successful values are
cached by repo, commit and query. PII tasks never query it; displayed names use
the hub's public metadata screen. It always analyzes a disposable raw-blob
snapshot, never main or a dirty/untracked owner tree, and removes that worktree
after the owned process stops. No heavy slot is acquired. Trees beyond the
regular-file/4096-file/32-MiB bounds remain unknown.

Ripwire 0.6.7 omits deleted definitions and does not classify change kinds, so
all symbol rows say `change: unknown`; planned/not-seen is not proof of no
change. Graph name-only matches are hidden as ambiguous, and graph count floors
remain explicit. The file-based coverage gate is unchanged. A future both-tree
inventory or bounded base/head probes can improve this advice after dogfooding.

At completion, optional symbol advice also becomes a head-bound task observation
(`#684` phase 2a). Console task detail and the UI task snapshot expose the
screened IDs, paths, names and kinds, without source/spans or internal repository
keys. Public reads re-screen current policy; PII stores nothing. Unknown or
stale evidence remains unavailable. Completion prepares this optional data even
without a reviewer, without adding a review gate. Foreign-repository tasks stay
unknown until the brief can independently bind its analysis repository.

In the console, Enter on a task in Tasks shows a `symbols` block after its plan (#684 phase 2b): each observed changed symbol is `matching` the plan or
`unplanned`, and each planned symbol that nothing changed under is `untouched`, with the counts and the head they were observed at. The match rule is the review
brief's own (a pair of qualified names must be equal, otherwise the last segments are). Without code facts it reads `changed symbols: unknown (no code facts)`;
an incomplete observation says an untouched symbol may have changed; a private task shows nothing. Names are quoted like every agent-written string, at most 40 are
listed and the rest are counted. The block is advice: deleted definitions are not reported, so it never proves a plan was or was not followed.

The dashboard's task sheet has the same block as a "Code" group (#684 phase 2c): the changed symbols as buttons marked `matching` or `unplanned` against the plan, the plan names nothing changed under as `untouched`, and the same advisory line (deleted symbols are not reported, an incomplete observation may hide a changed one). The hub classifies them (`codeGroup` on each task of the UI snapshot, from the same public observation the console reads), so the page never matches names itself. A symbol opens the Memory tab with its canonical node (`symbol:<name>@<path>`) as the graph start; the list is capped at 40 with the count of what is left out, and a summary line counts matching, unplanned and untouched before the cap. A plan name the hub withholds (screened out or malformed) is counted, and the line then says a symbol marked unplanned may be in the plan. Without code facts the group reads `unknown (no code facts)`, and a private task has no group at all, so the sheet shows nothing for it.

Task detail also shows an `overlaps` block (task 379), using the hub's read-only
`symbolOverlaps` projection of its existing open-task/other-owner overlap selection.
Each row names the other task ID and screened shared paths. A row says "same file,
different symbols" only when the same current screened predicate used by completion
notices establishes observed disjointness; otherwise it remains an ordinary overlap.
The block states "observed names only, deleted definitions may be missing". PII tasks
are excluded on both sides by their markers, even if the routing locality limit is
disabled. No pair result is stored, and the console never infers
one from its own plan or receipt. Missing fields on older hubs show no block; an
empty list says `none`. At most 40 pairs and 40 paths per pair are listed, with
omitted counts. Related-note counts remain a later slice.

When both tasks have complete public observations and non-empty disjoint sets
for every exact shared file, a completed-change notice says "same file, different
symbols" with the observed-name/deleted-definition ceiling. It still tells the
recipient to check the completed work. Missing or partial evidence keeps the
ordinary notice; plan-time overlap and coverage gates are unchanged. The receipt
keeps one current head, with at most 500 entries and 64 KiB total. This is the
data slice; the formatted Code panel and memory links follow separately.

`hub_review` takes `coverage {reviewed, skipped}`: in enforce an approval that leaves
a reviewable path unaccounted is refused, and advise notes the gap in the verdict
(#520). The hub
records how each review turned out, per implementer, reviewer and class:
approved; caught (changes were requested and the owner's redo was approved);
contradicted (within `tasks.contradiction_window_days`, default 7, work on the same file or symbol failed its check
or review); escalated (after the reviewer asked for changes). A record counts
tasks, not verdicts. `ahub task show <id>` lists a task's outcomes and `ahub
route explain` shows each reviewer's record with the implementer. `ahub route explain <id>` also prints the planner walk (`planner candidate X: ...` lines, then `planner: X (rotation | named | kept)`): the same planner walk used when a new or pulled task records its planner (#525-2, #525-3). The task detail, dashboard and console show the recorded planner and selection reason; only that effective planner or the person may change its planning. A peer that accepted or finished a task never reviews it; when every eligible reviewer did, the person reviews and the trace says so. With
`"review": { "adaptive": true }` in `.agenthub/config.json`, reviewers with at
least `min_reviews` (5) reviews of that implementer in the class are ordered by
how their reviews held up, ahead of quota but after idle before busy; off by
default, which leaves assignment as it was.

An agent can claim work nobody assigned it by proposing a task with itself as
owner; without a class, and with no model to name one, the claim is filed as
`implement`. A claim or an accept can carry a plan: the files, symbols and
signatures it will change and where new code goes (`ahub task show <id>` prints
it). When a task's paths, or its plan's paths or symbols, overlap another
owner's open task, the newcomer is told to settle it and the earlier owner gets
one line with its next message, the plan included, at no turn of its own. When a
task is done (after its check passes, when one is configured), the owners of
open tasks on the same paths or symbols get a message with the changed files,
the plan's signatures and the first line of the summary, each left out when it
matches a PII pattern (the summary also when `signals.pii_screen = "local"` did
not clear it); nobody else does. PII
tasks are left out on both sides. Overlap is compared only between tasks in the
same repository (#476): a task's repository is its `refs.repo` (an `owner/name`
slug or a checkout path, accepted by `hub_task_propose` and `hub_task_accept`),
else the common git top-level (or common parent) of its absolute paths outside
the project, else the project. A board with one repository behaves as before. `refs.repo` is metadata
only: it grants no file access and changes no execution root.

A task can wait for others: `hub_task_propose` takes `after: [ids]` (`ahub task
propose ... --after <id>`). Until every one of them is approved, the task is
offered to nobody, cannot be claimed, accepted or marked done, and `ahub route
explain <id>` says what it waits for. When the last one is approved, the task
goes through assignment like a new one; if the hub stopped before it got that
far, the task is offered within a minute of a peer that can take it attaching
to the next run. An offer is used up only by an assignment, after an approval
and on the timer alike. If no peer can take it or a ready/assignment write fails,
the task stays eligible; the timer adds no history or notices while nobody can
take it.
`ahub board --ready` and
`hub_task_list {ready: true}` list the proposed tasks with nothing left to wait
for. Dependencies are fixed when a task is proposed and can only name tasks that
already exist, so they cannot form a cycle.

`hub_task_list` pages (#1083), because a 628-task board was 2.4 MB and over every agent tool-output limit.
An agent's reply is `{tasks, total, next?}`: newest updated first (ties by id, descending), at most `limit`
rows (default 50, 1 to 200), each compact (`id`, `state`, `owner`, `reviewer`, `title`). Pass `next` back as
`cursor` for the following page; the cursor is the last row's `updated.id`, so a task that changes between
calls neither repeats nor skips an older row, and the last page has no `next`. `ids` (1 to 200 distinct task
numbers) returns the full public row of exactly those tasks, in the order given, and cannot be combined with
`limit` or `cursor`; `detail: true` returns full rows for a page. `state`, `ready` and `release` filter before
paging. PII tasks stay `[pii]` stubs in every form. Every refusal names its cause and what to pass instead.
The person's console keeps the full bare array unless it names `limit`, `cursor`, `ids` or `detail`, so
`ahub board`, `ahub tasks` and their `--json` output are unchanged. A peer that read the whole board as a
bare array (the benchmark runner did) reads `tasks` instead, or asks for its task by `ids`.

An owner named for a task that waits (`owner` with `after`, `--owner` with
`--after`) is its reserved owner: the task still waits, and when it is ready
routing offers it to that peer first, not to the first idle peer of the class.
A reserved owner that is offline, paused, failing, not attached or excluded is
passed over: routing proceeds as usual, the console and hub.log say which
reservation was passed over and why, and the assignment's history note keeps
it, unless it is no news (the reserved peer is the owner the task moves away
from, or it already refused the task). A peer the task was declined for (by
itself or by the console) or escalated away from after repeated
changes_requested or by hand stays excluded on every later reroute. A decline
with `capacity: true` (`hub_task_decline`, "no room right now") is the
exception: it skips that owner, and the hub offers that peer no task of its own
choosing until the peer next reports idle; a capacity decline of a planner-pulled
card returns it to backlog with its reservation kept (#531, #1626). An owner
released as gone, or moved by the hub after a failed delivery or inference, is
excluded only from that move and may get the task again from its reservation
later. Your own `ahub task assign` is not blocked by those exclusions, and it
drops the agent's reservation. The PII constraint and capability limits
still apply, so a PII task goes to `local` or nobody whoever was reserved.
`ahub task assign` on a task that waits changes its reserved owner instead of
handing it over. On a task that does not wait, an assignment whose named owner cannot take
the task now (offline or not attached, excluded, a capability or PII limit, or
an enforce-mode SDLC gap) is refused with the reason and the task is unchanged;
assign again once the peer is attached (#601). When a proposal names an owner,
a self-claim included, and that owner did not get the task, the proposal's
result says why and names `hub_task_assign`. `ahub route explain <id>` names the reserved owner; once the
task is ready it also says whether routing would honor the reservation now, and
why not.

The peer that proposed a task may redirect it with `hub_task_assign` while it
is `proposed` and nobody ever accepted it, without the conductor role (handing
it to another peer needs `assign` when the proposer has a capabilities list).
Once it was accepted, even if a decline or release later put it back in
`proposed`, or after a person assigned or reserved it from the console (also
once the hub carried that out), only the conductor and the console move it.

An owner offline longer than `tasks.release_after_min`
(default 30, `0` turns it off) in `.agenthub/config.json` loses its open tasks
to a peer routing can give them to; with nobody to take them they stay, and a
paused peer or a hub in a recovery operation is left alone.

Use targeted messages for coordination:

```bash
ahub say @codex "[IMPORTANT] inspect the failing fixture"
ahub say @claude "[STATUS] the test run is complete"
ahub say @kimi "[FYI] the result is recorded"
```

The `hub_send` tool declares `to` as an array of peer ids (#963). The control `send`
boundary also accepts one nonempty string as a single recipient; it never
turns that string into a broadcast. Without `reply_to`, omitting `to` or sending
an empty array keeps the broadcast meaning. A reply without recipients inherits
the sender it answers. Other recipient shapes, including `null`, empty strings
and arrays containing a non-string or empty item, are refused before publication.
The tool reports `not sent: to must be an array of peer ids` (the control reply's
error is `to must be an array of peer ids`). Valid arrays still deduplicate
recipients and pass through the existing unknown-peer, roster and privacy gates.

What agents send is limited per sender (`limits` in `.agenthub/config.json`; a
project config gets the values below unless it sets others, `0` turns one off):

- `sender_per_min` (12) messages a minute from one agent, `pair_per_min` (6) to
  one recipient (a broadcast counts as one), and `important_per_hour` (6)
  `[IMPORTANT]` messages, each of which can interrupt a running turn. Limits
  count what is sent: a reply goes to the agent it answers, a reply to a
  condensed digest counts against the agents behind it, and an `[IMPORTANT]` the
  hub lowers to status is not important. `[FYI]` costs nobody a turn and is
  never limited.
- `repeat_window_s` (120): the same text to the same recipients, answering the
  same message, again within the window is dropped. "Yes." to two different
  questions is two messages.
- A refused `hub_send` answers `not sent: <why>`, with the seconds to wait for a
  rate limit, so the agent learns at once. A turn answer has nobody to refuse
  to: one over the important budget goes out as status, and one over a rate
  limit or repeated is not published; either way the agent gets the reason with
  its next delivery, and has to send a dropped answer again. hub.log records
  each refusal (`limits:`), and a value that is not a number falls back to the
  default above. The console user and the hub itself are never limited.

`@peer` addresses one known peer. With no recipient, `ahub say` broadcasts
to attached peers. `[IMPORTANT]` can bypass batching where the peer supports
it; `[STATUS]` may batch, and `[FYI]` is recorded without follow-on
delivery. A delivery or answer is not a task completion receipt.

## Telemetry: export and report

The hub writes structured events to `.agenthub/state/events.jsonl` alongside
`hub.log` (schema: `docs/events.md`). They carry ids, routing, sizes, states and
token counts, never message bodies or task titles. Both rotate by size (#1546):
`events.jsonl` in 64 MiB segments with three kept (longer while an open task may
need one) and `hub.log` at 16 MiB with two kept; every reader reads the segments
before the live file, so rotation loses no input (`docs/events.md` "Rotation").

```bash
ahub report --since 7d          # turns, busy time and tokens per peer, messages, overlaps, task events
ahub report --since 7d --json   # the same numbers as JSON
ahub report --by task           # tokens, turns and wall time per task and class, with the unattributed share
                                # and, from #1278, what the person was asked per task (permissions, questions, completions, CLI refusals, minutes from recorded latencies only), with the unattributed remainder apart
ahub export --since 24h         # the raw events as JSON lines, for your own analysis
ahub report --dogfood [--since 7d|<iso>] [--json]   # read-only scorecard: flow, quality, cost, delivery, performance, adoption
```

`ahub report --dogfood` (#687) reads the event log, `hub.log`, the board and the delivery journal in `hub.db`, up to 16 recently merged
PRs through `gh`, and the feature table in `docs/dogfood.md`. It covers the last seven days by default, takes no `--by`, and prints the same
document as `--json` with `unknown` in place of null; missing or truncated evidence is unknown, never 0. It exports ids, timestamps and counts
only and runs no model. Its bounds and the weekly routine are in [dogfood](dogfood.md#weekly-scorecard).

`ahub report` labels quota counts as `quota rows` and `hard rows`: they count recorded events, not provider polls. Its JSON retains `quota.readings` and `quota.hard` with the same recorded-row meaning.

Per peer and model route, `ahub report` also counts model changes between consecutive
decisions, how many of them landed inside tool loops and, with `stay_switch` on, sessions
and the planner's switches (#197). With `stay_switch = "off"` session boundaries are not
recorded; `shadow` routes exactly as `off` does, so it is the baseline to compare `enforce` with.
A route event records the decision, so a load-moved request that its MLX fallback served counts
as a change to `dgx/fast`; the relay's request journal records which backend served it.

The event log also keeps the history of limits (#683). Each Codex update that adds tokens writes a
`usage` event with source `codex_appserver` next to the existing `tokens` event, split into input, cached
input, output and reasoning, so re-sent cached context is visible. A budget pause writes `budget_pause`
and its end `budget_resume`, with the window, the reset time and who ended it (`hub`, or `person` for an
`ahub budget resume`). A window's reset writes `quota_reset` when its `resetsAt` moves forward or its `used`
falls by 0.5 or more inside one window id, once per peer, window and `resetsAt`. These events hold ids and
numbers only, add no protocol version and are ignored by a reader that does not know them. `ahub report`
does not show them: `ahub usage` and `ahub usage limits` read them (below), and the console's Usage tab shows each peer's last resets (#683 U3). A dashboard Usage view shows the same roll-up in the Agents view (#683 U4, see [Operator console and panels](#operator-console-and-panels)).

`ahub usage` reads the same events from an incremental roll-up in `hub.db` instead of rescanning the log (#683):

```bash
ahub usage [--since 7d|<iso>] [--by peer|task|issue|pr|release|day|model] [--json]
ahub usage limits [--peer <id>] [--limit <n>] [--json]   # current quota windows, plus the newest 200 (up to 5000) pauses, resumes and resets
ahub usage total [--json]                  # lifetime development tokens since the first event, per peer and overall
```

The daemon folds `events.jsonl` into `usage_rollup`, `token_rollup` and `limit_events` from a stored byte offset, at most 8 MiB per pass, with a 20 ms scheduling slice checked between whole records (one record is indivisible),
only whole lines, and each pass commits its rows and the new offset together, so a crash repeats a pass and never half-applies one. A rebuild
from byte 0 gives the same rows (tested). A log that was replaced by a shorter one is folded again from the start. Before time slicing, on this project's 47 MB,
238k-line log the first fold took about 170 ms and a `usage` command about 95 ms, against about 150 ms for `ahub report --by task`, which
rescans the whole file on each call.
`issue`, `pr` and `release` are the board's current links of each task, read when you ask, so a task linked later is counted under its issue
for the history it already spent. A task with no link, and a record with no task, are `unattributed`.

Every number names its source: `native` (the provider's own counter), `hub count` (the hub's own `tokens` increments, which cover peers that
report no usage record), or `unknown`. Jcode's rows are `native` from 0.99.1 on: the hub records the per-turn buckets of its ACP prompt result as `jcode_acp` usage records (#801). Kimi's rows are `native`: the hub reads Kimi's own per-request counters from its session wire log and records them as `kimi_wire` usage records (#285 phase 2). Unknown is never shown as 0. `TOTAL` includes cache reads and `WITHOUT CACHE`
removes them; Claude's total is the sum of its four reported counters because its transcript carries none (`ahub report` still shows it as unknown), and a source whose input already
contains the cached part (Codex, the gateway) gets no derived total. A lifetime total that mixes a native and a hub-counted peer is labelled
`hub count`. When a peer is unknown the overall figure is `partial, at least`: a lower bound that leaves the named peers out, never a sum that counts them
as 0 (it is `unknown` when no peer is known). The overall `WITHOUT CACHE` is unknown unless every peer's cache split is known.
`usage limits` shows the newest 200 events and says `N older events are not shown` when it cuts (`--limit <n>`, up to 5000, shows more). A pause that the events
never ended and the hub no longer holds (cleared by `ahub reset`, which keeps the log as it was) shows as `pause ended, end unknown`, not as open. A private task shows its id and `[pii]`, never
a title. The person and a configured planner may read usage, in the console, the dashboard control link or the CLI; every other agent is refused.

`ahub report` counts the same overlap warnings as `scripts/overlaps.ts`, from the
structured events instead of log lines. `--by task` uses the task each usage and
token record was attributed to when it was written: the delivery that started the
turn, otherwise the peer's only `in_progress` task. Everything else is reported as
unattributed, and records from before 0.12.18 as a separate bucket; neither is
redistributed (rules: [events](events.md#per-task-usage-reports)).

## Research records

The [new-project SDLC guide](quickstart.md#a-new-project-with-sdlc-advise-or-enforce) includes this init choice; the machine-default producer and compatibility caveat are defined here.

`ahub init --research` or `--no-research` chooses research recording in the
project's untracked `.agenthub/config.local.json`. A new project defaults to
the trusted machine choice from an explicit `ahub setup --research` or
`ahub setup --no-research`, otherwise off. The choice is an optional boolean
`research.enabled` in the existing owner-only `~/.agenthub/defaults.json`;
setup preserves autonomy and the start-agent choice through the same guarded
compare-and-swap. Ordinary `ahub setup` leaves research unchanged. Init only
reads this default, never writes it, and refreshing an existing project changes
research only with an explicit flag. Missing, unreadable or untrusted machine
defaults remain off. The guided prompt shows the same choice its plan will write.

The file is shared by every hub and CLI on the machine, so upgrade them all to
0.36 or later before saving this choice: a hub or CLI from before 0.36 refuses
the unknown `research` key and treats the whole file as untrusted, so its machine
autonomy preset falls back to off and its start-agent default to the shipped one
until it upgrades.

With `"research": { "enabled": true }` in project configuration, the hub keeps one record per
task that reaches a terminal state (approved or cancelled) in `~/.agenthub/research/`, shared by every project that opts in:
outcome, review rounds and findings, delivery and merge figures, rework, failed checks, tokens and time per peer and model,
never task or message text ([schema](research.md)). Unknown values are null and counted, never zero.

```bash
ahub research --since 30d          # success, first-pass, rework and check-failure rates; tokens and wall time per task
ahub research --all --json         # every opted-in project on this machine
ahub research export --format csv  # the records, for your own analysis
ahub research export --dataset ~/research-out [--all]  # per-project tasks.jsonl, manifest.json, quality.json: family names only, to a directory in your home outside every project
ahub research backfill             # build this project's records once from events.jsonl
ahub task label 12 reverted        # a later verdict (ok, regressed, reverted, incomplete, wrong, abandoned)
```

## Research campaigns: `ahub study` (#930)

A research campaign splits one question on an approved parent task into bounded units, each a task with
its own sources and required output. Nothing happens until a campaign is drafted, and the `ahub research`
telemetry above is unrelated. The contract, its bounds and the slices are in the
[research campaigns spec](specs/2026-11-01-research-campaigns-design.md); the worked three-source example is in
[profiles](profiles.md).

```bash
ahub study draft 12 contract.json            # store revision 1 as a draft; creates no task
ahub study revise rc-0123456789ab 1 next.json  # store the next draft; a stale revision refuses
ahub study approve rc-0123456789ab 2         # person only: create the unit tasks as Backlog cards
ahub study show [rc-0123456789ab]            # list campaigns (50 per page, --after continues) or one projection
ahub study close rc-0123456789ab 2 --reason "answered"
ahub study approve-protocol <64-hex hash>    # person only: approve one exact experiment protocol
ahub study experiments --campaign rc-0123456789ab [--after 50]   # read the recorded attempts (also --attempt ra-... or --plan <hash> --baseline ra-... --variant ra-...)
ahub study evidence ev-... [--revision 2]    # re-read one evidence link under current privacy (--task <task>: person-only authoring bindings)
ahub study check 12 manifest.json            # person only: offline synthesis readiness of one manifest; non-ready exits nonzero
```

`ahub study evidence`, `ahub study check` and a manifest-bound `ahub task claim ... --manifest <file>
--disposition resolved|qualified` (#931) need a running hub that advertises `research_synthesis`; the CLI
refuses before sending to an older hub. What they report, and what `ready` does not mean, is in
[profiles](profiles.md).

- **Contract.** The JSON names the question, scope, exclusions, registered source ids, 1 to 32 units
  (round, question, perspective, required output, sources, dependencies and a purpose: discovery,
  independent check, analysis or synthesis), deliverable sections, a stop policy (`maxUnits`,
  `maxFollowUpRounds` up to 5, a deadline at most 90 days after approval) and an optional execution budget.
  A contract over its bounds refuses whole, naming the field.
- **Who does what.** Draft and revise are the person's (`ahub study`) or a configured planner's
  (`hub_study_draft`, `hub_study_revise`); they store drafts only. Approve, approve-protocol and close are
  console commands. Approval is the only step that creates unit tasks: they go to Backlog and the planner
  offers them through its ordinary pull; the campaign never assigns owners or approves a task. Re-running
  approve on an approved revision creates nothing.
- **Dispatch gate.** Before a unit task is offered, assigned, pulled or handed to another owner the hub
  re-reads the campaign and holds the task with a reason when its revision is no longer the latest approved
  one, the deadline has passed or the stop policy is exceeded. A newer draft holds older bound work until it
  is approved, and an owner offer held this way is re-offered after approval, across a restart too. A hold
  never stops a native turn already running.
- **Handoffs and coverage.** The current in-progress owner of a unit records `hub_study_handoff`: evidence per
  source, unresolved questions, contradictions and limitations, or `insufficientEvidence`. `ahub study show` and
  `hub_study_show` report per unit its round, task state, handoff completeness, covered sources and duplicate
  discovery assignments, the budget support label per resource (`enforceable`, `advisory`, `unknown` or
  `unavailable`) and why dispatch is held. A follow-up round needs every discovery unit of the previous round
  settled by a complete handoff or `insufficientEvidence`.
- **Budgets.** A contract's `budget: { id, hardCap: [...] }` names an existing execution budget. With a non-empty
  `hardCap`, approval refuses unless the budget is enabled, every capped resource has a limit and is not
  `tokens`, and at least one of its peers is instrumented (today `pi` and `local`); every later dispatch and
  owner change rechecks that same budget. The ledger is shared with the peers' other work.
- **Experiments.** Protocols, comparison plans and attempts are stored with their provenance (`declared`,
  `host-observed` from a check receipt or a hub-hashed deliverable), and `ahub study approve-protocol` binds an
  approval to one exact protocol hash and its evaluator; a changed protocol needs its own approval. The hub
  never ranks results. The current in-progress owner of a bound unit task records inert data through
  `hub_experiment_record`: `kind` is `protocol`, `plan`, `attempt`, `event` or `receipt`, using the existing
  protocol/attempt/event/plan envelope or `{ kind: "receipt", receipt, signature }` for a signed runner receipt.
  The person may relay a signed receipt through the authenticated console connection; this does not grant
  agents person authority or allow a person to bypass the current task/source/campaign checks. Every PII turn
  refuses the tool. It returns only record metadata (kind, ids/hashes, sequence and receipt id as applicable),
  and neither starts an experiment nor signs or verifies a receipt in the relay. Existing host evidence and
  signature verification remain inside `Tasks`. Read records with `ahub study experiments` or
  `hub_experiment_show` (see Experiment readback below).
- **Experiment readback (#602, #932 T3).** `ahub study experiments --campaign <id>` lists a campaign's attempts
  (50 rows a page, `--after <cursor>` continues), `--attempt <ra-id>` shows one, and `--plan <hash> --baseline
  <ra-id> --variant <ra-id>` shows one comparison under a recorded plan. `hub_experiment_show` takes the same three
  forms and is a read for every local peer. It runs no command and reads no file; it renders what
  `Tasks.experimentShow` already returns. Every value says where it came from: `declared` (the agent's own word),
  `host-observed` (a check receipt or a hub-hashed deliverable), `runner-attested` (a signature-verified runner
  receipt) or `person-attested`. A declared value is never shown as observed, a metric or output the hub could not
  read is `unknown`, sealing is `declared` and `isolation unverified` unless a runner receipt supplies the
  evidence, and failed, cancelled and unknown attempts stay in the counts at the top. A repeat is never an
  independent reproduction, and a comparison whose fixed inputs, evaluator, split or metric units differ, or that
  changes an undeclared factor, reads `no: <field> differs` and is shown, never ranked. A private campaign, task or
  source shows ids, counts and states only. **Optional rerun checklist** (written for a person, never run by the
  hub): a person who wants stronger evidence reruns the protocol themselves, then attaches it through the existing
  paths and no new one: a check on the task (`hub_check_start`, #513 and the remote runner #793) makes the end
  event's exit status `host-observed`; an output file named in an `output` event is hashed by the hub (#509) and
  stays `unknown` when it is missing or denied; a registered runner's signed receipt (#1050) is the only source of
  `runner-attested` sealing and isolation. Without one of these the experiment is reported as declared and
  unverified, which is not the same as wrong.
- **Privacy.** A campaign whose parent task is PII, or that names a private source, is private: every view keeps
  ids, counts, states and provenance and stubs its text as `[pii]`. Study tool arguments and results are kept out
  of hub-managed memory capture.
- **Upgrades.** The daemon advertises `research_records`, `research_dispatch`, `research_dropped_offers`,
  `research_experiments`, `research_comparisons`, `research_runners`, `research_evidence` and
  `research_evidence_withdrawal` (#931). While the
  matching rows exist (for `research_runners`, stored runner receipts or any `research.runners` block; for
  `research_evidence`, stored claim evidence links; for `research_evidence_withdrawal`, withdrawn evidence
  revisions), a restart, upgrade or recovery onto a release without the
  feature is refused.

## Hub memory

The hub opens the selected amem memory profile under `memoryHome()` (default `~/.agenthub/memory/`), with no claude-mem worker dependency ([how it works](memory.md)): notes saved
against an open task are short-term; when the task is approved its decisions, contracts and fails become long-term.
Task briefs, session-start recall and `ahub ask` read it first, and the dashboard has a Memory section.

```bash
ahub memory                              # this project's entries, newest first
ahub memory search parser                # every word must match
ahub memory show 1a2b3c4d                # one entry, its provenance and edges
ahub memory forget 1a2b3c4d              # also promote, demote, supersede, rebuild; an agent shell's change is recorded as that agent (#1522)
```

`"memory": { "native": false }` in `.agenthub/config.json` turns it off for a project.

The declared `@staix/agent-mem` range (`>=0.33.0 <1.0.0` in `package.json`, resolved to 0.38.0 by `bun.lock`) resolves `AMEM_HOME`, then `$AGENTHUB_HOME/memory`, then `~/.agenthub/memory`. A plain release inside that range opens memory without a hub release when its host API range intersects the supported `[1, 1]`; an out-of-range, unattested, prerelease or host-API-incompatible package refuses to open it. A new minor can raise the store format floor: an older hub or amem cannot read a store a newer one wrote, so roll back the hub together with the store. An absent `M/profile.json` selects shared v1; an explicit generation selects `M/generations/G` with the package's readonly legacy bridge. All daemon memory consumers and the hub memory/goal CLI use that selected profile. Invalid metadata or a missing selected generation makes native memory unavailable while the bus and board continue; there is no fallback to legacy writes. Inspect the daemon's memory binding/availability before interpreting missing memory as an empty store.

The daemon checks its selector at hub operation entry and before candidate/counter writes. It does not hot-switch handles or provide an atomic fence against selection changes during an in-flight core call. Quiesce consumers and close their handles before migration or selection changes; reopen through the supported session-preserving lifecycle afterward. Candidate/counter storage remains `M/candidates.db`, independent of `G`; since agent-mem 0.7.0 `amem review` also lists and accepts candidates on a selected generation. Every running hub using this home needs an authenticated receipt: a matching ready binding, or a generation-capable unbound receipt (`disabled` when native memory is off, `unavailable` when opening failed) proving it holds no memory handle. An unbound daemon and zero running hubs are quiesced for memory; a stale bound handle, unreadable registry or unknown runtime is not ready. Existing JSON memory/goal results remain unchanged; the additive binding receipt belongs to daemon status, profile-check and the decay object. This source integration does not authorize installing a new runtime, migrating real memory, restarting sessions or claiming real-machine sync/capture receipts. Migration/deactivation and their limits belong to [agent-mem](https://github.com/STAIxBWLB/agent-mem); see [the hub profile contract](memory.md#selected-memory-profile).

Run `ahub memory profile-check [--json]` from the person's terminal for the read-only preflight. It identifies live registry owners by signed process identity and authenticated daemon replies, then reports their loaded memory package and bound home/profile. The receipt names the current `AGENTHUB_HOME` registry scope; zero results establish no live daemon in that inventory, not system-wide process absence. Inventory and check separate custom registries too when they share `AMEM_HOME`. A missing or unreadable runtime receipt never counts as a different home or permission to migrate.

Before real migration, first upgrade every hub sharing the home to 0.12.30 or later. Obtain positive ready or unbound/quiesced receipts in every relevant registry; then quiesce consumers and close bound handles before changing the selector. A matching ready handle proves compatibility but is still an open handle. Verify synthetic cross-writes before the separately approved real migration, then reopen through the supported session-preserving lifecycle afterward. Merely installing this release does not authorize migration or provide live capture/device-sync evidence.

A curated split (`amem migrate --shards`) writes `M/shards.json`; from 0.12.37 the hub then opens this project's shard, with the user shard as its overlay, under the alias-resolved project key the `amem` CLI binds (#534, #537). Before splitting, upgrade or stop every hub using the home: a hub on 0.12.36 or earlier does not detect the split and keeps writing the old layout, which reaches the shards only through `amem migrate --shards --resume`. A split that is not active (captured, malformed, or a dangling or unreadable `shards.json`) makes native memory unavailable with that resume command as the remedy. An `amem alias add` that remaps a running hub's key latches its memory unavailable until a restart. `ahub memory profile-check` is split-aware: each running hub is compared with the shard profile of its own project, and an inactive split reports that resume command (#536). See [the shard binding](memory.md#selected-memory-profile).

Managed agents read through `hub_memory_search`, `hub_memory_show` and `hub_memory_graph`, with the server's project identity, the `memory_read` capability and current privacy screening. They cannot supply another project; private turns are refused. The tools bound UTF-8 input/output, screen before counts and truncation, and exclude their arguments/results from hub-managed capture. `hub_memory_correct` has its own `memory_correct` capability and records a screened correction candidate, not a note change. See [the complete memory contract](memory.md) for caps and refusal semantics.

Review candidates and rendered/delivered/cited counters stay in machine-local `M/candidates.db`, outside sync, import, recall, briefs, ask and graph evidence. Public changes-requested reviews with unmet items may propose a fail candidate; missing cause/retry details stay unknown. Acceptance is a person's `amem review` action with its TTY/policy checks, on shared v1 and, since agent-mem 0.7.0, on a selected generation. Read-time `(stale?)` hints and plan-fail advice never change stored rows or task authority. Structured fail notes are validated against 4000 UTF-8 bytes before screening or writes, with no silent truncation.

Recall presentation omits generated task-approval outcome notes and shows only nonempty reasons from generated changes-requested notes; an ordinary decision that merely resembles a header stays visible. Contracts and fails remain eligible. Capped recall lines preserve memory headers and end at word boundaries, and one delivery deduplicates ids across restored/current prefaces and shared note lines. Stored notes and brief evidence are unchanged; platform recall retains its budget split.

Between your machines, through a private git remote, with long-term tasks that span them:

```bash
ahub memory sync --remote git@github.com:you/agent-hub-memory.git   # once per machine; then every 10 minutes
ahub goal new "native memory"                                        # a long-term task
ahub goal                                                            # open ones, who holds each and until when
ahub goal take 1a2b3c4d --force                                      # take one over from another machine
```

Without a remote the periodic sync stays quiet; any other sync failure writes `hub memory sync failed: <reason>` to `hub.log` (task 401).

## Benchmarks

In a git repository kept for benchmarks (`"bench": { "enabled": true }` in its `.agenthub/config.json`, a clean tree),
`ahub bench` runs a suite of tasks against the peers attached to its hub and compares configurations: pass rate, first
pass, tokens and wall time per attempt, with bootstrap intervals between arms. Each attempt resets the tree to the
task's commit, so never enable it in a project you work in. The project must be the root of its repository with
nothing tracked under `.agenthub/`, and the suite file lives outside its tree ([suite format and store](bench.md)).

```bash
ahub bench run ../suites/suite.json --arm baseline --repeat 5   # the person's or the conductor's: resets the tree, proposes the tasks
ahub bench status                                     # the run in progress
ahub bench compare baseline ripwire-on                # arms side by side, inconclusive below 5 attempts each
ahub bench export --format csv
```

The dashboard's Benchmarks section shows the latest runs and, per suite with two or more arms, the comparison.

## Turns and undo

In a git work tree the hub snapshots the project's tracked and unignored files (the
project directory only, when it is part of a larger repository) when a peer
turns busy and again when it stops. The snapshots are git tree objects written
through a temporary index, so your index, HEAD and branches stay as they are. The
files a turn changed are the difference between its two snapshots, which counts
changes made by shell commands as well as edits. The last 20 turns per peer are
kept (`"snapshots": { "enabled": true, "keep": 20 }` in `.agenthub/config.json`).
Snapshots are on in any project with a config file, including one written before
0.8.0 without a `snapshots` block, and off without one; set `"enabled": false`
to opt out.

```bash
ahub turns                        # recent turns of every peer and the files each changed
ahub turns codex --limit 5
ahub undo <turn>                  # lists what it would restore; changes nothing
ahub undo <turn> --yes            # puts those files back as they were when the turn started
ahub undo <turn> --yes --context  # Codex's latest turn: also drop it from Codex's conversation
```

- A turn's files are everything that changed in the project while it ran,
  whoever changed them: the hub cannot tell Claude's or your edits made during
  the turn from the peer's own.
- `ahub undo` refuses the whole turn, naming the files, when a file it changed
  has changed again since the turn ended (by anyone; modes, symlinks and a
  directory in a deleted file's place count), or when another peer's turn that
  ran at the same time changed it too, so the change may be theirs. It also
  refuses while such an overlapping turn's changes are unknown (still running,
  cut short by a stop, a failed snapshot, a PII turn, or pruned records).
  Nothing is restored then. It plans again right before restoring and stops if
  anything moved meanwhile. A turn that is already undone says so.
- A file the turn created is deleted; a file it deleted comes back.
- The hub does not observe inside a git submodule (#798). A submodule the turn
  left dirty is listed as `<path> (changed, contents unobserved)` in `ahub turns`
  (`unobserved` in `--json`), and `ahub undo` says its contents cannot be restored:
  undo them in the submodule itself. A task that declares a path inside a submodule
  gets a notice at propose and accept, never a refusal. Without `.gitmodules` no git
  call is added; with one, each turn end adds one bounded `git status` probe, and a
  probe that cannot answer records unknown, never none.
- When HEAD moves during a turn, the hub reads the appended HEAD reflog (bounded to 64 moves and 128 KiB). The turn's own commits, amends, cherry-picks and rebase picks still count as its changes. Files brought in by a pull, merge, rebase start, branch checkout or fast-forward reset are left out, unless they are still dirty at the turn's end. An unreadable or ambiguous reflog, a rewinding reset, or a file touched by both kinds of move makes the turn's files unknown (#576).
- `--context` asks Codex (`thread/revert`) to drop the turn, and every later one,
  from its thread's saved history before the files are restored; Codex receives
  nothing while that runs. It changes no file itself, works only on Codex's
  latest recorded turn while Codex is idle, and is logged in hub.log. Whether
  Codex's running session also forgets the turn, or only its saved history, is
  still to be checked against a live Codex (docs/smoke.md).
- A turn of a peer that holds an open PII task (assigned, accepted or sent
  back) is not snapshotted, so it cannot be undone. Another peer's turn that
  starts or ends meanwhile snapshots the whole project, a PII file the worker
  has not removed yet included, and a PII file left in the project is
  snapshotted by later turns like any other file. Keep PII files in an ignored
  directory.
- A turn the hub stopped in the middle of shows the state `no end snapshot` and
  cannot be undone. So does a turn whose boundary evidence is unknown: snapshot
  Git calls made in one callback burst share a 250 ms budget, and a capture that
  runs past it, fails, or sees HEAD move while it is taken is unknown, never a
  stale baseline (for a task or review capture hub.log says `snapshot unavailable`
  once per burst; a turn boundary logs it only when a cooldown starts). A turn
  whose diff or HEAD-move evidence cannot be read is unknown as well (#576).
  After five consecutive exhausted bursts in one execution root (the project
  root or a peer's worktree), turn boundaries there skip the capture for ten
  minutes and record unknown evidence; the first boundary after that tries
  again, one more exhausted burst starts the wait again, and a restart clears
  the count (#1550).
- Claude's turns are not recorded: its channel shows the hub no turn boundary.
  Claude Code's own checkpoints cover its edits, though not its shell commands.
- The snapshots are unreferenced objects in the repository's own object store, so
  `git gc` prunes them after `gc.pruneExpire` (two weeks by default); undoing an
  older turn says so.
- Each `turn_end` event carries `files` and `snapshotMs` (`ahub export`).
- Each `turn_end` event may carry `model` and `modelEvidence` (#1402): the model id exactly as the peer's native surface reported it (passed through `safeModelLabel`; a label it refuses is dropped whole, an alias is never expanded) and how it was learned, `served` (named for this turn's responses), `session` (the native session's current model) or `configured` (only the hub's own override). A turn with no observation records neither field. `ahub research` reads them into `ownerModels` and groups by model on the owner's turns.

## Edit conflicts

With snapshots on, the hub also compares each turn's files with what other
owners' open tasks changed before it. A turn's files count for every task its
peer has in progress, except files that another peer's overlapping turn changed;
while such a turn's changes are unknown (it still runs), the turn's files count
for none. When a peer changes a file that another owner's open task changed
earlier, both get a message naming the file and the other task, the console
shows a `conflict:` line, and `events.jsonl` records a `conflict` event (`ahub
report` counts them). Each peer, task and file is reported once per hub run.
When another peer worked during the same turn, the messages say so: the change
may be theirs. Edits by Claude or by you during a peer's turn count as that
peer's, without that note: the hub sees no turn of yours. Nothing is blocked. A
file only one agent touched, and anything to do with a PII task, warns nobody.
A file whose name matches a PII pattern is not named, as in overlap notices: the
messages and the console line only count such files, and the event leaves them out.

Claude's edits do not pass through turn snapshots, so Claude can ask before each
edit instead. `templates/claude-hooks.json` is a PreToolUse hook for Edit, Write,
MultiEdit and NotebookEdit that runs `ahub check-path --hook`. Merge it into
`.claude/settings.local.json` (or your user settings) yourself. When another
owner's open task claims the file (refs or plan paths) or changed it, Claude gets
the list with the tool result and you see one line. The hook never decides a
permission, so your permission rules apply as before. Task titles in the list
are quoted and marked as other agents' text. The hook runs `ahub`, so it has to
be on the PATH Claude Code's hooks see; otherwise every edit shows a hook error
(it never blocks). `ahub check-path <file>` prints the same list in a terminal.

## Turn-free coordination

A notice about an open task of its recipient (the completed-change notice and the
edit-conflict messages above) is checked again for each recipient right before it
is handed over, after any digest condensation: if that recipient's task has
closed, changed owner or is gone, its copy is dropped instead of starting a turn,
the journal records it as `discarded`, `hub.log` has a `STALE` line and
`events.jsonl` a `stale` event. Other recipients keep their copies. Approvals,
check results, review requests, assignments and budget, permission and recovery
messages are never dropped this way, and a dropped notice never resolves another
delivery. The condition lives in memory: after a restart, or for the oldest of
more than 1024 notices, the notice is delivered as before.

Set `"coordination": "turn-free"` in `.agenthub/config.json` to let owners of
overlapping open tasks (the overlap rules above) work without messaging each
other. The default, `"advisory"`, keeps the behaviour described so far, and it
stays the default until an evaluation says otherwise (`docs/cooperbench.md`).

- Cohorts. Owners of overlapping tasks form a cohort when the overlap is found.
  It is silent only if, at that moment, turn-free is on, no PII task is open and
  every owner's context path is verified (below). It never turns silent later;
  it stops being silent, for good, when an owner without a verified path joins,
  a path is lost or a PII task opens, and every member still at work is told at
  once that it may message again, with the completed-change notices the silence
  held.
- Verified context path. A hub-launched Claude session (`ahub claude`) gets the
  hub's hook before and after every tool call and at the end of each turn, in
  its `--settings` next to the status line tee (a `--settings` of your own keeps
  them, added to its own hooks, and loses only the tee). Codex gets context by
  steer into its running turn. Until a fact or a
  one-line probe has been read back, the peer counts as unverified: for Claude
  the row Claude Code writes in its transcript for the hook's additional
  context, matched by tool use id and the offer's id; for Codex the steered
  input coming back as a user message item of the turn. A new native session,
  the peer going offline, or three offers past a minute without a readback
  (checked at its boundaries and every 30 seconds; facts sent with an
  integration request wait for the next done and do not count, a refused steer
  is no offer, and an unanswered one may still be read back), makes it
  unverified again, and a Claude session whose
  transcript the hub cannot find gets no facts at all and loses a verified
  path. A session whose hooks stop altogether leaves no offer unread, so it
  stays verified; a peer without a verified path that left three
  offers unread gets none until a readback arrives. Kimi, Pi and the local
  worker have no path yet, so a cohort with one of them is never silent.
- Silence. While a cohort is silent, an agent message from a member to another
  member is held back for that recipient only: other recipients and the console
  get it unchanged, and `events.jsonl` records a `quiet` event. `hub_send`
  answers `not delivered to <peer>: ...` (or `sent to: ...; not delivered to
  ...` when some recipients got it); a native turn answer's sender hears it on
  its next delivery. Workflow messages from the hub are never held back. A
  member's messages stay held until its native turn has ended after its task
  closed (Codex's turn completes, or Claude's Stop hook runs; a member already
  between turns when its task closes has stopped; a paused peer may still be in
  its turn, and Claude's channel going offline says nothing about its session),
  so a late answer is still the cohort's. That settlement is recorded when it happens and
  never undone: the member's next turn is new work, and once every member has
  settled the cohort is over (a task reopened after that is outside it). Only a tool call starting counts as activity after
  a turn end. A message held back from all its recipients does not count
  against the sender's limits.
- Facts. At each tool call (Claude) or completed tool item (Codex) of a cohort
  member with an open task, the hub offers what changed since it last
  acknowledged them in the files every member's task names and in the files it
  touched, with the other members' new plans; the last member still at work
  keeps the others' files after they finish. A directory a task names stands for
  git's changed (staged or not) files against HEAD, new and deleted files under
  it (200 at most; the fact says when more were cut, until it is read back, and a
  new session hears it again). A file the peer has seen there stays covered after git
  stops listing it (put back to HEAD's bytes, or the directory moved away), so
  the way back is shown (200 at most, the newest versions first; the rest are
  named as no longer followed, until the peer reads that back; a new session
  hears only the drops of its own). A file there that the peer has neither seen nor touched appears once
  someone changed it so that its bytes differ from HEAD's, or created it: it is
  named without a diff (what happened before is never shown) until the peer reads
  the fact back, and until then it counts as a change the peer has not been
  shown. A rewrite with HEAD's bytes, which git lists until it refreshes its
  index, is no change (a file too large to read is compared by git's own hash).
  `.git` directories
  at any depth and what the denylist keeps from every agent
  (`src/local/deny.ts` and `local.deny`) are never read or shown. A file a peer touched before it had a view of it (a
  partial read, say) is compared with what it was then, so a change landing in
  between is shown. A change is credited to an agent
  only with effect evidence: a Claude Edit, MultiEdit or Write whose result is
  exactly its input applied to the file as observed before it, or a Codex patch
  whose diff is exactly what changed. Shell commands, concurrent writers and
  unreported changes are shown with their attribution unknown, never credited by
  elimination; an agent's own verified writes are not shown back to it. A Codex
  read action never counts as having seen a file (it may be partial); a Claude
  Read does when it returns the whole file: no offset or limit, at most 2000
  lines and no line over 2000 characters. A diff that matches a PII pattern is
  not shown (the file is named, to be read), and a changed file whose name
  matches one is counted, not named. Only an acknowledgement (a readback, or the next
  `hub_task_done` for facts sent with an integration request) moves the peer's
  view, so a fact that does not arrive is
  offered again at a later boundary; no turn is ever started for one. An
  acknowledgement says the context reached the native session, not that the
  model read it. 60 changed lines are shown at most, the cut files named; a
  history longer than the hub keeps is shown with its attribution unknown, and a
  file that falls out of the 64 a peer touched is named until the peer reads
  that back. Only regular files
  of 256 KB or less inside the project are read, re-resolved at every read and
  opened without following links; larger ones are named without a diff, compared
  by size and modification time, or by their bytes while written in the last 2 s
  (4 MiB or less each, 16 MiB per store per event-loop turn), since a same-size
  rewrite within one filesystem timestamp tick keeps the stat. Facts never go through the bus or the delivery journal;
  `events.jsonl` records `fact`, `fact_ack` and `capability` events with bytes
  and latencies.
- Integration. A member's `hub_task_done` is a completion intent. The member
  whose intent completes the set is asked, as its done result, to check its work
  against the others' (their files, signatures and summaries, plus its own facts)
  and to call `hub_task_done` again; nothing is recorded as done yet. The next
  call counts only for the same target: the same owner, cohort revision and
  files (the named ones, and those each member wrote with an edit tool the hub
  saw, Claude's Edit, MultiEdit and Write or a Codex patch, between being handed
  its task and settling, so a symbol-only overlap counts and
  a member settling keeps its files in; reading a file never moves it, a settled
  member's later work does not count, a shell command's writes outside the named
  paths are not seen, and a file the hub reads whole whose bytes equal HEAD's
  is no change, whatever git's stat data says), with every other owner's native turn
  ended after its done (or that owner idle when it finished); the integrating
  owner's own other tasks in the cohort never count as still running. A done of a member by the console counts as its
  intent too. Edits in between, a new member, an owner change, a failed check or
  a reopened review ask again; a done within two seconds of a request is taken as a retry and gets the
  same request again; after three requests the done is recorded with
  `integration unresolved`, never as integrated, and that revision asks nothing
  more (a configured check then counts as usual). A configured check of the integrating member
  counts only for the target it confirmed; when another member reopens its task,
  that member integrates instead and the earlier one's check counts as usual.
  Inside a silent cohort a member's completed-change notice is held, not sent;
  where no integration step runs for the others (the silence was lifted, a PII
  task opened), the held notices go with the lift notice or the done result, and
  for a task the console finishes, to the console. Open tasks outside the cohort
  get their notices as usual. Facts sent with an integration request are
  offered again at the next boundary until the next done acknowledges them.
  Cohorts live in memory: after a hub restart an open
  request is recorded as unresolved, and when a peer first attaches, each of its
  open tasks that overlaps other work hears that overlaps are settled by message
  again, with the completed-change notices of overlapping tasks finished since
  it was handed the task (a notice may come twice; none is lost).
- While any PII task is open the project behaves as advisory: no facts, no
  silence and no integration step, and the cohorts that were silent stay lifted.
  When it closes, the hub forgets what it had observed, so nothing changed
  meanwhile is shown as a diff; each member is told which of its files to read
  again.
- `ahub check-path` asks the hub whether the owner of the claimed path shares a
  silent cohort with the caller, and only then leaves out the request to settle
  by message. `templates/claude-hooks.json` holds only the check-path hook; the
  facts hooks need a hub-launched session.
- Routing does not change. When routing chooses the first owner of a task that
  overlaps another owner's task not started yet (`where: "routing"`, the record
  calibration reads; an escalation, relay or reassignment is not one), and when an overlap forms or changes a cohort, routed or
  named (`where: "cohort"`), the hub records a shadow split prediction (`split`
  event; `ahub route explain <id>` shows its trace as it would be now): whether
  splitting two equal units between the two peers (`o_s + u_s < o_f + 2u_f`)
  would finish sooner than the faster one alone, from the recorded task stages of
  each peer under the profile it has now. Every hand-over is tagged with the new
  owner's profile: the hub's version, the agent's (Codex's from app-server,
  Claude Code's from its transcript; other agents report none yet) and the
  coordination mode, which decides the hub's own hooks; records accumulate across
  hub runs, one per hand-over (a decline or an escalation away counts against
  the peer that failed, never the next owner), and a peer whose version is
  unknown has no profile. The user's and
  plugins' hooks are not part of it. It is unknown unless the units are equal
  and known, both peers are available (idle, or busy taking the task in
  question: in this hub run, it is still in the turn that task started (the
  task delivered at once to the idle peer) or in which it claimed the task; a
  task queued, held, or steered into a turn about something else is not taken,
  and once that turn ends, busy is another turn; for the
  other owner, while the overlapping task is not started; the routing record,
  and a cohort record formed as a task is assigned, are taken before the task is
  sent, so a busy routed peer is not available then) with no other open work (an overlapping task its owner
  has started counts), and each has `tasks.split_min_observations` (default five) measured tasks with no more
  than `tasks.split_max_failure_share` (default 30%) failures and comparable work times. The work stage of a task ends at its first
  `hub_task_done`, and the task itself is never one of its own observations.
- `"experiments": {"stale_notices": "deliver"}` in `.agenthub/config.json`
  turns the stale-notice drop off, for a controlled comparison only (the #106
  ablation in `docs/cooperbench.md`); the hub logs it at start.

## Always-ask action policy foundation (#636)

The classifier, local configuration and session budget counter decide. The managed Claude PreToolUse hook (including the headless Claude implementer, #525-4), ACP permission requests with a host gate, received Codex command approval requests, and the hub-owned local/Pi tool boundary consume the same policy. Jcode still has no hub pre-tool approval path and remains listed as not enforceable. A default-on policy adds a pre-tool check only where the hub sees the call before it runs, and each peer's status row says whether it does.

What is enforced, and where it is not:

| Peer | Enforced | Not enforceable (the status row says why) |
| --- | --- | --- |
| Claude (`ahub claude`) | the managed PreToolUse hook returns `ask` for a classed call in `ask`, `ask-when-needed` and `never-ask` alike, and `ask` beats every allow the hook would add | a session with no hub permission hook, or one whose attached session has not yet run it (the launch record outlives the process, so it proves nothing alone: the status row says `no live Claude session has run the hub permission hook yet`); an `--unattended` launch (`--dangerously-skip-permissions` skips every permission check, hooks included); a hub that cannot answer the hook leaves Claude's own policy |
| Kimi and other hub-owned ACP peers with a host approval gate (headless) | `session/request_permission` for a classed call is never auto-approved (not even for a hub-owned tool title), carries `Action approval (<classes>): <command>`, withholds `allow_always`, and under `ahub --unattended` still waits for a person and expires as a denial | a peer in its native `ask-when-needed` (`yolo`) or `never-ask` (`auto`) mode: Kimi sends no request for a call that mode allows, so the hub cannot see it; the status row says `its native mode never-ask sends no request for a call it allows`. Switch the peer to `ask` to enforce. A request whose payload the agent did not report is not classed (unknown follows the mode) |
| Claude headless implementer | the managed hook asks for classed calls, and the current-child-bound prompt tool accepts only a person's allow-once or denial; ask and ask-when-needed retain their native requirements | an idle/offline implementer without a current child; never-ask and unattended are refused at startup |
| Codex app-server | received command approval RPCs (v2 command execution or legacy exec) are classed before reaching the TUI; a classed request offers only allow-once/deny and an explicit bounded class-budget choice | status conservatively says not enforceable: native policy can execute without emitting an approval request; never-ask sends approvalPolicy never. writeStdin, absent/unknown payloads, file-change and permission-profile requests retain native handling |
| Local worker and Pi | every model tool call is classed at the host permit boundary before never-ask, ask-when-needed or Pi's tool-wide grant; unattended never answers a classed request. Pi replayed call ids return the stored result without spending again | an offline local worker or Pi without a verified live bridge; Pi's verified person-authored idle shell remains the person's command, not a model tool call |
| Jcode | no hub pre-tool approval path | always-ask not enforceable; its unmanaged native policy remains authoritative |

Class budgets: the approval of a classed ACP, received Codex command, local or Pi call offers one extra choice, `Allow <class> xN for this session`, when the class budget is above one. Only that choice (never an ordinary allow) spends the ledger: it allows this call and the next N-1 of the same classes in the same native session, then asks again; several requests open at once share it, so a budget of N never lets more than N approved calls through. A new native session, a changed policy or a stopped, crashed or restarted peer starts from zero, even when it resumes the same session id. A budget of one is the single call the ordinary allow already covers. Claude's own permission dialog cannot carry that choice, so every classed Claude call asks. Local/Pi show the complete tool title plus its class on the person's console, including private turns. Other surfaces retain the screened public view. Any view that remains cut (`[cut, N chars]`) or withheld offers denial only, with no allow-once or class-budget choice.

Only ignored, untracked `.agenthub/config.local.json` can hold `action_policy`. Its optional keys are `enabled` (default true), `always_ask` (a distinct subset of publish, external-write, destroy, install; default all), and `budgets` (per-class integers 0..1000; defaults 1, 5, 3, 2 respectively). Shared `config.json` cannot set this policy and gets no confirmation offer. A tracked or unknown-trust local file is ignored. Use `ahub settings set action_policy.enabled <true|false>` or `ahub settings set action_policy.budgets.<class> <n>` for registered settings; change `always_ask` in the local file and use the existing confirmed terminal reload. Policy publication invalidates cached grants and pending approval challenges. Startup reads the untracked local policy without a retained confirmation. A policy that disables enforcement, omits a class or increases a class budget appends an attention notice to every status policy row. `ponytail:` this makes weakened startup policy visible, but the startup confirmation ceiling remains open; the upgrade is retained person-bound startup confirmation.

The ledger asks first and after the approved class budget is spent. Adapter integrations must request that class allowance explicitly; an ordinary one-time answer does not seed the cache, and a cached budget never suppresses a prompt required by the native mode. One approval includes its own invocation; budget zero asks for every invocation. A fresh native session resets counters, and status polls do not bind sessions. A command with no classed literal prefix retains native permission handling; around a shell expansion the literal words are classed, and where the opaque part could change the class the strictest reachable class applies (#756, #762; [security](security.md)). This foundation never changes a sandbox or bypasses a denied permission; per-adapter enforcement tests land with their integrations.

### Floor policy: ordinary development work does not ask (#999 T3)

`action_policy.floor: true` in the untracked `.agenthub/config.local.json` stops the always-ask policy from asking about ordinary development work, and changes nothing else. It is off by default, so a machine without it behaves exactly as above; `ahub autonomy on`, and `ahub init` inheriting a machine opt-in, set it. It applies live through the confirmed terminal reload, like the rest of `action_policy`.

With the floor on, these run without a prompt wherever the hub sees the call first:

- `git push` of a literal, non-default branch to `origin`, from inside the execution root (`git push origin feat/x`, `-u`, `HEAD`, `feat/x:feat/x`, `refs/heads/feat/x`, `git -C <subdir> push ...`).
- `gh pr create`, `comment`, `review` and `merge` in the project's own GitHub repository, with no `--repo` or URL naming another one and never with `--admin`.

These still ask, with the class they always had, and so does anything the classifier cannot decide:

- Any force push (`--force`, `-f`, `+refspec`, `--force-with-lease`, `--force-if-includes`), a delete (`:branch`, `--delete`), `--mirror`, `--all`, `--prune`, `--no-verify` and a push option.
- A push to the default branch (`main`, `master` and whatever the remote names its default, in any letter case, as `refs/heads/...` or `heads/...`, or as `HEAD` while it is checked out), a push of a tag (`v1`, `refs/tags/...`, `--tags`, `--follow-tags`, or a bare name that is also a local tag), a ref outside `refs/heads`, a remote other than `origin`, and a bare `git push` or `git push origin`, which follow `push.default`.
- `gh release *`, `npm`, `bun`, `pnpm`, `yarn` and `cargo publish`, deletion outside the execution root, `gh issue` and `gh gist` calls, `gh pr close|edit|reopen|delete`, any write to another repository, mail and posting tools.
- An expansion in a position that decides the outcome (`git push origin $B`, `gh pr create --repo $R`), a wrapper the classifier cannot read (`env`, `sudo`, `timeout`, `xargs`, a leading `VAR=value`), `-c`, `--git-dir` and `--work-tree`, and a directory the classifier cannot place (`cd /elsewhere`, `cd $D`). A command whose class cannot be decided keeps the strictest class it might reach (#756, #762).

Facts the floor needs come from the host, never from the agent: the default branch from the authoritative GitHub remote read the task shell uses (not a local `origin/HEAD`; read at start and at every `action_policy` reload, and unknown until it answers, so every push asks until then), the project's own repository from its `origin`, whether a name is also a local tag, and the branch checked out in the directory. A directory counts only when git proves its top level is the peer's execution root and its `origin` is the project's repository, so a nested clone keeps asking. A fact that is missing, unreadable or unproven keeps the call asking. The policy flag is the only switch: floor facts never widen a policy that did not set `floor`, and a disabled policy asks nothing as before. With the floor on, `publish`, `external-write` and `destroy` ask whatever `always_ask` says: a coarse selector cannot hand the floor's own classes back (`install` still follows `always_ask`).

The floor also reads the checkout's push configuration and gh's default, per call. A plain `git push origin <branch>` keeps asking when `remote.origin.pushurl` or a `url.<base>.pushInsteadOf` rewrite sends it anywhere but the project's own GitHub repository (the effective push URLs are read, every one of them, not the fetch URL), when `push.followTags`, `push.pushOption`, `push.recurseSubmodules`, `remote.origin.push` or `remote.origin.mirror` can add tags, options or refs to it, or when any of those reads fails. An unqualified `gh pr ...` asks for every peer whose shell environment the hub cannot see (Claude, Codex, Kimi, Qwen, Jcode, agy), because a `GH_REPO` exported there would redirect it and the hub cannot read it; only an explicit own `--repo`, `-R` or pull request URL runs. For Pi and the local worker, whose command environment the hub builds, an unqualified call runs only when `origin` is the checkout's only remote, no `gh repo set-default` marker names another repository, and the hub's own environment sets no `GH_REPO`, `GH_HOST` or `GH_ENTERPRISE_TOKEN`; a call that names the project's own repository does not depend on gh's default. A wrapper (`env`, `sudo`, `timeout`, `xargs`, a leading `VAR=value`) takes the floor away from a shell it wraps. A `git fetch`, a test or build run (`bun test`, `bun run build`) or `rg --pre` earlier on the same line also ends the floor for the rest of the line, because it can create tags or run the agent's own code. A `gh pr` call is read option by option: an option's value (a `--body` holding a pull request URL) never selects a repository, and an option the floor does not know asks. One classification reads at most 16 distinct facts through one shared budget (every git read and the project origin query alike), answers an identical read once and answers none after 2.5 s, so a long chain of pushes cannot hold the daemon; past the bound a fact is unknown and the call asks. A command earlier on the same line that can change those facts (`git config`, `git remote`, `git checkout`, `git tag`, `export GH_REPO=...`, `gh repo set-default`, any redirect, a script, an unlisted program) ends the floor for the rest of the line; `git add`, `git commit`, `git status`, `git diff`, `git log`, `git fetch`, `bun test`, `echo` and a push the floor itself allows do not.

Where the hub cannot see a call first (Codex in `never-ask`, Kimi in `auto`, Jcode, a session without the hub hook), the floor cannot be enforced by the hub. `ahub status` says so on that peer's action policy row, with `floor on:` and the structural guards the floor rests on, which the hub names and has not verified: GitHub branch protection on the default branch (force push, default-branch and tag pushes), release only through `ahub sdlc authorize-release` and the OIDC tag workflow (`gh release`, release tags), and the peer's native sandbox (deletion outside the project, writes to another repository). A missing guard is for the person to report. Status marks the floor as a weakening on every policy row (`attention`), like any other policy that asks less.

The floor changes approval prompts only. No sandbox, deny list, PII rule, path guard or trust check changes, and the person-only flow (release tag consent, logins and trust settings) stays the person's.

A project whose raw `config.json` or `config.local.json` names `action_policy.floor` at all (true or false, enabled or not, ignored as a shared-file key or not) cannot be upgraded or recovered onto a release that predates the key, because that release rejects an unknown `action_policy` key and the project would not load there. The daemon advertises the `action_policy_floor` feature, and a controlled recovery (`prepare`, `commit` and a target-checking `inspect`) refuses a target without it, naming `target lacks action_policy_floor`, before any effect. A project without the floor is unaffected.

## Permission modes for running peers

Use a plain terminal to inspect or change a running peer:

```bash
ahub permission
ahub permission local ask-when-needed
ahub permission kimi never-ask --yes
ahub permission kimi ask
```

In the console Peers panel, `m` opens the three modes. Never-ask requires `y`,
even for a typed command carrying --yes. Its confirmation says whether the peer
uses its own tools outside the hub sandbox (Kimi), the hub sandbox/path guard/
denylist (Pi and local), or native vendor boundaries (Claude and Codex).

| Peer | ask-when-needed | never-ask | ask |
| --- | --- | --- | --- |
| Kimi Code CLI | ACP yolo | ACP auto | ACP default |
| Codex | on-request for every outgoing turn/start | never for every outgoing turn/start | Restore the known native policy once, then stop overriding |
| Claude | Allow resolving project file tools outside .agenthub/.git/.claude/.codex/.qwen/.kimi/.kimi-code/.jcode/.pi/.mcp.json/.agents/.agent/_agents/_agent/.gemini/.grok/.claude.json | Hook allow for every tool | No hook decision |
| Pi and local | Grant write/edit outside native agent configuration paths and proven read-only shell calls; other shell/git writes ask | Grant each tool once within the existing sandbox/guard | Normal approval handling |

Kimi's map applies only to the actual Kimi Code CLI identity, not another ACP
agent configured in kimi_cmd. Qwen and other ACP agents start fresh/resumed
unmanaged without mode changes or mode-based startup refusals; runtime changes
are refused until their own map exists.
A set_mode timeout leaves the peer offline with mode unknown; inspect and
restart before using it. Missing ids and refused startup changes name the mode.
The benign Kimi live check verifies file edits and harmless shells in both
modes without requests; risky-action behavior remains unverified.

Claude's hook is installed in every managed launch. File grants use canonical
real paths under the authenticated project root. Missing targets, symlink
escapes, metadata directories and uncertain wildcard targets leave the native
rules in charge. Grep/Glob path-bearing filters cannot bypass the exclusions.
Other tools retain native decisions, which may already allow a harmless shell.
Permission-only PreToolUse never marks Claude busy; former observation hooks
retain their native-turn role. Settings are passed as a 0600 state file retained
until that native launch exits. Live/unknown previous launchers keep their files;
verified dead wrapper and native identities permit crash cleanup. Managed direct
binary launches record their native PID while running; crash cleanup also requires
that PID to be absent from the process table. Scripts/interpreters and unavailable
process evidence retain the settings file. Every launch atomically replaces
`claude-launch.json` with its current managed hook/session identity. Native PID
proof is separate in a private `claude-native-<binding-hash>.json` file, so an old
callback cannot overwrite a newer launch record. Only that native proof uses
`claude-launch.lock`, published with its signed owner already written. It waits
up to 250 ms for a verified live owner. An empty, unsigned or unverifiable lock
is retained and disables native identity/crash cleanup for this launch; the
warning names the path and what is off. Managed hooks and session observations
still use the newly published launch record. Inspect the named lock and verify
its owner has ended before removing it; a signed dead lock is recovered. Without
separate native identity proof, old settings remain for manual inspection. Settings carry
no inline caller values in argv. Status reports an unverified Claude hook as
unverified. Unattended native sessions cannot take a runtime mode; restart
without that native flag. Codex must be behind the hub proxy, and returning to
ask while attached requires a known native approval baseline. If unavailable,
close the TUI, then run `ahub permission codex ask` before starting `ahub codex`.
For a known baseline, a detached proxy keeps restoration owed per thread and sends
that policy once on the resumed thread's next accepted turn. Visiting another thread
does not clear the debt. The restoring turn uses that kept baseline even if the
TUI echoes the resume response's sticky override, whether ask was selected before
or after that resume. Rejected turns retain it. The protection covers that one
restoring turn. A later TUI turn that repeats the policy looks exactly like a
person's explicit native policy choice and is passed through; the proxy cannot
resolve that ambiguity. An explicit choice on the restoring turn is delayed
until the following turn. A baseline that was never reported
is explained in the CLI reply, and that old thread keeps its last policy.
An offline or absent peer accepts
`ahub permission <peer> ask` to clear its hub choice. Codex --unattended launch
is refused under a non-ask choice; clear it with `ahub permission codex ask`
first. A pending never-ask default cannot be confirmed for an unattended launch.

Project defaults use permission_modes in .agenthub/config.json or
.agenthub/config.local.json. Keys merge per peer; a local ask overrides the
same peer's earlier default, while an empty local block preserves it. Every
non-ask default start logs its mode and contributing filename. Automatic
config effects stop at ask-when-needed. Git-tracked defaults are ignored and never
offered for confirmation. Never-ask from an applied untracked file starts in ask
and appears as a pending source-labelled console question at hub start.
Only its separate console y enables that default; there is no boot --yes
bypass. Only explicit n declines and keeps ask for that hub. Esc defers without declining
and leaves approval keys usable; a refused y is not reoffered until its state changes. A successful runtime change removes that pending default. Runtime choices expire when the hub
stops, and a later restart asks again for a never-ask config default.

The CLI marker and console-role checks are operating policy, not a hostile-agent
boundary. An agent able to run unrestricted shells may clear its markers,
use --yes, or read the control token and act as the console. Hub tools,
conductor operations and ordinary agent messages have no direct mode-changing
or startup-confirmation operation, but those checks do not contain such a
shell. Review the boundaries in [security](security.md) before choosing a mode.
Modes never alter native sandboxes, hub path guards or denylists.

Permission mode starts reconcile the current operator choice after native startup before bus delivery. Each non-ask start logs the mode and its config or runtime source. Dropped git-tracked defaults never appear as startup confirmations. Non-Kimi ACP peers run unmanaged, preserving their native fresh/resumed mode; permission commands refuse changes until a vendor map exists.

Status shows non-ask modes and pending defaults, and each runtime change emits
permission_mode (peer/from/to) with no tool arguments under events schema 1.
The optional control requests preserve PROTOCOL; an older hub answers unknown
and the CLI advises upgrading.

### Where a person is asked to confirm: the inventory (#999 T0)

`templates/presets/confirmation-matrix.json` lists every place a person is asked to confirm during a standard task, for each agent kind (claude, codex, kimi, qwen, jcode, pi, local, agy) and each environment (plain terminal, Orca, headless). Each row names what is asked, which keys control it today (`permission_modes.<peer>`, `permission.<peer>`, `action_policy`, `tasks.auto_pull`, `task_sweep.auto_reassign`, `peers.<peer>.start_mode`, `terminal.open`, the peer's native config, and the launch and merge keys), whether the hub sees the call before it runs (`yes`, `partial`, `no`, `unknown`) and who asks (the hub console, the native TUI, both, or nobody). The data is model-free: it was read from the code and from this guide, and a fact that could not be established is the word `unknown` in the structured field (`hubSeesBeforeRun` or `askedBy`) and in the row's `unknowns` list, never in prose alone. A native TUI asker is claimed only on a row that is TUI-only. Qwen's dual-output TUI has separate rows for a turn the hub delivered (the hub asks) and a turn the person typed (only Qwen's own prompt).

The inventory changes no default itself. The project autonomy status below reads its confirmation facts and unknowns. `test/confirmation-matrix.test.ts` fails when a kind in the adapter catalog has no row in an environment it can run in, when the matrix's facts about a kind (forms, pull-only forms, conductor start, whether the hub maps a mode) differ from its `AdapterDefinition`, when a row names a key the matrix does not describe, or when a cited source line no longer exists. Adding a peer kind means adding its rows there. `templates/presets/autonomous.json` and `ahub autonomy status` use this inventory.

### Project autonomy: one preset and one confirmation (#999 T1)

Run `ahub autonomy on` from a person's terminal. It previews the concrete settings and their apply timing, then confirms once; a changed file, preset plan or configuration revision requires a fresh preview; `ahub autonomy on --yes` supplies that confirmation for a typed command. The shipped `templates/presets/autonomous.json` holds the kind and environment rows. This project receives `tasks.auto_pull`, the task sweep switches, `action_policy.floor`, supported permission defaults and start defaults through the existing validated settings writer.

`ahub autonomy off` removes the fixed shipped preset keys and retained consent, regardless of missing, forged or stale ownership metadata, so the local permission and task-flow values fall back to their inherited defaults. Unrelated settings stay. Reapplying on over unverified metadata overwrites the requested preset keys and issues fresh metadata. Authenticated metadata preserves prior originals for precise `ahub settings undo` after the person types `autonomy`; if its private undo witness does not verify, undo removes the fixed preset keys and clears consent instead, and reports that fallback. A precise authenticated undo still refuses if the file changed since that write. A preset write made while the hub was stopped (offline on, a stopped `--all-projects` target, init inheritance) has no undo witness, so a later undo takes this fallback. Project metadata proves no approval.

On a running hub, the on confirmation retains peer-specific consent under the machine hub home, outside the project and its execution roots, authenticated and bound to this project and the exact per-peer permission-mode values the person confirmed. A project-file marker or a forged state row cannot confirm never-ask. Missing or changed evidence keeps the ordinary per-peer console confirmation; changing one peer's mode invalidates that peer's consent. Start defaults and action-policy changes do not invalidate mode consent. Off and preset undo remove retained consent, so restoring a never-ask value with undo needs a new on confirmation, or a hub start under a trusted machine opt-in when the value exactly matches the preset plan, to retain it again. An agent shell, a delegated live-test command, a tools connection and the conductor cannot turn autonomy on or off. No hub tool exposes it.

`ahub autonomy status` starts with a padded peer table of current effective modes and preset next-start defaults (`unmanaged` when no mode is requested). Guarded actions follow, grouped by identical class, verdict and reason, with the affected peers (or "all peers") and counts of classes and classes enforced for at least one peer. Shared unknowns are printed once with their peer lists; floor-shaped missing entries are not repeated. Machine-default and Claude-home notices are retained, and paths under the user's home appear with `~`. Reasons and unknowns keep their original text. `--json` returns the unchanged structured report; an older hub without structured peers keeps the legacy line output. Plugin, native policy, terminal provider and GitHub branch protection are reported as missing or unknown when no current evidence establishes them. Orca uses the existing registered worktree opener; a custom `terminal.open` template is preserved. A headless or CI invocation selects headless defaults where the kind supports them. With the hub stopped, status reads only the project configuration: effective modes and retained consent are reported unknown, and every floor class is not enforced.

A controlled restart or upgrade checks target feature `project_autonomy` while preset metadata or retained consent is active. A target without it is refused before the source is held or stopped; it could not read the new config metadata. Turn the preset off before selecting such a target.

Live config switches apply through scoped reload now. Permission and start defaults apply at the next peer start; an active native turn keeps its policy. `ahub autonomy on` writes one action_policy key, `action_policy.floor: true` (#999 T3, see "Floor policy"), and `off` removes it; it writes no other action_policy key. Status takes each floor class from the running policy and where the hub sees that peer's calls: hub-enforced only for a peer whose calls the hub sees first while `action_policy` asks for the class, otherwise not enforced with the reason, naming the guard the class rests on and that the hub has not verified it. A class with no named guard (package publish, mail and posting) says so. The hub never reports a structural guard as holding on its own. The shipped ask default, sandbox, deny, PII and trust rules stay. Machine-wide defaults, `--all-projects`, init inheritance and Claude profile-home setup are described in "Machine autonomy and Claude homes" below.

### Machine autonomy and Claude homes (#999 T2)

`ahub autonomy on [--yes]` also writes the machine opt-in to `~/.agenthub/defaults.json` (or the selected hub home), and `off` disables that default. The file holds only its schema and opt-in; the shipped preset remains the source of settings. It is written as an owner-only 0600 regular file. Unsafe ownership, writable permissions, links, malformed schema or a location inside a project make the file ignored with a notice. A machine with no trusted opt-in keeps the shipped ask behavior. `settings undo` affects the project write, not this machine file.

Add `--all-projects` to apply on or off to every registered project. On previews all targets before one confirmation. A live hub uses its existing console transaction; a stopped project, with or without `--all-projects`, uses the same preset planner, validated writer and fixed off-key list while holding its registry claim. No daemon is started to write settings. Preview refusals prevent on from changing any target; apply failures name the affected projects and report the partial result. Off disables the machine default even when an unavailable project cannot be updated. Manual changes to fixed preset keys are removed by off, as in the project command.

A newly initialized `ahub init` project inherits a trusted machine opt-in and says so. Refreshing an existing project does not reapply the default. Offline apply and init create no HMAC consent or witnesses. Offline off may only revoke existing consent under the stopped project's registry claim; a revocation failure names the project and reports failure rather than off success. At startup the daemon can create retained permission consent only when the trusted machine opt-in exists and the local never-ask value exactly matches the preset plan for the environment. Explicit Orca/CI evidence selects those rows; a detached daemon otherwise uses terminal defaults. Without both facts, the ordinary console confirmation remains. Project metadata never supplies machine opt-in authority.

`ahub setup` selects the explicit `CLAUDE_CONFIG_DIR`, otherwise an existing default Claude home (or the not-yet-created default when no other home is selected), plus distinct homes proven in use by live registered Claude launcher records. It does not scan arbitrary profile directories. Each native plugin command receives that home's environment. One confirmation covers plugin setup and a project-neutral PreToolUse hook while preserving unrelated hooks and statusLine settings. The profile fallback requires the inherited hub state and peer identity and does nothing for a managed launch that already has its session hook, preventing duplicate delivery. Installing a hook proves configuration, not live enforcement.

Setup preserves a stable package alias from the `ahub` executable on PATH only
when its bounded symlink chain (at most eight leaf links) ends at this running
package's `src/cli/main.js`. A versioned install can therefore keep its `current`
parent alias in marketplace and profile-hook paths across upgrades. Another copy
on PATH, a missing target or an unproven alias uses the resolved running package
instead. The hook uses the PATH spelling of `bun` only when it resolves to the
same runtime as this process; otherwise it keeps the observed runtime path.

The generated single-command profile-hook shape identifies managed entries,
including entries from an older install whose script is now missing. Setup
replaces the first managed entry in place and removes duplicate managed entries,
preserving that entry's matcher/timeout metadata, unrelated hook commands and
statusLine.
Doctor reports missing managed script or runtime paths in every home it inspects.
Its read-only inventory also includes an existing default Claude home even when
`CLAUDE_CONFIG_DIR` selected another home for setup; that inspection neither
selects the default home for writes nor repairs it automatically. Run setup for
the intended home to refresh its managed hook.

Setup manages only the user-scope `agent-hub@agent-hub` plugin row (`claude
plugin install|uninstall ... --scope user`). A project- or local-scope row of that
plugin is kept and named in a notice (`... plugin row preserved ...; setup never
removes non-user scopes`). While such a row exists, setup is blocked rather than
removing an agent-hub marketplace that points at another source (#1073). The
refusal names every blocking row's scope, projectPath, version and installPath.
Hub-launched Claude sessions load their plugin from the hub's release runtime,
not those plugin-cache rows; standalone sessions may still use them. Back up the
selected home's `plugins/installed_plugins.json`, review every listed row, and
manually remove only rows confirmed stale and unused while preserving all other
rows; then rerun `ahub setup`. For a project row whose projectPath is `$HOME`, do
not run `claude plugin uninstall --scope project` from `$HOME`: its project
settings path is also the default home's `~/.claude/settings.json`. Setup leaves
these non-user rows unchanged on refusal. The semver check on installed plugin versions applies only to agent-hub rows, so
another plugin recorded with a git SHA no longer fails the inventory (#1074). When
a Claude home step fails, setup still records the `start.agents` answer before it
reports the failure.

Updating a project's daemon does not update the global CLI or shared plugin.
When a global CLI update is needed, upgrade and doctor guidance resolves the
`ahub` package on PATH independently of the executing staged daemon or `bun x`
coordinator. Outside a proven Bun-global prefix it names that installation path:
update it using the method that installed it, then run `ahub setup`. A Bun-global
command is suggested only for a PATH-selected package verified inside that prefix.
An unknown PATH installation gets generic update advice without an inferred path.
Handoff wire-version refusals keep fixed guidance to update the older hub and the
global CLI the way it was installed; `ahub doctor` names the exact step.

`ahub autonomy status [--json]` includes the machine default and each discovered Claude home's plugin/hook state. Missing, unsafe, stale, unavailable or incomplete evidence is explicit; a missing selected home is reported without starting a native inventory command that could create it. The native Orca zero-prompt receipt remains T4.


## Change the participating peers while the hub runs

`ahub roster` or `ahub roster list` lists every known peer, whether it participates, its start mode,
current state, queued messages and open tasks. `ahub roster --json` is the same
ordered catalog view for scripts. Status and the console keep their existing lazy
rows; an off-roster peer is shown only while it has retained messages, an uncertain
delivery or open work, with the words `off roster`.

```bash
ahub roster
ahub roster remove kimi --yes         # print the preview, confirm and remove
ahub roster remove kimi --yes --now   # stop a busy owned runtime before handing work over
ahub roster add kimi
ahub settings set roster.kimi false --preview
ahub settings set roster.kimi false --yes
```

These are the person's commands (`roster add|remove` also the configured conductor's,
see [the operational command table](#conductor-operations-812-t2-933-900)) and use the same settings preview, write and undo as
the dashboard's Roster settings. An ordinary dashboard session may remove a peer;
adding requires `ahub ui --settings` or a person's terminal. Removal requires the
peer id as confirmation. Without `--now`, a busy peer is refused. A conductor
holder cannot be removed until its role is moved.

Removal fences membership, stops hub-owned runtimes or detaches sessions in a
person's terminal, and then hands work over. The removal preview and result name
the peer whose existing work the person must stop in that retained terminal;
the preview names the roles offered and those with no eligible replacement; the
result lists the saved owner/reviewer moves and every assignment that stays. No stop notice is forced into
a detached session and nothing bypasses the journal. Codex 0.146.0
exits its TUI on the close-4000 disconnect and does not reconnect automatically.
Its app-server and proxy remain available; after `ahub roster add codex`, run
`ahub codex resume <thread-id>` (the full id is printed in the preview, removal
result and return) or `ahub codex resume` to select its previous native session. Removal never closes
the terminal window itself. The Claude channel retries and reconnects on return.
Pi return retains the verified owner's monotonic generation even after refused
native activity while detached; it shares no personal output and invalidates any
cached empty-session resume proof after that activity. Return also needs the
current hub extension, which fences prompt admission: a TUI still running an
older extension is refused (restart its retained terminal), and a return whose
snapshot raced native activity is refused until retried. When personal TUI
activity overtakes a hub prompt, Pi is detached: a prompt the extension proves it
never inserted returns to the queue, anything else is held as `needs_review`.
It leaves queued and held deliveries, and existing manual or budget pauses,
untouched. The queue listing names `off roster` as the membership hold. Returning
and starting the peer makes retained queued messages available again; held
uncertain work still needs the existing queue resolution command. A detached
personal Pi TUI with a live owner still blocks controlled recovery as `pi is not
settled`; end that retained TUI before restart/upgrade. The hub does not declare
a live native owner settled or close it implicitly during preparation. Open owner and
reviewer work, including ownership of `in_review` tasks, is offered through the
existing reassignment path; a transferred review keeps its review state. If nobody can
take it, its assignment stays and a notice names the person's next action. Task
text in a notice uses its public title, so a private task remains a stub. A stop
that is unconfirmed leaves the roster saved and reports that permission reset and
handoff were not attempted; reapply the removal after checking the runtime.

A hub task, verdict, review or budget message addressed to an off-roster peer
stays in its retained queue, with one public notice to the person. Task operations
use the current owner and reviewer after reassignment. A mixed addressed audience
receives the on-roster copies now and retains the off-roster copies; the sender
sees the existing notice field (or a decision note for native answers). Broadcasts
exclude off-roster peers; a person or agent addressing only removed peers is
refused before publishing. The dashboard roster undo has its own peer-id
confirmation and optional active-turn stop checkbox.

Without a roster setting, participation keeps the previous defaults. An explicit
`roster.pi` overrides `pi.enabled`; otherwise that legacy switch continues to
control Pi starts. External peer ids remain governed by their existing admission
rules. A runtime permission override is cleared on removal and the configured
default governs the next attachment. Config file edits outside the authorized
roster setting do not change running participation: they take effect at the next
hub start. The tracked config can provide defaults and config.local.json can
override them.

## Live peer model overrides (#1317)

From a plain person terminal, select the next model of a supported peer without
restarting the peer or reloading project configuration:

```bash
ahub model set claude-impl claude-sonnet-5-5
ahub model set codex gpt-5.1-codex
ahub model clear claude-impl
ahub model list
ahub model list --json
```

Use a model id available through the peer's existing provider.
Model ids are one bounded token: letters, digits and `._:/@+-`, at most 128 bytes,
no spaces and no leading dash. Agent shells and every hub-tool caller are
refused, including list; a conductor role does not grant person authority.
The dashboard Peers action uses a person settings session and preview/confirm,
not an agent command or an ordinary dashboard permission escalation.

An override is desired runtime state in `hub.db`. It survives daemon restart;
`ahub reset` clears it with runtime state. Precedence is override, instance
model, launch model, then native default where that surface supports them.
Clear restores the existing lower-priority selection. For Codex app-server,
an explicit client model always wins over hub injection. A `turn/start` model
becomes the native thread default, so clear may retain that current default;
it does not recover an earlier model. Raw/pull-only native TUI attachments remain
unsupported. A retained former override is labelled `native thread default (was override)`;
a rejected start leaves the next start free to sample a corrected selection.
The model and its source appear in `ahub status` and JSON output. An unknown native default remains
unknown. When no override, instance, launch or native baseline model is known, the
last model a finished turn reported is shown with source `observed (served)` or
`observed (session)` (#1402); a `configured` grade is never shown, and the
observation is dropped when the peer goes offline or its adapter is replaced. `pending next turn` means the desired value has not been acknowledged
at an eligible boundary; it does not claim the current turn changed models.

Changing a desired value during a turn leaves that turn unchanged. Steering and
local tool rounds keep the captured selection. If the person changes it twice
before the next turn, only the last desired value is selected there. A stale
callback cannot mark a newer desired value or another adapter owner applied.

T1 supports headless Claude implementer turns, supported Codex app-server turns,
fresh codex-review spawns, the local worker and Pi. Native account/provider
availability is still the backend's responsibility. Headless Kimi Code CLI 2.5.2
also supports next-turn selection through its receipt-backed ACP model setter.
It requires the existing native identity admission, an exact-version receipt,
an owned current session and advertised model choices. Clear restores the
validated session baseline. Kimi reviewer isolation and version qualification
are separate and unchanged.

Jcode, Qwen, other Kimi versions and native TUI forms remain `unsupported live`.
The [Jcode headless fixture](verification/2026-11-08-jcode-0991-model-setter-1317.md)
passes, but does not fence a shared TUI turn across native failover. The
[Qwen 0.26.9 setter fixture](verification/2026-11-08-qwen-0269-model-setter-1317.md)
retains historical A/B/B with an unknown third-request purpose. The
[suggestions-off repeat](verification/2026-11-11-qwen-setter-suggestions-off.md)
records ordinary A/B/A on exact 0.26.9 and 0.27.0; separate production setter
admission is still required. Neither fixture enables a production setter.
A refused set writes no new override and never restarts a process. Follow the
reported cause and `ahub restart <peer>` guidance for unsupported forms.

This does not make `instances.*.model` or `*_cmd` live or editable by agents.
Their existing machine-local tier 3 confirmation and restart behavior remains.
The plural `ahub models` still manages the existing local model service; it is
separate from the singular per-peer `ahub model` command. `model_change` records
ids and the next-turn boundary, never prompts or credentials.

Model display is bounded to 512 local identities. If legacy sessions exceed the
view budget, list refuses explicitly and status/dashboard mark model data
unavailable; they never call a truncated list complete. Close unused native
sessions, clear obsolete overrides and follow the restart guidance. Single-peer
set/clear remains usable and no process is restarted automatically.

## Settings from the dashboard and the terminal

In `ahub console`, press `6` for Settings. Existing operational-tab arrow cycling
is unchanged; from Settings, Left returns to Events and Right to Peers. Select a
row and press `e` to edit: value, daemon preview, nonempty reason, then `y`. Press
`u` to preview and confirm undo. Undo binds the key and exact undo-record digest;
if another write replaces that record, preview again. For busy roster removal,
the panel names `ahub roster remove <peer> --now`, which explicitly stops an owned
runtime or detaches a native session during its active turn; the panel does not force it.
Esc cancels, and pasted confirmation text cannot
write. This panel uses the current authenticated daemon connection. `c` edits
structural configuration and `R` prefills `restart` while a restart is pending
(see [Structural configuration](#structural-configuration-from-the-console-and-the-dashboard-issue-689)).

The dashboard's Settings section and `ahub settings` show and change the same
closed list of settings (issue #269). Run them from a plain terminal:

```bash
ahub settings                      # every setting: value, source file, when it applies
ahub settings get permission.kimi
ahub settings set routing.classes.implement.peers codex,kimi,pi --preview
ahub settings set routing.classes.implement.peers codex,kimi,pi
ahub settings set permission_modes.kimi ask-when-needed
ahub settings set research.enabled inherit   # remove the machine-local value
ahub settings undo                 # put back the file the last write changed
ahub settings reload               # validate and apply the complete four-file candidate
ahub ui --settings                 # dashboard with a 15-minute settings session
```

A guarded file edit that the daemon keeps at its accepted value remains visible as `config retained: <keys>; run ahub settings reload` in status, the console and Settings. The entry clears when the file value is confirmed through the terminal reload or reverted. Starting a peer whose launch keys are retained first explains that it uses the running value; the pending file value is not applied merely by restarting that peer. Public status and notices show key names and reasons, never the retained setting values.

| Group | Keys | Stored in | Applies |
| --- | --- | --- | --- |
| Permissions | `permission.<peer>` (the mode now) | the running hub only | at once |
| Permissions | `permission_modes.<peer>` (the default mode) | `config.local.json` | next peer start |
| Start | `peers.pi.start_mode`, `peers.codex.start_mode`, `peers.kimi.start_mode`, `peers.jcode.start_mode` (`tui` or `headless`) | `config.local.json` | that peer's next start |
| Start | `pi.auto_start` | `config.local.json` | next startup/recovery auto-start decision; never starts a peer merely on reload |
| Start | `start.agents` (peer list; `none` for an empty list) | `config.local.json` | next use; the next person's `ahub up` reads it |
| Routing | `routing.stay_switch`, `routing.classes.<class>.peers`, `.escalate_to`, `.route`, `.pi_backend` | `routing.local.toml` | at once |
| Switches | `research.enabled`, `approvals.notify`, `snapshots.enabled` | `config.local.json` | live, without disturbing an active turn |
| Switches | `coordination` | `config.local.json` | newly created tasks only |
| Switches | `worktrees.quiet_days` (0-3650, default 7, 0 never shelves by quiet time), `worktrees.alert_over` (0-100000, default 10, 0 never alerts) ([worktree shelf](#the-worktree-shelf-1057)) | `config.local.json` | live |
| Switches | `task_sweep.enabled`, `.auto_reassign`, `.interval_s`, `.unaccepted_min`, `.idle_min`, `.review_min`, `.ready_min`, `.ladder_min`, `.no_writes_turns` | `config.local.json` | live; `.no_writes_turns` sets the turn threshold independently; other keys reschedule the sweep timer |
| Routing | `tasks.wip_limits.<peer>` | `config.local.json` | live |
| Routing | `tasks.escalate_after` (1-10, default 3: consecutive `changes_requested` before a task moves to the next `escalate_to` peer) | `config.local.json` | live; the next verdict uses it |
| Routing | `tasks.groom_fyi_window_min` (1-1440 minutes, default 10) | `config.local.json` | live; the next planner-notice flush uses it; planning-change task notices are unchanged |
| Routing | `tasks.demote_at` (0.5-20 decayed recent failures, default 1.5) | `config.local.json` | live; the next demotion read (routing, `ahub route explain`) uses it |
| Routing | `tasks.demotion_half_life_h` (1-168 hours, default 24) | `config.local.json` | live; the next demotion read uses it |
| Routing | `tasks.contradiction_window_days` (1-90 days, default 7) | `config.local.json` | live; the next changes_requested verdict uses it |
| Routing | `tasks.rescreen_max` (1-100 attempts, default 10) | `config.local.json` | live; the next release-timer re-screen uses it |
| Routing | `tasks.split_min_observations` (3-100 measured tasks, default 5) | `config.local.json` | live; the next shadow split prediction uses it |
| Routing | `tasks.split_max_failure_share` (0-1, default 0.3) | `config.local.json` | live; the next shadow split prediction uses it |
| Switches | `tasks.auto_pull` (default off: pull the top explicitly reserved ready card when a slot frees, a backlog plan or dependency approval readies it, or its peer first attaches idle) | `config.local.json` | live; the next trigger uses it |
| Routing | `tasks.queue_backpressure.max_queued` (0-10000), `.max_oldest_s` (0-604800); 0, the default, disables each ([backpressure](#queue-backpressure-on-automatic-task-offers-800)) | `config.local.json` | live |
| Roles | `planner` (one or up to eight planner holders) | `config.local.json` | at once |
| Routing | `bus.max_attempts` (1-100 attempts, default 3) | `config.local.json` | live; next safe-failure retry evaluation, retaining existing counts and quota pauses |
| Routing | `bus.digest_max` (1-10 originals, default 10) | `config.local.json` | live; next push/attached-channel take, with poison-alone and remote-singleton rules |
| Routing | `bus.pull_budget_bytes` (1-65536 bytes, default 65536) | `config.local.json` | live; next pull-only read, oldest first; the first oversized item still goes |
| Routing | `bus.notes_kept` (1-10 notes, default 10) | `config.local.json` | live; next shared-note or failed-preface merge; existing prefaces remain unchanged on reload |
| Routing | `bus.terminal_history_limit` (1-2048 rows, default 2048) | `config.local.json` | live; next normal terminal settlement; unresolved rows and retry ancestry stay protected |
| Routing | `bus.accepted_settle_ms` (1000-86400000 ms, default 600000) | `config.local.json` | live; the next accepted-channel timeout sweep, approximately every five seconds |
| Routing | `recovery.reconnect_wait_s` (600-3600 seconds, default 600) | `config.local.json` | next use; the next managed-terminal attachment wait of an upgrade recovery reads it once, at its start |
| Routing | `recovery.unmanaged_reconnect_wait_s` (90-900 seconds, default 90) | `config.local.json` | next use; the next unmanaged Claude reconnect wait reads it once, at its start |
| Routing | `recovery.control_timeout_s` (30-300 seconds, default 30) | `config.local.json` | next use; the next control request of the recovery coordinator to a hub reads it |
| Routing | `recovery.shutdown_wait_s` (30-300 seconds, default 30) | `config.local.json` | next use; the next wait for a committed source to stop reads it once, at its start |
| Routing | `recovery.terminal_idle_wait_s` (30-600 seconds, default 120) | `config.local.json` | next use; the next wait for a terminal to go idle before it is closed reads it |
| Start | `adapter_timing.acp_tool_ceiling_min` (1-120 minutes, default 60) | `config.local.json` | next use; a new ACP launch captures it; effective ceiling is at least the watchdog |
| Start | `adapter_timing.acp_activity_batch_ms` (10-50 ms, default 50) | `config.local.json` | next use; a new ACP launch captures its activity batch delay; pending flushes are unchanged |
| Start | `adapter_timing.jcode_steer_timeout_s` (5-60 seconds, default 5) | `config.local.json` | next use; a new Jcode launch captures one total native steer deadline |
| Routing | `model_relay.cooldown_failures` (1-100, default 3) | `config.local.json` | restart; consecutive transport/startup failures before cooling an alias |
| Routing | `model_relay.cooldown_s` (1-300 seconds, default 30) | `config.local.json` | restart; initial cooldown and recent-failure window |
| Routing | `model_relay.cooldown_cap_s` (300-3600 seconds, default 300) | `config.local.json` | restart; cooldown cap, never below the initial cooldown |
| Routing | `model_relay.terminal_history_limit` (1-1000 records, default 1000) | `config.local.json` | restart; only tightens retained closed-request history |
| Routing | `inference.backoff_min` (1-60 minutes, default 5) | `config.local.json` | restart; failure backoff for optional inference, interactive calls exempt |
| Routing | `inference.digest_min_items` (1-100000 items, default 5) | `config.local.json` | restart; existing condensation threshold |
| Routing | `inference.digest_min_chars` (1-10000000 characters, default 8000) | `config.local.json` | restart; existing condensation threshold |
| Start | `console.poll_ms` (2000-60000 ms, default 4000) | `config.local.json` | next use; next console launch captures its refresh interval |
| Start | `console.notice_ms` (10000-60000 ms, default 10000) | `config.local.json` | next use; notice visibility may only lengthen |
| Start | `console.history_limit` (1-100 commands, default 100) | `config.local.json` | next use; only tightens transient command history |
| Start | `console.pending_stream_limit` (1-1000 events, default 1000) | `config.local.json` | next use; only tightens offscreen stream buffering, with omitted counts |
| Start | `console.attention_limit` (1-1000 messages, default 1000) | `config.local.json` | next use; only tightens transient message attention entries |

### Operational numeric settings (#489 H1)

Numeric operational conversions use the existing settings writer, loader and
reload path. A fixed row in `src/hub/operational-settings.ts` supplies the key,
unit, default, bounds, apply class and console/dashboard metadata. The closed
`config-apply.ts` schema still names each leaf explicitly; there is no dynamic
registration, extra configuration file, environment knob or per-call override.
`configApply` and the UI row consume the same metadata. The default enters the
existing `DEFAULT_CONFIG`; unset therefore keeps the previous value.

The worked H0 conversion is `tasks.groom_fyi_window_min`, the spacing between
state-only planner board-update FYIs. Its range is 1-1440 minutes and its
default is the existing 10 minutes. A settings-session or terminal change takes
effect at the next notice flush, without restarting a peer or altering task
ownership. It does not delay new planning/dependency task notices. Removing a
local value inherits the shared value or default through the ordinary settings
undo/write path. This new key grants no conductor authority.

For a later operational group, add its metadata row, exact schema leaf,
default and runtime config read, then its settings-table entry and independent
pin against the original constant. Test schema/UI bounds and apply-class parity,
inherit/undo and the real runtime boundary. H0 safety floors and contract
constants stay outside this table. Exposing a floor requires schema bounds that
permit tightening only, tested for that floor; UI `floor` metadata alone does
not enforce a safety ceiling. This H1 example changes no safety floor, protocol,
wire format or storage contract. The remaining H0 conversions belong to later
area PRs.

#### Tasks and routing conversions (#489 H2)

Six more operational numbers use the same fixed rows, all `live`, `risk: raises`, config store, with the
default equal to the constant it replaces (each pinned by a literal in `test/operational-settings.test.ts`):
`tasks.demote_at` (DEMOTE_AT), `tasks.demotion_half_life_h` (DEMOTION_HALF_LIFE_MS),
`tasks.contradiction_window_days` (CONTRADICTION_WINDOW_MS), `tasks.rescreen_max` (RESCREEN_MAX),
`tasks.split_min_observations` (SPLIT_MIN) and `tasks.split_max_failure_share` (SPLIT_FAILURE_SHARE). Each is
read where its constant was used, so a change applies at the next demotion read, verdict, re-screen or
prediction without a restart. The split thresholds only feed the shadow prediction, which never changes
assignment. None grants conductor authority.

The H0 operational items of `tasks.ts`, `routing.ts` and `task-sweep.ts` that stay as they are (42 listed, 6 converted here, 1 in H1):

- Already settings, so nothing to add: `task_sweep.interval_s`, `unaccepted_min`, `idle_min`, `review_min`, `ready_min`
  (both uses), `ladder_min` and `no_writes_turns` (the H0 rows are the defaults of the existing keys), `tasks.escalate_after`
  (ESCALATE_AFTER), `tasks.wip_limits` (the default of 1) and `tasks.groom_fyi_window_min` (H1).
- Already `routing.toml` keys, not config-store: `pi.dgx_max_context_tokens`, `pi.mlx_max_context_tokens`, the
  `pi.efficient_wait_ms` bound and `long_context_tokens`. H1 reaches the config store only, and
  `routing.local.toml` may not hold them (`checkOverlay`), so converting them would need a different mechanism.
- Resource bounds, not tunables: the 256-entry plan caches (`observedPlans`, `planReads`), the 1024-entry conditional
  map, the 500-task and 256-item grooming limits (`GROOMING_TASK_LIMIT`, `GROOMING_ITEM_LIMIT`, the digest's 500
  slices), and the 8, 16 and 32 read counts and 16-id lists of the digest, cost report and release cut. Raising any of
  them raises memory or work per call, so each would need a tighten-only schema bound and a test per floor
  (acceptance criterion 3), which this group does not add.
- Host deadlines for the `gh` reads (1_000, 4_000 and 20_000 ms in five places) and the 5 000 ms release-window
  freshness check. They bound a whole call, a refusal of a stale host window protects the release, and none is
  independently tunable without changing what a partial result means.

#### Bus and delivery conversions (#489 H3)

The five pre-existing #489 `bus.*` rows above use the H1 descriptor, schema, settings writer and live
reload path. Unset defaults equal `MAX_ATTEMPTS`, `DIGEST_MAX`, `PULL_BUDGET_BYTES`,
`NOTES_KEPT` and `TERMINAL_CAP`. Only `bus.max_attempts` may rise; the other four
can only tighten today's ceilings. A reload does not trim/reorder queues or
prefaces, reset attempts, re-arm batch deadlines, prune history, or change a pause
or in-flight delivery. Terminal history is a target: protected retry parents and the current mutation receipt may
keep the count above it. The settings add no conductor authority.

`bus.accepted_settle_ms` (#1172) adds a timeout for explicit push-channel acceptance, rather than converting an existing constant. Its ten-minute default allows normal session initialization, compaction and handling while bounding a silently lost notification; the channel can confirm earlier, before a long task finishes. The setting is read at the next maintenance sweep. Expiry changes only the delivery journal to `needs_review` and never replays the message; native completion, task completion and task approval remain separate.

The [H3 H0 ledger](verification/2026-10-30-bus-delivery-operational-settings.md)
lists all 59 unique inventory identities (5 converted and 54 excluded). The
persisted `SEEN_CAP`/dedupe contract and withdrawn cancellation evidence stay
fixed; recovery fence polling goes to H4, expired-limit-record cleanup remains
maintenance, existing limits/watchdog/batching knobs remain in their current
configuration path, and wire/storage/safety/test-seam values remain constants.

#### Recovery and upgrade waits (#489 H4)

The five `recovery.*` rows extend the existing `recovery` block (`auto_resume_after_crash` is unchanged) and use
the H1 descriptor, schema and settings writer. They are read by the upgrade coordinator, a CLI process and not the
daemon, from the project it is acting on, at the start of each wait: the shared `config.json` first and the
machine-local `config.local.json` over it (ignored when git tracks it). The apply class is `next use`: a wait that is
already running keeps the deadline the receipt records in `waits`, and a resume reads the file again. Unset defaults
equal `RECONNECT_WAIT_MS`, `UNMANAGED_RECONNECT_WAIT_MS`, `RECOVERY_CONTROL_TIMEOUT_MS`, the 30 s shutdown wait and
the 120 s terminal idle wait. A value outside a row's bounds, or a file the coordinator cannot read, is the default:
a recovery never fails on its configuration.

Every minimum is today's constant except `recovery.terminal_idle_wait_s`: a person-visible wait can be raised and
never shortened below what ships, and a control request that times out may already have applied. A shorter terminal
idle wait only ends in manual-required, which retains the terminal. The 600 s wait for the source to become quiet is
not a setting: the source's preparation lease is a fixed ten minutes, so no other value is valid. The 180 s global
install timeout has no project to own it, and the 610 s Orca command timeout follows terminal recovery's own ten-minute
ceiling. See the [H4 ledger](verification/2026-10-30-recovery-wait-settings.md) for every item in the group.

#### Adapters and handshakes (#489 H5)

Three `adapter_timing.*` rows use the same H1 metadata, closed schema, loader and
settings writer. `next use` means a new native peer launch: the host captures
primitive option values for Kimi/generic ACP and Jcode, including Jcode's inherited
ACP options. An accepted edit leaves active tool ceilings, pending activity
flushes and native steer deadlines unchanged until a new peer starts.

The open-tool ceiling defaults to 60 minutes, because this repository's own
instructions expect a gate run to wait up to 50 (`dot remote verify --wait 50m`);
it can be tightened or raised, and remains `max(watchdogMs, configured ceiling)`
with remaining-only rearming, so a tool call that reports no progress for those
minutes still ends the turn. A turn the ceiling cancels names its cause: hub.log
gets the ceiling and its minutes for a configured kind whose own native
diagnostics stay withheld, plus the launch that restarts that peer (`ahub jcode`,
or `ahub jcode --as <peer>` for an extra instance) and the held row it leaves
behind; a private turn's tool titles stay withheld with them. That restart brings
the peer back but does not redeliver the cancelled delivery, so the person settles
it with the command `ahub queue show <id>` prints, after
`ahub queue list --peer <peer>` names the row.

The activity delay defaults to the legacy 50 ms and never exceeds that buffer window;
its 4096-character threshold and privacy handling stay fixed. Jcode's default
5-second steer deadline can only rise, and one absolute timer covers all native
phases; pre-send refusals and post-send uncertainty retain their existing fences.
No new conductor authority or native permission mapping is added.

The [H5 ledger](verification/2026-10-30-adapter-operational-settings.md) accounts for
all 232 unique H0 identities: 3 converted and 229 excluded with reasons. ACP
startup/mode/cancel and Jcode readiness retain their 30-second constants: raising
startup deadlines does not fit the existing 65/70-second callers, and shortening
would fail slow healthy launches. The shared MCP server's reconnect cap stays
fixed at 30 seconds; no daemon-to-plugin projection, raw-config reader, RPC or
environment knob is introduced. Cleanup/identity proofs, wire/storage/safety caps,
existing settings and test seams remain at their current owners.

#### Model relay and inference (#489 H6)

The seven rows above use the same H1 descriptors, validation, settings writer and
undo path. All require a daemon restart: an inference consumer captures its
configuration at daemon start, and each relay captures its policy at creation.
A relay remains cached across a native peer stop/start, so restarting that peer
alone does not adopt these values. Pending edits never retime current cooldowns,
backoff deadlines or requests, or trim the running relay's journal.

The initial cooldown and its recent-failure window share one setting. Cooldowns
still start only after consecutive transport/startup failures, double by the
same fixed factor and end on expiry or an HTTP answer. The cap's minimum equals
the initial cooldown's maximum, so it can never fall below that delay. The
history setting can only tighten the legacy 1000 closed records; it does not
change active-request evidence or suppress terminal observers.

`inference.backoff_min` preserves fail-open delivery and interactive-call
exemption. The two digest thresholds were already configurable; their H1 rows
retain those keys, defaults and existing schema bounds. No new model selection,
PII screening, conductor authority or cross-process configuration path is added.
The 180-second request deadline, 15-second moved-attempt first-byte deadline and
8-second inference timeout stay fixed under their current caller budgets.

The [H6 ledger](verification/2026-10-30-model-operational-settings.md) accounts for
all 169 H0 identities: seven registered and 162 left out with individual reasons.
PII policy, route scoring, protocol contracts, existing model/routing settings
and test seams remain with their current owners.

#### UI and console (#489 H7)

Five `console.*` rows use H1 and apply at the next console launch. The console
reads accepted `settings_get` row values once through its existing authenticated
control connection, under the existing 3-second read bound. It uses fixed H1
bounds, ignores pending/file values, and retains legacy defaults for an older,
refusing or unreachable hub. A running console keeps its captured preferences.
The existing `options.pollMs` test seam still wins, with the fixed 2000 ms floor;
refresh serialization and its pending-refresh coalescing remain unchanged.

Notice visibility may only lengthen. The other retention settings only tighten
local presentation memory: command history, offscreen stream events and message
attention references. They never trim bus queues, delivery records or approvals.
Close/signal and permission handlers remain active while the startup read waits.
If pushes arrived before capture, only cold-start presentation buffers are
trimmed, preserving accurate omitted counts and every approval/control message.

The 1-second redraw/approval countdown interval, `appendEvent` cap test seam,
Usage history query bound, browser toast/poll/office timings, authentication
lifetimes and action budgets remain fixed. The multi-project manager owns the
browser page; this change adds no per-project configuration projection or RPC.

The [H7 ledger](verification/2026-10-30-ui-console-operational-settings.md) covers
all 1007 H0 UI/console fallback identities, with 81 in these UI/console paths and
926 outside them. The additional `task-progress.ts` initializer is classified
under tasks/routing by the inventory's precedence and is recorded separately.
Five rows cover six H0 identities (the two command-history paths share one key).
The deferred support, CLI and memory items stay constant at their current owners and bounds ([closure record](verification/2026-10-30-operational-settings-closure.md), #989); #489 is complete.

- Writes go only to `.agenthub/config.local.json` and `.agenthub/routing.local.toml`,
  the machine-local files (`ahub init` ignores both in git). The shared
  `config.json` and the hand-written `routing.toml` are never rewritten, and a
  machine-local file that is committed to git is refused. Each write is read by
  the hub's own loader first and replaces the file atomically.
- `routing.local.toml` overrides `routing.toml` key by key and may hold only the
  routing keys in the table. `ahub route explain` and the Settings rows name the
  file each value comes from. `--preview`, and the dashboard's Preview button,
  show `ahub route explain` for the open tasks before and after, or what a
  permission mode grants, and save nothing.
- A row shows running and file values, source and apply class (`live`, `next use`,
  or `restart`). Pending restart keys and reasons also appear in status, console
  and dashboard, including startup-only blocks outside the editable registry.
- Settings writes and undo, the dashboard Reload configuration button and
  `ahub settings reload` use one complete validation/apply path. Debounced changes
  of config.json, config.local.json, routing.toml and routing.local.toml use it too,
  including atomic file replacement. Invalid candidates apply nothing and emit
  one bounded error notice. Valid but unauthorized keys retain their accepted value and are reported per key; other eligible changes still apply. Recovery/shutdown hold reloads.
- Individual writes and undo publish only the named setting. Other file edits remain unapplied.
- `ahub settings reload` lists guarded keys with complete before -> after values (including full argv) and any planner/conductor holder effect. It requires an interactive terminal and exact `y` within 30 seconds before adopting them. Oversized previews remain unapplied and must be split or reduced. Candidate bytes or accepted state changes invalidate that confirmation. Watchers and ordinary dashboard reloads never confirm a raise.
- Privacy tightening (local PII constraints/screening, added PII patterns, nonholder role reductions and explicit capability-list narrowing) is automatic, including tracked files. A planner/conductor holder change is guarded even when a role list shrinks; deleting a restricted capability entry restores all capabilities and is guarded. Reload checks the actual files' Git provenance. Changed machine-local or raising
  values from tracked/unverifiable files are refused; an ordinary dashboard or
  watcher cannot adopt unrelated raising local edits. A settings session cannot
  adopt routing fields outside its editable registry. Existing confirmation and
  roster lifecycle fences remain; use the confirmed roster setting for membership.
Pi relay model aliases (`pi.dgx_coding`, `pi.dgx_fast`) and `routing.pi` retain their running values until restart, because existing native sessions use the published relay catalogue and context contract. Routing policy changes apply to future decisions; local model changes apply at the next peer creation.

- Runtime/client ownership still requires restart for memory handles and sync,
  gateway/MLX, runner/check commands, profile/tool contracts, converters, existing
  session privacy/sandbox policies, the terminal provider and benchmark environment.
  The exhaustive reasons are in the issue #439 spec amendment. A pending file value
  is not applied to the running consumer. Coordination creation pins last for the daemon lifetime; a restart re-pins retained rows to its startup mode.
- `ahub settings undo` (the dashboard's "Undo last write") puts back the one
  previous version of the file the last write changed. It refuses when that
  file was edited since, and when it would put a stored never-ask back (set it
  again with its confirmation instead). A mode changed for the running hub is
  not a file: set it again instead. Setting a value it already has, or
  removing one that is not set, writes nothing. A project with no
  `.agenthub/config.json` gets no first config file from a settings write
  (any config file turns the project defaults on): run `ahub init` first.
- A project initialised before 0.12.23 has no `.gitignore` line for
  `.agenthub/routing.local.toml`: run `ahub init` again, or add it. A
  `permission_modes` value is read only from a file git confirms nobody
  committed (config trust); where the hub will not read what was written, the
  reload refuses the guarded candidate and the Settings row identifies the file.
- Authority: a dashboard opened with `ahub ui` reads settings, lowers a mode to
  `ask`, turns `pi.auto_start` off, sets a start mode back to `tui`, sets a WIP
  limit to 0, turns `task_sweep.enabled` or `.auto_reassign` off and changes
  the other Switches. Everything
  else needs `ahub ui --settings`, whose session may raise for 15 minutes, or
  `ahub settings` in a terminal; the configured conductor may set only the
  thirteen keys in [the operational command table](#conductor-operations-812-t2-933-900). `never-ask` needs the peer id typed in the
  dashboard, or `--yes` in the terminal, and a stored never-ask default still
  waits for `y` in `ahub console` at each hub start. Tool approvals stay
  deny-only for Pi and local in every session.
- Commands and binaries, credential files, gateway URLs and the local worker's
  reach are never editable here: change them with `ahub settings edit` in a
  terminal, each confirmed by typing its name (tier 3 below), or edit
  `.agenthub/config.local.json` yourself.
- Every change is announced in `hub.log` and open consoles with its source and
  recorded as a `settings` event. `ahub settings` needs a running hub; an older
  hub answers the request as unknown and the CLI advises upgrading. The unified
  dashboard (`ahub ui --all`) acts as an ordinary session.

### Structural configuration from the console and the dashboard (issue #689)

Instances, the review and approval blocks and the lifecycle can be edited without an editor. The hub reads the candidate with the loaders it starts with (`readInstanceConfig` and `validateInstances`, `loadConfig` with its effective-config bounds, `checkJcodeInstanceHomes`, `sdlcConfig`), shows a diff and writes only after a person confirms. Three tiers:

1. **Registry settings** (everything above) are unchanged.
2. **Structural keys**, editable in the console and in a dashboard settings session:
   - `instances.<id>` with `kind`, `roles`, `start_mode`, `review_mode`, `readOnly`, `worktree` and `permission_mode`, in `config.local.json` (`review_scope` is tier 3 and not editable here);
   - `review.adaptive`, `review.min_reviews`, `review.pool`, `review.rerotate`, `review.same_family`, `snapshots.keep`, `approvals.timeout_s` and `context.gate`, in `config.local.json`;
   - `mode` and `required_checks` in `.agenthub/sdlc.toml`. Only those two lines change: comments and every other table stay as written, and a layout the editor cannot change faithfully (a key repeated, or one inside a multi-line string) is refused with its own reason.

   `roster.*`, `tasks.wip_limits.*`, `permission_modes`, `peers` and the rest of the registry keep their own `ahub settings set` path.
3. **Executable and secret-locating keys** are console only: the rest of `NEVER_EDITABLE` (`kimi_cmd`, `jcode_cmd`, `codex_bin`, `pi.cmd`, `checks`, `mlx`, `omniroute`, `terminal`, `schedules`, `folder_triggers`, `corpus`, `rooms`, `local.doc_read`, `local.web_fetch`, `adapters`, `adapter_modules` and the like) and the Jcode instance fields `jcode_home`, `provider`, `model` and `provider_profile`. The console shows "this runs code with the daemon's rights, or chooses where secrets are read from" and writes only when the key's exact name is typed, one key at a time; `--yes` never confirms one. The dashboard lists each of them with the console command that changes it and nothing else: no value, no path, no input. A forged dashboard request for one is refused by the hub.

In the console (`ahub console`, Settings tab `6`): `c` asks what to edit (`1` an instance, `2` the lifecycle, `3` another key), asks each field, shows the hub's diff or its loader reason, asks for a reason, then `y`. Esc cancels at any step, and pasted text never confirms. `R` appears while a restart is pending and prefills `restart`; the command still asks its own `y`. In the dashboard, open `ahub ui --settings`: the Structure group has the same forms; outside a settings session it is read only.

```bash
ahub settings edit config.local.json set instances.codex-review '{"kind":"codex","roles":["reviewer"],"start_mode":"headless","review_mode":"fresh"}' --reason "add the fresh reviewer"
ahub settings edit sdlc.toml set mode '"enforce"' --preview
ahub settings edit config.local.json remove review.pool --yes
ahub settings backups              # the newest backups of each file
```

Rules:
- A missing `start_mode` on the fresh `codex-review` reviewer shows the loader's reason (`fresh requires reviewer-only roles, headless mode ...`), names the field and writes nothing.
- The edit carries the revision (a sha256, or `absent`) of the file it was read from. The hub checks it when it plans the edit and again immediately before it writes, so a file changed on disk since is refused with a hint to reload and review again.
- The previous file is kept in `<state dir>/config-backups/` (the newest five of each file; `ahub settings backups` lists them) and the new one replaces it atomically. A `config.local.json` that git tracks is never written. Unknown fields and unknown keys are refused by name, never dropped.
- A whole instance that holds a native home, account or model (`jcode_home`, `provider`, `model`, `provider_profile`) is tier 3 to remove or replace, so a dashboard can neither see nor delete those values; an existing instance changes leaf by leaf (`instances.<id>.<field>`), and `clear` removes one field. A preview or write shows a tier 3 value only as `(set)`, and a write changes exactly one tier 3 key, counting the keys the file adds (removing two Jcode instances is two writes, each confirmed by its own typed name). The audit record gives a tier 3 key no value hash at all, because a model or provider name is easy to recover from an unsalted hash; the file revisions bind the change instead. An instance already in `config.local.json` is changed leaf by leaf even before a restart has started it. If `.agenthub` or `config.local.json` is a symlink, the Settings view reports its revision as `unavailable` and no edit is planned. An edit of `sdlc.toml` keeps the file's own line endings.
- Every write records a `config_edit` event: the file, each key path with a short hash of its value before and after (never a value), the file revisions before and after, the tier, the source (`dashboard` or `terminal`) and `by: person`. The notice and `hub.log` name key paths only.
- A changed instance declaration is restart-bound: it is listed as `pending restart` (`instances`) and takes effect at the next hub start. A changed `sdlc.toml` is read once at start and is listed as `sdlc.mode` or `sdlc.required_checks` until the running hub holds the same value. `review`, `snapshots`, `approvals` and `context.gate` publish through the one reload path, one key at a time.
- Person only: an agent shell or a hub tool is refused (`ahub settings edit` is a console command in the identity gate, and the three control requests answer only the console role). Recovery or shutdown holds every edit.
- The hub must run this release: an older hub answers `unknown message` and the command says to upgrade and restart it.

## Design spec inspection

`ahub specs list` discovers Markdown specs whose flat frontmatter names an `id`
and `type`. `ahub specs covers <file...>` finds their path scopes.
`ahub specs check` validates graph links, types and stamps without a daemon;
it prints nothing and exits 0 when there are no specs or stamped documents.
`--json` returns structured reports, and `--require-fresh` also fails on stale
documents. `--base <ref>` reports changed paths whose covering spec stayed
unchanged without making that report an error.

The `specs` config block defaults to
`{ "enabled": true, "review": "report", "roots": [], "stamps_file": "" }`.
Roots are repository-relative directories; an empty list scans the repository.
The optional stamps file uses the schema of `docs/verified.json` for other
documents. A scan stops at 2,000 Markdown files and 8 KiB of frontmatter per
file; a truncated report names `specs.roots` as the way to narrow the scan.
Symlinked files are skipped. Freshness counts commits touching covered paths
since the stamp and detects uncommitted changes without running Git filters
or external diffs. These commands never refresh a stamp.

The Switches settings `specs.enabled` and `specs.review` are machine-local
settings, and the specs config fields are tier 2 structural settings. Setting
`specs.enabled` to false suppresses this machine's notices and status summary,
leaving the shared config unchanged. Explicit CLI and `hub_specs` inspection
still work when notices are disabled.

`ahub init --specs` (the default) and `--no-specs` set the shared key
`specs.enabled` and add or remove the `AGENT_HUB_SPECS` instruction block in
`AGENTS.md` (the text is `templates/specs.block.md`). `--spec-review
off|report|require` sets `specs.review`. Both are rows of the init settings
table: on an existing project an explicit flag shows as one old -> new row in
`--dry-run`, a flag equal to the current value is a no-op, and a plain `ahub
init` follows the project's `specs.enabled` (on unless the project set it to false):
it adds or refreshes the block when specs are on and removes it when they are off. Text outside
the markers is never touched. A block with only one of its two markers is
refused, naming the cause, and nothing is written.

`ahub specs stamp <id-or-document...> [--yes]` is a person's record that they
reviewed a spec or a stamped document against HEAD. It is person only: an agent
identity is refused before the command runs (it is a console command, and
`--live-test` delegation refuses it too), and a run with no terminal is refused
even with `--yes`. It shows `old -> new` per document, asks, and then changes
only the spec's `verified-against` line (adding it before the closing `---` when
absent) or the document's `verifiedAgainst` value in the stamps file, keeping
every other byte, the line endings, a byte order mark and the file mode. The new
stamp is the full HEAD SHA. It is refused, writing nothing for any target, while
a document's covered paths have uncommitted changes, when the document has no
paths, when a document's frontmatter cannot take a stamp, or when a name matches
no or several documents; all refusals are listed together, and a document that
cannot be stamped is refused before the question is asked. The answer may take
minutes, so after it HEAD, each covered path's state and every target file's
bytes are checked again, and any change refuses the whole run: what you approved
is what is written. Removing the instruction block with `--no-specs` takes out
only the block and one separating blank line, so the whitespace of the text
around it is kept. Stamping changes a working-tree file: review the diff and commit it.
Agents never edit `verified-against`. `docs/verified.json` is still restamped
only in a release PR (AGENTS.md "Verified stamps").

`scripts/check-docs.mjs` stays a self-contained Node script, because the release
workflow runs it on Node without Bun or an install and `src/hub/specs.ts` is
TypeScript that depends on repository packages. `test/check-docs-parity.test.ts`
holds it to the same state, commit count and dirty flag as the shared engine on
the same stamps.

Task proposal and acceptance replies name the specs covering the task's refs
paths. At completion the hub reads spec metadata from the submitted commit,
compares the host-verified changed-file inventory with those scopes, and adds
`spec not updated: <id>` and `spec errors: <n>` to the result and review brief.
Dirty spec edits in another checkout do not satisfy this check. `report` records
the report; `off` suppresses task notices. Under `require`, unchanged covering
specs must be updated or named in `spec_ack`, for example
`[{ "id": "bus", "reason": "Only an internal allocation changed; the contract is unchanged." }]`.
Acknowledgements are screened, recorded at the exact head, and shown to the
reviewer. A new head invalidates the old report. Unknown or truncated coverage
cannot satisfy `require`; a refusal names the next step. A call accepts up to
20 acknowledgements; larger changes can update the specs or split the task.
Tasks without a submitted commit or with no changed files have no coverage
obligation. Existing spec errors are reported on tasks touching covered paths
or spec documents. A privacy change during a check suppresses its spec report
without discarding the check result. If an applicable review policy changes
to `require` while that check runs, the pass is retained and the owner is
asked to refile completion under the current policy.

`hub_specs` offers read-only `check` and `covers` actions with at most 20 report
items. These explicit reads and status inspect the daemon checkout; task notices
inspect the owner's execution root and completion reports inspect its submitted
commit. Immutable Markdown blobs are read in bounded batches and parsed results
are cached by object id across submitted heads. PII tasks and private turns do not publish spec paths through task
notices. Completion snapshots skip Git symlinks and cap each committed spec
body at 4 MiB; an incomplete read stays unknown. Status shows a specs count,
error count and stale count only when specs or stamped documents exist, with
one hint when the specs instruction block is missing. Empty projects stay
silent.

## Start modes: TUI by default, headless as opt-in

A peer that has a TUI the hub attaches to starts in it by default (issue #269).

| Peer | Default | Headless |
| --- | --- | --- |
| pi | `tui` | `ahub pi --headless` (or `--mode headless`), or `peers.pi.start_mode: headless` |
| codex | `tui` (`ahub codex`) | `peers.codex.start_mode: headless`: a hub-made start runs the app-server only |
| claude | `tui` (`ahub claude`) | none |
| kimi | `tui`, pull-only (`ahub kimi`) | `ahub kimi --mode headless`, or `peers.kimi.start_mode: headless` |
| jcode (optional) | `tui` on the hub-owned ACP session (`ahub jcode`) | `ahub jcode --mode headless`, or `peers.jcode.start_mode: headless` |
| local | headless (hub-native) | not applicable |

Daemon-owned peer launches, native version-helper probes and process-table helpers drop
every inherited `ORCA_*` variable. They pass `CLAUDE_CONFIG_DIR` and `CODEX_HOME` through
unchanged; Claude uses the former and Codex the latter, while other peers ignore
selectors they do not own. The hub does not choose a different account,
synthesize a home, or copy native credentials. A person-started native process
launched from `ahub claude`, `ahub codex`, `ahub kimi` or another native launcher
keeps its pane's `ORCA_*` context while its own peer markers replace inherited
agent identity. Manager and person console wrappers keep their existing
environment, routing and recovery rules. Adapter-owned fresh homes take
precedence; Pi's fixed environment carries `CODEX_HOME` but not
`CLAUDE_CONFIG_DIR`, and the local worker's fixed shell environment carries
neither.

- **You type the command:** `ahub pi` opens Pi's TUI in that terminal.
  `--headless` and the start mode setting are the two ways to ask for the
  background peer. `ahub settings set peers.pi.start_mode headless` writes the
  setting; it applies at Pi's next start.
- **The hub starts the peer** (the dashboard's Start control, `pi` typed in
  `ahub console`, the conductor's `hub_peer_start`, `pi.auto_start`): it
  follows the peer's start mode. For `tui` it opens a terminal running the
  fixed command `ahub <peer>`, through a terminal provider:
  1. `terminal.open` in `.agenthub/config.local.json`, an argv in which one
     element holds `{command}` (the quoted command line to run); `{title}` and
     `{cwd}` are replaced too. Examples:
     `["tmux", "new-window", "-n", "{title}", "{command}"]`,
     `["wezterm", "start", "--cwd", "{cwd}", "--", "sh", "-c", "{command}"]`.
     Only a config file nobody committed may set it, and it is not a setting
     the dashboard or `ahub settings` can write. It is read at hub start.
     `{command}` is quoted for a POSIX shell; `{title}` and `{cwd}` are raw,
     so give each an argv element of its own.
  2. Orca, when the hub runs in an Orca worktree or an earlier `ahub <peer>`
     launch of this project recorded one (the path recovery uses). The terminal opens in the
     Orca worktree whose root is exactly this project's root, found with `orca
     worktree list` (#1105); it never uses the worktree of whichever terminal
     started the hub, which is another project's after `ahub --project`, a
     dashboard manager start or an upgrade. The start is refused, naming the cause
     and `terminal.open` as the alternative, when Orca cannot list its worktrees,
     has no worktree with this root, has more than one, or cut its list off at 500
     rows first.
- **No provider:** the start is refused with the command to run by hand. It is
  never downgraded to headless. `ahub settings` lists each start mode, and the
  dashboard's Start control says which mode a start will use and where its
  terminal comes from.
- **A headless start gets a watch pane** (#286 AC10): when the hub itself
  starts Kimi or Qwen headless (Kimi when its start mode is `headless`), it
  also opens `ahub watch <peer>` through the same provider, a fixed command
  with no caller text, at most once per 30 seconds per peer. The headless
  start has already succeeded, so with no provider, or one that fails, the
  start still stands and its result and the hub's notice give the command to
  run by hand. A start in TUI mode opens the peer's own terminal instead, as
  above; an already attached peer, a declared extra instance and a peer
  without the watch capability open no pane.
- **Dashboard Start:** the control is locked while its request is in flight. A confirmed answer unlocks it immediately, so a retry reaches the hub's own 30-second terminal reopen guard and shows any known refusal. The unified dashboard waits 35 seconds, covering a terminal provider's 30-second cap plus a 5-second response margin; a slower headless start can still end unconfirmed while the hub continues. Check the Peers panel before retrying. An unconfirmed unified-dashboard start holds that peer's control for the shared 30-second reopen bound, or until its `starts` snapshot confirms attachment, across redraws and project switches within the same hub instance; the row states the retry bound. The project-local dashboard keeps its usual confirmed-answer behavior. Other forwarded actions keep their 10-second wait; the manager opens no settings session.
- The conductor cannot choose the mode: `hub_peer_start` takes the peer's own.
- Recovery restores each peer in the mode its recorded session had. After an
  unplanned stop, a Pi that ran in a terminal is reported with its command and
  is not replaced by a headless one unless headless is its start mode.

### Kimi in its own TUI

`ahub kimi` runs Kimi in the person's terminal by default. The launcher atomically
merges only `mcpServers["agent-hub"]` in `.kimi-code/mcp.json`, keeping foreign
entries and fields. It contains machine paths and the peer identity, not a token.
`ahub init` ignores that file when it is untracked; a tracked file is still written
with a warning. `--print-command` shows the change and command without writing.
The configured `kimi_cmd` must be a single executable or end in exactly `acp`;
the TUI uses the executable or drops that final word. Other wrappers are refused
with the headless command rather than guessed. The launcher uses the running
hub's `kimi_cmd`; when that value has no TUI form, the refusal says so, since an
edited file value waits for `ahub settings reload`.

After three empty inbox reads within ten minutes by a pull-only peer with no assigned task or review, the hub adds polling advice and one console notice per streak (peer id and counts only); a delivery or assignment resets it, and restart clears the in-memory counters.

The TUI is pull-only. Its model reads `hub_inbox` at the start of work, between
steps of longer work and before reporting, and shares results, and mid-work
blockers or changed contracts, explicitly with `hub_send` addressed with `to`
(progress-only notes `[FYI]`). Status, the console and
the dashboard show `pull-only`, the waiting count and the last inbox read. Messages
and important markers do not push or interrupt it. There is no hub busy state,
watchdog, console approval, hub permission mode, context reading, automatic quota
pause/handoff, shared final answer or session resume. When important messages are
waiting, every other hub tool result ends with a line saying how many, so the model
reads `hub_inbox` before starting long local work (#398). One `hub_inbox` read drains the queue oldest first up to
64 KiB of rendered text and, when more waits, ends with `N more waiting: call hub_inbox again before you start work` (#713).
Read quota and approve tools
in Kimi's own TUI; a person can pause the hub queue by hand. End the native terminal
session there, not with `ahub stop kimi`.

On Kimi 2.5.2 (compat entry `kimi-tui`), the launcher also installs a launch-scoped
plugin under `plugins/managed/agent-hub` in the Kimi home (`KIMI_CODE_HOME`, default
`~/.kimi-code`) and removes it when the TUI exits (#1282). Its hooks let a turn you
started there settle into a result (`ahub results`), always private, once the native
transcript shows the turn ended and no native background task is running or unknown. This adds no push,
steer, watchdog or quota handoff. Another Kimi version, or a plugin setup that
fails, prints the cause and launches the plain TUI without completion receipts.

Automatic routing never picks a pull-only owner or reviewer, even as the only
candidate. A proposer can name the owner or claim its own task; a person or the
conductor can name an owner or reviewer with
`ahub task assign <id> kimi --role owner|reviewer`. A waiting task reserves its
named owner; naming its reviewer is refused until dependencies are approved.
A named review waits in the same inbox. Queue holds and pauses refuse a pull with
the reason; an unaccepted assignment still follows the existing release deadline.

To switch to ACP, end the attached TUI and run `ahub kimi --mode headless`: the
person's command removes only the hub's project MCP entry before starting ACP.
A daemon-made headless start refuses a stale entry with that command and never
edits the project file. To switch back, stop the headless peer with `ahub stop kimi`
then run `ahub kimi --mode tui`. The peer id, queued messages and open tasks remain;
the ACP session is not resumed in the TUI. Agents cannot switch modes.

Projects with no explicit Kimi start mode also move to this default on upgrade.
The coordinating upgrade command announces it once; to keep ACP, run
`ahub settings set peers.kimi.start_mode headless`.

Source preflight checked Kimi Code 2.1.1 at
[f67e6398](https://github.com/MoonshotAI/kimi-code/tree/f67e6398fb3210ad8ace970e2dfd5bcc984ed61f):
trusted ACP workspaces read the user, repository-root and project MCP files, and a
passed session entry connects beside the project entry. Its model request path
uses tool definitions and managed AGENTS instructions, not MCP initialize
instructions. Folder trust, real TUI tool discovery and the model round trip are
still unverified live; see `docs/smoke.md`.

### Migration from 0.12.22 and earlier

Pi's default changes from headless to its TUI.

- `ahub pi` in a terminal now opens the TUI. For the background peer run
  `ahub pi --headless`.
- A project with `"pi": { "auto_start": true }` used to get a headless Pi at
  every hub start. To keep that, set the start mode once:
  `ahub settings set peers.pi.start_mode headless` (or add
  `"peers": { "pi": { "start_mode": "headless" } }` to
  `.agenthub/config.local.json`). Without it the hub opens Pi's TUI in a
  terminal at start, or, with no terminal provider, says
  `pi.auto_start did not start Pi` with the command to run.
- Scripts and the console's `pi` command: without a terminal, `ahub pi` asks
  the hub to open one. Add `--headless` where a headless Pi is meant.
- A conductor's `hub_peer_start` no longer takes a mode. A call that passes one
  is refused unless it repeats the peer's start mode.

## Approvals and pauses

Inspect permission requests in the terminal:

```bash
ahub console
```

Select the requested option in the console and confirm an allow decision.
For a separate plain terminal, the existing command remains available:

```bash
ahub tail
ahub permit <request-id> allow
```

Use the exact option shown by `ahub tail`; do not approve an unresolved or
unexpected request. On macOS a waiting request also raises a desktop
notification that names the peer and, for Kimi, Pi and the local worker, the tool,
never what it would run. An unanswered request is cancelled after `approvals.timeout_s` (default
120, 30 to 3600) in `.agenthub/config.json`, and the console and log say so.
Pi and the local worker are told that nobody answered, and two such requests in
a row end their turn ([Pi/local unanswered approvals](#pilocal-unanswered-approvals)).
Set `approvals.notify` to `false` to turn notifications off; a hub started
without a project config file raises none. While Kimi waits for an answer its
turn is kept alive, so a timeout longer than the inactivity watchdog does not
cancel it.
`ahub pause <peer>` holds delivery and `ahub resume
<peer>` releases a manual pause. Budget pauses are distinct:

```bash
ahub budget
ahub budget resume <peer>
```

A budget pause remains authoritative until the budget command explicitly
overrides it or the window resets. Check `ahub status` and `ahub board` after
a pause or handoff.

`ahub budget` (#285 phase 4) prints one row per window and a line for every attached peer that has no number. The KIND column says what the
number is, and SOURCE where it came from; MEASURED is its age.

| Kind | Meaning | Source examples |
| --- | --- | --- |
| `native` | the provider's own ratio and reset | `claude status line`, `codex rateLimits`, `kimi ACP usage-limit refusal` |
| `count` | tokens the hub counted, against a ceiling a person set | `hub count, kimi wire log, of kimi_tokens_5h 800000` (window `tokens`) |
| `manual` | a person fed it with `ahub budget set <peer> <0..1> [--window 5h\|week] [--resets-in 2h]` | `ahub budget set` |

A count never claims to be the provider's quota. For one window and peer a manual value replaces the provider's at the gate, and while any native
or manual reading is fresh the count is shown as `info only` and does not gate or feed routing headroom; when those go stale, or reset, the
count gates again. A provider's hard refusal clears the person's number for that window, so a pause is never outvoted. A peer without a number says
why instead: Pi and local print `no quota: on-prem ... has no provider quota` with the hub's own 5 h token count (information, never a meter);
Kimi without `budget.kimi_tokens_5h` says it reports context occupancy only; an unreadable Kimi wire log says so with a reason code; a peer whose
source has not reported yet says which. `--json` carries `kind`, `source`, `superseded` and a `peers` list of those notes; an older hub answers
without them and the CLI classifies a window by its source. `ahub doctor` adds the row `kimi usage source` (counting, no ceiling, or unreadable).
The console's peer detail (Enter on Peers) and the Usage detail, and the dashboard's Usage budgets row, show the same kind and source per window.

`ahub budget` also prints LEFT, the window's own remainder, and REACHES, when the window would reach its limit at the burn rate seen so far (#1513); the console's
Usage detail and the dashboard's Usage budgets row show the same two numbers for the same window. The rate is the peer's token series from the roll-up over at most 24 hours,
and when the window opened inside that span it is measured from the window's opening (the sentence says `rate since the window opened`), so a reset is never projected across.
A forecast that would land after the window's own reset reads `no forecast: it resets first`; fewer than two hourly points reads `no forecast: too few points yet`; a window
nobody burnt reads `no forecast: no burn yet`; and an unusable or stale reading reads `no forecast: no usable reading`. The burn is measured over the time that elapsed since
the first hourly bucket, so a partial last hour counts and a two-point series is not read at double its rate. An unknown forecast is never printed as a time. One view in the
hub fills every window for all three surfaces, so they cannot disagree, and `--json` carries each window's `left` and `projection` (an older hub sends neither, and the CLI
and the page print no forecast for it rather than inventing one).

A person's reconfigure of an execution budget can say why, and the budget row keeps the last reason with who gave it and when (#1513 AC3):

```bash
ahub budget execution configure <config.json> --reason "the release cut doubles this run"
```

`ahub budget execution status` then shows it as `override reason`, `override by` (`person`) and `override at`, and `--json` carries
`override: { reason, by, at }` on that budget. The reason is trimmed and at most 280 characters, and a longer one is refused before anything is written.
A configure without `--reason` changes the limits exactly as before and keeps the previous override and its reason, so the row answers why the limit is
what it is rather than what the last call said; a project that never gave one shows no `override` at all.

While a Codex peer's account is budget-paused (#1440), the hub reads `codex rateLimits` through the attached TUI link every 60 seconds instead of the
usual `usagePollMs` cadence (ten minutes), so a reset is seen early; it never redeems a credit or resumes a peer, and the existing reset/resume path
still decides. For a paused peer `ahub budget` adds the account diagnostics that read allows: reset credits available with their earliest expiry
(or `expiry unknown`), whether ordinary usage is allowed, `credits available` and `unlimited credits` (yes, no or unknown), `stale snapshot` when old,
and `turns would use paid credits` when ordinary usage is not allowed but paid credits are. These fields change no admission, pause or resume, are
held in memory only, and read unknown after a restart until the next native read; balances and account or credit identifiers are never kept.

Kimi Code CLI 2.1.1's observed 5-hour usage-limit refusal creates a hard budget reading (`kimi ACP usage-limit refusal`). `ahub status` shows a budget pause and `ahub budget` shows its source and reset estimate. The refusal gives no reset timestamp, so the hub estimates the reset at five hours after it was observed and resumes on the next budget tick after the existing one-minute grace. With `budget.wait_max_min` below that estimate, the existing budget relay automatically hands open tasks to an attached eligible peer; routing skips Kimi while paused. No checkpoint is requested from an exhausted agent.
`ahub budget resume kimi` overrides the reading so the provider can be tried early. A new provider refusal ends that override and pauses it again; a pending soft checkpoint cannot postpone this hard pause.
During one hub run, an early override followed by the same window's refusal keeps its earlier future reset bound; a provider's explicit reset remains authoritative. A restored pause without a per-window reading cannot identify that earlier window, so its next refusal starts a new estimate.
Unread quota resume notices are coalesced without losing their public task moves; the next notice lists moves accumulated across those pauses. An older notice without structured move metadata is kept as public text inside that notice.

A refused prompt with no acceptance or activity is requeued without a review hold. At the estimated reset it is tried again; another quota refusal pauses it again without consuming the poison-envelope retry count. Work that already started remains held for review even while its open tasks move to other peers. After the quota reset its queue stays held: inspect `ahub queue show <delivery-id>` and the associated task, then choose `ahub queue resolve <delivery-id> --action completed|retry|discard --reason "<text>"`. Do not retry work that another owner already took over without inspecting it. If the hub cannot confirm the pause, the refusal is also held instead of spending retries. Other errors keep their ordinary review behavior. Only the observed Kimi 5-hour text is recognised; weekly/monthly limits and other ACP vendors, including Qwen, remain unverified. The recognised text and its provenance live in `src/adapters/acp-quota.ts`.

The gate is `budget.gate`, 0.99 by default (#1292; 0.9 before). A peer whose fresh quota window reaches the gate is asked to checkpoint, then paused and its work handed over. It resumes when every fresh window is under the gate minus 0.1, or at the reset. A release cut is also held while any window has no more headroom than 1 minus the gate. At 0.99 a soft pause leaves about 1% of the window for the checkpoint turn; a provider's hard refusal still pauses at once. `budget.gate` is a registered setting (a number from 0 to 1): set it with `ahub settings set budget.gate <value>` in a terminal or in an `ahub ui --settings` session. An ordinary dashboard session and the conductor cannot set it. The value goes to `config.local.json`; the running hub uses it from the next quota reading, with no restart. A project created before #1292 has `"gate": 0.9` in its tracked `.agenthub/config.json` (the init template wrote it), and that value overrides the default: remove the key there to follow the default, or set the machine-local value.

Quota also shapes routing and handoffs:

- Among peers a task could go to, those with quota readings are ordered by
  headroom per hour left until the reset of the window that bounds it (the most
  used one, so a week window near its cap is not mistaken for a 5 h window about
  to reset), so the window that resets first is used first. Peers without readings, such as `local` and `pi`, keep
  their place in `routing.toml`. `ahub route explain` shows the reordering.
- When a paused peer's window resets within `budget.wait_max_min` (30 once the
  project has `.agenthub/config.json` or `config.local.json`, 0 without one; `0`
  always hands over), it keeps its work and only tasks proposed with `urgent`
  (`ahub task propose ... --urgent`) move. If the reset moves past the limit
  while it waits (a week window crosses the gate), its work is handed over after
  all. `ahub budget` shows each decision and why in the pause reason.
- A peer whose recent failures in a class (failed checks, changes requested,
  escalations by hand) reach `tasks.demote_at` (default 1.5) after decay, and outweigh its recent
  approvals there (a task without a reviewer counts when done), goes behind the
  other candidates in the same state for that class, `local` and `pi` included.
  A failure counts half after `tasks.demotion_half_life_h` (default 24 hours). `ahub route explain` names demoted peers.

## Durable delivery and queue resolution

Protocol 10 records each recipient delivery in the private project journal.
The states are `queued`, `dispatching`, `accepted`, `completed`,
`needs_review`, `failed`, and `discarded`. Adapter acceptance means that
the native bridge received the delivery; it does not prove that the agent
executed it. Only native completion or a correlated reply can settle a receipt.

Failed deliveries carry a public-safe `failureCause` from the fixed classes
`peer offline`, `adapter refused`, `push error`, `turn aborted`, and `timeout`
(#1178). `ahub queue show` and `ahub queue list --json` expose the class, never
message text as the cause. Older rows without it have an unknown cause; the hub
does not reconstruct one from their reason or body. This diagnostic does not
change settlement: a possibly effected delivery remains `needs_review`, not a
safe failure merely because its cause is known.

`ahub status` shows each peer's unresolved failed count above zero, with
`ahub queue discard --peer <id> --state failed` as the next step. Inspect the
rows first, then supply the discard command's reason and confirmation. A row
already settled by an explicit resolution is excluded, including a failed
parent left behind by `retry`; its linked attempt has its own state. Older hubs
without this count and unavailable delivery storage do not imply a zero count.

The console interface is:

```text
ahub queue list [--peer <id>] [--json]
ahub queue show <delivery-id>
ahub queue resolve <delivery-id> --action completed|retry|discard --reason "<text>"
```

These queue commands ship with protocol 10 (0.7.0 and later), where a known
offline recipient may also be queued explicitly; broadcast and automatic
assignment still require an attached peer. A hub still on protocol 9 (0.6.x)
has only `ahub status`, `ahub tail` and the task board.

Resolution requires the current observed revision. A retry closes the old
record and creates one linked attempt. Stale or conflicting resolutions fail.
A refused or failed resolution puts back only that peer's queue and preface
and keeps every pause, including budget and conductor holds. A storage failure
stops the bus; a validation refusal leaves it running under the existing holds.
If dispatching or accepted work has an uncertain outcome after a crash,
the system marks it `needs_review`. Establish evidence before choosing
`completed`, `retry`, or `discard`. Timeouts,
disconnects, cancellation, and partial effects are uncertain; do not replay
them automatically.

For an ACP peer (headless Kimi, Qwen, Jcode) a tool call that was announced and
has not completed or failed counts as running work, not silence: the inactivity
watchdog (`watchdog_ms`) keeps the turn alive up to the open-tool ceiling
(`adapter_timing.acp_tool_ceiling_min`, default 60 min since #1601, never below
`watchdog_ms`) since the peer's last output, then cancels the turn as before and
logs which open tool call was silent (#542).

After the inactivity watchdog cancels a Codex turn, a late acceptance, answer or
completion from that turn is dropped and never reaches a later audience; its
delivery is held as `needs_review`. When the cancelled turn has no verified
native id, Codex goes offline and the hub logs `Codex cancelled turn has no
verified native id; reattach the native session before further hub delivery`:
end its TUI and relaunch it (`ahub codex resume <thread-id>`) before resolving
the held delivery.

### Claude sessions without channel pushes

Only `ahub claude` starts Claude Code with the development-channel flag. A
Claude session started another way (plain `claude`, an IDE) keeps the hub tools
but cannot show pushes, so it attaches tools-only (protocol 16, issue #205):

- Its messages stay queued. `ahub status` shows the queue count in `Q` and a `tools-only` detail:
  `messages wait for hub_inbox; for pushes restart Claude with ahub claude`; the
  console footer shows `tools-only: ahub claude` and the dashboard shows the
  status line.
- The session reads them with `hub_inbox`, which drains the queue oldest first (important messages marked, as ever) up to 64 KiB of rendered text plus
  the hub's recall note when one waits (#713; a push peer's digest is still ten items). When more is waiting the result ends
  `N more waiting: call hub_inbox again before you start work`. Each read is one `completed` delivery (`read through
  hub_inbox` in `ahub queue list`); nothing is ever `accepted`, and the session
  has no `hub_delivery_done`. A read the model never saw (the tool call was
  cancelled, the plugin died) cannot be retried: `ahub queue show <id>` of the
  `completed` row prints the messages to send again.
- Whatever holds pushes holds `hub_inbox` too (`needs_review`, recovery,
  `ahub pause`, a budget pause, a conductor hold): it reads nothing and says
  which hold applies.
- Restarting Claude with `ahub claude` takes the peer over and pushes what still
  waits; the plain session stands by. The other way round, a plain session
  started while an `ahub claude` session holds the peer stands by and attaches
  only after that session leaves.

When a hub reconnect changes the hub tools (names or schemas), the plugin asks
Claude Code to list them again (`tools/list_changed`), so a session that listed
them while the hub was down does not keep the short list (#490). A status probe
that is unavailable right after a restart is retried, then the list is
announced anyway.

### Hand a peer to a standby session (#1174)

`ahub status` lists live standby connections with their connection identity and
reported PID when available. From the person's terminal, request a handover:

```sh
ahub peer takeover claude
```

The Peers panel in `ahub console` offers the same takeover action with `o`. An explicit
console selection stays bound to the displayed standby id; the CLI's peer-only
form chooses the oldest eligible live standby. The result reports that a claim
was requested. Refresh status to confirm attachment. If no eligible standby
remains, the command refuses without detaching the current owner.

Use `ahub peer takeover claude <standby-id>` to select the exact connection shown
by status. If a request times out, inspect status before retrying; the handover
may already have started.

This detaches the old hub connection, not its native process. The old plugin's
next hub tool explains that the person detached it; it cannot reconnect and take
the peer back. Unconfirmed deliveries follow their normal settlement rules, and
takeover itself never marks them completed. A reported PID or connection UUID is
not native session or permission evidence. Agent and delegated live-test writes
are refused by the same person-only path.

A previous plugin may display a generic terminal-admission refusal after takeover;
run `ahub setup` and restart that plugin for the specific person-detachment text.
With an older daemon the plugin keeps the prior standby reconnect behavior, and
an unsupported takeover request names the unavailable operation. No live account
or native process handover is certified by the fixture tests.

### Replaced or ended Claude sessions (#551)

A replaced session says it is standing by. Its reconnect requests cannot reclaim
an attached or claiming peer, even if its status-file read missed that holder. A
channel-capable session may still replace a pull-only holder once its claim has
finished. A session whose plugin does not opt in to standby (an older plugin, or
tools mode) keeps the newest-hello behavior; an opted-in session started while
another holds the peer stays a standby until the person runs `ahub peer takeover`
or the holder leaves (#1174).

A plugin carrying an older launch id than this daemon's current per-peer Claude
launch is refused with close 4430. It stops reconnecting, and hub tools report that
the launch ended. Start a new session with `ahub claude`, or use a plain session
with the tools and `hub_inbox`. A session with no launch id, or a hub with no
current launch record, keeps the existing behavior. The marker alone cannot
prove that a nested host loaded this specific MCP server as a channel; the
bridge currently receives no positive per-server activation signal.

### Claude channel sessions while busy (#493)

A Claude session started with `ahub claude` receives pushes when it is idle. While it is busy:

- Every hub tool result carries fresh counts, `(N queued hub message(s), M important hub message(s) waiting: call hub_inbox before starting long local work)`, when important work waits. A zero count clears an earlier hint. Under a delivery hold that refuses pulls, the counts and held rows stay but the `hub_inbox` advice is dropped.
- `hub_inbox` reads the daemon queue (and any local failed-push buffer) in a channel session too. A read is one `completed` delivery, like a tools-only read; holds refuse it the same way.
- An important message is pushed into the running turn (steered) instead of waiting for the turn to end. Mid-turn reading was verified on Claude Code 2.1.302; an older client that drops it leaves the delivery `accepted` until a person resolves it. Ordinary messages still wait for the idle push or `hub_inbox`.
- Do not use `[FYI]` for PR ready, done, submitted, ruling-needed, blocker or changed-contract messages: they need action. `hub_task_done` and `hub_review` already notify their recipients.
- Turn completion is read backwards in 4 MiB chunks, up to 64 MiB plus one row-boundary byte, whatever the transcript's size. A row crossing chunks is reconstructed whole; a row starting outside the bound stays unavailable. When no completed turn is found within that bound, the console says once per turn that the peer stays busy and its messages wait in its queue (#517).

## Graceful shutdown

Before stopping, let active turns and approvals settle when possible:

```bash
ahub status
ahub tail
ahub kill
```

`ahub down` is the same verified stop as `ahub kill`, named as the counterpart of
`ahub up` (#957); both are the person's, refused from an agent shell.
The daemon waits for shutdown work that must survive termination. Afterward,
run `ahub status` or `ahub up` and read the project state before restarting
peers. A stopped daemon does not delete task records or the durable journal.
Do not kill a native terminal by PID or start a replacement while ownership is
uncertain. To stop one headless peer and keep the hub running, use
`ahub stop <peer>` ([Stop one headless peer](#stop-one-headless-peer)).

Shutdown is bounded: once it begins, a daemon that cannot finish within
15 seconds exits anyway, and a peer that refuses to stop is logged rather than
allowed to block state cleanup. A managed Pi tool that does not settle within
the stop grace does not block the teardown either: the stop goes on
(shutdown, owner teardown, process stop) and reports the failure at the end.
A native Pi TUI owner that does not exit
gracefully is terminated by its verified process identity (never a bare PID),
so a restarted hub never launches beside a survivor. A hub whose project root
or state directory was deleted stops itself within about 10 seconds; the
dashboard manager does the same when its home directory vanishes.

## The planner (#455)

Planner holders propose and split tasks and read project-wide grooming. Each
task's effective planner gets its backlog and sweep notices. `ahub status`
prints the holders with their source, the dashboard's Agents view shows a
Planner badge, and the console marks their rows.

- `setting`: `planner` in `.agenthub/config.json` or `config.local.json` (the
  machine's file wins), either one id or a list of up to eight distinct ids.
  Only those peers hold the role. Builtins are `claude`, `codex`, `kimi`, `qwen`
  and `jcode`; a declared planner-capable instance is also eligible. A singleton
  settings write stores a string for older configuration readers.
- `roles`: with no `planner` key, the `roles` planners stand. A new project gets
  `claude` from the shipped `templates/config.json`, which `ahub init` copies;
  change it with `ahub init --planner <peer>` on a new project or by editing
  `roles` in `.agenthub/config.json`.
- `automatic`: when no rostered peer holds the role, the hub gives it to the
  first rostered peer of that list. It recomputes this at start and after
  each roster change, and writes nothing to disk.

Change it with `ahub settings set planner codex`, the dashboard Settings row
(a settings session, `ahub ui --settings`) or `l` in the console. Planning
holders and their backlog notices update at once. Use a comma list, for example
`ahub settings set planner claude,codex`, to select several holders and follow
any displayed holder-change confirmation. Role text updates at the next peer
start. `ahub settings undo` restores the previous designation. Agents cannot
change it.

New tasks record their planner through the same pure assignment walk shown by
`ahub route explain`. Only that effective planner or the person changes their
planning. A bound holder keeps authority while busy, offline or paused. If it
is removed or leaves the roster, authority falls back to the current holders;
the stored binding remains available for audit. Old tasks and releases with a
null planner retain the legacy holder-wide authority. PII tasks keep null.
The person names a different holder with
`ahub task assign <id> <peer> --role planner`; this leaves the owner, reviewer,
state and delivery offer intact. A planner-created release belongs to that
planner; a person-created release keeps null.

A plan review is the exception: another settled holder may review a plan even
when it is not that task's planner, without gaining its other planning powers.
An agent author cannot self-review while another rostered non-offline planner
exists. With no independent holder, the receipt says `selfReview: true`; it
also records `planAuthor` (null when unknown). A person's own-plan override is
marked self-review too. Independent requests contain ids only. Controlled
recovery requires `task_planners` once a list/instance planner is configured or
any task/release binding or plan-review authorship marker is stored, even after
that configuration is removed.

With the lifecycle on (an `.agenthub/sdlc.toml` mode other than off), a card's planners get a "The board
changed" notice (#758). The planner whose own write changed the board is skipped.
A planning revision, a dependency change or a new card is a task notice; state
moves, reviews and assignments are recorded at `fyi` weight (no turn), at most
once per planner per ten minutes. A newer notice replaces an unsettled copy, and
the hub's own bookkeeping tells nobody.

A task write also wakes the task's rostered planners when it frees capacity or
releases backlog work (#785): a lower WIP for the owner or reserved peer adds a
`capacity_released: <peer> WIP <n>; reserved ready #<id>|none` line, and an
approval that leaves a backlog card with no unresolved dependency adds
`backlog_ready: #<id>`. The lines go in one `Planner work ready:` task notice
per planner, ids only; a newer one merges and replaces the unsettled copy, which
survives a restart. By default nothing is pulled automatically: the planner reads the
board and decides. With `tasks.auto_pull` on (opt-in, see below) the hub itself pulls
the top eligible card explicitly reserved for a peer when an auto-pull trigger fires.

When `hub_task_done` leaves a review whose exact-head CI is not yet green (the
lifecycle must be on, the task linked to a PR and not private), the hub starts one watcher
for that head (#785): one `gh pr view` a minute, ended by a passed CI result, by a
45 minute deadline, by a newer head, a verdict or a cancellation, or by hub
shutdown; a restart does not restore it, and the next `hub_task_done` starts a new
one. A failed or incomplete result is told once and the watcher keeps reading for a
rerun of the same head: the first pending read after a newly told result renews the
deadline once, and a deadline after a told result ends silently (#540). Cancelled
attempts and a draft PR's deferred `check (macos-latest)` are pending to this watcher,
not failures; it keeps watching for a replacement run. After `gh pr ready`, an older
macOS aggregate failure stays pending while a newer same-workflow macOS shard is queued
or running (#1490). Review admission accepts this repository's draft head when Ubuntu,
seeded guards and the other required checks pass and the failed macOS aggregate's
exact-head job proves its draft-deferral step was the only failure (#1576); merge
still needs the full macOS gate. If GitHub returns multiple
rows for one check, the hub uses an older-run filter only when workflow identity and
start times identify one unique latest run; ambiguous duplicates cannot establish a
pass (#1527). On the result the owner and the reviewer each get one
`ci_completed: #<id> head <sha12> passed|failed|incomplete` task notice (ids only, the
head cut to 12 characters; a person reviewer gets a console line instead), and
unless CI failed, a review the hub held as premature for that head is offered
once more after a fresh readiness read. A deadline tells the console only. No peer turn waits for
CI, and nothing is polled outside a watcher.

`tasks.auto_pull` (default off, machine-local, live) lets the hub act on that
wake-up (#785, #1547). A slot release, an eligibility-changing backlog plan, a
dependency approval that readies a reserved card, or the peer's first idle
attachment queues a pull for that peer. The hub pulls the one top backlog card
explicitly reserved for that peer, through the same planner pull a
planner makes: revision, dependency, reservation, pinned, frozen-release, P0 order
and WIP checks all apply unchanged, and a refusal becomes a console notice naming
why. Unreserved cards, cards reserved for another peer and private (PII) cards are
never pulled. One card per trigger, as the hub for the card's own planner of record:
the history entry reads `by: hub` with that planner and a reason of the form
`auto_pull: <cause> for <peer>; hub acted for planner <planner>`. The cause is
`capacity released`, `backlog planned`, `backlog ready` or `peer available`. When no reserved card is ready, the idle or freed peer is offered the first ready, unowned proposed task it is eligible for, one per trigger, through the ordinary routing gates and only for classes whose routing list names it (#1626). Every owner choice the hub makes on its own also skips a peer at its WIP cap, with a held queue, or backing off after a capacity decline; an explicit person or conductor assignment is unchanged. A hub that
is paused for recovery pulls nothing, also when the setting is turned off or recovery begins while a pull is already waiting on its screening: that pull writes nothing, and a recovery waits for pulls in flight. A committed `config.json` cannot turn it on: like
the other machine-local policies it is ignored there with a log line.

A backlog or unowned proposed card whose `plannedStart` is still in the future is
not started automatically (#1092). Until that time the hub sends no
`backlog_ready` line, makes no auto-pull, makes no ready-queue or queue-pressure
owner offer, and the task sweep reports no stall. Planner grooming lists the card
as `scheduled`. The card becomes eligible at the planned start itself. A planner's
explicit pull or a person's assignment is unchanged.

## Resetting a project's hub

`ahub reset` returns a project's hub to a clean state. Without `--yes` it is a
dry run: it lists what it would settle, clear, archive and keep, by delivery
id, peer name and count, never task or message text, and changes nothing.
With `--yes` it first stops a running hub the way `ahub kill` does, then acts.

```bash
ahub reset              # dry run, runtime scope
ahub reset --yes        # runtime reset
ahub reset --all        # dry run, full reset
ahub reset --all --yes  # full reset
```

The runtime reset (the default):

- discards every `queued` and `needs_review` delivery with reason `reset`
  through the delivery journal, one `resolution_history` entry each. Work
  that was dispatching or accepted when the hub stopped is held as
  `needs_review` first, so it is discarded too;
- discards hub notices a recovery hold kept back the same way, one entry per
  recipient, without delivering them; the dry run lists them as
  `q:<peer>:<id>`;
- clears manual peer holds (`ahub pause`), budget pauses and conductor holds;
- drops the agent session resume pointers `sessions.json`,
  `claude-session.json` and `claude-context.json`, so the next launch starts
  new agent sessions. Pi transcripts under `pi-sessions/` stay;
- removes the manifest (`status.json`, `control-token`, and `hub.pid` from a
  hub of 0.12.20 or older) a hub left when it did not stop cleanly, once no
  process behind it is alive (a pid that now belongs to another process counts
  as gone when the manifest carries the hub's signature, from 0.12.21);
- keeps the board (tasks, reviews, outcomes, turns, touches), `hub.log`,
  `events.jsonl` and `cli-audit/`, recovery records, execution budgets,
  configuration and files the hub does not own.

The full reset (`--all`) moves the whole state directory, unchanged, to
`.agenthub/archive/state-<UTC time>/` (mode 0700) and starts an empty state
directory holding only `project.json`, so the project keeps its id and
registration; the next `ahub up` starts with an empty board and queue.
`.agenthub/config.json`, `config.local.json` and `routing.toml` live outside
the state directory and are not touched. The archive keeps the task text,
PII included, so it stays in the project: the reset writes
`.agenthub/archive/.gitignore` (`*`) so git ignores it, and the local
worker's and Pi's denylist (file tools, sandbox, memory capture) covers
`.agenthub/archive` as it covers `.agenthub/state`. Turn snapshots leave the
archive out as they leave the state out. Nothing deletes or prunes
archives; removing one is a manual act.

To restore an archive, stop the hub, move the current state directory into
the archive too (where git and the local worker's denylist cover it), then move
the archive back:

```bash
ahub kill
mv .agenthub/state .agenthub/archive/state-$(date -u +%Y%m%dT%H%M%SZ)
mv .agenthub/archive/state-<UTC time> .agenthub/state
ahub up
```

Only a person runs `ahub reset`: an agent shell is refused before anything
happens, as for `kill`, `restart` and `upgrade`. It is refused, with nothing
changed:

- while an upgrade or recovery operation is open (the machine's recovery lock,
  or a running hub that reports an unreleased recovery);
- when no registration matches this project and state directory. A running
  hub must then be stopped with its matching CLI; a stopped project is
  registered again by `ahub up` (then `ahub reset --yes` stops it first). When
  the project is registered with another state directory, the error names
  `ahub --project <id> reset` instead;
- when the hub's ownership cannot be verified, as `ahub kill` refuses it;
- for `--all`, when the state directory is not `<root>/.agenthub/state`
  (`AGENTHUB_STATE_DIR` or a symlink elsewhere): archive such a directory by
  hand after `ahub kill`;
- for `--all`, when `.agenthub/archive` is a symlink or not your own
  directory, or its `.gitignore` is not a regular file: anything with write
  access to the project could otherwise send `hub.db` out of it. Inspect and
  remove what is there, then run the reset again.

After stopping the hub the reset holds the project's registry claim, the one a
daemon takes to run, until it is done, so no hub starts under it; a hub that
started in between makes it stop with nothing reset; a crashed hub's leftover
manifest does not count as one. If a step fails after the stop, the error says
how far it got: rerun `ahub reset --yes` to finish a runtime reset (every step
can run again), unless the error says the state cannot be read (a damaged
`hub.db` or journal fails the same way every time): `ahub reset --all --yes`
archives such a state directory as it is. A full reset names the archive once
the state directory has moved.
It never touches claude-mem or hub memory (`~/.agenthub/memory/`): notes saved with
`hub_remember` are shared memory, not hub state. Claude Code sessions attached to the hub lose their hub session;
relaunch them with `ahub claude`.

## Orphaned daemons

Daemons from before those guards, or daemons whose project directory was
deleted while they were stopped mid-shutdown, are found with:

```bash
ahub doctor --orphans
```

It lists registrations whose project root is gone, with any live process
candidates (the registry claim, the state manifest, the legacy pid file).
To stop them:

```bash
ahub doctor --orphans --kill
```

`--kill` sends SIGTERM, then SIGKILL, but only while the process argv names
that project's hub daemon exactly (the argument after `--project` must equal
the registered root); a bare, reused, or merely prefix-matching PID is never
killed.
Rows without a live process are stale registrations; forget them with
`ahub projects remove <id>`.

## Agent CLI versions

Agent CLIs update themselves often, and a hub release cannot follow every one. One policy decides each gated CLI: the Codex and Kimi fresh reviewers, the headless Claude implementer, Jcode, agy, Qwen and Pi (#691, #847). Qwen has two entries: `qwen` for headless ACP and `qwen-dual` for the dual-output TUI (#286).

- `ahub agents [--json]` lists each gated CLI with its version, verdict and verified versions.
  - **verified:** a receipt exists.
  - **in-line:** untested, inside the compatible line that a contract gate (Jcode, agy) declares; it starts with a note.
  - **trusted:** you accepted this exact version on this machine.
  - **refused:** the reason names the installed and verified versions and the command that admits it.
  - **unknown:** the CLI is not on PATH, or its version could not be read.
- `ahub agents trust <id> <version>` accepts one untested version on this machine (`~/.agenthub/agent-compat.json`); `--revoke` undoes it. Only the person can run it; agent shells are refused.
  - For the reviewers, trust lifts only the version pin. The MCP inventory, Apps/plugins/hooks readback, sandbox denial fixtures and binary fence still run before every child, and a failed leg still refuses.
  - What trust cannot prove is printed when you trust.
- `ahub doctor` shows one line for each installed CLI that is not on a verified version.
- A daily workflow (`.github/workflows/agent-compat.yml`) runs `scripts/agent-compat-watch.ts`, which reads the latest published version of every gated CLI that has a public source: the npm packages `@anthropic-ai/claude-code`, `@openai/codex`, `@moonshot-ai/kimi-code`, `@qwen-code/qwen-code` (for both `qwen` and `qwen-dual`) and `@earendil-works/pi-coding-agent` (for `pi`, since #847 gave it a COMPAT entry), and the GitHub releases of Jcode. agy has no public source, so its row reads "no public source; local drift only" and is never a failure. Every COMPAT entry names the receipt to repeat (`receipt`), and a test requires that file to exist and the entry to have a watcher source. A version that cannot be read reads as unknown, not as a crash. The workflow keeps one `agent-compat` issue current while a source is ahead and closes it when none is.
  - **Tracking issue identity (#964):** only the exact title `agent CLI versions ahead of the verified set` identifies the issue; the `agent-compat` label is for people. The workflow reads open issues without filtering by label, then `scripts/agent-compat-issue.ts` selects one valid issue number or confirmed absence. Multiple exact-title matches fail with their issue numbers before any label or issue write. A failed read, malformed inventory or full 1000-issue result also stops without mutation. With no match, an ahead report creates the tracker and an all-verified report does nothing; unrelated labelled issues and their bodies are never selected.
  - **Maintenance loop (#843):** the daily upstream watch is the trigger; `ahub doctor` is the local drift notice for versions installed on a machine, and the hub itself tells the planner (below). The planner files one receipt task per (id, version): the implementer repeats the procedure in the entry's last `docs/verification/` receipt, writes a new one, and adds the version to `verified` in that same PR; the next release ships the bump. A person's `ahub agents trust` stays the stopgap that keeps a machine running meanwhile, and the person may revoke it once the bump lands.
  - **Local drift notice (#843 AC3):** at hub start and once a day the daemon reads each gated CLI's installed version with the probe `ahub agents` uses (no network, no install). For every installed CLI on a version that is not `verified` (in-line, trusted or refused) the effective planner gets one notice per (id, version): the id, the version, the state and the last receipt path, nothing the CLI printed. A CLI that is not installed, or whose version cannot be read, is not drift. The marker is kept per (id, version, planner) in `hub.db` (`agent_drift_notices`), so a restart repeats nothing, a planner whose notice could not be queued (or who joins later) is retried alone without telling the others again, and a new version is a new notice; with no rostered planner nothing is recorded. `ahub status` shows one `agent CLI drift` attention line per drifted id until the installed version is verified.

### Qwen 0.27.0 receipt attempt (#849)

The [0.27.0 ACP receipt](verification/2026-11-09-qwen-0270-acp.md) records passing account-free
ACP/permission/lifecycle checks after explicit runtime-state fence rulings, separately preserving earlier
controller preflight failures. Its [model-setter check](verification/2026-11-09-qwen-0270-model-setter-1317.md)
observed A/B/B after acknowledged B/A setters, but retained no latest-USER binding for the third request, whose purpose remains unknown. The [suggestions-off repeat](verification/2026-11-11-qwen-setter-suggestions-off.md) records ordinary A/B/A on both 0.26.9 and 0.27.0. Basic ACP 0.27.0 remains independently admitted; this setter evidence proposes a separate admission and enables nothing.
The production Qwen setter remains unavailable; `qwen-dual` is verified separately (0.26.1, 0.27.0, 0.27.1 and 0.28.3).

### Receipt automation audit (#1248 T0)

The data-only [manifest](../scripts/compat-receipts/manifest.json) and [per-leg audit](verification/2026-11-07-compat-receipt-audit-1248.md) classify all current COMPAT receipts. Every leg carries a source section and exact excerpt. `autoAdmit` is policy eligibility after every required check and artifact binding passes, not a runnable harness or a version admission. Native Mac arm64 requirements remain; Linux fixture/source-check feasibility does not replace native platform evidence. Changed security-source regions require human review rather than an automatic diff-only pass.

| COMPAT id | CI repeat and other required scope | Install method | autoAdmit |
| --- | --- | --- | --- |
| `pi` | Linux host permission/version fixtures; Mac RPC extension, SDK and tool receipts; Mac arm64 native | npm exact | `true` |
| `claude-implementer` | Mac Write/Bash/rewrite transport and wrapper controls, synthetic provider; Mac arm64 native | npm exact; native-installer receipt boundary | `true` |
| `codex-review` | Linux source comparison; Mac production metadata and native sandbox controls; Person-authorized model-backed tool call | npm exact | `false` |
| `kimi-review` | Linux source comparison; Mac private config/broker/native allowlist controls; Mac arm64 native | GitHub asset + SHA-256 | `true` |
| `jcode` | Linux source comparison; Mac serve/ACP/MCP and fixed-stream steering; Mac arm64 native | GitHub asset + SHA256SUMS | `true` |
| `agy` | Mac CLI, synthetic MCP/hooks and Seatbelt controls; Interactive TUI/launcher nonce; no public install source | Unavailable | `false` |
| `qwen` | Mac ACP/permission and install replay; recorded Linux run is additional; Mac arm64 repetition required | npm exact | `true` |
| `qwen-dual` | Version/file-source checks are partial only; Real gateway model and PTY; OS not recorded | npm exact; historical artifact gap | `false` |

Optional model/TUI behavior explicitly left unverified by a model-free receipt is not a new admission leg. `codex-review` requires its separately authorized model-backed tool-call proof. `agy` has no public install source. The `qwen-dual` manifest records the original real-model TUI recipe without an OS; the newer [manual macOS arm64 receipt](verification/2026-11-10-qwen-0270-dual-output.md) does not change that manifest's `autoAdmit: false`. The manifest records acquisition metadata separately from historical native-binary evidence; no CLI installation or COMPAT change is made by this audit.

For CI-opened PRs, the person selected `GITHUB_TOKEN` with explicit `check.yml` dispatch on `compat/<id>-<version>` (2026-11-07). The publisher needs `actions: write` for dispatch in addition to its branch, PR and issue permissions. No GitHub App credentials are used. Dispatch supplies exact-head check evidence; it does not trigger the separate PR-only closing-refs/routing-receipt workflows. The T0 audit retains the alternative App-token trade-offs as history. Current [GitHub documentation](https://docs.github.com/en/actions/how-tos/write-workflows/choose-when-workflows-run/trigger-a-workflow) also describes approval-required PR runs for GITHUB_TOKEN automation; that is not unattended CI. See the audit for permissions, queue and gate trade-offs.

### Automated receipt workflow (#1248 T2)

After merge, `agent-compat.yml` runs daily and can be dispatched with `dry: true`
(the manual default). The watcher emits validated ahead/version and verified-ID
JSON directly; matrix construction never parses report prose. At most eight IDs
are considered, with two hosted jobs at once. An unspecified manifest OS stays
not-run rather than receiving an invented native-platform proof.

The candidate matrix has only `contents: read`, no supplied secrets, checkout
credentials disabled and a 20-minute job bound. It runs the disposable harness and
uploads JSON/Markdown even for failed or not-run legs. A separate trusted read-only
job validates the summaries and builds the embedded COMPAT bundle from repository
source. It never imports candidate JS or Markdown. The publisher downloads that
job's immutable artifact ID and validates descriptors, byte hashes, identities,
complete leg sets and trusted manifest policy again.

The candidate CLI and receipt writer share a job and OS user. A malicious release
could overwrite its own `summary.json` before upload with a well-formed eligible
forgery; preparation cannot detect that forgery from the data alone. An eligible
receipt is a compatibility signal, not a security attestation of the release.
The person's PR and release review is the real admission gate; the automation
never merges its verification PR.

Only the publisher has contents/PR/issues write and Actions dispatch permission.
It executes first-party Node code and `gh` REST calls, with no package install,
build or candidate execution. All required legs must pass and trusted `autoAdmit`
must allow the ID; artifact `eligible` alone is not evidence. It changes only the
exact COMPAT row, its receipt and prepared plugin assets on `compat/<id>-<version>`.
Existing bot branches are checked for manual drift; unknown collisions refuse,
updates append without force, and verification PRs are never auto-merged. A newer
same-ID PR supersedes an older one only after the replacement and its check
dispatch succeed.

Other results update closed-cause receipt blocks in the exact-title drift issue.
Confirmed verified IDs remove their stale blocks, while still-drifting or unknown
IDs retain their evidence. Report text never supplies those identities. Dry mode
still performs isolated proof and read-only build/artifact work, then prints the
planned GitHub changes without creating/updating branches, PRs, labels or issues.
It is not native compatibility qualification on the person's Mac.

See the [T2 verification report](verification/2026-11-07-compat-workflow-1248.md)
for the data/credential boundary, fixtures and final committed-head evidence.

### Isolated receipt harness (#1248 T1)

Run `bun scripts/compat-receipt.ts <id> <exact-version> --out <new-owned-directory> --disposable-runner`
from the checkout on a GitHub-hosted runner or disposable Linux container. The
explicit flag is required; a local personal Mac is refused even with a temporary
HOME. The runner VM/container must be destroyed after the job. The command writes `summary.json` and `receipt.md` without
changing COMPAT, trust on this machine, or any workflow. Its exit codes are 0 for
a completed pass, 1 for failure, 3 for required work left not-run, and 2 for invalid
input/output. `eligible` also requires the manifest's admission policy; a pass
alone never overrides the Codex/agy policy or a required model/TUI leg.

The installer binds exact npm metadata and SRI before installing the verified
local tarball into its private prefix, with empty user/global npm configs and a
private cache. Release assets must match their tagged SHA-256 digest and checksum
before bounded extraction; absolute/traversal/link/nonregular archive entries and
size/count excesses refuse. No global installer or caller credential environment
is used. Normal npm lifecycle behavior is not silently disabled; this does not
certify an unreviewed lifecycle proof. Isolation uses fresh HOME/XDG/tool homes and
an allowlisted environment, not a claim of kernel confinement for every installer.

Proof APIs load in a separate worker after that environment is established. The
Codex backend's real production preparation is reused, including empty and
ambient fixtures; its returned model `exec` command is never started. Kimi private
configuration, exact host inventory and broker refusals are separate from native
tool dispatch. Committed Claude transport/wrapper producers are imported through
`runpy`, with optional exact-version/runtime-path inputs; their historical defaults
and behavior assertions remain intact. No prepare evidence-description string is
used as an execution-time proof.

| Proof family | T1 can run | Explicit not-run work |
| --- | --- | --- |
| Codex reviewer | Committed production prepare, actual metadata/native-canary checks and launch configuration assertions | Model-backed hub call, separate control artifact and human source review |
| Kimi reviewer | Committed prepare/inventory/broker plus promoted native two-tool loop, Write positive/negative controls, preload guard and producer group cleanup; the native child runs with Kimi's own startup update check off (`KIMI_CODE_NO_AUTO_UPDATE`), and accepts the 2.5.x and 2.6.x injected-Write refusal wordings (#1248) | Human source review; unsupported native platform |
| Claude implementer | Committed Write/Bash/rewrite and host-wrapper producer groups | Human upstream-impact review; unsupported launcher forms |
| Pi | Candidate-parameterized model-free receipt (`proofs/pi.ts`, from the 1.5.0/1.5.2 producers): `--version`, the installed SDK loading this checkout's extension, tool callback replay and denial, `--mode rpc` `get_state`, zero provider requests, the two host fixtures, and a before/after hash of the account's own `~/.pi/agent` (#1248) | Account-backed inference and interactive TUI coexistence (explicit unverified follow-ups, not legs) |
| Qwen ACP | Promoted ACP identity/session/mapped-mode and actual published permission-handler producers, preload controls and group cleanup | Human lifecycle/source review; Linux does not replace required macOS arm64 |
| Jcode | Reconstructed isolated serve/ACP/MCP, fixed-stream steering, telemetry and owned-group checks | Human source comparison; native macOS qualification remains unverified. The 0.99.1 Linux control is not qualified: telemetry identity and strict persisted-context binding fail; see the [reconstruction receipt](verification/2026-11-07-jcode-receipt-reconstruction-1248.md) |
| agy and qwen-dual | Policy and unavailable/manual-leg reporting | No public agy installer; account/model/TUI or unspecified-platform legs |

Every manifest leg appears as pass, fail or not-run with a cause and next step.
Missing producers are not inferred from configuration or other host tests. Partial
receipts cannot qualify a candidate while required work is missing. Source/lifecycle
semantic review is not a fetched-diff pass. Synthetic loopback fixture sentinels are
not real provider API keys; parent account/model variables never reach a worker.

Default execution deadlines are 15 minutes overall, 3 minutes for installation
and 2 minutes per proof-worker/group. Owned-process teardown has a separately
bounded 10-second allowance, included in the JSON wall-time bounds. Output verification/publication has a
separate 16-second allowance included in the total; elapsed time is sampled before
publication. The summary
separates `ownedStopConfirmed` from `processCleanup: proven|unproven` and gives its
reason. An empty leader process group cannot prove lifetime cleanup: a helper can
detach into a new group with ignored pipes and survive its launcher. Detected
survivors and an unconfirmed owned stop fail the run. Producer cleanup legs assert
that the native group they started stopped, using their original receipt evidence;
they retain that pass or fail independently of harness lifetime cleanup. Native
lifetime cleanup remains unproven in T1 and is reported without gating eligibility.
A passing receipt with eligible policy and confirmed owned stop can be eligible
while lifetime cleanup is unproven, provided no survivor was detected. The private
workspace is kept until runner destruction; its location is reported only on stderr. A portable
process supervisor belongs to a separate follow-up. Disposable runner lifetime is
the containment boundary, not fresh HOME or process-group emptiness.

The output directory is held open before installation. Exclusive, no-follow
writes are relative to that handle, so replacing an ancestor cannot redirect the
receipt. The receipt excludes raw native stdout/stderr and private prefix paths.
No PR is created by T1. The [T1b producer report](verification/2026-11-07-compat-receipt-producers-1248.md) maps the promoted Kimi and Qwen modules to their original receipts. Publisher integration is T2. The [Jcode reconstruction](verification/2026-11-07-jcode-receipt-reconstruction-1248.md) retains its failed native control legs and unverified Mac qualification.


## Upgrade and crash recovery


Before preparing or stopping a source, preview and uncommitted staging compare each automatically restored version-gated peer's configured executable with the verified target package's compatibility policy and current machine trust (#1426). A refused version names the peer/version and `ahub agents trust <peer> <version>` or installation of a verified version. Unknown observations remain unknown and block that source before commit. Preview may populate the private verified target-package cache; it does not prepare, stop or select a project runtime. The digest check uses the target's existing owned/hoisted dependency layout. Previously committed or commit-sent sources are not retroactively gated by a later executable/trust change. Ordinary Codex restoration does not acquire the separate reviewer sandbox version gate.

A refused restoration command now produces a private, per-attempt exit observation. The native command keeps its terminal descriptors; the reader accepts only the matching nonce/peer and a bounded complete record. The persisted cause is `version_refused` or `launch_exit`, with exit code and a bounded privacy-screened first hub refusal line (otherwise a neutral instruction to inspect the launch terminal). This observation blocks within the existing readiness slice; it is never evidence of native readiness, ownership or session settlement. Attempt files are disposed, and late writers cannot recreate their removed directory. Native/session fences still decide every retry and settlement.

Fix the named cause, then run the exact `ahub recovery resume <op>` command in the operation status. While its runner is still working, close the refused launch terminal and check status; resume after the runner blocks or exits. A direct peer start cannot bypass the recovery hold. A fresh resume launches once and retains the recorded conversation; it does not silently choose a new one.

### Side by side project versions (#1039)

`ahub --project <path|id> upgrade --to <version>` reviews and changes only that
project. With no selector, the current project is selected. Its recovery hold is
per project, so another project can keep working, start, or perform its own
upgrade. The registry and manager still serialize their short ownership writes.
Legacy unscoped recovery receipts retain their machine-wide hold and original
shared installation steps; finish or dispose those before a new project upgrade.

From 0.26.0, `ahub up`, manager Start and dashboard Start honor the selected
project's `<state dir>/runtime.json`. It binds the project identity to a verified
runtime version, root and capture digest. A caller at that version or later uses
the retained runtime; an older caller refuses with `this project runs X; use X or
later / ahub upgrade`. A scoped upgrade changes only that project's selection and
does not refresh the shared manager. The daemon records its claimed instance,
and readiness confirms the same selection before returning.

With no runtime record, the first managed startup captures the invoking package
and its exact first-party memory core under
`~/.agenthub/releases/<VERSION>/source-<digest>/`. Existing records with invalid
bindings or missing/changed captures refuse rather than selecting another
package. Runtime selection is machine-local state: a Git-tracked runtime record
or indeterminate Git tracking check refuses before launch. Each startup checks
only the runtime file's containing paths in Git once, with a bounded deadline;
unrelated index entries are not enumerated. Plain directories without a
repository remain supported. Capture reuse does not depend on a mutable global installation. Scoped
upgrade targets use the same version directory, with the verified registry
install kept separately in `registry/`. Recovery uses its authority receipt's
exact target path and records that selection through the updated startup path.

A project whose hub is stopped upgrades without starting it (#1540).
`ahub upgrade --to <version>` in such a project, or `ahub --project <id> upgrade
--to <version>`, shows `stopped: runtime selection only`, with no peers and
nothing carried over. With `--yes` it stages and verifies the target once, then
rewrites that project's `runtime.json` through the same verified write a startup
uses, under the registry's runtime-capture lock. It starts no daemon, opens or
closes no terminal, touches no peer and records no recovery operation. The next
`ahub up` with a CLI at that version or later starts the new runtime; an older
CLI refuses with `this project runs X`. A project that reads as anything but a
positive `stopped` (unknown, unavailable, starting, stopping, incompatible) is
never retargeted, and a hub that starts between planning and the write is refused
and never written over: the write rechecks the registry claim, the control
manifest, the recovery hold, the restart snapshot and the recorded selection
under the lock. These refuse and name their next step: a stopped project that
holds an unreleased or unreadable restart snapshot, a missing project, a root
that is not initialized, an unreadable or Git-tracked `runtime.json`, and a
project under a recovery hold. The retarget is the person's choice of which code
runs next, so a conductor or a `--live-test` delegation is refused.

`ahub upgrade --all-stopped --to <version>` covers every registered project that
reads as `stopped`. Each project is planned and applied on its own and the
package is staged once. A dry run lists one row per registered project: `retarget`,
`already at <version>` (also for a newer recorded version, never a downgrade),
`skipped: running` with that project's own `ahub --project <id> upgrade` command,
or `refused: <cause>` with its next step. `--yes` writes the `retarget` rows only
and requires `--to <exact-version>`. The result lists each project's outcome and
the exit code is nonzero when a planned retarget failed; the successful rewrites
stay and the failed projects are named. `--all-stopped` with `--project` is
refused as conflicting selectors.

This selector/refusal guarantee starts with 0.26.0. Published CLIs older than
0.26.0 ignore the runtime record. After a scoped upgrade, invoke `ahub up` with a
0.26.0-or-later CLI that is at least the selected project's version; keeping an
older global CLI does not retrofit this protection. No database schema or
bootstrap floor is raised for runtime selection. Tests of the updated resolver
are not receipts from those older published binaries.

After a confirmed new startup, a separate, rate-limited maintenance worker keeps
the newest three source captures per version plus every registered runtime, live
manager runtime and retained recovery reference. Metadata snapshots and atomic
quarantine use short registry writer transactions. Only removal candidates are
hashed; package verification and recursive deletion run outside that lock and
outside the startup result. Active recovery, uncertain owners, exhausted
inventory budgets or an unreadable/incomplete inventory defer deletion.
Only verified versioned `source-<digest>` directories are eligible;
registry installs, unversioned coordinator sources, unknown layouts and symlinks
remain. Reserved `.runtime-prune-*` quarantine paths cannot launch a managed
runtime. Changed or unknown quarantined contents remain undeleted for inspection.
Admission is home-wide, at most once per hour with at most three removals per
run. A start while a recovery hold exists (or cannot be read) schedules no pass;
the recovery runner schedules one after it releases its lock, a pass deferred
only by recovery coordination starts no one-hour wait, and `ahub doctor` reports
that deferral without failing runtime pruning (#1546). `~/.agenthub/runtime-prune.db` records admission and the bounded outcome.
Admission stores the worker's PID and process signature. The next admission
atomically replaces a worker proven gone; live or uncertain owners remain
fenced. Worker completion uses the normal database wait bound, while startup
admission keeps its 1 ms contention bound. `ahub doctor` names an uncertain or
stuck ledger and leftover quarantine paths without changing either. Leftover
containers remain available for inspection even after a dead worker is replaced.
Recovery receipts (`<hub home>/recovery/<operation-id>.json` and its
`.json.runner.db`) follow a retention rule the hub applies itself at the start
of each maintenance pass (#1541): it keeps every receipt that is not terminal,
the newest 32 `completed` or `cancelled` receipts, and up to 64 more finished
receipts that name a runtime a registered project or the live manager still
selects; it removes older finished receipts together with their runner database,
under the same exclusive runner claim every recovery command takes, so a live or
unidentifiable runner keeps its receipt. It does nothing while any recovery
hold (`recovery.lock` or `recovery/project-locks.db`) exists, and it never
removes a capture: captures are still retained by `runtime.json` and the
newest-three rule. An interrupted pass leaves at most a runner database with no
receipt, which the next pass removes. The inventory walk keeps 128 receipts as
a safety ceiling. Open receipts are the only way to reach it, and the deferral
then names the open operation and the commands to finish it
(`ahub recovery status <id>`, then `ahub recovery resume <id>` or
`ahub recovery abort <id>`), not the ledger. `ahub doctor` prints that text with
the same retention rule. Nothing asks you to delete a receipt by hand.
Startup still succeeds when maintenance defers. A damaged runtime
record/capture requires inspection or restoration.
Archiving the record deliberately resets first-use selection; archived copies
are not active pruning references.

A scoped upgrade leaves the global CLI and shared Claude plugin unchanged.
Update the CLI separately with `bun add --global @staix/agent-hub@<version>`, then
run `ahub setup` for the plugin. `ahub doctor` reports either tool when its known
version is older than the selected running daemon; it installs nothing. After a
completed or scheduled upgrade, `ahub upgrade` prints the same step when the CLI
or the plugin is older than the daemon it installed (#1179). It prints nothing with
`--json` or for `ahub restart`, and the advice never fails an upgrade.

| Runtime | Control protocol window | Legacy status field |
| --- | --- | --- |
| 0.12.20 through 0.25.0 | 16 only | `protocol: 16` |
| 0.26.0 through 0.39.0 | 16 through 17 | `protocol: 16`, `protocolMin: 16`, `protocolMax: 17` |

New clients choose the highest common protocol. The protocol window remains 16
through 17, so the published protocol-16 client and channel plugin remain usable; unrelated feature
capabilities still require their own labels. A disjoint window refuses with 4426.
The compatibility-floor `protocol` field remains readable by old clients.

Release N-1 is counted in minor versions, separately from this protocol window
(#1164, family contract entelecheia/ai-workspace#70). For 0.39.x, N-1 is 0.38.0,
the latest published patch of 0.38.x (exact `@staix/agent-mem` 0.24.0, control
protocol 17 with descriptor floor 16). Every patch on 0.39.x keeps that release
baseline. For 0.38.x, N-1 is 0.37.0,
the latest published patch of 0.37.x (exact `@staix/agent-mem` 0.24.0, control
protocol 17 with descriptor floor 16). Every patch on 0.38.x keeps that release
baseline. For 0.37.x, N-1 is 0.36.0,
the latest published patch of 0.36.x (exact `@staix/agent-mem` 0.23.1, control
protocol 17 with descriptor floor 16). Every patch on 0.37.x keeps that release
baseline. For 0.36.x, N-1 is 0.35.0,
the latest published patch of 0.35.x (exact `@staix/agent-mem` 0.23.1, control
protocol 17 with descriptor floor 16). Every patch on 0.36.x keeps that release
baseline. For 0.35.x, N-1 is 0.34.1,
the latest published patch of 0.34.x (exact `@staix/agent-mem` 0.22.1, control
protocol 17 with descriptor floor 16). Every patch on 0.35.x keeps that release
baseline. For 0.34.x, N-1 is 0.33.0,
the latest published patch of 0.33.x (exact `@staix/agent-mem` 0.22.1, control
protocol 17 with descriptor floor 16). Every patch on 0.34.x keeps that release
baseline. For 0.33.x, N-1 is 0.32.0,
the latest published patch of 0.32.x (exact `@staix/agent-mem` 0.21.0, control
protocol 17 with descriptor floor 16). Every patch on 0.33.x keeps that release
baseline. For 0.32.x, N-1 is 0.31.0,
the latest published patch of 0.31.x (exact `@staix/agent-mem` 0.21.0, control
protocol 17 with descriptor floor 16). Every patch on 0.32.x keeps that release
baseline. A change that cannot retain it needs a new minor release. The 0.31.x
baseline remains 0.30.0 (agent-mem 0.20.1); for 0.30.x it was 0.29.0.

In the minor release PR, together with its `package.json` version bump, query
the published versions of `@staix/agent-hub`,
select the latest stable patch of the preceding minor line, and mechanically
bump `test/fixtures/release-n-1/package.json` and its own `bun.lock`. Do not
merge this bump before or separately from the minor version bump: the guard
requires the fixture minor to be the package minor minus one. Update
the corresponding release entry in `test/published-protocol-compat.test.ts`
with the package version, exact amem dependency and protocol read from that
published package. Generate the lock with the pinned Bun, then commit it. The gate installs it separately
with `bun install --frozen-lockfile`; the compatibility test uses its unchanged
published runtime, client and plugin in both directions. Keep the separate
`test/fixtures/protocol-v16` fixture at 0.25.0 while protocol 16 is promised;
the previous-minor fixture does not replace protocol-floor coverage.

Each new minor release's CHANGELOG entry states the selected N-1 version and the
compatibility of each surface: wire/protocol, files and format floors, CLI,
and MCP tools. State any capability or format ceiling explicitly. Patch release
entries contain no new N-1 statement and inherit their minor line's baseline.
`release-prepare` moves the Unreleased text mechanically; the release author
adds this minor-only statement during preparation and checks the fixture bump
in that release PR. Never amend a tagged release section. The 0.30.0 N-1
record added by #1164 is an explicitly dated post-release note, published in the
0.31.0 section; it was not part of the published 0.30.0 tag or tarball. Its MCP ceiling includes
0.29.0 free-form `plan.sources` values: 0.30.0 requires registered source ids
and rechecks existing stored plans even when accept sends no new plan.
No compatibility statement grants release consent.

Guard-aware runtimes read `hub.db` format metadata before startup effects and
before writable database opens. A newer incompatible format refuses with
`this project was opened by agent-hub X; use X or later`. The format counter
advances for incompatible storage changes, not every package release. Controlled
recovery refuses a target without `schema_guard` before source replacement. A
fully committed legacy receipt continues from retained target identity evidence;
new staging gates are not applied retroactively to a target already started.
Published binaries from before this guard cannot enforce it; use their matching CLI for bootstrap and never open
a newer database directly with an unguarded old binary. New scoped receipts use
schema 3 so an older recovery coordinator refuses them rather than applying its
machine-wide upgrade steps.


On a terminal, one command reviews, applies and follows an upgrade:

```bash
ahub upgrade
```

Without `--to` the target is the registry's latest release. When that release is
newer than the installed CLI, the CLI names the release's own coordinator
(`bun x --package @staix/agent-hub@<version> ahub upgrade --to <version>`), asks,
and hands over to it, so the version is never typed twice and an older CLI never
coordinates. From an installed CLI older than 0.12.22, start it once by hand:
`bunx --package @staix/agent-hub@<version> ahub upgrade`. The screens are
described under [Interactive upgrade](#interactive-upgrade); the rest of this
section is what they run.

Upgrade running projects with the target release's own coordinator. It accepts
a running source on control protocol 9 (0.6.x), 10 (0.7.0 through 0.12.0),
11 (0.12.1 and 0.12.2), 12 (0.12.3), 13 (0.12.4 through 0.12.15), 14 (0.12.16), 15 (0.12.17 through 0.12.19) or 16 (0.12.20 through 0.25.0), plus the current 17/16 window, and only
a target with a common protocol and the required recovery capabilities, so the target's coordinator fits every supported
source and carries every recovery fix released up to it. Protocol 8 and older
(0.5.x and earlier) are refused as `manual-bootstrap-required`. Run from the
project directory, without replacing the global CLI first:

```bash
bunx --package @staix/agent-hub@0.12.43 ahub upgrade --to 0.12.43 --dry-run
bunx --package @staix/agent-hub@0.12.43 ahub upgrade --to 0.12.43 --yes
```

| Running now | Coordinator to use |
| --- | --- |
| 0.6.x (protocol 9) | the target's, through `bunx` as above |
| 0.7.0 through 0.12.0 (protocol 10), 0.12.1 and 0.12.2 (protocol 11), 0.12.3 (protocol 12), 0.12.4 through 0.12.15 (protocol 13), 0.12.16 (protocol 14), 0.12.17 through 0.12.19 (protocol 15), 0.12.20 through 0.25.0 (protocol 16) | the target's, through `bunx` as above |
| any supported source, with the installed CLI already at the target | `ahub upgrade` below, which is the same coordinator |
| 0.5.x or earlier (protocol 8 and older) | not supported: bootstrap by hand with the matching CLI |

Do not use the 0.8.0 coordinator for a running 0.7.x hub with tasks on its board:
its verification never matches the board and the operation stays blocked (fixed
in 0.8.1). Such a blocked operation can neither resume nor abort, and its lock
refuses `up` and `kill` for every project; the [smoke ledger](smoke.md) (0.7.11
to 0.8.0) records the manual cleanup. Do not use an older installed CLI as the
coordinator. After an upgrade, do not start an older hub on the same project: it
does not know the newer task columns, and its board readback breaks a later
upgrade. A 0.6.x CLI cannot target
protocol 10: its plan does not check the target's protocol, so the dry-run shows
no blocker, and `--yes` stops at staging ("target protocol requires a newer
coordinator") with an operation left to clear by `ahub recovery abort <id>`. An
older 0.7.x CLI may lack recovery fixes released after it. The
[smoke ledger](smoke.md) records dry-runs from real 0.6.4 and 0.7.5 hubs (issue
#75) and these applied upgrades: one with the 0.7.0 coordinator; one with the
0.9.0 coordinator from a running 0.8.1 hub with tasks and a budget pause; one
with the 0.10.0 coordinator from a 0.9.0 hub (one completion check running and
one queued); and one with the 0.11.0 coordinator from a 0.10.0 hub with
`local.bash_network` on.

The coordinator verifies and retains the exact target package, preserves its
own source, and verifies the selected project before releasing its hold. Legacy
unscoped receipts additionally promote the global CLI after project readback.

Once the installed CLI matches the target release, review the selected project first:

```bash
ahub restart --dry-run
ahub upgrade --to 0.12.43 --dry-run
```

Apply only after reviewing the plan:

```bash
ahub restart --yes
ahub upgrade --to 0.12.43 --yes
ahub recovery status [<operation-id>]
ahub recovery resume [<operation-id>]
ahub recovery abort [<operation-id>]
ahub recovery reattach <operation-id> codex|claude|pi
ahub recovery dispose [<operation-id>] --fresh-session <peer> --reason <text>
ahub recovery dispose [<operation-id>] --stop-and-archive --reason <text>
```

`--yes` needs `--to`; a dry run without `--to` plans the latest release. A target
newer than the CLI is handed to that release's coordinator with the same flags,
and the command is printed on stderr first. The `recovery` commands take the
operation that holds the selected project's lock (or a legacy machine hold) when
the id is left out, and report no operation when neither exists.

The coordinator commits only once the source is quiet: no turn running, no
approval pending, no completion check queued or running. It waits up to 10
minutes and then aborts, leaving the source running; upgrade between long
checks. A 0.8.x or older source does not report completion checks or console
task commands in flight, so the coordinator cannot wait for them. Before
`--yes`, for each task whose check `hub.log` reported as "queued or running",
wait until `ahub task show <id>` has `check passed`, `check failed` or `check
finished late` after `done (checking)` (a pass with a peer reviewer writes no
line of its own to `hub.log`), and until no task command or dashboard action is
still running. A check the commit's stop kills writes to the board after the
commit has recorded it, and the operation stays blocked.

From 0.12.33, while an operation holds a source of that release or later, and
while a restored target waits for release, the notices the hub writes itself
(other than `[FYI]` ones) are kept apart from the carried queues, durably in
the delivery journal and the restart snapshot, so the queue comparison still
matches exactly. Release queues them in order and saves each move before
anything is delivered. A target that does not advertise `recovery_deferred_hub`
gets them in its ordinary queues before commit instead. At most 2048 such
notices wait; a further one is refused, and none already kept is dropped.

0.9.0 turns on for every project with a config file, whether or not it has the
block: `limits` (12 messages a minute per sender, 6 per recipient, 6
`[IMPORTANT]` an hour, 120 s repeats) and `budget.wait_max_min` (30). Set them
to 0 to opt out.

0.10.0 changes every project's local worker: its commands run under the
deny-default sandbox described above, and a toolchain outside the listed
directories needs `local.read_allow`; `"local": { "sandbox": "allow-default" }`
in `config.local.json` restored the old profile until 0.12.0. Off unless set:
`review.adaptive`, `recovery.auto_resume_after_crash` and `capabilities`. A hub
before 0.10.0 keeps no session record, so a crash of one is not reported as such
by the next start.

0.11.0 changes what `local.bash_network: true` means: the local worker's and
Pi's commands reach the network only through the hub's egress proxy, to the
hosts in `local.network_allow` (package registries and GitHub's code hosts by
default). `local.network_allow` is machine-local and replaces the default list:
a project that needs another host sets it in `config.local.json` with the
defaults it still needs. `"direct"` keeps the open network of 0.10.0 until
0.13.0. Each command gets a temp dir of its own, and under deny-default the
shared temp dirs are closed.

0.12.0 removes `local.sandbox: "allow-default"`: a project that still sets it
runs under the deny-default sandbox, and `hub.log` and `ahub doctor` say so.
`local.bash_network: "direct"` still works until 0.13.0, and both name it while
it is set.

0.12.22 closes the name `.git` to the local worker's and Pi's commands at any
depth: `git init`, `git clone` and `git worktree add` no longer run inside the
sandbox (the full list is under Install and start).

The 0.7.0 transition stages the verified package and runs a retained
coordinator from the source tree. It accepts a verified protocol-9 source and
moves to a protocol-10 target. The source journal, queued envelopes, tasks,
manual pauses, budget state, and native session identity are read back before
release. The global CLI is promoted last.

A lost commit or start reply is reconciled against the actual daemon identity,
package digest, terminal binding, and phase receipt. An uncertain terminal
creation is never repeated blindly. Recovery retains the first-party memory package with the preserved runtime, includes its identity and bytes in the digest, and refuses missing, symlinked or changed retained dependencies instead of resolving a mutable ancestor/global installation. It does not copy the full dependency tree.

After creating a managed terminal, the coordinator saves its exact handle, incarnation and worktree before waiting up to 600 seconds (10 minutes) for authenticated attachment to the expected target hub and conversation. A pending or failed creation receipt also waits when the current target has a verified live launcher; its saved binding retains the pending/failed origin across interruption. An idle terminal alone is not attachment proof: after idle, the coordinator re-reads the launch record and Orca's identity every second within the same bound, until the terminal maps to the expected session or contradicts it (#599). Without a current launch record, a confirmed-ended row for another terminal and an attached session still reporting no id keep the chosen terminal waiting within the same bound; a late matching record continues that wait. Live replacement and unreadable records still block. Only non-offline session ids count, and older-instance launchers are checked before declaring a launch gone. Timeout retains the binding and diagnostic receipt; resume waits on that same binding rather than opening a duplicate.

The wait checks the selected launcher's signed identity on each poll. When that exact launcher exits and the target confirms no session or other live launcher, a pending-origin wait (including a new terminal) records failure and offers the failed-restoration choices, including fresh-session for Codex or Claude. A failed-origin wait returns to its existing retry path. A replacement terminal, missing or unreadable launcher identity, unreadable target or different attached conversation blocks without treating unknown as gone. Success clears the waiting origin and preserves exact terminal/session revalidation. A launcher from an older target instance still blocks without another terminal. The 10-minute limit matches terminal creation readiness; terminal idle can precede native resume and MCP handshake completion. The zero-turn Claude exception still applies only when no original transcript exists. If Claude shows its development-channel confirmation screen, confirm it in
the captured terminal, then run `ahub recovery resume <operation-id>`; resume must not open a duplicate terminal.
Kimi and local sessions may start fresh with preserved routing and task context.
A Claude session that never persisted a transcript (zero turns) also starts fresh:
there is nothing to resume, so the upgrade accepts the new session id; a session
with a transcript must come back with its original id.
A Claude session that `ahub claude` did not launch in a recorded Orca terminal
(a plain `claude`, or one whose launcher has ended) is planned as
reconnect-only: the plan lists it under `reconnectOnly`, and the command prints
`<project>: claude is reconnect-only` on stderr. Nothing in its terminal is
closed or relaunched, a `claude-session.json` left by an earlier launch is never
used as its target, and the plan does not show that record's id. Its plugin
reconnects to the new hub by itself (the coordinator waits up to 90 seconds) and
keeps the plugin version it started with until that Claude session restarts.
The target release must read recovery waivers; staging refuses one that does
not, before any runtime changes. Across a control-protocol change it cannot
reconnect; the plan then names a
blocker: end the session, or relaunch it with `ahub claude` in Orca, and make a
new plan. A refused `--yes`, and every dry-run, prints each blocker on its own
`ahub: blocker:` line before the final one.
Previously stopped projects stay stopped; only the reviewed running projects
are upgraded.

Do not run an upgrade with an incompatible active protocol, an unverified
terminal binding, or an unresolved operation lock. Dry-run performs no package,
plugin, daemon, or terminal mutation.

### Interactive upgrade

`ahub upgrade` and `ahub restart` are interactive when standard input and output
are a terminal and neither `--dry-run` nor `--yes` is given. With either flag, or
through a pipe, the plan is printed as readable text (#814) and `--json` keeps the JSON plan and the `ahub: blocker:` lines; the exit codes are unchanged. The screens add no way to change an operation: every choice runs one
of the commands in this section for you, so that command's refusals decide.

The screens use the CLI output palette and `--color=auto|always|never`, with the
same `NO_COLOR`, `FORCE_COLOR`, `CLICOLOR_FORCE`, `CLICOLOR=0` and `TERM` rules.
Auto colors a suitable TTY; explicit always has the console's override behaviour. Raw JSON bypasses colour and width
handling. Default and never print the same readable pipe, dry-run, status and
dispose text, and `--json` keeps the previous documents byte for byte. Presentation flags go after the command, for
example `ahub recovery --color=never` or
`ahub recovery status <operation-id> --json`. An explicit `--json` returns only
the raw document, without a human suffix. `upgrade --json` reviews a JSON plan;
`--yes` is still needed to apply it without the interactive review.

Under `--yes` the plan is printed without its closing "Nothing was changed"
line, because the command goes on to apply it (#1540). For a running hub, when
standard output is not a terminal, `ahub upgrade --yes` then waits until the
recovery operation is completed, blocked or cancelled and exits nonzero unless it
completed, so `ahub upgrade --to <v> --yes && ahub down` no longer races
`recovery operation <id> is active`. A runner that never appears (10 s), ends
with the receipt still open, or is still working after two hours is a failure
that names `recovery status`. On a terminal it still returns as soon
as the operation is scheduled, and `--json` prints the scheduled operation
document as before.

The plan screen lists each project with its hub version and, per attached peer,
its state, how it runs (`TUI` in a terminal the plan bound to its session,
`headless` as the hub's own process, `own` for a session the hub did not
launch or whose terminal the plan could not bind) and what happens to it: resumed in a new terminal (the old one is
named), reconnecting by itself, restarted as a new session, restarted headless,
or left offline. `in progress:` repeats what the running hub says keeps it from
being quiet (busy peers, pending approvals, a peer starting, a budget
transition; a hub of 0.12.22 or newer also names a task command, completion
checks or Pi tool calls in flight, ready tasks being released and a Pi that has
not settled); apply waits up to 10 minutes for it. Blockers follow, each with its
next action. The choices are `[a] apply` (absent while a blocker stands), `[r]
refresh`, `[k] end agents` (shown when an attached agent can be ended), `[j]`
the plan as JSON, `[x] reset a project's hub` (shown when the plan has a running
project) and `[q] quit`.

`[k] end agents` ends attached agents before the upgrade, so they are neither
waited for nor restored: `t` for the TUI agents, `h` for the headless ones
(Kimi, Pi in headless mode, the local worker), or their names, written
`<project id>/<name>` when the plan covers more than one project. After a
confirmation a TUI agent's terminal is closed, which cuts a turn in progress,
and a headless agent is stopped by its hub through the `peer_stop` request
(#278). A delivery that a busy agent had not settled is then held as
`needs_review`, and its queue stays held until `ahub queue resolve` settles it. Each agent is ended only
if the lock is free and its hub, its session and its terminal are still the
ones the plan read; otherwise the screen says why it was left. A hub that does
not know `peer_stop` (0.12.21 and older) cannot end a headless agent: the
screen says so, the agent stops with the old hub at the upgrade, and the new
hub starts it again. A session marked `own` is ended where it runs. The next
plan shows the ended agents as offline.

After apply the command stays attached and prints each step as the receipt
records it, and while a source is being prepared, what it still waits for.
Each reported step has a status mark and elapsed observation time. Resume lists
only steps observed on that attempt and says `resuming from ...` once. Its stage
step really runs again and is labelled `checking retained release`. Waits use
the coordinator's actual recorded start and deadline, for example
`[waiting] alpha: restoring Codex and Pi sessions (waiting 2m10s of 10m)`.
Older receipts without timing metadata say `timing unknown`; updatedAt is never
used as a substitute. Timing-only save failures log a warning and do not fail
the operation. Stable waits print only on change and at most once per minute.
Approval waits point to `ahub console`; native attachment waits point to the
recorded launch and conversation. Korean text and
long paths wrap to the measured width on plan, progress and menu screens.
Enter opens the operation's screen while the runner works on. Ctrl+C leaves the
command, at any prompt and while following, and never stops the runner: the
`left:` line names `ahub recovery status <operation-id>`. Use `--verbose` for
the internal command with the operation's retained coordinator, because the
installed `ahub` may still be the older release until the upgrade ends. A Ctrl+C between `a` and the start of the operation
starts nothing. A prompt for a reason that is answered with
Ctrl+C or the end of input ends nothing.

The operation's screen also opens first whenever an operation holds the lock,
and for bare `ahub recovery`. It shows the phase and step, each project's phase
and human outcome labels, then What happened / Why / What to do and the choices that `status` lists under
`next` for the same receipt and live state:

| Key | Runs | Offered when |
| --- | --- | --- |
| `r` | `recovery resume`, then follows | resume can get past what is live |
| `c` | `recovery abort` | no runtime was stopped and no terminal effect or commit request is recorded |
| `a` | `recovery reattach <id> <peer>` | the recorded detached session is eligible for reattachment |
| `f` | `recovery dispose --fresh-session <peer>`, after a reason | a Codex or Claude restoration failed |
| `e` | `recovery dispose --stop-and-archive`, after a confirmation and a reason | every unverified project reads as running, stopped or missing |
| `x` | `e`, then the reset below | as `e` |
| `w` | follows the runner | a runner holds the operation |

When more than one restoration failed, the second and later peers get
`f-<peer>`. `s` refreshes the screen, `j` prints the receipt as JSON and `q`
leaves the operation as it is.

The marked recommendation is a read-only Enter default: refresh the plan, follow
an active runner, read the receipt or refresh the operation. Apply, resume and
reattach require their explicit keys; buffered Enter never starts them. Unknown failures recommend
reading `j` before retrying effects. A wait whose runner cannot be verified is
shown disabled with its reason, and cannot run a command. Stop, archive, reset
and fresh-session choices carry a warning and name the consequence before the
person confirms. Raw receipt keys and the original recorded error are available
with `j` or `--verbose`. The four preservation failures name the actual failed
queue, manual-pause, board or budget comparison; an older untyped cause remains
unknown rather than being guessed from its text. When nothing more specific
applies (no typed cause, reattachment or `database_busy`), Why shows the first
line of the recorded error, with control characters removed and cut at 512
characters, marked `typed cause unknown`. What to do then says to resolve that
error, then resume or choose an offered action. Nothing is classified from that
text, and JSON and piped output are unchanged.

Completion and stop-and-archive use a human summary on a TTY. It separates the
outcome, recorded plugin/global installation effects, remaining work and the
per-peer session commands. An optional fresh read-only inspection names the
current hub version; a failed reading says `runtime unknown`, never a guessed
version from the plan. The summary performs no lifecycle action. Use `j` or
`--json` for the full receipt; JSON is intentionally exempt from human wrapping.
For a long command, copy the exact single-line value from `j` or the status JSON;
the width-wrapped human preview is for reading.

While a runner is only waiting for its source to get quiet (step `prepare`, no
effect recorded), `c` stops that runner and then aborts. It is offered only for
a runner whose claim carries a process signature that still matches; a claim
from a coordinator of 0.12.20 or older has none, so its pid is never signalled,
and such a runner gives up its wait after 10 minutes. The receipt is read again
when the key is pressed, and a runner that has moved on is left alone. If it
records an effect in the instant between that read and the signal, the abort is
refused and resume is offered instead. Past that step a running operation
offers only `w`.

A reset is offered from the plan screen for a project whose hub is running, and
with one question right after an operation was cancelled or ended from its
screen: it asks for the project (when there are several) and the scope, prints
the dry run of `ahub reset` or `ahub reset --all`, and applies it with `--yes`
only after a second confirmation. While an operation holds the lock it refuses,
as `ahub reset` does.

Ending a peer's running turn is not part of these screens: finish or interrupt
it in that peer's terminal, answer approvals with `ahub permit` or the console,
or cancel and upgrade later.

Terminal recovery records a launch only after that native session owns the peer
(#482). Capturing an Orca terminal or receiving `start: ok` creates only a pending
candidate; a second launcher that exits or is refused cannot replace the live
owner's row. A running hub without `terminal_owner` support leaves the new launch
unrecorded and prints an upgrade remedy. The plan names an attached native TUI
without a live launcher or exact Orca session proof as `attached, launcher
unrecorded`: end it in its terminal or use its native resume flow in an Orca
terminal, then press `[r]` refresh. Plain Claude's same-protocol reconnect-only
session still reconnects by itself without a terminal restart.

Background Orca identity reads are limited to 30 seconds and 1 MiB of output.
Shutdown cancels their owned query process groups and waits for reconciliation.
A query whose termination cannot be confirmed is logged as incomplete; the
remaining peer and daemon teardown still runs. Native terminal execution keeps
its foreground TTY behavior. Unknown terminal evidence is shown as unverified
ownership, with end or native resume guidance.

An Orca pane that is orphaned but still connected needs reattachment, not turn
cancellation (#1246). The blocker names the peer, the project and the handle, and its
next action is `orca terminal switch --terminal <handle>`, then refresh in
`ahub upgrade` (`[r]` on the plan, `[s]` on an open operation) or rerun it. The plan records each such pane whose identity it
verified (peer, handle, incarnation, worktree and root) as `orphanedTerminals`, part
of the plan fingerprint, and the interactive plan screen then offers `[t] reattach N
orphaned terminals`. Choosing it reads each recorded pane again, requires the same
identity, still orphaned and connected, and no recovery hold on this project (or the
machine), runs `orca terminal switch --terminal <handle>` once for that handle, and polls
`orca terminal show` for at most 5 s until `orphaned` is false (Orca can report `true`
for a moment after the switch). Each Orca call is itself bounded by that time, so a hung
`show` cannot hold the screen past it. Then the plan is made again. Nothing else is mutated:
no session, launch record, terminal or hub changes. A pane whose identity changed, that
disconnected, or that is still orphaned at the bound stays a blocker with the same next
action, and `[t]` is offered again. `--dry-run`, a pipe and `--yes` never switch a pane.
Such a pane is not evidence that its native process ended and never authorizes a
duplicate restore. Disconnected terminals keep their existing guidance.

The ledger retains historical and invalid rows; it does not prune them on launch.
Only this project, current daemon instance and peer can supply ownership evidence,
and a successful publication replaces only its matching valid row. Old-instance
rows cannot claim the current terminal. Older binaries that directly write
`terminal-recovery.json` are outside the new writer guarantee.

### A partial operation

`ahub recovery status <operation-id>` reads the receipt without changing it:
its phase, step and error; `runner`, which says whether a runner process holds
the operation now (`running` with its pid, or `none`; `stale` marks a receipt
that says running with no runner behind it); each project's phase and effect
receipts (`closed:<peer>` as `done` or `pending`; `restored:<peer>` as
`pending`, `waiting:pending`, `waiting:failed`, `done` or `failed`);
whether the shared plugin and the global CLI were installed; and `next`, the
commands that apply now, read from every source the operation has not stopped
yet (every error of `resume` ends with the same list). `resume` is left out
when it can never get past: a source replaced by another instance, or a
prepared source that stopped before any commit request. It shows no task or
message text. `resume` does not
start a second runner while one is alive. Every `next` entry and error names the
operation's own coordinator, `bun <preserved source>/src/cli/main.js recovery
...`: in the middle of an upgrade the global `ahub` may still be the older
release, whose `recovery` lacks these commands. The published 0.12.30 CLI also
mislabels tagged waiting receipts as done and can hide the fresh-session choice,
even when its status command exists. Use the printed preserved-source
coordinator for status, resume and disposition; do not decide from that older
CLI's receipt display. Copy that command line. When
an older coordinator started the operation, `dispose` is named from the running
release, which has it. What
each receipt allows, given what is live, is tabulated in the recovery spec
(`docs/specs/2026-09-20-upgrade-recovery-design.md`, "Receipts, evidence and
next actions").

- The source hold lapses after 10 minutes. If releasing it fails because the
  source's delivery storage fails, the hold stays and the expiry is retried
  every second until storage recovers; restore the storage before `abort`.
  A later `resume` prepares the same
  source again and checks its peers again, keeping the receipts, so no terminal
  is closed twice. It refuses, naming the next step, when the source daemon was
  replaced, when another operation holds it, or when a peer changed: a peer whose
  terminal the operation closed must stay closed, a session that joined since
  must end, every other one must keep its conversation. With nothing closed yet,
  `abort` cancels the operation (also once its hold has lapsed, or when another
  daemon or operation holds the source, which it leaves alone) so a new plan
  can be made, also after a source crashed before any commit was requested
  (`resume` then stops, as there is nothing to start from, and names abort, or
  stop-and-archive once anything was done); it
  refuses while a prepared source cannot be read (its hold may still stand),
  once a commit request may have been sent (or, for an operation from
  an older coordinator, which records no such thing, while a prepared source is
  not running), and once any project has effects the way out is
  stop-and-archive. `next` offers abort only where abort would succeed, and
  `resume` (and `--fresh-session`, which resume carries out) only where it can
  get past what is live: not past a replaced or missing source, a source that
  crashed before any commit request, a refusal at staging (the target release
  or the preserved source can never change back), a hub of another control
  protocol, a target that stopped after it started when the operation's
  coordinator is older than 0.12.21, or a stopped hub without the operation's
  restart snapshot.
  A second `resume` while its own hold still stands checks the peers again
  before it closes anything.
- If a restart stops with `database_busy`, the receipt stays `blocked` and
  carries `failure: { code: "database_busy", retryable: true, site: [...] }`.
  Let the other connection settle, inspect `ahub recovery status <id>` and
  use its offered `ahub recovery resume <id>`. Resume rechecks the source and
  reconciles a commit that may already have been requested. A busy read while
  that committed source is stopping stays inside the existing shutdown wait.
  A resumed prepared receipt with `commitSent` also polls an unavailable source
  within the 30-second shutdown bound, including initial database contention,
  without sending another commit, re-preparing or closing terminals again. Only
  confirmed `stopped` permits target startup; a replacement instance refuses, and
  expiry retains the prepared receipt and the same operation for another resume.
  A stop-and-archive that meets contention instead says to retry that
  disposition; resume remains refused while abandonment is partway. Successful
  abort, fresh-session choice and disposal clear the earlier failure annotation.
  Do not delete database files or start a second operation to bypass the lock.
  A failed installed-layout CI restart retains bounded, redacted fixture logs,
  receipt fields (including `commitSent` and failure frames) and file-mode
  metadata as a per-OS artifact.

  The historical CI receipt (38061057253, attempt 1) kept no throw site or
  hub log. At its main, status/inspect RPC failures were swallowed and the
  synchronous catch sent a fixed sentence, so its raw SQLite text could only
  have come from the commit rejection or the runner's own `registry.db` read.
  "Resume | wait until the hub settles", without stop-and-archive, means its
  next inspection saw neither running nor stopped/missing. Which of the two
  paths, which statement and which holder remain unknown. The controlled
  rollback-copy reproduction is separate evidence, not that historical cause.
- When a target hub dies after it started (a crash or a reboot), `resume`
  starts it again from the operation's snapshot while the project's state
  directory still holds it: it records the restart (status shows `restarts`),
  closes the terminals the dead hub's peers were restored into (or finds them
  gone), and relaunches those peers against the new hub, a session you had
  accepted instead of the original included. A launcher still running from
  the dead hub, or a session attached without an id, stops it until you end
  that session. A target that dies again in the same `resume` stops it with the
  restart count; look at its `hub.log` before resuming again. Without the
  snapshot, or for an operation started by a coordinator older than 0.12.21,
  the way out is stop-and-archive. A snapshot whose kept hub notices fail
  validation blocks that restart with `restart snapshot deferred hub notices
  are invalid; restore is blocked`. The hub still reads as stopped, so
  stop-and-archive (and abort, where it applies) stays offered; nothing
  repairs the snapshot or offers to resume from it.
- A Codex conversation comes back only when a rollout file naming its thread
  exists under `sessions/` of the store the restored terminal uses (the
  recorded `CODEX_HOME`, else `~/.codex`). Codex writes that file with the
  first message, so a thread the hub saw Codex start, with no turn on it since,
  is listed under `freshStart` and restarts as a new session, with nothing to
  lose; the command says so. A thread with turns, or one whose start the hub's
  log does not show (it was resumed, or the hub is older), blocks the plan when
  it has no rollout, and so does a store that cannot be read (unknown, not
  missing). The coordinator checks again before closing the terminal and before
  creating the new one. To continue without such a conversation, end that Codex
  session and close its Orca terminal, then `resume`; it stops at restoring
  Codex, where `--fresh-session codex` below is the way on.
- A restored terminal runs its launch in a login shell, so the coordinator
  watches the launcher, not the terminal: once `ahub codex`, `ahub claude` or
  `ahub pi` has recorded itself there and its process is gone, or Orca no longer
  lists that terminal at all, the restoration failed (found within one 5-second
  wait). A launcher whose process cannot be read counts as running, never as
  gone. One that dies before recording itself leaves no record to read, and
  what happens next depends on whether Orca reports the bare login shell it
  returned to as TUI-idle, which is not verified. If it does, the coordinator
  re-reads the terminal's mapping every second (#599) and stops at once only when
  Orca names another peer or session; otherwise it stops with "original session
  restoration needs manual verification" (the terminal cannot be mapped to the
  session) when the 10-minute wait ends. If it does not, it stops with the same
  error after the 10-minute wait. Either way the receipt stays
  `pending`; close that terminal in Orca (or wait, if the session may still
  attach), then `resume`: with no live launcher and no attached session it
  records `restored:<peer>` `failed` and lists the failed-restoration choices.
  A `failed` receipt never counts as restored.
  `resume` settles a `pending` or `failed` receipt by what is live: the planned
  session attached is the restoration, a launcher still running is waited for,
  and no second terminal is opened while one may run. A target hub that cannot
  be read counts as unknown, never as "nothing attached", and so does a launcher
  record file that cannot be read: `resume` then stops without changing any
  receipt; when the record file is what cannot be read, inspect it and move it
  aside, then `resume`. A record file that parses but holds a row that cannot
  be evaluated (a hand edit, a damaged or a future layout) is read the same way
  for the peer that row may belong to, and `ahub codex`, `ahub claude` and
  `ahub pi --mode tui` write such rows back unchanged: fix or remove that row,
  then `resume`. A launcher recorded by 0.12.12 or older is read with its own
  unpinned signature too, so it counts as running when this command runs in
  the same time zone and locale as the launcher did. `resume` is refused while a stop-and-archive is partway. A lifecycle command refused by the lock names
  the operation's own `status` command, which lists what to do next.
- `ahub recovery reattach <operation-id> codex|claude|pi` is person-only, including during live verification: an agent shell cannot delegate it. Name the operation and exactly one peer; session, backend, model and terminal overrides are not accepted. Use the exact operation-coordinator command printed by status or its blocked guidance. It repairs only that peer and leaves the operation blocked; run the offered `recovery resume` command to continue the remaining steps.
  The CLI delegates only when the retained coordinator supports reattach. An existing older coordinator without that action uses this release's implementation instead; a missing receipt, retained coordinator path or coordinator file prints inspection/recovery guidance and starts no session.
  A peer that attached and later went offline can be re-restored once when its saved terminal is positively orphaned or missing and no current or older operation launcher may still run. The recorded session id and Pi session file stay fixed; the new terminal binding is saved before waiting for authenticated attachment. A second detach blocks. An unreadable terminal, changed incarnation or worktree, disconnected-only evidence, truncated inventory or live/unknown launcher does not authorize another terminal.
  Recovery status names the saved Codex thread, Pi session file and Claude session, the terminal evidence, and the applicable reattach command. A different attached conversation remains a strict refusal.
- `ahub recovery dispose <operation-id> --fresh-session <peer> --reason <text>`
  applies to a Codex or Claude peer whose restoration failed (Pi is refused: a
  restored hub resumes Pi's recorded session). It records the lost session or
  thread id (status shows it under `lostContinuity`) and resumes: the peer
  starts without its old conversation, and the rest is verified as usual.
  A session the operation already reattached keeps that repaired provenance
  across target restarts and is never replaced automatically. Its
  loss can be accepted only after the restoration reported the recorded Claude
  transcript or Codex rollout as positively missing, naming the checked path;
  dispose checks that path again before saving the choice and otherwise refuses
  with "recorded conversation is not positively missing". Under `--live-test`
  this repaired-session choice is refused even where an ordinary fresh session
  may be delegated.
- `ahub recovery dispose <operation-id> --stop-and-archive --reason <text>`
  abandons the operation. It checks every project first and refuses while a
  hub is unreachable, starting, stopping or of another control protocol; `next`
  then says `wait until <project>'s hub settles, then ... recovery status
  <id>` instead of offering it. A hub that never answers (its pid is alive,
  nothing replies): take the `pid` from that project's
  `.agenthub/state/status.json`, check with `ps -p <pid> -o command=` that it
  is that project's hub daemon, end it by hand, then run `status` again. From
  0.12.21 a hub's manifest and registry claim and a runner's record carry the
  owner's process signature, so a pid that a reboot handed to another process
  reads as gone by itself. Records written by 0.12.20 or older carry none and
  are judged by their pid alone: if that pid now belongs to another process,
  move the stale `status.json` and `hub.pid` aside together (with only one of
  them gone the other still reads as an owner), then run `status` again;
  likewise when `next` says `wait: runner <pid>` and that pid is not an `ahub
  recovery-run` process, move the operation's
  `~/.agenthub/recovery/<id>.json.runner.db` aside, then run `status` again.
  An unsigned registry claim of such a hub, whose pid now belongs to another
  process, still reads as starting, and no command clears it: after `ps -p
  <pid> -o command=` shows that the process is not an `ahub ... daemon` of that
  project, clear it with `sqlite3 ~/.agenthub/registry.db "UPDATE projects SET
  instance_id = NULL, pid = NULL, claimed_at = NULL WHERE id = '<project id>'
  AND pid = <pid>"` (`ahub projects --json` shows the id). A
  project whose directory is
  gone is only recorded (`ahub doctor --orphans` lists a hub left running
  there). It records its decision before it acts; that audit entry keeps the
  operation's error at that moment as `cause`, because disposal clears the
  error itself (#776). It releases a source hold of
  its own (that hub keeps running), stops a target hub it started and has not
  released (one an older coordinator started is stopped at that release's
  control protocol), moves that operation's
  `restart.json` aside as `restart.abandoned.<hash>.json` (only the 5 newest released and abandoned copies are kept) and leaves any other
  hub running; only then is the operation recorded `cancelled` and the lock
  released. If it fails partway it keeps the lock, records what it did, and
  `resume` refuses until you run it again. Once a stop-and-archive is recorded,
  only the command `next` names continues it. On an operation whose
  coordinator predates these commands it also marks the receipt `schema: 2`,
  which every older release refuses before it acts: an older global `ahub
  recovery resume` still prints "scheduled", but its runner exits without
  touching the operation, and an older `ahub recovery abort` refuses with
  "unsupported operation receipt". Queued messages are not delivered
  from the archived file; a 0.7.0 or later hub reloads the queues it kept in
  `hub.db` when it starts again. Terminals it closed stay closed: start those
  sessions again by hand. Replacement terminals it opened stay open but have
  no hub: Claude's plugin reconnects once a hub runs, Codex needs `ahub codex`
  again.
  Start a project whose target ran with that release's CLI (`bunx --package
  @staix/agent-hub@<version> ahub up`), since it may have changed the task
  database. The global CLI was not promoted. The archive summary distinguishes completed target startup and plugin installation from remaining global CLI installation, and prints recorded-session commands: `ahub codex resume <thread-id>`, `ahub pi --session-file <path>`, and the Claude reconnect command. On the next `ahub up`, `pi.auto_start` resumes the archived operation's recorded Pi session rather than choosing a fresh conversation. Unknown or conflicting archived identity refuses that automatic resume.
  That session is kept as a bookmark, `.agenthub/state/recovery-continuity.json`. When its session file can no longer be resumed or does not match it, the hub archives the bookmark and starts no fresh session in that start; the error names `ahub pi --mode <mode> --session-file <managed-file>` for choosing one. An invalid or unreadable bookmark, or session storage that cannot be verified, starts nothing, keeps the bookmark and prints the `mv -n` command that archives it after inspection. The bookmark is retired once Pi attaches with a different authenticated session.
- Both choices are for a person in a terminal; an agent shell is refused, and
  the reason is kept in the operation's audit. Run each with the command
  `next` or the error prints: the operation's own coordinator, or the release
  you are running when that coordinator predates these commands (its `resume`
  still runs the old runner, and `next` says what that runner cannot do).
  `--fresh-session` never applies to such an operation: its runner never
  records a restoration as `failed`.
  `--fresh-session` is not offered when the target release cannot read recovery
  waivers, since it could never release a new session; `status` says so in
  `freshSession`. A runner record that cannot be read shows as `unknown`, and
  `resume`, `abort` and `dispose` are refused until it can be read.

### After an unplanned stop

While it runs, the hub keeps each attached peer's session identity in
`.agenthub/state/sessions.json` (ids and launch options, no message text); a stop
removes it as it begins. When a hub starts and finds the file, the previous run
died (`kill -9`, a crash, a lost machine), and `ahub status` and the console say
what happened to each peer. Hubs before 0.10.0 kept no such record, so a
crash of one is not reported this way.

- Deliveries that were in flight are in `needs_review` (`ahub queue list`), as
  before. When a peer next attaches, its next delivery starts with a notice that
  lists them by id, sender and task (`[pii]` for a PII task), never their text.
- Kimi, Pi and the local worker run inside the hub, so they died with it. With
  `"recovery": { "auto_resume_after_crash": true }` in `.agenthub/config.json` the
  hub starts them again: Kimi loads its recorded session (ACP `session/load`), Pi
  resumes its session file, and the local worker starts without its history, on
  its recorded route (or pinned model). Off by default: the report then says
  what to start. With `pi.auto_start` on, Pi comes back on its recorded
  headless session whether or not auto-resume is on (it runs on-prem, so this
  spends no cloud quota), and on a fresh session if that fails, keeping the
  recorded backend and model; the report says which. Malformed records in
  `sessions.json` are skipped. A Pi that ran in a terminal (`--mode tui`) is never started on its
  recorded session by the hub; the report gives the command. With
  `pi.auto_start` a fresh headless Pi starts instead only when Pi's start mode
  is headless; with the default (tui) nothing is started in its place.
- Codex's app-server died with the hub; run `ahub codex` again. Claude Code's
  plugin reconnects by itself while that session is open.

The report in `ahub status` shows only what still stands (#1082), worked out when
status is asked and not frozen at startup. A line that asks something of a peer
(`run ahub codex again`, `reconnects by itself`, a Pi that is still down) goes as
soon as that peer is attached again, whoever attached it. The headline's count of
deliveries still in `needs_review` counts only the ones this crash left, read
live, so it equals what `ahub queue list` shows for them and falls as each is
resolved. At zero the count and its pointer to the queue are gone and the headline
(`the previous hub run stopped without shutting down`) stays as the record that a
crash was found. Lines that say what recovery found or did (`kimi resumed`,
`pi not resumed`, `pi.auto_start started a fresh session`) are history and stay for
the run. The hub log keeps every line as it was written. A row that becomes
`needs_review` later in the run is in `ahub queue list` and is not part of this
count.

## Evidence and limits

The 0.6.4 release has real measurements in [the smoke checklist](smoke.md):
Pi returned an exact file marker through MLX in 5.800 seconds in the production
probe; the installed-package checks measured Pi MLX at 2.234 seconds, Pi DGX
at 1.324 seconds, and a 208 ms MLX-to-DGX handover with the same session
identity. A real Kimi 2.0.1 and Pi run showed queue counts and priority counts
matching between the CLI and status file. These are individual observations,
not a latency or reliability benchmark.

The 0.6.4 production readback retained two envelopes for a disconnected Codex
peer with identical IDs before and after recovery; general status lists attached
peers and therefore did not show that backlog. No messages were deleted. The
0.7.1 attended cutover and production readback verified queue visibility and
completion receipts; see the final section of the smoke checklist.

Issue [#1](https://github.com/STAIxBWLB/agent-hub/issues/1) remains open for
off-campus Access credentials and a natural near-limit budget pause. Tests,
synthetic approvals, and an authenticated internal network do not close those
prerequisites. Adapter acceptance is not task completion, and package
installation or a passing test suite is not proof of a successful production
cutover.


## Ollama MLX migration (issue #51)

The routing names `mlx/fast` and `--backend mlx` are retained. The normal
runtime provider is now Ollama; the standalone Python server is legacy.
Use an Apple Silicon Ollama build with MLX support and keep it bound to
loopback. Configure its finite keep-alive and one-model/one-generation
limits before use. The model is prepared only by explicit `models setup`;
an incoming generation does not download models or start a service.

Project `.agenthub/config.json` example:

```json
{
  "mlx": {
    "provider": "ollama",
    "host": "127.0.0.1",
    "port": 11434,
    "model": "agenthub-fast-mlx:4b-8k",
    "sourceModel": "qwen3.5:4b-mlx",
    "contextWindow": 8192,
    "maxInputTokens": 6000,
    "maxTokens": 2048,
    "maxConcurrency": 1
  }
}
```

1. Record the current project/hub state. Do not restart stopped hubs or
   replay queued tasks as part of model migration.
2. If the old Python server is still running, use the old matching CLI's
   `models stop` before changing configuration, or explicitly select
   `provider: "legacy"` temporarily. Its PID, start time and command must
   match the ownership record. Never kill by process name. Preserve model
   files and the old configuration for rollback.
3. Apply the Ollama configuration above, removing legacy `modelPath`,
   `runtimeDir` and Python binary settings. Existing custom legacy paths
   without an explicit provider fail with a migration error. Old 16K input
   overrides must also be reduced; the new total context is 8K.
4. Run `ahub models setup`, `ahub models start`, and `ahub models status`.
   Setup creates a dedicated derived model; an existing model is inspected
   rather than silently overwritten. A wrong context recipe must be fixed
   deliberately under a new model name or after an explicit model change.
5. Verify a streamed completion and tool call through the authenticated
   relay. Check Ollama logs for the MLX runner, `/api/ps` for context and
   finite expiry, then confirm idle eviction. Catalog availability does
   not mean the model is resident. Unit tests are not this live proof.

Ollama is shared and external. `models stop` refuses in Ollama mode rather
than interrupting another client. Hub shutdown releases local handles and
requests, not the server. Normal idle eviction is Ollama's responsibility;
no AgentHub timer unloads a potentially shared active model.

The relay's input budget is an estimate, not exact model tokenization. Keep
headroom for templates/tool metadata and choose a larger dedicated recipe
only after measuring memory. This path does not change local-worker PII
routing or the DGX backend. Rollback requires explicitly restoring the old
config with `provider: "legacy"`; Ollama errors never launch Python.

### In-process model routes

`routing.toml` supports in-process `[hub_routes."hub/<id>"]`.
A task uses a hub route when `[local] route` or its class's `route` names one.
A new `routing.toml` from `ahub init` sets `[local]` and `implement` to `hub/stage`
(fixed model `coding` as the fallback) and gives the lighter classes
`fixed_model = "fast"`. The shipped examples use OmniRoute `fast` and `coding`; `fixed_model` remains the fallback.
`--model` pins the worker and bypasses route selection. A class with `fixed_model`
and no `route` also calls that alias directly, even when `[local]` names a route.

The hub owns its in-process fallback and escalation/advisor decisions, with
optional adec model/effort choices (#1352). No separate routing binary or generated
model-router config is used; reserved port offset 3 remains unused. Existing `[targets]`
and `[routes]` tables are ignored and listed as retired settings in startup logs
and doctor. Every route without the `hub/` prefix, including named legacy routes
and `sy/` selections, uses the fixed alias with one warning. Loading or reloading
never rewrites the operator's routing files.

#### Optional adec decision route (#554)

The optional `decision` route calls a separately managed, loopback-only
`adec serve` using the [agent-decide route contract](https://github.com/STAIxBWLB/agent-decide/issues/4).
The hub never starts or configures that service, reads its credentials, or calls
its model directly. This backend is selected explicitly:

```toml
[hub_routes."hub/decision"]
type = "decision"
decision_backend = "adec"
decision_mode = "shadow"
policy_id = "ahub.chat"
adec_endpoint = "http://127.0.0.1:8740/v1/route"
decision_timeout_ms = 8000
efficient = "fast"
capable = "coding"
candidates = [
  { alias = "fast", efforts = ["low", "medium"] },
  { alias = "coding", efforts = ["high"] },
]
```

Select it by editing the existing `[local] route` or class `route` to
`"hub/decision"`. Do not append a duplicate `[local]` table. Ordinary routes,
class `fixed_model` selections and a person's explicit model override retain
their existing behavior; an explicit model bypasses this route.

Omitting `decision_mode` means `off`: no decision request or evidence is built.
This delivery supports `shadow` only. It records the proposed alias/effort,
margin, latency and decider while keeping the exact existing stage heuristic
model, effort and conversation. `enforce` is explicitly refused at config load:
`decision_mode enforce is not available yet; use shadow; tracked in #554`.
There is no dormant application path or gateway effort plumbing. No route is
enabled by default or deployed by this feature.

The configured alias/effort list has at most 26 pairs. Aliases narrow the adec
policy; efforts are an additional hub-side response allowlist and are not sent
as a policy override. Align the lists with the service policy: an unconfigured
effort is refused as `outside_options`, keeping the heuristic. The request
cannot add a policy candidate. The service assembles its question and
owns its hard rules, margin threshold, in-memory pins and fallback. A valid
`fallbackApplied` pair is recorded as the service's proposed fallback even when
`abstain` is true. Every proposal, failure and `no_candidate` keeps the hub
heuristic unchanged. An HTTP 400 is a caller/configuration
error; inspect the policy id and allowed pairs. Transport errors, timeout,
malformed responses and an out-of-list pair also keep the hub heuristic, with a
closed reason in the route event. A failed service is not asked again in the
same user turn. Operational diagnostics contain a closed cause and repair step,
and are emitted once per state/configuration change; a successful reply resets
the diagnostic so a later recurrence is visible. Per-call route records remain
available for outcome correlation. The default total timeout is 8 seconds (configurable from 1 to
30000 ms), covering headers and the full bounded response. Redirects, ambient
proxies, credentials and browser headers are not used. Endpoint URLs accept only
HTTP numeric loopback with `/v1/route`, without userinfo, query or fragment.

Each eligible tool round carries the same opaque, route/session/user-turn-bound
`turnId`. adec therefore reuses its pin while rechecking current hard rules.
The hub does not send a proposal as `current`: no pair is applied in shadow,
and the native/default effort is unknown. Explicit model selections bypass the
service.
Changing a service, provider, model, version or policy threshold requires a new
shadow period. The hub does not recalibrate a remote policy. The optional decider `version` is recorded when configured on the service;
otherwise it stays unknown and is not inferred from the model id. Moving
`latest` version aliases are refused.

Evidence is a bounded data projection, never the forwarded conversation: a
capped latest-user task fragment, the last assistant/tool tails, screened tool
names and numeric stage dimensions. Whole selected sources pass the current
public-view pattern/private-path/secret checks before UTF-8/JSON byte caps.
Tool arguments, system/developer instructions and older history are not sent.
The total evidence cap is 8 KiB; candidate and response payloads have finite
bounds too. Evidence is labelled untrusted data, not instructions; injection
resistance is not claimed. Review-observer-excluded and remote turns skip adec.
A PII/private turn needs positive `onCampus()` before any evidence build or
service call. Even on campus, its evidence is dimensions only, its context size
is redacted to 0, and its separate `pii`/`private` flags reach adec so the service
can enforce on-prem candidates/decider rules. The ordinary gateway campus and
execution-budget checks still apply. Current board/turn privacy and observer
facts are checked again across admission, campus and service awaits. A changed
or unavailable authority refuses the stale turn instead of turning into a
service-error fallback; inspect current task policy and retry. A returned proposal is checked again before telemetry. The original gateway
execution path and its privacy/budget checks are unchanged. Source text, tool arguments, credentials
and server error prose never enter route events.

This delivery is the adec consumer slice of #554. The direct System One backend
and enforcement application remain separate unimplemented legs; the optional
stage classifier is the ambiguity-band subsection below; the manual offline
triage evaluation is the by-hand script
below. Offline fake-service tests establish protocol and shadow
behavior; no routing gain, native service/model run or production rollout is
claimed.

#### Optional stage classifier band (#554)

An optional `stage` route can ask the same loopback service one classification
question, and only when its own deterministic score is ambiguous. It is opt-in
and off by default:

```toml
[hub_routes."hub/stage"]
type = "stage"
classifier = "decision"
decision_backend = "adec"
decision_mode = "shadow"
policy_id = "ahub.stage"
adec_endpoint = "http://127.0.0.1:8740/v1/route"
efficient = "fast"
capable = "coding"
ambiguous_band = 0.05
```

`classifier` has one value, `"decision"`, and both `efficient` and `capable` are
then required: they are the two options the question offers. A `stage` route
without `classifier` keeps the deterministic picker and sends nothing.
`ambiguous_band` is accepted only together with `classifier`, defaults to `0.05`
and must be a finite number from 0 to 0.5. The band is measured against the
route's own threshold: `abs(score - confidence_threshold) <= ambiguous_band` is
ambiguous, with the threshold defaulting to 0.5. The default therefore asks only
for the indecisive middle: the owned repeated-execution reading 0.46 lies four
hundredths from the 0.5 default, inside the band, while a single reported
failure (0.3) and an exception or critical failure (0.7 and 1) lie two tenths or
more outside. `ambiguous_band = 0` asks nothing; the maximum 0.5 covers the whole
score range at the default threshold. A value outside its range fails at load
rather than silently widening or narrowing the band.

The two tiers are the whole question: candidates are `efficient` and `capable`
with effort `none`, and the heuristic's own tier is sent as `current`. An answer
is recorded in the route event as the decision fields (mode, chosen alias and
effort, margin, latency, reason, screened decider) and changes no tier, model,
effort or conversation: shadow keeps the exact heuristic routing. Abstain or
`no_candidate`, a transport failure or timeout, `decision_mode = off` and an
off-campus decider for a PII or private turn each keep the heuristic tier and
record a closed reason in that event. `enforce` stays refused at load with the
same message as a decision route. One question is asked per user turn, reused
through the tool loop, and it dies with the turn: a turn that ends while the
question is outstanding applies no answer and is not failed by it. The question
carries R1's closed stage evidence (numeric signals, dimensions and scores),
never the generic decision v1 conversation projection; a PII or private turn
sends only the dimensions view. A held answer is reused only while the privacy
and observer facts it was recorded with still hold: a changed reading drops it,
and an unreadable one refuses the turn. A privacy or
observer change detected across the request is different from a service failure:
it refuses the stale turn, exactly as a decision route does, and the heuristic is
not executed around that refusal. The PII
screen, `assign()` and the escalation and advisor triggers never use this path.

#### Optional phase and judge model/effort choices (#1352)

The same separately operated ADEc service can suggest a model/effort pair for
an existing `plan_execute` phase or an existing `advisor`/`escalation` judge
call. Add the ordinary service binding to that route and keep
`decision_mode = "shadow"`; omitted mode remains `off`, and `enforce` is refused
at configuration load. No new `judge_choice` table or other routing key is
introduced.

For a phase route, `policy_id = "ahub.plan-execute"` refers to
[`templates/adec/ahub.plan-execute.json`](../templates/adec/ahub.plan-execute.json).
The policy's candidates, the route's allowed `candidates`, and the route's
`efficient`/`capable` fallback aliases must be reviewed together. The route's
`candidates` allowlist must match the policy options; the host fallback aliases
remain independent and are what the executor still receives in shadow. For
example, the syntactically valid placeholders in that template map to a route
like:

```toml
[hub_routes."hub/plan-execute"]
type = "plan_execute"
decision_backend = "adec"
decision_mode = "shadow"
policy_id = "ahub.plan-execute"
adec_endpoint = "http://127.0.0.1:8740/v1/route"
efficient = "replace-me-efficient"
capable = "replace-me-capable"
candidates = [
  { alias = "replace-me-efficient", efforts = ["edit-effort"] },
  { alias = "replace-me-capable", efforts = ["edit-effort"] },
]
```

Replace every placeholder with a provider and alias/effort pair from the
person's own ADEc configuration before using the example. `ahub.stage` is the
separate R1 ambiguity-band classifier policy; its template is
[`templates/adec/ahub.stage.json`](../templates/adec/ahub.stage.json) and its
stage candidates use effort `none`. These templates are pinned to the public
agent-decide policy schema at commit `008548c5`; their provider, aliases, effort
and on-prem status are examples only. Each sample candidate sets `onPrem` to
`false`. A person must verify the model's actual serving location before
changing that value; loopback service placement alone does not establish it.

Advisor and escalation judge routes may use the same binding shape with a
person-authored policy for the judge model/effort options. ADEc suggests only a
pair. The hub still owns whether to review or escalate, the judge prompt and
reply parsing, escalation confirmation, privacy and campus admission, and the
existing fallback execution. In shadow the suggested pair is metadata only;
it does not replace the model/effort actually sent to the executor. Judge
observations use the `decisionTarget = "judge"` route-event marker and do not
add a phase or purpose field. The route keeps the existing main model and host
semantics. No live model-quality, routing-gain or production claim follows from
the policy files or model-free proof; the manual model-routing receipt/live
benchmark remains unrun.

Migrate the retired settings as follows:

| Retired setting or route | In-process replacement |
| --- | --- |
| `stage_router` | `[hub_routes."hub/<id>"]` with `type = "stage"`; select it with `route = "hub/<id>"` |
| `efficient_target` / `capable_target` | Put the targets' model aliases in `efficient` / `capable` |
| `confidence_threshold` | Keep the same value on the hub stage route |
| Passthrough class route | Put its target model alias in the class's `fixed_model` and remove the class's `route` |
| Former unshipped classifier escalation | Use the existing hub `escalation` policy |
| `[targets]` / `[routes]` | Remove these retired tables after migrating their selections |

Doctor inventories all local/class fixed aliases and effective efficient/capable/judge aliases, reporting
each missing alias once or aggregate success when all are served. A
`routing.toml` or `routing.local.toml` that does not parse gets its own `routing`
row naming the file and the parse error, without the file's contents, and the
alias check is skipped (#563). Hub summaries
and triage use their fixed model directly.

#### Offline triage evaluation (#554 AC5, by hand)

`scripts/decision-eval.ts` replays the board's planner-classified, non-PII tasks
against a decider and against the hub's current `Inference.triage`, then reports
each column's accuracy against the class a planner named and its latency. It is
a person-run leg: it never runs in CI and needs a running `adec serve`
([route contract](https://github.com/STAIxBWLB/agent-decide/issues/4)), so
neither column is exercised by the hermetic suite.

```bash
# adec early-decision route: the seven classes are the policy's candidate aliases
bun scripts/decision-eval.ts --project . --decider route \
  --adec http://127.0.0.1:8740 --policy-id ahub.triage --effort default --limit 50

# adec System One endpoint: one choice question whose options are the classes
bun scripts/decision-eval.ts --project . --decider systemone \
  --adec http://127.0.0.1:8740 --model <model> --limit 50
```

`--project` names the hub project root and `--db` any `hub.db` copy; `--limit`
bounds the sample (default 50, at most 500) and `--timeout` the per-call deadline
(default 8000 ms). `--out <file>` also writes the Markdown report. The endpoint
must be literal loopback (`127.0.0.1` or `[::1]`) with the `/v1/route` or
`/v1/systemone` path; anything else is refused before a row is read. A
`--policy-id` the service does not hold answers 404, which the client reports as
the closed reason `http`, so every row is then a miss: check the service's
policies and that `--effort` is one the policy allows before reading the table.

The sample is the board's newest rows that a planner classified: a row whose
class sits outside the closed class list, whose history carries a hub `triaged`
or `class defaulted` event, or whose title is empty is excluded, and so is any
row carrying a `pii` or `pii_path` signal, which is dropped before its text is
read. Kept rows are read as a public view returns them, and each report lists the
excluded counts and the sampled classes so the sample can be judged.

The script takes one consistent snapshot of `hub.db` into a temporary directory
and opens the copy, so a run never opens the live board for writing. The snapshot
is SQLite's own serialization of a read-only connection, not a copy of the
database file and its `-wal`/`-shm` sidecars: a live writer that checkpoints and
then reuses the WAL would leave separately copied files disagreeing about which
frames are committed. Accuracy counts only rows a column labelled, a miss lowers
coverage rather than accuracy, and the report adds p50/p95/max latency, the two
columns' confusion and misses, and how often they agreed where both labelled a
row.

Each run gets a fresh run id in its report and in every adec turn id, because
adec keeps in-memory pins for the turn ids it has answered: without it, a second
run over the same board, or over another project whose task ids overlap, can be
answered from an earlier pin instead of a fresh classification, and both the
accuracy and the latency would then describe that pin.

A gain here is evidence for the decider question (D5) only: nothing in this
script reaches `Tasks.triage`, `assign()` or the PII screen, and no board row,
route or config is changed by a run.

Route types: `stage` scores recent tools and holds capable recovery for two calls;
`plan_execute` plans on capable until the first mutation and then stays efficient;
`advisor` holds no-tool answers for APPROVE/REDO review; `escalation` starts efficient
and latches capable after two same-category judgements with new evidence.
Optional judges have an eight-second deadline and five-minute failure backoff.
REDO feedback is kept in the completed local turn history and counts toward `max_steps`.
PII calls require a positively confirmed campus gateway immediately before transport;
PII turns never enter shared history, memory capture, or progress observation.
The `route`, `advisor`, `progress` and `stuck` events contain identifiers and aggregates only.

Session-aware stay/switch (#197) covers `hub/auto` and `stage` routes. The top-level
`routing.toml` key `stay_switch` is `off`, `shadow` (default: route events record what the
planner would do, routing unchanged) or `enforce`. Enforced, a hard override (compaction,
critical failure, repeated failure) escalates at once; a tool-result turn keeps the
session's tier; other changes wait for the next user turn, and a de-escalation whose
conversation is larger than `max_switch_prefill_tokens` (default 32000) stays; a PII route
has no such bound, so its size never shows in a decision. A capable
hold then lasts at least until the next user turn; `hold_turns` can extend it past that
turn. A tier whose backend
cannot hold the conversation is never chosen; no route summarizes or trims the history.

Pi exposes `hub/auto` for stage routing when available. Fixed `dgx/coding`, `dgx/fast`
and `mlx/fast` aliases still pin the backend. Automatic MLX selection admits the complete
input, tool schemas and requested output within the configured context window.
A `hub/auto` request bound for MLX has two candidates, MLX and its `dgx/fast` fallback; load
and cooldowns only change their order, never remove one (#199). A fixed alias (`mlx/fast`,
`pi_backend = "mlx"`) keeps its backend first as before. `dgx/fast` goes first when MLX is
cooling down (route event `source: "cooldown"`). Load moves are opt-in until they are
measured: with `[pi] efficient_wait_ms` set (0 to 119999; 0 tries once; read when the hub
first starts Pi, like `dgx_max_context_tokens`, so a change takes a hub restart), a request
whose MLX slot is still busy after that wait goes to `dgx/fast` first (`source: "load"`), and
so does an enforced tool loop pinned to it (`source: "pin"`); without it nothing moves for load. `dgx/fast`
never goes first while it is cooling down, or while its own last dispatch failed in any way,
an error status or a failed stream included, until it succeeds or 30 s pass (`ahub status`:
a `dispatch held` detail with a relative time and `no load moves until then`). No load move or pin happens while the request
runs under an execution budget, and enforced, a load move happens only at a user turn. A moved
attempt gets 15 s to its response headers after the gateway lookup (OmniRoute's own probe,
up to two 4 s rounds when no gateway is cached) and is then abandoned for MLX, which serves
with the usual slot wait. The bound ends with the headers: a stream that stalls or fails
after them is not retried on MLX, and a failed one marks `dgx/fast` failing (a client that
disconnects does not). Each backend is tried once per request, so with moves on, a moved attempt
cut at 15 s followed by an MLX slot that stays busy past 120 s fails the request (502), where
without moves the request would have waited for MLX and then had `dgx/fast` with its full
deadline; this is part of what the opt-in accepts until #199 AC5 measures it. After
`model_relay.cooldown_failures` (default three) consecutive transport or startup failures
outside a cooldown (a failure more than twice the cap, 10 min by default, after the last counted
one starts the count over), a relay alias cools down for `model_relay.cooldown_s` (default
30 s), doubling up to `model_relay.cooldown_cap_s` (default 5 min); all three apply at the next
daemon restart. A busy MLX slot and timeouts cut short by an execution budget never count; any HTTP
answer, a success or an error status, proves the transport works and ends the streak and the
cooldown. `ahub status` shows a `cooling` detail with a relative time and failure count and `events.jsonl`
records `cooldown` events.
Progress judgements suggest reassignment; they never change task ownership.

## Disable local MLX while keeping remote auto routing

`mlx.enabled` is an optional boolean and defaults to `true`, including legacy
configurations. Operators without an available local service can set:

```json
{
  "pi": { "enabled": true, "backend": "auto" },
  "mlx": { "enabled": false }
}
```

This removes `mlx/fast` from the relay inventory. `hub/auto` continues selecting
`dgx/fast` for efficient work and `dgx/coding` for capable work. Neither a local
probe nor a local startup occurs. `ahub models status` reports `disabled` and
`ahub doctor` reports a successful disabled row without probing the endpoint.
`models setup`, `start`, and `stop` are refused while disabled; shared Ollama
continues under its existing owner.

Migrate an earlier `pi.backend=dgx` workaround to `auto` explicitly. In a project
routing file, remove `pi_backend="mlx"` pins to use `hub/auto`, or set `dgx` to
keep a remote class pin. The hub refuses conflicting operator-written routing
before startup, while inherited shipped MLX class defaults use `hub/auto` when
the capability is absent. It never rewrites these settings. Explicit
`--backend mlx`, `--model mlx/fast`, and recorded MLX recovery launches are
refused before any local startup. Re-enable MLX or explicitly migrate the
recorded launch before recovery.

## Task stalls and cancellation

A ready task with an ineligible reservation, no eligible peer or a cancelled dependency shows an ids-only stall cause in status and the Tasks panel. The hub reports a cause once, repeating only when the cause changes or the task is re-planned. It directs ownerless advice to the designated planner's next bounded preface and the configured supervision stream, otherwise the person's attention list; it does not create an extra ordinary turn beside backlog batching. Configure the missing capability, assign another eligible peer, re-plan or cancel the task as appropriate; a reservation never bypasses routing guards.

An offer to a pull-only peer adds an advisory "open <peer>: task #N is waiting for it" attention item. It clears when that exact offer is accepted, declined, superseded or genuinely delivered and settled to the addressed peer. Another inbox read, an accepted-only receipt or a person's queue completion does not prove it was read. The attention item survives peer detach and daemon restart using the saved offer's pull-only flag; it does not alter delivery state.

The person can retain superseded work as closed history:

```sh
ahub task cancel <id> --reason <text> [--superseded-by <ref>] [--revision N]
```

The console also offers cancellation with the selected task's flow revision. Approved tasks cannot be cancelled. The planner's `hub_task_cancel` tool is limited to work it proposed that is in backlog or proposed with no execution evidence: never started, or accepted by an owner and then declined or returned untouched (no branch, commit, PR, local check, done, verdict or reopen, the same test as `hub_backlog_return_untouched`, #812). Work with any such evidence requires the person. Cancellation sends the former owner/reviewer a stop notice, releases overlap/reservation participation and keeps dependents blocked with a cancelled-dependency notice. It does not stop a native turn, delete a worktree or write an outcome memory note. Cancelled work is closed history, counted separately from approved work; it does not satisfy an approval dependency. A still-running private turn keeps its privacy fence after cancellation. Use the displayed revision to avoid acting on a task that changed while it was selected.

The daemon advertises `task_cancel`; a current CLI refuses cancellation against older daemons. Recovery retains verified target features beside its immutable root/digest, reuses them on resume and on each lease renewal before a terminal is closed, and checks only sources not yet past commit; a legacy receipt without that evidence needs a target probe only before commit. Upgrade/restart refuses a target without this feature while cancelled rows exist and names their ids. No cancelled row is rewritten as approved. An old binary launched by hand remains unsupported: it can count cancelled work as open or fail to move it. Use a compatible coordinator instead. Live task cancellation and sweep enablement are separate post-release operations.

## Task idle sweep

Writing-owner no-op detection (#498) is independent of the time sweep: `task_sweep.no_writes_turns` defaults to 2, and 0 disables its notices. Known file changes, HEAD/shared-branch ref movement and task-tool effects reset the streak. A canonical snapshot with recorded branch, worktree-path or PR/head evidence is unknown. Negative canonical evidence also needs exclusive worktree scope and no `.worktrees` directory, so uncommitted work in a separate checkout is not reported as empty. Done advisories use the first acceptance in the current ownership span; plan updates do not discard earlier touches.

A task that legitimately waits for a dated event (a CI or release window, a person-scheduled live leg, a quota reset) records a bounded wait instead of being swept (#1454): `hub_task_wait {id, until, reason}` from its owner, its planner or the person, with `until` an RFC 3339 time with a zone, in the future and at most 14 days ahead, and a one-line public `reason` of at most 200 characters. The tool is published only while `task_sweep.enabled` is true. While the wait is pending the `idle-owner` ladder is silent; after `until` it restarts from `until` (the first notice is `idle_min` later, step 3 still reassigns under `auto_reassign`). `review-pending`, `unaccepted-assignment` and `ready-unassigned` are never suppressed. Done, decline, return, reassignment or any other state-changing entry ends the wait. `ahub task show <id>` prints `waiting`, and `hub_planner_groom` lists a passed wait as `wait-passed` so a stale one is seen.

The between-turn task sweep (#186) is disabled by default. Set `task_sweep` in
`.agenthub/config.json` (or its machine-local override) to enable it:

```json
{
  "task_sweep": {
    "enabled": true,
    "interval_s": 300,
    "unaccepted_min": 60,
    "idle_min": 120,
    "review_min": 120,
    "ready_min": 60,
    "ladder_min": 30,
    "auto_reassign": false
  }
}
```

Booleans must be actual booleans. Each time setting must be a finite number of
at least 1; timeouts are bounded to the platform timer limit. Each threshold
measures time since the last real task history event. A ladder record does not
refresh that activity; a new event resets the ladder even at the same timestamp.

Ready proposed tasks without an owner use `ready_min` and the `ready-unassigned` ladder; unresolved or cancelled dependencies do not become ready. A person's unassignment suppresses this automatic ladder until a later explicit assignment or reservation. Planner-pulled work keeps its reserved peer and current WIP/hold admission; an unavailable or full reservation never selects another worker.

The first overdue sweep sends the assigned owner or reviewer one normal task
reminder. After `ladder_min`, the next sweep notifies the console and available
planner-role peers. After another interval it reports a reassignment suggestion
from the ordinary routing function. At most one step runs per task per sweep.
PII notices contain only the public task stub, never its text, refs or plan.

Busy, paused, offline or native-active peers, queued/in-flight deliveries and
queue holds, unresolved dependencies, completion checks, recovery/shutdown and
silent turn-free cohorts suppress the sweep. An offline owner remains governed
by the existing `tasks.release_after_min` policy. Human reviews produce console
notices. The sweep does not change route-explain output.

For Claude, `ahub claude` installs the existing PreToolUse/PostToolUse/Stop
observation hooks when the sweep is enabled, including in advisory projects.
The hooks return no facts in advisory mode. A native Stop establishes an idle
boundary; a subsequent PreToolUse marks activity. A delivery acknowledgement or
task approval does not establish native idle. Restart the daemon and relaunch
Claude after enabling the sweep so its session receives the hooks. A caller's
`--settings` keeps them: the launcher adds the hub's hooks to the caller's and
warns only that the status line tee is off.

`auto_reassign: true` explicitly allows an available alternative owner selected
under the existing routing, role and PII constraints to receive the task at step
three. Review-pending work always produces only a reviewer suggestion. The
sweep records no failed-work outcome and never weakens routing constraints.

Each ladder step is persisted in task history before publishing. A restart
therefore does not repeat it. A crash after the history write can leave its
notice unpublished or uncertain; the history records an attempted step, not a
receipt. Inspect `ahub task show <id>` and the delivery journal before acting;
durable-delivery retries remain the journal's responsibility.

## Documentation source verification

`docs/verified.json` maps README, every page directly under `docs/` and
`docs/addons/`, and every agent note to a full source commit and explicit covered paths.
A stamp records a human check of the cited paths, symbols, numeric limits and
operational commands. It does not certify live deployment or prove prose
correctness automatically. Specs, changelogs and the smoke ledger retain their
own dated evidence and are outside this manifest; so does the retired GSD analysis.

`node scripts/check-docs.mjs` also runs in `scripts/check.sh`. Missing manifest
coverage, unresolved or nonancestor commits, removed source paths and a README
status version different from `package.json` fail the gate. Source commits since
a stamp and uncommitted covered changes produce sorted stale notices without
failing it; CI's `decision` job repeats them as warnings on every pull request. Counts are commits touching any covered path, rather than file or
line counts; an unrelated commit leaves the document fresh. Git history must
include the stamped ancestors (CI checks out full history).

During release preparation, source review precedes restamping. Review each stale
page against its covered source, correct drift, and use the full SHA of the
reviewed source commit as `verifiedAgainst`. Record any deferred page and its
specific unverified claims in the release verification report before tagging. Deferred
pages must still be source-reviewed and current; a deferral is not a stale-stamp waiver.
The tag gate runs `node scripts/check-docs.mjs --require-fresh` with full history
before publishing. Stale or nonancestor stamps refuse publication, with the
release merge-commit instruction; an identical tree and green CI cannot waive this.

Do not advance a stamp solely to clear a notice. Source stamps can name an
ancestor: the manifest-only follow-up commit need not hash or stamp itself.

## Seeded guard verification

`bun scripts/seeded-check.ts` runs every guard pair in `scripts/seeds.json`
sequentially, starting with header quoting, Origin refusal, control-token
authentication, the hop cap, PII public views and uncertain-delivery receipts.
A guard needs a test that runs on Linux, where the CI job runs; a macOS-only
protection (sandbox, text projection) is covered by its regression test. Each named test first passes on current tracked
checkout bytes, then must fail an assertion with the corresponding guard weakened.
Seed rot (anything other than one exact replacement), a surviving seed and an
invalid detection have distinct errors. Compiler, setup, unrelated-test and timeout
failures never count as detection. When the anchor text is missing, the seed-rot
error also names the base commit, the symbol that held the anchor there and that
symbol's current file and line, or says which part is unknown (#778). This is
evidence only: the exact-match rule still fails the pair. `--base <commit>` names
the base; without it the runner uses the merge base with `origin/main`.

Each seed has a private temporary checkout without Git metadata, state, output
directories or user untracked files. Installed dependency packages are linked,
never copied or installed by the runner. Child tests use private home, temp and
registry directories and a scrubbed environment. The normal 20-second test timeout,
60-second hang watchdog and current-invocation process ledger/leak scan apply to
both legs. Successful fixtures are removed; a failed pair prints its preserved
fixture location with test and leak evidence for inspection.

CI runs the pairs as four Linux shards (`bun scripts/seeded-check.ts --shard i/4 --base <ref>`,
every fourth pair, still sequential within a shard; the base is the PR's base commit
or the push's previous one, on a full-history checkout) beside the ordinary checks; the
required job `seeded guards` passes only when all four shards passed (#457). The pairs
do not repeat on macOS or run recursively inside `bun test`. The runner reports every
pair's elapsed seconds and the total runtime. A green ordinary check alone does
not prove these pairs.

The full CI gate tests the PR head tree on Linux and macOS, with the seeded-guard
shards running at the same time. Main and release jobs reuse only a successful full
PR or push check with the identical Git tree and all three successful jobs. An absent or
unreadable result runs the main gate again and refuses release. A manual
`prepare_bundle` dispatch builds reviewable plugin assets without publishing;
it is never accepted as full-gate evidence. A `timing_runs=20` dispatch runs only the daemon, PII screen and ACP
test files twenty times on macOS, in its own concurrency group; it does not replace the full gate. Each PR has its own CI concurrency group, so PRs run side by side; within a PR a newer head replaces the older run, pending or in progress (`cancel-in-progress` for pull requests only, #1490); main pushes and dispatches keep queueing every run and are never cancelled. A cancelled run is never a full-gate proof. A draft PR skips the macOS shards and its required `check (macos-latest)` fails with "macOS deferred" until `gh pr ready` starts a run that includes them (#1490). Two groups admitting the same tree at once may run it twice, never a false green (#609). `scripts/check.sh --changed [<base>]` runs every non-test step but only the affected test files, and the full suite when it cannot tell; the full gate stays CI's (#610).
`scripts/check.sh` runs the suite under `scripts/hang-watch.sh`, which stops it when
no test result line (`(pass)`, `(fail)`, `(skip)` or `(todo)`) and no test file header
has appeared for `AHUB_CHECK_QUIET_S` seconds (300 by default, set to 300 in CI), so a
slow suite that is still passing tests is never cut. `scripts/progress-tee.sh` passes bun's
output through unchanged and appends one byte to a progress file for each of those lines;
the watchdog polls that file's size. On a stop it prints where the run is and the process
table below it first. `AHUB_CHECK_HANG_S` (2700 by default, 45 minutes: the owner raised it from 2250 on 2026-11-19 after healthy full runs on the remote host were ended at exit 143 while still printing passing results, #1564; #1086 had sized 2250 from two measured full runs on dgx02 of 1483 s and 1487 s of test time, and before that it was 960) is only the backstop for a run
that keeps printing results while hung; hosted CI sets 1500 on Linux inside a 35-minute
job limit (#378, #593, #752, task 516). The macOS leg runs as four shards and the Ubuntu leg as six (#548, #1490): `AHUB_CHECK_SHARD=i/n`
makes `scripts/check.sh` run slice `i` of the full suite through `bun test --shard=i/n --timings=scripts/test-timings.json`, which puts
every test file in exactly one shard and balances them by the recorded per-file times; shard 1 also runs the docs check, typecheck, role check, bundle freshness and
package contents, so each of those runs once per gate, and the others install and test. Each shard runs under the same 1500 s backstop as Linux inside a 25-minute job
limit, and its last line is `check: OK (shard i/n)`. The required check `check (macos-latest)` is an aggregator job that passes only when every shard passed (or an
identical-tree full proof was reused), so branch protection and the reuse proof read the same names as before. A stacked pull request (base not `main`) runs no macOS shard, and its `check (macos-latest)` fails with "macOS shards deferred", naming the base (#1307): GitHub allows 5 macOS jobs at once on this account, and such a PR is rebased and rerun once it targets `main`. A PR retargeted to `main` without a new commit gets its macOS run by a push, or by `gh pr close <n> && gh pr reopen <n>`; `gh run rerun` replays the old base and defers again. `AHUB_CHECK_SHARD` is the full suite only: it cannot be
combined with `--changed`. A shard execs the system git once before its tests (`AHUB_CHECK_WARM_GIT`, default `/usr/bin/git`; a failure of it is ignored), because the first execs of `/usr/bin/git` on a fresh hosted macOS runner outlast the 1000 ms some tests give it. `scripts/test-timings.json` is advice for balance, never a list of tests: a file missing from it still runs (Bun gives it the median time).
Regenerate it from a green macOS leg when the shards drift apart: `gh api --allow-escape-sequences repos/<owner>/<repo>/actions/jobs/<macOS shard job id>/logs`
for each shard, or from one unsharded leg's log, then `bun scripts/make-test-timings.ts <log>...`, or `bun scripts/refresh-test-timings.ts` for the newest green run (#1257).
A red CI job gets one rerun of its failed jobs on the same head, then an investigation; the weekly flake ledger issue and the rerun policy are in `docs/agent-notes/tests.md` (#1257).
The `closing-refs` workflow fails a PR whose title, body or commit messages would make
GitHub close an issue the text only mentions (`Refs #N`, a negated or qualified keyword);
an issue linked only in the sidebar passes (#760).
The gate holds `<git common dir>/ahub-heavy.lock` across every worktree of a
repository. A second gate waits up to `AHUB_CHECK_LOCK_WAIT_S` (1800 seconds by
default; 0 fails immediately) and names the holder. A holder whose PID is gone
is reaped. This filesystem slot works without a running hub; it covers this
gate, not arbitrary build commands. PID reuse can retain a stale slot, and two
waiters reaping the same dead owner can race; broader scheduling remains an
operator responsibility (#398).

## Preview initialization and native launch

Run `ahub init --dry-run --json` for action/path/reason metadata, including a
managed-block summary. The real init applies the same plan and preserves user text
and legacy symlink/hardlink safeguards. Preview creates no files or registration.

Use `ahub claude --print-command`, `ahub codex --dry-run`,
`ahub kimi --model <alias> --print-command`, or
`ahub pi --mode tui --print-command` to inspect launch JSON.
Environment values and arbitrary supplied values are withheld. Native-assigned
proxy/bridge endpoints and new session identity remain unresolved.
Claude and Codex previews include conditional `AGENTHUB_INSTANCE_ID` and
`AGENTHUB_LAUNCH_ID` environment names with unresolved reasons. Claude's existing
daemon identity is read at launch; a launch identity is allocated only after
verified Orca terminal readback. Codex identities are injected when that Orca
launch record is made. Preview neither reads those runtime identities nor
allocates them, and never displays their values. Pi's environment preview
continues to describe its native builder output.
These previews do not connect to the daemon, toggle permissions, record terminal
ownership, bind servers or start agents, sidecars or models.


## Native context readings and optional checkpoints

`ahub status`, `ahub tail` and the dashboard show native context occupancy,
source and measurement freshness. Claude readings come from the status-line
tee installed by `ahub claude`; Codex readings come from its current thread's
native token-usage updates. Kimi's context occupancy comes from its ACP `usage_update`
(`{used, size}`, source `acp_usage_update`), not consumption, so no token total is counted from it. Its consumption is counted from its
session wire log (`<kimi home>/sessions/.../agents/*/wire.jsonl`, #285 phase 2) and reported as the `tokens` window of
`budget.kimi_tokens_5h` (source `hub count, kimi wire log, of kimi_tokens_5h N`; cache reads are not counted); an unreadable log shows
unknown with one notice, never a short count. Until the OAuth probe or `ahub budget set kimi ...` feeds the plan quota, the provider's
own 5 h and weekly ratios stay unknown. Not yet verified live against Kimi's `/usage` (#285 AC11); the adapter accepts the
update whenever it names the current session, because 2.1.1's source text
emits it after the turn settles (read from the source, not yet observed live
through the hub; docs/smoke.md), so the peer may already be idle.
Jcode's context occupancy comes from its ACP `usage_update` (`{used, size}`, source `jcode_usage_update`, bound to the adapter's own session id) on the verified 0.99.1 shape; its consumption is one `usage` event per prompt (source `jcode_acp`: the prompt result's `inputTokens`, `outputTokens`, `cachedReadTokens` and `cachedWriteTokens` as the hub's buckets, never Jcode's `totalTokens`, which counts the cached read twice for OpenAI-style providers) and never a `tokens` event or a window. Jcode has no native quota reader: `jcode usage --json` carries a free-text limit name and no window length, so `ahub budget` keeps `no reading` for it and `ahub budget set` stays the way in (receipt: `docs/verification/2026-10-28-jcode-0.99.1-usage.md`).
Pi, Qwen (until a native source is verified, #625) and other unsupported surfaces show unknown.
A stale or disconnected reading is unknown, not 0%. Codex's accumulated session
usage is never used as context occupancy. In the tail (`ahub tail` and the
console's stream) a reading prints once and repeats only when the line changes
apart from its time: the printed percentage, the freshness, the source, or known
against unknown. Status, the Peers panel and the dashboard always read the
latest reading with its time.

Context-triggered checkpoints are disabled by default. To enable them, add
this to `.agenthub/config.json` and restart the daemon deliberately:

```json
{"context":{"gate":0.85,"stale_min":30}}
```

`gate` is a fraction between 0 and 1; 0 disables checkpoint requests.
`stale_min` must be positive. A reading at or above the threshold records a metadata-only
event and console notice, then asks an attached Claude/Codex with active work
for a checkpoint when no checkpoint request is already outstanding (an ACP peer
such as Kimi gets the event and notice only; no checkpoint request is sent to it
yet). The request supplies a `request_id`; include that id with
`hub_checkpoint {summary, request_id}`. Repeated high readings do not repeat
it until a fresh below-threshold reading or new session rearms the crossing.

The resulting non-private note is saved in the state directory as
`context-checkpoint-<peer>.json`, mode 0600; saving to shared memory is attempted
when memory is enabled. Its body is never broadcast. A private turn, an open PII
task held by the peer, or PII-pattern text prevents persistence and sharing.
Requests are bound to the current peer, native session and transport generation.
A new connection claim invalidates the old request before asynchronous recall or
attachment, even with an unchanged native session id. Requests also expire after
`budget.checkpoint_timeout_s` (90 seconds by default).
Quota pause and task handoff are separate; a context checkpoint neither pauses
nor hands work over. Continue normally or deliberately restart into a fresh
session with your chosen checkpoint as preface. No automatic restart or native
compaction override is performed.

### Structured checkpoint fields (#1331)

`hub_checkpoint` keeps `summary` and accepts five optional fields next to it:
`done`, `in_progress`, `next`, `verified_by` (how each done item was checked:
test, run or review) and `traps`. Each is at most 5 lines of 200 characters, and
the rendered checkpoint (summary and fields together) stays within 3000
characters, which is what a handoff keeps. A field over its limit is refused
with the field and the limit named, nothing is saved, and the request stays open
for a corrected call; nothing is truncated. A call with only `summary` behaves as
before.

The private context-checkpoint file, the shared-memory note and the quota
handoff prompt ("Handoff from the previous owner") render the summary first and
then each present field under its heading (`Done`, `In progress`, `Next`,
`Verified by`, `Traps`) in that fixed order. A missing field is omitted, never
invented. Both checkpoint requests name the fields and ask for the same
headings in `.agenthub/checkpoint.md`; the repository has no template file for
it, so the request text is the template. The PII handling is unchanged: the
fields are screened with the summary, and the envelope shows only the public
view.

Each saved checkpoint writes one `checkpoint` event with the peer, the reason
(`quota` or `context`) and the names of the fields it carried, never their
text. `quality.json` counts them under `events.checkpoints` (total, by number of
fields, by field name), so field use is measurable.

A context reset is an operator option, not something the hub does: when a
session is long, you can start a new session and give it the structured
checkpoint as its preface, or continue the same session after the native
compaction. Nothing resets automatically.

## Context headroom admission for new work (#802)

`context.max_assignment_used` is a separate, default-off admission threshold.
In an untracked `.agenthub/config.local.json`, set it to a fraction in `(0, 1]`,
for example `{"context":{"max_assignment_used":0.85}}`. Zero disables it.
Tracked configuration cannot enable it on another machine. Restart deliberately,
or preview and confirm `ahub settings reload` as the person; it applies to the
next routing decision. `context.stale_min` is the freshness limit.

A fresh native occupancy at or above the threshold skips that peer for a new
automatic owner offer. `ahub route explain` uses the same pure decision and
prints the measured fraction and limit. Missing, malformed, future, stale,
detached or replaced-session evidence is explicitly unknown: it neither blocks
nor establishes spare capacity, and the existing routing rules still decide.
Only adapters with declared native context readers supply evidence, including
Jcode's session-bound reader; unsupported surfaces stay unknown.

A name or reservation alone does not bypass admission. Explicit assignments by
the person or current configured conductor, and a peer's own self-claim, may
bypass this context limit; roster, privacy, quota, capability and other gates
still apply. Reviewer selection is unchanged, including review-class owners.
The rule never pauses, compacts, replaces or moves an active session or task.
It leaves `context.gate` checkpoint events and requests unchanged, and does not
add a telemetry-driven reassignment or retry timer. Re-evaluate or explicitly
assign an unassigned task when its owner's context has changed.

## Pi tool refusals, exit causes and idle automatic restart

Pi hub-task/conductor refusals proven before any task or board effect return
their original `error:` text and are recorded as completed tool receipts.
PII screening and its telemetry record may precede the refusal. An uncertain
post-effect or storage failure remains pending: inspect it before repeating an
action. Old pending receipts carry no proof of a past refusal and stay pending
across startup. Conductor assignment and escalation entry checks explicitly opt
into refusal typing; internal escalation after a saved review remains generic.

Pi exit records show code or signal, turn/tool activity, whether teardown was
expected, startup status, and the last tool's name without arguments. An
unobserved native-terminal exit records unknown OS status. The console notice
gives the next action, usually `ahub pi`, or says why automatic start is held.
A replacement says the owner stopped for a new Pi owner, including when the
replacement is refused. Internal failure teardown directs session inspection
rather than claiming a person requested it. Replacement, failed-start and
active-turn guidance appears before automatic-start-disabled guidance.

With `pi.auto_start`, an unexpectedly idle headless Pi is resumed on its
verified persisted session once. The 60-second retry window rearms when the
attempt settles; a second exit inside that window stays offline. Missing or
invalid session history has no fresh fallback; inspect it before running
`ahub pi`. Active turns/tools, failed startup, a superseded owner, native
terminal exits, a requested stop (`ahub stop pi`), requested shutdown and
recovery operations suppress this restart. Crash recovery's #66
recorded-session/fresh-start choices are unchanged.

### Explicit Pi history replacement

If an offline Pi owner has no verified persisted resume state, inspect the old
session and any partial work, then select a preserved file explicitly:

```sh
ahub pi --replace-session --session-file <managed-file>
```

The file must be inside this project's `.agenthub/state/pi-sessions/` and its
session header must identify the same project. The selected session keeps its
existing identity. This is a person-only recovery action; default restart never
selects another session or infers that missing history was empty. A session id
alone is insufficient. Add `--headless` to run the selected history in background.
`--print-command` validates flags without checking the live owner or changing it.

Replacement requires an existing offline owner whose native process is proven
gone, with settled tools, receipts and approvals, outside a recovery operation.
An unclaimed pending TUI launch uses the ordinary restart path instead. Before
revoking the old owner, the hub durably saves private previous/selected session
metadata in `pi-session-replacements/` beside `pi-sessions/`. Failed validation or
record storage leaves the old owner intact. All session files, queued work and
journal records remain. Uncertain effects are never retried by this selection;
inspect and reconcile them before continuing.

### Pi/local unanswered approvals

An expired Pi/local request says "approval expired: no person answered". The
worker must not retry that call; hand the task off or stop. Two consecutive
unanswered requests end the current turn and produce a console notice. An
expiry counts only when no person answered a request of that peer while it
was pending, so a batch of parallel requests does not stop a worker whose
person is answering; a grant served from the always-allow cache or a permission
mode is not an answer and does not reset the count. A new turn also resets it. The turn ends
through the same abort path an execution-budget stop uses: Pi stays attached
and the sender is told the approval reason. Supported Pi and local settle that
delivery after reporting the reason, so the next queued message runs without
an operator release. Pi clears turn-only approval state at settlement; the
person's idle `!command` remains usable and a later failure keeps its own reason.
A Pi whose extension cannot abort
a turn (an older hub extension or a runtime without native abort support) goes
offline instead. Inspect prior work, restart with `ahub pi`, find the held
delivery with `ahub queue list --peer pi`, inspect it with `ahub queue show <id>`,
then explicitly settle it with `ahub queue resolve <id> --action completed|retry|discard --reason "<text>"`.
A cancelled tool withdraws
its request immediately; a later `ahub permit` answer is refused and cannot
create an always-allow grant. Tool requests from a previous turn or an older
extension missing session/turn identity are refused before execution; restart
Pi with the current hub extension rather than retrying that old call.

The dashboard shows the number of waiting Pi/local requests and where to
answer them. It remains deny-only for those private rows. Use the console or
`ahub tail` to inspect the request, then `ahub permit` to answer it. Recovery
stops waiting for an approval when that request is withdrawn.

A person's `!command` in the managed Pi TUI runs through the managed sandbox
without asking for another hub approval. Its reported exit code comes from
the process, including a nonzero exit; text printed by the command does not
set its status. This exception requires the current idle TUI owner's reserved
request and does not apply to model-origin bash calls.

### Stop one headless peer

`ahub stop kimi`, `ahub stop pi` (headless mode), or `ahub stop local` stops
that hub-owned runtime through its adapter and prints `<peer>: offline`.
The hub and its other peers keep running. The command is the person's or the
configured conductor's (an audited operational admission); other agent shells and
tools-role connections are refused at the `peer_stop` request.
An older hub that does not know the request needs an upgrade before this
command is available.

Claude, Codex and Pi in TUI mode belong to their native terminals: end them
in those terminals. The upgrade plan's end-agents action closes a TUI through
its verified terminal binding and uses `peer_stop` for a headless runtime.
Unknown and already-offline peers are refused with a next action. A recovery
operation or shutdown holds stop mutations; finish that operation first.
A peer's concurrent start, stop or permission-mode change must also finish
before another lifecycle change is admitted, and an upgrade or restart does not
prepare the hub while a stop is in progress.

A requested stop does not automatically restart a peer. A person or an authorized
conductor can explicitly start it again; conductor starts remain permitted. Start it with
`ahub kimi`, `ahub pi` or `ahub local`. Pending approvals are withdrawn before
teardown. An in-flight delivery becomes `needs_review`, with a reason naming
the requested stop; it is neither completed nor automatically replayed.
Inspect partial effects with `ahub queue list --peer <peer>` and
`ahub queue show <delivery-id>`, then explicitly choose `completed`, `retry`
or `discard` with `ahub queue resolve`. Restarting alone does not release
that held delivery. Work queued behind an idle stopped peer is retained and
runs when it is started again, subject to its existing pauses and holds. New work
arriving during teardown stays queued too, even if a console resume runs meanwhile.
An idle Pi with no message/file yet records its live empty-session proof before
stopping, so its next start resumes that identity. A Pi stopped after its first
prompt was accepted but before history was persisted is not treated as empty:
its delivery is held, and another start refuses until resume history is verified.
Inspect and settle the held delivery before selecting preserved history through
[explicit Pi history replacement](#explicit-pi-history-replacement). The stop
never silently chooses a fresh session; replacement requires an offline, settled
owner and a validated managed session file.

A pull-only Kimi TUI has no controlled restore or resume. While it is attached,
upgrade/restart planning stops before effects and asks the person to end Kimi in
that terminal and make a new plan. Headless Kimi restoration stays headless even
though the unset launch mode now means TUI; older targets keep their legacy
command without a mode flag. Native recovery remains unverified.

Changing a reviewer on a task in review withdraws unread requests and tells the
former reviewer its request is withdrawn. A delivered request cannot be recalled,
but a later verdict from that former reviewer is refused by current authority.

Legacy Claude pull-only sessions retain their existing automatic owner/reviewer
selection; the watched-Kimi exclusion does not disable that review path. After
first creating the Kimi MCP file, run `ahub init` to ignore the untracked file.
Init leaves existing ignore bytes alone when no Kimi MCP file exists.
## Scoped grants for instruction files

`ahub settings set scoped_grants.protect_instructions true` asks a person before
Pi/local scoped writes and edits to `AGENTS.md`, `CLAUDE.md` and `QWEN.md`, and
withholds automatic permission from the managed Claude hook. Case, compatibility
forms and both symlink spellings are checked. The default is false: these project
documents remain editable under scoped grants. Reads, explicit approval and
never-ask keep their existing behavior.

Use `ahub settings preview scoped_grants.protect_instructions true` before a
change and `ahub settings undo` to restore it. It is in the Permissions registry,
writes only machine-local `protect_instruction_files`, and applies immediately
in the running hub. A dashboard settings session may change it; an ordinary
session may turn protection on but cannot weaken it. No agent surface changes it.
Like other machine-local security defaults, loading it requires git to establish
that the file is untracked; a dropped value is reported by the settings result.

## SDLC artifact receipts and gates

The playbook lifecycle (#257, #481) is off without `.agenthub/sdlc.toml`. When enabled its stages are intent, spec, plan, build, test, review, merge, release and maintain, grouped as Plan, Design, Build, Test, Deploy and Maintain. Advise shows blockers; enforce checks implemented head-bound review and approval gates. Stored implement/verify receipts read as build/test; new enabled receipts use canonical ids. See [the SDLC contract](sdlc.md) for gates, required check names, local receipts, console-only readbacks and the S0-S8 delivery table. A person accepts a spec issue with `ahub sdlc accept <task> --issue <n>` (S1). A PR merged outside the hub is recorded with `ahub sdlc adopt-merge <task> --pr <n>` (person or current conductor), which approves the task and releases dependents only at its recorded head with green required checks ([adoption](sdlc.md#adopting-a-pr-merged-outside-the-hub-1328-t3)). The planner records plan reviews with review and CI scope (`hub_plan_review`, `ahub sdlc plan-review`) and grooms with `ahub backlog groom`; `ahub backlog return <task> <revision> <reason>` returns accepted, untouched work (S9). `ahub sdlc costs [owner/repo]` reports review rounds and CI runs of merged PRs without writing the board (S10). `ahub sdlc metrics [--since <YYYY-MM-DD|ISO time>]` (the planner tool `hub_sdlc_metrics`, planner or person, read-only) reports lead times, first-pass approval and check rates, rework rounds, stale-head re-reviews and open stalls from board history, with `unknown` counted and never 0; optional `[bands.<metric>]` in `sdlc.toml` add control bands that the daemon checks every five minutes in advise or enforce, writing a hub notice (`log`), a read-only `triage` backlog task (`diagnose`) or a `plan` backlog card (`propose`), one per breach episode and never a GitHub issue (S7, see [metrics](sdlc.md#sdlc-metrics-and-control-bands-481-s7)). With the lifecycle on, a task's issue identity is linked when it is proposed or accepted, from the one issue it names (an imported GitHub issue, or a `#N`, `owner/repo#N` or issue URL in its title); a title that names a sibling repository (`agent-mem#13`) links only when `refs.repo` names it, and without `refs.repo` the propose result says to set it. `ahub backlog groom` also backfills up to 32 links per call, within 1 s (#723). S11 release trains ship in 0.12.37 (see [release scheduling](#planner-release-scheduling)). S3 structured review findings (an open Important finding blocks approval in enforce; `max_nits` in `sdlc.toml` caps nits) and S2 literal-path plan conformance with the person-only `ahub sdlc accept-departure <task> <head> <reason...>` are in source; see [findings](sdlc.md#structured-review-findings-481-s3) and [plan conformance](sdlc.md#plan-conformance-481-s2). S4 [test integrity](sdlc.md#test-integrity-481-s4) and S6 [release authorization](#release-approval-and-optional-tag-guard) are in source too. S5 is in source as an [eval gate mechanism](sdlc.md#eval-gate-for-agent-configuration-481-s5) with no suite chosen, and S7 adds merge-time readback, [release metrics](sdlc.md#release-metrics-481-ac12) and an opt-in security baseline; a full live advise/release cycle and the per-release gates-run record remain pending. Owners/reviewers record bounded identities through `hub_sdlc_record`; these grant no additional authority. Off output, receipt and schema shapes stay unchanged. #1403 adds a `[security]` table whose paths need a recorded `security_pass` on the approving review ([security pass](sdlc.md#security-pass-for-sensitive-paths-hub-task-895-1403-a2)), `ahub sdlc audit start|show` with a hub-written coverage ledger ([audit](sdlc.md#security-audit-with-a-coverage-ledger-hub-task-896-1403-a4-a5)), plan intent fields with advisory base drift on accept and done, and `ahub sdlc survey start|show` ([surveys](sdlc.md#advisor-surveys-and-considered-findings-1403-t7)); while survey or considered-finding state exists, a restart, upgrade or recovery onto a target without `advisor_surveys` is refused. The person may instruct the configured conductor in its own session to run `ahub sdlc configure` for `off`/`advise` and required checks ([#1432](sdlc.md#instructed-conductor-configuration-1432)).
## Supervision proposals

`supervision.mode` is off by default and machine-local (`ahub settings set supervision.mode advisory`); a committed
`.agenthub/config.json` cannot turn it on. `shadow` stores bounded proposals on the queue and does nothing else: no
inbox row, no notice, no turn. `advisory` may also show a pending proposal in the console's existing inbox, where only
an explicit accept or dismiss acts. The queue holds at most 100 pending proposals, three per task revision, and keeps
400 terminal rows for dedupe, so a reading already accepted, dismissed or expired is not proposed again for the same
rule, task, revision and trigger. A reading past a bound is refused and counted: `hub_supervision_list` reports the total
as `refused`, so a full queue never reads as "nothing to report".

A present role reads and decides them with `hub_supervision_list`, `hub_supervision_accept` and
`hub_supervision_dismiss`, or with the advisory inbox row: the task's owner, its reviewer, the configured planner, the
conductor and the person. There is no supervisor role. An acceptance runs the existing action the proposal names,
through that action's own authority: `escalate` through the conductor for an agent and the board's own escalation for
the person, and `recheck` or `request_integration` as the hub's notice to the owners, whose check re-run or integration
is their own action and their own board record. An `escalate` proposal is therefore accepted by the conductor or the
person only; another role's acceptance is refused and the proposal stays pending. Accepting writes nothing to the board.

Every refusal names its reason and starts nothing. A stale revision, a closed or vanished task, new input that cleared
the pattern, or a replaced native session expires the proposal; a private task, a clipped reading (a revision longer
than one rule reads), an unknown id, a caller with no role on the task, a caller that does not hold the action's own
authority, or an owner's `needs_review` delivery refuses without spending it. An action whose outcome the hub could not
observe is recorded `unknown` and never retried; a later read settles it from the board's own record at or after the
intent time and inside the task revision the proposal was read under, and a restart keeps the dispositions, the dedupe
keys and the unknown outcomes. There is no automatic pause, retry, cancel, reroute, approval or rollback, no resident
worker and no timer. See [supervision rules, proposals and the decision path](design/supervision.md).

## Optional Qwen Code peer

Select Qwen per project with `ahub roster add qwen`; it defaults off and is absent
from default class preferences. `ahub qwen [--mode headless|tui] [--model <alias>]`
starts its ACP peer (headless) or Qwen's own TUI in your terminal (below).
`--print-command` previews either. `ahub stop qwen` stops the owned process group
of a headless Qwen. A conductor may start the headless form only through the
selected roster and existing capabilities; the TUI is always a person's start.

### Qwen's own TUI, driven through dual output (#286 Part 3)

`ahub qwen --mode tui` runs `qwen --input-file <in> --json-file <out> --mcp-config <hub server> --approval-mode default` in the terminal you ran it from. The daemon prepares the two files (mode 0600, under `<state dir>/qwen/qwen-dual/`) and returns the launch; the hub then appends one `submit` line per delivery and tails the event file from a saved offset. It needs a Qwen the dual-output compat entry verifies (`ahub agents` shows `qwen-dual`, verified 0.26.1 and exact 0.27.0 and 0.27.1; the headless `qwen` entry has its own ACP receipts) and refuses another version before it creates a file. The TUI is explicit only: `ahub qwen` without `--mode` is still headless, Qwen is not a start-mode peer, and the hub never opens this terminal by itself. The TUI start is refused for an extra Qwen instance, off roster, outside a terminal, and while a headless Qwen runs (`ahub stop qwen` first); a headless start is refused while the TUI holds its terminal.

- What the hub does: a delivery becomes a `submit`; the last assistant message of the turn (an `assistant` event whose `stop_reason` is not `tool_use`, then `message_stop`) is shared as the answer; busy and idle follow the events. A `can_use_tool` request goes to the console approval path (`ahub permit`, the dashboard), and the hub's own tools are approved only by their exact `mcp__agent-hub__<tool>` name. If you answer a prompt in the Qwen terminal first, the hub's pending approval is withdrawn.
- **Limit 1, a deny is not a readiness ACK.** The known denied delivery completes without a shared answer, but queued messages remain unsubmitted behind a durable input fence. The denied turn's own assistant/Stop does not release it. After 30 s without recovery proof the peer reports offline, keeping the fence. Type a new plain, tool-free prompt (or press Esc first) in the Qwen terminal and finish that personal turn; its same-session final assistant/message_stop can restore readiness even after timeout. Alternatively, end Qwen in that terminal and run `ahub qwen --mode tui` for a verified new native generation. Merely making the event file readable, replaying session_start or restarting the hub does not release a deny fence. A new personal USER must be observed after adoption. An uncertain original turn still settles `needs_review`; a deny retains its known `completed` disposition. Background task-notification events are not personal USER recovery proof.
- **Limit 2, the hub cannot stop a Qwen turn.** The input protocol has only `submit` and `confirmation_response`, and a signal does not stop a running turn. The inactivity watchdog therefore never cancels: after `watchdog_ms` of silence it marks the turn stalled (`ahub status`, the console and the dashboard say "press Esc in the Qwen terminal") and keeps the peer busy. The hub never types into your terminal and never signals Qwen to stop a turn.
- A Qwen write or shell command that names the hub state directory is refused (see [security](security.md): the input file is a prompt channel).
- A short or unconfirmed input write, or an input file ending without newline, reports offline with the delivery held `needs_review`. No remainder or second message is appended. A personal turn cannot repair this input file; inspect and end Qwen in its terminal, then run `ahub qwen --mode tui` for a verified fresh generation. Crash detection reads the actual tail; a torn prefix ending with newline is an explicit undetected ceiling.
- If the hub cannot read the event file the peer is `detached`, shown as offline with a notice, never idle: Qwen itself keeps working, and the hub reattaches when the file is readable again. A pending deny excludes every event buffered before restored EOF, even on the same inode; follow the plain, tool-free recovery procedure above after reattachment. Tool/control activity can invalidate the completion proof, so tool-assisted recovery is not promised; completing a USER line begun before restored EOF does not supply recovery proof.
- Restart: if the hub restarts while your Qwen keeps running, it reads on from its saved offset (no event twice, no launch). If Qwen is gone, `ahub qwen --mode tui` starts `qwen -r <session id>` on the same two files; the earlier submits are not replayed and the recorded answers are not shared again. Recovery never restores this terminal as a headless worker, and `ahub stop qwen` refuses: end Qwen in its own terminal.

The [2026-11-10 account-free receipt](verification/2026-11-10-qwen-0270-dual-output.md)
qualifies exact 0.27.0 against matched private 0.26.1 on macOS arm64; the
[0.27.1 receipt](verification/2026-11-10-qwen-0271-dual-output.md) repeats the same
Q2 and Q3/Q5/Q6/Q7 suite on exact 0.27.1 against matched 0.27.0, and the
[0.28.3 receipt](verification/2026-11-22-qwen-0283-dual-output.md) repeats the suite on exact 0.28.3. Normal-Bus
Q2 has two user/final-Stop/ordinary-provider turns after owned stop; Q3's five
permission cases, unread-FIFO Q5, same-session/no-replay/assistant-context Q6 and
identity/guard Q7 also passed, with final closure and protected/artifact/source
fences. Q4 retains the external-stop limit. The separate direct-busy pair emitted
one user/assistant/Stop with both markers in one assistant, so the original
native-busy-submit queued-turn claim remains unreproduced. Adoption, reattachment
outside the durable deny-fence path do not prove native quiescence in every path. The deny fence is source/fake verified, not a new native cancel ACK qualification. Real-model
turns, this repository's live dual-output TUI use, Linux and lifetime containment
remain unverified; the basic ACP/setter contracts and automation eligibility are
separate.

Receipt-verified native ACP identities are qwen-code 0.25.0 and 0.26.0 ([dated receipt](verification/2026-10-22-kimi-qwen-compat.md)), 0.26.1 ([0.26.1 receipt](verification/2026-10-26-qwen-0261-acp.md)), 0.26.4 ([0.26.4 ACP receipt](verification/2026-10-31-qwen-0264-acp.md)), 0.26.5 ([0.26.5 ACP receipt](verification/2026-11-03-qwen-0265-acp.md)), 0.26.8 ([0.26.8 ACP receipt](verification/2026-11-06-qwen-0268-acp.md)), 0.26.9 ([0.26.9 ACP receipt](verification/2026-11-08-qwen-0269-acp.md)) 0.27.0 ([0.27.0 ACP receipt](verification/2026-11-09-qwen-0270-acp.md)), and 0.27.1 and 0.28.3 ([0.28.3 ACP receipt](verification/2026-11-22-qwen-0283-acp.md), which also records the 0.27.1 control). The separate [0.26.4](verification/2026-10-31-qwen-0264-dual-output.md), [0.26.5](verification/2026-11-03-qwen-0265-dual-output.md), and [0.26.8](verification/2026-11-06-qwen-0268-dual-output.md) dual-output attempts did not establish their queued-turn criterion, those versions remain unverified by `qwen-dual`; exact 0.27.0 and 0.27.1 have the separate matched receipts above. A CLI version label alone
is insufficient: startup verifies its native identity/version and advertised mode
ids before any prompt. The earlier local installation reported CLI 0.25.0 while
its package/ACP source said 0.24.1; that was not a ready identity. The 0.26.0 receipt
used a private prefix and did not upgrade PATH. Configure `qwen_cmd` only in
untracked config.local.json with a receipt-verified executable.
The provider's tunnel/relay, if needed, must already be available. Startup cannot
prove network readiness from a version command.

Modes: ask maps to default, scoped frequency maps to auto-edit, never-ask maps to
yolo. Qwen yolo approves every tool outside any hub sandbox; its own vendor bounds
apply. Auto and plan are not hub mode mappings. Unknown quota refusals are not
classified as authoritative quota; until a real pinned refusal is recorded, pause
by hand. Context occupancy shows unknown until a native source is verified; it no longer uses Kimi's usage parser (#625). Roles
do not establish that Qwen can reliably replace Kimi before the live leg.

Qwen controlled recovery and automatic crash resume load the recorded conversation with ACP session/load. The emitted launcher passes --session-id; a controlled plan with a missing or unsafe identity refuses before effects. Preview redacts the id. A custom executable argv keeps its wrapper arguments before appended model flags. Native recovery remains unverified.

## Optional Jcode peer

Use `ahub roster add jcode`, then `ahub jcode [--model <alias>] [--provider-profile <name>]`. It opens the native TUI attached to the hub-owned ACP session by default. Use `--mode headless` or `ahub settings set peers.jcode.start_mode headless` to keep headless startup. The launcher reads roster membership from the hub's status reply; a hub older than 0.12.35 does not send it, so the launcher stops with an upgrade-or-restart remedy and starts nothing (#484). The person launcher configures only agent-hub-jcode in .jcode/mcp.json; run ahub init afterwards to ignore the untracked machine-path file. It writes the plugin bundle the running hub reports in `status`, so a CLI from another install no longer leaves a stale entry; `ahub kimi` does the same for Kimi's TUI entry (#502). Conductor/dashboard starts read that entry without editing it. Preview starts nothing, and ahub stop jcode stops only the owned private daemon/ACP groups. jcode_cmd, jcode_home and jcode_provider_profile are machine-local and never editable from settings.

The native TUI opens only after Jcode has saved the selected session. On 0.98.1, `session/new` does not save it; the first real hub turn does. The launcher prints `jcode's TUI opens after its first hub turn; send it work, or Ctrl-C` once and waits for the same owned launch's saved session. Send Jcode work from the hub, or press Ctrl-C to end only the wait. No artificial prompt is sent. A console `peer_start` uses a terminal provider to run the same launcher, even while ACP is running; a conductor or dashboard start of an attached Jcode answers `already` and opens nothing (#559). Without a provider, run its displayed command in your own terminal. Options with no terminal need that manual path.

A refused TUI launch names its cause and the next step (#1093): Jcode was
restarted during the launch, its owned server is not running, its private socket
was replaced, no session has been reported yet, the saved session failed the hub's
safety check, the hub is busy stopping or recovering, Jcode is not running under
this hub, or the project MCP entry is stale. The daemon logs only the cause code,
never a path or id. After a crash or controlled recovery a Jcode whose start mode
is `tui` runs headless. Until a TUI launch is served, `ahub status` and the
launcher say `jcode is running headless after recovery; run ahub stop jcode, then
ahub jcode to get its TUI back`.

`ahub jcode --dry-run` stays pure and redacted. A person's `--print-command` can show the actual top-level native argv and closed native environment for an already-saved running session; it starts nothing, and like the launch it names a `--model`, `--provider-profile` or `--session-id` that differs from the running session (#574). The private socket/session tuple is not returned to hub tools or status. Native saved-session evidence is read-only and capped at 32 MiB; unsafe, mismatched or larger evidence refuses the TUI launch.

A busy jcode takes an `important` message into its running turn (#572): the hub sends it as a soft interrupt through jcode's own private server socket, which jcode injects at its next tool boundary, so the message no longer waits for the turn to end. The hub never cancels a turn to deliver. Headless Kimi and Qwen have no such path: an `important` message waits, and `ahub status` and the console show `important messages waiting on a busy ACP peer for N min` once it has waited past `budget.stale_min`, so you can decide to stop the peer.

jcode has no switch to choose which MCP servers its `serve` and `acp` load, so the hub-owned jcode starts every server named in `<JCODE_HOME>/mcp.json` and the project's `.jcode/mcp.json`, `.mcp.json` and `.claude/mcp.json`, besides the hub's own (#572). `ahub doctor` lists their names in its `jcode MCP servers` row (names only, from those four files only). To keep a server out, remove it from those files, or point `jcode_home` at a separate home. `ahub init` does the second for you (#1627): when jcode is installed or rostered and `jcode_home` is still your own `~/.jcode`, it creates `<hub home>/jcode/<project id>` holding only the hub's MCP entry, the servers you listed in `jcode_mcp_allow` (copied from your `mcp.json`) and the hub skill trees, leaves `jcode_home` unchanged (a new home has no login, and switching would break a working jcode), and prints your steps: `JCODE_HOME=<home> jcode login`, then `ahub init` again, which sets `jcode_home` in `.agenthub/config.local.json` (never the tracked file) once the home holds a login. Provider and model defaults stay in your own `config.toml` and are not copied. It never reads or copies your login, sessions or history and never changes your own home. `ahub init --no-jcode-home` skips it, `--dry-run` lists what it would write, and a second run only reports drift. `ahub roster add <peer>` shows a preflight first (CLI version verdict, start mode and, for jcode, the home and the MCP servers that would load) and asks y/N; with no terminal it refuses unless `--yes` is given, which a configured conductor keeps using. Probe receipt: `docs/verification/2026-11-22-jcode-separate-home.md`. To accept servers on purpose (for example `amem`, `vmem` and `ares`), list their names in `jcode_mcp_allow` in `.agenthub/config.local.json` (machine-local, never read from the tracked config, never editable from settings; an instance's own `jcode_mcp_allow` or the inherited top-level list applies): the row then reads `ok` and names them as allowed by the person, any other extra server still fails and is named, and an unreadable file still fails. This changes only what `ahub doctor` accepts, not what jcode loads, and it matches by name only, so another server registered under an allowed name also passes (#1621).

Known ceiling (#559): jcode 0.98.1's top-level TUI spawns a shared server, without `--temporary-server` or `--owner-pid`, when nothing answers on the dialed socket at startup or on its reload-handoff reconnect, and no native flag prevents it. A hub stop or an owned-server crash between the launcher's confirm and the TUI's check can leave an unowned jcode server on the private socket under the person's `JCODE_HOME`; stop it by hand. Revisit if upstream adds an owner flag. An option that differs from the running session (`--model`, `--provider-profile`, `--session-id`) is refused by name.

TUI input may interleave with an ACP turn; there is no single-writer guard. Closing the TUI leaves the owned ACP session running, and native policy remains unmanaged. The isolated 0.98.1 transport receipt is [recorded separately](verification/2026-10-20-jcode-tui-0.98.1.md); it is not personal account or real provider verification.

After upgrading to the recipient-retry release, a Jcode project MCP entry written before `AGENTHUB_DELIVERY_ONLY` was added is intentionally stale. Once per project, the person runs `ahub jcode --mode headless` before using conductor/dashboard starts. The launcher rewrites only the owned entry with the delivery-only marker, preserving foreign entries and refusing collisions; recovery relaunches already use this CLI path. Readiness checks never rewrite the file, and an explicit false marker or any other drift remains refused. Until that rewrite, daemon starts keep their actionable stale-entry refusal rather than advertising a retry tool Jcode cannot use. `ahub jcode` and `ahub agy` compare the entry's `AGENTHUB_PROJECT_DIR` (and agy's `AGENTHUB_STATE_DIR`) by real path (#1423), so after a project directory is renamed with its old path left as a symlink, the hub's own entry is recognised and rewritten with the new paths. An entry for another project or peer, or a path that no longer resolves, is refused with the differing field: remove the `agent-hub-jcode` (or agy's `agent-hub`) key and run the command again.


Native policy is unmanaged and has NO hub sandbox; no permission_modes.jcode or runtime mode mapping is invented. Quota and consumption remain unknown. Supported versions run from 0.98.0 up to, not including, 1.1.0 (#529); another version is refused before the owned daemon starts, with the version named and the trust command (#691). Every owned jcode process (version probe, daemon, ACP and TUI) runs with `JCODE_NO_TELEMETRY=1`. Native session/load (verified on 0.94.0, 0.98.1, 0.99.1 and 1.0.3) cannot prove identity, so attached Jcode blocks controlled recovery before effects and crash recovery asks for deliberate native reopening. A requested load without an echoed identity refuses; no fresh session is presented as restored. Provider/tool/native teardown receipts remain unverified in the pinned contract report.

## Optional Antigravity (agy) peer

Antigravity is optional and off roster by default. Use `ahub roster add agy`, then run `ahub agy` in a terminal: it runs the Antigravity CLI as a fresh pull-only TUI in that terminal. It accepts the 1.4.x line plus exact 1.5.3: 1.4.2, 1.4.7, 1.4.12 and 1.5.3 are the verified versions ([1.4.7 receipt](verification/2026-10-26-agy-1.4.7.md), [1.4.12 launcher nonce receipt](verification/2026-11-03-agy-1.4.12-launcher-nonce.md), [1.5.3 account-free receipt](verification/2026-11-08-agy-1.5.3.md)), any other 1.4.x launches with a stderr warning (agy updates itself, so the launcher sets `AGY_CLI_DISABLE_AUTO_UPDATE=1` for its version probe and the TUI it starts, #1140, #1286), and other versions are refused (#589) unless the person trusts that exact version with `ahub agents trust agy <version>` (#691). The running hub must advertise `native_hook_launch`; an older hub refuses before any write with an upgrade-or-restart remedy. Only the person's launcher starts it: conductor starts are refused, there is no controlled restore or resume, and a declared agy extra instance is refused when the config loads (#625). Headless/print, resume (`--conversation`, `--continue`, `--new`), `--mode`, `--dangerously-skip-permissions` and `--unattended` are refused until their native mapping is verified; `--print-command` previews without writing.

The launcher writes exactly `plugin.json`, `mcp_config.json` and `hooks.json` in `.agents/plugins/agent-hub/`, refusing linked or foreign entries before any write, and removes only its own matching files when the TUI ends. It never writes project-level `.agents/hooks.json` or the person's `~/.gemini` settings. Run `ahub init` afterwards to ignore the untracked plugin directory; a tracked plugin is written with a warning. The native model sees the hub tools under the server name `agent-hub_agent-hub`.

Like Kimi's TUI, agy is pull-only: it reads `hub_inbox` and shares results with `hub_send`, messages do not interrupt it, and automatic routing never picks it. Its roles are capped at implementer and verifier; a plan or review assignment and PII work are refused. Native permissions are unmanaged, with no hub sandbox, hub permission mode, quota source or session resume. Plugin hooks bound to that launch carry the hub's turn facts and report each completed native turn. When messages wait at a model boundary (`SessionStart`, `PreInvocation`), the hook adds one count-only line asking it to call `hub_inbox`, never a body or sender (#1280). A native read is recorded as a peer `Read` fact: `view_file` (`AbsolutePath`) in 1.4.2 and `read_file` (`Path`) in 1.4.3; a `StartLine`/`EndLine` range counts as a partial read, never a whole-file view (#555). The live TUI/account leg is unverified ([T0 receipt](verification/2026-10-19-agy-p1-t0.md)). The 1.4.3 T0 re-run keeps 1.4.3 unverified: its `call_mcp_tool` schema and native tool names changed, and the TUI attaches the hub tools only from the second model turn ([1.4.3 receipt](verification/2026-10-21-agy-1.4.3-t0.md), #607).

## Configured ACP adapters (#451 A3)

A tool that speaks standard ACP over stdio can join a project without a code change. The declaration is machine-local authority: put it only in an untracked `.agenthub/config.local.json` (in `config.json` or a tracked file it is ignored with a notice), then restart the hub. The hub compiles its adapter catalog once at startup, so adding, changing or removing a declaration needs a restart; settings list the change as pending restart and never edit `adapters`.

    {
      "adapters": {
        "myagent": {
          "transport": "acp",
          "command": "/opt/myagent/bin/myagent",
          "args": ["acp"],
          "displayName": "My Agent",
          "roles": ["implementer", "verifier"],
          "identity": { "name": "<initialize agentInfo.name>", "version": "<agentInfo.version>" },
          "permission": { "ask": "<native mode id>", "ask-when-needed": "<native mode id>", "never-ask": "<native mode id>" },
          "readOnly": "<native read-only mode id>"
        }
      }
    }

- The kind matches `[a-z][a-z0-9-]`, has at most 32 characters, and may not collide with a builtin peer, an `ahub` command or a reserved id. A project can declare at most 64 kinds. Unknown fields refuse the config.
- `roles` is a non-empty subset of `planner`, `implementer`, `verifier` and `reviewer`. `conductor` is refused here; only explicit project role policy can appoint one.
- `identity` is the name and version that ACP `initialize` reports. A start without it, or with a mismatch, refuses before any prompt.
- `args` may not select a leader, attach, connect or remote mode (`--leader*`, `--attach*`, `--connect*`, `--remote*`): only a foreground process the hub owns is supported. A Grok declaration (kind `grok`, a `grok` executable or identity name `grok`) must also pass a standalone `--no-leader` before any `--`. Grok 1.0.62 itself is not supported ([T0 receipt](verification/2026-10-21-grok-config-acp-t0.md)).
- `permission` maps hub modes to native ACP mode ids. Only mapped modes can be selected, and the session must advertise and acknowledge each one. Without a map (or with an empty one) native policy is unmanaged: `ahub permission <kind> <mode>` and `permission_modes.<kind>` are refused. No hub sandbox applies either way.
- `readOnly` names the native mode that read-only instances use (below). It is not applied to the kind itself.

    ahub roster add myagent          # configured kinds are off roster by default
    ahub myagent                     # headless; asks the running hub to start it
    ahub myagent --session-id <id>   # load a recorded native session; the agent must echo the id
    ahub myagent --print-command     # preview: executable, argv and session id are withheld
    ahub stop myagent

`ahub <kind>` accepts only `--mode headless`, `--as <instance>`, `--session-id <id>` and one of `--print-command`/`--dry-run`; model, route, unattended and other launch overrides are refused. The running hub must advertise `configured_acp` and list the kind as loaded; otherwise the command tells you to upgrade or restart. If the file changed since the hub started, the start warns and uses the running definition. A conductor may start the kind with `hub_peer_start` (headless, with no session override). There is no TUI form: `peers.<kind>.start_mode` accepts only `headless`, and `ahub watch` is not available. Default routing never picks a configured kind; it gets work through its roles, an explicit owner or reviewer, or a reservation.

Before admission the hub verifies the native identity, a valid session id, the requested native mode and positive ownership of the spawned process and its process group. A failure refuses the start with a generic reason; the agent's stderr and error text are withheld from the log. `ahub stop` signals only that original verified group. If teardown cannot be confirmed, the peer stays offline but held, and new starts are refused until `ahub stop <kind>` succeeds.

Extra instances use the existing `instances` block. For example, `"myagent-review": { "kind": "myagent", "roles": ["reviewer"], "readOnly": true }` is started with `ahub myagent --as myagent-review`. Unlike the kind, a declared instance is on the roster by default. `readOnly: true` requires the kind's `readOnly` mode, and the session must advertise and acknowledge that mode before a prompt. Native permission requests other than read, search and think are rejected. The instance is offered only `hub_send`, `hub_inbox`, `hub_delivery_done`, `hub_review`, `hub_task_show`, `hub_task_list`, `hub_memory_search|show|graph` and `hub_status`; the hub refuses every other hub tool. Its permission mode is locked: settings show it as read-only, no write, undo or `ahub permission` changes it, and `permission_mode` next to `readOnly` is refused.

Configured kinds are cloud peers and never receive PII work. Quota and context are unknown, and a kind with no budget source is exempt from quota accounting, so pause it by hand if its provider refuses. After a crash the hub resumes a recorded session through `session/load` only when the agent echoes the same id, and it never reuses a recorded model. Controlled recovery (`ahub upgrade`, `restart`, `recovery`) refuses a running configured kind: stop it, then start it again with its session id. While the project declares adapters, the upgrade or restart target must advertise `configured_acp`.

## External adapter modules (#451 A4)

A bundled adapter module is authorized by the person with `adapter_modules` (at most 16 rows of `path` and `sha256`) in an untracked `.agenthub/config.local.json`; in `config.json` or a tracked file it is ignored with a notice, and settings never edit it. Only daemon startup imports a module: settings, reload, previews and CLI reads never do, so a change needs a restart. The module must be a single self-contained ESM file inside the project (no symlinked, world-writable or oversized file) whose bytes match the pin, and it may import only Node/Bun builtins and `@staix/agent-hub/adapter`; the scanner also refuses any `require`, `eval` or `Function` word token. Each import must settle within 2 s. A module that fails any check is refused on its own, with a bounded reason in the status reply, while startup and the other adapters continue; its roster row stays inert. A loaded kind is headless, cloud (never PII), off roster until `ahub roster add <kind>`, and has no controlled recovery: stop it and start it again with its recorded session id. While modules are declared, the upgrade or restart source and target must advertise `external_adapter_modules`. Extra `instances` of a module kind (#754) exist only when the module opts in with `headlessInstances` (headless; implementer, verifier or continuing reviewer) and the person declares them in `config.local.json`; each needs its own worktree, is bound to what startup verified, and needs `external_adapter_instances` on both sides of a restart or upgrade ([security](security.md)). Bundling, the accepted definition subset and the conformance kit (`@staix/agent-hub/conformance`, for module CI only) are in [Adding an AI tool](adding-an-ai-tool.md#5-external-adapter-modules-451-a4). A pin authorizes code that runs with the daemon's rights; it is not a sandbox ([security](security.md)).

# Headless ACP watch (#286)

- A person opens `ahub watch kimi` or `ahub watch qwen` in a second terminal. `--no-thoughts` hides thought items; `--color=auto|always|never` controls colour. `q` or Ctrl+C leaves the view, keeping the peer running. Answer approvals in `ahub console` or with `ahub permit`.
- Watch replays bounded memory history from this daemon, then displays live updates. It is the hub's read-only view, with no prompt input. It does not read native session files.
- Kimi's default is its own pull-only TUI (#316). Watch requires `ahub kimi --mode headless`; its own TUI remains visible in its native terminal. Qwen requires roster participation and a receipt-verified ACP identity. Watch is for headless Qwen; `ahub qwen --mode tui` is Qwen's own terminal (see Optional Qwen Code peer) and has no watch view.
- Protocol stays 16; a same-protocol older daemon answers the new request as unknown, which the CLI reports. Since 0.12.44 a headless start that the hub itself makes for Kimi or Qwen opens this view automatically through the terminal provider (see Start modes; #286).
- Native T0 limits: [ACP watch verification](verification/2026-10-11-acp-watch-t0.md).

# Acceptance-criteria checklist (#481)

- The task reviewer/person records a head-bound `criteria` receipt with criterion ids matching the issue's AC ids, required/result fields and hashed evidence refs. This checklist belongs to the Compliance review pass. Use `ahub sdlc record <id> '<receipt JSON>'`; [schema and example](sdlc.md#acceptance-criteria-checklist).
- Deliverables (#509a, docs/sdlc.md, Deliverable records): `hub_task_done` and `hub_sdlc_record` take `deliverables: [{path, format, version?}]`; the hub hashes the files itself (a claimed hash is refused), in a plain folder with no git or PR, under the owner's execution root (its own worktree for a declared worktree instance; an unproven root refuses and reads `unknown`), and a reviewer's approval is refused with `deliverable changed since it was delivered` when a file changed since delivery (the owner calls `hub_task_done` again, or the person approves the current bytes). `ahub task show <id>` shows each file's state (`unchanged`, `changed`, `missing`, `unknown`) and `changedSinceReview`; a PII task or `pii.paths` file shows id, hash and size only. The person lists every task's delivered and approved files with `ahub deliverables [--task <id>] [--approved] [--check] [--json]`: without `--check` it reads the board's records and opens no file; `--check` measures them now and marks a row `changed since review`, `a file is missing` or `could not be measured`. The dashboard card shows a `Deliverables n` chip and the task sheet a Deliverables group from the same records; it shows a change only after a live check. An agent's shell gets only the tasks `hub_task_show` would show it (#933).
- The review request lists the recorded criteria with their ids and results, and a `hub_review` unmet item that starts with a recorded id (`AC2: ...`) is recorded on the verdict as `unmetCriteria` (#507b); `ahub task show` lists those ids in the history. A task with no checklist, and a PII task, are unchanged.
- Advise shows incomplete/stale checklist blockers; enforce checks them at approval. The `criteria` gate does not need a workflow selector. Dependencies stay with `ahub task propose --after`; checklist task import is removed.
- `status <id>`, `explain <id>` and `export <id>` use the same current board/config projection. Export keeps sanitized state and source hashes, with no external text, extra authority or verification claim.
- Migration from the retired workflow and its compatibility window (until hub 0.13.0) are described in [Retired workflow compatibility](sdlc.md#retired-workflow-compatibility-252-481-s8). Stored checklist task lists are ignored with a visible note; they never change board dependencies.

# Catalog session guidance (#295)

- Read available guidance with `ahub role list [--group dev|research|writing|ops]` and `ahub role show <id>`. Each definition identifies its layer and content hash. Doctor reports invalid files/selections without printing their contents.
- Select up to two ids per peer in `catalog_roles` in the shared/local config, with at least one flow base already held by that peer. Empty local lists clear shared selections. This initial slice applies selections at a new daemon/MCP/adapter start; live assignment/settings and task roles follow separately.
- Defaults preserve the existing flow. Catalog guidance adds no authority or routing preference. Native ingestion/retention and measured benefit remain unverified. Schema, bounds and source notice: [roles](roles.md).

# Project profiles (#259)

- Initialize new projects with `ahub init --profile research|writing|general`; default dev retains its existing templates and contracts. Profile aliases map to the existing base flow and are displayed beside it. `--profile <pack>` applies a domain pack (`.agenthub/roles/<name>.pack.json` or a shipped one: `writing-pack`, `analysis`, `ops`) as review-checklist and example-check overrides; `--dry-run` previews ids only, and a pack is data, never a command ([domain packs](profiles.md#domain-packs-513a), #513a).
- Non-dev plans declare paths, section anchors, source ids and claims. Configure completion checks explicitly in machine-local config; selecting a profile never starts a check or study. Schema, examples and pending converter/policy slices: [profiles](profiles.md).

# Private and read-only data paths (#259)

- Optional pii.paths forces matching declared refs/plans/section files to the on-prem flow before triage and memory, including when ordinary pattern routing is off. Optional data.readonly protects managed local/Pi writes and makes managed commands filesystem read-only.
- Both lists are empty by default and apply at daemon start. Reads/stdout remain available; command-created files/caches are blocked in read-only mode. Exact path rules, alias handling and evidence: [data policy](data-policy.md).

# Rich-document text projections (#259)

- Configure text_projection only in an untracked machine-local file, with a separate {input} argv argument. Facts uses bounded read-only/no-network conversion from a scratch directory, where the converter reads only its input snapshot and its own program and script files (no other project file, even under `local.read_allow`), and a content/config cache; failure keeps the prior file view and logs a bounded notice, and a conversion that failed with its full deadline is not retried for the same bytes and command while its entry lives in the failure record, which is in memory, bounded at 1024 entries, and cleared when full or at restart (#382).
- Raw change identity and projected presentation stay separate; private paths never enter conversion. Schema, limits and current surface scope: [text projections](text-projection.md).

# Task catalog guidance (#295)

- A proposal may name `role` from `ahub role list`. The allowed class list is checked in Tasks, and assignment/review notices carry bounded guidance. The role grants no authority and changes no routing decision. Scope and pending person-assignment surfaces: [roles](roles.md).

# Person catalog-role assignment (#295)

- Use `ahub role assign <peer> <id>` or `ahub role clear <peer> [<id>]`, or the dashboard Roles settings group. The selection is bounded to two compatible catalog ids, writes only machine-local settings and applies at the next peer start. Inherit and explicit no roles are distinct.
- Change an open task's guidance with `ahub task role <id> <role|none>`. Agent shells and peer/tools control clients cannot use `role assign|clear`; an agent may run `task role` on a task it owns while it is not in review, and a child, read-only or private-context connection is refused (#933). Details and unconfirmed native consumption: [roles](roles.md).

# Document projection review and undo

- Machine-local text_projection also supplies bounded review and reverse undo previews from stored raw snapshots. Task-proposal baselines survive restart and reviewer changes; missing/private/pruned evidence is unavailable. See [text projections](text-projection.md) for caps and converter requirements.
- Undo remains a raw-file operation: projected text cannot bypass later-edit, concurrency or unknown-turn refusals. Native model/account ingestion remains unverified.

# Opt-in shadow repository

- `ahub init --profile research|writing|general --shadow [--dry-run --json]` supplies hub-owned snapshot/facts/undo storage for a non-git folder. It creates no `.git` entry and never switches an existing Git project.
- Maintain `.agenthub/ignore` for large/raw data. Snapshot and facts operations leave the shadow index/HEAD alone; raw undo refusal rules remain authoritative. Shadow metadata stays protected from managed worker writes. See [profiles](profiles.md).

# Per-project profile data

- Use `profile_overrides` for class aliases, supported plan selection, role guidance, catalog defaults, managed AGENTS content and advisory example checks. Shared/local maps merge by key; selections/text replace. See [profiles](profiles.md).
- Refresh instructions with init and restart the daemon/MCP clients to apply their resolved contracts. Existing flow-role and executable-check authority remains in `roles`/trusted `checks`. Native model/account evidence remains unverified.


## Calendar schedules: `cron` and `tz` (#1017)

A `schedules` entry in `.agenthub/config.local.json` takes either `every` (an interval, `<n>m|h|d`, 15 minutes at least) or `cron`, never both. `cron` ties the run to the clock:

```json
{ "schedules": [{ "id": "digest", "cron": "30 7 * * 1-5", "tz": "Asia/Seoul", "class": "plan", "title": "Morning digest" }] }
```

- **The expression** is the standard five fields, minute, hour, day of month, month, day of week, with numbers, lists (`1,15`), ranges (`1-5`) and steps (`*/15`, `10-50/10`). Day of week 0 and 7 are Sunday. There are no seconds, no year, no `@daily` macros and no names (`MON`, `jan`). When both day fields are restricted a day matches if either does (the classic rule); a field that begins with `*` leaves the other to decide.
- **`tz`** is an IANA zone name (`Asia/Seoul`, `America/New_York`) and applies to `cron` only. Without it the machine's own zone is used. An unknown zone is refused with the entry named.
- **Daylight saving, one rule.** A local time the clock skips runs at the next valid minute of that day; a local time the clock repeats runs once, at its first occurrence.
- **Too frequent.** An expression that can fire more often than every 15 minutes (`* * * * *`, `*/5 * * * *`, `0,10 7 * * *`) is refused when the config loads, naming the schedule, as is one that never fires (`0 0 31 2 *`).
- **Everything else is as for `every`.** A schedule never runs at first sight; a hub that was down or held through several fire times proposes one task when it can, not one per missed fire; a budget pause or hold skips and counts the tick; no second task while the first is open. `ahub schedule list`, `ahub status` and the dashboard show the expression and the next run in the schedule's zone, for example `2026-11-02 07:30 Asia/Seoul`.
- **Upgrades.** The daemon advertises `calendar_schedules`. While a schedule uses `cron` or `tz`, a restart, upgrade or recovery onto a release without it is refused, naming the reason.
- Out of scope: holiday and exchange calendars. A task whose first step finds a non-working day can end itself.

## Registered sources and request drafts (#1144)

`ahub source add` registers a bounded file or URL snapshot, and `ahub source list` lists its `src:` registry ID. For profiles that support `plan.sources`, task proposal and acceptance validate each ID against this registry before changing the board or notifying peers. An unknown ID is refused with `ahub source list` as the next step. Source overlaps use the registry IDs; a private task's public plan remains withheld.

The dashboard's Plan sheet includes a read-only registered-source list with ID, kind, byte size, hash prefix and registration time. It receives only those allowlisted metadata fields through the existing snapshot, with no source content or origin paths.

Use Capture a request in the same sheet, or `ahub intake`, to stage natural-language work as held draft Backlog cards. Optional source IDs refer to the registered snapshots. The dashboard uses the same Tasks intake path and public task projection as the CLI; nothing is offered until a draft is approved. Inspect drafts in Backlog, then use `ahub intake approve` or `ahub intake discard` in a terminal. A delegated `--live-test` dashboard session cannot create intake drafts. If submission is unconfirmed, read Backlog before trying again to avoid a duplicate request.

## Staging work in Backlog (#263)

Use `ahub task propose implement "Later work" --backlog --owner codex` to stage
work without routing it. The owner is a reservation, including when an agent
names itself. Normal proposal behavior is unchanged without `--backlog`.

The person inspects `ahub board backlog` and `ahub task show <id>`, then runs
`ahub backlog pull <id>` to put it in To Do. Dependencies still block assignment.
Ready work uses the existing assignment and delivery-recovery contract; if no
peer can take it, a later attachment or restart can offer it. Return ownerless
To Do work with `ahub backlog return <id>`. Owned or started work cannot return.

Ordinary agent task lists and conductor task reads exclude Backlog. Staged work
is never claimed, accepted, completed, swept, escalated or relayed. PII cards and
notices use the existing public stub. Planner grooming, five-column views, releases and dates are described below.
The native planner/two-release smoke remains unverified; board release actions
never tag or publish software.


Pulling Backlog establishes its first execution-proposal boundary for projected
review snapshots and research records. An initial Backlog row is not an offered
proposal. Research uses the first pull time and preserves identity across later
unstarted return/pull cycles; a new backlogged id after reset starts a new record
generation. Partial work with acceptance/check/review evidence cannot return to
Backlog even after decline or reassignment leaves it ownerless.


## Dashboard project board (#263)

The board displays Backlog, To Do, In Progress, Review / QA and Done from task
states. To Do separates ready work from dependency, reservation, delivery-hold
and unavailable-owner waits. Review and Done offer no flow dragging. Owner and
reviewer names remain readable beside their filled/outlined color markers.
Urgent tasks display P0 and a star; ordinary legacy tasks display P2.

The legend reads the same live peer status as `ahub status`, with a derived
owned-work count, active board ids and explicit permission display. Use the agent
filter or By agent lanes to inspect work. Done shows recent rows first, with
older rows expandable. At phone width columns stack and controls remain usable.

Drag eligible work onto a peer to assign it, or use its labelled select and
Assign button. Drag Backlog into To Do to pull it; return only ownerless To Do
work to Backlog. Each move has a button/keyboard equivalent and reaches `Tasks`
through the existing authenticated console/dashboard action path. Cards carry
origin, project, instance and view-generation fences; stale or foreign drags
are refused. Review/verdict/approval transitions stay with their flow actors.

A hub advertises Backlog support explicitly. Older or unknown snapshots cannot
silently turn Add to Backlog into an immediate offer. PII cards retain their
public stub; legend entries contain ids/counts, never task prose. Planning priority/rank, releases, dates, planner grooming/undo and GitHub import
are described below. Native planner-cycle evidence remains unverified.


## Roadmap milestones (#1479 R1)

`ahub roadmap` (or `roadmap list`) reads board-backed milestones. `show <id>`
adds public links, task placement and computed progress. Reads print for a person;
`--json` returns the same public record. Unknown issue/spec evidence remains
unknown, and private task membership is a count without task ids or titles.

```sh
ahub roadmap new --title "Reliable releases" --outcome "Every release has verified delivery evidence" --horizon now
ahub roadmap link 1 issue owner/repo#42
ahub roadmap link 1 spec task-board
ahub roadmap show 1 --json
ahub roadmap edit 1 --revision 2 --target 2026-12-01
ahub roadmap order 1 10
ahub roadmap state 1 active
```

Use the revision actually returned by `show`; the numbers above are examples.
New/edit also accept `--order` and `--parent`; `--target none` or `--parent none`
clears that field. `unlink <id> <kind> <ref>` removes a link. The configured
planners, current unique conductor and the person may edit. Only the person
records `state <id> done|dropped`, in a terminal or through an instructed managed Claude session whose confirmed prompt names the milestone id literally (see instructed mode above), and that history entry records `instructed`, `instructedPeer` and `instructionReceipt`; live-test delegation cannot write milestone
content. Terminal milestones are final.

Explicit task links take precedence over issue inheritance across all milestones.
Otherwise GitHub-import `Task.external` or the canonical plan issue identity
places a task in its issue's milestone, labelled inherited from #N. Issue states
come from matching persisted plan-review metadata and include their cache time;
no GitHub lookup runs. Specs use the current complete spec graph; missing,
nonancestor or incomplete proof stays unknown. Trains keep their delivery rules.
Parent milestones are one-level organization, without automatic child membership.

A retained milestone requires a target advertising `roadmap` for controlled
recovery; its row/link digest is part of the recovery proof. Empty databases
retain the old format and integrity shape. R1 creates no GitHub milestone or issue,
model answer, export, dashboard view or console panel. See [the module contract](design/roadmap.md).

### Bottom-up placement (R3)

`ahub roadmap unplaced [--repo owner/name]` lists open issues, tasks and active or
draft specs with their placement reason. Private tasks are counted but not shown;
unavailable sources and capped or partial reads remain explicit, so an empty
list is not proof that everything is placed. `ahub roadmap triage [--repo]`
asks the configured planner or unique conductor's hub model for evidence-backed
suggestions. It stores suggestions without linking anything; `triage --list`
reads pending suggestions without a model call. The planner or conductor can
accept or reject each suggestion with `ahub roadmap accept|reject <id>`. Accept
creates a proposed milestone first when the suggestion names a new milestone,
then adds its link; no link is applied without acceptance.

The person can use `ahub roadmap import-github [--repo owner/name]` to preview
open GitHub milestones and their issue links. Add `--apply` to import them as
proposed milestones and link open issues. Imports are idempotent, partial reads
are marked, and nothing is written back to GitHub. See the [bottom-up placement
contract](design/roadmap.md#bottom-up-placement-r3).

### Decomposition (R2)

`ahub roadmap decompose <id>` asks the configured planner or unique conductor's
hub model how one milestone decomposes, reading only the milestone's public title
and outcome, the goal or architecture specs it links and the issues it links. Each
proposed part cites an id it was shown and says whether it needs its own spec
issue or goes straight to a task; an answer that cites nothing it was shown is
dropped whole. The kept parts are saved as one pending model answer per milestone,
so a second run supersedes the first. Proposing intakes, links and publishes nothing.
`ahub roadmap decompose <id> --accept <part>` holds one proposed part as a backlog
intake draft linked to the milestone, carrying its spec or task kind; nothing offers,
pulls or routes it until the person releases it with `ahub intake approve`, and
accepting the same part again returns the same draft. `ahub roadmap decompose <id> --publish` previews one GitHub issue per held `spec` part and writes nothing; `--apply --confirm <fingerprint>` creates them behind `roadmap.github_write` (the person, or the unique conductor when it is set to `conductor`) and links each to the milestone. A `task` part, a released draft and a private part get no issue. A second apply creates nothing, an overlapping apply is refused, and a failed `gh` call leaves the draft held with nothing linked. See the [decomposition contract](design/roadmap.md#decomposition-r2).

## Planning and phased releases (#263)

Use `ahub backlog list` to read public staged work (a table by rank with the reserved owner, dependencies and cut titles, then a count by reserved owner; `--full` and piped output keep whole titles and `--json` prints the raw listing), then `ahub backlog plan <id>
<revision> <fields-json> <reason>` to set rank, priority (0-3), release id, planned
start/due UTC milliseconds or pin. `pin` accepts true/false; `undo` needs the
current revision and latest eligible edit. The dashboard provides local-time
date fields, task/release filters and lanes, and Reload current values when an
edit is stale. A person's order, pins and frozen scopes protect planner changes.

Create a phase with `ahub release new <name> <goal> <order>`, inspect `list` or
`show`, and set planned start/cut/ship with `plan <name> <revision> <dates-json>`.
`activate`, `freeze`, `ship` and `drop` need its current revision. Only a person
freezes, ships, drops or edits frozen scope. Ship records the first ship time
only after every member is approved, cancelled or moved out; it runs no tag or publish.
The dashboard shows phase progress, blocking dependencies, dates and remaining
work. Actual task dates come from execution/review/approval history, never input.

Configured planners read `hub_backlog_list` and `hub_release_list`, edit the
cards they plan (see "The planner") with `hub_backlog_plan`, and undo their own latest eligible change with
`hub_backlog_undo`. Catalog guidance or a caller-supplied role grants no authority.
PII cards stay stubs, reasons are screened/withheld in public history, and planning
telemetry records ids/changed fields without prose. #247 task records carry
optional release, priority, plannedStart and due, retaining unknown legacy data.

Dependency/reservation planning, split/pull WIP limits, batched incoming notices
and one-way GitHub import are described below. Source checks are recorded in the
release verification report. Native planner work across two releases remains
unverified; source and fixture checks do not establish installed live behavior.

Office merge corrections retain the header's view selector when Off hides the
scene. Activating a card reveals its task if a state filter excluded it; Work
includes rework. Stable desk slots determine bounds after peers disconnect.
Reduced motion removes departures immediately and the existing snapshot poll
prunes transient deadlines without new timers. Explicit unattributed turns have
no guessed task bubble. Warning caps retain conflicts first and parallel warning
kinds have separate segments/labels. Physical visual validation remains pending.


Planner backlog plans also accept `deps` (at most 64 unique task ids) and
`reserved` (rostered peer id or null). Dependency/reservation edits require
unstarted, unowned backlog work even for the person; cycles and missing ids
are refused before persistence. Planning undo restores previous dependency and
reservation values at the same revision fence. Editing never routes work.


Release date editors invalidate stale revisions and offer Reload current release
without overwriting unsaved dates. Project changes clear release creation drafts.
Dashboard release actions use public numeric ids even when labels are withheld;
`ahub release show <name>` looks up the stored identity on the console and returns
the screened public projection. Exact-head source verification is recorded in the release report.


## Planner WIP pull (#263)

`hub_backlog_pull` takes id, current planning revision and a bounded reason. A
configured planner with assignment capability reserves a ready To Do slot using
current routing, roster, class, quota and health constraints. It refuses pins,
unapproved dependencies, frozen scope and overriding person P0 order/reservations.
The person uses `ahub backlog pull-ready <id> <revision> <reason>` or Pull within
WIP on a card. Explicit manual pull/assignment retain their existing authority.

A pull of a reserved backlog task (#718) assigns it to exactly that reserved peer
in the same write and sends it a fresh owner offer, so it can accept at once. A
reserved peer that cannot take it (offline, paused, excluded, at its WIP limit)
refuses the pull before any change, naming the peer and its reason; it is not
passed over to another peer. `ahub route explain` previews the same reserved-only
choice. An unreserved pull keeps reserving a slot as above. A refused pull
(#1430) names each owner refusal routing recorded (peer and reason, never task
text) beside the WIP or hold detail, and ends with the next step: reserve a
peer with `hub_backlog_plan` `fields.reserved` and pull again, or, when a
person's reservation is retained, ask the person to change it. A conductor's
`hub_task_assign` on a backlog card names the same route. A reserved offer that
was never started can return untouched. Omitting planning fields retains its
reservation, so `tasks.auto_pull` can offer it again as soon as the slot is free.

To park untouched work in one operation, the planner's
`hub_backlog_return_untouched` accepts optional `fields` containing only
`reserved` (a peer ID or `null`). For example:

```json
{"id":138,"revision":6,"reason":"wait for the person","fields":{"reserved":null}}
```

The return, reservation change, planning revision and previous reservation are
saved together before capacity notices or auto-pull run. Read the returned
`planningRevision` for a later planning change. Without `fields`, the planning
revision and reservation are retained. Reservation updates use the existing
person/planner, roster, exclusion and capability checks; a planner cannot clear
or replace a person's reservation. The ordinary `ahub backlog return` form keeps
its existing reservation-preserving behavior.

The CLI has the same two edits (#1177): `ahub backlog return <task> <revision>
<reason...> [--reserved <peer> | --unreserve]` sends `fields.reserved` as the peer
(`--reserved kimi` or `--reserved=kimi`) or `null` (`--unreserve`) with the
return, so the reservation moves or clears in the same operation and under the
same checks. The flags may stand anywhere among the reason's words and are not
part of the reason; at most one of them, and a malformed one is refused before
anything is sent. With neither flag the command sends exactly what it always
did and the reservation is kept.

Capacity defaults to one per peer. Each declared instance has its own `tasks.wip_limits.<instance>` key. `ahub settings set tasks.wip_limits.codex 2`
uses the existing machine-local registry path; integers 0..32 apply live (the next
admission reads the current value), with 0 disabling planner admission for that
peer. Status and the agent legend count
owned unfinished work plus unowned planner-pull reservations, and show how that
count splits (#784): `ahub status` prints `<peer> planner WIP 3/3 (active 2, review-wait 1, reserved 0)`,
the console Peers detail (Enter) has a `planner WIP` line, and the dashboard legend shows the same split.
`active` is owned work that is not waiting for review, `review-wait` is owned work in review (it still
holds its slot), `reserved` is a planner-pull reservation nobody owns yet; the three add up to the count
admission reads, and the split changes no admission decision. An older hub shows the plain count. The same limit gates
acceptance and self-claim in every lifecycle mode, so 0 refuses new acceptances; a
current owner's redo of sent-back work keeps its slot (#481 S9).

A refusal at the limit separates what the owner carries from what it was only offered (#1080):
`planner WIP capacity for codex: limit 2; open tasks #621, #624 (accepted #621; offered, not yet accepted #624); <next step>`.
An `urgent` task (priority 0, or the `urgent` signal) that is the owner's own offer may take back the
newest offers the owner has not accepted, only as many as it needs, when that is all that keeps it at the
limit. The hub returns each one ownerless to To Do (history `unassigned`, by the hub, naming the urgent
task; a planner-pulled offer also loses the reservation that counted toward the owner's WIP), withdraws its offer, and tells the planners and the console. After the displacement the hub checks that the owner is under its limit and refuses the accept with the cause and a next step if not. It never takes back accepted work,
another urgent offer, a person-pinned offer or an offer with work evidence, and a refusal changes nothing.

Pending unowned, unstarted pull can be undone at its latest owned revision via
`hub_backlog_undo` or the existing planning undo control, restoring its earlier
reservation. An ordinary return to Backlog also restores the pre-pull reservation unless a later explicit reservation edit superseded it. Normal release routing offers work only while that reserved peer
still has capacity; no other peer inherits its slot. Split and one-way import are described below. Native verification remains
outstanding; exact-head source checks are recorded separately.


Planned-date editors preserve loaded UTC milliseconds until their displayed
value changes, including repeated local wall times during a clock change. Local
inputs retain seconds/milliseconds and support HTML date years without truncating
fields; see https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#local-dates-and-times.
Date-editor source proof is recorded with the exact-head checks.


## Backlog split (#263)

Use `hub_backlog_split` with parent id/revision, reason and two to eight part
objects, or `ahub backlog split <id> <revision> <parts-json> <reason>`. Each part
has a title and optional detail/class/refs/plan; `after` names existing ids and
`afterParts` names earlier zero-based parts. The selected task's dashboard Split
form accepts one title per line and optional sequential dependencies.

The original card remains integration/acceptance work and waits for every part.
Children retain prerequisite, privacy and phase planning. A person's P0 order
permits that goal's required predecessors, preventing dependency deadlock.
Unused unchanged backlog children can be removed by latest split undo; later
edits, execution, ownership or outside references refuse it. All writes roll
back together and observers receive changes only after commit. Exact-head source checks are recorded separately; native verification remains
unverified.


The manager allows split screening, the bounded database wait and forwarding margin before declaring a missing reply unconfirmed. Reload the task before retrying an unconfirmed split. Stored role ids survive unavailable catalog guidance. Task memory-reference markers do not supersede assignment or check results, and dependency recovery ignores them.

## One-way GitHub intake (#263)

`ahub board import github --label <label> [--milestone <milestone>]
[--repo <owner/repo>]` is the person's or the configured conductor's (#933; the conductor is recorded as the actor). Omitted repo is resolved by gh in the
project directory. The command reads open issues with fixed bounded argv and
stages up to 32 into unoffered Backlog, retaining canonical repo/issue identity
across restarts. Repeating intake does not refresh or overwrite existing cards.

The response lists confirmed imported/existing task ids and explicit partial,
complete and unconfirmed state. A truncated page, time budget or interrupted
staging is incomplete; repeat safely to reconcile the persisted identity.
Public cards link to their source; PII cards expose no external identity.
GitHub comments/labels/assignment/closure are never written. Exact-head source checks are recorded separately. Native verification remains
unverified; no live account import was performed.


`ahub board --columns` groups the same state-derived columns and ready/waiting
reasons as the dashboard; `--release <name> | --release-id <id>` filters public rows on the hub.
`--columns --json` returns filtered tasks and column metadata together. Ordinary
peer reads retain the existing backlog prohibition. Phase views flag public ids
approved after a known cut outside that release, and separately list unknown
approval times without inventing dates. Exact-head source verification is recorded in the release report.
## Global attention and prompt output (#280, phase 3)

`ahub pet` reads the selected project's status file without a control token or
network connection. It accepts only structural counts/state/first metadata from
a confirmed daemon owner. Missing, malformed, legacy or unconfirmed data is
reported as unavailable; it is not an empty live hub. `ahub pet --short` writes
`ahub!N` when a known action count is positive, otherwise no bytes, including no
newline. Explicit `pet` reads remain available when the presentation is off;
normal `ahub status` appends the line only while the project's pet is enabled.

An open recovery lock is read without coordinating the operation. Only the
shared runner check's observed absence adds an action; unknown remains watch and
is labelled unknown. A matching daemon recovery watch is replaced once, without
double counting. A missing hub status is labelled unavailable even when a known
recovery action can be shown. The output never resumes, aborts or disposes a run.

Person-reviewed tasks contribute review actions; an offline peer holding
unfinished work contributes one watch item with its lowest task id. The console
receives those structural facts through its existing authenticated status reply.
Outside the Tasks table, `n` selects an exact visible review task, or prints the task/review guidance if
that row is unavailable. Offline guidance names status/task reads and an explicit
assignment command. No command is executed by navigation. There is no extra
console poll, timer or task-list request for stream mode.

Intentionally person-owned work is not an offline agent. Neither user nor hub
creates an offline watch item, while person-reviewed tasks remain actionable.
Status reads only the board's structural id/state/owner/reviewer projection and
reuses it for retained peer ids, avoiding task body/plan/history decoding.

Planner reservations normalize the same lowercase peer syntax as owner arguments,
reject reserved pseudo-peers and unknown unconfigured ids, and still enforce the
roster. Returning unstarted ownerless work to Backlog joins the next planner
notice batch without waiting for a restart.

Queued planner batches retain bounded ids-only backlog references and recheck
the board at actual delivery. A batch containing pulled/removed work is discarded
before reaching the planner; its remaining backlog ids join the next batch. This
floor also applies during the legacy stale-notice delivery experiment. No task
text is copied and no routing/ownership state changes.

## Console character choices (#280)

`pet.character` selects stai (default), gyul, lantern, cursor-cat or boxbot.
`pet.size` selects line (default), mini or full. Mini needs 100 columns; full also
needs 40 rows, and smaller terminals fall back automatically. `P` cycles the
built-ins and off for the current console only. `?` lists this under Pet, even
while drawing is off. The command prompt keeps its original row and width.

`pet.glyphs` selects auto/ascii/blocks; unsupported locales and dumb/linux
terminals retain the ASCII floor. `pet.blink:false` is static. Both `pet`
(`false` or an option block) and its fields validate identically at startup and
reload in `.agenthub/config.json` and `.agenthub/config.local.json`, apply live
as console-local presentation on an open console's next refresh, and grant no
authority (#483). Legacy `pet.palette` still validates blue, teal, violet or
ochre (`a`/`b`/`c`/`d`) for configuration compatibility, but has no rendering
effect after the window retirement. A legacy `pet.window` value is ignored with one notice; a
window-only local block preserves inherited `pet:false`. Neither
choosing nor drawing a character changes authority, config files, task state or
polling. Explicit `ahub pet` and text status use the configured line face; prompt
tokens remain character-independent. Native glyph width and tmux are unverified.

## Dashboard views and attention (#391, replaces the #280 in-page character)

Top buttons select Board, Office, Stream, Agents, Message, Memory, Settings or Roadmap
within the same page. The selected view and board column focus use the shared
host-scoped cookie helper; the URL fragment remains reserved for the session
ticket. Sections are hidden rather than fetched separately. Projects and
Benchmarks live under Agents alongside peers, approvals and usage budgets.
Office mode stays an explicit Off/Flat/Isometric preference inside Office.

Board cards show id/title, priority, owner dot and overdue/check markers.
Click or Enter opens a native detail dialog with the full stage/dependency,
release/date, SDLC, detail and GitHub content plus existing Pull/Return/Assign
controls. Snapshot changes refresh the dialog; project reset or a task leaving
the snapshot closes it. Expand on a column shows one wide list of full details;
Back returns to compact cards. State/agent/release filters still apply.

The shared pure needs model now drives the nav attention badge and existing
action-count tab title. Agents has a live pending-approval count even when
attention metadata is unavailable. Activation switches to the matching view
and focuses only the exact visible approval/task id; missing or filtered rows
receive fixed structural guidance, with no peer or first-row fallback. No
workflow action is issued and no filter is changed by attention navigation.
Invalid/legacy attention hides its badge and restores the base title.

The in-page pet, its SVG and character/pixel payload are removed. Floating pet
presentation belongs to acon Mini; the standalone macOS host is retired (#1012).
Existing snapshot poll, session,
request types and CSP hashes remain; no route, request or timer is added.
Browser screenshots/CSP-console verification are separate manual evidence on
the implementation PR; VM/HTTP fixtures do not establish human visual results.

With mini/full characters, active console notices remain visible away from the
character: panel body rows show the bounded wrapped notice, and stream mode
prints each fresh notice once through the existing local stream. Footer prose
exclusion and fixed prompt/footer geometry remain. No new request or timer.

Automatic reroutes of planner-pulled work retain WIP and delivery-hold admission
during offline, budget, roster and idle recovery. Explicit manual assignments
retain their existing override authority.


GitHub intake refuses comma-containing labels rather than allowing gh to split
one literal label into several filters. WIP capacity excludes owner candidates
only; eligible reviewers retain normal review routing. An auto-reassigning
planner idle sweep waits without consuming its final step while no owner has
capacity. Parent-only memory notes do not prevent unused child undo; child
reference markers remain protected. Split-part plan schemas follow the selected
project profile. Terminal tables preserve the visible read for stages and use
a fresh peer status read on the same authenticated connection.

Integer WIP editors save a value, including zero and inheritance; it applies at the next admission. GitHub intake accepts dot-prefixed repository names within the existing bounded owner/repository identity. Split undo also refuses children referenced by another task's persisted phase checklist.

Declining rework returns changes_requested to To Do before rerouting. When a planner-pulled task has no eligible destination capacity, it remains ownerless in To Do and is retried after capacity clears, preserving the declined-owner exclusion. A planner pull that finds no owner names the cause by peer id: a lasting exclusion, WIP full (with wip/limit), a held queue or needs_review deliveries; a capacity-only decline is not an exclusion (#531).

With no release cut, outside approved tasks are reported under unknown cut evidence, including tasks with a known approval time. A child task execution budget also prevents split undo until the person disables that budget.

Split children retain their initial deterministic and inherited privacy signals across awaited screening. A routing-pattern reload cannot remove those captured signals from an unscreened child at final validation.

If a routing pattern adds deterministic privacy during screening, split history and telemetry use regex-private provenance rather than an earlier clear model result. The same captured final signals determine both the child and its provenance.

Dashboard backlog splits receive a dedicated outer HTTP request bound above manager forwarding, using the shared screening/database bounds and margin. Ordinary action policy remains unchanged. At phone widths, split form grids use one column so native date controls remain inside their panels.

An acknowledged ACP permission-mode change awaits queued cancellation cleanup only when the cancelled prompt response has already been observed. A still-unreported cancelled prompt stays busy under its existing deadline, while mode acknowledgements remain available. A successful mode acknowledgement alone does not prove the peer is idle.

Task idle sweeps ignore body-free memory-reference bookkeeping when finding the last real activity. Saving a task note or goal link does not postpone an idle notice or restart its escalation ladder.

Split reasons preserve deterministic privacy from both initial and final policy checks, including parent privacy. Once withheld, a reason stays withheld in public history even if routing patterns are later removed.

GitHub import rejects labels containing commas or double quotes before invoking gh, since its CSV-style label parser could otherwise select a different literal label.

Ask evidence skips body-free memory-reference markers when selecting the latest task transition and note. The selected note retains the existing withheld and on-campus privacy checks.

GitHub intake checks its staging deadline after every awaited proposal, including the final issue. A confirmed late save returns its task ID with partial=true and complete=false so the operator can read back and resume.

If GitHub intake saves a row but later bookkeeping fails, canonical identity readback preserves the confirmed ID and queues its Backlog notice. The response remains partial; unreadable or missing readback remains unconfirmed.

A later issue lookup or profile-preparation failure also returns the IDs confirmed earlier in the import as partial progress.

Release cut audits return exact counts with at most 32 example IDs per category; the dashboard states how many IDs are shown when truncated. Scope grouping and indexed approval dates avoid scanning each task history for every release. Full audit pagination remains a future extension.

Release cards include task states in their refresh key, so completion of an outside prerequisite updates blocked counts even when the release and audit preview are unchanged.

## Floating pet in acon Mini (#1012)

Run `acon ui` and open Mini for the floating pet. The former
`ahub pet --window [--close]` command prints that pointer and exits successfully
from a person terminal, an agent shell or `--live-test`. It starts no window,
host, JXA process or network connection. The console's `o` shortcut and automatic
window startup from `ahub up` are retired.

The terminal pet remains available through `ahub pet`, `ahub pet --short` and
the console's line/mini/full frames. `ahub pet --palette <blue|teal|violet|ochre>`
is also retired: it validates the argument, prints the same Mini pointer and
writes no configuration. Existing `pet.window` settings are ignored with one notice;
remove the obsolete key when updating configuration.

The composer already lives in the agent-hub console plugin's **Console message**
view (#935), available through `acon ui`. It sends through the existing plugin
`send` action and retains that action's audience and authority checks.

## Additional headless peer instances

Per-turn Claude print children and local/Pi sandbox commands may receive `AGENTHUB_TASK_ID` and `AGENTHUB_TRIGGER` (`assign`, `review`, `message`, `manual` or `schedule`) when the host has an unambiguous attribution. `AGENTHUB_ATTEMPT_ID` is reserved for a host-known research attempt (`ra-` plus 12 lowercase hex digits); the current dispatch has no persisted attempt link, so it is normally absent. A private task ID is omitted for cloud children. These are hints only, not authority; absent values are unset, inherited values cannot override them, and long-lived sessions retain their existing environment.

Declare extra instances only in an untracked `.agenthub/config.local.json`, then
restart the hub. For example, a reviewer can use:

```json
{
  "instances": {
    "codex-review": { "kind": "codex", "roles": ["reviewer"] },
    "kimi-review": { "kind": "kimi", "roles": ["reviewer"] }
  }
}
```

Start them with `ahub codex --as codex-review` and
`ahub kimi --as kimi-review`. Codex keeps its native TUI and its own hub-owned
app-server proxy; extra Kimi, Qwen, Jcode, Pi and local instances use headless starts.

An extra instance of any kind that holds the `implementer` role needs its own
registered worktree on an attached branch, at exactly `.worktrees/<id>`
(`"worktree": ".worktrees/<id>"`). Configuration validation refuses a missing one
only for Claude channel instances and headless writers. For other kinds, Codex and
Jcode included, the hub accepts the declaration at startup and then refuses the start
with `an extra implementer requires an explicit managed worktree`. Create and
register the worktree before the start; the hub never creates it.

Extra Jcode instances are supported (#685), in `.agenthub/config.local.json` only:

```json
{
  "instances": {
    "jcode-claude": { "kind": "jcode", "roles": ["verifier"], "jcode_home": "/Users/you/.agenthub/jcode/claude",
                      "provider": "claude", "model": "claude-sonnet-5-5" },
    "jcode-local":  { "kind": "jcode", "roles": ["verifier"], "jcode_home": "/Users/you/.agenthub/jcode/local",
                      "provider_profile": "onprem" }
  }
}
```

`jcode_home` is required, absolute, and must differ from the base `jcode_home`, from
every other instance's and from any directory inside or around them, however it is
spelled: a symlink, a system alias such as `/tmp` and `/private/tmp`, or a case-only
alias is the same home (the hub refuses the configuration at startup otherwise). At most 8 Jcode instances are accepted per
project. `provider`, `model` and `provider_profile` are optional and passed to Jcode
as `-p`, `--model` and `--provider-profile` exactly as written; any other field is
refused, and these fields are never editable from settings.

You authenticate inside Jcode, never in the hub. Run Jcode's own setup against each
home (provider login, API key, an OpenAI-compatible base URL such as the on-prem
gateway, a provider profile), and initialize that home's MCP store with Jcode's own
client, as for the base peer. The hub never reads, writes, copies or injects a model
credential, a key, a token or a provider URL, and never creates the home. Its only
start preflight is read-only: the home must exist as a directory you own, otherwise
the start is refused and nothing runs. A Jcode sign-in failure appears as the start
or turn error, with bounded text. An instance reports tokens only if Jcode itself
does; until then they show `unknown`, never 0.

Each instance owns its private `jcode serve` and `jcode acp` pair, socket, roster row
and launch record, and acts as its own peer id (for example `jcode-local`), never as
`jcode`. Start it with `ahub jcode --as jcode-local` (headless; an instance has no
TUI) and stop it with `ahub stop jcode-local`: the base Jcode and every other instance
keep running. An extra implementer needs the same managed worktree as every extra
implementer (`worktree: ".worktrees/jcode-local"`). Every instance is a cloud peer
(`trust.onPrem` is false), whatever provider you configured: it never receives PII
work. `ahub status` and the dashboard show the provider, model and profile as
declared, and `ahub doctor` lists the MCP servers each rostered instance's home would
load.

Upgrade note (task 368): the project's `.jcode/mcp.json` entry for Jcode no longer names
`AGENTHUB_PEER_ID`, because the file is shared by every Jcode in the project and Jcode
gives an entry's own env precedence over the process env. Each hub-started Jcode now
supplies its own peer id and a launch id, and the hub admits a hub-tools connection
for Jcode only with the launch id of that peer's current owned launch. After
upgrading, `ahub status` and `ahub doctor` report the Jcode MCP entry as not ready
once (`jcodeMcpReady` is false for the old entry): run `ahub jcode` once and it
rewrites its own entry, or follow the remedy text the start refusal shows. A Jcode you
run yourself in this project outside the hub has no peer id: its hub tools refuse
every call with that reason and never default to `jcode`, and a process that only
sets `AGENTHUB_PEER_ID` without an owned launch is refused by the hub.

An extra Claude instance is one you start yourself: declare it with `roles` (for example
`"claude-review": { "kind": "claude", "roles": ["reviewer"] }`) and run `ahub claude --as claude-review` in a
terminal. It keeps its own `claude-*.claude-review.json` state files. A planner or reviewer instance reads the
project checkout and refuses `worktree`. From #525-1 an `implementer` or `verifier` instance is accepted and
requires its own `worktree` (for example `"claude-impl": { "kind": "claude", "roles": ["implementer"],
"worktree": ".worktrees/claude-impl" }`). `ahub claude --as claude-impl` validates that registered branch worktree and starts Claude there while keeping its canonical hub connection. Its private launch record stores the execution root. The channel reports its own canonical cwd (verified model-free with Claude 2.1.309); the daemon grants owner isolation only when that root, the current launch id, the recorded root and its own worktree validation all agree. Missing, legacy or mismatched evidence still permits a channel attachment, but write-owner routing is refused with `owner admission: declared write owner requires a verified isolated execution root`. Status renders the last verified binding from memory, without workspace-Git revalidation; this display is not permission or owner-admission authority. Detach or replacement claims invalidate the binding. A launch-record or filesystem/branch change is checked at the next routing admission, facts permission reply or recovery owner proof, which revokes a mismatch before effects. Facts and permission grants use the verified execution root; an unverified implementer gets no automatic grant. Recovery records retain that execution root, checked against the current declaration, separately from the Orca grouping root. This is same-user launch evidence, not kernel filesystem isolation. A Claude instance holding only planner or reviewer roles still uses the canonical checkout. A headless Claude reviewer retains its reviewer-only declaration. A headless implementer is available with the separate declaration below (#525-4).

A headless Claude implementer (#525-4) is declared separately:

```json
"claude-impl": { "kind": "claude", "roles": ["implementer"], "start_mode": "headless", "worktree": ".worktrees/claude-impl", "permission_mode": "ask" }
```

A headless Claude implementer may name its model (#844): `"model": "claude-sonnet-5-5"` on its declaration passes `--model <value>` on every native turn, resumed ones included. It is one bounded word (letters, digits and `._:/@+-`, up to 128 bytes, no spaces and no leading dash) and is accepted only on a headless implementer, only from the untracked `config.local.json`. A tracked-file declaration is ignored with a reason, and the key is tier 3: the dashboard and a settings session cannot read or change it, only the console or your editor. Unset, the argv is unchanged and Claude uses its own default. `ahub status` shows the model on the instance row as `model source`. Declarations are captured once when the hub daemon starts, so a changed or newly added `model` takes effect after a hub daemon restart (`ahub restart`); restarting only the instance keeps the old model. For a person-owned next-turn override without changing that configuration path, use [live peer model overrides](#live-peer-model-overrides-1317).

Create and register the attached-branch worktree first; the hub never creates it implicitly. `ahub claude --as claude-impl` asks the hub to start the instance and returns. Idle holds no native child. Task deliveries use a persisted UUID per task: first `--session-id`, later `--resume`. Unscoped chat reuses a session only when exactly one task is in progress for the instance; otherwise it is ephemeral. Positive missing-transcript evidence starts fresh with a notice; unknown read evidence retains the id. Reset includes the per-peer session map. A child inbox read refuses a queued batch attributed to another task and leaves it queued for that task's own session.

Both permission modes use native `default`, managed settings/hooks and the instance's strict tools-mode MCP binding. `ask` routes writes and shell calls to the person's approval. `ask-when-needed` may explicitly allow safe project file tools through the facts hook in the execution root. For Bash, #845 also permits proven read-only commands and the closed task command forms below, through a host-owned execution wrapper. Protected configuration, paths outside that worktree and unproven shell commands still ask. There is no `acceptEdits` or `never-ask` bypass. A failed hook decides nothing and may be followed by a valid person allow. Prompt failure, timeout, disconnect and a stale child binding never grant permission. Approvals use the existing console and `approvals.timeout_s`; no answer returns deny. A stop holds uncertain delivery until the owned process group is confirmed gone; a failed cleanup keeps the peer busy.

Under #845, automatic Bash grants require a current public task and the instance's registered worktree. The exact task forms are `scripts/check.sh --changed`, `bun run build`, `bun test <explicit test/*.test.ts paths>`, `git add <named paths>`, `git commit -m <message>`, `git push origin <bound branch>` or `git push -u origin <bound branch>`, and `gh pr view|checks <bound branch>`. `gh pr create` requires `--base <default> --head <bound branch> --title <title>` and exactly one `--body <text>` or `--body-file <relative path>`. Operators, expansion, extra flags, force/refspec/delete pushes, another remote/branch, background execution or a model-supplied cwd ask. Enabled publish/destroy/install/external-write policy classes still ask. Unknown default-branch evidence also asks.

The task's `refs.branch` is authoritative. Otherwise the first eligible task-command request records the current non-default/non-main/master attached branch through `Tasks`, provided no other open task uses it. A host history entry binds the worktree too; restarting preserves it, and a changed branch or root asks rather than rebinding. Each automatic allow contains only the fixed wrapper and one short-lived single-use ticket. The host rechecks the task, child, root, branch and command proof before executing with its fixed environment and absolute executable; native shell cwd/PATH/config variables do not carry over. Unknown, expired, reused or stale tickets run nothing. Read-only and executable code commands (check/test/build) use the existing local-worker Seatbelt profile: writes only in the worktree and own temp, with all project Git metadata read-only, credential/hub-state denial and the configured network policy. These commands ask if macOS sandbox-exec is unavailable. Only closed host Git add/commit/push and gh operations run outside that profile. Push execution pins both source and destination as refs/heads/<bound>:refs/heads/<bound>; configured remote.origin.push/mirror asks. PATH excludes project/worktree directories, gh child Git uses the core hardening config, and body-file uploads use bounded screened snapshots. An older plugin without the wrapper protocol keeps person approval. [The native context receipt](verification/2026-10-26-headless-claude-shell-context.md) records which native legs have actually been observed.

Check/test/build cannot write the project Git common/current directory at all, including objects, HEAD/index, refs/logs, other worktrees and either submodule tree. Closed host add/commit reuse core Git hardening, ask with configured filters/external drivers/textconv, and force signing/automatic maintenance off. A global Git LFS installation does not disable push/gh grants; only add/commit keep person approval so LFS conversions are not silently bypassed. Automatic push still does not run pre-push hooks. Config includes and partial clones refuse privileged Git/gh. Their command/paths/current task/branch are re-proved before execution. The host pins the default branch from the remote at startup, using a bounded isolated-config Git symref probe against the captured GitHub repository. Local origin/HEAD changes cannot redefine it. No credentials are supplied to that probe; unavailable/private-remote evidence or an unsupported Git layout asks. local.bash_network "direct" gives code direct network access. A setsid-detached code child can outlive owned-group cleanup while retaining its sandbox and permitted worktree writes.

Default-branch capture runs only at daemon startup when a Claude implementer is declared. If the first implementer is added through config reload, automatic task-command grants remain unavailable and those commands ask. Restart the daemon with that implementer declared to capture the remote default branch. Reload does not retry a failed startup probe or refresh the captured default branch.

Project Git retains the core policy that clears credential.helper and core.askpass; an HTTPS push needing those helpers may fail, rather than importing credentials or relaxing that policy. Task branch/config proof reads are bounded synchronous reads (1.5 seconds per reader); slow or unknown evidence asks. The existing sandbox profile discovery is also synchronous; moving it to an asynchronous inventory proof with a shared deadline remains a follow-up. The nonce is visible in a permission response, so it proves a bounded grant rather than native-dispatch provenance.

The [native permission receipt](verification/2026-10-23-headless-claude-permissions.md) covers Claude Code 2.1.309, and the [2.1.310 receipt](verification/2026-10-26-claude-implementer-2.1.310.md) repeats it on 2.1.310 (with 2.1.309 as a control), and the [2.1.314 receipt](verification/2026-10-31-claude-implementer-2.1.314.md) repeats it and the host-wrapper procedure on 2.1.314 (with 2.1.310 as a control), and the [2.1.316 receipt](verification/2026-10-31-claude-implementer-2.1.316.md) repeats both on 2.1.316 (with 2.1.314 as a control), and the [2.1.318 receipt](verification/2026-11-05-claude-implementer-2.1.318.md) repeats both on 2.1.318 (with 2.1.316 as a control), and the [2.1.319 receipt](verification/2026-11-06-claude-implementer-2.1.319.md) repeats both on 2.1.319 (with 2.1.318 as a control), and the [2.1.322 receipt](verification/2026-11-10-claude-implementer-2.1.322.md) repeats both on 2.1.322 (with 2.1.319 as a control), the [2.1.323 receipt](verification/2026-11-13-claude-implementer-2.1.323.md) repeats both on 2.1.323 (with 2.1.322 as a control), and the [2.1.328](verification/2026-11-19-claude-implementer-2.1.328.md) and [2.1.329](verification/2026-11-20-claude-implementer-2.1.329.md) receipts repeat both on those versions (each with 2.1.323 as a control), each with a deterministic loopback fixture and no real account/model call. It is not sandbox proof or a runtime receipt gate. The real account/model/person interaction remains a separate live leg.

A headless Claude reviewer is run by the hub instead (task 223): declare
`"claude-review": { "kind": "claude", "roles": ["reviewer"], "start_mode": "headless" }`
and start it with `ahub claude --as claude-review`, which asks the running hub to start it (nothing runs in that terminal); `ahub stop claude-review` stops it. It holds no process while idle; each
review request runs one new `claude -p` session (never resumed) that may only read
the checkout and call `hub_review` and `hub_task_show`, with no user settings,
hooks or plugins. It gets the review facts and a bounded diff of the head, never
the builder's summary or agent chat, and the board records its verdicts as
`reviewContext: fresh`. Review requests go to it first; while it is not started,
the planner reviews and the task's assignment note says `reviewer=planner (fallback)`.
A missing
`peer_instances` feature on an old daemon or upgrade target requires a supporting
version before launching or restoring extras. An older recovery source without it
is refused only while a declared instance is live or unreadable; a source whose
status shows every declared id offline proceeds.

### Fresh reviewer pool (#519)

From 0.12.37 reviews can rotate across fresh headless Claude and Codex reviewers, and from 0.12.38 Kimi reviewers too. Declare reviewer-only instances with explicit headless mode and the Codex or Kimi fresh opt-in in `.agenthub/config.local.json`:

```json
{
  "instances": {
    "claude-review": { "kind": "claude", "roles": ["reviewer"], "start_mode": "headless" },
    "codex-review": { "kind": "codex", "roles": ["reviewer"], "start_mode": "headless", "review_mode": "fresh" },
    "kimi-review": { "kind": "kimi", "roles": ["reviewer"], "start_mode": "headless", "review_mode": "fresh" }
  },
  "review": { "pool": ["claude", "codex", "kimi"], "rerotate": false, "same_family": "fallback" }
}
```

`review.same_family` (#820) is `"fallback"` (the default) or `"never"`. With `"fallback"` a reviewer of the owner's family is chosen only when no other family is eligible, and the board records a same-family fallback. With `"never"` routing never selects one, in the pool and in the legacy path: the planner reviews when it holds the reviewer role, is not the owner, is of another family and is not blocked, otherwise the person does (`reviewer = "user"`, recorded as blocked), including when every reviewer is offline: an approval without review never happens under `"never"`. A manual `ahub task assign <id> <peer> --role reviewer` of a same-family peer is refused with `same family as <owner>; review.same_family is never`. `ahub route explain <id>` names the rule in its trace. Use `"never"` when the workspace review gate needs the reviewer to be a different AI than the implementer; a Jcode running a Claude model is still family `jcode`.

A reviewer has a review scope (#852): `full` (reads the code, runs the affected tests, reads CI) or `code` (reads the code only). The fresh Codex and Kimi reviewers run in a sandbox that cannot run `bun test` or read CI, so they default to `code`; every other reviewer is `full`. A `code` reviewer's review request replaces the check and exact-head CI lines with one: its sandbox cannot run tests or read CI, review the code against the plan, and the merger gates on exact-head CI. Findings are only defects in the reviewed code, docs or tests; a missing check result, CI result, test run or PR/branch identity belongs in `unmet`, never in `findings`. A `code` reviewer's approval and verdicts record `reviewScope: "code"` in the task history. Its `changes_requested` is always recorded and never refused: with at least one structured finding whose disposition is `open` it counts as a rejection as usual; without one it is recorded as evidence-only, which does not count toward `rejections` or escalation, still returns the task to its owner, and sends the conductor one task notice with ids only. The review request therefore asks a `code` reviewer to report every code defect as a structured finding with an id. A person's verdict is never evidence-only. The scope is a fixed property of the definition. To change it for one instance, set `"review_scope": "full"` or `"code"` on that fresh-reviewer instance in the untracked `config.local.json` (a tracked declaration is ignored with a reason; the key is tier 3, so the dashboard and settings sessions cannot read or change it, and a hub daemon restart applies it). `ahub status` shows `review scope` on each reviewer row. A task approved by a `code` reviewer is merged only after exact-head CI is green and no review thread is unresolved, and the merge note names the CI run.

Start them with `ahub claude --as claude-review`, `ahub codex --as codex-review` and `ahub kimi --as kimi-review`; stop with `ahub stop <id>`. For the Claude and Codex reviewers the command asks the running hub to start the reviewer and returns: nothing runs in that terminal, it takes no launch arguments, and `--print-command` or `--dry-run` prints a hub-start note instead of a launch (#720). Fresh Claude and Codex variants share the project checkout; the Kimi variant runs in a clean temporary working directory and reviews only the screened brief and host facts. All fresh variants refuse a custom worktree or permission mode. Codex and Kimi require `review_mode: "fresh"`; without it, an existing headless instance with the reviewer role keeps its native app-server/ACP behavior, worktree and permission options and does not join this pool. Claude retains its task 223 automatic headless-reviewer declaration. The agy reviewer slot remains automatically unavailable (`agy is an implementer peer (#485)`). A failed or unsupported fresh start never downgrades to a native continuing session. Ordinary implementer instances retain their own adapters. The default logical pool order is Claude, Codex, Kimi. Only configured kinds with at least one declared reviewer count as slots, including declared ones that are offline, paused, quota-limited or failing, so availability never renumbers them; configured kinds with no declaration are listed after the walk as `no declared reviewer`. `review.rerotate` defaults to false. Pool selection starts at PR number modulo the number of declared kind slots, or task id when there is no PR, then skips the implementer's family and unavailable candidates. Delta review prefers the preceding eligible independent family in a fresh child. A preceding same-family fallback does not outrank a newly available independent family. `ahub route explain` shows the same pure walk.

Codex requires a verified `codex-cli` (0.146.0, 0.163.0, 0.164.0, 0.166.0 or 0.169.0) or one the person trusts on this machine, and a passing bounded runtime receipt before its model child starts. 0.146.0 and 0.163.0 passed the [2026-10-22 model-free production admission](verification/2026-10-22-codex-reviewer-isolation.md) and 0.164.0 the [2026-10-24 one](verification/2026-10-24-codex-0164-reviewer-isolation.md); 0.166.0 passed the [2026-10-31 model-free procedure](verification/2026-10-31-codex-0166-reviewer-isolation.md). Its [first authorized model review](verification/2026-10-31-codex-0166-reviewer-tool-call.md) missed a marker hidden by the fixture's accepted plan, so that admission was reverted. After a committed model-free envelope regression and a fixture correction, the separately authorized [2026-11-02 single model review](verification/2026-11-02-codex-0166-reviewer-tool-call.md) persisted one approved verdict with the required marker and exact head; 0.166.0 is now verified. 0.167.0 passed the [2026-11-06 model-free procedure](verification/2026-11-06-codex-0167-reviewer-isolation.md) with 0.166.0 as control. The separately authorized [single model-backed attempt](verification/2026-11-06-codex-0167-reviewer-tool-call.md) failed a harness readiness/readback check after startup and marker preconditions; a complete persisted verdict/head/marker result was not recorded, so the model/tool outcome is unknown and 0.167.0 remains unverified. No retry was made. It joins the verified set only after a separately authorized model-backed tool-call run succeeds; until then it is refused unless the person runs `ahub agents trust codex-review 0.167.0`, and every runtime proof still runs. 0.167.2 passed the [2026-11-13 model-free procedure](verification/2026-11-13-codex-01672-reviewer-isolation.md) with 0.166.0 and 0.167.0 as controls and stays out of the verified set on the same terms (`ahub agents trust codex-review 0.167.2`). 0.169.0 passed the [2026-11-14 model-free procedure](verification/2026-11-14-codex-0169-reviewer-isolation.md) with 0.166.0 and 0.167.2 as controls (six of the seven re-read source files changed and were re-read, and the app-server schema comparison found no removed type, property or enum value), and the separately authorized [single model-backed review](verification/2026-11-14-codex-0169-reviewer-tool-call.md) persisted one approved verdict with the required marker and exact head; 0.169.0 is verified. Four earlier starts of that harness were refused at the isolation proof before any model request, a fixture deny-list artifact that the receipt records. A refusal names the installed and verified versions. Either set `codex_bin` to a verified executable, or run `ahub agents trust codex-review <version>`: trust lifts only the version pin, and every proof below still runs before each child (#691). Each launch approves exactly `hub_review` and `hub_task_show` per tool (`approval_mode = "approve"`), never through a server-wide default: without it Codex 0.164.0 listed the tools but refused the call, so reviews ended with no verdict (#783). A model-free receipt proves the inventory, not that a verdict reaches the hub; a [model-backed 0.164.0 run](verification/2026-10-25-codex-0164-reviewer-tool-call.md) recorded one verdict through that path. The producer checks native binary/config stability, configured MCP inventory with only the two hub tools, effective Apps/plugins/hooks disablement, an explicit empty legacy `notify` command and a named filesystem profile. Apps needs separate feature readback because configured inventory omits runtime connectors. Web search is requested disabled; its effective turn mode is not read back and managed requirements can select Cached (see the verification ceiling). Each launch proves public-read, exact/glob/symlink private-denial, standard host credential denial and write-denial in temporary fixtures. Standard credential and configured tool-home/XDG subtrees are denied independently of project `local.deny`. Its sandboxed shell is filesystem read-only with private paths denied and network configured disabled; it is not Claude's Read/Grep/Glob-only tool whitelist. No credential home is copied.

Kimi requires a compat-admitted Kimi Code on the hub's PATH (receipt-verified 2.2.0, 2.3.0, 2.3.1, 2.3.2, 2.4.1 and 2.5.1), signed in through its managed OAuth provider, and a passing runtime preparation before each child; an unverified/untrusted version or a failed preparation is unavailable with its reason. The [2.3.0](verification/2026-10-22-kimi-qwen-compat.md), [2.3.1](verification/2026-10-25-kimi-231-reviewer-compat.md), [2.3.2](verification/2026-10-26-kimi-232-reviewer-compat.md), [2.4.1](verification/2026-10-31-kimi-241-reviewer-compat.md) and [2.5.1](verification/2026-11-06-kimi-251-reviewer-compat.md) receipts are model-free and do not verify real login/provider readiness. Each review runs a new `kimi -p` child without Seatbelt, in a private `KIMI_CODE_HOME` with managed-provider-only config, a clean temporary working directory and an empty skills directory. Its agent may call only `hub_review` and `hub_task_show`, through a task-bound loopback MCP session that never carries the hub's control token, and has no native read, file or shell tool: it reviews the screened brief and host facts only. Its `credentials/`, `oauth/` and `device_id` link to the person's native Kimi files, so it shares the native login, refresh lock and the Kimi account's budget; no token is copied. A stop revokes its verdict authority first, then waits briefly while an OAuth refresh holds the lock; a forced stop mid-refresh may require a native re-login. The Kimi backend records no measured token counts here, so its usage stays unknown; the 2.3.0 receipt makes no usage claim. This is a native tool-authority boundary, not filesystem or network isolation.

A dangling or unreadable standard/configured credential root makes the Codex reviewer unavailable with only its path class in the reason (for example `~/.docker` or `$DOCKER_CONFIG`, never an expanded path or contents); repair the root and start the reviewer again.

agy is not a reviewer (person decision, 2026-10-19): it is an optional implementer peer (see [Optional Antigravity peer](#optional-antigravity-agy-peer)), and its retained reviewer slot is outside the default pool and always unavailable with `agy is an implementer peer (#485)`. A manual pool accepts only registered reviewer kinds (Claude, Codex, Kimi, agy), so local/Pi are refused. An explicit pool without declared candidates blocks for person action; an omitted pool retains legacy routing without declarations and falls back to an eligible planner when fresh candidates are exhausted. The exhausted pool walk remains recorded; without an eligible planner, the person reviews. A manual pool may name agy, or a Kimi reviewer whose preparation fails; the reason appears as an unavailable skip, and they never run or count as approval. Do not substitute plan mode for isolation.

A failed start or any child ending without a saved verdict advances to the remaining eligible candidates; no quota meaning is guessed from text. A request that went stale before its child started (a new head, review revision or reviewer) is skipped with one `hub.log` line; a still-current request whose review policy changed moves on as `no_verdict`. Neither marks the reviewer unavailable (#781). A child that ends without a verdict leaves one bounded `hub.log` line: its exit code and the hub tools it called, screened like any refusal, never tool arguments or model text. Its delivery completes only once the re-offer is confirmed; an unconfirmed re-offer stays `needs_review`. A manually named reviewer's no-verdict, and one with no declared pool, goes to the person, never to an agent the person did not choose (task 453). A same-family fallback is a distinct fresh reviewer session. Exhaustion records `blocked: no reviewer can run`; with no explicit pool the eligible planner fallback is retained, while an explicit pool or absent eligible planner leaves person action. It never auto-approves. A per-review isolation preparation failure excludes that peer from later tasks until a verified restart. Its reason names one cause from a closed list (`version`, `binary`, `mcp_inventory`, `plugins_hooks_apps`, `sandbox_proof`, `credential_root`, `fixture_root_denied`, `timeout`, `unknown`) with a fixed hint, on the peer's `reviewer` line in `ahub status` and in a `hub.log` line, and never a path, native CLI text or token (#722). Only the Codex preparation classifies its failures; other reviewers report `unknown`. Recovery targets must advertise `reviewer_pool` when a pool is explicitly configured or fresh reviewer instances are declared. Verdict history retains `reviewContext` and adds `reviewerFamily` and `reviewerReason` from the host.

Fake-CLI tests and CI cover these host contracts. [Offline isolation evidence](verification/2026-10-19-reviewer-isolation.md) and fake-CLI tests do not prove an account/model review or observed network denial. Native acceptance remains a separate [manual smoke leg](smoke.md#reviewer-pool-native-legs-519-2026-10-19); existing task 223 Claude behavior has no new live proof here. Kimi's authenticated fresh-verdict receipts, and its still-open interactive-TUI coexistence and usage checks, are tracked in [Kimi smoke legs](smoke.md#kimi-reviewer-and-task-bound-mcp-533).

An additional implementer must have an existing registered Git worktree and
attached branch at `.worktrees/<instance-id>`, named explicitly by `worktree` in
its declaration. The hub validates it and does not create it in this phase.
Reviewer instances may share the checkout, or name their own validated worktree.
The execution directory is separate from the canonical hub project. Resolving it
(at an extra-instance start and for a turn undo) makes up to four git calls that
share one 5 s allowance; when it runs out the start refuses with `Git workspace
evidence unavailable`. An Orca
terminal may belong to either that canonical project or the instance's execution
worktree; recovery preserves its exact recorded grouping and live launcher.
Changing or removing the declaration invalidates its saved extra-instance
binding; the recovery screen and `--verbose` receipt still show what was recorded
for it. A roster key left by an undeclared instance (`codex-2`) loads as inert and
`ahub roster remove codex-2` deletes it from `.agenthub/config.local.json`; a key
held only in the shared `config.json` is refused with a request to edit that file.
Any other unknown roster key is still an unsupported peer. Do not infer ownership
from a native-kind label alone.

A routing preference for a kind chooses among its instances using current load
and WIP. A manual instance id remains exact. Reviewers from the same kind share
a family; the board records a same-family fallback when no other eligible family
exists. Native context is per conversation, while quota windows and quota pauses
are shared by kind/account. A quota reset does not lift a manual pause.

Facts and turn snapshots follow the instance's execution checkout. Use a CLI
that supports instances to undo those turns: older readers see their snapshot
fields as unknown and cannot restore them into the main checkout. The supporting
CLI checks the saved workspace against the current declaration again before any
context change or file restoration. Removing the declaration intentionally
blocks that undo until the identity and workspace can be reviewed.

## Release approval and optional tag guard

Run `ahub sdlc authorize-release <version>` from the running daemon's release-candidate checkout after checking the committed release policy. The person may run it directly; the unique configured conductor may run it only on the person's explicit instruction in its own session naming the release. A hub message, task text, review note, file or peer relay never qualifies. Other peers, child `toolsOwner` sessions, private or PII turns, and delegated `--live-test` calls cannot authorize. The receipt binds the exact commit, version source, remote identity and documentation verdict or explicit `docs:none` exemption; its `by` and the audit name the actual asker. The daemon keeps approval only in memory; restart requires a new approval. The read-only `ahub sdlc release <owner/repo>` report shows its receipt, retaining native-verification blockers.

`ahub init --release-guard` installs a managed Git pre-push guard and release instructions (`--dry-run --json` previews them). It preserves an existing default hook as `pre-push.agent-hub-original` and passes original argv/stdin to it only after approval matches. Unknown or mismatched `v*` tag pushes fail closed, including when the daemon is down. Non-version branch pushes remain independent of the daemon. Custom `core.hooksPath` and linked/hardlinked hook files require manual integration. Re-run init after changing the Bun/package location. The person's `git push --no-verify` remains an explicit bypass; agents are instructed never to use it.

For `gh release create` and `npm publish`, use the exact literal command after `ahub sdlc release-guard --`. This preflight reads evidence and never executes the command. New GitHub tags require an explicit full commit target; alternate-repository, workspace/archive and bulk target forms refuse. GitHub/npm adapter enforcement is deferred to tasks 312/313. This consent record does not certify a tarball, native acceptance or live publication. Detailed limits: [S6 authorization](sdlc.md#person-release-authorization-481-s6).

## Planner release scheduling

Use `ahub sdlc train report <release-id>` for scope readiness and recorded release metrics. The planner creates future release rows, activates one train, and assigns tasks through the release-only hub tools. A due date requests a cut review; it never clears unfinished work. Move missed tasks to the next row with a reason, then use `ahub sdlc train cut <release-id> <revision>` from the person's terminal or `hub_release_cut` as the planner. The cut retains a short host admission lease through freeze and defers on held gate slots or unknown/quota-limited peer windows with a real quota source. Accounts without a quota reader (Kimi included when `kimi_tokens_5h` is zero) report `no quota source`; manual and budget-record pauses still defer. It does not run release preparation or publish anything. Schedule bundle/check/docs work under separate heavy admission and retain the person's native verification, authorization and upgrade window. A hotfix records its enumerated cause and keeps every gate.

The per-release "gates run" record is not built: it needs gate-execution evidence the S6 authorization path would supply, and a cut record is not that evidence. Release interval, approval-to-release lead time and hotfix rate are shown by the release report (#442). Person ruling 2026-10-19 supersedes the earlier S11 upgrade-admission ruling: upgrades use pre-S11 recovery readiness (no busy peers, pending approvals resolved, completion checks settled) and retain the existing operation checks. S11 adds no host-admission, quota or all-idle requirement to upgrade. An active/frozen configured train still requires recovery-target `release_trains` compatibility. Release-cut admission remains unchanged: follow its refusal's applicable exit by stopping or resuming the paused peer, adjusting `ahub budget set`, or using `ahub release drop`. Missing/shadowed `dot` requires the resource controller or a PATH correction for the cut; nested admission requires retrying the cut outside the outer lease.


## Codex cancellation identity notice

If Codex is offline with `statusNotice.code = unidentified-cancellation`, the hub
could not identify a cancelled native turn. Reattach the native session before
further hub delivery. A late completion keeps this hold; verified native
reattachment or TUI detachment clears it. The notice contains fixed guidance, without native ids.

## Roles per SDLC stage (#525)

The design for planner, implementer and reviewer instances per stage is in the spec section "Amendment: roles per SDLC stage (#525)". Slice 525-1 is available: role capability per kind and form, Claude channel instances as implementer or verifier in their own worktree, and `planner` refused on builtin kinds that cannot plan (pi, local and agy): an instance declaring it is refused with `this kind cannot plan`, and a `roles` entry keeps its other roles with the notice `roles.<peer>: ignored roles outside the adapter ceiling`. A configured ACP agent (`adapters`) is different: it may hold `planner` in its `roles` or in a `roles` entry and then plans like any peer, but it can never be pinned with the `planner` setting or chosen as the automatic planner, because it has no host projection (#735). Slices 525-3, 525-4 and 525-5 are available too:

- 525-3: `assign()` walks the planner holders (rotation by task id over every holder, never renumbered by availability; a named planner exact; a recorded planner kept; none for a PII task) and `ahub route explain <id>` prints that walk. Task planner bindings are recorded by 525-2. A peer that accepted or finished a task never reviews it, a named reviewer and the declared reviewer pool included; when no other candidate is left the person reviews.
- 525-4: a headless Claude implementer runs one owned child per turn in its declared worktree, with a separate persisted session per task (`start_mode: "headless"`, permission `ask` or `ask-when-needed`; `never-ask` refused).
- 525-5: terminal Claude implementer instances own write-class tasks once the daemon has verified their execution root.

For a Codex planner, put a declaration such as the following in the untracked `.agenthub/config.local.json`, then restart the daemon. A planner instance holds `planner` and neither `implementer` nor `verifier`; adding `reviewer` does not grant code-write ownership. It uses the project checkout, so `worktree` is refused.

```json
{
  "instances": {
    "codex-plan": { "kind": "codex", "roles": ["planner"], "start_mode": "headless" }
  },
  "planner": ["claude", "codex-plan"]
}
```

Run `ahub codex --as codex-plan` from the person's terminal. The hub opens the app-server proxy without creating a synthetic host thread. Each native `thread/start` or `thread/resume` is requested read-only. The host rechecks the current settled roles when each thread is admitted and before hub injection, so changing a running instance from a continuing reviewer to a planner cannot reuse an unconfirmed writable thread. A live planner transition with a declared writing worktree is refused until the declaration is corrected and the daemon restarted. A reply that does not positively confirm read-only refuses that RPC and closes the unconfirmed link before the hub adopts the thread or delivers work; missing or malformed evidence is not read-only. The attached TUI belongs to the person and can change its native sandbox later: this is an initial thread ceiling, not a claim that the hub confines the person's TUI. A planner can own `plan` work but cannot become the code owner without the implementer role.

A planner-only Claude instance stays a channel instance on the project checkout, with no `worktree` or headless form. Its facts hook gives no automatic grant for mutating file tools or shell, whatever the hub permission mode. The daemon also returns `ask` for those calls in the existing grant reply field, protecting older hooks that do not recognize the added ceiling flag; the person's runtime mode itself is unchanged. A native choice in that person's terminal remains the person's; the builtin `claude` keeps its existing behavior.

Inspect the running holders with `ahub status` and the dashboard's Agents view. Each peer's `roleInfo` includes its running `form`, `capableRoles` and effective `flowRoles`; a planner holder also names its planner source. `form` distinguishes a channel, headless variant, terminal implementer or builtin form. Capability describes the allowed ceiling, not an extra assigned role. Each declared extra shows owner isolation as `isolated` or `not isolated: <reason>`; a planner using the canonical checkout is not an isolated write owner by design. Missing proof never counts as isolation. The isolation fields and status stall projection are cached display evidence; they may still show the last verified root before an effect point checks a filesystem change. Actual assignment, facts grants and recovery never authorize from this display cache.

Use `ahub task show <id>`, the console Tasks panel and the dashboard task detail to inspect planner, owner and reviewer with their recorded reasons. `ahub task show <id> --json` and `ui_snapshot` carry `planner` and `plannerReason` as additive fields; a legacy null planner stays unbound. Compare the holder walk with `ahub route explain <id>`. Use `ahub task assign <id> <peer> --role planner` from the person's terminal to name another eligible holder without moving owner or reviewer. Planner settings, bindings, independent plan review and the recovery floor are described in "The planner" above; implementer/reviewer setup is in "Additional headless peer instances". The [six-instance person smoke leg](smoke.md#six-role-instances-525-6) remains unverified until it is actually run.

## Daemon responsiveness and launch connects (#719)

Periodic peer-roster and delivery-supervision reads select pending journal metadata/rows, excluding completed payload history. Queue revision reads do not construct a recovery snapshot. Explicit queue/history commands retain terminal history. The pending-state index supports these reads without sorting historical payloads.

Native launcher connections retry transport timeouts/unclean closes with bounded backoff for at most 15 seconds, printing `hub busy, retrying` once. The ordinary control-connect timeout remains 3 seconds. An immediately unreachable listener, authentication refusals, wire mismatch and project/instance mismatch are terminal. Every retry rereads the descriptor and preserves the invocation's delegated-audit instance pin. Usage queries retain their existing catch-up budgets and report `behind` until complete; time slicing never advances beyond the last atomically folded record.

## amem runtime (agent-mem#13 P4)

The hub accepts @staix/agent-mem <!-- facts:agent-mem-pin -->>=0.33.0 <1.0.0<!-- /facts:agent-mem-pin --> (a range `bun.lock` resolves; a newer plain release in it with a supported host API needs no hub release) for recall, curated evidence and local deterministic capture. No runtime call reaches a claude-mem worker; `memory.worker_url` is ignored. The person's `ahub memory import claude-mem` remains explicit and off by default. Existing profile, alias, PII and private-turn fences still apply. `ask --remember` and context checkpoints propose machine-local candidates, never automatic curated evidence. See [memory integration](memory.md#in-process-recall-and-capture-agent-mem13-p4) for changed behavior and bounded-view ceilings.

## Person-run backlog legs (#1176)

A leg only the person can run (live receipts, their accounts, machines or approvals) is marked with `ahub backlog person <id> <revision> true <reason...>` (`false` clears it; `ahub backlog plan <id> <revision> '{"needsPerson":true}' <reason...>` is the same write). The mark is the person's alone: a planner or any agent that sends `fields.needsPerson`, or plans a marked card, is refused with the reason. A marked card keeps its `reserved` peer as the "who will run it" hint, and:

- `tasks.auto_pull` and a planner's `hub_backlog_pull` never pull it (the pull refuses with "person-run leg"), and the planner notice never names it as ready;
- `assign()` gives it no owner and no reviewer, whatever its reservation says, and `ahub route explain` prints the same `person-run` line (it is the same function);
- the idle sweep never escalates it, and a marked card in To Do is not reported as stalled for lacking an owner;
- it counts toward no planner's WIP;
- a planner's `hub_backlog_split` of a marked card is refused (its children would be unmarked cards an agent could take); the person's own split marks every child person-run, so person-only work stays person-only until the person clears each mark;
- an agent's `accept` and `acceptReviewed` of a marked card are refused, a queued offer for a card marked since is dropped at delivery, and `hub_task_assign` names no agent owner of a marked card (the conductor, a planner and the person alike: clear the mark first);
- marking a card an agent already owns (an offer in its queue, or accepted work) is refused with the way out (the owner declines, or `ahub task cancel`), so a mark never leaves an agent on the card;
- `ahub backlog list` shows it as `<peer> (person)` and ends with `waiting on you: #N...`, and `ahub status` carries a `WAITING ON YOU  #N` line (ids only).

An unmarked reserved card behaves exactly as before. The column is additive (`needs_person`, default 0): an older hub ignores it, and a card marked by this hub is then offered by the older one as an ordinary reserved card.

## Backlog issue identity and notes

The card's effective planner or the person can relink an unstarted backlog card through `hub_backlog_plan`, using `fields: {sdlc: {repo: "owner/repo", issue: 525}}`. The change is one planning revision and clears the old spec acceptance. Stage, reviewed heads, checklists and other lifecycle evidence cannot be supplied through this path; `hub_sdlc_record` still refuses backlog work.

Omit tool `fields`, or use `{}`, to record only the bounded reason as a new revision. The person CLI retains its JSON argument: `ahub backlog plan <id> <revision> '{}' '<reason>'`. Existing planner scope, pins, frozen releases and stale-revision checks still apply. Undo restores identity members without restoring old consent; null members represent an absent previous repo or issue.

The grooming digest no longer calls ordered dependency phases duplicate merely because they share a design issue. It still reports path/symbol overlap, unrelated same-issue cards and references requiring attention. It uses dependency edges only, including bounded public context for approved intermediate phases.

## Inspecting memory symbol anchors

`ahub doctor --stale-anchors [--json]` (#684 phase 3) checks a bounded set of this project's screened symbol anchors through the optional code-facts boundary. Stale means positively absent at the reported head; unavailable or ambiguous evidence stays unknown. Read the coverage/truncation fields before treating the report as complete. This command performs no note mutation or automatic repair.

A task completion note stores actually observed, existing symbol nodes instead of plan guesses. Earlier notes remain connected through the same reset-safe task node. Related-memory retrieval reaches those earlier notes at memory hop two; the graph's literal two-edge view shows the completion note and task node. Unknown observations are labelled and never substituted with the plan. See [canonical symbol anchors](memory.md#canonical-symbol-anchors-684-phase-3) for bounds.

## Code-facts inspection cleanup and lookup coverage

`doctor --stale-anchors` may create transient detached Git worktrees for exact-head analysis. A Ctrl-C or interrupted cleanup can leave a prunable registration. Inspect `git worktree list --porcelain`; remove or prune only an entry confirmed abandoned, through the person's normal Git maintenance. The report performs no automatic prune. Repeated optional cleanup failure is reported as unknown rather than escaping as a second error.

An absence row says "absent from indexed definitions". Imported package APIs/types and unsupported host qualification are not proof of removed source. Names containing `#`, `->` or `:` remain unknown. Existing raw-signature and normalized note associations are queried together without changing stored entries. See [symbol preparation and query compatibility](memory.md#symbol-preparation-and-historical-query-compatibility-684-follow-ups).

## Inspecting memory code neighbours

In the dashboard Memory view (#684 phase 4), select a symbol and enable Code neighbours. Dashed calls are read-time caller/callee evidence at the displayed commit SHA; solid note associations still come from authored metadata. Unknown, lower-bound and truncated coverage are advisory, never a proof of no callers. The accessible edge list carries the same SHA and direction. Toggle off to view the stored graph alone.

`hub_memory_graph` includes the same bounded derived context for symbol starts within its existing 6 KB output budget. Task briefs prioritize attached fails and decisions within `brief_items`; the console related-note count refers to that bounded selection. Code facts remain optional: no index is copied into memory, no graph edges are persisted and no PII task/turn starts a query.

Optional code work runs only while Memory is open and visible. A cold console count reports unknown immediately; it does not prepare code facts. Direct task memory remains available when optional code facts are ineligible, interrupted or unavailable. Review/completion queries pre-empt optional native work after its owned process/tree cleanup. Unknown lookups have a five-second retry floor; topology caches are commit-bound and note bodies are refreshed under current policy. These are advisory coverage bounds, not empty-result proofs.

## Authority by command

### Conductor operations (#812 T2, #933, #900)

The selected project's configured conductor may run the commands below through its ordinary peer identity. Other peers retain the guidance "the person runs it in ahub console or a terminal". A missing or dead descriptor refuses promptly. For a live descriptor the connect and local authorization handshakes each keep a 3-second bound; connection unavailability is not presented as proof that the peer lacks the conductor role. Actual authority refusals are audited as refused, while ordinary operation failures retain their original cause. The daemon checks the authenticated connection, current role and project membership before effects and after asynchronous boundaries. Roster handoffs carry that same authority check through plan admission, owner delivery and each later task; a saved assignment is never rolled back when delivery is interrupted. Effectful operations and operational history reads retain an `agent_cli` admission with the initiating peer; audit failure refuses those operations. Authorization negotiation, `settings_preview` and `queue show` still check current authority but emit no extra admission record or conductor notice. Admission records are not a unique invocation counter.

| Command | Conductor scope |
| --- | --- |
| roster add/remove | Existing roster lifecycle and confirmations; no role or permission-mode grant |
| stop peer | Existing hub-owned peer stop, ownership and recovery guards |
| queue show/resolve/discard | Public queue projection and existing revision/confirmation guards |
| board import / intake approve | Existing import and intake admission; the actual conductor remains the actor |
| schedule run/pause/resume | Existing machine-local schedule controls; no role or policy changes |
| research backfill / bench run / source add / goal link | Existing bounded CLI or daemon paths, with fixed audit labels |
| start Jcode | Launcher-only peer the conductor is configured to start |
| task unassign <id> [--role owner\|reviewer] [--revision N] | The actual conductor is recorded; no replacement is routed and no native work is stopped |
| guidance probe register/start/show/receipts/cancel | Bounded private probe declaration, fake-only lifecycle and the read-only sealed-receipt export through Tasks (#1226); `--live-test` is refused and production has no probe runner |
| restart --yes | Only with a source-issued continuation proof for this project's own operation |
| upgrade --yes --to <exact-version> | Only with proof for this project's supported exact-version upgrade; newer coordinator handoff is person-only |
| recovery resume\|abort [<op-id>] | Only the initiating conductor's own restart/authorized-upgrade operation; the person keeps the normal recovery path |
| doctor --orphans --kill | Selected project's positively identified hub-owned process only; no cross-project registrations or unsigned process files. Prints the stopped pids for a person; `--json` prints the hub's reply |
| logs / export | Bounded daemon projections, with unsupported/private records withheld; logs -f ends when authority ends |
| settings set | Only the thirteen existing live registry keys listed below |
| sdlc configure [--mode off\|advise] [--required-checks <names>] | Only on the person's direct instruction in the conductor's own session (#1432); stages `off`/`advise` and the required check names for the next hub start, never `enforce` or while running or file mode is `enforce` ([contract](sdlc.md#instructed-conductor-configuration-1432)) |

The exact settings keys are `task_sweep.enabled`, `task_sweep.auto_reassign`, `task_sweep.no_writes_turns`, `task_sweep.interval_s`, `task_sweep.unaccepted_min`, `task_sweep.idle_min`, `task_sweep.review_min`, `task_sweep.ready_min`, `task_sweep.ladder_min`, `snapshots.enabled`, `research.enabled`, `approvals.notify` and `tasks.escalate_after`. New keys receive no authority by prefix. Generic roster setting writes still use the dedicated roster lifecycle. Conductor setting records name the initiating peer, and conductor writes preserve the person's pending undo record. An intervening write can still invalidate that undo through the existing file-digest guard; preserving the record does not bypass that guard. Permission modes, roles, `models start|stop`, arbitrary configuration reload and undo remain person commands. `task cancel` remains a separate own-task `hub_task_cancel` permission, not a conductor operation.

Log history is limited to the last 100 retained lines and export to the last 1000 retained events, each within a 128 KiB read. Truncation is explicit. An incomplete public projection reports one bounded reason on stderr, preserving export JSON on stdout. The complete privacy inventory has no 500-task cutoff and is cached until board or privacy/config revisions change, so log-follow does not rebuild it for every line. Export accepts closed metadata shapes; unknown fields and nested records are withheld rather than copied. Task titles, paths and private delivery bodies are not part of this projection. It does not change the person's ordinary logs/export output.

Orphan cleanup requires a missing selected root, signed process identity and the host-known hub executable/entrypoint and argv. An inaccessible root or unavailable proof remains unknown; there is no offline config-based role grant. The daemon rechecks authority and process ownership before signals. A confirmed self candidate uses the existing lifecycle stop after its reply. A roster write already committed before authority ends is acknowledged as saved, without authorizing further lifecycle work or commands.

### Conductor-bound restart and recovery continuation (task 535, #900)

The configured conductor may start a restart with `ahub restart --yes` or an
upgrade with `ahub upgrade --yes --to <exact-version>` only after the source hub
issues a bounded, fixed-shape private continuation record for that exact operation. The record is
separate from public recovery JSON and its `delegatedAudits` history. A
source-issued HMAC binds the operation id, initiating peer, project id and
canonical root, source daemon instance, target root and package bytes, plan
fingerprint, and a version-neutral digest of bounded source inputs and fresh
actor/privacy evidence. A public operation entry or audit label alone grants
nothing. The digest covers raw config-layer and routing-file texts, plus the
source-resolved public routing template bytes when no project routing file
exists; it does not hash expanded defaults, default roles or parsed routing.
The public `conductorRoutingDefaults` map is advisory; the target inherits the
sealed source fallback. The private record stores digests, not raw config,
routing contents or the HMAC key.

Every planned project is preflighted for source recovery support and current
authority before staging begins. An upgrade then stages and verifies its exact
target; restart has no package stage. The source issues the private HMAC record
after the target bytes and feature floor are verified, before publishing the
public operation receipt, taking the lock or applying runtime holds. A source
preflight refusal prevents staging; an unsupported staged target or failed
proof prevents the public operation and its holds. A target requiring handoff
to a newer coordinator remains person-only. At every effect boundary, the host
rechecks the same peer's live conductor role and roster membership, project
authority, read-only status and current non-PII/privacy policy. Offline
continuation uses only bounded current actor/privacy checks; unrelated public
board writes do not invalidate it. Changed or unreadable authority evidence
stops the next effect and leaves the operation for the person.

An upgrade digest includes the exact staged `@staix/agent-mem` and, when declared,
`@staix/cli-output` packages from their hoisted install; a restart digest includes
their verified source dependencies. Legacy packages without the output dependency
keep their original digest.
Protected or restart-bound source config/routing edits that have not been
accepted remain person-only. The replacement validates the captured inputs
before adapter imports and uses the sealed source fallback for startup routing.

Captured TUI terminal restoration remains person-only: a delayed native
launcher cannot re-prove the conductor at its eventual spawn. Headless
restoration uses the target-owned snapshot through a tools connection.

An unmanaged reconnect-only Claude channel may reattach itself without a native launch. The source keeps a SHA-256 fingerprint of its observed session identity separate from restoration metadata (the raw unmanaged session id is omitted from the plan) and verifies the exact peer, kind and attachment against the live channel. This exception requires no terminal or restoration arguments, no managed launch proof, and an absent or confirmed-ended launcher; unknown launcher evidence refuses. Other peer identities still compare exactly.

Claude channel push mode also requires the plugin's direct parent process row to begin with the exact `claude --dangerously-load-development-channels <plugin-or-server-target>` argv prefix. The inherited `AGENTHUB_CHANNEL=1` marker alone is insufficient: Claude's `daemon run` and `bg-spare` children inherit it but do not load the development channel, and print forms ignore it. The bounded `ps -ww` read is display/attachment evidence, not authentication; unreadable, truncated, changed-parent or unrecognized rows attach tools-only and keep messages for `hub_inbox`. `ahub status` shows the attach mode and the closed evidence label.


Only the conductor that created the restart or authorized upgrade may run
`recovery resume|abort` for that operation. A different conductor cannot take
over; the person can use the ordinary recovery commands. The detached
`recovery-run` and target launcher are internal continuations bound to the
recorded operation and captured target arguments. They do not grant arbitrary
console CLI commands. The existing `--live-test` path remains separate and does
not create a conductor continuation.

`task unassign` runs as the conductor's own actor and does not route a
replacement or stop native work. An owner unassign suppresses automatic owner
offers until an authorized explicit assignment or reservation clears that
suppression. This behavior has fixture coverage only; it does not establish a
current installed-release or live-account receipt.

## Standalone ciphertext broker (#446 X2)

From the operator's terminal, run `ahub broker serve --port 8788 --state-dir <private-directory>`.
Default bind is 127.0.0.1; default storage is `broker/` under the selected hub state
directory. Ctrl+C or SIGTERM closes the listener and SQLite handle together.
Accepted ciphertext remains across restart. `GET http://127.0.0.1:8788/health`
returns fixed version/status data.

For another machine, configure TLS termination and use
`--public-url wss://relay.example/ --owner <owner-signing-fingerprint>`.
Repeat `--owner` for each approved creator. Public WSS audiences, even on a loopback
listener behind a proxy, require this allowlist. It controls new rooms only;
existing member revocation still uses the owner's signed roster. Omitting the
allowlist is allowed only in the loopback/no-public-audience development mode;
do not expose that open mode through a proxy.
The audience must be a canonical root URL without credentials, query or fragment.
Proxy `/v1/rooms/<room>` as binary WebSocket, preserve Origin and expose WSS only.
A non-loopback bind also needs `--hostname <address>` and an explicit WSS URL.
The command configures no proxy, certificate, firewall or hosting account; live
TLS and two-machine operation need their own operator receipts.

Keep `broker.db` and its directory outside version control. There is one process
per database, enforced by SQLite's kernel lock; a second instance reports busy.
A crash releases that lock. Do not delete the database as lock recovery: owner/
epoch pins protect membership. Empty/corrupt/unsupported state refuses rather than
forgetting pins. Restore a known valid backup or arrange a fresh room lifecycle
explicitly; X3 clients must retain their own owner/epoch/replay state.

The first room connection proves its signed roster's owner identity; later ones
prove current membership. Room create/invite/join/expose and the hub link are X3;
ordinary chat forwarding and local policy are X4. A stored or queue_ack packet is
transport/storage only; application delivery needs the recipient's separate signed
receipt. Queue-full/backpressure refuses new work without evicting accepted data.
See the [protocol and caps](specs/2026-09-19-agent-hub-design.md#encrypted-rooms-x2-blind-broker-446).


### Reclaim one broker room

Stop the broker first, then run
`ahub broker room drop <room> --yes --state-dir <private-directory>` from the
operator's terminal. Online attempts report busy; agent markers and `--live-test`
delegation refuse. The directory/database must already exist. This forgets only
that room's pins, sender floors and pending ciphertext, freeing its slot; it keeps
other rooms and their pins. It is a destructive room reset, not membership
revocation, secure erasure or confirmation that pending messages were delivered.
Clients must retain their own owner/epoch/replay state. Remove an unwanted owner
from the startup allowlist before restarting so it cannot recreate the dropped id.
Never delete the whole database to free one room.

Existing populated state directories must contain only recognized broker files
and already be 0700. Other populated directories, including a checkout, refuse
without chmod. Empty directories may be tightened. Schema v1 migrates to v2 while
preserving signed pins, floors and queued ciphertext. The 4 MiB per-room admission
share prevents one room taking the whole aggregate byte budget; valid older larger
queues stay available but block new admission until drained or expired.


## Outbound room membership (#446 X3)

Run room mutations from the person's terminal, never an agent shell or `--live-test`.
Start a self-hosted broker as described above, then create a room with
`ahub room create team --broker wss://broker.example/`. The owner fingerprint must
be on a public broker's `--owner` allowlist. `room list` prints that fingerprint.
No room joins or exposure are loaded from committed configuration.

Exchange these artifacts privately out of band:

1. Owner: `ahub room invite team`, send the invitation token to the joining person.
2. Joiner: `ahub room join <token> --name team`, send the printed request back.
3. Owner: `ahub room invite team --accept <request>`, send the printed signed roster.
4. Joiner: `ahub room join team --roster <signed-roster>`.

Both consoles print owner and member fingerprints before installing/consuming.
Compare them out of band, then answer the TTY's y/N prompt (default No). A non-TTY
must pass `--confirm <member-fingerprint-prefix>` with 16..64 matching lowercase
hex characters; it does not execute on a missing or mismatched confirmation.
This flag does not delegate to an agent or bypass the `--live-test` refusal. Only the invitation token contains its one-time secret.
The join request/roster contain no private key or invitation secret. Keep tokens
out of shell transcripts, shared logs and source control. A saved pending join can
be retried with the same token/name/label; `room leave team` cancels it if needed.

`room expose team codex` sets the untracked local exposure policy. On a non-owner
it prints a signed exposure request: send it through the same owner `invite --accept`
and joiner `join --roster` round trip. Empty exposure is the default. `room status`
shows ids and closed states. The X4 chat workflow is below.

`room revoke team <fingerprint>` rotates the owner roster, giving no new key to the
removed member. `room leave team` disconnects locally and retains replay/pin state;
ask the owner to revoke membership as well. Hub shutdown closes links but keeps
membership. Never delete rooms.db to repair a pin or sequence failure. Unknown or
corrupt state disables rooms, while local hub work remains available. Real TLS,
proxy forwarding and two-machine smoke remain unverified until the person runs X7.

## Queue backpressure on automatic task offers (#800)

WIP and a peer's waiting messages measure different constraints. Backpressure is
off by default. A person may opt in through untracked local settings:

```sh
ahub settings set tasks.queue_backpressure.max_queued 20
ahub settings set tasks.queue_backpressure.max_oldest_s 600
```

The bounds are 10,000 messages and seven days; zero disables that threshold.
Values strictly above a threshold hold new automatic owner/reviewer offers.
`ahub route explain <task>` uses the actual assignment rule. `ahub status` shows
queued count, oldest age and a fixed hold reason separately from active,
review-wait and reserved WIP. Unknown age is shown as unknown and holds an offer
when the age threshold is on. Existing queued work still drains normally.

After enabling age policy, old or recovered entries can lack host arrival proof;
resaving/restarting does not make them fresh. Drain them or explicitly assign the
particular task as the person/conductor. That override applies only to the named
role, not other automatic choices, and does not waive privacy/independence/runtime
admission. Automatic reserved planner pulls are still guarded.

Queue-origin holds are retried after committed queue/state/policy changes, without
routing work a person explicitly unassigned. Automatic decline/budget reroutes
retain their retry intent across planning updates; a named proposal keeps its
target. A person reservation waits under pressure rather than moving to another
peer. Self-claims enqueue no owner request and skip only that queue guard.
Continuing reviewers remain bound unless their own queue refuses the new offer.
Setting both values to zero returns
to ordinary automatic assignment. This PR changes no live repository setting or
routing template; real-use adoption metrics remain separate from fixture checks.


### Presence and full broker queues (#1204 T1)

Unchanged presence snapshots are skipped. Presence is ephemeral: an offline
member does not accumulate observations, and the broker keeps only the latest
per sender for connected members. Explicit refresh exchanges still work.

On `queue_full`, the link retains the sealed frame and retries with exponential
backoff from 250 ms to at most 30 s. Applications stay in the existing local
outbox, and later sequences wait for broker storage acceptance. Stop/refresh
clears connection timers. The broker storage ACK remains transport metadata;
application receipt and retry rules are described below. No layer cap is raised.


A hub uses the ephemeral bit only after the broker advertises it to that
connection. Against an older broker, presence uses the legacy wire shape and
chat stays usable; upgrade the broker to avoid offline presence retention.
The supporting broker withholds ephemeral frames from older member hubs; they
must upgrade to see upgraded hubs' presence. Chat wire shapes remain unchanged. See [wire compatibility](design/bus.md#room-wire-compatibility-1204-t1).

### Room liveness and graceful stop (#1204 T3)

On an ephemeral-capable broker, idle hubs request fresh signed presence every
30 seconds. After three missed periods (90 seconds), room presence becomes
`unknown` in exposed-peer status. This expiry is advisory only and never blocks
outbound transport: current signed roster, exposure, link and Bus proofs still
control sending, including broker queueing for members that are not live. An
explicit signed offline presence keeps its existing handling. Saved presence after
restart is not a fresh liveness observation.
The optional room advisory presence is separate from native peer state; neither
an offline observation nor expiry stops the other person's agent process.

With a legacy broker, status says `liveness not tracked (broker without ephemeral)`.
Upgrade the broker to enable periodic refresh and aging. Legacy connections keep
identical-snapshot dedupe and ordinary state-change publication, with no
periodic refresh or freshness expiry. Older clients may ignore the new advisory
status fields. Codec negotiation is described under Room health diagnostics below.

A graceful room stop immediately fences new publications and attempts one signed
offline snapshot behind an already attempted FIFO frame, bounded to two seconds
before disconnect. Durable sends and receipts remain for recovery. If that
attempt fails or the broker is blocked, supporting recipients expire their last
observation through aging. A crash has the same aging fallback. A legacy broker
has no such expiry guarantee.

### Inspect outstanding work before rotating an epoch (#1204 T3)

Before an epoch-changing owner `expose`, `invite --accept`, `revoke` or an
existing-room `join --roster`, the person preview prints sorted outstanding
sealed delivery ids, without message text. It excludes work still queued only
in the local Bus. The operation rechecks the exact id set and roster digest
with link application publication quiesced; if either changed, obtain a fresh
preview rather than reuse the old confirmation.

The epoch commit quarantines old active sealed intents and removes their
sendable ciphertext. Their local delivery becomes `needs_review` with reason
`room epoch rotated; inspect ahub queue show <id>`; `ahub room status team` labels
its `holdReason` as `epoch rotated`. Inspect each id with
`ahub queue show <delivery-id>` and choose a person disposition. Rotation does
not assert completion, cancel a native turn or replay old ciphertext. Existing
terminal results and person dispositions remain unchanged. T2 already fences
the crash gap between the Store commit and local journal update.

If the command says `epoch rotated but delivery journal holds are unavailable`,
the epoch has committed and old ciphertext is fenced. Inspect `ahub room status`
and the affected queue ids before taking further action; do not assume the
command rolled the roster back.

## Screened room chat (#446 X4)

After joining and confirming fingerprints, expose each receiving native peer with
`ahub room expose team codex`. A non-owner returns the signed exposure request to
the owner and installs the resulting roster as described above. Exposure is empty
by default; this repository enables no room or exposure automatically.

`ahub room status team` lists remote addresses such as `codex@hub-guest`. Send to
one explicitly:

```sh
ahub say @codex@hub-guest "Please inspect the public example"
```

A local exposed agent can use `hub_send` with that exact address. Native peers
can exchange round-trips. X5b below adds the person's durable inbox for replies
to `user@label`. An older X4-only receiver returns signed `failed_safe` with
"person inbox not supported yet (X5)", rather than claiming admission. One remote plus
local recipients is supported. X4 refuses multiple remote recipients before any
delivery: send separately. Ordinary broadcasts stay local. Unknown or ambiguous
addresses refuse. Private turns, PII task references and private envelopes do not
cross; secret/path/pattern/model-screen failures produce an ids-only stub.

Room status and `ahub queue show <delivery-id>` distinguish accepted ciphertext
from **completed (admitted)**, meaning the remote hub saved the chat to its local
peer queue. Native/model execution is independent. Incoming messages remain
untrusted text and grant no local task, role, approval, tool or control authority.

Offline queues are capped at 200 per room. In untracked config.local.json, optional
`rooms.ack_timeout_s` defaults to 600 and `rooms.queue_ttl_h` to 24. The ACK
deadline schedules another attempt under the same application id, while the
original queue TTL stays fixed. Active sends resume after restart. Only queue
expiry or a permanent refusal ends automatic sending; an ordinary remote chat
`needs_review` row does not hold the rest of that peer's queue. A valid late signed
receipt can settle an unresolved ordinary remote row once, with an ids-only event.
Invocation uncertainty keeps its person-only hold; a late transport receipt is
advisory and does not assert the invoked operation's outcome. The person's prior
disposition is never overridden. Old text cannot be
retried to a replacement fingerprint reusing a label. An unproved terminal retry
refuses and requires a deliberately authored new message.
An expired or missing original enqueue deadline likewise refuses retry without
recording a successful disposition. Send a new message deliberately instead.

The ACK timeout starts when the application is handed to the room link, even if
the broker never confirms storage. A reconnect or restart requests fresh signed
presence from the other hub without waiting for its peer state to change.
The receiver commits receipt ciphertext to its local durable outbox before
transport-ACKing an admitted chat, then replays the receipt until broker storage
confirmation. This stays safe at broker capacity one and across receiver restart;
transport settlement still proves admission rather than native execution.
An application awaiting local admission may instead ACK after its crypto inbox
entry commits durably. Later admission uses the same durable receipt outbox;
the waiting chat does not pin broker capacity.
Pauses and lifecycle/recovery holds also block resends. A pause after local
enqueue retains the same delivery id and original expiry. Missing local durable
intent after restart is held as `needs_review`; inspect the delivery named by
`ahub queue show` before choosing a disposition.
Restart and inbound-receipt recovery apply any previously recorded person
disposition before automatic settlement. A known signed transport outcome remains
evidence alongside the decision; it does not undo the person's disposition.
Capacity refusal of one incoming chat retains that pending chat while allowing
later packets and receipts through; a later online or person-disposition event
rechecks admission. Merely reading room status applies no disposition.
Up to eight matching receipt payloads per room have a separate 1,024-byte-per-row
durable reserve so a full chat inbox can still settle outstanding deliveries.
The normal chat cap is unchanged; unrelated receipts cannot use that reserve.
Presence retired at the ordinary cap is re-fetched once after capacity frees,
so that a dropped state update does not leave the remote view stale indefinitely.
Fresh authenticated chat that reaches the full ordinary inbox is refused and
transport-ACKed without admission or a signed receipt. The sender's application
expires to `needs_review`; receipt traffic behind the refused chat continues.

For an incoming uncertain admission, copy its frame id from room status:

```sh
ahub room resolve team --frame FRAME_DIGEST --action accept
ahub room resolve team --frame FRAME_DIGEST --action discard
```

Both forms show the owner/member fingerprints before asking y/N. Non-TTY use
requires `--confirm` with a matching member fingerprint prefix. Accept records
that the person vouches the local peer got it; discard records dropping it.
Neither sends, re-admits, or produces a signed completion. The displayed state is
**disposed (accept|discard, by person)**. These mutations refuse agent shells and
`--live-test`, including after leaving a room.

Application-id and trace metadata retain 30 days/10,000 per room, evicting settled
rows first. Protected uncertainty remains until person disposition. Outside that
retention no historical app-id or trace claim is made. Automatic resend can reach
this ceiling and admit an application again after settled eviction; the guarantee
is "exactly once within dedupe ceiling". Pinning retryable identities or #737
receipt confirmation would extend it. Permanent seq floors and
MAX_HOP 3 still apply. Status prioritizes uncertainty and bounds each direction's
rows to 200; queue inspection remains the delivery-history entry point. Broker,
TLS/proxy and real two-machine/account receipts remain separate live proof.

## Room metadata views (#446 X5)

Press `8` in the panel console for Rooms, or open Agents > Rooms in the dashboard.
The views show local room membership, owner/self fingerprints, member count,
link state and exposed remote peer ids/states. They are hidden when an older hub
supplies no room field or no rooms are configured. An unavailable read clears
old metadata and shows an unavailable state. Reading status creates no room
storage or keys.

Relay figures are **since daemon startup**, not lifetime totals: outbound is
successful handoffs, inbound is confirmed local admissions, and withheld is a
subset of outbound handoffs. Unknown values display as unknown, not zero. A
daemon restart resets the counters; neither a handoff nor these totals means a
native agent completed its work.

These views contain no message body/title, reason, broker URL, key material or delivery
history. Use the existing queue inspection workflow for delivery uncertainty.
The metadata-only views never show inbox bodies; use the separate person-only
CLI below.

## Person-only room inbox (#446 X5b)

List metadata for all rooms or one named room:

```sh
ahub room inbox [<name>] [--json]
```

The list contains local inbox ids, room/sender metadata, times, byte counts and
states, never body previews. One operand is always a room name, even `show`,
`done` or `discard`. Only an action plus an exact local UUID acts on a message:

```sh
ahub room inbox show <id>
ahub room inbox done <id>
ahub room inbox discard <id>
```

Only list accepts `--json`; none of these commands accepts `--confirm` or asks
for a fingerprint. All inbox forms refuse agent shells, conductors and
`--live-test`. They also refuse during recovery or a Bus hold. Show prints one
sanitized, terminal-safe untrusted body and does not mark it done. Done/discard
immediately purge the body and keep a metadata stub. Their acknowledgement is
sent before any background room retry. Expiry does the same;
there is no archive or read-after-done command. Capacity released by done/discard
or a real TTL purge wakes already-deferred X4 traffic; no new receipt is sent for
the purged entry, and idle ticks never poll queued plaintext. Dashboard, status, logs, memory,
models and observers never receive the body.

The sender's **completed (inbox)** receipt means durable admission, not that the
person read or completed the request. Reading, disposing or expiring the local
copy never changes that receipt. Inbound session counts increment once at
admission. Older X4 senders cannot parse the new inbox receipt reasons and stay
uncertain; do not treat mixed-version traffic as verified success.

Limits are 100 unread messages per room, 64 KiB decoded body per message and
4 MiB canonical payload bytes retained globally, including JSON overhead and
escaping (the displayed size remains decoded UTF-8 body bytes). The unchanged 64 KiB entire-wire cap
leaves less than 64 KiB for a sendable body. Schema 4 starts the 30-day TTL at the
first durable local crypto arrival, not remote time or restart. Legacy pending
person traffic without that age gets fixed `failed_safe/inbox_age_unavailable`;
native peer traffic is unchanged. Full, oversized or already-expired person
admissions return fixed `inbox_full`, `inbox_oversize` or `inbox_expired` refusals.

Up to 1,000 settled stubs per room remain for 30 days after settlement, oldest
first. Unread messages and their admission identities are protected, along with
unsettled identities at the shared 10,000-per-room application cap. One loaded
daemon expiry hook runs every 30 seconds, including for left rooms; it creates
no empty room database or keys. Bodies remain plaintext in the protected local
store, with no new encryption-at-rest or secure-erasure guarantee.

Lists are complete up to 1,100 rows. If an all-room list exceeds that limit, the
CLI explicitly asks you to choose a room name; it never silently truncates.
ponytail: pagination is later work; a filtered room's 100 unread plus 1,000
settled stubs fit the current response ceiling.

## Handing work to another project (#604, agent-hub#1030)

Work that belongs to another repository that runs agent-hub on this machine goes onto that repository's board, not into this session. Its own roles plan, implement and review it, and each state change it reaches is reported back here. The first case: after a library you maintain publishes a release that a consumer's declared range does not cover, raising it in the consumer belongs on the consumer's board.

```
ahub task handoff --project <root|id> [<class>] <title...> [--path <p>]... [--issue <n>] [--task <n>] [--detail <text>] [--duplicate-ok <reason>] [--key <uuid>]
```

- `--project` is the other project's canonical root or its id from `ahub projects`. It must be registered and its hub must be running (`ahub up` in that project). Nothing is queued: a hub that is not running is refused with that action.
- A feature or behavior change first gets a spec issue in the other repository: pass its number as `--issue`. A mechanical chore (an exact version pin, a regenerated file) goes straight to a task.
- A spec issue that already has an open task on the other board is refused with those task ids (#1175): a task counts when its lifecycle receipt names the issue, its title has a bare `#N` or an `owner/repo#N` of that repository, or its detail holds the `spec issue: #N in this repository` line a handoff keeps; a closed (approved or cancelled) task and a `[pii]` task do not count, so a private task's id is never named to another project. Use the open task, or pass `--duplicate-ok <reason>` (the tool's `duplicate_ok`, at most 300 characters) when the work is genuinely separate; the reason is kept as a line of the new task. The check runs on the target right before the task is written and stores nothing when it refuses, so a refused duplicate is never offered to an owner or escalated by the idle sweep. A handoff with no `--issue` has nothing to compare and is not refused.
- `--path` names files in the other project, repository-relative (no absolute path, `~` or `..`). `--task` names your own task this comes from, so a `[pii]` one is refused.
- `ahub task handoff` is the person's command (an agent's shell is refused it as a console command). Agents use `hub_task_handoff` (the same fields) when they hold the planner or conductor role; `hub_task_handoffs` and `ahub board --handoffs` list what this project handed over and the last state each target reported.

What the other project sees: an ownerless proposed task, made by its hub, whose detail ends with where it came from; `ahub board` and `ahub task show` there name the origin project and peer. Its own routing offers it as it would a local proposal. The requesting peer has no identity or authority there: it cannot accept, review, approve, assign or cancel. The receiving project's configured conductor can cancel such a task with `hub_task_cancel` (or `ahub task cancel` as the person), with a reason, while nobody has accepted it and it has no branch, commit, PR, check, done or verdict (#1175); the history records the conductor as the actor, and the origin hears `agent-hub task N cancelled` through the follow-back, never the reason. Any other peer keeps the planner's own-work rule.

What comes back: each change is recorded in `ahub board --handoffs`, and an agent that handed the task over also gets one `kind: task` message per change, `agent-hub task 123 accepted`, `in review`, `approved: PR #7 at <sha>`, `declined` or `cancelled` (a handoff you made from the terminal sends you no message: read the list). It carries an event name, a PR number and a full head, never the other project's text. If this project's hub was stopped meanwhile, it asks each running target hub where its open handoffs stand when it starts again; a target that is down then is asked at the next start. From #1203 T2 the origin also asks every 5 minutes, and at once when a target's hub restarts or moves, for every handoff that is not cancelled (an approved one for a week), in requests of 200, so a state change that missed the first notify arrives within one period; an event that arrives out of order is ignored by its sequence, and a reviewer's `changes requested` and a reopen are reported (`agent-hub task 123 changes requested`, `reopened`).

A handoff the target did not confirm (#1203 T1): a timeout or a closed connection does not mean refused, because the target may have filed the task. Each request carries a key (`handoffKey`, a UUID the origin mints), the target files it once, and the origin sends the same key once more and then asks the target by key before it gives up. The command waits for that whole recovery (up to about 90 seconds when the target is slow), not the usual 30. If it still cannot tell, the refusal is `outcome_unknown` and names the key: run the same `ahub task handoff` again with `--key <uuid>` (an agent passes `handoffKey`), and the target answers with the task it already made instead of a second one. The same key with a different request is refused. A target without `task_handoff_key` gets no key: it keeps the old behavior, and `outcome_unknown` then says to check its board (`ahub board` there) before handing the task off again.

Diagnostics and repair (#1203 T3): `ahub task handoff --list` shows every handoff this project made with its age since the last report and whether its target can be reached now: `reachable`, `unreachable` with the cause and what to run (`ahub up` in its root, `ahub upgrade`, `ahub status`), or `moved` when the project id is no longer in `ahub projects` (its root moved or it was removed: run `ahub up` in the new root, then hand the work off again; the old id is not repaired). It reads the registry and the target's descriptor, so it answers at once. `ahub task handoff --sync` (the person or the conductor) asks every target now instead of at the next 5-minute pass and prints the refreshed list; it waits at most 20 seconds, and if several targets are slow or down it prints the list so far with "catch-up still running for N targets: run `ahub task handoff --list` in a minute" (the pass goes on in the background) instead of timing out. A target on another wire version is refused as `older_target` with the upgrade step. An instance mismatch names `ahub projects`, and `ahub up` only if the intended target is not running. A failed notify or catch-up writes one `hub.log` line per target and cause every 15 minutes (`handoff catch-up of <project> failed: <cause>`). A catch-up request that gets no usable reply (the target refused it, timed out or dropped the connection) is a failure like any other: its target reads `unreachable` with the cause "no answer to the state request" and the step `ahub status` in that project, one log line is written, and the earlier failure is not cleared. If the pass itself fails, `--sync` answers `synced: false` with that cause instead of `synced: true`.

Refusals, each named with the action: an unregistered target, this very project, a hub that is not running, a request over 8 KiB or with an unknown field, a caller that is not a planner, the conductor or the person, a private (PII) turn, a spec issue that already has an open task there (the refusal lists their ids; `--duplicate-ok <reason>` overrides it; an issue number only matches work of the target's own repository, and an imported backlog row counts by its `external` issue; a target from before #1175 refuses `duplicate_ok` as an unknown field and the refusal says to run `ahub upgrade` there or hand off without it), a `[pii]` task named with `--task`, text that matches the target's PII patterns or that the target's screen cannot clear, a target hub in recovery or shutting down (hand it off again after that ends), and an older target hub (it lacks the `task_handoff` feature: run `ahub upgrade` in that project).

Recovery: `task_handoff` is its own recovery label. A project that holds a handoff row, in either direction, refuses a recovery target that lacks it.

## The agents `ahub up` starts (#608, agent-hub#1040)

`ahub up` starts the hub, then asks it to start this project's default agents: `claude` and `codex` unless you chose others. Each goes through the same hub start as the dashboard's Start button and `ahub <peer>` from the console, so the peer's own start mode applies (`peers.<id>.start_mode`), the terminal comes from `terminal.open` or Orca, and a peer that is already attached answers `already attached`. There is no headless fallback: a peer whose TUI cannot be opened is refused with the command to run by hand.

```
ahub up                  # the hub, then one line per agent
ahub up --no-agents      # the hub alone, for this run
ahub setup --agents kimi,codex      # this machine's choice, once
ahub settings set start.agents claude,codex,kimi     # this project's own list; none for no agent; inherit removes it
```

```
claude: started tui (terminal.open), it attaches when its TUI is ready
codex: already attached
kimi: not started: kimi starts in its TUI and the hub could not open a terminal for it (...). Run ahub kimi in a terminal
```

- **Where the list comes from, in order:** `start.agents` in the project's `.agenthub/config.local.json` (an empty list starts none), else the machine default `start.agents` in `~/.agenthub/defaults.json`, else `["claude", "codex"]`. `ahub setup` asks once ("Agents to start with ahub up"); `--agents <a,b>` answers it, `--yes` keeps the current choice or the default, and a run with no terminal and neither flag keeps the default and says so. `ahub init` of a new project copies the machine default into its `config.local.json`; a project that has its own value keeps it, and nothing is written into a file git tracks.
- **Machine-local and trust tier:** `start.agents` is in `ALL_MACHINE_LOCAL`: a committed `.agenthub/config.json` that sets it is ignored with a notice, because a clone must not open terminals on someone else's machine. It is a settings row in the Start group that raises what the hub does on its own, so it needs a settings session (`ahub ui --settings`) or a person's terminal. `defaults.json` stays owner-only (mode 0600, outside every project root); a `start` entry that is not an object with an `agents` list of allowed peers makes the whole file ignored with the existing notice.
- **Who and when:** only a person's own `ahub up` and the dashboard manager's "start" (which counts as one). An agent's `ahub up` is refused by the CLI before this runs. A daemon restart, a crash recovery, a config reload (`start` applies at the next `ahub up`) and the `ahub up` that an upgrade or recovery relaunches (it carries `AGENTHUB_RECOVERY_OPERATION`) start nothing from the list, and the running hub never reads it. `--live-test` starts none either.
- **What can be listed:** `claude`, `codex`, `kimi`, `pi`, `local` and `jcode`. `qwen` is refused when saved ("the hub never opens its TUI"), as are `agy`, a declared instance, a Claude channel extra, an unknown id and a duplicate, each with a named reason; the loader and the settings writer say the same words. Pi in the list is the user-facing switch; `pi.auto_start` keeps working for configs that have it.
- **Failure is local to one agent:** a refusal, a terminal provider that fails or a request that times out prints its own line and never stops the hub or the other agents. The lines come from the hub's own reply, so a provider's error text stays in `hub.log`.

## The worktree shelf (#1057)

Implementers work in `.worktrees/<name>`, and after a guarded merge only the owner removes its local worktree and branch (`docs/sdlc.md`, Merge result and cleanup), so finished worktrees pile up. The shelf shows which ones are finished. It never removes anything itself.

```
ahub worktrees                         # live worktrees, then the shelf with each settled row's reason
ahub worktrees --json
ahub worktrees tidy                    # a preview: what is safe to remove, what is refused and why, and a fingerprint
ahub worktrees tidy --confirm <fingerprint>    # the person's own terminal: re-reads everything, then removes
```

- **Settled is derived, never stored.** The hub stores facts and two person overrides, and works the groups out on every read. Rules, in order: the main checkout and the declared instance worktrees (`.worktrees/<instance>`) are never shelved; an override that is still in force wins; a merged or closed PR with no work newer than its change time settles the worktree; `worktrees.quiet_days` without activity settles it (`quiet`); everything else is live. A settled row names its reason: `merged`, `closed`, `quiet` or `parked`; a row bound to a PII task shows `settled` and `task: private` instead of its PR reason, task id and PR.
- **What counts as activity.** The latest of the HEAD commit time, the mtime of the worktree's own index (uncommitted editing) and the bound task's latest history entry written by anyone but the hub. The hub's own entries (the merge result, the owner notice) are left out, or a merge would always look like newer work. The tidy preview's own git reads run with `--no-optional-locks`, so previewing does not touch the index and make a settled worktree look active. A worktree whose commit time or index could not be read (a failed git call, or the read budget used up) is listed live with `complete: false` and is never shelved by a PR or by quiet time: unknown is not settled.
- **Where the PR state comes from.** From the board only: a guarded merge's own record says `merged`. A cancelled task says nothing about its PR, and a task with no record reads `unknown`. Nothing is fetched from GitHub when you open the panel, run `ahub worktrees`, or when the inbox alert is computed.
- **Park, Pin and Unset.** The Agents panel offers Park (move a live row to the shelf), Pin (keep a settled row live) and Unset (back to what the rules derive). An override counts only while the worktree has had no newer activity (`lastActiveAt <= at`); later work makes it inert and the next write removes it. They are control operations `worktree_override_set` and `worktree_override_clear`, console role only: an agent's tools connection is refused.
- **Refresh PR states.** The one button that reads GitHub, and the control operation `worktrees_refresh_prs` behind it (console role). It reads each bound task's PR with the same `readSdlcPr` the guarded merge uses, at most 8 PRs, 8 s per call and 25 s in all, one refresh at a time, and keeps what it read in the hub's memory (a restart forgets it and those rows read `unknown` again). A PR GitHub could not answer for keeps its old state and is counted as unreadable. The plugin asks you to confirm it first, because it calls GitHub.
- **The panel's list.** The Agents view gets a `worktrees` field from a cache at most 30 s old that a background read refreshes: a snapshot never waits for git. Paths are project-relative (or the basename outside the project root), never absolute. The panel shows removal as the command to copy, never as a button.
- **The inbox alert.** acon's inbox raises one `alert` item per project when the settled count is above `worktrees.alert_over` (0 never). It carries the count and a link to the Agents panel, nothing else: no path, branch or task.
- **Settings.** `worktrees.quiet_days` (default 7, 0 = never shelve by quiet time) and `worktrees.alert_over` (default 10, 0 = never alert), both live, both on the Switches group of `ahub settings` and the dashboard.
- **Tidy is the person's.** `tidy` previews each settled row that is safe to remove and each refused row with its reasons: dirty, locked, commits not pushed to the upstream or no upstream, branch not merged into the default branch, the main checkout, an instance worktree, a bound task that is not approved or cancelled, or anything git could not tell. The preview ends with a fingerprint over the rows. `--confirm <fingerprint>` is console class (an agent can only preview, and `--live-test` refuses it), re-reads everything, refuses the whole run if the set changed, and runs exactly two argv shapes per row, `git worktree remove <path>` and `git branch -d <branch>`, then reads each result back. `--force` and `-D` never appear: git itself refuses a dirty tree or an unmerged branch. A worktree edited between the confirm's re-read and the removal is not guarded by anything but git's own refusal.
- **The daemon deletes nothing.** The shelf's git port runs only `worktree list --porcelain -z`, `log -1 --format=%ct HEAD` and `rev-parse --absolute-git-dir`, and refuses any other argv before spawning. Removal exists only in the CLI process (`src/cli/worktree-tidy.ts`), which the daemon never imports; `test/worktree-shelf.test.ts` greps the daemon-reachable modules for a removal.
- **Limits.** At most 256 worktrees are listed and 1024 overrides read; git reads run 4 at a time under a 3 s total budget (5 s per call), asynchronously, so a slow git never holds the daemon. The quiet threshold is the owner's call after a week of use.

## Results: what a run you started left behind (#1054)

A run you started (a message you sent to a peer, from the console, `ahub say` or acon) settles into one **result** when the adapter's own signal says it ended and nothing else is pending: no queued continuation, open permission or question, owned child, running check or held delivery. Peers whose adapter declares no settle signal (agy, person-typed Codex turns) leave none; Kimi in its own TUI leaves one only when started with `ahub kimi` on the verified Kimi 2.5.2 (see [Kimi in its own TUI](#kimi-in-its-own-tui)). Outcomes are `done`, `failed`, `limit` and `interrupted` (the hub restarted mid-run); an explicit stop by you and a budget pause leave no result. A result is **unread** until you mark it read; nothing a snapshot, `ahub status` or `ahub results` reads ever marks one.

- `ahub results [--unread]` lists them, newest first, unread ones marked `*`: id, `<peer>: <outcome word>` (a private result is `a private result`), when it settled and how long it ran. It prints no prompt and no reply.
- `ahub results --read <id>` marks one read (it must exist and be unread). `--read-all` marks every unread result of the project. `--unread-last` lights the most recent read one again by deleting its receipt.
- An unread result is a `result` need at level `watch` in `ahub status` and `ahub console` (ids, the peer and the time only): it never makes the state read as waiting, blocked or review. The console stream tells you once, with no text.
- `result_seen` and `results` are console-role control messages that always reply; an agent's connection and an agent shell (`ahub results` is the person's command) are refused, and nothing a peer writes counts as a receipt.
- Retention: the table is bounded. At each start the hub keeps the newest 500 READ results and deletes older read ones with their receipts; an unread result is never deleted, and neither is an open run. A hub restart while a peer is under a budget pause ends its open run with no result (a pause stays a budget need, `ahub budget`), whatever work was still pending; any other open run settles `interrupted`, once.
- Recovery: a hub from before this feature ignores the tables, so a target without the `completions` label is refused while a run is open (let it settle) or a result is unread (`ahub results --read-all`, or use a supporting release).
- **In the dashboard and the acon console (#1054 T6).** The Agents view of `ahub ui` and of the acon panel has a Results section: the unread results (the newest 50, with a count of any older ones and the command that lists them), each with `<peer>: <outcome word>`, when it settled, how long it ran and a one-line **detail**, and the buttons Mark read, Mark all read and Mark last unread again (the relight; it appears only when a read result exists). Opening or refreshing the panel never marks anything read: a poll is not a person looking.
- **The detail line is built when you look, never stored.** A completion row keeps envelope ids only, so the head of the request you started (one line, 120 characters) is read from the envelope the bus still holds, passed through the hub's own secret, PII and private-path screens, shown, and thrown away. A private run shows `a private request` without its body being read; a head the screens refuse shows `request withheld by the privacy screen`; a result whose request the bus no longer holds (a long-running hub whose cache turned over, or a restarted one) shows no detail. A live-test dashboard session gets no results and is refused every receipt.
- **In the acon inbox.** With a console that advertises both `inbox.result` and `action.meta`, an unread result is an inbox item in the `result` group: kind `result`, title `<peer>: <outcome word>` (`<peer>: a private result` when private), the detail, a chip by outcome (done, failed, limit, interrupted), one `open` verb that links to the Agents panel, and `seen: { action: "result_seen" }`, which acon runs once per page session when the result has been in view (the seeing rule is agent-console#27, not the hub's). With either feature missing, nothing is published and results stay in the Agents panel, `ahub console`, `ahub status` and `ahub results`. A read item leaves the inbox, so **mark unread is not an inbox verb**: it is the panel's button and `ahub results --unread-last`.

## Questions for the person: `hub_ask` (#1053)

A peer asks with `hub_ask` (the same tool for Claude, Codex, Kimi, Jcode, Pi and the local worker). The call waits for the person, then answers one of:

| status | meaning |
|---|---|
| `answered` | the person's options, inside the wait window |
| `pending` | the window ended; the row stays open and the answer arrives later as one message of kind `answer` whose first line is `reply_to: <questionSet>` |
| `superseded` | the person sent this peer a normal message instead; that message is delivered as usual |
| `cancelled` | `stopped` (a stop, kill or roster removal), `turn_aborted`, `session_changed` or `expired`, as `reason` |
| `unavailable` | `unattended`: the hub is, or the peer was started, with `--unattended`; nothing was asked and nothing waits |

- **Wait window.** Per adapter (`questionWaitMs`): 45 s for the MCP peers, 300 s for Pi and the local worker. These are provisional until T1 measures each client's real tool-call timeout. Override per kind with `questions.wait_ms.<kind>` (1000 to 600000 ms). The Claude channel holds its control request open past the client's 30 s cap. Pi's bridge lifts its 60 s idle timeout for this one call and streams the reply (headers at once, a space every 15 s, then the JSON), because Pi installs a global undici dispatcher with a 300 s headers and body timeout (Pi 1.4.0, measured `UND_ERR_HEADERS_TIMEOUT`); a client that drops anyway leaves the question open, so its answer arrives as the late envelope.
- **Expiry.** `questions.ttl_s` (60 to 2592000, default 86400) expires an unanswered question. The peer gets a hub notice of kind `status`, never an answer, and a waiting call is told `cancelled` with reason `expired`.
- **Restart.** Open questions are stored in `hub.db` and survive a restart. A waiting call ends `pending` at shutdown and at a recovery `prepare`; the row stays open and its answer takes the late path. A row whose peer is back with a different native session is cancelled (`session_changed`); a peer that reports no session is never cancelled for it.
- **Bounds.** At most 8 open questions per peer and 64 in all: a loop of questions turns into a refusal, not a flood.
- **Answering.** The person uses the existing console, terminal or acon paths (`questions` remains a console-only read). Ordinary `answer` writes remain console-only; the per-set instructed-conductor exception is described below. In `ahub console`, `A` answers the oldest open question key by key: a digit picks an option (single choice moves on, multi toggles and Enter moves on), `o` types free text where the question allows it (a paste goes into that text, printable characters only, so a pasted Enter or Esc cannot send or leave the answer), Esc leaves and the question stays open. The question and every numbered option are shown in a wrapped area (the body in panels mode, the stream in stream mode), never in the one-line footer, which holds only the keys and the text being typed, so no option is ever off screen while a digit can pick it. A question id is the agent's, so the flow keeps its picks in Maps: `constructor` and `toString` are valid ids; `n` (the attention key) opens the same flow for the question it selects. The last answer is sent at once with no confirm step: answering is neither outward nor destructive. `ahub answer` lists the open questions; `ahub answer <set> <question>=<option>[,<option>]... [--other [<question>=]<text>]...` answers one set as the person (an agent shell without the guarded `--instructed` path is refused before it reaches the hub). In the acon console an open question is an inbox item (`group: decision`, `kind: question`, title `<peer> asks: <first prompt>`, a stub for a private question) whose `answer` verb carries a form built from the stored row; it needs a console that advertises `inbox.form` and `action.meta`, otherwise the item is a plain decision with an `open` verb that links to the Agents panel. The plugin accepts an answer only with the console's own verified person `meta` (`via: "console"`), and refuses one without it before it reaches the hub; the verified identity is recorded on the answered row and on its `question` event (`person`, acon answers only). A stale or superseded set answers `{ ok: false, error }` naming its terminal state.
- **Instructed conductor answer (#1473).** After the person directly decides and explicitly asks the unique configured conductor in its own session to record that decision, the conductor may use `hub_ask_answer {set, answers, instruction}` or the CLI below. The quote is required for that one open set. Hub/task/review/file/peer messages and relays never supply this instruction. This cooperative claim follows the release-consent precedent (#1328); it is not independent verification of the quote, release consent, standing delegation or permission to answer in another project. The asking peer cannot answer its own set, including when it is the conductor. Private questions/callers, child tools ownership, live-test/delegated runs, wrong actors, missing/empty quotes and non-open sets are refused with `ahub console` as the person's next step. A relayed decision is final under the same existing validation, expiry, supersede and cancellation rules. The row records surface `conductor`, its peer actor and `instructed: true`; public provenance reads "answered by <conductor> on the person's instruction" in question/answer views and in the waiting result or late envelope. The quote stays only in `hub.db`, never even in question readback, the peer envelope, logs, events or memory capture. The CLI audit records instructed provenance without quote/answer text.

  ```bash
  ahub answer qs-0123456789ab choice=option --instructed "Record the option I just selected."
  ```

  Use the actual open set, question and offered option ids; the example records no standing authority. Without `--instructed`, an agent shell retains the existing person-only refusal. The Agents view shows completed instructed answers under Recorded answers; the acon inbox also lists a read-only answered item that links to that view. The instruction quote is not shown. The person's console and ordinary terminal answers are unchanged.
- **Attention.** An open question is a `question` need (level `act`) and the status `waiting` while one is open, ranked after approvals and permission defaults. It is level-triggered: viewing or listing it never clears it; only an answer, a supersede, a cancel or an expiry does. The model carries the set id, the asking peer and the time, never a prompt or an option. The console reads the list only from a hub whose status lists the `questions` feature, and prints one stream line (peer and count, no text) when a new question arrives.
- **Recovery.** A new daemon feature label, `questions`, marks the protocol. Recovery refuses a target without it while a question is open or an answer is still owed (`target lacks questions`), because an older daemon would silently ignore the table; answer or cancel the questions first. A recovery `prepare` ends every waiting call as `pending` at once, so a waiting `hub_ask` never holds the prepare for its window. The Claude plugin reports a hub without the label as "this hub does not support questions".
- **Events.** `question` records `set`, `peer`, `event` (`asked`, `answered`, `pending`, `superseded`, `cancelled`, `expired`, `unavailable`), `latencyMs`, `surface`, `reason`, `questions` (a count) and `private`; never any text.

## Anchored review comments (#1056)

Open a task review in acon and refresh explicitly to read current immutable material. Routine dashboard polls do not query GitHub or Git for review comments. Standalone `ahub ui` is read-only. Unavailable public comments retain their stored text in the person view, but Send refuses those selected IDs until their material is available.

The hub exact-quote limit is 512 UTF-8 bytes, stricter than acon's character allowance; prefix and suffix each allow 64 bytes. A refusal identifies the field and limit. Shorten the selection, or delete and recreate a stale-head draft from refreshed material. Stored selectors keep exact source text. Delete or dismiss requires confirmation.

An unconfirmed Send keeps its saved package. Inspect `ahub queue list --peer <owner>` and `ahub queue show <id>` before using the confirmed Retry package action in acon. Recovery reuses the saved envelope identity and text; an already published package starts no new turn. A failed or discarded delivery refuses resend with its state and the queue inspection step instead of reporting queued success. Reviewer requests have a distinct marker and their terminal delivery rows are pruned normally. A previously unpublished package whose comments were dismissed or became private refuses: inspect the saved queue, dismiss the old comments and recreate safe comments when appropriate. An unchanged count-only private stub can recover without revealing text. Legacy or unavailable evidence refuses rather than inventing a fresh message. A queued receipt proves publication, not owner consumption. Package receipts retain terminal delivery payloads alongside their board packages until a future archival transaction can replace both with IDs-only tombstones.

Comment IDs resolve only after final successful `hub_task_done`, not while a check runs or after it fails. Until resolution or person dismissal, open sent comments and outstanding anchored findings keep scoped responses out of memory and observer views; this does not hide the summary or check tail from its intended recipient.

For a memory note naming that task, anchored-finding scope conservatively lasts until task close, including a finding later marked fixed. Sent-comment task scope lasts until resolution or person dismissal. Unknown or over-budget task metadata refuses that named-task memory write; it does not impose a peer-wide capture hold based on another task. Capture, progress and session titles follow the current review input instead. Public comment edits from another person appear on the next explicit refresh.

An owner/reviewer change does not dispose of an earlier review delivery. Its original recipient remains excluded from shared-memory writes naming that task while that delivery is queued or unsettled. Dismissing comments does not dispose of the envelope: inspect `ahub queue list --peer <original-recipient>` and explicitly settle the relevant delivery when appropriate.

Comment resolution does not end the current review input. A delivered quote-bearing input or a submitted anchored verdict keeps that input's capture and shared-memory writes held through the final answer. Ordinary next-turn input can release it where the transport confirms replacement; restored pull-only sessions follow the native-identity rule below. Presence-only traffic does not release the hold; neither does additional input within the same active turn. Previously saved incoming-label bindings to a review-bearing batch are ignored; a later ordinary input can establish a fresh binding. The local worker latches before the whole anchored-verdict tool batch and does not retain that turn in history, even if the verdict is refused. Historical review scope on another task alone does not block an ordinary new turn. Restarting the daemon does not release a surviving session's recorded review-input hold. The journal stores peer identity, session/input ID hashes and receipt-integrity metadata. In an intact, readable, complete store, a new session with no matching held row is clean immediately. Unreadable or corrupt storage, or unconfirmed coverage for the current session, keeps capture, progress, titles and unscoped shared-memory writes excluded. A validated release receipt confirms its own session while other unconfirmed identities remain held. For an identified pull-only session, a positive held row stays excluded across restart until confirmed native identity changes. Its own incomplete marker clears after verified ordinary replacement or a confirmed new session; legacy coverage alone does not create a sticky hold. A peer with no stable native session id can still receive review input under an in-RAM unknown-held scope, with a peer-level incomplete marker retained until release. For a never-identified peer with no positive or incomplete SID record, a later verified ordinary replacement in that daemon run releases its RAM hold and own marker; in an intact complete store that released absence stays clean after restart. If earlier positive or incomplete SID records exist and the current id cannot be matched, delivery remains available but observer writes stay held. `ahub status` names the peer as "held: session unidentified, earlier review input" and asks for reconnection so its real id is known. A fresh confirmed SID uses its own state; old SID rows remain protected. First confirmation persists any current RAM quote under that SID before clearing the peer-level marker. This records current-input replacement, not erasure of vendor-native transcript history. No launch, attach or socket id is treated as native identity. Presence and additional input within a known active held turn cannot clear the hold. Required provenance persistence happens before a review package is handed over, and a failure refuses that handout. Recovery targets must support `review_observer_input_state` while held or unknown provenance exists. Provenance receipts are bounded at 4096 rows per project. Legacy coverage completes once the journal has no unsettled pre-upgrade review-scoped delivery. At complete coverage, NULL clean receipts are pruned because absence is clean. Positive and uncertain holds remain; a confirmed new session clears only the peer-level incomplete marker, not an older session's held row. Closed fresh-reviewer receipts can still be removed with matching disposal proof. The cap refuses new quote handoffs rather than evicting surviving or uncertain holds. A reviewer still receives the owner's completion summary; recipient output remains distinct from observer exclusion.

A local tool batch containing an anchored `hub_review` refuses `hub_remember` and `hub_task_propose` before either can write, including siblings listed before the verdict and later steps of that held turn. Save notes or propose new work in a later ordinary turn. Reading a non-empty inbox during an invocation does not replace its answer-routing input; pulled review provenance still protects observers. If provenance admission refuses `hub_inbox`, reconnect the session and retry; if the refusal persists, inspect `ahub status` for delivery journal health. The refused delivery remains queued.

### Review-input provenance health (#728)

Read the separate provenance health in `ahub status`. Legacy coverage can remain incomplete while a captured review delivery is unsettled; inspect it with `ahub queue list` and `ahub queue show <id>`, and give it an explicit disposition rather than replaying it as a repair. Reopen/import conservatively recaptures all handed non-terminal rows present then, so a guarded B can keep this window open after the original legacy A settles. Timeout to needs_review does not itself close the window. Delivery still proceeds, and legacy coverage alone does not create a sticky pull-only hold. Ordinary input and confirmed session changes release only the applicable incomplete marker. A healthy positive hold is expected protection, not a journal failure.

Corrupt or unreadable provenance stays unknown and held. The status next step directs the person to arrange review-input provenance inspection/repair while preserving task rows, delivery dispositions and known positive holds. No reset command or automatic repair is provided in this slice. Do not replace the whole database with an older copy or edit a live journal to make the warning disappear; that can lose disposition evidence and replay work. Keep affected work held until a maintainer can recover trustworthy provenance.

## Memory sync diagnosis (#1173)

A ready memory profile does not prove a successful sync. Read the separate automatic-sync result and timestamp in `ahub status` or Memory. It resets to not run after daemon restart; it is not a machine-global record of manual CLI attempts. Missing remote configuration (shared v1, generation and sharded homes alike) is the neutral `not-configured` state; an interrupted/stopped attempt is neutral `stopped`. Both keep their safe next step and produce no failure log under `quietSyncError`.

For policy-declined rows, a person or an agent shell runs `ahub memory declined --json` to inspect IDs and safe rule categories, never note text. The agent-mem public `inspectSyncPolicy` API (0.32.1 and later) bounds physical outbound inspection for shared-v1 and generation profiles. A complete result supplies the declined IDs and rules; `complete:false` means the scan is unavailable, stale or over its diagnostic bound, not zero declined rows. The command stays read-only and rechecks its profile binding. No migration or policy edit is performed automatically.

The hub projects verified withheld/exported counts when a trusted SDK sync returns a successful placement result. That projection is covered by an injected-result fixture, not an activated-store sync. Agent-mem requires a fresh `placementAttestation` even for an already active v3 store; since 0.35.0 the daemon builds one with the package's own `createPlacementAttestation` on every sync pass and supplies no writer facts of its own, so no attestation is fabricated. A refused attestation is the closed cause `writer` in status, the dashboard and the log: its category, its cause class (`missing`, `changed`, `unavailable`) and the next step (repair the amem install and its host pin, then a person runs `amem migrate --sync-placement --dry-run`). An in-place agent-mem patch upgrade inside the declared range turns the writer proof to `changed` the same way, because placement records each writer's installed version and file hash, and it stays that way until a person re-runs `amem migrate --sync-placement --dry-run`. Activation remains a person-run action. A nonzero withheld count in a successful result is not a transport failure and does not mean those rows were deleted, rewritten or published. Inspect the IDs and rules before deliberately changing any source or approved policy; a forget operation does not remove its original text from physical history.

A legacy store without active per-row placement still blocks a sync containing declined rows. Status names inactive placement and the person-only `amem migrate --sync-placement --dry-run` preview, which requires every local writer installation through repeatable `--writer-root` flags. It keeps `ahub memory declined` as the safe inspection step. The native CLI supports activation from 0.22.0; the declared core floor is 0.33.0. See the [activation preview and prerequisites](memory.md#automatic-sync-health-1173) before any separately authorized apply. Preview writes nothing, and activation does not migrate layouts, change policy or automatically raise a format floor. The hub does not invoke it or fabricate its proof.

The bounded diagnostic addresses #1173 AC4; AC5 has result projection and the host attestation. Whether an activated store syncs on a person's machine is not established by the isolated fixtures.

For a transport or unknown failure, run `ahub memory sync` as a person to see the local diagnostic. Logs keep only the cause class and known declined count, once per unchanged failure episode. Complete declined-ID sets can distinguish a changed failure without placing IDs or bodies in the log; incomplete inspection keeps the set unknown. Existing write-time screening and profile/privacy fences remain. SDK adoption and isolated fixtures do not prove live rollout or a successful sync of the person's memory home.

### Room health diagnostics (#1204 T4)

`ahub room status [name]` prints retained refused-frame counts by reason, room
outbox depth, oldest age, last signed receipt age and the link cause with a next
step. `--json` contains the same allowlisted metadata. Unknown age is not zero;
legacy generic outbox rows have no creation timestamp. Refusal counts cover only
retained diagnostics, not lifetime failures. No message body, key, broker URL or
raw exception appears in these projections.

`ahub status` names `rooms: unavailable (<code>)` if room storage cannot open.
Open retries back off from 1 s to at most 30 s and stop on shutdown. For
`clock_rollback`, correct the system clock to at least the last recorded room
time; do not edit stored replay or clock records. A receive-only hub retries
blocked admission when a successful journal checkpoint clears its storage error.
Status reads and idle ticks do not poll blocked plaintext.

Codec negotiation keeps `x-agent-hub-ephemeral: 1` and adds
`x-agent-hub-codecs: 1` on the same WebSocket upgrade. A released broker ignores
the latter and retains its ephemeral/liveness behavior. A peer with a pending
codec observation waits under the original queue expiry; it does not receive a
false upgrade refusal. Known legacy or unsupported peers name the upgrade step.
Ordinary presence refreshes preserve same-connection signed codec evidence.
During a rolling upgrade, person-inbox (`user@label`) and invocation sends to a
released 0.31/0.32 member, or between upgraded hubs on a released broker, are
refused before any effect with an upgrade step; plain chat keeps working.
Upgrade the broker, then every room member to a codec-capable release, then reconnect.
`ahub status` distinguishes local room storage opening from a failed broker
connection; direct `ahub room status` failures expose only closed cause/action
metadata. A healthy online link needs no broker repair advice.

## Optional Orca companion (moved, #1198)

The optional Orca companion moved to [STAIxBWLB/ahub-orca](https://github.com/STAIxBWLB/ahub-orca) (#1387). Its code, tests and receipts live there; nothing of it remains in this repository. (The two Orca CLI verification records under `docs/verification/` stay here: they are ahub's own terminal-recovery evidence, cited by `src/cli/terminal-recovery.ts`.) It is an Orca plugin (`orca-plugin.json` at that repository's root, tagged `vX.Y.Z`), not an ahub dependency. It stays off here, and its native receipts are person-run and not run.

## Herdr companion (moved, #1199)

The Herdr companion moved to [STAIxBWLB/ahub-herdr](https://github.com/STAIxBWLB/ahub-herdr) (#1387). Its code, tests and receipts live there; nothing of it remains in this repository. It is a mod folder the person copies into Herdr, not an ahub dependency. It stays off here, and its native receipts are person-run and not run.

## Who owns a pull-only peer (#1310)

`ahub status` (and `--json`) names the current owner of an attached channel peer, beside its standby rows: `<peer> owner: pid <n>; attached <age>; native session <id>`. The pid is what the owner's plugin reported at hello (`pid unknown` when it reported none or an unusable one). `attached` is when the attach finished, not when the hello arrived. The native session reads `unverified` until the hub has verified one through the native-facts path (today agy), and an id that is not a short plain token is never shown. The owner line is absent while a newer session is still arriving, while the peer is offline, and after a detach, so a claimant is never shown as attached, and a takeover replaces the whole line at once. Use it to see who holds a queued peer before running `ahub peer takeover`. It is display only: it never decides delivery, takeover or permission, and `status.json` on disk does not carry it.

## Bounded visual attachments (#1058)

`hub_visual` lets an ordinary local peer or the local worker annotate public work
with a Mermaid diagram, comparison, table or before/after view. It is a separate
tool, not extra fields in `hub_send`. Its input is `{payload, task?, to?}` and its
receipt is `visual <id>`. `hub_visual_show {id}` explicitly reads a retained public
record in this project. Read-only roles may read; publication still requires the
ordinary shared-note capability and no-writes admission. Isolated fresh-reviewer
MCP remains limited to `hub_review` and `hub_task_show`.

The stored payload is the exact acon `VisualPayload` shape. acon owns `ui.visual`,
its sandboxed Mermaid renderer, table kit and asset route; the hub imports types
only. The standalone dashboard shows a readable title and text/source. Stream
stubs and task details load a visual on demand. A missing/older acon visual kit
keeps the fallback rather than loading another renderer into the hub.

```json
{"payload":{"kind":"mermaid","title":"Review flow","source":"flowchart TD\nPlan --> Implement --> Review"}}
```

The four kinds are `mermaid` (`source`, optional `title`), `comparison` (2-6
`options`, optional `title`), `table` (`columns`, `rows`, optional `caption`) and
`beforeAfter` (`before`, `after`, optional `caption`). Each comparison option has a
title, optional summary, up to 10 pros and 10 cons, and optional `recommended`.
Tables allow at most 500 rows and 12 columns. Column fields are `key`, `label`,
optional `align: start|end` and `format: text|number|percent`; percent values use
percent units as acon does. Cells are strings or finite numbers.

Mermaid is self-contained source without a Markdown fence, at most 20 KiB UTF-8.
The first non-comment line starts with a supported diagram keyword. This is only
a header check, not parsing proof: acon shows source with a notice when its parser
fails or the renderer times out. The hub adds no parser or Mermaid dependency.

Hub admission also bounds the entire serialized payload to 1 MiB and each text
field: title 300 bytes, caption 2000, alt 1000, text side 20 KiB, option summary
4000, each pro/con 2000, table cell 4000, column key 128 and file path 4096. These
are hub storage/admission ceilings, distinct from acon's payload type. Every text
field and record key is screened before sanitization and again afterwards; an
unsafe key is refused rather than renamed. Oversized or malformed data is refused
with the field and repair step, never silently truncated or partially stored.

A before/after side is either `{text}` or a project path with alt text:

```json
{"payload":{"kind":"beforeAfter","caption":"Layout change","before":{"path":"artifacts/before.png","alt":"Previous layout"},"after":{"path":"artifacts/after.png","alt":"Updated layout"}}}
```

Paths are relative to the canonical hub project, not an inferred peer worktree.
WebP asset display requires acon 0.1.7 or later (agent-console#81). Older 0.1.3/0.1.4 hosts refuse that MIME type; use PNG or JPEG there. The hub adds no transcoder.

Only a guarded public PNG, JPEG or WebP of at most 8 MiB is accepted; extension
and byte signature must agree. SVG, secret/PII paths, hub state, outside paths,
links swapped during inspection and two names for the same physical file refuse.
The hub replaces paths in the payload with opaque asset ids and records its own
hash. A later asset read repeats the current guard and hash checks; a changed or
newly private image is refused as changed since posted. Post it again using a
current public file. A copied visual id in another project's database does not
select that project's asset: the acon provider binds the project and instance,
then rechecks metadata/privacy after the guarded read before returning bytes.

The default audience is the console, with an FYI chat stub. Explicit `to` uses
local addressed delivery, including `to: "user"` for the console; an empty list
broadcasts to local peers. An explicit
remote recipient refuses the whole call, rather than silently dropping that
target. The stub carries only `[visual <id>] <kind>: <title or caption>` and
`refs.visual`. Peers receive no source, table/comparison body or inline image.
This feature adds no visual transport over the cross-network broker.

Publication is refused in a private turn or on a PII task, including when policy
or task privacy changes during an awaited image read. Current privacy also gates
show, snapshots and assets after posting. Visual file access combines accepted
runtime restrictions with the normally merged on-disk candidate policy. A pending
stricter path rule protects new visual access immediately; a pending weaker file
cannot remove the accepted restriction. Native sessions retain their existing
configuration-adoption boundary. The raw visual tool input/result is
excluded from observer capture even when the call is refused; amem/delivery
capture retains only the sanitized stub. `events.jsonl` records only id, kind,
payload byte count, image count and optional task id, never title/source/path or
image bytes. A visual is explanatory material, not approval or completion proof,
and a visual-only turn does not clear the task's no-write advisory.

Periodic snapshots and task lists read bounded metadata only. Full payload
screening happens on an explicit show; image reads still check current privacy,
existence and hash at the asset route. A moved or deleted image leaves the public
caption/text/alt record readable but cannot serve its old bytes.

A recovery refusal asks you to retry after `ahub status` shows the hold released.
Role or membership refusals name the missing authority, and a task/config change
asks for a retry. If the privacy screen is unavailable, restore the configured screen and retry;
if the visual exceeds its input limit, shorten the text first. Private context, paths and pattern hits
retain a uniform privacy refusal. Rate limits are checked before expensive
screening or file reads and checked again at publication.

Task-bound visuals live with their task. Unbound records expire after 30 days;
`visuals.retention_days` is an integer setting from 1 to 3650 days, applied live,
with the normal authority guard on raising retention. Expired/removed records
are unavailable even before a maintenance prune runs. No documentation stamp or
real-home policy change is performed by posting a visual.

## Agent-authored records

Headless Record handling follows amem's effective machine and repository policy. Set `records: false` in the amem configuration to disable instruction, capture and Record preference; repository policy can only narrow machine policy. There is no hub-only override. Private or unverified contexts fail closed for capture without preventing ordinary answer routing.

Upgrade every amem consumer sharing a memory home together, including native CLI hooks and embedded hub/plugin copies. A 0.22.1 hook drain silently discards Record format-3 spool entries without a counted loss, and its config parser refuses the `records` key even when false, so set `records: false` only after every consumer is upgraded. The hub exact-pins 0.26.0 and uses its public `recordsEnabled` accessor for the active home and execution repository; it does not upgrade the other consumers automatically. No real home is migrated by the feature's fixtures.

Count-only `records capture`, `records forwarded`, `records brief` and `records recall` diagnostics report accepted/dropped rows or before/after UTF-8 bytes. Record text, anchors, native session IDs and credentials are absent from these diagnostics. An absent registry proof or an unavailable Record source preserves old note content; a privacy or policy change during a read withholds the stale block.

## Claude Code companion (moved, #1338)

The Claude Code companion moved to [STAIxBWLB/ahub-claude](https://github.com/STAIxBWLB/ahub-claude) (#1387). Its code, tests and receipts live there; nothing of it remains in this repository. It is separate from the channel plugin `plugins/agent-hub` that ahub ships. It stays `fixture_only` with manual session-only placement, and its native receipts are person-run and not run.

## Reviewer quota admission and review caps (#1446)

`review.gate` accepts a finite number in `0..1` or `"off"` and defaults to `0.8`; a declared reviewer with known account usage at or above that floor is skipped. `review.unknown_quota` defaults to `skip`, so unknown, missing or stale quota evidence is skipped. Setting `review.unknown_quota = "pass"` admits unknown readings while keeping the numeric floor for known readings. An admitted unknown candidate never supplies quota-wait evidence. Setting `review.gate = "off"` disables the floor, unknown-reading check and every quota wait. Actual Budget pauses and manual pauses still block under either opt-out, as do the existing role, health, failed-reviewer and same-family constraints. Neither setting turns unknown usage into a known reading or clears a cleanup hold.

Both keys use the existing registered settings path and the same tier and `raises` risk as `review.gate`: use a person terminal or an `ahub ui --settings` session. An ordinary dashboard session or conductor does not gain write authority. These examples change the machine-local override through that guarded path:

```bash
ahub settings set review.gate off
ahub settings set review.gate 0.8
ahub settings set review.unknown_quota pass
ahub settings set review.unknown_quota skip
ahub settings set review.unknown_quota inherit
ahub settings set review.gate inherit
```

`inherit` removes only the machine-local override; a project value or default still applies. `ahub route explain`, the routing line and `ahub budget` name the active quota admission rule. The unknown-quota skip reason names both opt-outs. These commands change admission policy only: there is no new account source, transport or resume path.

`review.max_minutes` defaults to `20` and caps each actual native review child once, regardless of activity. A cap uses owned process cleanup and records `reviewerFailure.reason = "review time cap"`; the task remains reviewable through the existing fallback.

With the numeric gate enabled, a quota wait requires every declared candidate to be actually quota-paused or skipped at the known floor, with a known reset for each, and no other blocker. The routing history names each candidate, paused/floor state and reset. The earliest reset only wakes a recheck, including Budget's existing reset plus 60-second expiry grace. `task_sweep.review_min` supplies the sole hard deadline; its initial deadline is bound to task incarnation/head/repository and survives restart without extension. Unknown evidence under the default skip policy, another blocker or expiry uses existing planner/person fallback. With unknown pass, an otherwise eligible unknown candidate is admitted instead of waiting; with gate off, no quota wait is retained. Head, privacy, close and shutdown changes cancel the old timer. Quota refusals never permanently exclude that reviewer for the head.

Hard reviewer refusals pause the canonical account and its siblings through Budget when observed, independently of eventual task reroute. A stop or cleanup failure cannot discard the observation. Account handoff waits until the owned group/watch settles; Kimi stderr remains admissible only after that settlement. Existing attached Codex account siblings supply the #1440 reads; reviewer-only children have no additional account transport. Without an attached source there is no claim of early reset observation. Only the existing Budget resume policy can release a hard pause; credit flags never do so.

Claude native `rate_limit_event` rejected frames and `assistant.error = "rate_limit"` are admitted at their outer envelope. Codex 0.166.0 exec supplies only a native error message, so matching is restricted to pinned refusal prefixes inside outer `error`/`turn.failed`; it never parses reset prose. These shapes follow the [official Claude parser](https://github.com/anthropics/claude-agent-sdk-python/blob/d48fa33d9c587d3b9f76307add4b0f9382afbba4/src/claude_agent_sdk/_internal/message_parser.py), [Codex exec schema](https://github.com/openai/codex/blob/rust-v0.166.0/codex-rs/exec/src/exec_events.rs) and [Codex refusal formatter](https://github.com/openai/codex/blob/rust-v0.166.0/codex-rs/protocol/src/error.rs).

Kimi has no verified typed quota error frame. The narrow exception requires a hub-owned nonzero child exit and a complete bounded own-stderr line starting `error: failed to run prompt: provider.` and containing `usage limit`. It is observed on 2.2.0, unverified on 2.5.2, and always has UNKNOWN reset, so never admits a wait. See the [authorized diagnostic receipt](verification/2026-10-19-kimi-agy-reviewer-isolation.md). Stdout/model/tool text and wire-log errors are never quota evidence.

Kimi reviewer usage is read from its isolated native session index/wire usage through the existing counter before profile removal, attributed once to the review task. A journal ACK precedes spawn; terminal accounting follows confirmed group settlement and usage read. An unmatched start, damaged replay or incomplete count makes soft headroom UNKNOWN across restart. No host start/cap timestamp clears it. Incomplete logs or missing terminal ACK retain the profile through the existing cleanup hold. Events carry only opaque attempt ids, enums, counts and times. These synthetic paths do not certify a live account reset or a newer native Kimi diagnostic.

Controlled recovery advertises `reviewer_quota`. A target needs it only when reviewer accounting/wait history is retained or the project explicitly configures `review.gate`, `review.unknown_quota` or `review.max_minutes` (including `unknown_quota = "skip"` and `gate = "off"`); legacy empty state remains compatible with older targets. Snapshot integrity binds ordered safe accounting fields, complete/pending/unknown counts and replay completeness, with no native session/home/text. Missing or changed journal state refuses target restoration. Ending a quota wait at its original deadline is separate from native review readiness: failed enforce-mode CI cannot extend the quota wait, and no premature native review is sent.

## Hub skills on other hosts (#1622)

The hub's own skills (`ahub-status`, `ahub-manage`, `ahub-use` and the person-only `ahub`) ship in the Claude
plugin, which Claude Code loads as it is. `ahub setup` also writes them to every other agent host installed on this
machine, in that host's user skill directory:

| Host | User skill directory |
|---|---|
| Codex | `$CODEX_HOME/skills` (default `~/.codex/skills`) |
| Kimi | `$KIMI_CODE_HOME/skills` (default `~/.kimi-code/skills`) |
| Qwen | `$QWEN_HOME/skills` (default `~/.qwen/skills`) |
| Jcode | `$JCODE_HOME/skills` (default `~/.jcode/skills`) |
| Pi | `$PI_CODING_AGENT_DIR/skills` (default `~/.pi/agent/skills`) |
| agy | `~/.gemini/config/skills` |

A host with no config directory on this machine is left alone: setup never creates a home for a tool that is not
installed. Setup prints the per-host plan and asks once; `--yes` runs it without the question.

Every installed skill tree carries `.ahub-skill.json` with `tool`, `version` and the `sha256` digest of the tree. The
contract:

- A tree that is absent is installed.
- A tree the hub wrote is replaced only while its digest still matches the marker; a different version is stale and
  is replaced.
- A tree with no marker, another tool's marker, a local edit or a link is reported as foreign, modified or linked and
  left exactly as it is. The check runs again at the moment of the write, so a tree that changed while the question
  was open is kept too.
- `ahub setup --undo` removes only trees whose marker is the hub's and whose digest still matches; it reports and
  keeps anything else. It takes `--yes` like the install path.

A symlinked host config home (`~/.codex` -> a data directory, say) is the host's own choice and is resolved; a linked
skills directory or a link inside a tree is reported as linked and left alone.

`ahub doctor` has one `hub skills` row covering the Claude plugin's own copy and each installed host's state:
`installed`, `stale`, `missing`, `modified`, `foreign` or `linked`. A stale or missing tree makes the row fail and
names the repair command; a tree the hub will not touch is a warning, never a failure.
