@staix/agent-hub 0.46.1 → 0.47.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 (130) hide show
  1. package/CHANGELOG.md +79 -0
  2. package/README.md +8 -4
  3. package/docs/adding-an-ai-tool.md +20 -4
  4. package/docs/agent-notes/adapters.md +3 -3
  5. package/docs/agent-notes/benchmarks.md +7 -1
  6. package/docs/agent-notes/daemon.md +5 -4
  7. package/docs/agent-notes/tasks.md +4 -2
  8. package/docs/agent-notes/tests.md +3 -0
  9. package/docs/contracts/companion-cli-v1.json +3 -0
  10. package/docs/data-policy.md +9 -0
  11. package/docs/design/adapters.md +14 -0
  12. package/docs/design/cli-output-inventory.md +362 -0
  13. package/docs/design/cli-output.md +42 -1
  14. package/docs/design/execution-reference.md +5 -2
  15. package/docs/design/guidance-probes.md +2 -2
  16. package/docs/design/refusal-inventory.md +26 -0
  17. package/docs/design/roadmap.md +4 -0
  18. package/docs/design/task-board.md +17 -1
  19. package/docs/dogfood.md +26 -10
  20. package/docs/events.md +9 -0
  21. package/docs/friction.md +46 -0
  22. package/docs/memory.md +35 -3
  23. package/docs/operations.md +63 -15
  24. package/docs/profiles.md +1 -0
  25. package/docs/quickstart.md +8 -2
  26. package/docs/roles.md +6 -0
  27. package/docs/sdlc.md +44 -1
  28. package/docs/security.md +16 -7
  29. package/docs/specs/2026-09-19-agent-hub-design.md +17 -0
  30. package/docs/specs/2026-09-19-multi-project-design.md +7 -1
  31. package/docs/verification/2026-11-25-agy-1.5.16.md +31 -0
  32. package/docs/verification/2026-11-25-claude-implementer-2.1.332.md +47 -0
  33. package/docs/verification/2026-11-25-codex-0172-reviewer-isolation.md +47 -0
  34. package/docs/verification/2026-11-25-kimi-272-reviewer-compat.md +38 -0
  35. package/docs/verification/2026-11-25-kimi-tui-272.md +14 -0
  36. package/docs/verification/2026-11-25-pi-160-compat.md +40 -0
  37. package/docs/verification/2026-11-26-0.47.0.md +43 -0
  38. package/docs/verification/2026-11-26-codex-0172-reviewer-tool-call.md +29 -0
  39. package/docs/verification/dogfood/2026-11-24.md +2829 -0
  40. package/docs/verification/pi-160-model-free.ts +57 -0
  41. package/docs/verification/pi-160-native.mjs +21 -0
  42. package/docs/verified.json +43 -31
  43. package/package.json +2 -2
  44. package/plugins/agent-hub/.claude-plugin/plugin.json +1 -1
  45. package/plugins/agent-hub/kimi-hook.js +579 -126
  46. package/plugins/agent-hub/server.js +668 -138
  47. package/src/adapters/acp.ts +5 -0
  48. package/src/adapters/channel-peer.ts +7 -0
  49. package/src/adapters/claude-print-child.ts +27 -5
  50. package/src/adapters/codex-appserver.ts +9 -0
  51. package/src/adapters/compat.ts +12 -11
  52. package/src/adapters/configured-acp.ts +45 -2
  53. package/src/adapters/configured-print.ts +163 -0
  54. package/src/adapters/conformance/index.ts +1 -0
  55. package/src/adapters/conformance/print.ts +57 -0
  56. package/src/adapters/definitions/native-activity.ts +57 -0
  57. package/src/adapters/definitions/native-factories.ts +4 -2
  58. package/src/adapters/jcode.ts +10 -2
  59. package/src/adapters/local-worker.ts +2 -0
  60. package/src/adapters/registry-types.ts +5 -3
  61. package/src/adapters/role-eligibility.ts +5 -0
  62. package/src/cli/bench.ts +2 -1
  63. package/src/cli/broker.ts +2 -1
  64. package/src/cli/capabilities-output.ts +10 -14
  65. package/src/cli/configured-acp-entry.ts +10 -2
  66. package/src/cli/console-state.ts +25 -5
  67. package/src/cli/error-format.ts +2 -0
  68. package/src/cli/guidance.ts +1 -1
  69. package/src/cli/handoff-output.ts +20 -17
  70. package/src/cli/help.ts +78 -40
  71. package/src/cli/init-settings.ts +15 -0
  72. package/src/cli/intake-output.ts +13 -13
  73. package/src/cli/launch.ts +3 -2
  74. package/src/cli/learn-output.ts +40 -21
  75. package/src/cli/main.ts +148 -77
  76. package/src/cli/memory.ts +47 -2
  77. package/src/cli/output.ts +54 -31
  78. package/src/cli/roadmap.ts +2 -2
  79. package/src/cli/room-output.ts +71 -0
  80. package/src/cli/room.ts +19 -33
  81. package/src/cli/schedule-output.ts +20 -19
  82. package/src/cli/sdlc-output.ts +188 -170
  83. package/src/cli/source-output.ts +17 -14
  84. package/src/cli/specs.ts +13 -13
  85. package/src/cli/study-output.ts +66 -69
  86. package/src/cli/task-output.ts +106 -158
  87. package/src/cli/terminal-recovery.ts +2 -1
  88. package/src/cli/upgrade-runtime.ts +2 -1
  89. package/src/cli/warn-line.ts +18 -0
  90. package/src/cli/worktrees-output.ts +25 -23
  91. package/src/hub/audit-source.ts +45 -0
  92. package/src/hub/board.ts +141 -5
  93. package/src/hub/bus.ts +13 -2
  94. package/src/hub/config-apply.ts +14 -1
  95. package/src/hub/config-trust.ts +1 -0
  96. package/src/hub/control-client.ts +1 -1
  97. package/src/hub/daemon.ts +371 -45
  98. package/src/hub/handoff.ts +5 -1
  99. package/src/hub/hub-tools.ts +23 -5
  100. package/src/hub/instance-config.ts +3 -3
  101. package/src/hub/learn-followup.ts +103 -0
  102. package/src/hub/learning.ts +63 -1
  103. package/src/hub/manager.ts +15 -1
  104. package/src/hub/memory-policy.ts +2 -1
  105. package/src/hub/memory-review.ts +217 -0
  106. package/src/hub/peer-activity.ts +37 -0
  107. package/src/hub/peers.ts +3 -0
  108. package/src/hub/project-move.ts +258 -0
  109. package/src/hub/registry.ts +16 -5
  110. package/src/hub/restart.ts +7 -0
  111. package/src/hub/review-brief.ts +8 -4
  112. package/src/hub/review-checkout.ts +26 -0
  113. package/src/hub/review-findings.ts +6 -3
  114. package/src/hub/risk-tier.ts +129 -0
  115. package/src/hub/roadmap-check.ts +1 -0
  116. package/src/hub/routing.ts +3 -1
  117. package/src/hub/sdlc-merge.ts +9 -0
  118. package/src/hub/sdlc-metrics.ts +24 -1
  119. package/src/hub/sdlc-queue.ts +1 -1
  120. package/src/hub/sdlc.ts +15 -6
  121. package/src/hub/settings.ts +2 -0
  122. package/src/hub/spec-readback.ts +136 -0
  123. package/src/hub/specs.ts +1 -1
  124. package/src/hub/task-list-page.ts +1 -1
  125. package/src/hub/tasks.ts +558 -65
  126. package/src/hub/ui.ts +4 -2
  127. package/src/ui/index.html +26 -2
  128. package/src/ui/overview-model.ts +138 -0
  129. package/src/ui/plugin.ts +30 -4
  130. package/templates/roles/ops/project-manager.md +1 -1
