@staix/agent-hub 0.51.0 → 0.52.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 (299) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/README.md +1 -1
  3. package/docs/adding-an-ai-tool.md +24 -2
  4. package/docs/agent-notes/adapters.md +1 -0
  5. package/docs/agent-notes/budget.md +8 -2
  6. package/docs/agent-notes/daemon.md +13 -8
  7. package/docs/agent-notes/security-review.md +6 -5
  8. package/docs/agent-notes/tasks.md +5 -2
  9. package/docs/agent-notes/tests.md +4 -3
  10. package/docs/cooperbench.md +1 -1
  11. package/docs/design/adapters.md +4 -0
  12. package/docs/design/cli-output-inventory.md +162 -152
  13. package/docs/design/cli-output.md +4 -3
  14. package/docs/design/guidance-probes.md +1 -0
  15. package/docs/design/roadmap.md +2 -0
  16. package/docs/design/task-board.md +1 -0
  17. package/docs/dogfood.md +14 -0
  18. package/docs/events.md +4 -2
  19. package/docs/memory.md +5 -3
  20. package/docs/operations.md +210 -16
  21. package/docs/quickstart.md +12 -2
  22. package/docs/roles.md +1 -1
  23. package/docs/sdlc.md +26 -3
  24. package/docs/security.md +11 -5
  25. package/docs/specs/2026-09-19-agent-hub-design.md +43 -0
  26. package/docs/specs/2026-09-19-multi-project-design.md +4 -0
  27. package/docs/specs/2026-09-20-upgrade-recovery-design.md +17 -0
  28. package/docs/specs/mcp-endpoint.md +63 -0
  29. package/docs/verification/2026-11-30-capability-listing-shape-1808.md +45 -0
  30. package/docs/verification/2026-11-30-upgrade-keep-1807.md +174 -0
  31. package/docs/verification/2026-12-01-1811-confirmation-receipt.md +19 -0
  32. package/docs/verification/2026-12-01-1811-orca-agent-list.md +20 -0
  33. package/docs/verification/2026-12-01-1811-orca-pane-key.md +21 -0
  34. package/docs/verification/2026-12-02-1819-claude-process-after-renewal.md +54 -0
  35. package/docs/verification/2026-12-02-agy-1.5.21.md +74 -0
  36. package/docs/verification/2026-12-02-claude-implementer-2.1.334.md +44 -0
  37. package/docs/verification/2026-12-02-cli-import-graph.md +33 -0
  38. package/docs/verification/2026-12-03-0.52.0.md +150 -0
  39. package/docs/verification/2026-12-03-codex-0173-reviewer-isolation.md +53 -0
  40. package/docs/verification/2026-12-03-codex-0173-reviewer-tool-call.md +34 -0
  41. package/docs/verification/2026-12-03-jcode-1.3.0.md +25 -0
  42. package/docs/verification/agy/README.md +17 -0
  43. package/docs/verification/agy/cli-surface.ts +68 -0
  44. package/docs/verification/agy/interactive-bridge.ts +92 -0
  45. package/docs/verification/agy/interactive-session.ts +131 -0
  46. package/docs/verification/agy/launcher-nonce.ts +215 -0
  47. package/docs/verification/agy/native-hooks.ts +210 -0
  48. package/docs/verification/agy/originals/agent-hub-681/cli-surface.ts +87 -0
  49. package/docs/verification/agy/originals/agent-hub-681/native-hooks-adapted.ts +91 -0
  50. package/docs/verification/agy/originals/agent-hub-681/tui-actual.ts +200 -0
  51. package/docs/verification/agy/originals/agent-hub-684/probe.ts +107 -0
  52. package/docs/verification/agy/originals.json +25 -0
  53. package/docs/verification/agy/permission-new-functions.ts +128 -0
  54. package/docs/verification/agy/run-probe.py +108 -0
  55. package/docs/verification/agy/runtime.ts +171 -0
  56. package/docs/verification/agy/tmux-helper-control.ts +6 -0
  57. package/docs/verification/agy/tmux-session.ts +235 -0
  58. package/docs/verified.json +82 -41
  59. package/package.json +3 -3
  60. package/plugins/agent-hub/.claude-plugin/plugin.json +1 -1
  61. package/plugins/agent-hub/compat.json +157 -0
  62. package/plugins/agent-hub/kimi-hook.js +621 -865
  63. package/plugins/agent-hub/server.js +17423 -32962
  64. package/src/adapters/agy/definition.ts +7 -24
  65. package/src/adapters/channel-peer.ts +3 -1
  66. package/src/adapters/claude-channel.ts +38 -257
  67. package/src/adapters/claude-implementer.ts +3 -1
  68. package/src/adapters/codex-appserver.ts +77 -15
  69. package/src/adapters/compat.ts +74 -11
  70. package/src/adapters/configured-acp.ts +23 -163
  71. package/src/adapters/configured-adapter-policy.ts +160 -0
  72. package/src/adapters/configured-pull-entry.ts +53 -0
  73. package/src/adapters/configured-pull.ts +38 -0
  74. package/src/adapters/conformance/fakes/app-server.ts +9 -2
  75. package/src/adapters/declaration-catalog.ts +25 -0
  76. package/src/adapters/declaration-data.ts +342 -0
  77. package/src/adapters/declaration-resolution.ts +53 -0
  78. package/src/adapters/definitions/builtin-metadata.ts +61 -83
  79. package/src/adapters/definitions/jcode-launch.ts +13 -0
  80. package/src/adapters/definitions/native-adapter-policy.ts +390 -0
  81. package/src/adapters/definitions/native-cli-claude-launch.ts +3 -2
  82. package/src/adapters/definitions/native-cli-codex-launch.ts +2 -1
  83. package/src/adapters/definitions/native-cli-entry-jcode.ts +4 -2
  84. package/src/adapters/definitions/native-cli-entry-types.ts +9 -2
  85. package/src/adapters/definitions/native-cli-launch-common.ts +2 -2
  86. package/src/adapters/definitions/native-cli-retained.ts +1 -1
  87. package/src/adapters/definitions/native-configuration.ts +18 -0
  88. package/src/adapters/definitions/native-help.ts +24 -0
  89. package/src/adapters/definitions/native-launch-declarations.ts +34 -0
  90. package/src/adapters/definitions/native-launch-policy.ts +4 -0
  91. package/src/adapters/definitions/native-launch-settings.ts +72 -0
  92. package/src/adapters/definitions/native-light-cli.ts +18 -0
  93. package/src/adapters/definitions/native-light-preview.ts +10 -0
  94. package/src/adapters/definitions/native-wrapper-launch.ts +10 -0
  95. package/src/adapters/definitions/qwen.ts +6 -29
  96. package/src/adapters/definitions/reviewer-variants.ts +7 -8
  97. package/src/adapters/external-declarations.ts +31 -0
  98. package/src/adapters/external-modules.ts +4 -29
  99. package/src/adapters/jcode.ts +3 -12
  100. package/src/adapters/native-capabilities.ts +18 -8
  101. package/src/adapters/native-proof-ports.ts +1 -1
  102. package/src/adapters/presets.ts +136 -0
  103. package/src/adapters/qwen-dual.ts +2 -2
  104. package/src/adapters/registry-types.ts +3 -0
  105. package/src/adapters/registry.ts +20 -81
  106. package/src/adapters/reviewer-print.ts +26 -9
  107. package/src/adapters/role-eligibility.ts +2 -1
  108. package/src/cli/accounts-import.ts +72 -0
  109. package/src/cli/agents-latest-table.ts +88 -0
  110. package/src/cli/agents-latest.ts +22 -0
  111. package/src/cli/agents-output.ts +10 -0
  112. package/src/cli/agents-presets.ts +100 -0
  113. package/src/cli/agents.ts +1 -1
  114. package/src/cli/attention.ts +3 -2
  115. package/src/cli/autonomy-homes.ts +7 -2
  116. package/src/cli/budget-renew-guidance.ts +129 -0
  117. package/src/cli/claude-homes.ts +9 -5
  118. package/src/cli/command-context.ts +3 -0
  119. package/src/cli/command-table.ts +123 -0
  120. package/src/cli/commands/accounts.ts +8 -0
  121. package/src/cli/commands/agents.ts +18 -0
  122. package/src/cli/commands/answer.ts +28 -0
  123. package/src/cli/commands/ask.ts +17 -0
  124. package/src/cli/commands/autonomy.ts +83 -0
  125. package/src/cli/commands/backlog.ts +46 -0
  126. package/src/cli/commands/bench.ts +60 -0
  127. package/src/cli/commands/board.ts +48 -0
  128. package/src/cli/commands/broker.ts +9 -0
  129. package/src/cli/commands/budget.ts +96 -0
  130. package/src/cli/commands/capabilities.ts +12 -0
  131. package/src/cli/commands/check-path.ts +55 -0
  132. package/src/cli/commands/completion.ts +8 -0
  133. package/src/cli/commands/console.ts +12 -0
  134. package/src/cli/commands/daemon.ts +8 -0
  135. package/src/cli/commands/deliverables.ts +25 -0
  136. package/src/cli/commands/doctor.ts +249 -0
  137. package/src/cli/commands/down.ts +3 -0
  138. package/src/cli/commands/export.ts +15 -0
  139. package/src/cli/commands/facts.ts +15 -0
  140. package/src/cli/commands/goal.ts +22 -0
  141. package/src/cli/commands/guidance.ts +102 -0
  142. package/src/cli/commands/help.ts +17 -0
  143. package/src/cli/commands/host.ts +45 -0
  144. package/src/cli/commands/init.ts +121 -0
  145. package/src/cli/commands/instructed.ts +19 -0
  146. package/src/cli/commands/instruction-hook.ts +15 -0
  147. package/src/cli/commands/intake.ts +24 -0
  148. package/src/cli/commands/kill.ts +15 -0
  149. package/src/cli/commands/learn.ts +23 -0
  150. package/src/cli/commands/lineage.ts +30 -0
  151. package/src/cli/commands/logs.ts +21 -0
  152. package/src/cli/commands/manager.ts +15 -0
  153. package/src/cli/commands/memory.ts +21 -0
  154. package/src/cli/commands/model.ts +25 -0
  155. package/src/cli/commands/models.ts +40 -0
  156. package/src/cli/commands/native.ts +39 -0
  157. package/src/cli/commands/pause.ts +5 -0
  158. package/src/cli/commands/peer.ts +32 -0
  159. package/src/cli/commands/permission.ts +26 -0
  160. package/src/cli/commands/permit.ts +12 -0
  161. package/src/cli/commands/pet.ts +24 -0
  162. package/src/cli/commands/projects.ts +49 -0
  163. package/src/cli/commands/queue.ts +70 -0
  164. package/src/cli/commands/recovery-run.ts +13 -0
  165. package/src/cli/commands/recovery.ts +130 -0
  166. package/src/cli/commands/release.ts +23 -0
  167. package/src/cli/commands/releases.ts +9 -0
  168. package/src/cli/commands/remember.ts +6 -0
  169. package/src/cli/commands/report.ts +27 -0
  170. package/src/cli/commands/research.ts +53 -0
  171. package/src/cli/commands/reset.ts +89 -0
  172. package/src/cli/commands/restart.ts +5 -0
  173. package/src/cli/commands/results.ts +31 -0
  174. package/src/cli/commands/resume.ts +5 -0
  175. package/src/cli/commands/review.ts +24 -0
  176. package/src/cli/commands/roadmap.ts +21 -0
  177. package/src/cli/commands/role.ts +34 -0
  178. package/src/cli/commands/roles.ts +30 -0
  179. package/src/cli/commands/room.ts +14 -0
  180. package/src/cli/commands/roster.ts +48 -0
  181. package/src/cli/commands/route.ts +9 -0
  182. package/src/cli/commands/say.ts +21 -0
  183. package/src/cli/commands/schedule.ts +17 -0
  184. package/src/cli/commands/sdlc.ts +321 -0
  185. package/src/cli/commands/settings.ts +148 -0
  186. package/src/cli/commands/setup.ts +89 -0
  187. package/src/cli/commands/shared-refusals.ts +25 -0
  188. package/src/cli/commands/smoke.ts +44 -0
  189. package/src/cli/commands/source.ts +64 -0
  190. package/src/cli/commands/specs.ts +13 -0
  191. package/src/cli/commands/status.ts +28 -0
  192. package/src/cli/commands/stop.ts +17 -0
  193. package/src/cli/commands/structure.ts +60 -0
  194. package/src/cli/commands/study.ts +39 -0
  195. package/src/cli/commands/tail.ts +19 -0
  196. package/src/cli/commands/task.ts +114 -0
  197. package/src/cli/commands/title.ts +17 -0
  198. package/src/cli/commands/turns.ts +10 -0
  199. package/src/cli/commands/ui.ts +47 -0
  200. package/src/cli/commands/undo.ts +77 -0
  201. package/src/cli/commands/up.ts +39 -0
  202. package/src/cli/commands/upgrade.ts +5 -0
  203. package/src/cli/commands/usage.ts +33 -0
  204. package/src/cli/commands/version.ts +5 -0
  205. package/src/cli/commands/watch.ts +30 -0
  206. package/src/cli/commands/worktrees.ts +31 -0
  207. package/src/cli/console-state.ts +5 -138
  208. package/src/cli/console-versions.ts +1 -1
  209. package/src/cli/help.ts +37 -15
  210. package/src/cli/identity.ts +23 -4
  211. package/src/cli/launch-check.ts +1 -2
  212. package/src/cli/launch.ts +13 -82
  213. package/src/cli/light-dispatch.ts +29 -0
  214. package/src/cli/main.js +8 -1
  215. package/src/cli/main.ts +233 -2816
  216. package/src/cli/orca-probe.ts +119 -0
  217. package/src/cli/output.ts +31 -2
  218. package/src/cli/preview.ts +10 -5
  219. package/src/cli/recovery-version-preflight.ts +28 -9
  220. package/src/cli/replace-process.ts +22 -0
  221. package/src/cli/report-layout.ts +142 -0
  222. package/src/cli/roadmap-usage.ts +16 -0
  223. package/src/cli/roadmap.ts +3 -16
  224. package/src/cli/sdlc-doctor.ts +27 -0
  225. package/src/cli/sdlc-output.ts +55 -1
  226. package/src/cli/setup-homes.ts +1 -1
  227. package/src/cli/start-agents-run.ts +1 -1
  228. package/src/cli/statusline-tee.ts +25 -4
  229. package/src/cli/terminal-recovery.ts +53 -10
  230. package/src/cli/upgrade-interactive.ts +1 -0
  231. package/src/cli/upgrade-runtime.ts +11 -0
  232. package/src/cli/upgrade.ts +4 -15
  233. package/src/hub/accounts.ts +148 -0
  234. package/src/hub/addons.ts +20 -0
  235. package/src/hub/agent-drift.ts +2 -1
  236. package/src/hub/budget-projection.ts +39 -7
  237. package/src/hub/budget.ts +231 -16
  238. package/src/hub/channel-project.ts +3 -3
  239. package/src/hub/conductor-peer.ts +24 -0
  240. package/src/hub/conductor.ts +2 -21
  241. package/src/hub/config-apply.ts +24 -13
  242. package/src/hub/config-edit.ts +1 -1
  243. package/src/hub/config-tier.ts +2 -0
  244. package/src/hub/config.ts +31 -14
  245. package/src/hub/control-client.ts +48 -0
  246. package/src/hub/daemon.ts +421 -61
  247. package/src/hub/events.ts +3 -0
  248. package/src/hub/home-tag.ts +12 -0
  249. package/src/hub/host.ts +217 -0
  250. package/src/hub/hub-tools.ts +2 -1
  251. package/src/hub/instance-budget.ts +2 -2
  252. package/src/hub/instance-config.ts +15 -126
  253. package/src/hub/instances.ts +22 -6
  254. package/src/hub/instruction-receipt.ts +2 -2
  255. package/src/hub/kimi-usage.ts +38 -11
  256. package/src/hub/lifecycle.ts +86 -4
  257. package/src/hub/mcp-bridge-core.ts +98 -0
  258. package/src/hub/mcp-channel-push.ts +20 -0
  259. package/src/hub/mcp-endpoint-serve.ts +178 -0
  260. package/src/hub/mcp-endpoint.ts +226 -0
  261. package/src/hub/mcp-tool-call.ts +181 -0
  262. package/src/hub/operational-settings.ts +2 -0
  263. package/src/hub/orca-env.ts +6 -0
  264. package/src/hub/orca-state.ts +84 -0
  265. package/src/hub/peers.ts +5 -1
  266. package/src/hub/permission-mode.ts +2 -1
  267. package/src/hub/project.ts +20 -0
  268. package/src/hub/protocol-window.ts +58 -0
  269. package/src/hub/quota-origin.ts +20 -0
  270. package/src/hub/registry.ts +36 -2
  271. package/src/hub/report.ts +1 -1
  272. package/src/hub/research.ts +1 -1
  273. package/src/hub/review-brief.ts +47 -2
  274. package/src/hub/roster.ts +6 -3
  275. package/src/hub/routing.ts +9 -2
  276. package/src/hub/sdlc-check.ts +205 -0
  277. package/src/hub/sdlc-sync.ts +146 -0
  278. package/src/hub/sdlc.ts +33 -4
  279. package/src/hub/settings.ts +7 -4
  280. package/src/hub/start-agents.ts +1 -1
  281. package/src/hub/start-mode.ts +11 -4
  282. package/src/hub/structure-budget.ts +131 -0
  283. package/src/hub/structure-scan.ts +149 -0
  284. package/src/hub/tasks-experiment.ts +455 -0
  285. package/src/hub/tasks-guidance.ts +606 -0
  286. package/src/hub/tasks-roadmap-plan.ts +419 -0
  287. package/src/hub/tasks-roadmap.ts +491 -0
  288. package/src/hub/tasks-study.ts +661 -0
  289. package/src/hub/tasks-survey.ts +192 -0
  290. package/src/hub/tasks.ts +319 -2548
  291. package/src/hub/terminal-open.ts +5 -3
  292. package/src/hub/tooling.ts +3 -19
  293. package/src/hub/usage-rollup.ts +9 -3
  294. package/src/local/tools.ts +5 -0
  295. package/src/ui/index.html +1 -1
  296. package/src/ui/needs.ts +17 -5
  297. package/src/ui/peer-palette.ts +2 -4
  298. package/templates/presets/agents.json +60 -0
  299. package/templates/presets/confirmation-matrix.json +8 -8
