@staix/agent-hub 0.39.0 → 0.40.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/README.md +12 -6
  3. package/docs/adding-an-ai-tool.md +1 -1
  4. package/docs/agent-notes/README.md +7 -0
  5. package/docs/agent-notes/adapters.md +5 -3
  6. package/docs/agent-notes/benchmarks.md +2 -0
  7. package/docs/agent-notes/budget.md +1 -0
  8. package/docs/agent-notes/bus.md +1 -0
  9. package/docs/agent-notes/daemon.md +8 -3
  10. package/docs/agent-notes/local-worker.md +3 -1
  11. package/docs/agent-notes/security-review.md +1 -0
  12. package/docs/agent-notes/tasks.md +7 -2
  13. package/docs/agent-notes/tests.md +7 -7
  14. package/docs/contracts/companion-cli-v1.json +4 -0
  15. package/docs/design/adapters.md +91 -0
  16. package/docs/design/agent-hub-architecture.md +17 -0
  17. package/docs/design/agent-hub.md +10 -0
  18. package/docs/design/bus.md +7 -0
  19. package/docs/design/cli-output.md +183 -0
  20. package/docs/design/execution-reference.md +6 -1
  21. package/docs/design/roadmap.md +191 -0
  22. package/docs/design/task-board.md +34 -0
  23. package/docs/dogfood.md +11 -4
  24. package/docs/events.md +4 -4
  25. package/docs/memory.md +3 -3
  26. package/docs/operations.md +153 -41
  27. package/docs/profiles.md +1 -0
  28. package/docs/quickstart.md +17 -4
  29. package/docs/sdlc.md +3 -1
  30. package/docs/security.md +40 -4
  31. package/docs/verification/2026-11-14-codex-0169-reviewer-isolation.md +70 -0
  32. package/docs/verification/2026-11-14-codex-0169-reviewer-tool-call.md +48 -0
  33. package/docs/verification/2026-11-14-pi-152-compat.md +45 -0
  34. package/docs/verification/2026-11-15-0.40.0.md +39 -0
  35. package/docs/verification/2026-11-16-pi-loopback-1447.md +39 -0
  36. package/docs/verification/pi-152-model-free.ts +57 -0
  37. package/docs/verification/pi-152-native.mjs +21 -0
  38. package/docs/verified.json +22 -22
  39. package/package.json +3 -3
  40. package/plugins/agent-hub/.claude-plugin/plugin.json +1 -1
  41. package/plugins/agent-hub/kimi-hook.js +332 -89
  42. package/plugins/agent-hub/kimi-review-policy-worker.js +16 -11
  43. package/plugins/agent-hub/server.js +417 -160
  44. package/src/adapters/agy/definition.ts +1 -1
  45. package/src/adapters/claude-channel.ts +1 -1
  46. package/src/adapters/codex-review-isolation.ts +61 -17
  47. package/src/adapters/compat.ts +7 -7
  48. package/src/adapters/definitions/builtin-metadata.ts +6 -6
  49. package/src/adapters/definitions/native-config-defaults.ts +1 -1
  50. package/src/adapters/definitions/native-config-policy.ts +1 -1
  51. package/src/adapters/definitions/qwen.ts +1 -1
  52. package/src/adapters/local-worker.ts +5 -3
  53. package/src/adapters/pi.ts +54 -11
  54. package/src/adapters/registry-types.ts +2 -1
  55. package/src/adapters/reviewer-print.ts +2 -1
  56. package/src/cli/answer-args.ts +11 -3
  57. package/src/cli/console-question.ts +1 -1
  58. package/src/cli/console-state.ts +95 -10
  59. package/src/cli/console.ts +6 -2
  60. package/src/cli/error-format.ts +19 -0
  61. package/src/cli/help.ts +290 -25
  62. package/src/cli/identity-audit.ts +8 -7
  63. package/src/cli/identity.ts +17 -0
  64. package/src/cli/init.ts +102 -9
  65. package/src/cli/main.js +2 -2
  66. package/src/cli/main.ts +57 -21
  67. package/src/cli/output-standard.ts +56 -0
  68. package/src/cli/output.ts +143 -8
  69. package/src/cli/roadmap.ts +215 -0
  70. package/src/cli/smoke-pty-bridge.ts +7 -24
  71. package/src/cli/task-output.ts +3 -1
  72. package/src/cli/upgrade-presentation-flags.ts +2 -2
  73. package/src/hub/board.ts +200 -3
  74. package/src/hub/bus.ts +9 -0
  75. package/src/hub/check-runner.ts +3 -4
  76. package/src/hub/ci-watch.ts +19 -4
  77. package/src/hub/control-client.ts +1 -1
  78. package/src/hub/daemon.ts +245 -43
  79. package/src/hub/events.ts +2 -2
  80. package/src/hub/execution-reference.ts +1 -1
  81. package/src/hub/github-import.ts +81 -0
  82. package/src/hub/hub-tools.ts +34 -9
  83. package/src/hub/install-policy.ts +23 -0
  84. package/src/hub/lifecycle-schema.ts +2 -2
  85. package/src/hub/no-writes.ts +3 -0
  86. package/src/hub/operational-authority.ts +3 -1
  87. package/src/hub/operational-view.ts +1 -1
  88. package/src/hub/pi-failure.ts +7 -0
  89. package/src/hub/question-desk.ts +26 -7
  90. package/src/hub/questions.ts +33 -5
  91. package/src/hub/restart.ts +7 -0
  92. package/src/hub/roadmap-triage.ts +86 -0
  93. package/src/hub/roadmap-unplaced.ts +169 -0
  94. package/src/hub/roadmap-view.ts +83 -0
  95. package/src/hub/roadmap.ts +127 -0
  96. package/src/hub/sdlc-merge.ts +5 -4
  97. package/src/hub/sdlc-queue.ts +3 -3
  98. package/src/hub/sdlc.ts +37 -2
  99. package/src/hub/specs-task.ts +7 -0
  100. package/src/hub/task-sweep.ts +29 -2
  101. package/src/hub/task-worktree.ts +37 -0
  102. package/src/hub/tasks.ts +381 -7
  103. package/src/pi/dependency-publish.ts +50 -0
  104. package/src/pi/extension.ts +1 -1
  105. package/src/pi/launch.ts +1 -1
  106. package/src/pi/task-dependencies.ts +249 -0
  107. package/src/ui/index.html +53 -13
  108. package/src/ui/plugin-questions.ts +5 -0
  109. package/src/ui/plugin.ts +6 -1
  110. package/templates/config.json +1 -1
package/CHANGELOG.md CHANGED
@@ -4,6 +4,45 @@ Issue and pull request numbers in the entries for 0.7.7 and earlier refer to the
4
4
 
5
5
  ## Unreleased
6
6
 