package/CHANGELOG.md CHANGED
@@ -4,6 +4,85 @@ 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.47.0
8
+
9
+ - Release N-1 for 0.47.x is published 0.46.1, which declares agent-mem `>=0.33.0 <1.0.0`; its fixture lock pins the 0.38.0 that the 0.46.1 release resolved, with 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 compatibility fixture covers old clients and plugins against the new daemon and new clients and plugins against the old daemon; it does not prove live-agent, rollback, or shared-home compatibility. The protocol window is unchanged; the daemon adds the `configured_print` and `spec_readbacks` features, and a recovery target without `spec_readbacks` (0.46.1) is refused once a spec read-back is stored. The CLI adds `ahub projects move`, `ahub memory review` and `ahub sdlc readback`; a 0.46.1 CLI does not offer these. The MCP tools add `hub_readback_report` and `hub_review_file`, and `hub_task_propose` takes an optional `reason`. The declared agent-mem range rises to `>=0.39.0 <1.0.0`: on first open each populated profile builds a v6 derived index beside the v5 one, so a 0.46.1 hub on agent-mem 0.38.0 still reads the same home; no store or sync format floor is raised.
10
+ - Add a friction benchmark (Refs #1644): `scripts/benchmarks/friction` runs a corpus of journeys against an isolated hub and classifies each refusal as in_band, out_of_band, dead_end or by_design; `compare.ts` diffs two reports and a nightly workflow publishes one. Results and the journey list are in [docs/friction.md](docs/friction.md).
11
+ - Inventory refusal carriers (Refs #1643): `scripts/refusal-inventory.ts --check` runs once per `scripts/check.sh` and fails on a new refusal without a runnable continuation or a `// refusal:by-design` marker, against a shrink-only baseline.
12
+ - The refusal for a handoff to an unregistered project leads with the step that registers it, `ahub --project <path> init`, and says that a project id alone cannot be registered (Refs #1686).
13
+ - The Qwen dual-output Q2 proof no longer waits for a file-watch event to re-read the state its barrier stands for (hub task 1151, Refs #1669). `runQwenDualBusQ2` re-checked every `observe` predicate only when a wake arrived from the bus tap or from the `qwen-dual` state-directory watcher, so a watcher event that was coalesced or shed under load left all of them unread until the run's own guard expired, which is how the flaky macOS shard once reported `first-held` instead of the checkpoint it asserts; the predicates read the files themselves, so they are now re-read on the same 2 ms receipt poll the test fixture already uses for its submit, an idle run keeps its ~65 ms, and the guard stays a hang guard. With the watcher removed entirely the file went from a 10,001 ms failure at `first-stream-consumed` to 10/10 green in 394 ms; `test/compat-receipt-qwen-dual-q2.test.ts` is unchanged, so its 10 cases and 84 `expect()` calls remain.
14
+ - Stderr diagnostics of upgrade, restart, recovery, `init`, `up`, `queue`, `board`, the broker, the launcher and the bench runner print as `ahub: warning: <what>: <why>` with a `→` next step where the fix is known, and `ahub room list|status|inbox` and the confirmation previews and results print on the shared Report layout with `--ascii`, no longer as bare lines (#1724 batch 1, Refs #1654). `--json` output and exit codes are unchanged; the room artifact is still printed raw so it copies exactly. The raw-output baseline went from 269 to 221 entries.
15
+ - CLI warnings print as `ahub: warning: <what>: <why>` on stderr, with an optional `→ next` line and a marker on a terminal (#1654 AC4): the project-config notes, `never-ask`, the `--autonomy` and class notes, `hub busy, retrying` and `default agents were not started`. `ahub specs` refusals read `ahub: specs: <what>`. Exit codes and `--json` are unchanged; the `ahub: blocker:` lines stay as they are, because `--json` consumers match them (#206). `test/cli-output-conformance.test.ts` now fails on a raw `console.log` or `console.error` in `src/cli` that is not in `scripts/cli-raw-output.baseline.json`, a list that can only shrink.
16
+ - Remove the macOS dashboard approval flake (hub task 1149, Refs #1260): two `test/daemon.test.ts` cases read a pending approval back across dashboard round trips while their hub kept the helper's 200 ms approval seam, and the request-to-second-snapshot window measured 42 ms here and expired on a loaded shard (`raisedSnapshot.permissions[0]` undefined), so both now take the same 30 s window the four other pending-approval cases already use, which is the product's own floor for `approvals.timeout_s`; the assertions are unchanged.
17
+ - The dashboard has an Overview view (#1514): throughput per week, board pulse per day, peer first-pass health over 30 days, peer workload by state and the 20 most recent failures. Figures shared with `ahub sdlc metrics` come from the same `taskSample`, an unknown figure reads `unknown` and never 0, and a private task is only counted as withheld. The data is built only while that view is open.
18
+ - `ahub source`, `schedule`, `study`, `task handoff`, `board --handoffs`, `learn`, `intake`, `capabilities` and `worktrees` print on the shared Report layout (#1654), take `--ascii`, and joined the grammar checks, so every human view now uses one layout and `sdlc-output.ts` no longer exports its own heading, pair or blank helpers. `--json` is unchanged and every pinned phrase is kept.
19
+ - `ahub task show|cancel`, the backlog results and `backlog groom`, `ahub release list|show|new|plan|activate|freeze|ship|drop`, `ahub sdlc configure` and `ahub sdlc survey show` print on the shared Report layout (#1654), take `--ascii`, and joined the grammar checks. The "header fits, else the context moves to a note" rule is now one `Report.titled` instead of three copies. `--json` is unchanged and every pinned phrase is kept.
20
+
21
+ - Scope, bound and report a memory review (hub task 1134, Refs #1329 parts 2). While a turn is bound to a review card its owner holds, the hub refuses every tool call outside the review's scope with the card id, the cause and the next step: a memory mutation, a vault note write, a code edit or check, a peer start, and any hub tool that is not a read, a proposal, the card's lifecycle or a message. The binding is the turn's own attribution, so the card's reviewer and the owner's work on another task keep every tool. `hub_remember` in that turn becomes a `memory` candidate attributed to the card and the peer instead of a curated note. The hub counts each review turn's own tokens and compares them with `memory.review.max_tokens_run` or `max_tokens_week`, asks the owner for one checkpoint at either cap and then escalates the card with reason `budget`; `ahub memory review status` prints the counted spend. A completed review carries counts only: notes checked, proposals by kind, origin sessions and tokens, written to its history as `review counts`.
22
+
23
+ - `ahub status --verbose`, `status --full` and `ahub report` print on the shared Report layout, and the grammar is now checked over the real output of every converted view (hub task 1141, Refs #1654): a header, a `▸` section mark per group, `--ascii` markers, and a header that moves its context to a wrapped line on a terminal too narrow for it. Every detail line keeps its words, `--json` is unchanged. This is the last slice of #1654 T3 and T4.
24
+
25
+ - `ahub sdlc status` and `explain` print on the shared Report layout (hub task 1137, Refs #1654): a header with the mode, a task table, one section per task with its blockers and gate findings as marker lines, and `--ascii` markers. `sdlc release` also prints a warning line when a release is not ready or native verification is unverified. `--json` is unchanged and every pinned phrase stays.
26
+
27
+ - `ahub sdlc queue`, `audit show`, `release`, `metrics` and `costs` print on the shared Report layout (hub task 1135, Refs #1654): a header, one section per topic, markers for blockers and units, and `--ascii` markers. A repository name too long for the header wraps on its own line, and a narrow terminal stacks a `kv` value under its key. `--json` is unchanged and every pinned phrase stays.
28
+
29
+ - Schedule a memory review from a machine-local switch (hub task 1132, Refs #1329). `memory.review` in `.agenthub/config.local.json` (off by default, console-only, dropped from a committed config) schedules one `review`-class card per period from a fixed template whose only input is the notes whose code anchors no longer resolve; `ahub memory review on|off|status` is the person's switch, `off` stops the schedule at once and cancels the card a run left open through the ordinary cancel path, and enabling without both `max_tokens_run` and `max_tokens_week` is refused by the config. Part 2 adds the review's tool scope, the counted budget stop and the count-only report.
30
+
31
+ - `ahub sdlc authorize-release` and `ahub sdlc merge` print on the shared Report layout (hub task 1116, Refs #1654): a header, `Authorization`, `Decision`, `Refused` and `Result` sections, one `✗` line per refused gate, and `--ascii` markers (now accepted as a presentation flag by both commands), plus a `✗` or `⚠` line when a merge did not happen. `--json` is unchanged and every pinned phrase stays.
32
+
33
+ - Refuse a recovery target that predates stored spec read-backs, and make the read-back's own answers say what to do next. `spec_readbacks` gains its `DAEMON_FEATURES` name, a `Board.hasSpecReadbacksState()` floor in `incompatibleRecoveryTarget`, and a counts-and-digest proof that joins `integrity()` and the restart comparison only while rows exist, so a handover to an older daemon is refused instead of silently dropping the grants, and a row that fails its hash refuses as unknown storage. A routing refusal now reaches the person inside the read-back's continuation instead of as a bare "not attached", the CLI fallback prints the real task id, `ahub sdlc accept` records the acceptance when a row is corrupt (printing that the state is unknown), and `spec-readback` reuses the hardened `GIT_SAFE_OPTIONS`. Refs #1658, hub task 1129.
34
+
35
+ - Let a console poll the board cheaply (hub task 1124, Refs #1635). The hub answers a new console-role `board_revision` control message with the task board's own write counter, one bare number (an older hub answers it as an unknown message, `PROTOCOL` is unchanged), and the acon console provider answers `revision(scopes)` from it without reading a board snapshot: the `board` scope returns a short opaque value that changes on every task-board write across the running projects and stays the same between writes. Any other scope is `0`, and so is the board scope when any shown project's counter is unknown (an older hub or a failed read), so the console fetches instead of believing the board is unchanged. At most 20 scopes of at most 200 characters. No task text is folded into it, and board writes stay inside `Tasks`. `capabilities.revision` is not declared, because the pinned agent-console 0.2.0 has no revision contract; that, and the conformance-kit test, wait for the 0.3.x release, so the issue stays open.
36
+
37
+ - agy 1.5.16 stays unverified (hub task 1122, Refs #888 and #1280). The new [receipt](docs/verification/2026-11-25-agy-1.5.16.md) records the CLI surface leg as passing on a scratch copy of the binary, with the real `~/.local/bin/agy` hashed identically before and after, and the hooks, close and actual-launcher nonce legs as not run because the task801 producers are gone. `verified` is unchanged.
38
+
39
+ - Pi 1.6.0 is a verified version (hub task 1121, Refs #888). The new [receipt](docs/verification/2026-11-25-pi-160-compat.md) repeats every leg of the 1.5.2 one model-free against `@earendil-works/pi-coding-agent@1.6.0` installed into a scratch prefix: native identity, real CLI extension load and RPC session identity, SDK extension registration, the managed tool callback and receipt replay, a failed tool result, and zero provider requests. The launcher entry file hash is unchanged. Other Pi versions, including 1.5.3 and 1.6.1, still need the person's `ahub agents trust pi <version>`.
40
+
41
+ - Show a Jcode peer as detached when a server the hub did not start is serving its socket: the hub-tools hello the hub already refused as `not an owned launch` now records the peer with the cause and the launch that puts it back under the hub (`ahub jcode`, or `ahub jcode --as <id>` for an extra instance), `ahub status` lists it in Attention with that command and `ahub status --json` carries `peers.<id>.detached`, and a hub-owned launch of that peer clears it. A hello refused for a peer that is on no roster records nothing, the refusal text and its close code are unchanged, and nothing new listens. The record is this daemon's memory, so a restart forgets it until that server's next refused hello. Refs #1668, hub task 1125.
42
+
43
+ - Raise the `@staix/agent-mem` floor to 0.39.0, so a host can call `MemoryStore.unsettledTaskKeys` (agent-mem#610) without feature detection, for #1445 / hub task 1085. On first open, each populated profile rebuilds a separate v6 derived index from existing rows: a one-time startup cost plus extra disk. The v5 index stays beside it for 0.38.0, or an N-1 0.45.0 hub, sharing the home. HOST_API_VERSION stays 1 and no store or sync format floor is raised. A hub that resolves agent-mem 0.38.0 or older now refuses memory at load. Refs #1664, hub task 1117.
44
+
45
+ - At startup, use agent-mem's outstanding-task index to repair interrupted memory settlements, checking the current board for approval and privacy before each repair. Refs #1445, hub task 1085.
46
+
47
+ - Omit acknowledged spec decisions from roadmap drift rule 5. Unchanged covering specs still appear when the owner did not record a reason. Refs #1482, hub task 1139.
48
+
49
+ - Report the current native activity category in live JSON status for Codex, ACP and the local worker, omitting private turns and keeping no history. Refs #1512, hub task 1143.
50
+
51
+ - Finish the help grammar of `ahub help <command>`: Details names each form and says what it does instead of repeating the usage, operands are lowercase `<placeholders>` (`<n>`, `<hash>`, `<ms>`, `<json>`, `<token>`, `<date>`) in usage and in the guidance and roadmap usage errors, and a usage line breaks only between bracket groups. Flags, `--json` and exit codes are unchanged. Refs #1654, hub task 1114.
52
+ - Ask a fresh reader to state a spec issue back before the person accepts it, as a report and never a gate: `ahub sdlc readback start <task>` files one request per task, issue and body edit time to an attached reviewer-role peer that neither proposed nor owns the task, the bound reader alone answers with `hub_readback_report {task, proposes, existing, cannot_paraphrase, undefined, open_decisions, refs}` (bounded at 1,024 bytes a section, 16 terms, 16 decisions and 64 paths, and refused over a limit rather than cut), and the hub checks only each listed path against the default branch head and stores what is missing. `ahub sdlc readback show <task>`, the `readback` line on `ahub sdlc status`/`explain` (`none`, `current`, `stale`, `unavailable`, `private`) and the line `ahub sdlc accept` prints before it records the acceptance report the same state, and acceptance proceeds in every state. A repeated start returns the existing request, a private task starts none, and the lifecycle off adds no output and no schema change. Refs #1658, hub task 1099.
53
+
54
+ - Render the project, queue, turn and orphan listings through the shared report layout: a ` ahub <Name>` header, a counted section, a note for an empty list and next steps. `--json`, flags and exit codes are unchanged (Refs #1654, hub task 1115).
55
+
56
+ - Let a planner name why work is split off: an optional `reason` on `hub_task_propose` (explore, parallel, context, verify, capability, person) is stored on the task and shown by `hub_task_show`, `hub_task_list`, `ahub task show` and the board, an unknown value is refused naming the allowed values, `parallel` siblings with overlapping `refs.paths` are refused before any task exists, and `ahub sdlc metrics` groups task count, review rounds and tokens by reason with `unset` as its own group. The planner role text gains one sentence. Refs #1647, hub task 1109.
57
+
58
+ - Require a screened reason to reopen a settled review finding in enforce mode. Advise reports missing reasons, and reasoned reopenings after person acceptance notify the person. Refs #1657, hub task 1095.
59
+ - List each command once in the help overview, add examples for version, kill, down and tail, and clarify which roadmap operations accept JSON (Refs #1654, hub task 1106).
60
+
61
+ - Record on a review verdict what the checkout the reviewer read held: for the files the review brief lists, which differ from the reviewed commit and which the checkout holds untracked, with that checkout's own head and which checkout it was, the reviewing session's own when the hub knows it and otherwise the project checkout. An unreadable checkout records no evidence rather than a clean one. Refs #1646, hub task 1092.
62
+
63
+ - Derive a risk tier from a filed change's complete file inventory: `[risk]` in `.agenthub/sdlc.toml` names the paths that make a change `high` and the ones that keep it `low`, a `[security]` path is always `high`, a path no pattern names is `medium`, and an inventory the hub cannot read completely records no tier rather than `medium`. A done records the tier with the head it classified, and a re-file drops it and derives a new one, so a tier is never read for a head it was not derived from. A project without a `[risk]` table is unchanged. Refs #1645, hub task 1097.
64
+
65
+ - Enforce the minimum review a risk tier owes: a `high` change needs one reviewer plus a verifier card owned by a peer other than the implementer, and the card is identified by what the board already records (a `test` card on the same branch whose `refs.commit` is the filed head), so no field is added for it. `enforce` refuses the approving verdict with the continuation that proposes the card, `advise` reports the same line, and the review request, the review brief and `hub_task_show` carry the tier and its gap. A plan whose own `review` metadata asks for fewer reviewers than the floor is reported at plan review and refused at the merge gate, and `ahub init` writes the `[risk]` table commented out. Refs #1645, hub task 1107.
66
+
67
+ - Add a shrink-only unused-export ratchet: `bun scripts/unused-exports.ts --check` fails on an export of `src/` that nothing imports, or that only tests import, unless `scripts/unused-exports.baseline.json` knows it, and a baseline entry that is gone or used now must leave it. Entry points come from `package.json` and the bundles `scripts/build.mjs` builds, and a name reached only through a string is declared with a `// used-by: <file>` comment above its declaration. `scripts/check.sh` runs it with the once-only steps, and one seed turns it red (Refs #1649, hub task 1093).
68
+
69
+ - Add `ahub projects move` to keep a moved project's port, board, delivery history and handoff links. Preview first and stop every affected hub before confirming. Refs #1424, hub task 1100.
70
+
71
+ - Verify Kimi Code 2.7.2 for fresh reviews with isolated model-free broker and native tool-loop evidence. Refs #888, hub task 1120.
72
+
73
+ - Remove the Qwen dual-output compat-receipt timing flake: the fixture now consumes submits from a poll as well as `fs.watch`, and the proof deadline is a hang guard instead of a 4 s wall-clock bound, so a loaded runner no longer fails at the `first-held` checkpoint. Refs #1669, hub task 1089.
74
+ - Refuse task proposals whose detail exceeds 8000 characters and show how to retry with a spec issue reference. Refs #1648, hub task 1086.
75
+
76
+ - Follow an accepted review-checklist line and propose its removal when it stops helping: an accept records the line's profile, class and criterion, the time and its 30-day unmet rate as a fixed suffix on the card's own note, `ahub learn list --accepted` reports each followed line as `insufficient`, `helping`, `no-change` or `worse` beside the checklist size, and a line with 5 reviewed tasks in its window and no improvement gets one removal card that removes only that line through the settings writer (`ahub settings undo` restores it), while rejecting it closes the card and restarts the window. A hand-written or edited line is `untracked` and never removed, PII tasks and evidence-only verdicts never count, and at the 16-line cap a new candidate's card names the weakest followed line. Refs #1642, hub task 1108.
77
+
78
+ - Advertise the execution-lineage snapshot as a non-navigation acon read. Agent-console 0.3.x support is pending. Refs #1632, hub task 1123.
79
+
80
+ - Gate the CLI output inventory: `scripts/check.sh` runs `bun scripts/cli-output-inventory.ts --check` with the once-only steps, so a help or renderer change that ages the dated snapshot fails the gate instead of surfacing at review. The step runs once per gate on each operating system, never once per shard. Refs #1654, hub task 1112.
81
+
82
+ - Verify Claude Code 2.1.332 as a headless implementer with an isolated model-free transport and wrapper receipt, allowing it to start without machine-local trust after release (Refs #888, hub task 1118).
83
+
84
+ - Add a sandboxed config-only print adapter for read-only CLI opinions. Print peers return messages and leave task verdicts to tool-capable reviewers or the person. Refs #1515, hub task 1140.
85
+
7
86
  ## 0.46.1
8
87
 
9
88
  - Resolve `@staix/agent-mem` 0.38.0 in `bun.lock` so the repository's tests and CI run on the version a fresh install resolves; the declared range `>=0.33.0 <1.0.0` is unchanged. The recovery package refuses a ranged `@staix/cli-output` pin with the output message again when agent-mem declares it. Refs #1664, hub task 1084.
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.46.1, control protocol 17 (accepts 16). Bun + TypeScript, one loopback daemon per
8
+ Status: 0.47.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
@@ -107,6 +107,7 @@ including [a new project with SDLC advise or enforce](docs/quickstart.md#a-new-p
107
107
  coverage ledger ([security pass and audit](docs/sdlc.md#security-pass-for-sensitive-paths-hub-task-895-1403-a2)).
108
108
  For a PR already merged outside the hub, [merged PR adoption](docs/sdlc.md#adopting-a-pr-merged-outside-the-hub-1328-t3) verifies its recorded head and releases dependents: `ahub sdlc adopt-merge <task> --pr <n>`.
109
109
  An explicitly superseding task may [carry existing spec consent](docs/sdlc.md#spec-acceptance-481-s1) for the same repository and issue when the host verifies an unchanged body.
110
+ `ahub sdlc readback start|show` asks a fresh reader to state a spec issue back before you accept it, as a report and never a gate ([spec read-back](docs/sdlc.md#spec-read-back-1658)), and an optional `[risk]` table sets the minimum review a change owes ([risk tier](docs/sdlc.md#minimum-review-by-risk-tier-1645)).
110
111
  Fresh Kimi reviews run periodic isolation checks off the hub event loop;
111
112
  verdict and task-tool authority still require the complete synchronous fence
112
113
  ([measurements and limits](docs/verification/2026-11-07-kimi-review-watch-1284.md)).
@@ -140,7 +141,9 @@ including [a new project with SDLC advise or enforce](docs/quickstart.md#a-new-p
140
141
  it as a recall preface, as briefs on a task, and through bounded search tools.
141
142
  Managed headless peers can save compact `amem:` records from final answers; the
142
143
  hub follows amem's `records` policy and removes record lines from shared replies
143
- ([details](docs/memory.md#agent-authored-records-1320)).
144
+ ([details](docs/memory.md#agent-authored-records-1320)). A scheduled memory review,
145
+ off by default, is the person's switch: `ahub memory review on|off|status`
146
+ ([scheduled review](docs/memory.md#scheduled-review-and-its-switch-1329-part-1)).
144
147
  - **Local and on-prem models.** Pi and the local worker can run on DGX or local MLX
145
148
  through an authenticated relay. Tasks marked as PII stay on the on-prem worker.
146
149
  Pi can checkpoint and continue after a tool-step ceiling, within a configured
@@ -178,8 +181,9 @@ including [a new project with SDLC advise or enforce](docs/quickstart.md#a-new-p
178
181
  standby session (`ahub peer takeover`), structural config
179
182
  (instances, review, lifecycle) edited with a validated diff and a backup from the
180
183
  console or a dashboard settings session, token usage and quota
181
- history (`ahub usage` and the dashboard's Usage view), and `ahub upgrade`, which
182
- carries running sessions across versions.
184
+ history (`ahub usage` and the dashboard's Usage view), the dashboard's Overview of
185
+ throughput, board pulse and peer health, `ahub projects move` for a repository
186
+ you moved, and `ahub upgrade`, which carries running sessions across versions.
183
187
 
184
188
  ## Upgrading
185
189
 
@@ -64,6 +64,7 @@ Defines how the hub MCP server identity reaches the tool:
64
64
  * `"project-file"`: Written into workspace plugin or config files (e.g. `.agents/plugins/agent-hub/mcp_config.json`).
65
65
  * `"channel-plugin"`: Provided by an installed MCP bundle.
66
66
  * `"env"`: Passed via environment variables.
67
+ * `"none"`: The tool gets no hub MCP identity (a configured print peer).
67
68
 
68
69
  #### `permission`
69
70
  Maps hub permission modes (`ask`, `ask-when-needed`, `never-ask`) to native flags or ACP mode IDs:
@@ -91,7 +92,7 @@ The `ahub <kind>` surface: `command`, `startWords(form)`, and for a fixed builti
91
92
  `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.
92
93
 
93
94
  #### Peer capability members
94
- The runtime peer (`PeerAdapter`, `src/hub/peers.ts`) exposes optional members that the daemon reads instead of checking its class (#625 phase 6): `sessionGeneration` (native session identity: absent keeps the owner-token fallback, present but undefined is unknown and refuses bounded checks), `checkpointUsesSessionGeneration` (opt out of generation-fenced checkpoints, as Pi does), `permissionModeState` (the effective native approval state, or `unknown` / `unmanaged`) and `setPermissionMode(mode)` (resolves only after the native side acknowledges). `observedModel()` returns the model the native surface reported for the turn that just ended, with its evidence grade (`served`, `session` or `configured`), read once at `turn_end`; return undefined when the surface reports none, so unknown stays unknown. A driven peer publishes its turn's final answer through `BasePeer.finalAnswer` rather than `onMessage`, so the bus strips `amem:` Record lines before sharing it (#1320); the Record instruction reaches only the owners the daemon binds (see [memory](memory.md#agent-authored-records-1320)). Native safety proofs (Codex proxy and restoration, Claude launch generation) stay in the daemon.
95
+ The runtime peer (`PeerAdapter`, `src/hub/peers.ts`) exposes optional members that the daemon reads instead of checking its class (#625 phase 6): `sessionGeneration` (native session identity: absent keeps the owner-token fallback, present but undefined is unknown and refuses bounded checks), `checkpointUsesSessionGeneration` (opt out of generation-fenced checkpoints, as Pi does), `permissionModeState` (the effective native approval state, or `unknown` / `unmanaged`) and `setPermissionMode(mode)` (resolves only after the native side acknowledges). `observedModel()` returns the model the native surface reported for the turn that just ended, with its evidence grade (`served`, `session` or `configured`), read once at `turn_end`; return undefined when the surface reports none, so unknown stays unknown. `onActivity(kind)`, set by the bus like `onDoing`, takes the closed category of the current native tool start (`files`, `shell`, `network`, `hub`, `memory`, `agents`, `model`, `unknown`) or undefined to clear it (#1512); the daemon withholds it for a private or PII turn and shows it only in live console status. A driven peer publishes its turn's final answer through `BasePeer.finalAnswer` rather than `onMessage`, so the bus strips `amem:` Record lines before sharing it (#1320); the Record instruction reaches only the owners the daemon binds (see [memory](memory.md#agent-authored-records-1320)). Native safety proofs (Codex proxy and restoration, Claude launch generation) stay in the daemon.
95
96
 
96
97
  #### `budget`
97
98
  Defines quota and context window consumption readers:
@@ -101,14 +102,29 @@ Defines quota and context window consumption readers:
101
102
 
102
103
  ---
103
104
 
104
- ## 4. Config-Only Generic ACP Adapters (#451 A3)
105
+ ## 4. Config-Only Adapters (#451 A3, #1515)
105
106
 
106
- Declare `adapters.<kind>` only in a Git-confirmed untracked `.agenthub/config.local.json`. The declaration is wholly machine-local authority and cannot override builtin kinds or select executable modules. Its `transport` is `acp`; it names a command, optional argv, display name and default roles, with optional native identity, permission-mode mappings and read-only mode. Adapter defaults cannot appoint the conductor. A project captures its catalog at startup, so declaration changes require restart.
107
+ Declare `adapters.<kind>` only in a Git-confirmed untracked `.agenthub/config.local.json`. The declaration is wholly machine-local authority and cannot override builtin kinds or select executable modules. For `transport: "acp"`, it names a command, optional argv, display name and default roles, with optional native identity, permission-mode mappings and read-only mode. Adapter defaults cannot appoint the conductor. A project captures its catalog at startup, so declaration changes require restart.
107
108
 
108
109
  Configured kinds are headless and off roster by default. Before a start can succeed, the native initialize name/version must match the configured pin and the spawned process group must be positively owned. Resume also requires an exact session/load echo. Missing native permission mappings mean unmanaged policy; missing usage/context sources remain exempt/unknown. Titles do not auto-approve tools, and read-only mode requires both native acknowledgement and host mutation fences.
109
110
 
110
111
  Grok declarations require explicit `--no-leader`, since native defaults can inherit ambient `[cli] use_leader`. Grok 1.0.62 remains unsupported: its isolated probe lacked initialize identity and refused session creation. The [T0 receipt](verification/2026-10-21-grok-config-acp-t0.md) records the remaining evidence. The full A3 schema and proof boundary are in the [spec amendment](specs/2026-09-19-agent-hub-design.md#amendment-config-only-acp-adapters-a3-451-486).
111
112
 
113
+ For `transport: "print"`, declare `command`, `args`, `displayName`, `roles`,
114
+ `versionArgs`, `versionPin` and `timeoutS` (1 to 300 seconds). Supply one
115
+ `{prompt}` placeholder in `args` or set `stdin: true` with no placeholder.
116
+ The version probe must exit successfully and match the entire trimmed pin.
117
+ The hub starts a new read-only sandboxed process group per public message.
118
+ The sandbox is required on the host and does not grant network access or
119
+ expose the person's credentials. Output is a bounded advisory answer.
120
+ A timeout or nonzero exit reports the failure with a screened stderr tail.
121
+ Permission is unmanaged. Quota and context are unknown.
122
+
123
+ The `reviewer` and `advisor` labels both permit requests for advisory opinions.
124
+ A print peer never owns a task or joins the reviewer pool. A tool-capable
125
+ reviewer or the person files the verdict. Start by kind with no instance,
126
+ resume or native launch overrides. AC5 remains a person-run receipt.
127
+
112
128
  ---
113
129
 
114
130
  ## 5. External Adapter Modules (#451 A4)
@@ -192,7 +208,7 @@ An external adapter test imports its definition and calls
192
208
  `registerConformance` with its real factory and a fake transport fixture. ACP
193
209
  adapters also call `registerAcpConformance({ definition, ... })`; unsupported native
194
210
  approval, mode or quota legs require concrete reasons, never silent skips. Other
195
- exports cover Codex, owned ACP, Pi, local and external-channel fixture contracts.
211
+ exports cover Codex, owned ACP, Pi, local, configured print (`registerPrintConformance`) and external-channel fixture contracts.
196
212
  Those exports do not grant an external runtime access to a builtin-only engine.
197
213
  The shipped fake assets live under `src/adapters/conformance/fakes`, so package CI needs
198
214
  no development-tree files. Native account/TUI probes remain separate from these
@@ -1,6 +1,6 @@
1
1
  # Native adapters and spawned agents
2
2
 
3
- Scope: the Codex, ACP and Pi adapters and the Pi extension (turn `generation` and `activity` events), peer turn state, approvals, and the agent processes the hub spawns and stops. Read before editing `src/adapters/`, `src/pi/`, `src/hub/peers.ts`, `src/hub/permission-mode.ts`, `src/hub/tool-refusal.ts`, `src/hub/action-enforce.ts`, `src/hub/permission-payload.ts`, `src/hub/claude-shell-wrapper.ts`, `src/hub/task-shell-command.ts`, `src/hub/task-shell-default.ts`, `src/hub/task-shell-proof.ts`, `src/hub/task-shell-sandbox.ts`, `src/cli/claude-shell-wrapper.ts`, `src/hub/child-process.ts`, `src/hub/lifecycle.ts` (shutdown deadline), `src/hub/start-mode.ts`, `src/hub/terminal-open.ts`, `src/memory/capture.ts` (session end), `src/hub/native-hook-launch.ts`, `src/hub/peer-catalog.ts`, the launcher-managed MCP entries (`src/cli/agy-mcp.ts`, `src/cli/kimi-mcp.ts`, `src/cli/jcode-mcp.ts`), `src/cli/configured-acp-entry.ts`, the version policy (`src/adapters/compat.ts`, `src/cli/agents.ts`) or the process-tree stop in `scripts/benchmarks/teardown.ts`, or before adding a native peer.
3
+ Scope: the Codex, ACP and Pi adapters and the Pi extension (turn `generation` and `activity` events), peer turn state, approvals, and the agent processes the hub spawns and stops. Read before editing `src/adapters/`, `src/pi/`, `src/hub/peers.ts`, `src/hub/peer-activity.ts`, `src/hub/permission-mode.ts`, `src/hub/tool-refusal.ts`, `src/hub/action-enforce.ts`, `src/hub/permission-payload.ts`, `src/hub/claude-shell-wrapper.ts`, `src/hub/task-shell-command.ts`, `src/hub/task-shell-default.ts`, `src/hub/task-shell-proof.ts`, `src/hub/task-shell-sandbox.ts`, `src/cli/claude-shell-wrapper.ts`, `src/hub/child-process.ts`, `src/hub/lifecycle.ts` (shutdown deadline), `src/hub/start-mode.ts`, `src/hub/terminal-open.ts`, `src/memory/capture.ts` (session end), `src/hub/native-hook-launch.ts`, `src/hub/peer-catalog.ts`, the launcher-managed MCP entries (`src/cli/agy-mcp.ts`, `src/cli/kimi-mcp.ts`, `src/cli/jcode-mcp.ts`), `src/cli/configured-acp-entry.ts`, the version policy (`src/adapters/compat.ts`, `src/cli/agents.ts`) or the process-tree stop in `scripts/benchmarks/teardown.ts`, or before adding a native peer.
4
4
 
5
5
  - For conceptual architecture, definition fields, generic ACP config and the new-adapter review checklist, see [Adding an AI Tool](../adding-an-ai-tool.md). For definition interfaces, see [registry-types.ts](../../src/adapters/registry-types.ts).
6
6
 
@@ -59,7 +59,7 @@ Scope: the Codex, ACP and Pi adapters and the Pi extension (turn `generation` an
59
59
  - Observed turn model (#1402, spec `docs/design/adapters.md` "Observed turn model"): report a turn's model only through `PeerAdapter.observedModel()`, cleared on read and read once at `turn_end`. `served` only when the native surface names what it served (Claude print `result` `modelUsage`, Codex `model/rerouted`), `session` for the agent's own current model (ACP session model at prompt send, headless Pi `get_state`, Codex thread model, agy hook `modelName`), `configured` for a model the hub set and the agent acknowledged. Pass ids through `safeModelLabel`; never invent, expand an alias or truncate, and a refused, `unknown` or absent value records nothing. A failed model read never fails the delivery.
60
60
  - Codex 0.154.0 `agentMessage` items carry `text` and `phase` (not `content[]`); only the last non-`commentary` message of a turn is shared.
61
61
  - Hide `hub_delivery_retry` from delivery-only ACP/local tool lists and omit its retry hint. Treat `AGENTHUB_DELIVERY_ONLY` only as an exposure hint; the daemon must refuse by the actual attached adapter, and native children must not inherit the marker. A Claude push that cannot reach its model reports `failed_safe`; if the daemon refuses that optional receipt state, try `needs_review` and retain uncertainty when neither receipt is confirmed. Keep `hub_delivery_resolve` on every list, delivery-only included: settling one's own `needs_review` row is not a retry (#1112).
62
- - ACP `onActivity` is a closed, transient person-only projection. Never publish it through the bus, log/event writers, UI, tools or memory. Emit only for an active turn; latch private envelopes and associated PII work, including unreadable privacy state, and discard pending chunks on turn teardown. Native terminal references do not authorize filesystem/terminal RPC reads.
62
+ - `onActivity` (ACP, Codex and the local worker, #1512) is a closed, transient person-only projection: only an `ActivityKind` (`src/hub/peer-activity.ts`) derived from the native item or tool kind and configured server identity (`src/adapters/definitions/native-activity.ts`), never command text, paths, URLs or arguments. The bus binds it to the current owner while busy and clears it on reset; the daemon's `PeerActivityTracker` keeps one row per busy peer, and only the console-role `status` reply (`includeActivity`) carries it. Never publish it through the bus, log/event writers, snapshots, other UI, tools or memory. Emit only for an active turn; latch private envelopes and associated PII work, including unreadable privacy state, and discard pending chunks on turn teardown. Native terminal references do not authorize filesystem/terminal RPC reads.
63
63
  - ACP quota refusals use the pinned agent contract in `src/adapters/acp-quota.ts`, fenced by native identity and current turn generation. Report hard quota and require the hub's explicit pause confirmation before settling a pre-acceptance refusal as `failed_safe`; retain `needs_review` when work already started, and keep unknown refusals on the ordinary failure path. Sanitize agent refusal text before hub-written output.
64
64
 
65
65
  ## Spawned processes and teardown
@@ -116,7 +116,7 @@ Scope: the Codex, ACP and Pi adapters and the Pi extension (turn `generation` an
116
116
  - Jcode TUI (#464): use only the current owned launch's top-level `--socket`/`--resume` tuple after native saved-session proof. Prove the save only through `savedSession` (no-follow, single-link regular file, size-bounded, unchanged across the read, its `id` and `messages` matching) and refuse a requested model, provider profile or session that differs from the running launch with `JcodeOptionMismatch`, which names the flag, never its value (#559); both the launcher and `--print-command` report it through `refuseNamedOption` (#574). Hand the tuple only to a person's launcher through `native_tui_launch` (admission: `daemon.md`); a refused tuple throws `JcodeTuiRefusal` with one closed `JcodeTuiRefusalCode` per check, never a path, socket, session or launch id. The launcher turns a returned code into words only through `jcodeTuiCauseMessage` (#1093). The headless-after-recovery hint is `JcodePeer.statusNotice` (fixed `JCODE_HEADLESS_AFTER_RECOVERY`), shown only after a crash report or a resumed session and gone once a ready TUI launch was served (`tuiServed`); previews (`--dry-run`, or `--print-command` from anyone but a person) start nothing and never resolve it. Never synthesize a save or prompt to induce one. Ctrl-C during the save wait and frontend close retain ACP; preserve session/load identity refusal and headless owned recovery metadata, and never record the TUI as a managed terminal (`recordTerminalLaunch`): Jcode has no terminal recovery adapter (#564).
117
117
  - Jcode steer (#572): reach a busy owned jcode only through `nativeSteer` on its private server socket, never by cancelling its turn: `ping` must list `soft_interrupt_ids`, `subscribe` uses `target_session_id` (the ACP session id) and `continue_on_disconnect`, `state` must report `is_processing` (a soft interrupt sent while idle starts a turn by itself), then `soft_interrupt {content, urgent: false, client_id}`. `canSend` rechecks the captured turn, busy state, owned server process, socket identity and session immediately before the write. Every refusal before the send is `failed_safe` with nothing sent; a sent message that is not acknowledged, or whose turn cannot be confirmed, is `needs_review`, never `failed_safe` or `completed`. Read `currentTurn()` before sending and adopt only through `AcpPeer.adoptIntoTurn(turn, ...)`, which refuses a different or ended turn; adopted senders join the turn answer's audience (`replyParent` and `replyAudience` over the turn envelopes, so the hop cap holds), and each steer receipt is `accepted` at once and settles with the turn (`completed` on a normal end, `needs_review` on a cancel, failure, stop or watchdog). Headless Kimi and Qwen have no steer: status reports their waiting important messages only through `importantWaitingStatus` (`src/hub/daemon.ts`) past `budget.stale_min`. A turn that ends and restarts between jcode's `state` reply and the write still receives the message, held `needs_review` and adopted into nobody: keep that ceiling until upstream offers an atomic per-turn steer, and never add a cancel-to-deliver path.
118
118
  - Jcode MCP set (#572): `jcode acp` and `jcode serve` start every server named in `<JCODE_HOME>/mcp.json` and the project's `.jcode/mcp.json`, `.mcp.json` and `.claude/mcp.json`, and no flag or variable selects them (`--mcp-tools`, `JCODE_MCP_TOOLS`, `JCODE_DISABLED_TOOLS` and `JCODE_DISABLE_CLAUDE_MCP` do not). Do not paper over it: `ahub doctor` lists the extra names through `jcodeExtraMcpServers` (`src/adapters/definitions/native-cli-jcode-mcp.ts`), names only, those four paths only, no home search, no link followed. Below the project root or home, `.jcode` and `.claude` must be real directories and the file a regular file (per-component `lstat`, an `O_NOFOLLOW` open and an `fstat` identity recheck); a system alias at or above the configured root stays allowed. Revisit if upstream adds a server selector. The person's machine-local `jcode_mcp_allow` (#1621; top level, or per instance, tier 3, never settings-editable) only changes what doctor accepts, through `splitJcodeMcpServers`: matching is by name, so a different server under an allowed name also passes (`ponytail:` comment). Never widen it to read a server's command or args, and never use it to change what jcode loads.
119
- - Extra Jcode instances (#685, #368): one `JcodePeer` per declared id (at most 8), each with its own `jcode_home`, socket and state. The person authenticates inside Jcode; the hub passes `-p`, `--model` and `--provider-profile` exactly as declared, handles no model credential or URL, and only checks that the home is a directory the person owns (`jcodeHomeRefusal`: no read or write under it). Never put `AGENTHUB_PEER_ID` in the shared `.jcode/mcp.json` entry (`jcodeMcpEntry`): every owned launch supplies it through `peerChildEnv(<id>)` or the TUI launch env, together with its `AGENTHUB_LAUNCH_ID`. The MCP server with no `AGENTHUB_PEER_ID` in tools mode refuses every tool and never defaults to a peer id. The daemon admits a `tools` hello for a peer whose definition is `owned-acp` only when it carries the launch id of that peer's current owned launch (`JcodePeer.ownsLaunch`, from `jcodeLaunches`); never trust the env alone. `jcode --as <id>` never opens a TUI. Declare the semantic `instances.nativeHome` on a definition, never compare the kind name (`registry-guard`); it is a fixed-builtin capability that `assertNativeCapabilityScope` refuses elsewhere. `checkJcodeInstanceHomes` (`src/hub/instances.ts`, run once at daemon startup) refuses a home equal to or nested in the base Jcode's or another instance's; compare homes only through its `canonicalHome` (`realPath`, case-folded on a volume that folds case, inode), never `resolve()` text. The preview of `--as <id>` passes the instance to `previewJcode` so it shows the daemon's real flags.
119
+ - Extra Jcode instances (#685, #368): one `JcodePeer` per declared id (at most 8), each with its own `jcode_home`, socket and state. The person authenticates inside Jcode; the hub passes `-p`, `--model` and `--provider-profile` exactly as declared, handles no model credential or URL, and only checks that the home is a directory the person owns (`jcodeHomeRefusal`: no read or write under it). Never put `AGENTHUB_PEER_ID` in the shared `.jcode/mcp.json` entry (`jcodeMcpEntry`): every owned launch supplies it through `peerChildEnv(<id>)` or the TUI launch env, together with its `AGENTHUB_LAUNCH_ID`. The MCP server with no `AGENTHUB_PEER_ID` in tools mode refuses every tool and never defaults to a peer id. The daemon admits a `tools` hello for a peer whose definition is `owned-acp` only when it carries the launch id of that peer's current owned launch (`JcodePeer.ownsLaunch`, from `jcodeLaunches`); never trust the env alone. #1668: a hello refused there for a rostered peer records that peer as detached (`status.peers.<id>.detached`, the cause and that peer's own launch command from `jcodeDetachedNotice`) until a hub-owned launch of it succeeds; the refusal, its close code and the listeners are unchanged, the record is daemon memory, and a hello refused off roster records nothing. `jcode --as <id>` never opens a TUI. Declare the semantic `instances.nativeHome` on a definition, never compare the kind name (`registry-guard`); it is a fixed-builtin capability that `assertNativeCapabilityScope` refuses elsewhere. `checkJcodeInstanceHomes` (`src/hub/instances.ts`, run once at daemon startup) refuses a home equal to or nested in the base Jcode's or another instance's; compare homes only through its `canonicalHome` (`realPath`, case-folded on a volume that folds case, inode), never `resolve()` text. The preview of `--as <id>` passes the instance to `previewJcode` so it shows the daemon's real flags.
120
120
  - Hub-owned Jcode home (#1627, `src/adapters/definitions/native-cli-jcode-home*.ts`): `ahub init` reads only the allowed entries of the person's own `mcp.json` and never writes it. It never copies or links auth. It writes the new home's files 0600, and sets `jcode_home` only after that home holds a login.
121
121
  - Jcode defers MCP tools (#912, `JCODE_DEFERRED_TOOLS_INSTRUCTION` in `src/hub/envelope.ts`): a Jcode peer lists only its built-in tools until the model searches for an MCP tool, so without a hint it reports the hub tools missing and answers in its final message. The guidance is written in exactly one place, that constant, and `JcodePeer` sends it through `jcodePreamble` (`src/adapters/jcode.ts`) ahead of the role contract, once with a session's first prompt, for the base peer and every extra instance. Never copy it into `STANDING_INSTRUCTION`, `templates/AGENTS.block.md` or a profile template (the Jcode bullet there is the same text in every template, and `test/jcode-deferred-tools.test.ts` pins both), and never change Jcode's own deferral or cache settings from the hub. The tools it names must exist, and the server name must be `JCODE_MCP_NAME`.
122
122
  - Antigravity P1 (`src/adapters/agy/`): keep it optional, cloud, off roster by default, implementer/verifier only and pull-only. Until per-mode native prompt behavior is verified, reject hub permission/unattended mappings, headless starts and resume selectors; do not infer a quota source. The launcher refuses extra instances, any `agy --version` not admitted by `assessVersion("agy", ...)` (`COMPAT.agy` in `src/adapters/compat.ts` is the verified-set/warning-line source of truth; exact person trust is separate, #691), and a hub without the `native_hook_launch` feature.
@@ -1,6 +1,6 @@
1
1
  # Benchmark runners
2
2
 
3
- Scope: the CooperBench runners, their fixtures, teardown and recovery. Read before editing `scripts/benchmarks/` or `test/benchmarks/`, or before running a benchmark.
3
+ Scope: the CooperBench runners, their fixtures, teardown and recovery, and the friction corpus. Read before editing `scripts/benchmarks/` or `test/benchmarks/`, or before running a benchmark.
4
4
 
5
5
  - Never auto-register Orca benchmark fixtures, including ad-hoc or copied runners; require an explicit pre-existing repo and exact worktree registration, and preserve fixture directories, Git state and benchmark evidence during cleanup.
6
6
  - The manifest-v3 Pi/Qwen CooperBench driver (`scripts/benchmarks/native-pi-qwen.ts`, #140) is headless and never touches Orca. Its pinned build is the effective one: each native's `--version` runs under the final isolation environment (Qwen inside its seatbelt profile with `QWEN_HOME` set; the PATH bootstrap lies about the managed build under isolation). Its protected-file probe counts only with structured denial evidence (a guard denial or a failed read tool call with EPERM/EACCES), never a model-written marker alone, and each peer's serialized `sandboxProbe` readiness reports only that peer's observed probe outcome (`denied` with its evidence, else explicit `failed`/`unknown`; #150), never a synthesized denial. Served-model evidence is each request's own journaled `RelayRequestRecord` (#139): a heartbeat-only or cancelled-before-identification record certifies nothing, and every identified record is evidence whatever its outcome; a confirmed mismatch on a request cancelled after identification fails the model gate. A backend's last-served label is never a request's evidence. Qwen's peer tool approval is the exact canonical `mcp__pilot-peer-bus__hub_send` through the adapter's #138 binding, never a title-prefix workaround.
@@ -43,3 +43,9 @@ A default that decides which MODEL answers is changed with a receipt too. Scope:
43
43
  - **The live half is by hand.** A change to an alias, a judge or any key outside the deterministic set (`liveRequired`) moves what a model answers, so the receipt must carry a `live` block made with `--live`: it asks each policy's judge alias the judge cases through the gateway with the request THAT POLICY builds (`judgeRequestFor`: the same prompts and the advisor's route `transcript_max_chars` as `HubRouteRuntime.review` passes them; a test compares it with what the real runtime sends) and writes the model id the gateway REPORTED for each alias (OmniRoute `servedModel`). Each outcome records the sha256 of the request it was asked, and CI recomputes it, so a receipt for a changed cap that measured the default's request is refused. It needs `AGENTHUB_OMNIROUTE_URL` and `OMNIROUTE_API_KEY`, exits 2 without them before any request, and writes nothing when a call failed, the gateway named no served model, or it named the alias. A deterministic-only change may carry `served_models: live-not-run`.
44
44
  - **CI** is the second step of `.github/workflows/routing-receipt.yml`, `scripts/check-model-routing-receipt.ts`. It runs no model and has no gateway or key. It REBUILDS everything the files determine (configurations, changed keys, every metric and per-case outcome, the rendered document) and compares it whole, as part 1 does. The live block is the one thing no file determines, so CI checks its shape and consistency only: exactly the test-split judge cases, the alias each policy asks, no failed call, a served id for every alias that is a real model id and not the alias, and scores recomputed from the recorded verdicts. It cannot check that a model said it: a person who reads the receipt owns that.
45
45
  - **A corpus change voids every earlier receipt** and never lands in the same PR as the keys it measures. Do not edit a case's `expect` to make a candidate pass, relax a guard, or move a case between splits to flatter a candidate.
46
+
47
+ ## Friction journeys (#1644)
48
+
49
+ - The corpus (`scripts/benchmarks/friction/`, how to run and extend it: `docs/friction.md`) drives a built `ahub` as a subprocess in a throwaway HOME, state directory and git repository, offline, with no model call and no account. Never instrument the product for it, and never let the runner fall back to another binary when the measured one does not start.
50
+ - `classify.ts` is the one classifier for every mode; do not add a second one in a journey or in `compare.ts`. A new journey goes in `JOURNEYS` (`journeys.ts`) with `guards` naming the issue or contract it protects and `expectText` pinning the refusal it reaches; a refusal it cannot reach offline is listed with `skip` and a one-line reason, never counted. Run the corpus twice: the class counts must match (`test/benchmarks/friction.test.ts`).
51
+ - It is report only: keep it out of `scripts/check.sh`, and keep `.github/workflows/friction.yml` at `contents: read` with no secret, writing only the job summary and the artifact.
@@ -30,13 +30,13 @@
30
30
 
31
31
  - 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.
32
32
 
33
- 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.
33
+ 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/cli/warn-line.ts`, `src/ui/index.html`, the dashboard view models (`src/ui/roadmap-model.ts`, `src/ui/overview-model.ts`), 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.
34
34
 
35
35
  - The plugin bundle is installed apart from the daemon. Breaking a control WS message contract bumps `PROTOCOL` in `control-client.ts`; a new request answered as unknown or an optional field preserves it, as does additive optional public task metadata in `ui_snapshot` that older clients ignore (such as `deps` in #246).
36
36
  - `hub_invoke` over the control WS (#445, #991): the daemon binds each admission to its socket and `rid` with an `AbortController` (`invocationRequests`, at most 64 per connection; a duplicate `rid` refuses). `request_cancel` and socket close abort it, and every check after an await confirms the socket is open and still maps that `rid` to the same controller before any effect. Clients go through `ControlClient.request`, whose `controlRequestTimeout` raises a `hub_invoke` wait to `INVOCATION_CONTROL_TIMEOUT_MS`; never call it with a shorter bound.
37
37
  - Control write outcomes (#1106, `src/hub/tool-request.ts`): `toolWriteOperation` is the one list of writes whose transport result can be lost (`hub_task_propose`, `hub_review`, `delivery_complete`). After a timeout, a cancel or a closed socket, `ControlClient` answers `outcome: unknown` with the settling read (`toolWriteUnknownReply`), never a plain failure. Replay goes only through `ToolWriteRegistry`, keyed by `requestId` and `toolWriteScope`, with one bucket per actor. `toolWriteCurrent` rechecks authority and privacy before a retained result is returned. The channel strips MCP `request_id` before `taskOp`, and `Tasks` never reads it. An explicit key is refused before sending to a hub without `tool_write_idempotency`. `delivery_complete` keeps the journal's idempotence and never uses the registry. A new retryable write joins `toolWriteOperation`; never add a second key path.
38
38
  - Control-write diagnostics (#1126, `src/hub/control-write-trace.ts`): `onControlMessage` wraps the original `onMessage`, keeps its name for the native-branch ratchet, and returns to it untraced before any argument traversal for a client that is not admitted. Privacy guards are factories over primitives (`controlWritePrivacyGuard`), raw-input screens are passed as lazy admission-only callbacks and never retained, and an expired trace is settled and suppressed without touching the operation. Never add a timeout, retry or authority decision to this path; a new boundary is one more closed `ControlWritePhase`, and a test that extracts these closures binds the real guards (tests.md).
39
- - `peer_stop` is the console's or an admitted conductor's (`admitOperational(sock, "stop")`) and stops, through its adapter, only an owner whose adapter reports `hubOwned === true` and whose `form` is not `tui` (today headless ACP, Pi, local, print-reviewer and Claude implementer); a present `undefined` form refuses. Refuse native-terminal peers and recovery-held mutations; serialize with starts and permission changes, and refuse a recovery `prepare` while a stop runs. An admitted stop holds delivery through `BusOptions.deliveryHeld` before any teardown await (never a console pause that resume can undo, or a global recovery hold that blocks unrelated peers) and withdraws the peer's pending approvals before the adapter stops. A requested stop holds an in-flight delivery as `needs_review` with an ids-only stop reason, suppresses restart/escalation, and never resolves that delivery automatically.
39
+ - `peer_stop` is the console's or an admitted conductor's (`admitOperational(sock, "stop")`) and stops, through its adapter, only an owner whose adapter reports `hubOwned === true` and whose `form` is not `tui` (today headless ACP, Pi, local, print-reviewer, configured print and Claude implementer); a present `undefined` form refuses. Refuse native-terminal peers and recovery-held mutations; serialize with starts and permission changes, and refuse a recovery `prepare` while a stop runs. An admitted stop holds delivery through `BusOptions.deliveryHeld` before any teardown await (never a console pause that resume can undo, or a global recovery hold that blocks unrelated peers) and withdraws the peer's pending approvals before the adapter stops. A requested stop holds an in-flight delivery as `needs_review` with an ids-only stop reason, suppresses restart/escalation, and never resolves that delivery automatically.
40
40
  - Console review guidance (#711): `r` on a task in review opens `reviewChoice` (`src/cli/console-review.ts`, modelled on `modeChoice`) from the row or the open task detail, never a bare prefill; `a` and `c` prefill `review N approved|changes_requested ` with a guide line, a `changes_requested` line with no note is refused in `reduceConsole` before any effect, and the result of a review command is shown as a notice in panels mode (`reviewResult`). The console only prefills and runs `ahub review` as the person: never grant it extra authority, and keep a private task's title out of the choice line (`[pii]`). The CLI cause line (`agentShellCause`, `src/cli/identity.ts`) is printed for the `tools` identity and a person-only hub refusal only, never for the console identity, and never replaces the refusal.
41
41
  - Console changed-symbols block (#684 2b): `symbolFields` (`src/cli/console-symbols.ts`) adds `symbols` after `plan` for a task_show-shaped detail only, from the public `codeSymbols`; never from a raw `Task`, never for a private task, never from a stored receipt (one with `repositoryKey` reads as unknown: only the screened public receipt is shown), never as a second copy of the match rule (`planSymbolMatches` in `review-brief.ts`). Unknown is `unknown (no code facts)`, never an empty list.
42
42
  - Console Queue `D` (#713) only prefills `queue discard --peer <selected row's peer> --reason `; Enter refuses a missing peer or reason and arms a `y` confirm that names the count, then runs the person's `ahub queue discard ... --yes`. Without `--state` the confirm counts the peer's queued and unsettled failed rows; the console sends that form only when the hub's `features` list `queue_discard_states`, otherwise it sends `--state queued` (#1103). Beyond `list`, the `queue` op is the console's or an admitted conductor's (`admitOperational`, `show`/`resolve`/`discard` only); `discard` without `confirmed` only counts, and a confirmed one needs a reason, is refused during recovery or shutdown and discards row by row through `resolveDelivery` (rule: `bus.md`).
@@ -50,6 +50,7 @@ Scope: the operator console, control WS and its protocol, state files, the dashb
50
50
  - SDLC band timer (#481 S7): the daemon's band interval (`bandsEveryMs`, default 5 min) is the only caller of `tasks.proposeFromBands`. It skips while stopping or in recovery, when `tasks.bandsState()` is not ready or `bandsHeld` holds, and when `board.statusRevision()` with the band signature is unchanged since the last pass that ran; it records that key after the write. A failure is one sanitized `hub.log` line. Writer rules: `tasks.md`.
51
51
  - `ahub board` (#724): `renderBoard` prints one line per task only with a terminal width and without `--full`; `--full`, `ahub task show` and output without a width keep the full table and SDLC advice. `STAGE_CODES` (`src/cli/output.ts`) keys on blocker-text prefixes from `src/hub/sdlc.ts`: rewording a blocker there updates its code in the same PR. TITLE is cut, never wrapped; STAGE is never dropped (it falls back to the meter and the code); a PII row keeps its `(ahub task show N)` hint while 8 title columns remain.
52
52
  - CLI output default (#814): a command prints for a person unless `--json` is given. The recovery and upgrade commands follow it too (`src/cli/upgrade-output.ts` composes `planLines`, `renderPlan`, `renderOperation`, `renderBlocked` and `choiceInstruction`, so the non-interactive text never says what the screens would not): a pipe and `--dry-run` print the plan with blockers, reconnect-only and fresh-start peers in stdout, `--json` keeps the document and the stderr lines (#206), and `recoveryDisplay` takes a pipe's width from `COLUMNS`. Hub tool text (`task show`, the backlog and release commands) is parsed on the CLI side by `showToolText` and rendered by `src/cli/task-output.ts`; `--json` prints the text byte for byte, unparseable text prints as it came, and a private task is rendered as the stub the hub sent, never asked for more. A command that takes free text reads `--json`, `--full` and `--color=` through `splitPresentation` (`edges`): only a leading or trailing run is a flag, and a value flag's value never is, so a reason keeps its words. `test/cli-json-guard.test.ts` also scans every file in `src/cli/` for a print of a hub tool's text (`console.log(await taskOp(<op>))`, or `console.log(x)` where `x` is bound from one) and passes only when the print is inside a `--json` branch, the op is in the named `SENTENCE_OPS` (ops whose daemon case returns prose, each checked against the daemon), or it is named debt with a reason (`TEXT_DEBT` for JSON ops a later task converts, `CONDUCTOR_DEBT` for the conductor-role commands, `REFUSAL_FALLBACK` for the refusal sentence printed after `--json` and the table were handled); a new JSON-returning op printed bare fails it, and an entry that matches no print fails too. Convert a command by rendering it through `showToolText`, never by adding it to a list. A renderer is a pure function in `src/cli/` (`sdlc-output.ts` for the `sdlc` read commands) and the call site keeps its own visible `if (options.json) console.log(JSON.stringify(...))`, so `test/cli-json-guard.test.ts` can see the branch. Never print JSON by default: add the command's `--json` branch, or name the site in the guard's `DATA_FORMAT` (JSON by purpose: `export`, `sdlc export`, `bench export`, the PreToolUse hook reply) with its reason. The guard accepts a `--json` branch only when the condition PROVES the flag (`selectsJson`): `X.json` on an option holder (`options`, `display`, `present`), `args|flags.includes("--json")`, a known alias, `&&` when either side does, `||` only when both do, `=== true`. Anything else (`!x`, `=== false`, `|| other`, `?? x`, a comparison, an unknown name) is not a guard, so a new shape fails until it is written one of these ways. A renderer table never exceeds the terminal: `grid` (`sdlc-output.ts`) wraps cells, then falls back to one labelled block per row, and keeps every identifier whole. `NOT_YET_CONVERTED` is debt the later #814 tasks delete; an entry that matches no site fails the test, so the list only shrinks. `sdlc` drops `--json`, `--full` and `--color=` from its operands only for its read subcommands (`sdlcOperands`): the others keep their argv exactly. A hub tool's JSON text that does not parse prints as it came, never as an empty report.
53
+ - CLI warnings and raw prints (#1654 AC4): a warning goes through `warn()` in `src/cli/main.ts`, which is `warnLine()` (`src/cli/warn-line.ts`: `ahub: warning: <what>: <why>` and an optional `→` next step); keep `warn-line.ts` importing only `output-standard.ts`, because the modules that warn load it early and `console-state.ts` would close an import cycle through the adapter registry. A raw `console.log` or `console.error` in `src/cli` outside Report, `printOutput`, `errorLines` or the warning printers fails `test/cli-output-conformance.test.ts` unless `scripts/cli-raw-output.baseline.json` lists it (file, exact trimmed line text, count, a reason naming #1654). That baseline only shrinks: never add an entry or re-add a reworded line; when you move a listed call onto Report or `warn()`, or remove it, lower or delete its entry in the same commit.
53
54
  - CLI help and free text (#1433, #1405): `ahub <command> <sub> -h|--help` prints help only when `listsSubcommand` (`src/cli/help.ts`) finds that subcommand in the help, so free text such as `ahub say try ls -h` stays text. A write command that takes a title or text from leftover words refuses an unknown `--` word or `-h` before anything is filed (`unknownOption`, `unknownOptionRefusal` in `src/cli/free-text.ts`, naming `subcommandUsage`), and words after a lone `--` are text; apply it to any new such command. A usage that both `ahub help` and a refusal print has one source (`GUIDANCE_PROBE_USAGE` is the pattern).
54
55
  - Settings (#269): the dashboard's `setting`, `setting_undo`, `setting_preview` and `setting_reload` actions and the console-role `settings_get|set|undo|preview|reload` requests go through `settingsSet`, `settingsUndo`, `settingsPreview` (`settingsUndoPreview` for `undo: true`) and `reloadConfig` (`src/hub/daemon.ts`) and the registry in `src/hub/settings.ts`. A new editable setting is a registry entry, never a new write path (a number that can be turned off is type `number-or-off`, the literal `off`, never a sentinel number); a numeric operational tunable (#489) is a fixed row in `OPERATIONAL_NUMBERS` (`src/hub/operational-settings.ts`) plus its explicit `config-apply.ts` leaf (`operationalNumberCheck`), its `DEFAULT_CONFIG` default and a reader asked at each use, or, for a row with `applies: "next use"` or `"restart"`, captured once by the consumer it configures (a new adapter for `adapter_timing.*`, a new model relay for `model_relay.*`, `Inference` at daemon start for `inference.*`, a console launch for `console.*` through one `settings_get` after its first draw and tail subscription, 3 s bound, defaults on failure); never retime or trim a running consumer's state with it, never registered from a file, request or environment variable; a key that chooses what the hub runs or where secrets or task text go joins `NEVER_EDITABLE` instead. Writes go only to `.agenthub/config.local.json` and `.agenthub/routing.local.toml` through `store()`: the loader's own validation first, temp file and rename, never a file git tracks. Authority comes from the dashboard session (`DashboardSession`, `src/hub/ui.ts`) or the console role (for `settings_set` and `settings_preview` of an `operationalSetting` or `operationalRosterSetting` key, also an admitted conductor), never from the request body; `ui_action` from the manager is an ordinary session. Never return a setting's value in an event or notice except through `recordSetting`.
55
56
  - Structural config edits (#689): `src/hub/config-tier.ts` is the one tier rule (editor, dashboard refusal and `structuralLeaf` in `authorizeConfigLeaf`), `src/hub/config-edit.ts` plans and writes (loaders first, revision checked twice, bounded backups, atomic), `src/hub/config-edit-host.ts` owns authority, the typed tier 3 confirmation, the `config_edit` event and the scoped publish. The daemon only supplies ports (`createConfigEditor` in `daemon.ts`); never validate, write or classify in `daemon.ts`. A new editable structural key is an entry in `config-tier.ts` and nothing else; a key that chooses what the hub runs or where secrets go is tier 3 and is never offered to the dashboard (the hub refuses it, the page also hides it). The audit event and every notice carry key paths and value hashes, never a value. `structural` reaches `authorizeConfigLeaf` only through `structuralScopes` for the one scoped reload. `sdlc.toml` is read once at start, so it joins `pendingRestart` through `allPendingRestart()`, never through `reloadConfig`; read the file's value only through `readSdlcFile`, which returns the host-only `DaemonOptions.sdlc` when a fixture supplies one (#1411), so a fixture neither runs nor reports a restart pending against the checkout's tracked file. A new ahub settings subcommand that writes is classified `console` by default; keep it that way.
@@ -77,7 +78,7 @@ Scope: the operator console, control WS and its protocol, state files, the dashb
77
78
  - 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.
78
79
  - 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.
79
80
  - 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).
80
- - 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.
81
+ - 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, `spec_readbacks` while `Board.hasSpecReadbacksState()` finds a read-back request or report (its `specReadbacks` digest joins `integrity()` only then, and a corrupt row refuses as unknown storage), `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.
81
82
  - 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`.
82
83
  - 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).
83
84
  - 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`).
@@ -177,4 +178,4 @@ Scope: the operator console, control WS and its protocol, state files, the dashb
177
178
  - 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.
178
179
  - 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.
179
180
  - 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.
180
- - `src/ui/roadmap-model.ts` is injected into the page by source (`/* ROADMAP_MODEL */` in `src/hub/ui.ts`). Keep it self-contained, with no imports or module closures. The roadmap view writes through `textContent` only, and the `roadmap` snapshot block rides only `view: "roadmap"`.
181
+ - `src/ui/roadmap-model.ts` and `src/ui/overview-model.ts` (#1514) are injected into the page by source (`/* ROADMAP_MODEL */` and `/* OVERVIEW_MODEL */` in `src/hub/ui.ts`). Keep them self-contained, with no imports or module closures. The roadmap view writes through `textContent` only; the `roadmap` snapshot block rides only `view: "roadmap"` and the `overview` block only `view: "overview"`. The Overview reads the same `taskSample` as `ahub sdlc metrics`; an underivable figure is `null` (shown `unknown`, never 0), and a private task is only counted in `withheld`.
@@ -1,6 +1,6 @@
1
1
  # Task board and hub tools
2
2
 
3
- Scope: the task flow, assignment, the state machine and the hub's MCP tools. Read before editing `src/hub/tasks.ts`, `src/hub/board.ts`, `src/hub/routing.ts`, `src/hub/task-sweep.ts`, `src/hub/settled-roles.ts`, `src/hub/conductor.ts`, `src/hub/supervision.ts`, `src/hub/tool-refusal.ts`, `src/hub/hub-tools.ts`, `src/hub/review-brief.ts`, `src/hub/reviewer-pool.ts`, `src/hub/reviewer-pool-config.ts`, `src/hub/release-admission.ts`, `src/hub/main-checkout.ts`, `src/hub/checks.ts`, `src/hub/task-repository.ts`, `src/hub/review-findings.ts`, `src/hub/review-scope.ts`, `src/hub/plan-conformance.ts`, `src/hub/sdlc-metrics.ts`, `src/hub/sdlc-merge.ts`, `src/hub/sdlc-mirror.ts`, `src/hub/no-writes.ts`, `src/hub/workflow.ts`, `src/hub/deliverables.ts`, `src/hub/deliverable-files.ts`, `src/hub/research-campaign.ts`, `src/hub/research-experiments.ts`, `src/hub/research-runner.ts`, `src/hub/task-approval.ts`, `src/hub/ci-watch.ts` or the cross-project handoff (`src/hub/handoff.ts`, `src/cli/handoff-args.ts`, `src/cli/handoff-output.ts`).
3
+ Scope: the task flow, assignment, the state machine and the hub's MCP tools. Read before editing `src/hub/tasks.ts`, `src/hub/board.ts`, `src/hub/routing.ts`, `src/hub/task-sweep.ts`, `src/hub/settled-roles.ts`, `src/hub/conductor.ts`, `src/hub/supervision.ts`, `src/hub/tool-refusal.ts`, `src/hub/hub-tools.ts`, `src/hub/review-brief.ts`, `src/hub/reviewer-pool.ts`, `src/hub/reviewer-pool-config.ts`, `src/hub/release-admission.ts`, `src/hub/main-checkout.ts`, `src/hub/checks.ts`, `src/hub/task-repository.ts`, `src/hub/review-findings.ts`, `src/hub/review-scope.ts`, `src/hub/plan-conformance.ts`, `src/hub/risk-tier.ts`, `src/hub/review-checkout.ts`, `src/hub/sdlc-metrics.ts`, `src/hub/sdlc-merge.ts`, `src/hub/sdlc-mirror.ts`, `src/hub/no-writes.ts`, `src/hub/workflow.ts`, `src/hub/deliverables.ts`, `src/hub/deliverable-files.ts`, `src/hub/research-campaign.ts`, `src/hub/research-experiments.ts`, `src/hub/research-runner.ts`, `src/hub/task-approval.ts`, `src/hub/ci-watch.ts` or the cross-project handoff (`src/hub/handoff.ts`, `src/cli/handoff-args.ts`, `src/cli/handoff-output.ts`).
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.
@@ -92,8 +92,10 @@ Scope: the task flow, assignment, the state machine and the hub's MCP tools. Rea
92
92
  - Security pass (#1403 A2, `src/hub/security-pass.ts`, `Tasks.securityView`): applicability comes only from the complete PR file inventory plan conformance reads; an incomplete or unreadable inventory is `unknown`, never `not_required`. The record is the latest non-withheld verdict's `securityPass`, bound to the head that verdict reviewed. `hub_review` `security_pass` is refused pre-effect in off and validated before any board effect; enforce turns `required` and `unknown` into blockers for approval, the merge queue and the merge gate through `securityPassBlockers`, the one source. `SECURITY_COMPANIONS` is a closed list because its names are printed into review requests. A PII task or an off lifecycle computes nothing.
93
93
  - Security audit (#1403 A4, A5; `src/hub/security-audit.ts`, `Tasks.auditStart`, `auditShow`, `auditReport`; `docs/sdlc.md` "Security audit with a coverage ledger"): only the hub writes the ledger, through `Board.auditCreate` and `Board.auditApply` (units, findings, verifications and settlements in one transaction; `undefined` means a finding was decided meanwhile and refuses). `auditStart` admits the person or the rostered configured conductor outside a private turn, needs the lifecycle on and `[security]`, allows one open audit, and cancels its task when the ledger cannot be created. In `auditReport`, units and findings come only from the in-progress owner; `verify` and `settle` come from a rostered reviewer-role peer that is not the finder (`verificationRefusal`, `settlementRefusal`) or the person, never verify and settle the same finding in one call, and the audit and task are compared again after the screen's await before `auditApply`. Rejections and `false_positive` settlements go to the considered ledger (`recordConsideredAfter`). `hub_audit_report` is advertised only with the lifecycle on and `[security]`, and stays out of memory capture.
94
94
  - Person review comments and anchored findings (#1056, #1181, #1192, #1205; `src/hub/review-comments.ts`, `src/hub/review-anchor.ts`, `src/hub/review-material.ts`, `Tasks.reviewComment*`): only the console person writes a comment (`reviewPerson`), and authorship comes only from the server-built `ActionMeta`. A send binds immutable anchors and bodies into one package, appends one count-only history entry and attempts one envelope; it is never retried automatically, and only an explicit Send with `packageId` recovers that saved package. Placement is computed at read and send and never persisted over the stored anchor. Dashboard snapshots never read comment material. PII comments stay board-local and count-only. Comment writes count in `reviewCommentsPending`, which recovery and shutdown wait for. A finding `anchor` must agree with its `path`. Bounds and the full contract are in `docs/design/task-board.md` "Anchored review packages (#1056)"; read it before changing these paths.
95
- - Recurring unmet criteria (#514a, `src/hub/learning.ts`): grouping is pure (rows in, groups out); `Tasks.proposeCriterionCandidates` is the only caller and runs beside `proposeRecurringFindings`. It files a backlog card with ids and counts and the `profile_overrides` fragment as text, never applies it, and counts only rows that `candidateTextAllowed` passes (no PII). Its dedupe is the `Criterion candidate key:` line; keep it first in the detail. `ahub learn` (#514b) is the person's verdict on those cards: `parseCandidateCard` reads only that first line (and the hub-authored `plan` card, and the title that must match it), the task count and the line are recomputed from the board (`learnEvidence`, `overridesDiff`), and the card closes through `Tasks.cancel` only after `settingsSet` wrote the one managed key `LEARN_CHECKLIST` (never before, never by a direct board write); every `Tasks.learn*` method refuses any `by` but the person, and a new learn op never joins `CONDUCTOR_TASK_OPS`. Rewording the card's key line or title changes the parser in the same change.
95
+ - Recurring unmet criteria (#514a, `src/hub/learning.ts`): grouping is pure (rows in, groups out); `Tasks.proposeCriterionCandidates` is the only caller and runs beside `proposeRecurringFindings`. It files a backlog card with ids and counts and the `profile_overrides` fragment as text, never applies it, and counts only rows that `candidateTextAllowed` passes (no PII). Its dedupe is the `Criterion candidate key:` line; keep it first in the detail. `ahub learn` (#514b) is the person's verdict on those cards: `parseCandidateCard` reads only that first line (and the hub-authored `plan` card, and the title that must match it), the task count and the line are recomputed from the board (`learnEvidence`, `overridesDiff`), and the card closes through `Tasks.cancel` only after `settingsSet` wrote the one managed key `LEARN_CHECKLIST` (never before, never by a direct board write); every `Tasks.learn*` method refuses any `by` but the person, and a new learn op never joins `CONDUCTOR_TASK_OPS`. Rewording the card's key line or title changes the parser in the same change. Follow-up (#1642): an accepted line's record is the fixed suffix `src/hub/learn-followup.ts` writes on the card's cancel note and reads back (pure, cleared rows in, counts out); a removal card removes only its one line through the same settings writer, and a hand-written or edited line is `untracked` and never removed.
96
96
  - Plan conformance (#481 S2, `src/hub/plan-conformance.ts`): compare only literal repository-relative `plan.paths` entries (file or directory prefix, no glob) with complete PR file metadata; `completePlanInventory` requires a full head, `pathsComplete` and `typesComplete` (false on any rename or copy). Root, absolute-unverified or unsafe entries, a missing plan, a truncated inventory and a failed read are `unknown`, never covered; never read patches or the filesystem. An untouched planned path is advice; a changed path outside the plan is a departure, and `planConformanceBlockers` blocks enforce approval on `unknown` and on an unaccepted departure. Plan `proof` and `risks` (32 strings of 512 characters) cover no file. `Board` records `planRevision` only while `trackPlanRevisions` (mode not off), separate from backlog `planningRevision`.
97
+ - Risk tier (#1645, `src/hub/risk-tier.ts`): derive a tier only from the complete PR file inventory against the `[risk]` and `[security]` globs (pure: no clock, I/O, board, worktree or model call); an incomplete inventory records no tier, never `medium`. A tier is bound to the head it classified, and a re-file drops it before deriving a new one. The tier names stay unexported and `riskMinimum` is the one place that spells a tier's floor, read by the verdict, the plan review and the merge gate; never restate a floor elsewhere.
98
+ - Reviewer checkout evidence (#1646, `src/hub/review-checkout.ts`): the hub reads the checkout, never the reviewer, and the record lives on the verdict's history entry, never in `sdlc` (the approval's coverage receipt is hashed from it). An unreadable checkout records no evidence, never an empty list, and every record names its source (`peer-cwd` or `project-root`).
97
99
  - Cold-readable plans (#1403 B1): when lifecycle is enabled, include the full `base` commit, literal `out_of_scope` paths, bounded `stop_if` conditions and ordered `steps` (`description`, optional `verify` command and expected result). Keep verification as text, never execute it from a plan. Include every new string in the existing task privacy screen. Exclusions override broader includes in both task and merge-queue conformance. Accept drift compares base to the local remote-tracking default tip (`refs/remotes/origin/HEAD`) without a task head. Done compares base to the unique merge-base of the recorded task head and that default tip, excluding own commits. Require base ancestry of the endpoint; use optional `AuditSource.defaultTip`/`mergeBase`, reject shallow/missing/ambiguous/reversed/foreign evidence, recheck the default tip, and screen changed names. Keep Git local-only with the existing hardened read-only diagnostic environment; never fetch, lazy-fetch or guess `main`. Missing ports or incomplete evidence is unknown. Never substitute checkout HEAD, persist a drift claim as evidence, or let drift block a transition. Off advertises/normalizes none of these fields and reads no drift.
98
100
  - Advisor surveys and considered findings (#1403 B2/B3/T7): read `docs/design/task-board.md` "Advisor survey and rejection ledger" before changing these paths. Start only through Tasks for the person/current unique conductor with lifecycle enabled; atomically create the read-only planner task and private survey metadata through the host-only proposal hook before delivery. Report through the current assigned planner with fresh task/role/privacy/recovery fences and the existing study drain. Require explicit vetting before backlog cards; dedupe only open host-created markers, and name the prior closed hub task plus the screened reopening reason on a new unsuppressed card. Closing a card never clears rejection. Retain rejection/reconsideration history, compare only same-repository semantic ids and affected literal paths against complete pinned-ref diffs, and keep unknown suppression. Keep private/security facts local and public reasons behind current metadata policy; expose security/withheld identities as stubs. Require `advisor_surveys` only when survey or considered state exists, preserve its conditional recovery integrity, and keep empty databases on their existing format floor. Never schedule surveys, execute finding text or infer independent source review from a declared vet decision.
99
101
 
@@ -66,3 +66,6 @@ Scope: tests, fakes and the test gate. Read before adding or changing a test or
66
66
  - Production `MemoryClient` (`src/memory/client.ts`) is the in-process amem store and never opens `memory.worker_url` (#752). A test that needs the legacy worker shape injects `FakeMemoryClient` (`test/fakes/mem-worker.ts`) as `DaemonOptions.memoryClient` or in place of the client; never add an HTTP path to the production client for a test. An amem-backed test sets its own temp `AMEM_HOME` and reads only its own fixture memory directory.
67
67
  - CLI print guards (#814, `test/cli-json-guard.test.ts`): two scans over every file in `src/cli`. One finds `console.log(JSON.stringify(...))` and passes only behind a `--json` branch (`selectsJson`) or a named `DATA_FORMAT` entry (`NOT_YET_CONVERTED` is empty since #899; keep it empty). The other finds a print of a hub tool's text (`console.log(await taskOp(<op>))`, or a variable bound from one) and passes only behind `--json`, for a named `SENTENCE_OPS` op (checked against the daemon's case), or named debt (`TEXT_DEBT`, `CONDUCTOR_DEBT`, `REFUSAL_FALLBACK`). A list entry with no matching site fails, so the lists only shrink. Add a command's `--json` branch or renderer; never add a list entry to make a new print pass. Per-command output tests (`test/task-output.test.ts`, `test/sdlc-output.test.ts`) run the real CLI against a fake control server and assert default not JSON, `--json` byte equality, 80 and 200 columns and `--color=never`.
68
68
  - Hard-coded values inventory (#719, #1180, `scripts/inventory-hardcoded-values.ts --check`, a once-only step of `scripts/check.sh`): a constant or inline literal you add to `src/` or `scripts/` is an inventory entry, and the gate fails until it is classified in `scripts/inventory-hardcoded-values.classifications.json` (`operational`, `safety floor`, `contract` or `test seam`, by the reasons of `docs/verification/2026-10-30-operational-settings-closure.md`). Never add a key to `scripts/inventory-hardcoded-values.baseline.json`: it is the list of keys that were unclassified when the check began and it only shrinks. Classify a baseline key by adding it to the classifications file and deleting it from the baseline in the same commit; the check refuses either half alone. For `src/hub` bounds and truncations, apply the committed conventions and rulings in `docs/verification/2026-11-05-hardcoded-values-classification-rules.md` (#739/#741). Before each batch, run a fresh blind sample of 80 already-decided entries and proceed only at 85% agreement or more. Outside that settled slice, a baseline key needs a calibrated mechanical rule that the committed file agrees with on at least 94% of its decided keys; leave an undecided shape in the baseline pending a ruling, never guess its label. Do not classify keys in bulk from reading the code: a blind pass agreed with the committed file on 58% of a sample, because the file counts hub-internal caps, injected `opts.x ?? N` defaults and script deadlines as operational (`docs/verification/2026-11-05-hardcoded-values-ratchet.md`). A line moved inside a file changes no key; a changed value or name does. After adding keys to the classifications file, keep it sorted by key in codepoint order (a key appended at the end breaks `test/inventory-hardcoded-values.test.ts`, which `--check` does not catch) and run that test. Seen on hub task 992 (PR #1544) and hub task 991 (PR #1548), 2026-11-17.
69
+ - Unused exports (#1649, `scripts/unused-exports.ts --check`, a once-only step of `scripts/check.sh` after the inventory): an export of `src/` that no other file imports, or that only `test/` and `src/adapters/conformance/` import, fails the gate unless it is in `scripts/unused-exports.baseline.json`, and that file only shrinks: delete the export and its key together, and a baseline key that is imported now or gone must leave it in the same commit. Entry points are a contract, not a use: every target of `package.json` `bin` and `exports` (a `.js` target is its `.ts` source) and the three files `scripts/build.mjs` bundles by name are never findings. A name reached only through a string is declared with `// used-by: <repo-relative file>` above the declaration, and the check fails if that file does not exist. `import * as`, `export * from` and a literal `import(…)` count a whole module as used. The program is built with `types: []` in about 2 s, and adding a once-only step means editing three step lists in `test/macos-shard.test.ts` (`ONCE` and both ordered lists), or the shard tests fail. Seen on hub task 1093 (PR #1673), 2026-11-24.
70
+ - CLI output inventory (#1654 T4, `bun scripts/cli-output-inventory.ts --check`, the once-only step after unused exports): a change to help text, the dispatch table, an adapter's CLI entry or a renderer that ages `docs/design/cli-output-inventory.md` fails the gate. Regenerate it with `bun scripts/cli-output-inventory.ts --write` in the same commit; never edit the table by hand.
71
+ - Refusal continuations (#1643, `bun scripts/refusal-inventory.ts --check`, the once-only step after the CLI output inventory): a `new PreEffectToolRefusal`, a `new HandoffRefusal` or a `fail(...)` in `src/cli/main.ts` with static text names a runnable continuation (an `ahub` command with flags its help lists, or a declared `hub_*` tool), or carries `// refusal:by-design operator-knowledge|world-action|human-authority: <reason>` on the line above. `scripts/refusal-inventory.baseline.json` only shrinks: never add a `missing` key, remove a key when its message is fixed or gone, lower `dynamicCeiling` when fully dynamic sites fall, and give a new dynamic refusal a static fragment with a continuation instead of raising it. An unknown command, flag or tool fails even on a baselined site (`docs/design/refusal-inventory.md`).
@@ -42,6 +42,9 @@
42
42
  "peers.<id>.needsReview": { "type": "count", "presence": "when nonzero; absent when zero" },
43
43
  "peers.<id>.pullOnly": { "type": "true", "presence": "when the peer reads messages only through hub_inbox; absent otherwise" },
44
44
  "peers.<id>.paused": { "type": "prefixed", "presence": "when paused; absent otherwise", "values": ["manual"], "prefixes": ["budget: "] },
45
+ "peers.<id>.detached": { "type": "object", "presence": "when a server the hub did not start serves that peer's socket; absent otherwise" },
46
+ "peers.<id>.detached.cause": { "type": "string", "presence": "with peers.<id>.detached" },
47
+ "peers.<id>.detached.command": { "type": "string", "presence": "with peers.<id>.detached; the exact command that puts the peer back under the hub" },
45
48
  "needs": { "type": "object", "presence": "always" },
46
49
  "needs.act": { "type": "count", "presence": "always" },
47
50
  "needs.watch": { "type": "count", "presence": "always" },
@@ -37,3 +37,12 @@
37
37
  - Hardlink identity refusal precedes path matching for managed writes, including an already protected original. This keeps the refusal stable across platform-specific real-path alias choices; read access and policy-off behavior remain unchanged.
38
38
  - The local worker's opt-in `doc_read` tool (`local.doc_read`, machine-local, off by default) reads a PDF, DOCX or HWPX document through the project's `text_projection` converters. A document under `pii.paths`, or whose text matches `signals.pii_patterns`, is refused to an ordinary turn and readable in a PII task turn. `data.readonly` does not block it (it only reads), the result is bounded and passed through `sanitize()`, and it is never captured to memory.
39
39
  - The local worker's opt-in `web_fetch` tool (`local.web_fetch.allow`, machine-local, off by default) is the one place a model's own request can leave the machine, so it is refused for the whole turn of a PII task, whatever the host: the URL or a query could carry PII to the web, and `pii.paths` and `sanitize()` cover what comes back, not what goes out. In an ordinary turn it reaches only the hosts the person listed, over https, through its own egress proxy (never the shell's), as a bare GET with no header or body from the model, re-checking every redirect. What it returns is bounded text passed through `sanitize()`, and neither the page nor the URL is captured to memory.
40
+
41
+ ## Derived peer activity
42
+
43
+ Live console status may include a busy peer's current activity kind and start
44
+ time. The hub derives the kind from a closed native-tool category, without using
45
+ command text, file paths, URLs or tool arguments. Private and PII turns omit the
46
+ field. The value lives only in daemon memory for the current turn and is cleared
47
+ on turn end, reset or adapter replacement. Activity is never written to the
48
+ database, event journal, log, snapshot, envelope, memory capture or prompt.
@@ -279,6 +279,13 @@ fake app-server fixtures.
279
279
 
280
280
  ## Observed turn model (#1402)
281
281
 
282
+ An optional `PeerAdapter.onActivity` callback reports a closed category for the
283
+ current native tool start. Codex, the ACP family and the local worker classify
284
+ only the native item or tool kind and configured server identity. The bus binds
285
+ the callback to the current owner and clears it on lifecycle transitions. The
286
+ daemon suppresses private and PII activity and exposes the remaining row only
287
+ on explicit live console status. Events, snapshots and prompts never carry it.
288
+
282
289
  An adapter may implement `PeerAdapter.observedModel()`: the model its native surface reported for the turn that just ended, as `{ model, evidence }`. The daemon reads it once, when it writes the peer's `turn_end`, and passes it through `turnModelFields`: the event carries `model` (the id exactly as reported, through `safeModelLabel`) and `modelEvidence` (`served`, `session` or `configured`, strongest first) or neither. A label `safeModelLabel` refuses is dropped whole, never truncated, and an alias (`opus`, `default`) is never expanded. An adapter that reports nothing, or throws, records nothing: unknown stays unknown. Codex and Claude print are wired (#1402 T2); the others (ACP peers, Pi, Antigravity) by the later tasks of #1402. Codex: the model in the `thread/start` or `thread/resume` reply, or the model the hub or the TUI started a turn with once Codex accepted it, is `session`; a `model/rerouted` notification names the model it moved the running turn to, `served` for that turn only. Neither reply nor `turn/start` carries a per-response model, so Codex is never `served` unless it said so (schema of codex-cli 0.167.2). Claude print (reviewer and implementer): the `modelUsage` keys of the `result` row are `served`; several keys name the one with strictly more usage tokens, and a tie or a breakdown with no counts names none (`src/adapters/print-result-model.ts`). Claude channel and TUI sessions are unchanged (their transcript usage already carries `servedModel`). research builds `ownerModels` from the owner's turns only (`docs/research.md`).
283
290
 
284
291
  ACP peers (Qwen, Jcode, headless Kimi; #1402 T3) report the session's current model as `session` evidence, whatever the override policy (`src/adapters/acp-session-model.ts`). The id is read from `models.currentModelId` or the `model` select's `currentValue` of the `session/new` or `session/load` result, and moved by `current_model_update`, `config_option_update` and Qwen's `session/model-update` notices for the current session only. It is the value when the turn's prompt was sent, read once at the turn end, so a change that arrives mid-turn belongs to the next one. Qwen's `id(openai)` wire id goes through its receipt codec; an id `safeModelLabel` refuses, the placeholder `unknown` or an absent field names no model. This is the agent's own current model, not a per-response one, so it is never `served`.
@@ -369,6 +376,13 @@ boundary, never prompts or credentials. A future native turn id is not invented;
369
376
 
370
377
  ## Compatibility and external modules
371
378
 
379
+ Configured print peers (#1515) use the machine-local adapter catalog and a
380
+ whole-output version pin. Each public advisory delivery runs one child through
381
+ the owned print runner inside the read-only hub sandbox. The host caps stdout,
382
+ reports failure with a screened stderr tail, and denies task ownership and
383
+ verdict authority even when the declaration lists the `reviewer` role. A print
384
+ declaration has no MCP channel, session resume, quota reader or context reader.
385
+
372
386
  Native CLI compatibility is centralized in `compat.ts`. Each gated operation asks that policy for a verified, in-contract, person-trusted, or refused result; person trust for one exact version does not skip a separate isolation or runtime proof. This lets upstream versions change without turning an untested protocol assumption into support ([#691](https://github.com/STAIxBWLB/agent-hub/issues/691)).
373
387
 
374
388
  External adapter modules are an explicit, person-owned, machine-local opt-in. The daemon verifies and pins the captured bundle at startup, then admits only the bounded headless ACP instance contract through host-managed launch and current-owner checks. Module code runs in the daemon trust domain; pinning is integrity evidence, not a sandbox. Modules cannot supply native reviewer engines, proof ports, permission callbacks, provider selectors, or arbitrary recovery authority. This ceiling limits what imported code can claim and prevents live reload from replacing the executable catalog ([#754](https://github.com/STAIxBWLB/agent-hub/issues/754)).