@@ -18,7 +18,7 @@ Or use the matching GitHub release:
18
18
 
19
19
  <!-- facts:install-tag -->
20
20
  ```bash
21
- bun add -g github:STAIxBWLB/agent-hub#v0.51.0
21
+ bun add -g github:STAIxBWLB/agent-hub#v0.52.0
22
22
  ahub setup
23
23
  ```
24
24
  <!-- /facts:install-tag -->
@@ -59,6 +59,16 @@ A project whose hub is stopped is upgraded without starting it: `ahub upgrade
59
59
  --all-stopped --to <version>` does that for every stopped project at once
60
60
  (`--dry-run` lists each one first).
61
61
 
62
+ ## Upgrading to 0.52.0
63
+
64
+ Most of what is new waits until you use it: `ahub sdlc check`, `ahub sdlc sync` and the unsettled-task view of `ahub sdlc status`, `ahub structure check`, `ahub agents presets` and `ahub agents add`, `ahub accounts import --from orca`, declared accounts, and the shared host (`host.shared`, off by default). Quota renewal now clears stale readings and warns before exhaustion, and a peer waiting in a blocked Orca pane raises an Attention item with the `orca terminal switch` command.
65
+
66
+ **Do not add the new settings until every hub that reads the file runs 0.52.0:** a 0.51.0 hub refuses to start with `[structure]` in `.agenthub/sdlc.toml`, or with `accounts`, `instances.<id>.account`, `host.shared`, `upgrade.bridge_window_days`, `upgrade.bridge_window_min` or a `transport: "pull"` kind in `.agenthub/config.local.json`.
67
+
68
+ The memory library resolves agent-mem 0.47.0 (declared range `>=0.47.0 <1.0.0`); store and sync formats do not change. On a home with active per-row sync placement, the new package bytes change the attested writer inventory, so sync reports the `writer` cause until a person renews it with `amem migrate --sync-placement` (see [automatic sync health](memory.md#automatic-sync-health-1173)). Release N-1 for 0.52.x is 0.51.0.
69
+
70
+ `ahub upgrade` does not update the global CLI or the shared Claude plugin: run `bun add -g @staix/agent-hub@0.52.0` and then `ahub setup` yourself, and `ahub doctor` warns while either is older than a running daemon.
71
+
62
72
  ## Upgrading to 0.51.0
63
73
 
64
74
  **Restart Claude sessions that were started by 0.49.0, 0.49.1 or 0.50.0.** Those versions put a generated session ID ahead of the channel flag, so `ahub claude` could attach `tools-only`: the session worked, but hub messages waited until it called `hub_inbox` (#1794). 0.51.0 puts the flag first again. A session that is already running keeps its old arguments, and upgrading the hub does not change them. In each project, `ahub status` now lists such a session under Attention. Exit that Claude session and start it again with `ahub claude` in the same project. `ahub claude --continue` continues the latest conversation there.
@@ -597,7 +607,7 @@ More: `ahub help`. How it is built and why: [`docs/specs/2026-09-19-agent-hub-de
597
607
 
598
608
  ## Shared memory
599
609
 
600
- The hub accepts the first-party `@staix/agent-mem` <!-- facts:agent-mem-pin -->>=0.42.0 <1.0.0<!-- /facts:agent-mem-pin --> core as a range below the next major: a plain release inside it with a supported host API needs no hub release, and the lockfile resolves one release. That includes deterministic capture; no claude-mem worker is needed. Existing shared-v1 memory remains the default; upgrading does not migrate it. Managed agents use screened `hub_memory_search`, `hub_memory_show` and `hub_memory_graph` tools, or propose a correction with `hub_memory_correct`; only a person accepts candidates through the supported `amem review` path. Since agent-mem 0.7.0, `amem review` also accepts candidates on a selected generation.
610
+ The hub accepts the first-party `@staix/agent-mem` <!-- facts:agent-mem-pin -->>=0.47.0 <1.0.0<!-- /facts:agent-mem-pin --> core as a range below the next major: a plain release inside it with a supported host API needs no hub release, and the lockfile resolves one release. That includes deterministic capture; no claude-mem worker is needed. Existing shared-v1 memory remains the default; upgrading does not migrate it. Managed agents use screened `hub_memory_search`, `hub_memory_show` and `hub_memory_graph` tools, or propose a correction with `hub_memory_correct`; only a person accepts candidates through the supported `amem review` path. Since agent-mem 0.7.0, `amem review` also accepts candidates on a selected generation.
601
611
 
602
612
  Before any real generation migration, upgrade every hub sharing that memory home to 0.12.30 or later and check its authenticated binding with `ahub memory profile-check` in each custom registry. Ready bindings prove compatibility, not an atomic live cutover: quiesce consumers and close their handles before migrating, then reopen through the supported session-preserving lifecycle. Invalid or changed profiles disable native memory without falling back to legacy writes; the bus and board continue. See [memory operations](operations.md#hub-memory) for the remaining rollout gates.
603
613
 
package/docs/roles.md CHANGED
@@ -124,7 +124,7 @@ Baseline reconciliation, 2026-10-13: ROLE_TEXT and roleContract source blocks
124
124
  are byte-identical at original1cbbc57 and laterd83cb8dd; the latter changes only
125
125
  default role construction to the peer catalog. The five original rendered
126
126
  contracts match both fixtures. A new independent original-baseline assertion
127
- retains the existingd83 assertion unchanged. Assignment-notice byte comparison
127
+ retains the existing d83cb8dd assertion unchanged. Assignment-notice byte comparison
128
128
  is separately verified by the five-peer fixture; role strings alone still do
129
129
  not establish native consumption. Native/visual consumption and role-effect
130
130
  measurement remain unverified.
package/docs/sdlc.md CHANGED
@@ -34,7 +34,7 @@ file through `ahub settings edit sdlc.toml` and restart to apply it.
34
34
 
35
35
  ## Authority and evidence
36
36
 
37
- The issue remains the specification, Tasks remains the sole task mutation boundary, and GitHub remains authoritative for PR heads, required checks, merge commits and releases. The hub stores artifact identities and bounded structured readbacks, never issue/PR bodies. Off is the default. Advise exposes blockers without changing task transitions. Enforce blocks the build-entry and review/approval transitions listed below; it never releases, edits GitHub or gives a peer additional capabilities. The one GitHub write is the guarded merge of an approved task (#786, below), off by default.
37
+ The issue remains the specification, Tasks remains the sole task mutation boundary, and GitHub remains authoritative for PR heads, required checks, merge commits and releases. The hub stores artifact identities and bounded structured readbacks, never issue/PR bodies. Off is the default. Advise exposes blockers without changing task transitions. Enforce blocks the build-entry and review/approval transitions listed below; it never releases, edits GitHub or gives a peer additional capabilities. The GitHub writes are the guarded merge of an approved task (#786, below), off by default, and the issue closes that `ahub sdlc sync --close-settled-issues --apply` makes (#1856, below).
38
38
 
39
39
  A reviewed head is a full lowercase 40-character SHA observed through a successful readback, not an implementer-supplied statement. A check is evidence only for that same head. Unknown/missing required checks, unavailable GitHub, pending reviews or unresolved threads remain blockers in enforce and visible unknowns in advise. A newer head invalidates the derived review and approval readiness. Historical task approval is retained as history, not presented as approval of the new commit. Revalidate after asynchronous readbacks immediately before any board write.
40
40
 
@@ -163,7 +163,7 @@ A reviewer records the head it actually reviewed. If GitHub no longer reports th
163
163
 
164
164
  ## Readbacks and presentation
165
165
 
166
- Use structured gh JSON/GraphQL read-only calls (the guarded merge below is the one exception) with validated repository and numeric artifact identities. No shell interpolation, PR/issue body fetching, token logging or unbounded comment storage. Failure yields unknown. Required checks come from repository rules or explicitly configured names; an empty/unknown set is not silently green. Review-thread status is counted, not copied. Cancellation and task-owner generation fencing prevent a late read from approving reassigned work.
166
+ Use structured gh JSON/GraphQL read-only calls (the guarded merge and the settled-issue closes below are the exceptions) with validated repository and numeric artifact identities. No shell interpolation, PR/issue body fetching, token logging or unbounded comment storage. The one body read is the live issue body that `ahub sdlc sync --close-settled-issues` checks for an unchecked task-list item; it keeps none of it. Failure yields unknown. Required checks come from repository rules or explicitly configured names; an empty/unknown set is not silently green. Review-thread status is counted, not copied. Cancellation and task-owner generation fencing prevent a late read from approving reassigned work.
167
167
 
168
168
  GitHub may return more than one row for a named check after a rerun or cancellation. When every row has a workflow identity and start time, and those identify one uniquely newest run of the same workflow, the hub evaluates that run and drops older rows. If workflow identity or ordering is ambiguous, it retains the rows; duplicate evidence remains a blocker rather than a guessed pass. In the CI watcher, cancelled attempts and a draft PR's deferred `check (macos-latest)` read as pending so the watcher can wait for a replacement run. Review admission can accept this repository's draft head only when Ubuntu and seeded guards pass, the remaining required checks pass, and the failed macOS aggregate's exact-head job proves its draft-deferral step was the sole failure. Incomplete or stale proof remains a blocker. This is review readiness, not a successful full gate: the macOS aggregate still needs to pass for merge.
169
169
 
@@ -185,7 +185,7 @@ For `STAIxBWLB/agent-hub`, a per-project `.agenthub/sdlc.toml` may set `mode = "
185
185
 
186
186
  A person records ids and a claimed local receipt with `ahub sdlc record 12 '{"repo":"owner/repo","issue":109,"pr":325,"localHead":"<full SHA>","localResult":"passed","stage":"build"}'`. Owners/reviewers have the bounded `hub_sdlc_record` tool; it accepts no remote bodies or external-check results. Only the assigned reviewer or person records a reviewed head. `ahub review 12 approved --head <full SHA>` rechecks current evidence before approval. Changes requested does not require green CI.
187
187
 
188
- `ahub sdlc status` lists bounded local projections without polling every remote PR. `ahub sdlc explain 12` or `status 12` performs a fresh structured readback, open to any agent as a public view (private tasks stay stubs), with no remote body retention. Shared console/dashboard projections explicitly show unknown external evidence; they do not certify freshness from cached data. Default task rows and contracts remain unchanged when off.
188
+ `ahub sdlc status` lists bounded local projections without polling every remote PR. With no task it lists the unsettled tasks (`proposed`, `in_progress`, `in_review`, `changes_requested`) and the tasks of a release train that is neither shipped nor dropped, at most 100, and names how many settled tasks it hides (#1856); `ahub sdlc status --all` keeps the earlier view, the first 100 tasks by id. `ahub sdlc explain 12` or `status 12` performs a fresh structured readback, open to any agent as a public view (private tasks stay stubs), with no remote body retention. Shared console/dashboard projections explicitly show unknown external evidence; they do not certify freshness from cached data. Default task rows and contracts remain unchanged when off.
189
189
 
190
190
  # Spec acceptance (#481 S1)
191
191
 
@@ -620,6 +620,15 @@ low = ["docs/**", "*.md"]
620
620
  - **Where it shows.** The review request, the review brief, the verdict's note and `hub_task_show` (as `risk`) carry one line, `risk <tier> (<n> paths decided it); minimum <what the tier owes>`, then `; verifier card <id> is approved` when the board holds one or `; no verifier card by another peer is approved at this head` when it does not. The line states what is owed; the command that supplies it belongs to the refusal, which writes its continuation where it is thrown. In `enforce` the merge gate refuses a plan whose own review asked for less than the tier's minimum, naming `hub_plan_review` as the continuation.
621
621
  - `ahub init` writes the table commented out in a newly created `sdlc.toml`, so the feature is discoverable without a project being opted in. Tier counts against rework rounds over four weeks of dogfood are the person's own follow-up.
622
622
 
623
+ ## Structure budgets (#1829)
624
+
625
+ An optional `[structure]` table in `.agenthub/sdlc.toml` caps file size under named roots and flags a declaration that repeats a name a shared module already exports. It is off when the table is absent, and every key is required and checked at load: `roots` (literal repository-relative directories), `max_lines` and `max_bytes` (positive integers), `shared` (globs of the shared modules), `baseline` (a literal path to the committed baseline JSON) and `grow` (`warn` or `refuse`). The rules are `checkStructureBudget` and `updateStructureBaseline` in `src/hub/structure-budget.ts`.
626
+
627
+ - `ahub structure check [--json]` reads only. A file over the budget with no baseline entry, a stale baseline entry, and a new shared-name repeat are findings (exit 1); a baselined file that grows past its ceiling is a warning under `grow = "warn"` and a finding under `refuse`.
628
+ - `ahub structure baseline --write` creates the first baseline for review, and afterwards only shrinks it: ceilings never rise and new entries are never added.
629
+ - When a `hub_task_propose` or `hub_task_accept` plan names a baselined file over the budget in `paths`, the tool's reply names its size against the budget, says to put new code in its own module, and lists the shared modules to search first.
630
+ - The review brief (`ahub review brief`) adds a `Structure changes:` section when the change, read against the merge base's own rules and baseline, adds an oversized file, grows a baselined one or repeats a shared name.
631
+
623
632
  ## Security audit with a coverage ledger (hub task 896, #1403 A4, A5)
624
633
 
625
634
  A recurring, read-only read of the security-sensitive surfaces, on request. It needs the lifecycle on (`advise` or `enforce`) and the `[security]` table above.
@@ -691,6 +700,8 @@ Release preparation is an agent task; the release decision remains the person's.
691
700
 
692
701
  `bun scripts/release-prepare.ts [--version X.Y.Z] [--dry-run]` is the mechanical half of AGENTS.md "Releasing" steps 1 and 2. On a `release/<version>` branch (it refuses `main`, a detached HEAD, a dirty tree and any other branch name) it reads the commits since the last `v*` tag, applies the rule (any `feat` subject bumps the minor, otherwise the patch; a version below the rule or not newer than the last tag is refused, so is a missing or empty `## Unreleased`), and writes `package.json`, the README `Status:` line, the generated doc facts (the quickstart install tag and the version pins between `<!-- facts:<name> -->` markers, rendered by `scripts/lib/readme-facts.ts`, so the release PR passes `scripts/readme-facts.ts`; `--dry-run` lists the blocks it would change, #1273), the CHANGELOG section (the Unreleased entries move under the version, Unreleased stays empty), the `Upgrading to <version>` note in `docs/quickstart.md` with the global CLI and plugin step, the bundle (`bun run build`) and a verification report skeleton `docs/verification/<date>-<version>.md`. The skeleton lists the pull requests the commits name and the native acceptance receipts, which it reads from `docs/verification/` files added since the tag, never from what an agent writes. It leaves `TODO(agent)` markers for what only a review can state: each PR's review and CI, the document review, the checks and the known gaps.
693
702
 
703
+ Update the bridge table manually in the release PR. In `src/hub/protocol-window.ts`, set the current row's latest tag to the package tag and its latest date to the planned UTC publication date. If the protocol changed, add its new row and keep earlier rows frozen. Run `bun scripts/bridge-protocol-table.ts --write`. `release-prepare` does not update these rows or regenerate this block. If publication moves to a later UTC date, correct the row and rerender before tagging. The 90-day compatibility window uses that date, so an earlier date would end support early.
704
+
694
705
  It restamps nothing by itself. A stamp in `docs/verified.json` records that someone read what changed under a document, so `bun scripts/release-prepare.ts restamp <document>... --reviewed` sets `verifiedAgainst` to HEAD for the named documents only, refuses without `--reviewed`, refuses an unnamed or unknown document and refuses with staged changes. The agent runs it per document after reading the source commits, commits `docs/verified.json`, opens the release PR and merges it with a merge commit (never squash).
695
706
 
696
707
  `bun scripts/release-tag.ts <version> [--execute]` is the one guarded tag run. Every run repeats the whole preflight and reports every refusal at once: a valid release version; `package.json`, the README Status line and a CHANGELOG section at HEAD all naming it; HEAD on `main`, clean, and the merge commit of a `release/<version>` PR (a squash is refused); HEAD an ancestor of `origin/main` (fetched, not assumed); no `v<version>` tag locally or on the remote; `scripts/check-docs.mjs --require-fresh --committed` clean; a `docs/quickstart.md` "Upgrading to <version>" section with the global CLI and plugin step and no `TODO(agent)`; and exactly one `docs/verification/<date>-<version>.md` with no `TODO(agent)` left. Without `--execute` it only reports, and whether the person's consent matches (exit 2 when it does not). With `--execute` it reads the consent through `ahub sdlc release-guard -- git push <remote> <commit>:refs/tags/v<version>` (read only; the ledger `ahub sdlc authorize-release` fills from the person or the explicitly instructed configured conductor, revoked by a hub restart), repeats the preflight, checks the commit did not move, reads the consent once more, and then makes the single push of that exact commit. A rejected push is reported and never retried, and the script passes neither `--force` nor `--no-verify`; the pre-push hook from `ahub init --release-guard` still runs on that push. The push creates a lightweight tag (`<commit>:refs/tags/v<version>`), the exact form `ahub sdlc release-guard` parses and the consent receipt binds; the repository's tags are mixed (v0.19.0 and v0.18.0 are annotated, v0.17.0 is not) and `.github/workflows/release.yml` accepts either (`v*`, then `--verify-tag`), so this is a convention difference, not a gap. If the project wants annotated release tags, create the tag object first and push the tag ref, which the guard also accepts (its source object is peeled to the commit); that is a later change to this script. `AHUB_RELEASE_ROOT` points both scripts at a checkout other than the one they live in (the tests use it so nothing outside a scratch repository is touched). Neither script calls `authorize-release`: the report only names the command; the person or the explicitly instructed configured conductor records consent separately. Publication (npm, the GitHub release) stays with the tag-triggered workflow, which has its own gate (`.github/workflows/release.yml`).
@@ -783,3 +794,15 @@ A task that reaches `approved` or `cancelled` drops its ephemeral state, and not
783
794
  - The settled results of a closed Pi session in `pi_tool_receipts` (`compactPiResult`): a new session closes the earlier ones, and a result over 2,000 characters keeps its prefix and, for a shell result, its exit code. The active session's receipts are untouched.
784
795
 
785
796
  Task rows, history, `sdlc` receipts, `usage_rollup` and `rollup_seen` are never deleted or edited. `test/terminal-compaction.test.ts` computes `sdlcMetrics`, `costMetrics`, `releaseMetrics`, the usage roll-up and the whole task rows before and after a compaction and requires them identical.
797
+
798
+ ## `ahub sdlc check` (#1856)
799
+
800
+ `ahub sdlc check [--json]` is a read-only audit with four sections: config and roles, repository and required checks, active task bindings, and roadmap hygiene. Every non-ok row names its cause and a runnable next command. Exit status is 1 only when a row fails. All GitHub reads share one 20 s deadline, and private unsettled tasks are only counted. `ahub doctor` shows one offline `sdlc` row that never calls GitHub. The `draft_deferred_checks` sub-check is omitted until that setting exists (#1823).
801
+
802
+ ## `ahub sdlc sync` (#1856)
803
+
804
+ `ahub sdlc sync [--json]` builds one deterministic plan from fresh reads under a single 30 s deadline and writes nothing. It prints the planned operations and a 64-hex SHA-256 fingerprint of the plan, the origin, the authority and every considered card's history length. Repairs: link an issue when the title names exactly one unqualified `#N` and the card records none (several are ambiguous and never guessed); bind the recorded open PR's newer head for `in_progress` and `changes_requested` cards, or, for any active card (`in_progress`, `in_review`, `changes_requested`) with no PR recorded, the one open PR matching the card's branch; adopt a merged PR whose head is the recorded one. An `in_review` card never has its reviewed head overwritten, the movement is reported. `ahub sdlc sync --apply --confirm <fingerprint>` re-runs the plan and refuses, naming the new fingerprint, on any drift before the first write. Only the person or the one configured conductor applies, and each repair is written under the real actor: `Tasks.recordSyncRepair` records the person or the conductor by name in the card's history, admits only a link (`repo`, `issue`) or a bind (`repo`, `pr`, `localHead`), and never relinks an established repository, issue or PR; adoptions go through `Tasks.adoptMerge` and still pass its own gates. The branch match reads the card's `refs.branch` only, not the instance worktree branch. Verdicts that belong to the person (accept, accept-departure, authorize-release, mode enforce, roadmap done or dropped) are never written. Private tasks are only counted.
805
+
806
+ ### Opt-in sync actions (#1856 T4)
807
+
808
+ `ahub sdlc sync --write-roadmap` adds a roadmap refresh to the plan when `docs/roadmap.json` or `docs/roadmap.md` is tracked in the caller's worktree; the plan carries a digest of the rendering, so a changed roadmap changes the fingerprint, and apply writes the two files in that worktree through the same guarded writer as `ahub roadmap export --write`. `ahub sdlc sync --close-settled-issues` is admitted only under roadmap apply authority (the person, or the unique conductor when `roadmap.github_write = "conductor"`); without it the command is refused and names the person's command. The preview lists `gh issue close <n>` only for an open issue in this repository when a linked task is approved with a PR that is in the merged list, no linked task (a private one included, never described) is unsettled, and the live issue body has no unchecked task-list item (`- [ ]`, `* [ ]`, `+ [ ]` or a numbered `1. [ ]`). At most 20 candidates are read per run. Name the same flags again with `--apply --confirm <fingerprint>`. No milestone is ever marked done or dropped.
package/docs/security.md CHANGED
@@ -6,10 +6,12 @@ agent-hub connects agents that can each run commands. This page says what the hu
6
6
 
7
7
  - **Other agents' text is untrusted.** Every message that crosses from one peer to another is framed as untrusted input: a channel tag with `meta.source` for Claude started with `ahub claude`; otherwise a fixed header line (`frame()`, `[agent-hub message from ...]`) with an instruction that says it is untrusted, the plugin's server instructions for a tools-only Claude reading `hub_inbox` and a standing instruction for the others. A message body cannot forge the hub's own headers: such lines are quoted (`sanitize`). Replies inherit a hop count capped at 3, so agents cannot ping-pong forever; neither a digest nor a steer can reset it.
8
8
  - **The control link is loopback plus a secret.** The daemon and the Codex proxy bind 127.0.0.1 only. The control WebSocket requires a per-run token (`.agenthub/state/control-token`, mode 600), and both servers refuse any request that carries an `Origin` header: any web page can open a WebSocket to localhost, and browsers always send `Origin`. The bearer header a Codex TUI sends to the proxy carries only the terminal launch id (#586): it binds terminal ownership and is not a credential. External clients cannot claim the console user's id or a hub-managed peer's id.
9
+ - **The MCP endpoint socket is owner-only plus the same secret (#1780).** `<hub home>/run/<projectId>/mcp.sock` sits in `0700` directories that must be plain directories you own, and the socket is `0600`. A connection gets nothing until one hello line, within 5 s and 8 KB, carries the control token, compared in constant time; anything else closes it with no reply. The `ps` check that the hello's pid belongs to you catches mistakes only, since the pid is self-reported. A session keeps the account label the hello's home maps to, never the path. A stale socket is replaced only by the hub that holds the project's control port, only when nothing answers on it, it is your own socket and it is the same file at both looks; otherwise the hub runs without the endpoint.
9
10
  - **Write retry keys grant no authority (#1078).** The `tool_write_idempotency` feature binds top-level control `requestId` keys to authenticated actor/role/launch/generation/execution scope and canonical business arguments. For task proposals and reviews, MCP `request_id` is an explicit retry argument, independent of JSON-RPC correlation; it is removed before dispatch. A timeout or connection loss remains `outcome: unknown`, with a settling read, while a pre-admission refusal says this attempt did not run. Reusing another scope's key, changed arguments, expired or old-instance IDs never starts a new write. Current authority and privacy are rechecked before a cached result is returned, including the PII status of overlap references. Request payloads are hashed rather than retained; result records are bounded and remain in daemon memory. Limits are per authenticated actor (512 entries/15 minutes), not one shared admission budget. Delivery acknowledgement uses the journal's existing idempotence and socket/generation ownership checks without consuming that cache, so another actor's filled window cannot prevent settlement. Legacy clients without keys keep their path; current clients refuse explicit replay to an older daemon that would ignore it. See [safe retry and refusal semantics](operations.md#control-write-outcomes-and-safe-retries-1078).
10
11
  - **Control-write diagnostics carry metadata only (#1126).** The daemon's write spans and event-loop probe record a closed set of operation kinds, phases, task numbers and durations, never task text, paths, ids of transports, actors or sessions, credentials, error text or external output, and nothing for a PII task or a private turn. A frame from a client that has not authenticated is never inspected for them. Retention is capped (128 requests, 256 spans, 512 recent intervals, five-minute expiry) and a record in `hub.log` is at most 2,048 bytes; client timing on stderr is off unless `AHUB_CONTROL_WRITE_TIMING=1`.
11
12
  - **Permission prompts stay on unless an operator selects a permission mode.** `ask` leaves native decisions unchanged. `ask-when-needed` grants scoped Claude file tools or Pi/local writes and edits, and a headless Claude implementer's proven shell commands through the host wrapper (#845, below); Kimi and Codex use their own native policies. `never-ask` requires explicit runtime confirmation, a person's console `y` for a config default at hub start, or retained autonomy consent bound to that peer's exact never-ask value in the untracked `config.local.json` (#999, below). Without one of these the peer runs in `ask`. Kimi's and `local`'s permission requests are relayed to the console and cancelled after `approvals.timeout_s` (default 120 s) of silence; the macOS notification for a waiting request carries the peer and the tool name only. The one exception is the hub's own tools (`hub_send` and the task tools, matched by exact name): Kimi's requests for them are approved once without a prompt and logged by name, the same trust Codex gets through `approval_mode` in the hub's config. They invoke hub-owned operations rather than arbitrary file or shell tools, and every call passes the hub's own checks. A call the always-ask policy classes (below) is never approved this way, whatever its title. Identity comes from the exact permission title, or from the earlier tool-call title bound to the same call id and resolved against the configured MCP servers when the permission title contains argument JSON (Qwen). Payload text and unrelated display titles never establish identity. Configured ACP kinds (#451) never get this exception: a request whose title spells a hub tool exactly still goes to the person approval path, and only a mapped native mode changes what the agent itself asks. For ACP agents, a payload longer than the console shows is marked as cut and never offers a session-wide grant. Pi's write, edit, shell and git write requests are relayed the same way and can be answered `Always allow <tool> until Pi restarts`: later calls of that tool by the same Pi start skip the prompt but stay inside the path guard and sandbox. The grant covers every later call of that tool whatever its payload, is kept in memory only, cannot be given from the dashboard, and each call it allows is logged by tool name. A Pi or `local` request whose call was cancelled or whose turn ended is withdrawn at once: a later answer is refused and grants nothing, an `Always allow` included. One shell command runs without a hub approval: the `!command` a person types in the managed Pi TUI. It stays inside the same sandbox and denylist, and the hub takes it only from the verified owner process of a Pi in TUI mode, while Pi is idle, on a reservation that is used once; a model's own bash call never takes that path (issue #253). `--unattended` turns prompts off, says so loudly, and is never the default; a classed call from a hub-owned ACP peer, the local worker or Pi still waits for a person under it.
12
- - **A committed config cannot choose launch commands, credential files, data endpoints, permission modes or a wider sandbox.** The machine-local fields (`kimi_cmd`, `permission_modes`, `codex_bin`, `pi.cmd`, `checks`, `mlx.bin`, `mlx.runtimeDir`, `mlx.modelPath`, `omniroute.urls`, `omniroute.access_hosts`, the `omniroute` key files, `memory.worker_url` (still accepted, ignored since 0.16.0), `local.read_allow`, `local.bash_network`, `local.network_allow`, `local.doc_read`, `local.web_fetch`, `terminal.open`, `tasks.auto_pull`, `tasks.queue_backpressure`, `context.max_assignment_used`, `schedules` (the `every`, `cron` and `tz` forms alike), `folder_triggers`, `memory.review`, `corpus.paths`, `invocation`, `start.agents`, `instances`, `action_policy`, `rooms`, `instructed`, `jcode_mcp_allow`) apply only from a config file git confirms nobody committed (`instances`, `action_policy` and `rooms` are read only from an untracked `.agenthub/config.local.json`; in `config.json` they are ignored even when untracked): `.agenthub/config.json` or `.agenthub/config.local.json`, matched by file identity so no other spelling the file system accepts slips past, and `.agenthub` itself not a committed symlink or submodule. Without a repository, or when git fails, they keep their defaults; an empty value always means the default. "Untracked" is answered by the repository that contains the project: a checkout copied or extracted into an unrelated repository, or into an ignored directory of one, is trusted like your own files. So a cloned repository cannot choose a launch command, a completion check, a gateway to send a key file to, a memory endpoint, a permission mode, the command that opens a terminal, which agents `ahub up` opens terminals for, a folder the hub reads, work proposed on a timer, a host a model may fetch from, which of your agents' skills other peers may call, or a wider sandbox. A command in `checks` runs as you, outside the local worker's sandbox, like a git hook. So do the `setup` and `verify` commands of a benchmark suite (issue #251): `ahub bench run <suite.json>` is a person's command, refused from an agent session, and it resets the work tree for each attempt, so it runs only with `bench.enabled`, at the root of a clean repository that tracks nothing under `.agenthub/`. Nothing in `routing.toml` or in task text is ever run. `routing.toml` and the other shared fields still come from the checkout, and they matter: `routing.toml` picks the models the local worker and the hub's inference use at your gateway and can turn the PII constraint off, and roles and budget shape who does what. Review them in a repository you do not trust. The hub's own git calls outside the sandbox (snapshots, facts, config trust, project discovery, memory recall, the bench runner) all use the single hardened implementation in the first-party `@staix/agent-mem/platform` package, re-exported by `src/hub/git.ts`, which disables the programs a repository's configuration can name — the file-system monitor, hooks, external diff, the pager, and the credential and askpass helpers, with prompts failing closed — so a config that ever does get written cannot run code with the hub's rights. Of those, the monitor, hooks and external diff are reachable by commands the hub issues (the planted-program test exercises all three; a `diff --no-index` reads the repo's config, so that call also passes `--no-ext-diff` and `--no-textconv`); the pager is not (every call pipes stdout). Credential and askpass helpers are disabled for project repositories; memory sync alone may use credentials for its own memory repository, without prompts. The cost: `core.fsmonitor=false` also turns off a person's enabled built-in monitor for the hub's own calls, so the per-turn snapshot's `add -A` scans the whole tree (the snapshot Git calls of one burst share a 250 ms budget, each call at most 10 s; a boundary that runs out is recorded as unknown, never as a stale baseline) (#576). git has no global switch for filter drivers, and of the hub's commands only the snapshot's `add`/`restore` would run one (its driver command lives in the protected `.git/config`).
13
+ - **A committed config cannot choose launch commands, credential files, data endpoints, permission modes or a wider sandbox.** The machine-local fields (`kimi_cmd`, `permission_modes`, `codex_bin`, `pi.cmd`, `checks`, `mlx.bin`, `mlx.runtimeDir`, `mlx.modelPath`, `omniroute.urls`, `omniroute.access_hosts`, the `omniroute` key files, `memory.worker_url` (still accepted, ignored since 0.16.0), `local.read_allow`, `local.bash_network`, `local.network_allow`, `local.doc_read`, `local.web_fetch`, `terminal.open`, `tasks.auto_pull`, `tasks.queue_backpressure`, `context.max_assignment_used`, `schedules` (the `every`, `cron` and `tz` forms alike), `folder_triggers`, `memory.review`, `corpus.paths`, `invocation`, `start.agents`, `instances`, `accounts`, `action_policy`, `rooms`, `instructed`, `jcode_mcp_allow`) apply only from a config file git confirms nobody committed (`instances`, `accounts`, `action_policy` and `rooms` are read only from an untracked `.agenthub/config.local.json`; in `config.json` they are ignored even when untracked): `.agenthub/config.json` or `.agenthub/config.local.json`, matched by file identity so no other spelling the file system accepts slips past, and `.agenthub` itself not a committed symlink or submodule. Without a repository, or when git fails, they keep their defaults; an empty value always means the default. "Untracked" is answered by the repository that contains the project: a checkout copied or extracted into an unrelated repository, or into an ignored directory of one, is trusted like your own files. So a cloned repository cannot choose a launch command, a completion check, a gateway to send a key file to, a memory endpoint, a permission mode, the command that opens a terminal, which agents `ahub up` opens terminals for, a folder the hub reads, work proposed on a timer, a host a model may fetch from, which of your agents' skills other peers may call, or a wider sandbox. A command in `checks` runs as you, outside the local worker's sandbox, like a git hook. So do the `setup` and `verify` commands of a benchmark suite (issue #251): `ahub bench run <suite.json>` is a person's command, refused from an agent session, and it resets the work tree for each attempt, so it runs only with `bench.enabled`, at the root of a clean repository that tracks nothing under `.agenthub/`. Nothing in `routing.toml` or in task text is ever run. `routing.toml` and the other shared fields still come from the checkout, and they matter: `routing.toml` picks the models the local worker and the hub's inference use at your gateway and can turn the PII constraint off, and roles and budget shape who does what. Review them in a repository you do not trust. The hub's own git calls outside the sandbox (snapshots, facts, config trust, project discovery, memory recall, the bench runner) all use the single hardened implementation in the first-party `@staix/agent-mem/platform` package, re-exported by `src/hub/git.ts`, which disables the programs a repository's configuration can name — the file-system monitor, hooks, external diff, the pager, and the credential and askpass helpers, with prompts failing closed — so a config that ever does get written cannot run code with the hub's rights. Of those, the monitor, hooks and external diff are reachable by commands the hub issues (the planted-program test exercises all three; a `diff --no-index` reads the repo's config, so that call also passes `--no-ext-diff` and `--no-textconv`); the pager is not (every call pipes stdout). Credential and askpass helpers are disabled for project repositories; memory sync alone may use credentials for its own memory repository, without prompts. The cost: `core.fsmonitor=false` also turns off a person's enabled built-in monitor for the hub's own calls, so the per-turn snapshot's `add -A` scans the whole tree (the snapshot Git calls of one burst share a 250 ms budget, each call at most 10 s; a boundary that runs out is recorded as unknown, never as a stale baseline) (#576). git has no global switch for filter drivers, and of the hub's commands only the snapshot's `add`/`restore` would run one (its driver command lives in the protected `.git/config`).
14
+ - **Declared accounts show labels only (#1810).** Extra Claude or Codex homes are declared only under `accounts` in an untracked `.agenthub/config.local.json`, and settings never edit them. Status, logs, events and budget output name an account by its label (`claude:<label>`), never its home path. `ahub accounts import --from orca` is person-only, writes nothing, and prints `<kind>-<n>` labels with no email, account id, organization or workspace id.
13
15
  - **Telemetry holds no bodies.** `.agenthub/state/events.jsonl` (issue #40) records envelope ids, routing and sizes, task ids and states, overlapping paths and token counts, and the task id (with a PII flag) that each usage and token record is attributed to. It never records a message body, a task title or detail, and marks private (PII) envelopes and tasks as such. Budget pauses, resumes and quota resets carry the peer, window, times and the hub's own reason text, and a person's release authorization its commit, version and docs digest. The usage roll-up (#683) folds the usage, token and limit records into `hub.db` and joins issue, PR and release from the board when read; `ahub usage` and the console's Usage panel answer only the console and a configured planner, and a planner not during a private turn. Kimi's token records (#285) are counted from its own session wire log under its home: only the four token integers, the model label and the row time are copied, and the record id is an opaque hash, never a path, session id or text. agy's (#1280) are read from its session transcript through the hook-gated readback the same way: the token integers and an opaque hash of session and step. A person's model override (`model_change`, #1317) records the peer, the previous and new model ids and the next-turn boundary; a visual (#1058) its id, kind, byte and image counts and optional task id. The log stays on the machine; `ahub export` only prints it. Two opt-in stores copy numbers from it into your home directory, shared by every project on the machine (directories mode 700, files 600): research records (issue #247, `research.enabled`; a person's explicit `ahub setup --research` or `--no-research` saves the default for new projects in the owner-only `~/.agenthub/defaults.json`, which `ahub init` only reads, and a missing, unreadable or untrusted file means off, #1347) in `~/.agenthub/research/` hold per approved or cancelled task (record v2) the ids, states, counts, tokens, times and PII flag the events hold, counts and closed words only, a person's label from a closed list, and a hash in place of the project id, and `ahub research export --dataset <dir>` writes an allowlisted copy meant to leave the machine (peers reduced to family names, project-chosen role and profile names dropped, owner-only files in a directory inside the home and outside every registered project, compared as real paths); benchmark runs (issue #251) in `~/.agenthub/bench/` hold suite name and hash, arm label, the attached peers' ids, models and permission modes, task ids, outcomes, exit codes, counts, tokens and times, never suite text or a command's output.
14
16
  - **Snapshots stay in your repository.** Per-turn snapshots (issue #33) are git objects in the project's own object store, written through a temporary index; nothing is referenced, pushed or copied elsewhere, and `git gc` prunes them. They hold what the work tree held, including untracked files that are not ignored, so keep secrets in ignored files. They carry the repository's own permissions, and nothing caps their disk use but `git gc`. A turn of a peer holding an open PII task is not snapshotted; a PII file left in the project is snapshotted by later turns like any other file. `ahub undo` restores only files whose current content is exactly what the turn left.
15
17
  - **The edit hook reads, never decides.** `ahub check-path --hook` (issue #32) reads hub.db and returns context for Claude and a line for you; it sets no permission decision, so your permission rules stay in charge. It names other owners' task ids, titles and states, which then reach Claude's model; PII tasks are left out.
@@ -647,7 +649,7 @@ Please report vulnerabilities privately through GitHub's "Report a vulnerability
647
649
 
648
650
  ## Dashboard settings and the settings session (issue #269)
649
651
 
650
- - Settings are a closed registry (`src/hub/settings.ts`). The dashboard and `ahub settings` can write only its keys, each checked against its own closed values, and only to `.agenthub/config.local.json` and `.agenthub/routing.local.toml`. A file git tracks is never written, so the shared `config.json` and `routing.toml` stay byte-identical; in a repository where git cannot answer, nothing is written either. Commands and binaries (`kimi_cmd`, `codex_bin`, `pi.cmd`, `checks`, `mlx`), credential files and gateway URLs (`omniroute`, `memory.worker_url`), the local worker's reach (`local.read_allow`, `local.bash_network`, `local.network_allow`), `bench.enabled`, `terminal` and `instances` are refused by name from every registry surface: they choose what the hub runs or where secrets and task text go. The structural editor below (#689) is the only other writer, and it keeps the executable and secret-locating keys console only.
652
+ - Settings are a closed registry (`src/hub/settings.ts`). The dashboard and `ahub settings` can write only its keys, each checked against its own closed values, and only to `.agenthub/config.local.json` and `.agenthub/routing.local.toml`. A file git tracks is never written, so the shared `config.json` and `routing.toml` stay byte-identical; in a repository where git cannot answer, nothing is written either. Commands and binaries (`kimi_cmd`, `codex_bin`, `pi.cmd`, `checks`, `mlx`), credential files and gateway URLs (`omniroute`, `memory.worker_url`), the local worker's reach (`local.read_allow`, `local.bash_network`, `local.network_allow`), `bench.enabled`, `terminal`, `instances` and `accounts` are refused by name from every registry surface: they choose what the hub runs or where secrets and task text go. The structural editor below (#689) is the only other writer, and it keeps the executable and secret-locating keys console only.
651
653
  - `routing.local.toml` holds `stay_switch` and, per class, `peers`, `escalate_to`, `route` (an id `routing.toml` defines) and `pi_backend`, and nothing else: targets, routes, signals and the PII constraint cannot be set through it. A write is read by the hub's own loader before it replaces the file (temp file and rename), and one previous version is kept for undo.
652
654
  - An ordinary dashboard session (`ahub ui`) reads settings, lowers a mode to `ask`, turns `pi.auto_start`, `task_sweep.enabled`, `task_sweep.auto_reassign` or `tasks.auto_pull` off, sets a start mode back to `tui` or a WIP limit to 0, and changes the safe switches (`research.enabled`, `approvals.notify`, `snapshots.enabled`, `coordination`). Whatever can widen what agents do without asking needs a settings session: a non-ask mode now or at hub start, routing, starting Pi with the hub, turning on automatic backlog pulls, removing a machine-local value, and undo. `ahub ui --settings` opens one: its ticket marks the session for 15 minutes, after which it is an ordinary session. `never-ask` also needs the peer's id typed as the confirmation, and a stored never-ask default still waits for the console's `y` at each hub start unless retained autonomy consent matches it. An undo never puts never-ask back, and removing a machine-local value that uncovers a never-ask in the shared file needs the same confirmation. "Lowering to `ask`" means handing the decision back to the agent's own rules: for Codex that is the approval policy the person configured natively, which the hub does not judge.
653
655
  - A settings session is as strong as the console for these settings and no stronger elsewhere. A mode change is the console's own request with the same refusals; tool approvals stay deny-only for Pi and local; there is still no shell, file, task-detail or launch-command API. `ahub ui --settings` and `ahub settings` pass the same identity gate as `ahub permission`, which is an operating policy, not authentication. The hostile-agent boundary above applies unchanged: an agent with an unrestricted shell as the same user can impersonate the console, and so can open a settings session.
@@ -680,6 +682,8 @@ its existing basename/worktree aliases and provider accounts can remain shared.
680
682
 
681
683
  `ahub projects move` (#1424) re-keys a moved project's registration and is person-only: an agent shell and `--live-test` are refused. It previews first and applies only with the preview's `--confirm` fingerprint after every affected hub is stopped, backs up the databases and markers it changes under `.agenthub/archive/move-<UTC time>/`, and leaves memory project keys and archived recovery history at their original identities; autonomy is not carried to the new root.
682
684
 
685
+ A shared host (#1779 T3a) is off by default. A project with `host.shared` runs its daemon inside the host process of its runtime, together with every other opted-in project of that runtime; a project that starts under a recovery operation or a live test keeps its own process. Each project keeps its own control port, token file and state directory. The host answers only `ping` and `add` of a project the registry holds, on `<hub home>/hosts/<hash of the runtime root>.sock` with no token: the owner-only `hosts` directory and the socket's `0600` mode are the authority. An uncaught error the host cannot tie to a project (a socket handler's error or an unhandled rejection under Bun) stops every project in it. Limit: an external adapter module of one project runs in the process that holds the other opted-in projects' control tokens and state, and nothing refuses that today, so enable `host.shared` only for projects that trust each other's adapter modules.
686
+
683
687
  ## acon console plugin (#935, #1012)
684
688
 
685
689
  `@staix/agent-hub/ui-plugin` runs inside the agent-console (`acon`) process as the
@@ -787,7 +791,7 @@ live after a settings write, undo or reload (turning it off from an edited file
787
791
  be set through an agent, tools or conductor surface. Claude's daemon response
788
792
  withholds the scoped mode on these writes so an older hook grants nothing too.
789
793
 
790
- Agent CLI versions (#691). One policy gates the Codex and Kimi fresh reviewers, the headless Claude implementer, Jcode, agy, Qwen (ACP and the dual-output TUI) and Pi (#843): a receipt-verified version passes, Jcode and agy also start an untested version inside their compatible line with a note, and any other version is refused unless the person trusts that exact version on this machine with `ahub agents trust <id> <version>`. The record is `agent-compat.json` in the hub home (`~/.agenthub`), written atomically with mode 600 and at most 64 entries; an unreadable, linked, oversized or invalid record trusts nothing. Agent shells and `--live-test` may read `ahub agents` but cannot trust or revoke. Trust lifts only the version pin: the fresh reviewers' runtime proofs still run before every child, and an untested version's native contract stays unverified.
794
+ Agent CLI versions (#691). One policy gates the Codex and Kimi fresh reviewers, the headless Claude implementer, Jcode, agy, Qwen (ACP and the dual-output TUI) and Pi (#843): a receipt-verified version passes, Jcode and agy also start an untested version inside their compatible line with a note, and any other version is refused unless the person trusts that exact version on this machine with `ahub agents trust <id> <version>`. The record is `agent-compat.json` in the hub home (`~/.agenthub`), written atomically with mode 600 and at most 64 entries; an unreadable, linked, oversized or invalid record trusts nothing. Agent shells and `--live-test` may read `ahub agents` but cannot trust or revoke. Trust lifts only the version pin: the fresh reviewers' runtime proofs still run before every child, and an untested version's native contract stays unverified. The native capability listings (#1808) are gated the same way: Kimi, Qwen and Codex list capabilities only on their probed versions (2.3.2, 0.26.1 and 0.166.0) or a version the person trusts, and an untested listing may miss or misclassify entries. Watch-only `observe` entries (the Codex app-server and Kimi ACP handshakes, the Claude channel flag, the Orca CLI) never refuse on a version: no launch, start or restore path reads them, and the daily watch, `ahub agents` and `ahub doctor` report them. Separately, an upgrade plan that must close or restore Orca terminals checks the field names of the Orca CLI's answers and blocks those rows on a mismatch. `ahub agents --latest` (person only) is the one path that reads the network for this table: it reads the newest published release's `compat.json`, advises and writes nothing, and the hub never fetches it.
791
795
 
792
796
  Qwen Code's optional production ACP peer requires the qwen-code native identity, a compat-admitted version (receipt-verified 0.25.0, 0.26.0, 0.26.1, 0.26.4, 0.26.5, 0.26.8, 0.26.9, 0.27.0, 0.27.1 and 0.28.3)
793
797
  and advertised mode ids before setting a policy or starting work. Its own tools
@@ -798,10 +802,12 @@ this production table. Startup diagnostics withhold native host/payload details.
798
802
 
799
803
  Jcode is optional, source/version-fenced and runs native tools without a hub sandbox or hub permission-mode mapping. .jcode joins the scoped-grant exclusion, including lexical/resolved aliases. Only a person writes its unique project MCP entry; foreign/override/symlink entries refuse. Its `AGENTHUB_PROJECT_DIR` is compared by real path, so a hub-written entry stays the hub's own after the project directory moves and its old path is left as a symlink; the rest of the entry's shape still must match exactly, and a refusal names the differing field (#1423). The hub owns a private daemon/socket and ACP group, never the global daemon, and copies no credentials. It accepts a plain jcode release from 0.98.0 up to, not including, 1.1.0 (#529; only 0.98.1, 0.99.0, 0.99.1 and 1.0.3 are verified, and another version in that line starts with a note), or an exact version the person trusts (#691), and runs every owned jcode process (probe, serve, ACP and TUI) with `JCODE_NO_TELEMETRY=1`, because jcode's telemetry can report the provider account's email. Native diagnostics withhold payloads/hosts. Hub tools are bound to an owned launch (task 368): the shared project entry names no peer, each owned Jcode process carries its own peer id and launch id, the daemon admits a hub-tools connection for a Jcode peer only with the id of that peer's current owned launch, and a tools-mode server started without a peer id refuses every tool. Extra Jcode instances (#685, at most 8) are declared only through `instances` in an untracked `.agenthub/config.local.json`, start headless, and each needs its own `jcode_home`, which may not be the base home or another instance's, nor nested in or around one, however it is spelled. Unproved conversation loads refuse; no fresh replacement is called a restore. A finished task's advisory about the project root checkout names the branch only after the hub's whole public-text screen (`Tasks.publicMetadataText`: a PII pattern, a secret shape and a project-private path) passes it and it is a plain ref name; otherwise a generic sentence carries no part of it (#572). Native TUI launch exposes its private socket/session tuple only to the authenticated console, bound to the same live owned socket and session after read-only native persistence proof. Tools/status do not receive it. The TUI has no single-writer guard: person input may interleave with ACP. Native policy remains unmanaged and closing the frontend does not stop ACP. An `important` message reaches a busy Jcode as a soft interrupt written to the hub's own private server socket for the owned session (#572); the hub never cancels a turn to deliver, and a steer that was sent but not acknowledged, or whose turn ended first, is held as `needs_review`, never replayed. Jcode has no switch to choose its MCP servers, so the owned serve and ACP processes load every server named in `<JCODE_HOME>/mcp.json` and the project's `.jcode/mcp.json`, `.mcp.json` and `.claude/mcp.json`, besides the hub's own; `ahub doctor` lists their names only. Point `jcode_home` at a separate home, or remove a server from those files, to keep it out. `ahub init` creates a hub-owned home holding only the hub entry, the `jcode_mcp_allow` servers and the hub skills, and never reads or copies the person's login, sessions or history (#1627). `jcode_mcp_allow` changes only what `ahub doctor` accepts, by name, not what jcode loads (#1621).
800
804
 
801
- Antigravity (`agy`, #485) is optional, cloud and off roster by default. The launcher accepts the Antigravity CLI 1.4.x line and exact 1.5.3; only 1.4.2, 1.4.7, 1.4.12 and 1.5.3 have a native receipt ([1.4.7](verification/2026-10-26-agy-1.4.7.md), [1.4.12](verification/2026-11-03-agy-1.4.12-launcher-nonce.md), [1.5.3](verification/2026-11-08-agy-1.5.3.md)), so another 1.4.x patch launches with a warning that it is unverified, and every other version, other 1.5.x included, is refused before a hub connection or plugin write (#589) unless the person trusts that exact version (#691). It runs native tools under its own unmanaged permissions, without a hub sandbox or hub permission-mode mapping; headless, resume, unattended and native permission flags are refused. Its roles are capped at implementer and verifier, so it never plans, reviews or receives PII work. Only the person's `ahub agy` launcher writes its three plugin files in `.agents/plugins/agent-hub/` (`plugin.json`, `mcp_config.json`, `hooks.json`): linked or foreign entries refuse before any write (`AGENTHUB_PROJECT_DIR` and `AGENTHUB_STATE_DIR` in its MCP entry and hook commands are compared by real path, #1423), cleanup removes only that launch's matching files, and it never writes project-level `.agents/hooks.json` or the person's `~/.gemini` settings (`ahub setup` writes only the hub's own marker-guarded skill trees under `~/.gemini/config/skills` and in the other hosts' user skill directories, replacing a tree only while its recorded digest matches; modified, foreign and linked trees are left alone, #1622). Conductor starts are refused, and a declared agy extra instance is refused at config load (#625). Hook authority (`native_hook_launch`) comes only from that launcher, belongs to the console socket that began it and ends when that socket closes; hook input over 1 MiB is refused, and observations are bound to the daemon, launch, native session and project.
805
+ Antigravity (`agy`, #485) is optional, cloud and off roster by default. The launcher accepts the Antigravity CLI 1.4.x line and exact 1.5.3 and 1.5.21; only 1.4.2, 1.4.7, 1.4.12, 1.5.3 and 1.5.21 have a native receipt ([1.4.7](verification/2026-10-26-agy-1.4.7.md), [1.4.12](verification/2026-11-03-agy-1.4.12-launcher-nonce.md), [1.5.3](verification/2026-11-08-agy-1.5.3.md), [1.5.21](verification/2026-12-02-agy-1.5.21.md)), so another 1.4.x patch launches with a warning that it is unverified, and every other version, other 1.5.x included, is refused before a hub connection or plugin write (#589) unless the person trusts that exact version (#691). It runs native tools under its own unmanaged permissions, without a hub sandbox or hub permission-mode mapping; headless, resume, unattended and native permission flags are refused. Its roles are capped at implementer and verifier, so it never plans, reviews or receives PII work. Only the person's `ahub agy` launcher writes its three plugin files in `.agents/plugins/agent-hub/` (`plugin.json`, `mcp_config.json`, `hooks.json`): linked or foreign entries refuse before any write (`AGENTHUB_PROJECT_DIR` and `AGENTHUB_STATE_DIR` in its MCP entry and hook commands are compared by real path, #1423), cleanup removes only that launch's matching files, and it never writes project-level `.agents/hooks.json` or the person's `~/.gemini` settings (`ahub setup` writes only the hub's own marker-guarded skill trees under `~/.gemini/config/skills` and in the other hosts' user skill directories, replacing a tree only while its recorded digest matches; modified, foreign and linked trees are left alone, #1622). Conductor starts are refused, and a declared agy extra instance is refused at config load (#625). Hook authority (`native_hook_launch`) comes only from that launcher, belongs to the console socket that began it and ends when that socket closes; hook input over 1 MiB is refused, and observations are bound to the daemon, launch, native session and project.
802
806
 
803
807
  Configured ACP adapters (#451 A3) are declared only by the person, in a Git-confirmed untracked `.agenthub/config.local.json`. The whole declaration (command, argv, identity, roles and mode maps) is machine-local authority: a shared or tracked declaration is ignored with a notice, settings never edit it, and changes need a hub restart. The hub runs only the declared argv, never a module or callback. Argv that selects a leader, attach, connect or remote mode is refused, and a Grok declaration needs `--no-leader`. Each start requires the pinned native identity, an exact `session/load` echo on resume, and positive ownership of the spawned process and its original process group; unknown ownership refuses, and stop signals only that verified group. An agent that hands its work to a process outside that group is outside this boundary. Without a mode map native policy is unmanaged, and there is no hub sandbox either way. Configured kinds are cloud peers (never PII), headless only and off roster by default, and the hub makes no quota, context or controlled-recovery claims for them. A read-only instance needs the native read-only mode acknowledged before a prompt and is limited to read and review hub tools, both in the published MCP list and at the host; its native non-read tool requests are rejected, and no setting or runtime change can raise it. These agents' stderr and error text are withheld from logs, and previews redact the executable, argv and session id.
804
808
 
809
+ Configured pull kinds and presets (#1809) are the same person-only, machine-local declaration with `transport: "pull"`. A pull kind is the person's own TUI, started by `ahub <kind>` in their terminal with the kind's peer identity and an environment that carries no tools socket and no other peer's marker. It reaches the hub through the MCP bridge the person registers in that CLI (the hub never writes that registration), is cloud trust and off roster by default, is never pushed to, owns no task, has no hub permission mode or sandbox, and is never started by a conductor. `ahub agents presets` lists the shipped presets and whether a verification receipt backs each; `ahub agents add <preset>` (person only) writes a preset's declaration only into a `.agenthub/config.local.json` git confirms untracked, refuses an existing kind or a missing executable, and takes effect at the next hub restart.
810
+
805
811
  Configured print adapters (#1515) are the same person-only, machine-local declaration with `transport: "print"`: a fixed command and argv with one `{prompt}` placeholder or stdin, a version probe argv whose whole trimmed output must equal `versionPin`, a deadline of 1 to 300 seconds and the advisory roles `reviewer` or `advisor`. Unlike a configured ACP kind, a print peer runs only inside the hub's read-only sandbox: the hub refuses to start one on a host without it, and the version probe and every turn run as a new child under `sandbox-exec` with no network, no file write but `/dev/null`, no read of the hub's state directory, the project's deny list applied, and an environment replaced by a fixed `PATH`, `HOME=/var/empty`, `LANG` and `TERM`, so none of the person's credentials or variables reach it. The executable's identity is pinned at start and rechecked before each run. It takes public advisory messages only: a private or PII turn, and any `task`, `review` or `invocation` envelope, is refused before a child is spawned, and the prompt and the answer each pass the public-text screen. Stdout is capped at 64 KiB and marked when cut; a failure or timeout reports a sanitized stderr tail of at most 2,000 characters only when it passes that screen. A print peer has no hub MCP tools, so it never owns a task, never files a verdict and is excluded from the reviewer pool and the assignment walk even when its declaration lists `reviewer`; its permission mode is unmanaged and its quota and context are unknown.
806
812
 
807
813
  External adapter modules (#451 A4) are the one way to run adapter code that ships outside the hub, and the pin is code authorization, not a sandbox. `adapter_modules` is read only from a Git-confirmed untracked `.agenthub/config.local.json` (never from a shared, tracked or cloned config, and never written by settings or a hub tool). Only daemon startup imports a module, from the captured bytes that matched the `sha256` pin, not by reopening the path; the file must sit inside the project with no symlinked component and not be world-writable. Its imports are bound to the running hub's own `@staix/agent-hub/adapter` and builtins (`bun:ffi` and `bun:test` excluded), and dynamic imports, `require`, `eval` and `Function` are refused by a conservative scan. Once imported, the module runs with the daemon's privileges: the 2 s import deadline stops waiting but does not cancel its code or undo side effects, and the host's default against hub-tool title auto-approval holds only while the module keeps the factory options it is given. Inspect the whole bundle before recording its hash. Refusal reasons withhold source and module error text. A loaded kind keeps its own family, cloud trust (never PII), headless start and off-roster default, and fixed-builtin capabilities are refused. The daemon reads a native proof port (a status notice, the Codex frontend proxy, a native turn revert, a Claude launch proof) only from a fixed builtin definition, so a module product that carries one gains nothing (#790). Extra instances of a module kind (#754) exist only when the module opts in (`headlessInstances`: headless, implementer, verifier or continuing reviewer) and the person declares them in `instances`. Each needs its own managed worktree, on an attached branch unless it is read-only, and is bound to what startup verified (module pin, API, capability and policy digests, execution root): a changed binding, a replaced worktree, a branch switch or a lost owned process revokes its authority, and a recorded native session resumes only under the exact same binding.
@@ -945,7 +951,7 @@ A terminal Claude implementer or verifier instance (#525-5) owns write-class tas
945
951
 
946
952
  A planner-only instance (#525-6: `planner` without `implementer` or `verifier`) plans on the project checkout, so a declared `worktree` is refused. A Codex planner's `thread/start` and `thread/resume` are requested read-only, and a thread is adopted only when Codex's reply positively confirms a read-only sandbox; an unconfirmed or malformed reply refuses that RPC and closes the link before the hub adopts the thread or delivers work, and the current roles are rechecked before each injection. This is an initial ceiling, not confinement of the person's attached TUI, which can change its native sandbox later. A declared planner-only Claude channel instance gets no automatic grant from its facts hook for any tool but Read, LS, Glob and Grep, whatever the permission mode.
947
953
 
948
- The headless Claude implementer (#525-4) runs one owned `claude -p` child per turn in its declared worktree, with `--setting-sources ""`, `--strict-mcp-config`, native permission mode `default`, the hub's managed PreToolUse hook and `--permission-prompt-tool mcp__agent-hub__hub_permission_request`; never `--bare`, `acceptEdits`, `dontAsk` or `bypassPermissions`, and `never-ask` is refused. Each task keeps its own persisted session; unscoped chat reuses one only while exactly one task is in progress, and a `hub_inbox` read refuses a batch attributed to another task. The approval path fails closed: `hub_permission_request` is accepted only from the current child's launch and generation, goes to the console's existing approval queue and `approvals.timeout_s`, and offers allow-once and deny only, with no allow-always or session grant. A timeout, a prompt failure, a disconnect, a hub that is down or refusing, or a stale child binding answers deny; a failed hook decides nothing, so the call still waits for a person. The approval title is the tool name and a JSON rendering of the arguments passed through `sanitize()` and the public-text screen (any PII, secret or private-path match withholds the whole value as `[withheld]`, before any cut), never task text, cut at 600 characters with a `[cut, N chars]` marker; the original arguments stay with the child and are not logged. The MCP wire cannot tell a native permission dispatch from a call the model makes itself; a person allow still refers only to its original arguments. Automatic Bash authorization uses the separate single-use host wrapper contract below, never a caller-supplied tool id as native provenance. A stop holds an uncertain delivery until the owned process group is confirmed gone. The [native permission receipt](verification/2026-10-23-headless-claude-permissions.md) is model-free on Claude Code 2.1.309, [repeated on 2.1.310](verification/2026-10-26-claude-implementer-2.1.310.md), [on 2.1.314](verification/2026-10-31-claude-implementer-2.1.314.md), [on 2.1.316](verification/2026-10-31-claude-implementer-2.1.316.md) [on 2.1.318](verification/2026-11-05-claude-implementer-2.1.318.md), [on 2.1.319](verification/2026-11-06-claude-implementer-2.1.319.md), [on 2.1.322](verification/2026-11-10-claude-implementer-2.1.322.md), [on 2.1.323](verification/2026-11-13-claude-implementer-2.1.323.md), [on 2.1.328](verification/2026-11-19-claude-implementer-2.1.328.md) and [on 2.1.329](verification/2026-11-20-claude-implementer-2.1.329.md); it is not sandbox proof, and a real account, model and person interaction remains a live leg.
954
+ The headless Claude implementer (#525-4) runs one owned `claude -p` child per turn in its declared worktree, with `--setting-sources ""`, `--strict-mcp-config`, native permission mode `default`, the hub's managed PreToolUse hook and `--permission-prompt-tool mcp__agent-hub__hub_permission_request`; never `--bare`, `acceptEdits`, `dontAsk` or `bypassPermissions`, and `never-ask` is refused. Each task keeps its own persisted session; unscoped chat reuses one only while exactly one task is in progress, and a `hub_inbox` read refuses a batch attributed to another task. The approval path fails closed: `hub_permission_request` is accepted only from the current child's launch and generation, goes to the console's existing approval queue and `approvals.timeout_s`, and offers allow-once and deny only, with no allow-always or session grant. A timeout, a prompt failure, a disconnect, a hub that is down or refusing, or a stale child binding answers deny; a failed hook decides nothing, so the call still waits for a person. The approval title is the tool name and a JSON rendering of the arguments passed through `sanitize()` and the public-text screen (any PII, secret or private-path match withholds the whole value as `[withheld]`, before any cut), never task text, cut at 600 characters with a `[cut, N chars]` marker; the original arguments stay with the child and are not logged. The MCP wire cannot tell a native permission dispatch from a call the model makes itself; a person allow still refers only to its original arguments. Automatic Bash authorization uses the separate single-use host wrapper contract below, never a caller-supplied tool id as native provenance. A stop holds an uncertain delivery until the owned process group is confirmed gone. The [native permission receipt](verification/2026-10-23-headless-claude-permissions.md) is model-free on Claude Code 2.1.309, [repeated on 2.1.310](verification/2026-10-26-claude-implementer-2.1.310.md), [on 2.1.314](verification/2026-10-31-claude-implementer-2.1.314.md), [on 2.1.316](verification/2026-10-31-claude-implementer-2.1.316.md) [on 2.1.318](verification/2026-11-05-claude-implementer-2.1.318.md), [on 2.1.319](verification/2026-11-06-claude-implementer-2.1.319.md), [on 2.1.322](verification/2026-11-10-claude-implementer-2.1.322.md), [on 2.1.323](verification/2026-11-13-claude-implementer-2.1.323.md), [on 2.1.328](verification/2026-11-19-claude-implementer-2.1.328.md), [on 2.1.329](verification/2026-11-20-claude-implementer-2.1.329.md), [on 2.1.332](verification/2026-11-25-claude-implementer-2.1.332.md) and [on 2.1.334](verification/2026-12-02-claude-implementer-2.1.334.md); it is not sandbox proof, and a real account, model and person interaction remains a live leg.
949
955
 
950
956
  The #845 host shell wrapper is the only automatic Bash path for a headless implementer. In `ask-when-needed`, a complete public input must pass the existing #816 read-only proof or the closed task-command proof, with an active owned task and registered worktree. Enabled action-policy classes still ask, and `ask`, PII handling and the `never-ask` refusal are unchanged. The native request and authenticated host response both name wrapper protocol 1, so an older plugin cannot drop the rewrite and execute an original command automatically.
951
957
 
@@ -410,6 +410,49 @@ inside a peer.
410
410
 
411
411
  ### Budget relay
412
412
 
413
+ Explicit quota renewal (#1806) is person-only. Reset and switched modes
414
+ clear the account's earlier readings and forecast evidence, cancel soft
415
+ checkpoint admission and resume an open budget pause through the existing
416
+ moved-task notice. Manual pauses and conductor holds remain. Until an
417
+ admissible reading arrives, quota is unknown. A renewal never overrides the
418
+ next gate. Equal provider usage repeats discarded evidence when the reset
419
+ times are within the existing 15-minute jitter bound or either time is missing. Switched Codex compares its members' effective homes in memory and
420
+ requires a proved post-renewal app-server for soft quota. Switched Claude
421
+ keeps provider quota unknown and disables the soft gate while native account
422
+ evidence is unverified. An in-flight Codex reviewer attempt makes its home
423
+ comparison unknown, including during cleanup, so the account renewal changes
424
+ nothing. The hub compares each home through the optional synchronous
425
+ `PeerAdapter.compareQuotaHome` port before renewal and again at the save
426
+ boundary. Only fixed builtin definitions can provide either quota port. The
427
+ hub checks definition identity before reading either member, and rejects a
428
+ foreign product with either member present, even if undefined. A foreign
429
+ definition, absent port or undefined result uses the next launch environment.
430
+ A thrown comparison stays unknown. After saving, the optional `readQuotaNow`
431
+ port requests an immediate read. A read failure leaves the saved renewal and
432
+ its success reply intact. A hard refusal
433
+ counts unless the turn can be proved to have started before renewal. A
434
+ whole-second timestamp proves this only if that entire second predates
435
+ renewal. The person's manual reading can trigger the gate in either mode and
436
+ never supplies provider evidence. If a provider window began before renewal,
437
+ a forecast requires a fresh provider baseline, at least five percentage
438
+ points of increase and at least 15 minutes since the baseline. Divide that
439
+ increase by elapsed time for the rate. The resulting forecast uses the
440
+ `renewal` basis. Adjacent reset-time jitter and small dips preserve the
441
+ provider baseline. A confirmed new window, an expired reset bound or a
442
+ reset-sized drop takes a new baseline. Track eight sources per account and
443
+ window in memory, using the Claude session and optional launch or the Codex
444
+ peer and process. Pair the forecast with the shown reading's own source.
445
+ Missing or malformed source evidence cannot support this forecast. These IDs
446
+ confer no authority over reading admission or budget pauses.
447
+ The Kimi hub counter uses the saved canonical account renewal time in either
448
+ mode. Only rows measured strictly after it count toward the new soft window.
449
+ Replay also retains the resume filter on recording time. Excluded rows keep
450
+ their event ids for deduplication, and usage totals are unchanged. A future
451
+ measurement cannot establish post-renewal use. Clock changes can therefore
452
+ delay a soft pause. A Kimi count window predating renewal has no native
453
+ baseline for this forecast.
454
+
455
+
413
456
  - Sources (amended in M5). Codex: `account/rateLimits/read` sent through the TUI's
414
457
  connection with a hub id, `account/rateLimits/updated` forwarded from the proxy, and a
415
458
  turn refused with `usageLimitExceeded` as a hard limit (verified live: the owner's account
@@ -115,3 +115,7 @@ Same-machine cross-project routing is no longer out of scope: work that belongs
115
115
  - **Follow-back envelope (#1203 T1).** It carries `refs.handoff {project, task}` (the target's project and task) and no `refs.task`, so the bus never judges it against a local task that happens to have the same number; the one-line body is unchanged.
116
116
  - **Privacy.** Refused during a private (PII) turn and for a `[pii]` task named with `task`; the target refuses text that matches a PII pattern or that its screen cannot clear. No memory, evidence or turn content crosses beyond the handoff fields.
117
117
  - **Compatibility.** The additive daemon features `task_handoff` and, from #1203 T1, `task_handoff_key` and `task_handoff_seq` (the latter: a target sends `seq` and the two new events only to an origin that has it; an origin ignores a missing `seq`). `task_handoff_key` (an origin sends no key to a target without it and keeps the earlier behavior, a timeout there is `outcome_unknown` without a retry key, and the request is not repeated). Neither feature bumps the protocol: a new message type is answered as unknown by an older hub, and an optional field is ignored, except `duplicate_ok` and `handoffKey`, which an older target refuses as unknown fields (so the key is sent only to a target that advertises it). An older target is refused with a named "upgrade the target hub" error, and a recovery target without the label is refused while either handoff table holds a row.
118
+
119
+ - **Project context (#1779 T2).** `startDaemon` takes an explicit `DaemonProjectContext` (`root`, `stateDir`, `env` for children; default built once from `cwd`, `stateDir` and the process environment). Child environments (tool servers, the instructed hook, the ACP and Codex adapters) come from it, and `scripts/check-process-identity.ts` fails on a new `process.cwd()` or `AGENTHUB_STATE_DIR` / `AGENTHUB_PROJECT_DIR` read in `src/hub` outside a reasoned allow-list (CLI-side resolution before a daemon exists). Still one project per process; signals, forced exit and loggers stay process-wide (T3).
120
+
121
+ - **Host (#1779 T3a).** `ahub host --runtime <root>` owns several `startDaemon` instances of one runtime, keyed by project id (`src/hub/host.ts`), each started with `hostedProjectContext` (the host's environment with that project's own state and project directories). Off by default: `startProject` hands a project to the host of its runtime only when its config sets `host.shared: true` and it starts neither under a recovery operation nor as a live test; otherwise it spawns a daemon as before, byte for byte. The host listens on an owner-only socket under the hub home, named by a hash of the runtime root (`ping`, `add`); a project that asks while no host answers starts one (`ahub host --runtime <root> --add-current`), and a second host for the same runtime joins the first instead of replacing its socket. Signals and the 15 s forced exit belong to the host: a signal stops every project in the order added, then the host. An uncaught error or rejection is attributed through an `AsyncLocalStorage` entered when the project was added, so it reaches timers and promises the project started: it stops that project only; an error with no project is logged and stops the host. Measured under Bun 1.4.4 (`test/host-shared.test.ts`, a real host process): an error thrown from a timer the project started is attributed and stops that project only; an error thrown from a `node:net` socket handler and an unhandled rejection lose the context, count as unattributed and stop the host. Errors in `Bun.serve` fetch handlers were not tested through the process hook. One host per runtime root is an atomic claim in `registry.db` (`host_claims`, pid and process signature): only the claim holder removes a stale socket file and listens, a loser joins the answering host or fails closed naming the holder, and a project the host is asked to add is admitted only as the registry holds it. `project stop` is the project's own `kill`: its daemon removes its listener, timers and children, releases its registry claim and leaves the others serving. Clients see no change: per-project control port, `status.json`, `control-token` and state directory stay; `status.json` and the status reply gain `hostId`, and `pid` is the host's. The host exits when its last project stops. Not here: the shared memory handle (T3b), upgrade across hosts (T4), loop fairness and the default (T5), codex app-server children.
@@ -875,3 +875,20 @@ When no typed presentation cause exists, the human blocked screen shows only the
875
875
  An expired source lease retries a failed release checkpoint on a short timer; a vanished coordinator is not required to unstick the hold once storage recovers. Reset previews count deferred recipients as pending delivery ids, and stopped-runtime reset atomically records their discard audit and removes the originals without publication. Deferred records require their captured recipient array. Flush rollback restores only publication-owned state (affected queue arrays in place, deferred and seen ids, withdrawal bookkeeping and pending outcomes); it never reloads a live bus snapshot or changes its recovery mode, prefaces or independent pauses. Advisory nudges, like publication events, run after the checkpoint.
876
876
 
877
877
  A corrupt deferred field still refuses daemon restore. Coordinator inspection catches only the typed deferred-corruption error, keeps independently verified stopped evidence, reports an unknown snapshot binding with a static blocker, and leaves person abort/stop-and-archive exits available. It never claims that the corrupt snapshot can be resumed, repairs it or exposes rejected content.
878
+
879
+ ## Bridge mismatch retry and release history
880
+
881
+ A wire mismatch (4426) leaves the bridge's MCP transport open. Tool calls
882
+ report the mismatch, and the bridge tries the project endpoint again every
883
+ five minutes. If a hub upgrade does not restore compatibility, run
884
+ `ahub setup` and restart the session. Other terminal-close cases keep
885
+ their existing behavior.
886
+
887
+ The release age and prior-protocol count determine an accepted startup
888
+ window. Use the wider window subject to the implemented floor of 16.
889
+ The default is 16–17. Protocol 15 or older needs a fresh session.
890
+ The settings accept nonnegative integers and require a restart. Status
891
+ publishes the accepted range. It reports the floor limit only when at least
892
+ one setting exceeds its default and the requested range reaches below the
893
+ implementation floor. Retain the scalar field at the accepted
894
+ minimum so published clients can still read the descriptor.
@@ -0,0 +1,63 @@
1
+ ---
2
+ id: mcp-endpoint
3
+ type: module
4
+ title: Per-project MCP endpoint socket
5
+ status: draft
6
+ parent: agent-hub-architecture
7
+ paths:
8
+ - src/hub/mcp-endpoint.ts
9
+ - src/hub/mcp-endpoint-serve.ts
10
+ - src/hub/mcp-channel-push.ts
11
+ - src/hub/mcp-tool-call.ts
12
+ - test/mcp-endpoint-closer.test.ts
13
+ - test/mcp-endpoint-push.test.ts
14
+ - test/mcp-endpoint-session.test.ts
15
+ - test/mcp-endpoint.test.ts
16
+ - test/mcp-endpoint-daemon.test.ts
17
+ ---
18
+
19
+ # Per-project MCP endpoint socket (#1780 T1)
20
+
21
+ The daemon listens on a Unix socket, `<hub home>/run/<projectId>/mcp.sock`, so a later task can serve MCP to agent sessions without a bridge process per session. T1 serves no MCP: after a valid hello every request gets JSON-RPC error -32601 "not served yet".
22
+
23
+ ## Contract
24
+
25
+ - **Directories:** `run/` and `run/<projectId>/` are created 0700 and the socket is chmod 0600. A directory that is group or world accessible, or owned by another user, is refused with the path and the fix (`chmod 700 <dir>`). The hub then runs without the endpoint and logs why.
26
+ - **Claiming the path:** by `bind()` itself. On EADDRINUSE the socket is probed: a live hub is named and never replaced. A stale socket file is left for the person to delete, with its path, except for a daemon that holds its project's fixed control port (`exclusiveOwner`, true when `controlPort` is not 0): only one daemon per project can hold that port, so no second process recovers; recoverers inside one process take turns (`recovering` in `src/hub/mcp-endpoint.ts`), so a later one finds the earlier one's live socket and refuses. It replaces the file only when it is a socket of this user that the probe positively finds unserved (ECONNREFUSED or ENOENT; a timeout, EACCES or any other error reads as maybe alive and keeps the refusal, which names the probe result (no answer within 1 s, or the errno) and says to check the socket's permissions or which process listens; "another hub already serves" is kept for an actual connect) and kept the same device and inode across the two looks; anything else is refused untouched. A bind that fails after the stale file was removed reports its own error code, not the stale-file instruction. A daemon on an ephemeral port (a test, a host that did not claim its port) keeps the refusal. Ceiling: the lstat, answer probe and unlink are not one atomic step, so the guarantee is the port ownership, not the filesystem (#329).
27
+ - **Directories:** created with `mkdir` and `EEXIST` tolerated (two hubs of one home may race), then judged by `lstat`: plain directory, this user, mode 0700.
28
+ - **uid check:** `ps` runs asynchronously, so a slow `ps` never blocks the daemon's loop; the lines that arrive during it wait in the buffer and are handled in order; a client that has gone by the time the check settles gets no session.
29
+ - **Path length:** a socket path over 100 bytes is refused before anything is created (platform limit about 104).
30
+ - **Hello:** the first line is one JSON object `{v:1, mode:"channel"|"tools", peer, pid, ppid, cwd, home?, token}` plus the optional fields of T2a-2c (below); a key outside that set is refused. The token is the daemon's control token, compared in constant time. Any failure (bad JSON, version, field, token, other user, 5 s without a hello, over 8 KB before hello) closes the connection with no reply. No MCP byte is read before a valid hello.
31
+ - **Session record:** peer, mode, pid, ppid and an account label derived from `home` as bridge sessions do. The home path itself is never kept.
32
+
33
+ ## Ceiling: peer uid
34
+
35
+ Node and Bun expose no peer credentials (`SO_PEERCRED`, `LOCAL_PEERCRED`). The uid check runs `ps` on the pid the hello claims and refuses another user's process. A same-user process can claim any pid, so the real boundary is the 0600 socket inside a 0700 directory plus the token. The `ps` check catches mistakes and a token leaked to another user, not a malicious same-user client. Upgrade path: a native peer-credential call when the runtime offers one.
36
+
37
+ ## Shared core (T2a-1)
38
+
39
+ `src/hub/mcp-bridge-core.ts` builds the `initialize` options (capabilities and instructions) and the `tools/list` result from an explicit `McpSurface` (peer id, tools mode, channel, permission tool, delivery-only, roles, session roles, profile) and the lifecycle facts. The Claude channel bridge reads its environment and project files and passes them in; `test/mcp-bridge-core.test.ts` shows the core equals the bridge process's answer for six peer and mode combinations. The tool list reads only the tool surface (`McpToolSurface`: mode, channel, permission tool, delivery-only, profile), so a `tools/list` or a reconnect comparison never rereads roles or the role catalog; they are read on the initialize path only. The endpoint still answers -32601 until the serving task lands.
40
+
41
+ ## Serving (T2a-2c)
42
+
43
+ With `startDaemon({ mcpServe: true })` (off by default; no production caller sets it until the relay and channel pushes land) a valid hello opens a served session.
44
+
45
+ - **Admission by reuse:** the daemon opens a `ControlClient` over a Sock-shaped link (`ControlClient.inProcess`, `openMcpSession` in `src/hub/daemon.ts`) and sends the hello a bridge would send through the control WebSocket's own `message` handler (`controlWebsocket`). Peer admission, launch proof, session identity, account label and attachment are the control code. The control WebSocket protocol is unchanged.
46
+ - **Hello, additive optional fields:** `session` (label, at most 64 characters), `claudeSessionId` (a Claude session uuid), `launchId` (1 to 128 characters), `projectRoot` (1 to 4096), `permissionTool` and `deliveryOnly` (booleans, tools mode only for the first). Each is validated as on the control path, under the same token and size limits; unknown fields are refused. Roles, profile and catalog roles are derived by the daemon from its own configuration, never from the hello.
47
+ - **Mode mapping:** `tools` (or a hello with `session`) is a control `tools` client; `channel` is a control `peer` client with `channel: false` and `channelEvidence: "unknown"`, so the session is pull-only (`hub_inbox`) until channel pushes, receipts and the evidence check land (T2b, T3). It never asks to stand by.
48
+ - **JSON-RPC 2.0, newline-delimited:** `initialize` and `tools/list` come from `src/hub/mcp-bridge-core.ts` (`tools/list` reads the lifecycle through the session's own control client); `tools/call` goes through `hubToolCall` (`src/hub/mcp-tool-call.ts`), so a refusal carries the bridge's text. `ping` answers `{}`, `notifications/cancelled` aborts the named call, any other method is -32601, a handler error keeps its code or becomes -32603. Calls run concurrently; the endpoint does not await a line.
49
+ - **Refusal:** when the control path refuses the hello (project or instance mismatch, off roster, reserved id), the session gets one JSON-RPC error line (`id: null`, code -32000, the hub's reason) and the connection ends. A malformed hello still closes with no reply.
50
+ - **AC7:** `home` maps to `claude:<label>` as for a bridge session (#1810) because the control hello does the mapping; an undeclared, missing or invalid home leaves the bare key. The home path is passed only into that mapping and appears in no log, event, status reply or output.
51
+
52
+ ## Channel pushes and the buffer (T2b)
53
+
54
+ - **Evidence seam:** a `channel` hello is a channel session only when the hub's own evidence check says `development-channel-launch` (`startDaemon({ mcpChannelEvidence })`, supplied by T3 from the reported parent pid); with none it reads `unknown` and the session stays pull-only, as a bridge without proof does (AC3). A tools-mode or `session` hello is never a channel session.
55
+ - **Push:** a `deliver` for a channel session becomes one `notifications/claude/channel` line on that session's connection and no other (each peer is attached to one link). `channelPush` (`src/hub/mcp-channel-push.ts`) is the bridge's own notification builder, shared by both. The receipt is `accepted` once the line was handed to the connection.
56
+ - **Failure:** a delivery with an id whose connection is gone is receipted `needs_review`; one without an id is framed into the peer's buffer, kept up to 200 entries per peer id in the daemon (`PushBuffers`), so a reconnect of the same peer finds it; a session-join (a hello with `session`) holds none of the peer's roles and gets a buffer of its own, never the peer's and `hub_inbox` drains it. A delivery that was never pushed stays queued in the bus and reaches the session that reconnects.
57
+ - **Pull-only session:** a push it cannot show is receipted `failed_safe` (then `needs_review` for an older hub) and its originals return to the queue, as in the bridge.
58
+
59
+ ## T2 closer: footer and re-announcement
60
+
61
+ - **Footer:** `withPendingHint` (#221, #493, #1172) moved from the bridge into `src/hub/mcp-tool-call.ts`; the bridge and the endpoint both call it. A `tools/call` result carries the fresh `delivery_holds` counts and the held hint, and an inbox result keeps its own count and never repeats it.
62
+ - **Re-announcement (#490), within one daemon's life:** the daemon keeps, per peer id (`ListedTools`, daemon memory), the tool definitions the host was last given. A new session of the same peer that finds a different list (or cannot read the lifecycle after two retries) writes `notifications/tools/list_changed`; an identical list writes nothing, and a peer whose host never listed gets nothing. A session-join keeps its own record. This does not cover a daemon replacement: the record is lost with the daemon, so the host that kept a stale list across an upgrade (the bridge's #490 case, where `listedTools` lives in the surviving bridge process) is not told.
63
+ - **Parity left for later tasks:** (T3) channel evidence from the reported parent pid. (T4) the relay, its reconnect backoff, the bridge's `TERMINAL_CLOSES` texts (4401, 4403, 4404, 4405, 4409, 4430) and the standby handoff (`peer_attached`, `retainStandby`): an endpoint session never stands by and reports a refusal as one JSON-RPC error line. (T4) re-announcement after a daemon replacement: the relay outlives the daemon, so it closes this case, either by carrying the last-listed key or a reconnect flag in its hello (an additive optional field, validated like the others) or by the endpoint announcing whenever a reconnect cannot be compared. (T4) whether a relayed reconnect repeats `initialize`: `reannounce` starts at session creation, so a host whose first `initialize` is still to come could get `list_changed` before its reply; T4 either decides that a reconnect skips `initialize` or gates `reannounce` on `initialize` or the first `tools/list`. A live `tools/list_changed` on a configuration reload is not done by the bridge either.
@@ -0,0 +1,45 @@
1
+ # #1808 T2: do the capability listing shapes hold from their C0 pin to the installed version?
2
+
3
+ Date: 2026-11-30. Refs #1808 (T2, first step). Model-free, offline schema read only. This receipt decides whether a `line` may be added to the three capability entries. It does not: see the verdict.
4
+
5
+ ## What was checked
6
+
7
+ The C0 receipt ([2026-10-30-445-capability-probes.md](2026-10-30-445-capability-probes.md)) probed three listings on exactly one version each: Kimi 2.3.2 and Qwen 0.26.1 (`available_commands_update` over ACP) and Codex 0.166.0 (`skills/list` over the app-server). The same workstation now runs Kimi 2.8.1, Qwen 0.27.1 and Codex 0.172.0. The question is whether each listing shape held across the versions between its pin and the installed one.
8
+
9
+ ## Isolation
10
+
11
+ Two things happened outside that wrapper, and both are recorded as they were. First, `kimi --version`, `qwen --version` and `codex --version` were each run once with the person's real homes (no isolation), only to read the installed versions; nothing else was run that way. Second, the one isolated command below was run once, before the instruction not to run any probe. The wrapper: `env -i` with `PATH`, `HOME`, `CODEX_HOME`, `TMPDIR`, `LANG` and `TERM`, every home a fresh scratch directory, cwd a scratch directory, never the repository. The command was `codex --version` and `codex app-server generate-json-schema --out <scratch>`. No app-server was started, no session or thread was opened, no account, model or network leg was used, and the person's real homes were not read.
12
+
13
+ ## Codex: schema comparison 0.166.0 against 0.172.0
14
+
15
+ | Definition | C0 (0.166.0) | Read at 0.172.0 |
16
+ | --- | --- | --- |
17
+ | `SkillsListParams` | `cwds?`, `forceReload?` | same two properties, none required |
18
+ | `SkillsListResponse` | `data` | `data`, required |
19
+ | `SkillsListEntry` | `cwd`, `errors[]`, `skills[]` | same three, all required |
20
+ | `SkillMetadata` | `name`, `description`, `path`, `scope`, `enabled`, optional `pluginId`, `interface`, `shortDescription`, `dependencies` | the same nine properties; required: `name`, `description`, `path`, `scope`, `enabled` |
21
+ | `SkillScope` | `user`, `repo`, `system`, `admin` | same four values |
22
+
23
+ Result: the schema of the `skills/list` request and answer at 0.172.0 matches the C0 description of 0.166.0.
24
+
25
+ ## What this does not show
26
+
27
+ - Only the two end versions were compared. Codex 0.167.0 to 0.171.0 were not read, so the shape is not shown to hold across the line between them.
28
+ - A schema is not an answer: a live `skills/list` against 0.172.0 (no thread, no account) was not run here, and the `enabled` flag meaning was not re-observed.
29
+ - Kimi 2.8.1 and Qwen 0.27.1 were not probed. Their listing is an ACP update that needs a fixture-model session, and the versions between the pins and the installed ones were not read.
30
+
31
+ ## Verdict
32
+
33
+ No `line` is added to `kimi-capabilities`, `qwen-capabilities` or `codex-capabilities`. Each stays on its one C0 version, so another version lists nothing unless the person trusts that exact version with `ahub agents trust` (owner choice, #1808; its note says what trust covers). A kind gets a `line` or another exact version only with a receipt that repeats the C0 leg against it (the manifest legs added with these entries describe that replay).
34
+
35
+ ## The manifest legs
36
+
37
+ The `listing-shape` legs of `kimi-capabilities` and `qwen-capabilities` have a producer (`scripts/compat-receipts/proofs/capabilities.ts` with the driver `capabilities-acp.py`). It starts the exact installed candidate as an ACP agent with a fixture model on an unreachable loopback address, opens one session, sends no prompt, and compares the `available_commands_update` of that session with the shape the C0 receipt recorded. A pass needs the exact agent name and candidate version, no entry or field the record does not know, the recorded builtins first and in order (Kimi), exactly one fixture skill, a network log that is absent or a zero-byte regular file (a link, another file type, an oversized or an unreadable log never passes), a preload marker written from inside the candidate process (without it the leg is not-run, never a pass), and no surviving process. The driver signals the candidate's group only while its leader is unreaped and still leads it (SIGTERM, up to 3 s, then SIGKILL, up to 3 s) and sends only signal 0 probes afterwards, so a helper that outlives its leader is reported as a cleanup failure and never signalled by the driver. A PermissionError from a probe counts as not shown gone yet and probing goes on to the 3 s bound. If the driver itself is stopped mid-cleanup, the runner records what it started and stops it when the process table can be read; otherwise the disposable runner is the boundary. It was tested only with fake executables: no real candidate has been measured. It cannot prove that a skill runs, that an entry has the class its name suggests, or anything about a version it was not given. Its pass leaves `autoAdmit` false, so a pass adds a drift row and never a PR, a verified version or a `line`; a person reviews before `verified` changes. The Codex leg (`codex-capabilities` `skills-list-shape`) has a producer (`scripts/compat-receipts/proofs/codex-capabilities.ts` with `codex-listing.py` and `codex-sandbox-launcher.py`, macOS only). It starts `codex app-server` over stdio under the seatbelt profile of `src/local/sandbox.ts` with network false and `(deny network*)`, `CODEX_HOME`, `HOME` and `TMPDIR` in a private folder, and a launcher in the same process that becomes the candidate tries a loopback connection first. A pass needs the same listener to accept a connection from outside the sandbox, the launcher's attempt to fail with EPERM (a refusal, a timeout or another error proves nothing and the leg is not-run, and so is any error before that control is proved or an exit before the candidate's first answer; an exit after a valid answer is a failure), nothing to reach the listener from the launcher, the exact version, the recorded `skills/list` fields, the entry's `cwd` equal to the requested one and the one fixture user skill at its exact file (`skills/probe-fixture/SKILL.md` under the private `CODEX_HOME`, compared by real path) (both the exact file name and the exact `cwd` are inferred from how the C0 run was set up, not recorded in its answer) and a clean stop; only `initialize`, `initialized` and `skills/list` are sent. It was tested only with fake executables: no real Codex was measured, a real Codex may not start under this profile, and the sandbox does not log blocked network attempts. It cannot prove that a skill runs, that nothing else leaves the machine on a path the profile does not cover, or anything on another OS. `autoAdmit` stays false. Two more watch-only entries use the same producers: `codex-appserver` (leg `appserver-handshake`, mode `handshake` of the same Codex driver: `initialize` only, exact version in `userAgent`) and `kimi-acp` (leg `acp-handshake`, mode `handshake` of the Kimi driver: exact agent name and version, `loadSession` true and a session id, no listing; it adds nothing to the Kimi listing leg's isolation). Both are gate `observe`, tested only with fake executables, never auto-admitted, and a failed leg of either is reported as `contract-drift`; an unreadable version is `unknown`. `claude-channel` has no leg yet. The shape comparison in this record is a schema read of Codex 0.172.0 against 0.166.0 and nothing else; the producers above compare against the C0 receipt text, not against this record.
38
+
39
+ ## One CLI release, several entries
40
+
41
+ One published CLI feeds several `COMPAT` ids: `@moonshot-ai/kimi-code` feeds `kimi-review`, `kimi-tui`, `kimi-capabilities` and `kimi-acp`, `@qwen-code/qwen-code` feeds `qwen`, `qwen-dual` and `qwen-capabilities`, `@openai/codex` feeds `codex-review`, `codex-capabilities` and `codex-appserver`, and `@anthropic-ai/claude-code` feeds `claude-implementer` and `claude-channel`. A new release makes the watch list each id as a candidate and run one matrix job per id. It opens a pull request only for an id whose manifest entry has `autoAdmit` true, whose required legs all pass, and which is not `codex-review` or `agy`. The three listing ids, `kimi-acp`, `codex-appserver`, `claude-channel`, `kimi-tui`, `qwen-dual` and `codex-review` never open one: each gets a drift row. `COMPAT` has 15 ids. The daily watch cannot list `agy`, so at most 14 ids are candidates (`agy` is not counted), under the limit of sixteen.
42
+
43
+ ## The claude-channel leg
44
+
45
+ `claude-channel` is a watch-only entry (gate `observe`, `referenceOnly` with 2.1.332 as its install reference (never called verified: `ahub agents` prints "reference 2.1.332 (not verified)", every version reads `observed`, the daily watch settles the reference and reports a newer version as ahead, and the publisher never adds a version), `autoAdmit` false, never a PR, a verified version or a line) with one leg, `channel-flag-parse` (`scripts/compat-receipts/proofs/claude-channel.ts` with the driver `claude-channel-parse.py`). It starts the installed Claude Code three times under the Codex leg's setup (seatbelt with all network denied, a private home, no account, stdin closed, no prompt, and the same-process network control before every run) with new random option names: two different invalid options (the error must name the first and not the second), one invalid option (the error must name it), and the launcher's own channel flag and value followed by one invalid option (the error must name only that option). The flag and its value are read from `claudeNativeLaunch`, not copied. Only the third run can fail the leg, and only when the first two passed and it names the channel flag. A zero exit, a session start, a timeout, oversized output, a failed control or neither option named is not-run. This proves only that the installed parser still takes the flag. It does not prove that a live session accepts channel messages. No real Claude parse error is recorded, so a real candidate may always come back not-run, and the check is not tuned to pass. It was tested only with fake executables. `classifyClaudeParentCommand` stays a separate check on the launcher's real argv.