7
+ ## 0.40.0
8
+
9
+ - Release N-1 for 0.40.x is published 0.39.0, with exact agent-mem 0.26.0 and control protocol 17 (descriptor floor 16). The N-1 fixture and matrix pin that package; the separate protocol-16 fixture stays at 0.25.0. The isolated fixture exercises old client and plugin against the new daemon and the new client and plugin against the old daemon. It does not establish live-agent, rollback or shared-home compatibility. The wire retains protocol 16 through 17; roadmap adds a conditional recovery feature and additive milestone tables. New roadmap CLI and MCP forms are not available from a 0.39.0 daemon. File and format-floor compatibility beyond these fixtures remains subject to the release verification report.
10
+
11
+ - Companion CLI contract v1 lists the existing optional per-peer context occupancy and freshness (hub task 974, Refs #1511). A scratch hub with a fixture status-line reading verifies the real status JSON; no context measurement or wire field was added.
12
+
13
+ - Execution lineage accepts `atex` as an opaque declared producer (hub task 972, Refs #1510). A build reference can carry its receipt id and PDF SHA-256; the hub does not execute atex, fetch the receipt or attest the build.
14
+
15
+ - `ahub help <command>` says what each flag is for (hub task 971, #1504 AC3). A Flags line was the flag, its value shape and the forms that take it (`--sync in handoff`); it is now one short description (`--sync sync handoff states from the targets`), at most 46 cells so it fits 80 columns. The words live in `FLAG_DESCRIPTIONS` in `src/cli/help.ts`, keyed by the flag or by `<command> <flag>` where a command uses a flag differently (`--all` means every project for `status`, decided candidates for `learn`, completed goals for `goal`). A flag with no entry falls back to the forms line. `test/help.test.ts` fails a flag of any command without a description, a line over the width, and a table entry that names no flag.
16
+ - CI spends fewer macOS minutes and waits less (hub task 970, Refs #1490). The org can run at most 5 macOS jobs at once, and this repository used 61% of the org's macOS minutes in Nov 1-14 while 367 of 437 superseded PR runs still ran to completion. A draft PR now starts no macOS shard and its required `check (macos-latest)` fails with `macOS deferred` (never a skip, so no run that skipped macOS can be reused as a full proof); `gh pr ready` starts the run that includes macOS (`pull_request` gains `ready_for_review`). A newer head cancels the older head's run in its PR group (`cancel-in-progress` is true for pull requests only: main pushes and dispatches keep `queue: max` and are never cancelled, which GitHub requires). `check (ubuntu-latest)` runs six shards (`AHUB_CHECK_SHARD=<n>/6`) and macOS stays at four; `scripts/test-timings.json` is unchanged because Bun balances by it at run time. The hub's CI watcher reads `isDraft` and treats a cancelled required check and a draft's deferred macOS check as pending, so the implementer gets no "CI failed" notice for either; a real failure of the same head is still told. This PR's own run showed a second path: after `gh pr ready` one head carries the check rows of two runs of the same workflow (the draft run's failed aggregates beside the ready run's), and every reader took the old rows as failures (`check (ubuntu-latest)`, `check (macos-latest)` and `seeded guards` all read `failed` while the ready run was green or still running). `latestCheckRuns` in `src/hub/sdlc.ts` keeps only the newest run's row of each check name in the watcher, the review admission, the merge evidence, the merge queue snapshot and `readSdlcPr`; it needs a start time and one workflow identity on every row of a name and exactly one newest, and otherwise keeps every row, so an unsure head stays not ready. The GraphQL check queries now also request `startedAt` and the workflow. `AGENTS.md` states the draft-first flow, and `docs/sdlc.md`, `docs/operations.md` and `docs/agent-notes/tests.md` carry the new concurrency and shard rules. Tests: the draft condition and message, the cancel expression per event, six shards and every file in exactly one, a cancelled or draft-deferred run never reused as a proof (pure and over the API), and the watcher's draft and cancelled reads.
17
+ - Roadmap R3: bottom-up placement (hub task 963, Refs #1481, roadmap R3 of #1478). `ahub roadmap unplaced` and `hub_roadmap_unplaced` list the open GitHub issues, open board tasks and `active` or `draft` specs that no live milestone places, each with its reason; linking an issue drops it and the tasks that inherit from it, a link into a `dropped` milestone does not place, private tasks are only a count, and a cut or early-stopped GitHub read says `partial: true` while an unreadable source is named under `unavailable`. The GitHub read is new and paged (up to 10 pages of 100 under one 20 s deadline, fixed-argv GETs, no write); the one-page Backlog intake is unchanged. `ahub roadmap triage` and `hub_roadmap_triage` (planner or conductor, refused during a PII turn) ask the hub's model for a milestone, or a new one, for up to 25 unplaced items; an answer is kept only when it names a shown item and milestone and quotes words that occur in both, and is stored as a pending model answer attributed to the hub. Nothing is linked until `ahub roadmap accept <id>` (`hub_roadmap_edit {op: accept}`), which applies exactly that one link through R1's compare-and-set writer; `reject` drops it. Milestones now carry `tree` (a parent's roll-up including its children) and `readyToClose` with its reasons, advice for the person that never sets a state. `ahub roadmap import-github [--repo] [--apply]` is the person's alone: a dry run unless `--apply`, one `proposed` milestone per open GitHub milestone with its issues linked, idempotent on a second run, never a GitHub write. Two additive tables (`milestone_suggestions`, `milestone_imports`) stay outside the roadmap integrity digest, so the recovery format and its floor do not move. The design is in `docs/design/roadmap.md` "Bottom-up placement (R3)".
18
+ - The exact `@staix/agent-mem` pin moves 0.26.1 → 0.26.3 (hub task 968). On a real v3 placement home `ahub memory sync` fails with "Placement sync is unavailable" under 0.26.0 and 0.26.1, and the `amem` CLI sharing that home refuses too, while 0.26.3 syncs the same home: 0.26.2 raises the first placement sync's captured source from 8 MiB to 64 MiB (the 20000-row and metadata ceilings are unchanged, and a refusal above it names the bound instead of suggesting an epoch transition), and 0.26.3 reuses one complete placement writer/source proof for at most 1 s between effect boundaries instead of re-measuring every writer install around every row, reuses decoded journal prefixes and the validated publication plan, and adds `amem sync --progress auto|human|json|off` and `--status`. Nothing in the 0.26.1 → 0.26.3 range changes a host API: `src/index.ts` and `./platform` are byte-identical between the two published tarballs, the two new files are internal placement modules, and the only config surface added is the machine-file-only `privateRemotes` key (additive, at most 16 exact non-GitHub URLs). No storage format, file name, record/ref or recovery format and no format floor moves, so hubs and `amem` CLIs sharing a home need no coordinated upgrade. The change itself is `package.json`, `bun.lock`, the pin facts in `docs/quickstart.md` and `docs/operations.md`, the pin prose in `docs/memory.md` and `docs/operations.md`, the four tests that assert the installed version, and the committed plugin bundles, rebuilt under 0.26.3.
19
+ - Pi 1.5.2 is a verified version (hub task 961, Refs #888 and #1447 T6). The new [receipt](docs/verification/2026-11-14-pi-152-compat.md) repeats every leg of the 1.5.0 one model-free, against `@earendil-works/pi-coding-agent@1.5.2` installed into a private npm prefix under a scratch HOME (npm integrity `sha512-mUWI04rq...`, the same `dist/cli.js` SHA-256 as 1.4.0 and 1.5.0): native identity, extension load and RPC session identity, SDK registration, managed tool callback with receipt replay, failed tool result, zero provider requests. The producer ran twice and passed (`pi-152-model-free.ts`, the 1.5.0 producer with only the version constants and file names changed). `COMPAT.pi.verified` is now `["1.4.0", "1.5.0", "1.5.2"]` and its receipt pointer names the new file; `1.5.1` and every other version still need `ahub agents trust pi <version>`, so a person who trusted 1.5.2 locally now sees it as verified. The receipt records one limit: the whole-home before/after hash of `~/.qwen` was not identical because live Qwen sessions wrote there, so the isolation claim rests on a tight `~/.pi` bracket that was identical. Account-backed inference, Linux and Intel macOS stay unverified, and #1447 stays open until its live-leg acceptance is recorded.
20
+ - `ahub help` and `ahub help <command>` follow the standard's Help section (hub task 966, Refs #1504, T1 and T2 of the #1484 follow-up). The overview has a blank line before its first section, and every native agent row says what the command does from the optional third element of its `cli.usage` entry in its adapter definition (`jcode` was "optional Jcode", `pi` was "start Pi"; the element rides `cli.usage`'s fixed-builtin restriction, so no new restricted field). `ahub help <command>` now prints `Usage` (every form), `Description`, `Flags` (one line per flag, with its value shape and, for `--json` and `--color`, what the standard defines; other flags say which forms take them, a flag after a `|` in a form such as `task handoff --list | --sync | --project ...` included), `Examples` (one or two complete commands for each command that takes arguments) and then `Details`, which is the previous long text unchanged, so no usage form, flag or description word is lost (the test checks every one). The flag test in `test/help.test.ts` now reads the rendered text of each command; it compared `HELP` with itself before and could not fail. Each example is checked against the dispatch table and the command's own usage. A flag line says only what the usage and the standard state: for 283 of the 371 flag rows across all commands the command's existing description never names the flag, so the line gives its value shape and the forms that take it, not a meaning this change would have had to invent.
21
+ - The pinned Bun moves from 1.4.2 to 1.4.4 (hub task 940, #1486): `.bun-version`, `engines.bun` (`>=1.4.4`) and the README, quickstart, operations and CONTRIBUTING floor facts. The #560 start gate in `src/cli/smoke-pty-bridge.ts` is removed: it existed only for oven-sh/bun#45300, fixed in 1.4.4 (the bare 12-way repro hung 2 of 96 on 1.4.3 and 0 of 96 on 1.4.4 on this Mac; the real bridge ran 0 hangs in 180 12-way spawns on 1.4.4). The gate's tests and the probe's gate observations go with it; the parent-death, hung-bridge, killed-caller and failed-spawn tests stay. The committed plugin bundle is rebuilt under 1.4.4, so every open PR's bundle is stale after this merges: rebuild it with `bun run build` before re-filing. The runtime floor in `src/cli/main.js` (the check that stops an older Bun with one line) and the remote check runner's `CHECK_IMAGE` (`oven/bun:1.4.4`, index digest `sha256:1d22548f...`, pulled on the runner host) move with the pin. Bun's backslash realpath ENOENT is fixed in 1.4.4; the hardlink realpath wrong name (#541) is not, so `guardPath` keeps judging the typed name. Bun 1.4.4 also changed `realpathSync` so that `<link>/..` is folded by text, not resolved on disk (`realpathSync.native` and `/bin/realpath` are right), which broke `realPath`'s backslash fallback; agent-mem 0.26.1 resolves `..` after a symlink on disk (agent-mem #404), so the exact `@staix/agent-mem` pin moves 0.26.0 -> 0.26.1 in the same change, with `bun.lock`, the pin prose in `docs/memory.md` and `docs/operations.md`, and the four tests that assert the installed version. `test/project.test.ts` is unchanged and passes. The `AGENTS.md` "Real paths" note names both behaviors.
22
+ - A bounded wait on an `in_progress` task suspends the idle-owner sweep (hub task 960, Refs #1454). The owner, the task's planner or the person records it with the new `hub_task_wait {id, until, reason}` (an RFC 3339 time with a zone, in the future and at most 14 days ahead, and a public one-line reason of at most 200 characters). While it is pending `nextSweep` returns nothing for `idle-owner` on that task; after `until` the ladder restarts from `until`, so the first notice comes `idle_min` later and step 3 still reassigns under `auto_reassign`. `review-pending`, `unaccepted-assignment` and `ready-unassigned` never read it. Done, decline, return and any reassignment end the wait (the next state-changing history entry does; `reviewer changed`, `idle sweep` and the other quiet entries do not). The reason goes through the same privacy screen as a completion note: an ordinary task refuses text the screen would withhold, a PII task keeps it withheld. The wait shows in `hub_task_show` and `ahub task show` (`waiting`, with whether it has passed) and the planner groom view lists a passed one as `wait-passed`. Every refusal names its cause and next step. With `task_sweep.enabled` off the tool is not published and `Tasks.wait` refuses, so tool lists and the sweep are unchanged. Wait-passed shows in `hub_planner_groom` only; the CLI board rows are unchanged.
23
+ - `ahub help` is an overview (hub task 959, Refs #1484 T4). It prints one row per command as ` <name> <one-line summary>` in two aligned columns under `▸ <group>` titles, within 80 columns (about 110 lines, it was about 1,040), and ends with where the long text lives. `ahub help <command>`, `ahub <command> --help` and `-h` print the long text unchanged: every usage form, flag and description of that command, so no command, subcommand or flag was removed. A command with two meanings keeps a row in each group (`backlog`, `check-path`); `pause|resume` and `version|--version` share a row. The summaries are in `SUMMARIES` in `src/cli/help.ts`; a command not named there (the native agents, whose text comes from their adapter definitions) takes the first clause of its description. `LANG=C` or `--ascii` prints `>` for `▸`. `help` still exits 0, and `ahub help <unknown>` still exits 2 with `unknown command`.
24
+ - `ahub status` opens with what needs action (hub task 958, Refs #1484 T3). The default view is a header, an `Attention` section, then `Hub`, `Peers` and `Tasks`. Each Attention row is a marker (`✗` a failure such as a held delivery or a stopped dispatch, `⚠` a warning; an agent CLI version appears there only when it is refused, while trusted and in-line versions are a count on the `Hub` row) with its finding and, where the fix is known, the exact next command on a `→` line (`ahub queue show <id>`, `ahub agents trust <id> <version>`, `ahub queue discard --peer <peer> --state failed`, `ahub restart --dry-run`, `ahub resume <peer>`). A healthy hub prints `✓ nothing needs attention`. Peer detail under `Peers` uses plain keys (`form`, `flow roles`), not `claude form`. The older full detail (model backends, specs, queue pressure, schedules, per-peer notes, control-write timing) is `ahub status --verbose` (`--full` still prints it too, with full ids). `--json` and the exit code (0) are unchanged. On a pipe without `COLUMNS` the view does not wrap; the `WAITING ON YOU #N` line keeps its words.
25
+ - `ahub doctor` and the shared error line follow CLI output standard v1 (hub task 957, Refs #1484 T2). Three behavior changes, each with its test updated:
26
+ - `ahub doctor` exits 1 when any row is a failure (it exited 0 with failed rows before). Warnings and unknowns do not change the exit code. This holds for `ahub doctor --json` too: the JSON document is unchanged, but a script reading it now sees exit 1. `ahub setup` prints the same report and keeps its own exit code.
27
+ - A usage error exits 2 (it exited 1): `usage: ...`, an unknown command, and the error forms that carry their usage on a line of their own. A refusal that changed nothing (for example `never-ask requires --yes`) and a runtime failure (an unreadable file, no hub running) still exit 1.
28
+ - `ahub task show <id>` for an id that does not exist prints `ahub: no task #N` and a next step on stderr and exits 1, with `--json` too; it printed to stdout and exited 0.
29
+ The doctor report reads as a standard v1 report: a `▸` section per area with a count, one marker row per check (`✓ ✗ ⚠ ?`, ASCII `ok x ! ?` in a non-UTF-8 locale) that keeps the state word, failures first and then warnings, unknowns and oks, a check name capped at 32 cells with a long path shortened in the middle, and a summary line last (`✗ 2 failed ⚠ 3 warnings ✓ 18 ok`). The error line is `ahub: <what failed>: <why>`; on a terminal it leads with `✗`, a piped line keeps the plain `ahub: ` form, and a known fix is printed as a second `→ <command>` line. Daemon refusal text is passed through unchanged.
30
+
31
+ - A `local.deny` or `pii.paths` entry that contains the system temp directory no longer fails the Codex reviewer sandbox proof as `sandbox_proof` (hub task 956, Refs #1493; diagnosis from hub task 934). The proof made its fixture under `os.tmpdir()` and denied every entry's subtree, so a deny such as `~/.jcode` (a jcode session's `TMPDIR` is `~/.jcode/scratch`) put the proof's own public canary under a denied tree. `prepare` now checks each expanded deny entry, the core deny globs and the host credential roots against `tmpdir()` first; when one covers it, the fixture root is made under `<hub home>/reviewer-proof`, and when that is covered too the reviewer is unavailable with the new cause `fixture_root_denied` (`ahub status` says to move `TMPDIR` or narrow the entry and never names the entry). The ordinary proof legs and markers are unchanged. A deny that covers the reviewer's cwd does not fail the proof (the canary is in the fixture root, not in cwd).
32
+
33
+ - The first check-runner probe no longer holds daemon startup (hub task 925, #1445 step 2). The post-merge `startup timings ms:` line on this hub named `task_checks` (9.9 s of a 12.5 s start): the remote runner's availability probe takes about 8 s (ssh, docker version, image inspect, a launched and torn-down probe container). It now runs beside the orphan sweep and the spec probe, startup waits for it at most 500 ms, and `ahub status` shows the runner as unavailable (`runner probe in progress`) until it settles. `check_run` joins the same single-flight probe, so a check started right after startup waits for the real answer, and the settled state equals the one a blocking start gave.
34
+ - CLI output standard v1 foundation (hub task 936, Refs #1484 T1). `docs/design/cli-output.md` holds the standard. The new `src/cli/output-standard.ts` (no imports, so it can move to a shared package) holds the nine semantic roles on the 16 ANSI colors (`ROLE_SGR`), the marker table with ASCII forms and the 2-cell marker column, and color resolution per stream; `src/cli/console-state.ts` re-exports them, maps the console's `Tone` onto the roles (`TONE_ROLE`) and gains a `Report` builder for the layout grammar. Color resolution: `--color`, then `NO_COLOR`, `FORCE_COLOR` / `CLICOLOR_FORCE`, `FORCE_COLOR=0` / `CLICOLOR=0`, then TTY and `TERM`. Behavior change: `FORCE_COLOR` and `CLICOLOR_FORCE` now turn color on for a pipe, and `FORCE_COLOR=0` / `CLICOLOR=0` turn it off for a terminal. `test/cli-output-conformance.test.ts` runs the five conformance checks and fails on a raw SGR literal in `src/cli/` and `src/hub/` outside the console and the identity palettes. No report changes yet (doctor, status, help and `fail()` follow in hub task 942, 944 and 946).
35
+ - Roadmap R1 adds board-backed milestones through `hub_roadmap_list`, `hub_roadmap_show`, `hub_roadmap_edit` and `ahub roadmap` (hub task 941, Refs #1479). Public reads compute task, cached issue, spec and train progress without GitHub or model calls. Explicit task placement overrides source-issue inheritance; private work is a count only. Planner/conductor edits use revision checks, done/dropped are person-only, and retained roadmap state is bound to controlled recovery. The tables are additive; no database format bump or UI is included.
36
+
37
+ - `ahub init --track-config` now handles outside `.agenthub/` ignore rules in one run by appending and verifying a project-local re-include block (hub task 965, #1496). Dry-run shows its lines; nested rules that still win refuse before writes. State and machine-local files stay ignored, machine-endpoint routing stays local, and `--no-track-config` removes init-owned re-inclusions. No user excludes/config or index is changed.
38
+ - Pi tool-step ceilings now grant bounded checkpoint-and-continue turns (`pi.max_continuations`, default 2, range 0..10), then move the task with `step_limit` and observed steps/continuations rather than an inference-failed label (hub task 943, Refs #1447 T1/T2). Failed turns log `ceiling`, `model_error` or observation-only `aborted`; private diagnostics keep only the class, public model text is screened and bounded. Only a safely settled structured ceiling consumes its delivery as a limit; uncertain tools and concurrent cancellations remain held. Tool-step defaults, sandbox, dependencies and native version policy are unchanged in this slice.
39
+ - Pi `max_steps` now defaults to 100 and this repository's tracked Pi setting and init template also use 100; an existing project with explicit `pi.max_steps: 30` keeps 30 until the person edits it (hub task 945, Refs #1447 T3). The local worker stays at 30 and continuation allowance is unchanged. Config/policy and real-extension fake checks cover the 101/100 rejection boundary; this edit does not apply settings or restart a live peer.
40
+ - Important task-move/cancel notices queued during ordinary digest condensation now participate in the next host turn, ahead of chat (hub task 947, Refs #1447 T4). The bus reselects queued originals without recording an abandoned attempt or receipt. Checkpoint waiters reject lost ownership before summary effects, including move-away/back; taskless checkpoints and same-owner metadata changes remain valid. Fake Pi tests cover the actual escalation prompt and former-owner refusals. Notices sent after adapter busy but before the provider prompt remain queued for the following host turn; that preflight window was not timed and closing it needs an explicit preparation/commit contract.
41
+ - Pi prepares accepted-worktree dependencies from reviewed Git-base install inputs in protected staging, using the shared Bun cache and fixed frozen install (hub task 949, Refs #1447 T5). Changed inputs, lifecycle/trust hooks, existing targets and unsupported layouts remain unprepared. Publication uses a verified directory identity and same-volume rename, never a copied dependency tree. Preparation failures keep acceptance and report a fixed reason in the result and next prompt; full checks remain with CI and the remote runner. The localhost listener leg moved to a follow-up; Pi's network profile and proxy environment are unchanged.
42
+ - Codex 0.169.0 is a verified reviewer version (hub task 931, Refs #888). It passed the model-free reviewer isolation procedure with 0.166.0 and 0.167.2 as controls (`docs/verification/2026-11-14-codex-0169-reviewer-isolation.md`): six of the seven re-read Codex source files changed and were re-read, every committed preparation leg passed, and the app-server schema comparison found no removed type, property or enum value. The separately authorized single model-backed review (`docs/verification/2026-11-14-codex-0169-reviewer-tool-call.md`) persisted one approved verdict with the required marker and the exact head, with no retry. `COMPAT["codex-review"].verified` is now 0.146.0, 0.163.0, 0.164.0, 0.166.0 and 0.169.0; 0.167.0 and 0.167.2 stay unverified, and every launch still runs each isolation proof. Merge this after the v0.39.0 tag.
43
+
44
+ - The configured conductor can run `ahub sdlc audit start|show` from its agent shell (hub task 933, #1403 A4, which stays open). `classifyPeerCommand` returned "console" for both forms, so the CLI refused a conductor before it connected, although the daemon and `docs/sdlc.md` already admit the one configured conductor. They are now conductor forms like `sdlc survey start|show`: `CONDUCTOR_DAEMON_OPERATIONS`, `conductorOperation` and `operationalRequestLabel` name them, the audit and refusal labels are `sdlc audit start` and `sdlc audit show` (never an operand), and `--live-test` still refuses `start` and leaves `show` a read. A peer that is not the conductor stays refused and audited. No daemon change. Merge this after the v0.39.0 tag.
45
+
7
46
  ## 0.39.0
8
47
 
9
48
  - Release N-1 for 0.39.x is 0.38.0 (exact `@staix/agent-mem` 0.24.0, control protocol 17 with descriptor floor 16); `test/fixtures/release-n-1` and `test/published-protocol-compat.test.ts` now pin it. Compatibility: the wire protocol window is unchanged at 16 through 17; the new daemon features `reviewer_quota`, `research_synthesis`, `research_evidence_withdrawal` and `advisor_surveys` are optional, and a 0.38.0 daemon answers their control ops as unknown. Files: `hub.db` gains additive tables (`advisor_surveys`, `advisor_survey_findings`, `considered_findings`, `security_audits`, `security_audit_findings`) created with `CREATE TABLE IF NOT EXISTS`, and `security_audit_findings` gains the additive columns `settled_by` and `settled_as`; there is no `hub_schema` bump, so 0.38.0 opens a 0.39.0 database and ignores them. The exact `@staix/agent-mem` pin moves to 0.26.0 (entry below).
package/README.md CHANGED
@@ -5,7 +5,7 @@ Code, Codex, Kimi Code, Pi and a hub-owned local worker (plus Qwen Code, Jcode a
5
5
  Antigravity if you want them) share a message bus, a task board and a memory, each
6
6
  connected through its own native interface.
7
7
 
8
- Status: 0.39.0, control protocol 17 (accepts 16). Bun + TypeScript, one loopback daemon per
8
+ Status: 0.40.0, control protocol 17 (accepts 16). Bun + TypeScript, one loopback daemon per
9
9
  project. Site: [agent-hub.staix.net](https://agent-hub.staix.net).
10
10
 
11
11
  Inspect bounded task and attempt metadata with `ahub lineage show`; admit external
@@ -14,7 +14,7 @@ declared and never cause an external fetch. See [execution lineage](docs/operati
14
14
 
15
15
  ## Quick start
16
16
 
17
- You need [Bun](https://bun.sh) <!-- facts:bun-floor -->1.4.2<!-- /facts:bun-floor --> or later on PATH.
17
+ You need [Bun](https://bun.sh) <!-- facts:bun-floor -->1.4.4<!-- /facts:bun-floor --> or later on PATH.
18
18
 
19
19
  ```bash
20
20
  bun add -g @staix/agent-hub && ahub setup
@@ -88,7 +88,10 @@ including [a new project with SDLC advise or enforce](docs/quickstart.md#a-new-p
88
88
  Claude Code instances can implement in their own worktree, in a terminal or
89
89
  headless with one session per task. `ahub sdlc metrics` reads lead times,
90
90
  rework and stalls from board history, and
91
- optional control bands turn a breach into a backlog card. Work that belongs to
91
+ optional control bands turn a breach into a backlog card. `ahub roadmap` groups
92
+ work into board-backed milestones with computed task, cached issue, spec and
93
+ train progress; private tasks appear only as counts. Planner/conductor edits
94
+ are separate from the person's done/dropped decisions ([roadmap](docs/design/roadmap.md)). Work that belongs to
92
95
  another project running agent-hub on this machine goes onto that project's board
93
96
  with `ahub task handoff` (agents: `hub_task_handoff`), and its state changes come
94
97
  back as task messages.
@@ -137,9 +140,12 @@ including [a new project with SDLC advise or enforce](docs/quickstart.md#a-new-p
137
140
  ([details](docs/memory.md#agent-authored-records-1320)).
138
141
  - **Local and on-prem models.** Pi and the local worker can run on DGX or local MLX
139
142
  through an authenticated relay. Tasks marked as PII stay on the on-prem worker.
140
- - **Guard rails.** The local worker and Pi run in a sandbox, and their writes and
141
- shell commands wait for your approval unless you choose a looser permission mode.
142
- Publish, external-write, destroy and install calls ask a person in every mode for
143
+ Pi can checkpoint and continue after a tool-step ceiling, within a configured
144
+ continuation allowance; exhausted ceilings and model failures have distinct
145
+ task-move reasons ([Pi operations](docs/operations.md#pi-with-dgx-and-mlx)).
146
+ - **Guard rails.** The local worker and Pi run in a sandbox, and peer-issued writes
147
+ and shell commands wait for your approval unless you choose a looser permission mode.
148
+ Peer-issued publish, external-write, destroy and install calls ask a person in every mode for
143
149
  Claude Code, the local worker, Pi, hub-owned ACP peers such as Kimi and the
144
150
  approval requests Codex sends, wherever the hub sees the call before it runs;
145
151
  `ahub status` names each peer where it cannot. The opt-in floor
@@ -83,7 +83,7 @@ Controls session restoration, thread continuity, and crash recovery:
83
83
  Where the kind sits in the host's derived lists: `roleRank`, `startRank`, `helpRank` and `plannerEligible`. `conductorEligible` (an interactive form that receives hub pushes and holds a writable tools connection) and `reviewerEligible` (the kind can receive `hub_review`) say which flow roles it may hold; absent means false, so a kind not yet proven is not eligible. `roleEligibility` (`src/adapters/role-eligibility.ts`) reads them for the loader, `ahub init` and `ahub doctor`, and the table in [roles](roles.md#who-may-hold-what) is generated from it. `KNOWN_PEERS`, `OPTIONAL_PEERS`, `START_MODE_PEERS`, `ROLE_ORDER`, `HELP_ORDER` and `PLANNER_PEERS` are derived from `ADAPTERS` and these ranks (`deriveAdapterLists`). The only hand-kept lists are the cross-release copies in `src/hub/peer-catalog.ts` (`KNOWN_PEERS`, `OPTIONAL_PEERS`) and `src/hub/start-mode.ts` (`START_MODE_PEERS`, for a dual-form kind): a new native kind is added there too, and `test/registry-guard.test.ts` fails until those copies equal the derived lists. A configured or external definition cannot set `projection`.
84
84
 
85
85
  #### `cli`
86
- The `ahub <kind>` surface: `command`, `startWords(form)`, and for a fixed builtin `entry` (the launcher and whether it needs lifecycle admission), `preview`, `usage` (help lines) and `launchConfigKeys`. `builtinCliEntries(definitions)` projects the entries; no configuration or module can register one.
86
+ The `ahub <kind>` surface: `command`, `startWords(form)`, and for a fixed builtin `entry` (the launcher and whether it needs lifecycle admission), `preview`, `usage` (help lines: `[usage, description, summary?]`, where the optional third element is the one-line row in `ahub help`, three or more words and at most 56 cells; the help test fails without it) and `launchConfigKeys`. `builtinCliEntries(definitions)` projects the entries; no configuration or module can register one.
87
87
 
88
88
  #### `instances` and `attach`
89
89
  `instances.mode` is `headless` (needs a headless `start.create` factory) or `external` (a channel instance started from the person's terminal). A kind with no `instances` policy (Jcode) takes no extra instance, and `validateInstances` refuses a declaration of one. `attach` holds the pull-only forms, external-hello admission and the refusal texts for a TUI that attaches without a driven peer.
@@ -122,6 +122,9 @@ revision preserves both behaviors; capture still uses its stricter turn fence.
122
122
 
123
123
  ## Changes
124
124
 
125
+ - 2026-11-15: #1447 T5 prepares dependencies from reviewed Git-base install inputs because validating a peer-writable manifest and later running it on the host leaves a race. Fixed readiness guidance does not turn an installer failure into failed acceptance. The localhost listener leg moved to a follow-up, and this slice keeps Pi's network profile unchanged.
126
+ - 2026-11-15: #1447 T4 reproduces a digest prepared before a task-move notice was queued. Conditional queue re-selection keeps that notice in the next host turn without changing durable ACKs; the later provider-prompt window remains unmeasured and open. Checkpoint ownership epochs prevent a pending notice from permitting former-owner summary effects.
127
+ - 2026-11-14: #1473 follows the #1328 cooperative direct-instruction precedent for one conductor-recorded question answer. Visible actor provenance avoids a second terminal step while a DB-only quote and unchanged person/private/self-answer boundaries keep the claim separate from blanket delegation or release consent.
125
128
  - 2026-11-14: #1467 separates unknown-quota admission from the numeric reviewer floor. The default remains skip at 0.8; explicit pass can bootstrap a reviewer without a reading, while off disables quota admission checks and waits. Actual account/manual pauses remain independent, and the synthetic opt-out evidence does not claim live use or a new reset source.
126
129
  - 2026-11-14: #1432 adds a narrow off/advise and check-name exception to person-only structural editing, following the existing cooperative direct-instruction model for release authorization. Separate intent and hashed-result audits distinguish a caller claim from a saved configuration, while the generic editor and release-consent authority stay separate.
127
130
  - 2026-11-14: #1403 T7 preserves considered rejections because a repeated semantic finding id alone does not establish new evidence. Complete path-change evidence and an explicit reconsideration reason distinguish a new case from replay; unknown diffs retain suppression without deleting history. Closed proposal history no longer prevents an unsuppressed finding from becoming a new open card; its prior task id and reopening reason remain visible.
@@ -182,3 +185,7 @@ The normal ten-minute native usage poll could delay observing an external reset
182
185
  Issue #1403 B1 follow-up separates upstream plan drift from a task's own implementation. Acceptance needs no recorded task head: it compares the plan base with the locally recorded remote-tracking default tip. Completion uses the shared integration point with that tip, so the task's own commits do not masquerade as upstream drift. Local refs may lag the server; this advice performs no fetch. Missing or ambiguous history remains unknown, and lifecycle off remains quiet.
183
186
 
184
187
  Issue #1446 separates reviewer admission from the account's hard pause. The reviewer floor defaults to 0.8 while the account gate keeps its own configuration. A wait is useful only with complete pool and reset evidence; preserving its first deadline avoids indefinite waiting after restarts. Kimi's diagnostic exception was observed on 2.2.0 and is unverified on 2.5.2. Its absence of a reset timestamp prevents wait admission. Owned accounting intents survive a crash without publishing private profile identity or silently treating an incomplete log as zero consumption.
188
+
189
+ On 2026-11-14, #1473 added shared question-tool exclusions to the daemon progress closure. Its extracted VM fixture omitted the new import, so both hosted OS shard 3 legs failed with `QUESTION_TOOLS is not defined`. The earlier Office render fixture had omitted a new helper too. The tests note now names the progress fixture and actual shared import so question-tool changes include that runtime privacy path; its canary checks preserve the existing ordinary-escalation positive control.
190
+
191
+ The 0.40.0 release review found that Pi's host-side dependency preparation security boundary was documented in the adapter and security guides but not pointed to by the security-review checklist. The checklist now points to those existing rules rather than duplicating them.
@@ -68,7 +68,7 @@ Scope: the Codex, ACP and Pi adapters and the Pi extension (turn `generation` an
68
68
  - To stop a process tree, freeze it (SIGSTOP) before reading what it contains, then SIGKILL, and call it done only when the table shows none of it (with no table at all, the stop can only ask the group itself, which cannot see groups below it). A process a read after the freeze shows for the first time is frozen and read again before anything is killed.
69
69
  - Work that must survive `ahub kill` (amem capture session end) is awaited in `stop()`; fire-and-forget dies with the process.
70
70
  - Native owner teardown must handle a lost shutdown acknowledgement using verified process identity. Pending launches must be revocable, and active tools/streaming output must count as watchdog activity. A reloaded `watchdog_ms` reaches a peer only through `configureWatchdog` (`src/hub/peers.ts`, #439) and applies from its next busy turn, never to the running one.
71
- - `stop(reason?)` (`src/hub/peers.ts`): a reason marks a person's requested stop (`peer_stop`, rule: `daemon.md`). Fence before the first await (the adapter's stopping flag, or `offline`) so `deliver()` and buffered native callbacks do nothing more, hold the in-flight delivery as `needs_review` with that reason, and end `offline`. For ACP without a journal, return ordinary in-flight envelopes once through `onFailed` before a requested stop invalidates the turn; never return the watchdog-cancelled original prompt. A requested stop never completes, escalates or reports the turn it cut (`AcpPeer` bumps `turn`; `PiPeer.fail` skips the failure message and `onTurnFailure` while `requestedStopReason` is set). `PiPeer.stop()` waits for aborted tools only up to `stopGraceMs`: a tool past it never blocks the teardown, and the stop throws `PiToolSettlementFailure` once the owner is down.
71
+ - `stop(reason?)` (`src/hub/peers.ts`): a reason marks a person's requested stop (`peer_stop`, rule: `daemon.md`). Fence before the first await (the adapter's stopping flag, or `offline`) so `deliver()` and buffered native callbacks do nothing more, hold the in-flight delivery as `needs_review` with that reason, and end `offline`. For ACP without a journal, return ordinary in-flight envelopes once through `onFailed` before a requested stop invalidates the turn; never return the watchdog-cancelled original prompt. A requested stop never completes, escalates or invokes failure handoff for the turn it cut (`AcpPeer` bumps `turn`; `PiPeer.fail` skips the failure message and `onTurnFailure` while `requestedStopReason` is set). `PiPeer.stop()` waits for aborted tools only up to `stopGraceMs`: a tool past it never blocks the teardown, and the stop throws `PiToolSettlementFailure` once the owner is down.
72
72
  - A terminal the hub opens for a person (`src/hub/terminal-open.ts`, #269) gets `personEnv`, which strips every agent marker; never `peerChildEnv`, which sets one.
73
73
  - Spawn a native peer with `peerChildEnv(peer, source)` so its own `AGENTHUB_PEER_ID` replaces inherited agent markers. Sandbox tool environments carry their executing peer too. Preserve the native shell environment policy; Codex's `CODEX_THREAD_ID` supplies the fallback after filtering. Before changing marker detection or launcher environments, read `docs/verification/2026-10-09-agent-shell-t0.md` for pinned source and live-probe limits.
74
74
  - `peerChildEnv` drops every `ORCA_*` variable by default (#1094). Only a native that runs in the person's own pane passes `{ preserveOrca: true }`: `src/cli/launch.ts` and the Qwen CLI entry. A version probe, the process table or another helper the hub spawns uses `withoutOrcaEnv(childEnv(...))`, never `{ ...process.env }`.
@@ -83,7 +83,9 @@ Scope: the Codex, ACP and Pi adapters and the Pi extension (turn `generation` an
83
83
  - Keep Pi owner identity on the shared `processSignature`/`processLiveness` contract exported by the exact-pinned package's Node-safe `@staix/agent-mem/platform` entry, re-exported unchanged by `src/pi/process-signature.ts` for the startup claim, extension claim, TUI owner monitor, `recoveryReady` and verified teardown. Memory's `sync.lock` uses the same implementation. Preserve the Node-safe process-entry regression in `test/memory-parity.test.ts`, the existing Pi process behavior tests, the LC_ALL=C/TZ=UTC `ps` read and strict pid + start + command identity; never accept PID-only or a fuzzy command match.
84
84
  - Return the shared `toolResultFailed` verdict as `/tool`'s `failed`; map only `failed === true` to Pi's `isError`. Preserve text and the older bridge's absent-flag behavior. The one exception is a person's `!command` whose process exit was observed: its `failed` is `exitCode !== 0` and the reply carries `exitCode`, from `onProcessExit` through `packPiShellResult`, never parsed from the output (#253).
85
85
  - Pi's bridge executes `/tool` only for the verified owner (`verifiedOwner()`: the claimed pid with its `processSignature`; a headless owner is pinned from the spawned process once `get_state` proved its session) with the current `sessionId` and turn `generation`, and admits `/budget` only for that owner and generation, checked again after the awaited admission. Refuse anything else before execution. `tool_abort` aborts that pending call, or fences its id when it arrives before the call (64 ids a turn, then every further call of that turn). A person's `!command` (`purpose: "idle_user_bash"`) is taken only in TUI mode from an idle owner on its one-use reservation, and it alone skips `piPermit`: never widen that to a model's bash call (#253).
86
- - Emit Pi's ceiling event at the pre-effect rejection boundary (`src/pi/ceiling.ts`), before `agent_end`. Accept only a valid current-session/current-generation signal during a running turn; retain the first signal and attach it to that turn's failure. Never classify a ceiling from free text.
86
+ - Emit Pi's ceiling event at the pre-effect rejection boundary (`src/pi/ceiling.ts`), before `agent_end`. Accept only a valid current-session/current-generation signal during a running turn; retain the first signal and attach it to that turn's failure. Never classify a ceiling from free text. At `agent_settled`, mark a ceiling delivery completed with `ceiling steps <count>/<limit>` and pass `settledCeiling: true` only when that turn failed without cancellation, withdrawal or an execution/approval budget stop, and no managed tool was pending when the ceiling arrived or remains pending. Latch tool uncertainty at the ceiling even if tools settle later. Keep every other failed delivery held; never replay it. Observe explicit stop/recovery, roster or personal withdrawal and cancelled settlement once per logical turn through `onTurnAborted`, without failure handoff; internal model-failure teardown suppresses that observation. Call `onTurnSuccess` only for an actual nonerror, noncancelled settlement, never a ceiling.
87
+ - Known limit (#1447 T4): host `turn_start` is adapter busy, before Pi model selection/readback. Workflow items after that boundary stay queued for the following host turn; do not fold them into an unsent provider prompt. Closing this gap needs an explicit preparation/commit or deferred-fold contract preserving durable ACKs and private input fences. Former-owner done/checkpoint refusals still apply in that window. Its duration was not measured.
88
+ - Pi dependencies (#1447 T5): register preparation only from the Pi factory. Use the trusted worktree record's reviewed Git base and protected global hub state outside every peer root; never execute mutable task install inputs. Keep the fixed frozen-install command, scrubbed environment, deadline, lifecycle/config refusals and CWD-pinned rename publication. Preparation failures stay advisory; accept/self-claim replies recheck ownership, acceptance/session and privacy after waiting and carry fixed readiness guidance. Never copy dependency trees or skip install scripts to make preparation succeed.
87
89
  - Pi TUI hub prompts (#379; an idle snapshot ACK arriving before a personal start inserted a hub prompt into the person's turn): attribute a start, end or settle to a hub turn only by the command's `promptId`, which lasts until the logical `agent_settled`; treat any other start while a hub prompt is pending or running as personal activity that detaches Pi. Settle `failed_safe` only on a `prompt_not_started` refusal bound to the verified owner, session, command id and generation; everything else stays `needs_review`. Refuse roster return without `fencedPrompt`.
88
90
  - `validatePiSession` (`src/pi/session.ts`) throws `PiSessionUnresumable` only on positive evidence (ENOENT, a file outside the managed session directory, an unparsable or mismatched header) and `PiSessionBookmarkMismatch` only when a valid header names another session id; every other read failure is rethrown unchanged, because the daemon retires a Pi continuity bookmark only on those two classes (#463). `PiPeer` rethrows a mismatch with the neutral header-id message and never claims a bookmark exists (`test/pi-session-validation.test.ts`).
89
91
  - Pi terminal ownership reads only the existing monitor's current pid/signature/session/file/token observation, expiring after 1 s; unknown verification withdraws proof. Keep fresh shared process-signature checks at tool/effect admission and teardown, and never revive terminal proof across detach, offline, stop or a changed owner/session (#576).
@@ -135,7 +137,7 @@ Scope: the Codex, ACP and Pi adapters and the Pi extension (turn `generation` an
135
137
  - Retained standby (#1174, `WsPeer` in `src/adapters/channel-peer.ts`): an opt-in (`retainStandby`) hello while another session holds the peer is kept as one of at most `MAX_STANDBY_SESSIONS` (8) standbys; `standbySessions` ids and PIDs are display only, never native-session provenance or authority. Ownership changes only through `takeover` (the person's `peer_takeover`, or the oldest standby when the owner leaves), guarded by the host's `channelTakeoverAdmission` and `claim.isCurrent()` across the async preface; the old socket closes 4405 (opt-in) or 4403 "detached by the person" and its native process is not stopped. A standby socket runs no peer operation until `ownsSocket` confirms it. A hello without the opt-in keeps newest-hello replacement.
136
138
  - A reviewer backend is a fixed builtin `ReviewerBackend` in a definition's `reviewer`, never config. Its `prepare` must return a complete isolation receipt (matching backend id, binary, version, profile, evidence and `readOnly` true, plus `strictMcp` and `ephemeral` true, or for a `nativePolicy` backend `enforcement: "native-policy"`, `freshSession` and `hubToolsOnly` true) before every child. A `taskMcp` backend refuses without the host's `taskMcp` port and gets only that task's MCP config, never the hub-wide one. `admit(env)` and the complete synchronous `launch.current()` are rechecked right before spawn; keep that complete fence in `reviewToken()` at every verdict/task-MCP authority boundary. A `watchCurrent` launch supplies `startPolicyWatch()` with a review-owned full-policy probe; run its serialized asynchronous checks on absolute 100 ms due times, coalescing missed ticks without overlap or an extra post-check delay. Pass only expected paths/fingerprints to its worker, never task text or inherited environment. Fence the exact child/review sequence on failure as `review policy changed`, and terminate/join the worker before private cleanup even when native stop fails; retain an unconfirmed owner for explicit stop retry; a missing or failed proof refuses, never a weaker launch or a continuing native session. The daemon puts the reviewer on the bus only after `start()` proved isolation; a failed start or a `start_failed` report marks it in `reviewerUnavailable`, which routing reads as `failing`. An unavailable reviewer variant has no reviewer backend or launch code; `startPeerBody` refuses it before preflight, independently of any native TUI launcher.
137
139
  - Report reviewer failures (`onUnavailable`: `start_failed`, `quota`, `no_verdict`, the last also for a `review.max_minutes` wall-clock cap with reason `review time cap`) only after the child's group is confirmed gone and only while its generation is current: a person's stop owns its hold and never reroutes. Complete a normal no-verdict delivery only after the host confirms a current re-offer; an uncertain or failed fallback stays `needs_review`, with its `REVIEWER_FALLBACK_UNCONFIRMED` reason excluded from automatic moved-review settlement; ordinary superseded holds keep their existing rule. Log one bounded no-verdict line from exit code and allowlisted hub-tool metadata only, with full refusal privacy/secret screening before sanitization and truncation; retain the first full host refusal across native echoes, and withhold differing later host refusals rather than replacing or accumulating them; stale/private context is withheld. Record only allowlisted tool names and refusal text; never retain argument objects, task/diff fields or model-message events as trace data. `quota` comes only from the backend's structured `failure(event)` (the pinned native frames in `src/adapters/definitions/native-quota.ts`, revalidated by `nativeReviewerQuota`) or Kimi's `failureOnExit` (a nonzero exit with the complete owned stderr read after group settlement, `kimiReviewerQuotaOnExit`), never from assistant, tool or model text (quota rules: `budget.md`). An NDJSON frame over 256 KiB or more than 4 MiB of output aborts the review as `needs_review`.
138
- - Codex reviewer isolation (`src/adapters/codex-review-isolation.ts`): accept only a `codex-cli` version that compat `codex-review` admits (verified or the person's trust, #691), and still run every proof below after trust; pass `-c notify=[]` (legacy notify off) on every launch; prove model-free that Apps, plugins and hooks are disabled (`features list`), ambient MCP servers are replaced by disabled stubs, and the hub server alone is enabled with exactly `hub_review` and `hub_task_show`; approve exactly those two MCP tools per tool, never with a server-wide approval default; before marking a reviewer backend/version verified, record a successful model-backed hub tool call as well as the model-free inventory (inventory alone is not verdict-delivery proof); run the native sandbox fixture probe before every launch; hash the binary once and fence binary and config files by metadata. Credential denies come only from the bounded `HOST_CREDENTIAL_PATHS` and `HOST_CREDENTIAL_ENV` lists, denied at the lexical and canonical path; refuse glob syntax or a root inside the checkout. A root that is dangling or unreadable refuses too; the reason names only its path class (`~/.docker`, `$DOCKER_CONFIG`), never a path or contents. Never pass the control token in a reviewer child's argv, env or MCP config: keep the hub state dir in its `privatePaths`. A refused `prepare` carries a `causeClass` from the closed `REVIEWER_CAUSE_CLASSES` (`version`, `binary`, `mcp_inventory`, `plugins_hooks_apps`, `sandbox_proof`, `credential_root`, `timeout`, `unknown`; `reviewer-print.ts`, #722): `prepare` tracks the proof leg it is on, and `timeout` means a metadata command ran out of its 2 s or the 12 s budget, never an abort. The host builds the reason only through `reviewerUnavailableReason(cause, detail)`: a fixed sentence per class, plus a credential-root path class (`~/.docker: a dangling link`) as the only detail. The one exception is a failed `start()` whose error is a version refusal (`VERSION_REFUSAL`) or comes from a `nativePolicy` backend: the daemon shows that sanitized message, capped at 1000 characters (#691). `ReviewerPrintPeer` classes a missing or invalid receipt as `unknown`, a `launch.current()` change before spawn as `binary`, and any other start error as `unknown`. Keep admission refusals separate from start failures: skip only a stale-bound request with one task-id log and no reroute; reroute a still-current request whose policy changed as `no_verdict`, without marking the reviewer unavailable. The daemon writes that reason to the `reviewerUnavailable` map (read by routing and shown as the `reviewer` line of `ahub status`), and a `hub.log` line names the class. Never add native CLI text, a path, a version output or a token to the class, the reason or the log.
140
+ - Codex reviewer isolation (`src/adapters/codex-review-isolation.ts`): accept only a `codex-cli` version that compat `codex-review` admits (verified or the person's trust, #691), and still run every proof below after trust; pass `-c notify=[]` (legacy notify off) on every launch; prove model-free that Apps, plugins and hooks are disabled (`features list`), ambient MCP servers are replaced by disabled stubs, and the hub server alone is enabled with exactly `hub_review` and `hub_task_show`; approve exactly those two MCP tools per tool, never with a server-wide approval default; before marking a reviewer backend/version verified, record a successful model-backed hub tool call as well as the model-free inventory (inventory alone is not verdict-delivery proof); run the native sandbox fixture probe before every launch; hash the binary once and fence binary and config files by metadata. Credential denies come only from the bounded `HOST_CREDENTIAL_PATHS` and `HOST_CREDENTIAL_ENV` lists, denied at the lexical and canonical path; refuse glob syntax or a root inside the checkout. A root that is dangling or unreadable refuses too; the reason names only its path class (`~/.docker`, `$DOCKER_CONFIG`), never a path or contents. Never pass the control token in a reviewer child's argv, env or MCP config: keep the hub state dir in its `privatePaths`. A refused `prepare` carries a `causeClass` from the closed `REVIEWER_CAUSE_CLASSES` (`version`, `binary`, `mcp_inventory`, `plugins_hooks_apps`, `sandbox_proof`, `credential_root`, `fixture_root_denied`, `timeout`, `unknown`; `reviewer-print.ts`, #722): `prepare` tracks the proof leg it is on, `fixture_root_denied` (#1493) means a deny entry covers the system temp directory and the hub's own `reviewer-proof` directory, so the proof has no place for its public canary (the fixture root moves to the hub directory when only the temp directory is covered; the reason names no entry), and `timeout` means a metadata command ran out of its 2 s or the 12 s budget, never an abort. The host builds the reason only through `reviewerUnavailableReason(cause, detail)`: a fixed sentence per class, plus a credential-root path class (`~/.docker: a dangling link`) as the only detail. The one exception is a failed `start()` whose error is a version refusal (`VERSION_REFUSAL`) or comes from a `nativePolicy` backend: the daemon shows that sanitized message, capped at 1000 characters (#691). `ReviewerPrintPeer` classes a missing or invalid receipt as `unknown`, a `launch.current()` change before spawn as `binary`, and any other start error as `unknown`. Keep admission refusals separate from start failures: skip only a stale-bound request with one task-id log and no reroute; reroute a still-current request whose policy changed as `no_verdict`, without marking the reviewer unavailable. The daemon writes that reason to the `reviewerUnavailable` map (read by routing and shown as the `reviewer` line of `ahub status`), and a `hub.log` line names the class. Never add native CLI text, a path, a version output or a token to the class, the reason or the log.
139
141
 
140
142
  ## Headless Claude implementer (#525-4)
141
143
 
@@ -7,6 +7,8 @@ Scope: the CooperBench runners, their fixtures, teardown and recovery. Read befo
7
7
  - The benchmark run's restoration state: `restoration.json` says `restored: false` from before the runner locks anything until it writes its outcome, and the recovery trusts `restored: true` only when `restoration-ledger.json` agrees (`unrestored` in `scripts/benchmarks/teardown.ts`). A run directory that is not restored is never reused: its locked modes would become the originals. A ledger from before 0.12.5 (no runner identity) owes its locks but, when `restoration.json` says `restored: true` or names a runner, keeps its trust entry as it was then (`owed`; with no `restoration.json`, its runner did not finish and the entry is owed too): the reuse check and the recovery read both through these two functions, never on their own (#120).
8
8
  - A latched active-window terminal failure carries the #175 bounded diagnosis: the terminal class comes only from the pinned Qwen build's exact loop-protection message contract (anything else stays `unknown`), the active-window tool trace is count-only and phase/generation-fenced like the latch (setup probes and teardown never count), tool categories come from the protocol kinds and the #138 canonical binding (`canonicalMcpToolName` in `src/adapters/acp.ts`), and the native guard's threshold, predicate and no-op signals are declared unavailable, never derived from event totals. The diagnosis explains the latched failure and never changes it: no retry, no continuation, no guard relaxation.
9
9
  - Classify Pi's ceiling only from the adapter's validated producer signal bound to the latched peer/active generation. Keep shared budgets and Qwen's guard distinct; diagnostics never change the frozen end cause.
10
+ - Pi's managed step ceiling changed from 30 to 100 (#1502, `src/pi/extension.ts`, `src/pi/launch.ts`), so a collection using that default has a changed study condition. Declare it before collecting. Host continuation (#1500) requires a settled ceiling with no active or pending tools and an accepting live owner, and is bounded by `pi.max_continuations` for the same accepted task and owner. Aborted turns do not continue; a successful turn resets the continuation count. Do not count an unsettled ceiling or an abort as a continuation.
11
+ - A collection that exercises Pi task worktrees with install inputs must account for dependency preparation (#1509, `src/pi/task-dependencies.ts`, `src/pi/dependency-publish.ts`): install inputs come from the reviewed base, the task worktree is rechecked before publication, and preparation failure is advisory rather than task-acceptance evidence.
10
12
  - Read terminal coverage only through bounded `terminal_coverage` metadata reads, rebinding the audit, ledger and manifest to the seal index. Require complete sealed state, all audit checks, plan/cell/count reconciliation and zero recorded live owners. Report recorded verification separately from fresh audit; missing or inconsistent evidence is unavailable.
11
13
  - Publish Pi benchmark descriptors from `benchPiToolProblem`; keep production schemas unchanged and omit solo peer messaging. Attest every bootstrap tool publication against declared native/schema/source pins before scored generation. Fail/defer missing, mixed, malformed, truncated or changed publications; retain only bounded names/counts/hashes. Declare a new study condition before any changed collection; never rewrite historical artifacts or select retries by score. The driver's Qwen profile and Pi tool sandbox are `profile()` from `src/local/sandbox.ts`: a change to that profile (#270's refusal of the `.git` name is one) is such a changed condition. So is a change to when its Qwen `AcpPeer` cancels a turn: it passes no `toolCeilingMs`, so a silent open tool call runs to the default ACP tool ceiling (#542), not `watchdogMs`.
12
14
  - The benchmark runner's Claude trust entry: a write still `pending` in the runner's own process never landed, so it is `not_written` on every path (contained or not, its temp file removed or left), and neither the runner nor the recovery touches an entry then. Only a dead runner's `pending` leaves that question to the recovery, which takes back only an entry exactly as the runner would have written it, and none while the runner's temp file is still there (the rename never happened). `changed_concurrently` is the user's entry and is never taken back. The runner's settlement is `settleTrust` in `scripts/benchmarks/teardown.ts`, tested as a table: change it there, never inline.
@@ -18,6 +18,7 @@ Scope: quota and native context readings, checkpoints, pause, handoff and resume
18
18
 
19
19
  - Keep native context occupancy (`src/hub/context-window.ts`, readers in `src/adapters/definitions/native-context.ts`) separate from quota accounting; never use Codex's accumulated `total` as occupancy or estimate Pi counters. Host code reads quota and context only through `readNativeQuota` (`budget.ts`) and `readNativeContext` on the resolved definition's declared `budget.reader` / `budget.context`; no declared reader is unknown, never an empty reading (rule: `adapters.md`).
20
20
  - Context checkpoint completion requires its request id and the current attached peer/native session. Invalidate its transport generation synchronously at a new peer claim, before asynchronous recall or attachment. Never pause, reassign or replace a session on context pressure; `ContextWindows.admission` (#802) only copies the reading for new-offer routing and never changes the crossing latch. Refuse private-turn, PII-pattern and all associated open PII-task summaries (owner or reviewer, including in_review, with the current routing policy; use `isClosedTaskState` to exclude approved and cancelled work) before local persistence or cloud memory; never broadcast checkpoint text.
21
+ - A quota or context checkpoint also snapshots each owned task's creation and ownership-change epoch (#1506). Before accepting a summary, require that task binding and the original peer/session to remain current. If ownership moved or the task was cancelled, refuse the stale answer with a body-free cause retained only until that request's original deadline; a new request replaces the refusal. A changed peer/session reveals no prior task ids.
21
22
  - Invalid/stale context readings expose unknown and do not rearm a crossing. Latch a crossing only after its event is accepted; reconsider paused/recovery-held crossings after release with fresh current-session readings. Tee context fields contain finite numeric values or null only, bound to daemon instance, launcher and native session. Context and session go to the per-peer file `claudeStateFile(base, peer)` (the builtin keeps the unsuffixed name); `claude-usage.json` stays one shared file per account.
22
23
 
23
24
  - A provider hard refusal ends a reading override and supersedes a soft evaluation still awaiting its checkpoint; never let the obsolete checkpoint overwrite that pause. An ACP provider quota refusal reports a hard budget reading and confirms the live pause before the adapter requeues work, so the pause fences retries and the existing relay handles assignments. Use the observed window length for an unknown reset; repeated quota refusals while paused do not consume poison-envelope retries, except for an `invocation` request: it gets at most one automatic retry, only when `canRetryInvocation` says so, paused or not (rule: `bus.md`).
@@ -5,6 +5,7 @@ Scope: delivery, digests and condensation, reply addressing, priority and limits
5
5
  - Supervision replaces only pending, never attempted or accepted, envelopes with the same stable key. Preserve the first batch deadline and existing digest/queue ceilings; role/feed revocation withdraws pending notices only. Count supervision from actual transport admission followed by a successful native turn completion, never from enqueue or failure-to-idle.
6
6
  - Lifecycle `deliveryHeld` fences both drain/pull and important steering before owner teardown awaits; retain newly queued work for an explicit restart without altering manual, budget or conductor pauses.
7
7
  - Apply reloaded `batch_max`, `batch_ms` and `queue_cap` only through `Bus.configureScheduling` (#439): it validates the values and changes later batching and admission only. Never re-arm an existing batch deadline, trim or reorder queued work, or touch prefaces, pauses, recovery holds or in-flight delivery from it.
8
+ - Re-take the queue before handing a prepared digest to the adapter when important work arrived during condensation (#1447 T4); restore volatile originals/preface only, leave durable queued rows intact and count no attempt for abandoned preparation.
8
9
  - A failed digest is retried one envelope at a time, so a poison envelope cannot take its neighbours down with it.
9
10
  - Preserve typed `failureCause` through journal transitions, direct holds, recovery and explicit retry; an absent cause on an older row stays unknown, never inferred from its reason or body. Read unresolved failed counts only through `failedDeliveryCounts()` / `unresolvedFailedCounts()`, without hydrating payload history; exclude explicitly resolved rows, including failed retry parents, and keep unavailable counts distinct from zero. These diagnostics never authorize replay or change delivery disposition (#1178).
10
11
  - An `important` envelope being steered is not in the queue while the steer is in flight; queue it first and an idle transition delivers it twice.
@@ -21,6 +21,10 @@
21
21
 
22
22
  - Conductor console ops (#933): a tools caller's `CONDUCTOR_TASK_OPS` request (`github_import`, `intake_approve`, `schedule_run|pause|resume`, `task_unassign`) and `goal_link` are admitted by `admitOperational` in `onMessage` before Tasks sees them, and the task op runs inside `operationalContext`, which `TasksDeps.operational` reads; never let `taskOpBody` admit a non-person caller to a console op any other way. `conductor_operational` `admit` audits a `CONDUCTOR_LOCAL_OPERATIONS` form once; `authorize` only rechecks the role. `task_catalog_role` from a tools caller passes the peer to `Tasks.setRole` (never `USER`), and is refused for a child, external, read-only or PII-context caller.
23
23
 
24
+ - Security audit CLI (#1403 A4): `sdlc audit start|show` runs as the console user or the current configured conductor; the conductor CLI form passes through `conductorOperation` and `admitOperational` before the audit handler. Keep the validated subcommand mapping and task/unit/finding authority in `tasks.md`, with the lifecycle contract in `docs/sdlc.md`.
25
+
26
+ - Bounded task wait (#1454): pass the current `task_sweep.enabled` state into `profileTaskTools` as `wait`/`taskWait`, so `hub_task_wait` is listed only when the idle sweep is enabled. Keep the tool gate aligned with the setting; `Tasks.wait` and sweep semantics are in `tasks.md`.
27
+
24
28
  - Console attention navigation selects a delivery only by an exact visible row id. A missing id or row prints read-only guidance; never select by peer or fall back to the first Queue row.
25
29
 
26
30
  Scope: the operator console, control WS and its protocol, state files, the dashboard listener and settings, the Claude channel's reconnect, `ahub setup`, git snapshots, upgrade and recovery. Read before editing `src/adapters/definitions/native-recovery*.ts`, `src/adapters/definitions/native-policy-aux.ts`, `src/adapters/definitions/native-config-*.ts`, `src/adapters/definitions/native-cli-*.ts`, `src/cli/console.ts`, `src/cli/console-state.ts`, `src/cli/console-versions.ts`, `src/cli/attention.ts`, `src/ui/needs.ts`, `src/hub/daemon.ts`, `src/hub/ui.ts`, `src/hub/settings.ts`, `src/hub/control-client.ts`, `src/adapters/claude-channel.ts`, `src/hub/restart.ts`, `src/hub/recovery-store.ts`, `src/hub/snapshots.ts`, `src/hub/manager.ts`, `src/hub/lifecycle.ts`, the runtime selection and retention modules (`src/hub/project-runtime-state.ts`, `src/hub/project-runtime.ts`, `src/hub/runtime-capture-prune.ts`, `src/hub/runtime-prune-health.ts`, `src/hub/registry.ts`), `src/hub/crash.ts`, `src/hub/start-mode.ts`, `src/hub/terminal-open.ts`, `src/hub/recovery-error.ts`, `src/hub/db-timeout.ts`, `src/hub/db-schema.ts`, `src/hub/protocol-window.ts`, `src/hub/config-reload.ts`, `src/hub/config-apply.ts`, `src/hub/config-tier.ts`, `src/hub/config-edit.ts`, `src/hub/config-edit-host.ts`, `src/hub/claude-launch-proof.ts`, the session and provenance modules (`src/hub/session-identity.ts`, `src/hub/provenance.ts`, `src/hub/channel-project.ts`), `src/hub/recovery-continuity.ts`, `src/cli/recovery-presentation-options.ts`, `src/cli/setup.ts`, the default agent set (`src/hub/start-agents.ts`, `src/cli/start-agents-run.ts`), `src/cli/upgrade*.ts`, `src/cli/runtime-version-warning.ts`, `src/cli/terminal-recovery.ts`, `src/cli/recovery-package.ts`, `src/cli/facts-hook.ts`, `src/hub/usage.ts`, `src/hub/memory-profile.ts`, the memory code modules (`src/hub/memory-symbols.ts`, `src/hub/memory-code-overlay.ts`, `src/hub/memory-code-head.ts`, `src/hub/memory-stale-anchors.ts`, `src/cli/memory.ts`), the task brief host (`src/memory/brief.ts`, `src/hub/memory-plan-guard.ts`), `src/hub/native-hook-launch.ts`, `src/cli/output.ts`, `src/ui/index.html`, the acon plugin (`src/ui/plugin.ts`, `src/ui/office-space.ts`, `src/cli/acon-register.ts`), `ahub study` (`src/cli/study.ts`, `src/cli/study-output.ts`), `src/hub/task-code-group.ts` (dashboard Code group), the agent drift sweep (`src/hub/agent-drift.ts`, `src/cli/agents.ts`) or the instance modules (`src/hub/instances.ts`, `src/hub/instance-config.ts`, `src/hub/instance-execution.ts`), or before adding a native peer.
@@ -70,7 +74,7 @@ Scope: the operator console, control WS and its protocol, state files, the dashb
70
74
  - Adding a native peer requires testing the command emitted by the actual recovery driver, not only its inspection or launch helpers. Never let a generic non-Codex branch treat a new peer as Claude.
71
75
  - Cross-version recovery must use the authenticated source protocol for prepare/commit/abort and the target protocol after startup. Prove the transition against a real prior release before claiming compatibility.
72
76
  - Preserve `task_cancel` target-feature preflight before source holds, capture or commit. Reuse stored target features only after verifying the same retained root and digest; legacy receipts still capable of commit must obtain feature proof. Do not apply pre-commit compatibility checks to sources already past commit. Every prepare, including the lease renewal before a terminal close and after a resume, sends the operation's stored `targetFeatures` (#478).
73
- - A recovery target-feature floor (`task_cancel`, `invocation` while the invocation ledger has an open (`queued` or `delivered`) row, `peer_instances`, `role_stages` while a declared Claude-kind instance holds `implementer`, `task_planners` while a list/instance planner is configured or `Board.hasPlannerState()` finds a task/release binding or plan-review authorship marker, `release_trains` while a configured train is active or frozen, `reviewer_pool` while a fresh reviewer or `review.pool` is configured, `configured_acp` while the project declares `adapters`, `external_adapter_modules` while external module definitions are loaded, `external_adapter_instances` with `external_adapter_modules` and `peer_instances` while an external module-kind instance is declared, `conductor_recovery` while `Board.hasConductorManualState()` finds open conductor manual-assignment intent, `project_autonomy` while the daemon holds retained autonomy consent or a raw `config.json` or `config.local.json` has a top-level `_autonomy` key (an unreadable file refuses as unknown), `calendar_schedules` while a raw `schedules` entry has a `cron` or `tz` key (#1017: an older target refuses the key at load), `research_records` while `Board.hasResearchState()` or a raw `config.json` or `config.local.json` `research` object names `runners` (unreadable refuses as unknown), `research_dispatch`, `research_dropped_offers`, `research_experiments`, `research_comparisons` and `research_evidence` while `Board.hasResearchDispatchState()`, `hasResearchDroppedOffers()`, `hasResearchExperimentState()`, `hasResearchComparisonState()` and `hasResearchEvidenceState()` find rows (each research digest joins `integrity()` only when its rows exist), `research_evidence_withdrawal` while `Board.hasWithdrawnEvidenceState()` finds withdrawal revisions, `advisor_surveys` while `Board.hasSurveyState()` finds survey, survey-finding or considered-finding rows, `reviewer_quota` while reviewer quota accounting rows or wait deadlines are retained, their integrity proof is incomplete, or the effective config holds a non-default `review.gate`, `review.max_minutes` or `review.unknown_quota` or a raw config file names one of those keys (an unreadable file refuses as unknown; the `advisorSurveys` digest joins `integrity()` only while its rows exist, `reviewerQuota` only while accounting rows or waits exist or its proof is incomplete), `research_runners` under the runner registration rule below, `review_comments` while `Board.hasReviewCommentsState()` finds stored comments or packages (its `reviewComments` digest joins `integrity()` only then), `review_observer_input_state` while the journal (`hasReviewInputState`) or a live or recovery-snapshot peer holds review input (unreadable refuses as unknown), `accepted_delivery_settlement` while `Bus.hasAcceptedTimeoutHolds()` finds a timeout hold (unreadable refuses as unknown), `action_policy_floor` while the raw `config.json` or `config.local.json` names `action_policy.floor`, true or false, even where the key is ignored or normalized away: an older target parses the raw key and rejects it before any trust rule, so check raw file presence, never the effective config (#582, seen twice), `model_overrides` while runtime model overrides are stored, `visuals` while visual records or a raw `visuals` config key exist, `guidance_probes` while `GuidanceProbeStore.hasRecords()` finds retained probe declarations or held work (#1391), `guidance_variants` while `Board.hasGuidanceVariants()` finds rows (#1367) and `execution_lineage` while `Board.hasExecutionReferences()` finds declared references (#1341); for these four a read that throws refuses as unknown) lives in `incompatibleRecoveryTarget`, which every existing check site calls, and its name in `DAEMON_FEATURES`; never check a floor at one site only.
77
+ - A recovery target-feature floor (`task_cancel`, `invocation` while the invocation ledger has an open (`queued` or `delivered`) row, `peer_instances`, `role_stages` while a declared Claude-kind instance holds `implementer`, `task_planners` while a list/instance planner is configured or `Board.hasPlannerState()` finds a task/release binding or plan-review authorship marker, `release_trains` while a configured train is active or frozen, `roadmap` while `Board.hasMilestoneState()` finds retained milestones or links (its roadmap digest joins `integrity()` only then), `reviewer_pool` while a fresh reviewer or `review.pool` is configured, `configured_acp` while the project declares `adapters`, `external_adapter_modules` while external module definitions are loaded, `external_adapter_instances` with `external_adapter_modules` and `peer_instances` while an external module-kind instance is declared, `conductor_recovery` while `Board.hasConductorManualState()` finds open conductor manual-assignment intent, `project_autonomy` while the daemon holds retained autonomy consent or a raw `config.json` or `config.local.json` has a top-level `_autonomy` key (an unreadable file refuses as unknown), `calendar_schedules` while a raw `schedules` entry has a `cron` or `tz` key (#1017: an older target refuses the key at load), `research_records` while `Board.hasResearchState()` or a raw `config.json` or `config.local.json` `research` object names `runners` (unreadable refuses as unknown), `research_dispatch`, `research_dropped_offers`, `research_experiments`, `research_comparisons` and `research_evidence` while `Board.hasResearchDispatchState()`, `hasResearchDroppedOffers()`, `hasResearchExperimentState()`, `hasResearchComparisonState()` and `hasResearchEvidenceState()` find rows (each research digest joins `integrity()` only when its rows exist), `research_evidence_withdrawal` while `Board.hasWithdrawnEvidenceState()` finds withdrawal revisions, `advisor_surveys` while `Board.hasSurveyState()` finds survey, survey-finding or considered-finding rows, `reviewer_quota` while reviewer quota accounting rows or wait deadlines are retained, their integrity proof is incomplete, or the effective config holds a non-default `review.gate`, `review.max_minutes` or `review.unknown_quota` or a raw config file names one of those keys (an unreadable file refuses as unknown; the `advisorSurveys` digest joins `integrity()` only while its rows exist, `reviewerQuota` only while accounting rows or waits exist or its proof is incomplete), `research_runners` under the runner registration rule below, `review_comments` while `Board.hasReviewCommentsState()` finds stored comments or packages (its `reviewComments` digest joins `integrity()` only then), `review_observer_input_state` while the journal (`hasReviewInputState`) or a live or recovery-snapshot peer holds review input (unreadable refuses as unknown), `accepted_delivery_settlement` while `Bus.hasAcceptedTimeoutHolds()` finds a timeout hold (unreadable refuses as unknown), `action_policy_floor` while the raw `config.json` or `config.local.json` names `action_policy.floor`, true or false, even where the key is ignored or normalized away: an older target parses the raw key and rejects it before any trust rule, so check raw file presence, never the effective config (#582, seen twice), `model_overrides` while runtime model overrides are stored, `visuals` while visual records or a raw `visuals` config key exist, `guidance_probes` while `GuidanceProbeStore.hasRecords()` finds retained probe declarations or held work (#1391), `guidance_variants` while `Board.hasGuidanceVariants()` finds rows (#1367) and `execution_lineage` while `Board.hasExecutionReferences()` finds declared references (#1341); for these four a read that throws refuses as unknown) lives in `incompatibleRecoveryTarget`, which every existing check site calls, and its name in `DAEMON_FEATURES`; never check a floor at one site only.
74
78
  - Project autonomy (`autonomyCommand` in `src/hub/daemon.ts`, `writeAutonomyPreset` in `src/hub/settings.ts`): the `autonomy` control message is console-only; its operations come only from `planAutonomy` and `autonomyRemovalKeys`, never from the request; `off` removes the fixed key list and clears consent whatever `_autonomy` says. `_autonomy` is inert metadata, never approval provenance. Retained consent is created only by `createAutonomyConsent(...).confirm` inside the daemon (console `on`, or startup under a trusted `readAutonomyDefaults` opt-in with an exact plan match), never by a CLI or offline writer; a config `never-ask` takes effect only for a peer in `autonomyConfirmed`.
75
79
  - Defer hub notices only for an authenticated recovery `prepare` or `commit` whose target features include `recovery_deferred_hub`, or for a restored daemon. Otherwise `setRecoveryHold(true)` moves the deferred notices into queues before commit records expected integrity, and a bare `fenceRecovery` defers nothing. Abort and lease expiry release the bus hold before clearing the operation; if that release fails, keep the operation and let expiry retry on its 1 s timer (#478).
76
80
  - A restored daemon releases deferred hub notices before `tasks` is initialized (#1353), and the bus's `silence` hook (`src/hub/daemon.ts`) runs for them: keep its Tasks-independent exclusions (user, hub and digest senders, `fyi`, non-chat kinds, the user recipient) ahead of `turnFree()` and any `tasks` call (`test/deferred-hub-startup.test.ts`).
@@ -155,11 +159,12 @@ Scope: the operator console, control WS and its protocol, state files, the dashb
155
159
  - Anything the daemon starts on a timer and registers only with `startupCleanup` is not stopped by a normal `stop()`: `startupCleanup` runs on a failed startup only. Clear the timer and close the store in `stopOnce`, and wait for a pass in flight before the board closes (`schedulesPass`, #512a). A console op that runs the same writer on demand (`schedule_run`, #335) joins that wait through `manualSchedulePasses`; add any new on-demand entry to it, or `stopOnce` closes the board and the store under it.
156
160
  - Corpus (#510a, `src/hub/corpus.ts`, `corpus-config.ts`): `corpus.paths` is machine-local and `corpus` is never editable from settings. Keep `corpus-config.ts` free of file-system imports, because the config schema (`config-apply.ts`) reaches the Claude channel bundle. A refusal of a root is a reason string, never a thrown error and never a partial read: evidence the check cannot read refuses, and only a completed read certifies a folder. The vault check is `.obsidian` at the real root, in every ancestor and anywhere below (any entry of that name), always on the `realPath`. A folder the pii, deny or local.deny rules protect is never listed, so it cannot be shown vault-free: the root that holds it is refused, never certified with that subtree skipped (a protected file is only skipped).
157
161
  - Domain packs (#513a, `src/hub/packs.ts`): `ahub init --profile` resolves a shipped profile name first, then a pack through `loadPacks` (shipped: `templates/packs/` listed in `src/hub/shipped-packs.ts`; a project pack in `.agenthub/roles/<name>.pack.json` replaces a shipped one of the same name); keep `parsePack` closed (exact fields, bounded, plain ASCII, ids through `criterionId` from `src/hub/workflow.ts`) and never give a pack a field that carries a command, a path or an authority. The preview names a pack by ids only, never rubric or check text, and the apply goes through `packOverrides`, which `resolveProfile` validates. Reads use `lstat` and `O_NOFOLLOW` and refuse a hardlinked file, as the role catalog does. A pack whose roles are not in `loadRoleCatalog` is refused whole.
158
- - `ahub init` settings (#1100, #1110, #1107): a settable key is one row in `INIT_SETTINGS` (`src/cli/init-settings.ts`, pure, closed value sets). Derive peer rows from `ADAPTERS`. Never add a row for an executable, secret, model, provider, instance or permission. The guided prompt runs only when `promptGate` holds: a person at a TTY, a new project, no setting flag, no `--yes` and no `--dry-run`; never for a delegated peer or a live test. It returns flag values and writes nothing, and its plan takes the autonomy row from `autonomyInheritanceChange`, the same helper `--dry-run` uses. Role choices at init (#1408 T2, `src/cli/init-roles.ts`: `--conductor <peer>|none`, `--planner <peer>[,...]`, `--reviewer <peer>[,...]|person` and one guided question each) are pure: `planRoles` asks `roleEligibility` and refuses before anything is written, moves only conductor, planner and reviewer, and writes each changed peer as one explicit list, including the peer that loses a role, because `roles` merges per peer. `--track-config` / `--no-track-config` (#1411 T1) checks every `.gitignore` line it adds with `git check-ignore` first and refuses, writing nothing, when a rule would hide a shared file; with neither flag an existing project keeps its ignore state and the block's role sentence.
162
+ - `ahub init` settings (#1100, #1110, #1107): a settable key is one row in `INIT_SETTINGS` (`src/cli/init-settings.ts`, pure, closed value sets). Derive peer rows from `ADAPTERS`. Never add a row for an executable, secret, model, provider, instance or permission. The guided prompt runs only when `promptGate` holds: a person at a TTY, a new project, no setting flag, no `--yes` and no `--dry-run`; never for a delegated peer or a live test. It returns flag values and writes nothing, and its plan takes the autonomy row from `autonomyInheritanceChange`, the same helper `--dry-run` uses. Role choices at init (#1408 T2, `src/cli/init-roles.ts`: `--conductor <peer>|none`, `--planner <peer>[,...]`, `--reviewer <peer>[,...]|person` and one guided question each) are pure: `planRoles` asks `roleEligibility` and refuses before anything is written, moves only conductor, planner and reviewer, and writes each changed peer as one explicit list, including the peer that loses a role, because `roles` merges per peer. `--track-config` / `--no-track-config` (#1411 T1, #1496) verifies planned root ignore text with Git before project writes, appends only its owned shared-config re-inclusions over outside or root rules when the project is the Git root (subdirectory projects retain the earlier no-block/manual-refusal path), and refuses a still-winning nested/project rule; the disposable preview holds only root and .agenthub ignore text, uses the real Git dir read-only and is removed in finally; with neither flag an existing project keeps its ignore state and the block's role sentence.
159
163
 
160
164
  - Campaign dispatch (#597): keep `research_dispatch` additive to `research_records`; any stored campaign requires it, because old campaign stop policies also need current dispatch enforcement. Preserve the conditional dispatch metadata/handoff integrity digest and every other recovery feature guard. A study-dropped owner offer (#603) is a `research_dropped_offers` row written through `Board.recordResearchDroppedOffer` from `Tasks.relevant`, never an in-memory map: a restart between the drop and the approval must still re-offer. It joins `researchDispatchIntegrity` only when rows exist (so a project without one keeps its digest), requires a `research_units` row for its task and a peer-shaped owner, and `studyReoffer` clears it only after the offer is published or the record is stale.
161
165
 
162
166
  - Experiment storage and runner registration (#598, #600): preserve `research_experiments`, its conditional integrity digest and every earlier research/calendar/autonomy guard. Read check evidence only through this project's host reader; no record input creates a measured field. Accept `research.runners` only in untracked `.agenthub/config.local.json`; refuse shared or tracked raw keys even when empty. Keep registration person-only, with whole-block tier2 structural edits and atomic scoped reload; never admit conductor writes. Consume registrations through `TasksDeps.researchRunners`, revalidating the active accepted configuration and current source trust each call; never adopt raw disk edits through that getter. While stored runner state or an active/raw runner key exists (empty counts), require `research_runners`. Include `researchRunners` in release-equality integrity only when stored receipts exist, using their count and stored-row digest alone; never bind accepted registrations or raw config presence to board-state equality across restart.
167
+ - CLI exit codes and the error line (#1484 T2, `src/cli/error-format.ts`): `fail()` exits 2 for a usage error and 1 for everything else, and it classifies by the message text (`failureExitCode`), not by a separate helper. A NEW usage error must start with `usage:` (or be `unknown command ...`, `<what>\nusage: ...`, `--flag needs a value`, `unknown argument|option|flag ...`, `invalid release command`) or it exits 1 by accident; a refusal that changed nothing (`never-ask requires --yes`) and a runtime failure (no hub, an unreadable file) stay 1. `fail(message, refusalAudited, authorityRefused, next)` takes an optional next step, printed as ` → <command>` only where the fix is known; a daemon refusal passes through without one. `ahub doctor` exits 1 on a failed row, `--json` included, and `ahub setup` clears `doctorSetsExit` before it runs the same report. A report built on `Report` (`console-state.ts`) takes `columns` undefined on a pipe without COLUMNS and then never wraps (standard v1, Width).
163
168
  - `ahub study` (#601, `src/cli/study.ts`, `src/cli/study-output.ts`): `study.ts` is pure argv parsing (ids `rc-` and twelve hex digits, revisions as positive integers, `--reason` takes the rest of the words) and runs before any connection; `main.ts` reads the contract file against `invokedFrom` with a 64 KiB bound and sends it to the hub, which validates it. `show` and `experiments` (#602: `--campaign`, `--attempt` or `--plan --baseline --variant`, the same read as `hub_experiment_show`) are `allowed` in `classifyPeerCommand` through `peerReadForms`, and so is `evidence <ev-id> [--revision <n>]` (#931, the same read as `hub_evidence_read`); `evidence --task <task>` (`study_evidence`) and `check <task> <manifest.json>` (`study_check`, which exits 1 unless the status is `ready`) are console-only task ops the daemon refuses on any other connection, and the CLI refuses them, like a manifest-bound `task claim`, against a hub whose `features` lack `research_synthesis`; draft, revise, approve, approve-protocol and close are `console`, and the audit label names at most the subcommand (approve-protocol is labelled `study`; a campaign id, a protocol hash and a contract path are the person's text). The default output is for a person and `--json` prints the hub's text byte for byte (`test/output-cli.test.ts`); a new `study` form needs its `--json` branch and a renderer, never a `TEXT_DEBT` entry.
164
169
  - `ahub specs` (#1097, #1107, `src/cli/specs.ts`): `list`, `check` and `covers` are read-only and run without a daemon. `specs stamp` records a person's review: `classifyPeerCommand` refuses it from every agent shell, live-test delegation included, and it needs a TTY even with `--yes`. Never add a delegated or conductor form of it.
165
170
 
@@ -167,5 +172,5 @@ Scope: the operator console, control WS and its protocol, state files, the dashb
167
172
  - Doctor memory capture (#1008, #1025): the `memory capture: <tool>` rows come only from `amem setup <tool> --json`, a preview that writes nothing (`readMemorySetup` in `src/cli/main.ts`: no shell, 10 s, 256 KiB), judged by the pure `nativeMemoryCaptureRow` (`src/adapters/definitions/native-cli-doctor.ts`). A plan not in the documented shape, a non-zero exit, a timeout or unparsable output is unknown, never ready; never read dotfiles text or a client's config, and do not scrub the caller's identity before the call.
168
173
  - Handoff transport (#604): `handoffOut` connects to the target as a `console` role through `ControlClient` (same token file and machine user as every control message; the hello checks the target's project root and instance), and the target answers every handoff message, an unknown one included. `handoffNotifyOrigin` hangs off `board.onChange` inside its own try, so a task move never waits for, or fails because of, another project's daemon. A target is judged by its own `status.json` features (`checkTarget`), never by a guess from its version. The inbound `task_handoff` is refused while recovery is active, counts in `taskOpsInFlight` so a recovery commit waits for it, and hands `handoffIn` a fence (recovery or `stopping`) that it asks again right before the board write, after the PII screen's await. Keep `task_handoff` in `DAEMON_FEATURES` and its recovery guard beside `research_experiments`; no `PROTOCOL` bump, because a new message type is answered as unknown by an older hub and an optional field is ignored. Handoff diagnostics (#1203 T3): a connection failure to a target is classified by `handoffConnectFailure` from the error's `code` (4426, 4404, `AHUB_CONNECT_TIMEOUT`, anything else), never from its message, and every handoff failure log goes through `handoffLog`, which keeps the last cause per target (`handoffFailures`, read by `handoffListView`) and rate-limits the line with `handoffLogGate`; a new silent `catch` in the handoff block is a defect. `handoffListView` opens no connection (registry and descriptor files only), so `--list` never waits on a target. `hub_task_handoff_sync` is a control op and not in `hub-tools.ts`: an agent never sees it, and `Tasks.handoffSyncAuthority` refuses anyone but the person or the conductor. `handoffCatchUp(only, wait)` with `wait` waits for the running pass and then runs its own, so a sync answers after a pass that began when it was asked, but never for longer than `handoffSyncBoundMs` (20 s, below the CLI's 30 s control timeout): a slower pass makes it answer `syncing: true` with the list, and a sync must never end in the generic "no answer from the hub". Handoff sequence (#1203 T2): `recordHandoffOutbound` applies a write with a `seq` only when it is newer, inside the one statement; `handoffEvent` returns `recorded: false` for a stale one before it publishes, so never publish a follow-back before the write says `applied`. `handoffCatchUp` reads `handoffOutboundOpen` (no cap; `handoffOutbound` is the capped display list, never the catch-up's input), runs one pass at a time and queues a request that arrives meanwhile (the targets it names, or all) to be drained when the pass ends, so the guard never drops a watcher's request; `handoffWatch` asks once for the whole changed set; it asks in chunks of `HANDOFF_STATES_CHUNK`, and checks `stopping` between requests; its timers go in `intervals`. A new handoff event goes only to an origin that advertises `task_handoff_seq`. Handoff key (#1203 T1): `handoffOut` sends a key only to a target whose status descriptor lists `task_handoff_key`; a timeout or closed connection (`handoffOutcomeUnknown`, which reads the client's fixed wording and anchors it) is resent once with the same key, then asked by key (`task_handoff_by_key`), then `outcome_unknown`, never `invalid`. A refusal of the resend never settles an unknown first attempt (its PII screen may still file the task): it is kept as a note and the by-key lookup still runs. The caller's deadline covers the whole recovery: `controlRequestTimeout` gives `hub_task_handoff` `HANDOFF_CONTROL_TIMEOUT_MS`, built from the same `HANDOFF_*` budgets `handoffOut` spends, so the CLI and the MCP path (both ask for 30 s) receive `outcome_unknown` with the key instead of a generic timeout; change a budget there and the deadline moves with it. Never write the outbound row before an answer, and never reset an existing one (`handoffSent`). The follow-back envelope carries `refs.handoff` and no `refs.task`: a new envelope field that names a task in another project must not reuse `refs.task`, which the bus judges against this board.
169
174
  - Staged upgrades (#1039): retain `status.protocol` at the compatibility floor and publish `protocolMin`/`protocolMax`; negotiate the highest common control version and preserve each attached channel's actual negotiated protocol in recovery metadata. New scoped recovery receipts use schema 3 and per-project holds; keep legacy unscoped receipt behavior. Start ordinary project daemons from verified versioned release captures. Check `hub.db` with `db-schema.ts` before startup effects and every writable opener; advance its marker only with an incompatible format migration, never merely on opening with a newer binary. Before source replacement, controlled targets require `schema_guard`; preserve the retained target evidence of fully committed legacy receipts. Unguarded published binaries remain outside the bootstrap guarantee. Keep project runtime selection in bounded project-bound `runtime.json`; refuse Git-tracked or indeterminate repository state before using or replacing that authority. Updated 0.26+ up/manager/dashboard paths use its verified capture or a named version refusal. Preserve the explicit pre-0.26 published-CLI ceiling with a `ponytail:` note; never raise a DB/bootstrap floor for this selection. Compute path-scoped Git trust once per startup outside the writer lock; reuse its project-bound access for runtime reads and writes. Record selection and synchronous launch under the same registry lock used for capture publication and prune quarantine; confirm the unchanged selection and owner at readiness, and require the internal daemon to execute from that exact root. Scoped recovery must not refresh the shared manager. Prune only verified unreferenced versioned source captures, keep newest three/version, and defer on active recovery, unknown reference inventory or exhausted budgets. Schedule rate-limited maintenance after startup returns; keep only bounded metadata validation and atomic quarantine inside the registry writer lock, with candidate hashing and recursive deletion outside it. Refuse managed execution from reserved `.runtime-prune-*` paths; leave changed quarantine contents undeleted. Keep the 1 ms ledger wait on startup admission only; worker statements use the normal bounded wait. Record PID plus process signature and replace only a proven-gone running owner atomically under the admission transaction, with id/phase-fenced completion. Doctor names uncertain ledger state and leftover quarantine paths without repairing or deleting them. Reject empty recovery plans before source preservation.
170
- - Questions (#1053, `src/hub/questions.ts`, `src/hub/question-desk.ts`): the store owns the row and its ONE terminal transition (`UPDATE ... WHERE state = 'open'`; of concurrent answer, stop and expiry exactly one sees `changes === 1`), the desk owns the waiting call and the hub-built envelope, and the daemon only supplies ports. `answer` and `questions` are console-role control messages that always reply (rid); a tools or peer connection never reaches `questionDesk.answer`, and nothing a peer sends (a `hub_send` body, a tool result, an envelope) is parsed as an answer. A late answer is `kind: "answer"`, `from: user`, id `answer-<set>` (so a republish after a crash is dropped by the bus's own dedupe) with `refs.question`; an expiry notice is `kind: "status"` from the hub, never an answer. Supersede keys on `from === USER && kind !== "answer"` in the bus tap, never on the body, and never on the hub's own answer envelope. Question and answer text reach nothing but `hub.db` and the envelope to the asking peer: the tap's log line, `redactBusEvent` and the `question` event all stub them, `QUESTION_TOOLS` skips capture and the progress observer skips `hub_ask`. `hub_ask` holds its control request open (`controlRequestTimeout`, `request_cancel` through the shared `invocationRequests` map, so a closed socket or an aborted turn cancels the row) and Pi's bridge lifts its idle timeout for that one call. A new peer kind gets `questionWaitMs` on its definition (fixed builtins only, `assertNativeCapabilityScope`), never a wait chosen by the caller. The `questions` feature label is a recovery label: an older target ignores the table, so keep it in `DAEMON_FEATURES`. Start repair runs once after `ready`'s locals exist (`questionDesk.repair()` just before `ready = true`), and the sweep timer is pushed only after the desk exists.
175
+ - Questions (#1053, `src/hub/questions.ts`, `src/hub/question-desk.ts`): the store owns the row and its ONE terminal transition (`UPDATE ... WHERE state = 'open'`; of concurrent answer, stop and expiry exactly one sees `changes === 1`), the desk owns the waiting call and the hub-built envelope, and the daemon only supplies ports. Keep `questions` console-only and ordinary person answers unchanged. Permit `hub_ask_answer` and instructed `answer` only for the current unique conductor on the person's explicit per-set instruction in its own session; require a non-empty quote, open public set and public caller, and refuse self-answer, wrong actor, live-test/delegated execution and child/tools ownership. Never infer instruction from hub/task/review/file/peer text, permit blanket delegation or answer across projects. Keep every control rid answered and retain the existing question validation/one terminal transition. Read `docs/security.md` "Questions a peer asks the person" before changing this exception or its #1328 precedent. Persist the instruction quote only in hub.db; remove it from all read views, tool responses, envelopes, logs, events and capture. Publish only actor/instructed provenance (including `agent_cli`); include `hub_ask_answer` in the existing question capture/progress exclusions. Nothing a peer sends as a `hub_send` body, tool result or ordinary envelope is parsed as an answer. A late answer is `kind: "answer"`, `from: user`, id `answer-<set>` (so a republish after a crash is dropped by the bus's own dedupe) with `refs.question`; an expiry notice is `kind: "status"` from the hub, never an answer. Supersede keys on `from === USER && kind !== "answer"` in the bus tap, never on the body, and never on the hub's own answer envelope. Question text and answers are stored in hub.db; the answer envelope goes only to the asking peer, while person surfaces use `questionView` (instruction quote removed). The `answeredQuestions` dashboard, CLI and Acon projections include only non-private, non-PII rows. The tap's log line, `redactBusEvent` and the `question` event stub question/answer text; `QUESTION_TOOLS` skips capture and the progress observer skips `hub_ask`. `hub_ask` holds its control request open (`controlRequestTimeout`, `request_cancel` through the shared `invocationRequests` map, so a closed socket or an aborted turn cancels the row) and Pi's bridge lifts its idle timeout for that one call. A new peer kind gets `questionWaitMs` on its definition (fixed builtins only, `assertNativeCapabilityScope`), never a wait chosen by the caller. The `questions` feature label is a recovery label: an older target ignores the table, so keep it in `DAEMON_FEATURES`. Start repair runs once after `ready`'s locals exist (`questionDesk.repair()` just before `ready = true`), and the sweep timer is pushed only after the desk exists.
171
176
  - Completions (#1054 T2/T3, `src/hub/completions.ts`, `src/hub/completions-store.ts`): a run opens at the `turn_start` that consumes a `from: user` delivery (never the hub's own `answer`), only for a peer whose definition declares `settle`. An unattached pull-only peer creates none; a launcher-bound Kimi TUI opens one only after native readback proves a person origin. `settleCheck(peer)` is the ONE settle check and never throws; call it from every place a pending-work fact can change (turn end, `bus.onQueues`, a permission or question closing, an isolated check ending, `Tasks.checkEnded`, a native task notification or a native-background re-read). The bus takes a delivery out of its queue before the peer's idle reaches the state tap, so `queuedContinuations` also counts `dispatching` rows and `deliveredAwaitingTurn` (bounded to 10 s, `ponytail:` in the code); drop either and a continuation reads as nothing pending. Claude settles only on the verified native Stop (a lost channel or watchdog carries no id and never settles). Kimi TUI settles only on correlated final-turn readback plus a known-empty background inventory; a running or unknown inventory and an active native turn stay working. A `limit` or budget pause ends the run with no completion (`budget.record`), an explicit stop calls `quietStop`, and `completions` is a recovery feature label (`hasPending`: an open run or an unread completion). The store keys a completion by the run's first turn id (`UNIQUE`), so repeated restarts yield one `interrupted` completion; never reconstruct from `events.jsonl`, which cannot say who started a turn. Launcher end/socket loss also settles an open run `interrupted`, once. Receipts (#1054 T4/T5): `completion_receipts` has a UNIQUE index on `completion_id`, so `markSeen` is one compare-and-set and a mark-unread has exactly one row to delete; `result_seen` and `results` are console-role control cases (rid always) placed before `case "kill"`, and nothing else writes a receipt: never mark read from a snapshot, a status read, a listing or an envelope. The `result` need is level `watch` and is not in the `waiting`/`blocked` lists in `needs()`; keep it that way so a result never reads as something to act on. Reconstruction drops an open run whose peer has a budget pause record before it would settle it `interrupted` (persist before remove, per run), and `CompletionStore.prune` bounds the table to the newest 500 read completions at start; never prune an unread completion or an open run. The title of a result is computed at display (`resultView`), a stub when private, and no prompt or reply text is ever stored. Native-person results always stay private.
@@ -21,11 +21,13 @@ Scope: the hub-native local worker, its tools, path guard, denylist and seatbelt
21
21
  - A review turn (any envelope `isReviewObserverExcluded` accepts, or an anchored `hub_review` call, which latches the exclusion for the rest of the turn; both in `src/hub/memory-policy.ts`; any `hub_evidence_read` call latches it the same way, #931) is handled like a remote turn: it never joins `history`, never reaches `capture.observe`, `capture.summarize` or `observeTool`, and every failure it reports (answer, delivery reason, log line) says only `review turn failed`. While latched, `hub_remember` and `hub_task_propose` are refused before they reach `taskTool`. A throwing `beforeInput` settles the delivery `failed_safe` (`review input provenance unavailable`) before the turn starts. Keep all of these when you touch the turn's settlement or the tool loop.
22
22
  - `ctx.permit` answers a `ToolApproval` (`true`, `false`, `"expired"`, `"aborted"`, #253): only `true` permits an effect, so never test it for truthiness. A tool returns `approvalError`'s text for the rest: a denial, the expiry (which tells the model not to retry) or the withdrawal. A turn that two unanswered approvals ended (`ApprovalWaitStop`; counting rule: `adapters.md`) completes its missing tool results, settles its delivery `completed` with the reason and is never handed back for replay, also when no tool had a side effect.
23
23
  - `Facts` (`src/hub/facts.ts`, #428) names a large file whose ctime is under `RACY_MS` by its git blob id: in `load()` and `observe()` only through `racyBlob()` (per-file `RACY_HASH_MAX_BYTES`, per-store `RACY_BURST_BYTES` per event-loop turn, memo cleared at `boundary()`), past which it keeps the stat-only stamp and makes no claim; `atHead()` keeps its own `HASHED_BYTES` bound, `tree()` reads large files by stat only, and `largeBlob()` caches only settled stamps.
24
- - Hub tool calls (`hub_send`, `TASK_TOOL_NAMES`, `CONDUCTOR_TOOL_NAMES`) are never passed to `capture.observe`; `Tasks` alone decides what hub tool text reaches memory (#230). Every live `capture.observe` passes a host `sourceId` (`<session>.<turn>.<step>.<n>`, #752); a new host caller supplies one too. Capture stores `paths` only for `read`/`write`/`edit` and only project-relative ones: command argv is never path metadata.
24
+ - Hub tool calls (`hub_send`, `TASK_TOOL_NAMES`, `CONDUCTOR_TOOL_NAMES`) are never passed to `capture.observe`; `Tasks` alone decides what hub tool text reaches memory (#230). Keep `hub_ask_answer` explicitly excluded from `observeTool` too: its question and answer are not capture evidence (authority and read-view rules: `daemon.md` and `tasks.md`). Every live `capture.observe` passes a host `sourceId` (`<session>.<turn>.<step>.<n>`, #752); a new host caller supplies one too. Capture stores `paths` only for `read`/`write`/`edit` and only project-relative ones: command argv is never path metadata.
25
25
  - A tool that asks for approval passes its name to `ctx.permit`, and `write`/`edit` also the `guardPath` result, never the model's path string: also pass the original path separately through every permit wrapper, and every tool its parsed arguments as `input` (the always-ask classifier reads it, #750; rule: `adapters.md`); `ask-when-needed` grants only when both the original project-relative spelling and the real path avoid protected names through `grantablePath` (`src/hub/permission-mode.ts`). `bash` and mutating `git` pass no path. After the awaited approval `write`/`edit` run `guardPath` again and refuse a target that changed (#242).
26
26
 
27
27
  - Honor the live `protect_instruction_files` policy in scoped grants for the instruction names in `INSTRUCTION_FILES` (`src/hub/permission-mode.ts`: `AGENTS.md`, `CLAUDE.md`, `QWEN.md`, `GEMINI.md`); keep reads, explicit approval and never-ask unchanged. Only the settings registry writes this machine-local policy (#323).
28
28
 
29
+ - Bounded task wait (#1454): the daemon passes `taskWait` to `LocalPeer`; `profileTaskTools` includes `hub_task_wait` only when the idle sweep is enabled. Do not infer or read that setting in the worker; the authority and wait rules live in `tasks.md`.
30
+
29
31
  - For sandboxed task checks, use the opt-in hub-owned bounded container runner; never widen Seatbelt, expose credentials, mount host paths or fall back to a host command. Keep spec/check arguments and results out of capture.
30
32
  - The `bash` tool asks `ctx.permit` with the frozen input, then `ctx.shellExecutionCheck` right before the sandbox spawns (#816): `valid` runs, `ask` repeats the permit once with `{ forceAsk: true }`, `aborted` or a cancelled signal returns "turn cancelled before shell execution". `LocalWorker` binds the check to its turn generation, so a stale turn cannot spawn. A fake `ctx` in a test supplies `shellExecutionCheck` or accepts the `valid` default; never make it return `valid` for an aborted turn.
31
33
  - `web_fetch` (#515b, `src/local/web-fetch.ts`) is opt-in like `doc_read` (never in `TOOL_SCHEMAS`; offered only when `local.web_fetch.allow` names a host) and carries the owner's PII rule: it is refused for the WHOLE turn of a PII task, whatever the host, and that refusal is the first thing `webFetch` does, before the URL, the list or the proxy is read, so the answer and the timing do not depend on the request. Never move another check in front of it, and never give it a way to accept a PII turn "for a clean URL": the URL or a query could carry PII to the web, which `pii.paths` and `sanitize()` do not cover. It runs only through its OWN `startEgressProxy` (`webEgress` in `daemon.ts`, list `local.web_fetch.allow`), never the bash proxy: do not merge the two lists or reuse the bash proxy for it. The model sets only `url`, `offset` and `limit`; keep the request a bare GET with no model-chosen header, body or method, keep redirects manual and re-checked, and keep the result and the URL out of `capture.observe` and the research observation on every turn. The pure host checks live in `src/local/web-fetch-config.ts` because the config schema reaches the Claude channel bundle: keep that file free of file-system and process imports.
@@ -37,6 +37,7 @@ Scope: the security pass of a review (`REVIEW.md`), and any change under `src/lo
37
37
 
38
38
  ## Supply chain and release (companion `supply-chain`)
39
39
 
40
+ - When reviewing Pi dependency preparation, also check the Pi dependencies rule in `docs/agent-notes/adapters.md` and the Pi prepared dependencies section in `docs/security.md`.
40
41
  - Workflow actions are pinned by commit SHA with the version in a comment; `test/workflow-pins.test.ts` refuses a tag. Workflow `permissions` stay at the minimum each job needs (`.github/workflows/`).
41
42
  - The dependency volume key covers everything that decides `node_modules` (`dependencyKey` in `src/hub/check-runner.ts`); a manifest with an install lifecycle script is refused, never keyed. Never add `--ignore-scripts` or a writable shared cache to make a run pass.
42
43
  - Runtime dependencies stay at zero third-party packages; `@staix/agent-mem` stays exact-pinned.
@@ -4,6 +4,7 @@ Scope: the task flow, assignment, the state machine and the hub's MCP tools. Rea
4
4
 
5
5
  - Scope every task-place comparison through `TaskRepositories` (`src/hub/task-repository.ts`, #476): explicit `refs.repo`, else a common outside-absolute-ref repository or parent, else this project. Preserve relative display spelling within that key and gate overlap, contradiction, replay and held evidence by equal keys. Warm/cache repository identity at task mutation and startup; never repeat Git reads for unchanged overlap inputs. Set `refs.repo` for work in another repository; repo-only accept metadata never grants execution or file access.
6
6
  - Tool callers are models: MCP `inputSchema` is not enforced on the way in. Normalize at the boundary (`cleanRefs`) before anything reaches the board, and never throw after a board write: a publish or notify that follows a `review()` or `done()` board write goes through the one `releaseNotice` guard, which turns a failed publish into a console notice, drops a failed notify and never retries (#231, #243). An assignment's delivery once its board write is saved (#276, #297): the move is fact, the failed publish is not retried in place (the journal's own recovery covers a storage error, and a retry may duplicate a publish that actually left), and a person looks 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 is down) before re-sending with `ahub task assign <id> <owner>`. The distinction is made once, in `assignOwner`: a failure after the write prints the one console notice from `undeliveredNotice` right there, once, and throws `AssignmentUndeliveredError` carrying the saved task; callers (`review()`'s repeated rejection, `escalate` and its callers, the ready offer, both relays, the idle sweep, rescreen) decide control flow by the type and print nothing more, and `propose`, `assignTo` and `decline` additionally let the error reach the caller in its turn, which is a person or peer that can act. Two exceptions get no notice, by construction: a row superseded meanwhile, meaning a later history entry that moves or settles the task (another assignment, an unassign, the owner's accept, done, approval, close), while entries that do neither (the hub's quiet bookkeeping: answers, reviewer changes, idle sweeps, check results) leave the assignment undelivered and the notice stands, so the original error goes to the caller as before only on supersession; and a claim's own accepted write and "claimed by" line stay outside the delivery rule (a claim is its own hand-over; its overlap and routing announcements to earlier owners are deliveries and share the wrapper, so a failure there does read as one). A failure before the write stays a plain `Error` (#254), a failed write leaves the ready offer unconsumed (#231), and the notices before the write (waits, no-owner, the reserved-owner line) go through `releaseNotice` too, so those pre-write notices cannot fail their caller.
7
+ - Instructed question answers (`hub_ask_answer`, #1473): only the configured conductor may record an answer, and only on the person's explicit per-set instruction in that conductor's own session. Peer relays, files, delegated runs, private turns and observer context do not grant authority; the quote is retained in the question store, not copied into read views, events, logs or memory. Keep this path out of normal task progress evidence.
7
8
  - For execution-lineage reads (`src/hub/execution-lineage*.ts`), validate caller limits and producer-kind id grammar before source-owner lookups and the source-corruption catch. Return caller errors as invalid/unsupported, reserve corrupt for source failures, and keep unauthorized responses neutral.
8
9
  - Derive attempt/output lineage support from current host policy before raw event paging. With PII paths, deny entries, routing PII patterns or unknown policy, return unavailable independently of stored row contents or counts; retain independently public task/head/deliverable slices. Recover event projections only through a privacy-aware page source, never a derived privacy index, backfill or unbounded scan.
9
10
  - Post-await assignment publication is fenced by current role authority: supersession returns the current task without a saved-delivery notice; reviewer-only changes refresh current metadata and do not suppress a valid owner delivery. A replacement notice goes only to a role that actually received the request, not to an unread-only queue.
@@ -23,11 +24,12 @@ Scope: the task flow, assignment, the state machine and the hub's MCP tools. Rea
23
24
  - Planner work-ready notices (#785 P1a, `writePlannerNotices`): a write that can free a reserved owner's WIP or release backlog (done, approval, decline, cancel, backlog return or pull, untouched return, pull undo) takes `capacityBefore` (the `wip()` of the task's owner and reservation) before its board write and calls `writePlannerNotices` after it. Each rostered planner of the task (`taskPlanner`) gets one ids-only `task` envelope starting `Planner work ready:`: `capacity_released: <peer> WIP <n>; reserved ready #<id>|none` for a peer whose WIP dropped, and, when the write approved the task, `backlog_ready: #<id>` for each backlog dependent with nothing left to wait for. Merge the lines of that planner's unsettled copies, read back from `bus.pendingEnvelopes` (they survive a restart; never keep them in memory), withdraw them, then publish, so at most one stays queued per planner; all of it runs inside `releaseNotice`. The notice only wakes the planner: never pull, reserve or assign from it, and never put a title or note in it.
24
25
  - Person-run cards (#1176, `needsPerson` / column `needs_person`): the mark is the person's alone (`planBacklog` refuses an agent that sets or clears it or plans a marked card), and every way an agent could be offered the card checks it: `topReservedReady` (auto pull and the planner notice), the one pull gate in `pullPlanned`, `offerReady`, `releaseReady` (not a stall), `assign()` (pure, before any routing, so `route explain` agrees), `nextSweep`, and the two `plannerWip` queries; and the other doors: `splitBacklog` (agent refused in `Tasks` before and after the screen and in the board transaction; the person's children inherit the mark), `accept` and `acceptReviewed`, `assignTo` for the owner role, `relevant` (drops a queued offer), and `planBacklog` (refuses a mark on an owned card). A new way to offer a card to an agent must check `needsPerson` too; `test/person-run-cards.test.ts` has a mutation-checked test per gate.
25
26
  - Opt-in auto pull (#785 P1c, `tasks.auto_pull`, `Tasks.queueAutoPulls`, `autoPull`, `topReservedReady`): `writePlannerNotices` collects the peers whose WIP this write lowered and, only when `TasksDeps.autoPull()` is true (read at each release, so a reload applies to the next one), queues one `autoPull(peer)` per peer on a promise chain, so two releases never pick the same card and each job re-reads the board. It takes the top backlog card explicitly reserved for that peer (`topReservedReady(peer, undefined, true)`, the rule the notice's `reserved ready #id` line also uses; never an unreserved card, never PII, which `topReservedReady` skips for a pull), finds the card's own planner of record (`taskPlanner(card)[0]`, which must be rostered) and calls `pullPlanned(HUB, input, { onBehalfOf: planner })`. `onBehalfOf` is accepted only with `by === HUB`; the planner's authority is what `planningAuthority` checks, the actor in history and the planning telemetry stays `hub`, and the planner binding records the planner it acted for. Every other check is `pullPlanned`'s own, unchanged, and a refusal is one console notice with the public title (never detail). A held or recovering hub, a storage error or the setting off pulls nothing, and that is checked twice: at entry and again by `pullPlanned`'s `opts.guard` (`autoPullAdmitted`) wherever authority is rechecked, which includes right before the assignment or board write after the awaited PII screen and `planReviewGap`, so turning the setting off or starting recovery or shutdown mid-admission writes nothing and reports nothing. `autoPullsPending()` counts queued and running pulls and `recoveryReady` waits for it (also named in the recovery view's blockers), as it does for `checksPending`. The key is in `ALL_MACHINE_LOCAL` (`config-trust.ts`) so a committed config is ignored for it, and it is not in `CONDUCTOR_SETTING_KEYS`: an agent never turns it on. Never add a timer or sweep that pulls: the only trigger is the write that freed the slot.
27
+ - Bounded waits (#1454, `Tasks.wait`, `taskWait`, `hub_task_wait`): a wait is one quiet `wait recorded` history entry with `wait: {until, owner}` and the public reason as its note, never a column or a second write. `taskWait` (`src/hub/task-sweep.ts`) parses whether the latest wait remains in force from history alone (latest wait entry names the current owner, nothing state-changing after it); callers use that result for idle-sweep timing and to surface an expired wait as `wait-passed` in planner grooming. A new event that must not end a wait joins `WAIT_KEEPING_EVENTS` beside its `QUIET_EVENTS` line. `nextSweep` reads it for `idle-owner` only; never let it touch `review-pending`, `unaccepted-assignment` or `ready-unassigned`. The tool is published only while `task_sweep.enabled` (`profileTaskTools(..., wait)`, status field `taskWait`), and `Tasks.wait` refuses with the same condition, so sweep off changes no tool list. Refusals are `PreEffectToolRefusal` naming cause and next step; the reason is screened and refused, not cut, on an ordinary task.
26
28
  - Planned start (#1092): `plannedStartPending` (`src/hub/task-sweep.ts`) is the only test that a card's `plannedStart` is still ahead. Every automatic path skips such a card: dependent readiness, `backlog_ready` notices, the reserved-ready pick, auto pull and its `guard`, a hub-actor (`by === HUB`) offer, pull or assign of an ownerless backlog or proposed card, and the idle sweep. The planner digest shows it as `scheduled`. A new automatic path asks it too.
27
- - Per-head CI watcher (#785 P1b, `src/hub/ci-watch.ts`, `Tasks.watchCi`, `ciCompleted`, `reofferHeldReview`): when a `done` leaves a review whose admission was not ready at the task's exact full-commit head (or a review is held as premature in `sendReview`), `CiWatchers` starts at most one watcher per task and head, with chained unref'd `setTimeout`s and no interval. Each poll is one `gh pr view` through the `sdlc.gh` port (`pollCi`); it ends on a passed result for the required checks, on `CI_WATCH_DEADLINE_MS`, on `stopCiWatchers` (daemon `stopOnce`), or silently when `ciWatchCurrent` fails (the task left `in_review`, its head or PR changed, the lifecycle is off, it turned private). `complete`, `review` (both verdict writes) and `cancel` cancel it. Each (head, outcome) is told once (`settled`), and only `passed` settles a head for good (#540): after `failed` or `incomplete` the watcher keeps reading for a rerun of that head (the first pending read after each newly told result is a new run attempt and renews the deadline once; later pending or unreadable reads and an unchanged failed result never renew it, so the watcher always ends; a deadline after a told result ends silently), and a later `hub_task_done` at that head starts one again. A newer head replaces the watcher. The result is one ids-only `ci_completed:` task envelope at `status` weight to the owner and the reviewer (`fyi` is never delivered to a peer, so it would not reach them), a console notice for `user`, and for a deadline a console notice only. A passed or incomplete result re-offers a review held as premature once (`heldReviews`, keyed by task, head, reviewer and review revision) after a fresh `reviewRequestAdmission` says ready; a failed one re-offers nothing. No task text goes in the notice, no PII task is watched, and nothing is restored after a hub restart (the next `hub_task_done` starts one). Never add a second periodic gh read outside this watcher.
29
+ - Per-head CI watcher (#785 P1b, `src/hub/ci-watch.ts`, `Tasks.watchCi`, `ciCompleted`, `reofferHeldReview`): when a `done` leaves a review whose admission was not ready at the task's exact full-commit head (or a review is held as premature in `sendReview`), `CiWatchers` starts at most one watcher per task and head, with chained unref'd `setTimeout`s and no interval. Each poll is one `gh pr view` through the `sdlc.gh` port (`pollCi`); `latestCheckRuns` drops older rows only when a same-name check has the same workflow identity and a unique latest start time, otherwise duplicate evidence remains. A cancelled check and a draft PR's deliberately deferred `check (macos-latest)` failure are pending, not failed; other required failures remain failures. It ends on a passed result for the required checks, on `CI_WATCH_DEADLINE_MS`, on `stopCiWatchers` (daemon `stopOnce`), or silently when `ciWatchCurrent` fails (the task left `in_review`, its head or PR changed, the lifecycle is off, it turned private). `complete`, `review` (both verdict writes) and `cancel` cancel it. Each (head, outcome) is told once (`settled`), and only `passed` settles a head for good (#540): after `failed` or `incomplete` the watcher keeps reading for a rerun of that head (the first pending read after each newly told result is a new run attempt and renews the deadline once; later pending or unreadable reads and an unchanged failed result never renew it, so the watcher always ends; a deadline after a told result ends silently), and a later `hub_task_done` at that head starts one again. A newer head replaces the watcher. The result is one ids-only `ci_completed:` task envelope at `status` weight to the owner and the reviewer (`fyi` is never delivered to a peer, so it would not reach them), a console notice for `user`, and for a deadline a console notice only. A passed or incomplete result re-offers a review held as premature once (`heldReviews`, keyed by task, head, reviewer and review revision) after a fresh `reviewRequestAdmission` says ready; a failed one re-offers nothing. No task text goes in the notice, no PII task is watched, and nothing is restored after a hub restart (the next `hub_task_done` starts one). Never add a second periodic gh read outside this watcher.
28
30
  - Required checks (#1344): resolve the names only through `requiredChecksFor` / `requiredCheckNames` (`src/hub/sdlc-merge.ts`, `src/hub/sdlc.ts`); the built-in `check (...)` and `seeded guards` set applies only to this repository, and an empty set elsewhere is a `required checks unknown` blocker, never a pass.
29
31
  - Build-entry guidance (#1354, `buildEntryDiagnostic` in `src/hub/build-entry.ts`) is pure display data: routing and `route explain` may show it but never read GitHub or change eligibility because of it.
30
- - Merge adoption (#1348, `ahub sdlc adopt-merge`, `Tasks.adoptMerge`): only the person or the one configured conductor adopts an already merged PR; it writes `approved` with the `merged outside the hub` event and creates no reviewer verdict, review metric, reviewed-head receipt, guarded-merge result or GitHub mutation, and a private task or turn refuses before any GitHub read. Contract: `docs/design/task-board.md` "Merged PR adoption".
32
+ - Merge adoption (#1348, `ahub sdlc adopt-merge`, `Tasks.adoptMerge`): only the person or the one configured conductor adopts an already merged PR; it writes `approved` with the `merged outside the hub` event and creates no reviewer verdict, review metric, reviewed-head receipt, guarded-merge result or GitHub mutation, and a private task or turn refuses before any GitHub read. Its bounded GraphQL check read uses `latestCheckRuns`: discard an older same-name row only when workflow identity and a unique latest start time prove which run is newest; preserve duplicate evidence when ordering is uncertain. Contract: `docs/design/task-board.md` "Merged PR adoption".
31
33
 
32
34
  - Handoff idempotency (#1203 T1): the target writes a handed-off task only through `Board.proposeHandoff` (the proposal and `task_handoff_origin` row, key and request digest in one `atomic` transaction); `handoffIn` asks `replay()` before the duplicate check and again after the PII screen's await, so a retry of a key whose first attempt is still screening files nothing twice. Never `propose` then `setHandoffOrigin` for a handoff, and never compare a key to anything but this origin project's own rows.
33
35
  - Completed-change notices (#713, one per recipient per done, accepted work only, superseding by `completedFor`): rule in `bus.md`.
@@ -127,6 +129,9 @@ Scope: the task flow, assignment, the state machine and the hub's MCP tools. Rea
127
129
 
128
130
  - Declared needs (#1081, 2026-11-02): `needs_network` and `needs_worktree` are task signals set only by an explicit `true` in `Tasks.propose` (never inferred from text). `assign()` in `routing.ts` reads each as a refusal code (`network`, `worktree`) against `PeerCapabilities.network` / `.worktree === false`, and `Tasks.declaredNeedCheck` repeats both at accept, before any write: that check is what stops a sandboxed peer from accepting work, failing at `git worktree add` (#270) and leaving an empty branch ref (#621, #565). `peerCapabilities` in `daemon.ts` is the only producer: unsandboxed peers are `true` for both, hub-sandboxed peers have `worktree` from `TaskWorktrees.available()` (#1115: true only where the hub can make the worktree, else false with its cause and next step) and `network` from `sandboxNetwork !== false` (the one `local.bash_network` setting). Unknown (no entry) is never a refusal. Keep the four lists together when you add a need: `RoutingRefusalCode`, `TASK_STALL_CODES`, the `requireCapabilities` filter and `declaredNeedCheck`.
129
131
  - Hub-made task worktree (#1115, 2026-11-02, `src/hub/task-worktree.ts`): `Tasks.accept` calls `hubWorktreeFor` right before `acceptanceCapacity` and the accept write, only for a hub-sandboxed owner (`TaskWorktrees.applies`), a non-PII task, and write-class work (`writesRepository(task.class)` in `routing.ts`: `implement` and `bulk_edit`, #1129) or a declared `needs_worktree`, and clears it again (`undoWorktree`) when anything throws before the write. `Tasks.decline` and `Tasks.cancel` call `releaseHubWorktree` after their board write. The daemon's `hub_task_done` case calls `tasks.worktreeHandoff` BEFORE `tasks.done` and passes its `{ commit, branch }` refs on, so `Tasks.done` itself is untouched and its head gates see an ordinary full-SHA refile; keep the hook out of `done`. The sandbox profile is not changed by this hook. Since #1123 it refuses ref, HEAD, packed-refs and worktree-admin writes, so a sandboxed peer cannot commit at all and the hub's commit is the only one; still never trust what is under `.git`, and commit only when the branch tip equals the recorded base or the hub's own last commit (the record lives in `<state>/task-worktrees.json`, which no sandbox root contains), because a rule can be loosened later and a same-user process is outside the sandbox. Since #1129 the hook covers every write-class task, so a hub-sandboxed owner of `implement` or `bulk_edit` work always has a hub worktree and a hub commit; keep `writesRepository` the one definition that routing and `Tasks` both read.
132
+ - Focused-check dependency preparation (#1447): after a task is accepted, the hub may prepare the task worktree's dependencies and report a fixed prepared/not-prepared result in that owner's task context. Preparation is advisory; do not treat it as a check result or replace the remote/full verification gates.
133
+ - Roadmap milestones and placement (#1479/#1481): `docs/design/roadmap.md` is the contract. `Board` stores rows and links; every external write goes through `Tasks` with revision and privacy checks. Triage suggestions are inert until accepted; GitHub import is person-only and dry-run by default. Keep private membership count-only and preserve the recovery compatibility check.
134
+ - Pi step-ceiling escalation (#1447): `step_limit` is a distinct task-move reason from `inference_failed`; only a settled ceiling can receive the bounded, acceptance/session-bound continuation. See the dogfood row for coverage and live-proof limits.
130
135
  - Paged `hub_task_list` (#1083, 2026-11-02, `src/hub/task-list-page.ts`, the `hub_task_list` case in `daemon.ts`): an agent (`by !== USER`) always gets `{tasks, total, next?}` and the console gets the bare array unless it names `limit`, `cursor`, `ids` or `detail`; keep that split, because `ahub board`/`ahub tasks` and `test/cli-json-guard.test.ts` read the array. Build every row with the existing `listRow` (it starts from `tasks.publicView`, so PII stays a stub and the `board-column-started-projection` seed text is unchanged) and only then reduce it with `compactRow`; never build a compact row from the raw `Task`. The cursor is a keyset (`updated.id`), not an offset. A new caller of `hub_task_list` as a peer reads `.tasks`, or passes `ids` for one task. Do not raise the 200 cap or the default 50 without re-running the 600-task size test.
131
136
  - Urgent accept and the WIP refusal (#1080, 2026-11-02): `acceptanceCapacity` takes an `urgent` mode, and only `accept` passes `"displace"`; `acceptReviewed` and the early check in `accept` pass `"check"`, which never writes. `displaceOffers` runs immediately before the accept write, after every gate (spec, plan, study), so a refused accept can never have taken back an offer. It takes back only offers the owner never accepted (`displaceable`: state proposed, owned, not pinned, not urgent, no `taskHasStarted`), newest handed first, and only as many as the limit needs; if they are not enough it takes none and refuses. The refusal comes from `wipSplit` and names accepted, offered and reserved separately, with a next step. Do not widen `displaceable` to accepted or urgent work, and do not call the displace mode from any other path.
132
137
  - Planner WIP breakdown (#784 AC3, `Board.plannerWipBreakdown`, `Tasks.wipBreakdown`): a read-only split of `plannerWip` into `active`, `reviewWait` and `reserved` for status, the console Peers detail and the dashboard legend. Read it from ONE grouped query for every peer (the status snapshot builds on a hot path); never loop `wip()` per peer or per task there. Admission, `reservedHold`, `acceptanceCapacity` and the planner pull keep reading `wip()` / `plannerWip` unchanged, and the three parts must add up to it: change the two queries together. The new `taskWip` fields are additive; renderers keep printing the plain count when an older hub sends none.