@staix/agent-hub 0.50.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 (350) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/README.md +1 -1
  3. package/docs/adding-an-ai-tool.md +26 -4
  4. package/docs/agent-notes/README.md +1 -0
  5. package/docs/agent-notes/adapters.md +4 -3
  6. package/docs/agent-notes/budget.md +8 -2
  7. package/docs/agent-notes/daemon.md +13 -8
  8. package/docs/agent-notes/local-worker.md +3 -3
  9. package/docs/agent-notes/security-review.md +6 -5
  10. package/docs/agent-notes/tasks.md +10 -3
  11. package/docs/agent-notes/tests.md +4 -3
  12. package/docs/cooperbench.md +1 -1
  13. package/docs/design/adapters.md +21 -0
  14. package/docs/design/cli-output-inventory.md +165 -150
  15. package/docs/design/cli-output.md +4 -3
  16. package/docs/design/guidance-probes.md +1 -0
  17. package/docs/design/roadmap.md +3 -1
  18. package/docs/design/task-board.md +35 -0
  19. package/docs/dogfood.md +21 -3
  20. package/docs/events.md +4 -2
  21. package/docs/memory.md +5 -3
  22. package/docs/operations.md +259 -19
  23. package/docs/quickstart.md +29 -2
  24. package/docs/roadmap.json +20 -20
  25. package/docs/roadmap.md +2 -2
  26. package/docs/roles.md +1 -1
  27. package/docs/sdlc.md +29 -5
  28. package/docs/security.md +11 -5
  29. package/docs/specs/2026-09-19-agent-hub-design.md +44 -0
  30. package/docs/specs/2026-09-19-multi-project-design.md +4 -0
  31. package/docs/specs/2026-09-20-upgrade-recovery-design.md +17 -0
  32. package/docs/specs/mcp-endpoint.md +63 -0
  33. package/docs/verification/2026-11-29-agy-1.5.20.md +33 -0
  34. package/docs/verification/2026-11-29-claude-profile-hook.md +12 -0
  35. package/docs/verification/2026-11-29-idle-daemon-footprint.md +75 -0
  36. package/docs/verification/2026-11-29-kimi-281-reviewer-compat.md +38 -0
  37. package/docs/verification/2026-11-29-kimi-tui-281.md +12 -0
  38. package/docs/verification/2026-11-30-0.51.0.md +91 -0
  39. package/docs/verification/2026-11-30-account-switch-1806.md +445 -0
  40. package/docs/verification/2026-11-30-capability-listing-shape-1808.md +45 -0
  41. package/docs/verification/2026-11-30-upgrade-keep-1807.md +174 -0
  42. package/docs/verification/2026-12-01-1811-confirmation-receipt.md +19 -0
  43. package/docs/verification/2026-12-01-1811-orca-agent-list.md +20 -0
  44. package/docs/verification/2026-12-01-1811-orca-pane-key.md +21 -0
  45. package/docs/verification/2026-12-02-1819-claude-process-after-renewal.md +54 -0
  46. package/docs/verification/2026-12-02-agy-1.5.21.md +74 -0
  47. package/docs/verification/2026-12-02-claude-implementer-2.1.334.md +44 -0
  48. package/docs/verification/2026-12-02-cli-import-graph.md +33 -0
  49. package/docs/verification/2026-12-03-0.52.0.md +150 -0
  50. package/docs/verification/2026-12-03-codex-0173-reviewer-isolation.md +53 -0
  51. package/docs/verification/2026-12-03-codex-0173-reviewer-tool-call.md +34 -0
  52. package/docs/verification/2026-12-03-jcode-1.3.0.md +25 -0
  53. package/docs/verification/agy/README.md +17 -0
  54. package/docs/verification/agy/cli-surface.ts +68 -0
  55. package/docs/verification/agy/interactive-bridge.ts +92 -0
  56. package/docs/verification/agy/interactive-session.ts +131 -0
  57. package/docs/verification/agy/launcher-nonce.ts +215 -0
  58. package/docs/verification/agy/native-hooks.ts +210 -0
  59. package/docs/verification/agy/originals/agent-hub-681/cli-surface.ts +87 -0
  60. package/docs/verification/agy/originals/agent-hub-681/native-hooks-adapted.ts +91 -0
  61. package/docs/verification/agy/originals/agent-hub-681/tui-actual.ts +200 -0
  62. package/docs/verification/agy/originals/agent-hub-684/probe.ts +107 -0
  63. package/docs/verification/agy/originals.json +25 -0
  64. package/docs/verification/agy/permission-new-functions.ts +128 -0
  65. package/docs/verification/agy/run-probe.py +108 -0
  66. package/docs/verification/agy/runtime.ts +171 -0
  67. package/docs/verification/agy/tmux-helper-control.ts +6 -0
  68. package/docs/verification/agy/tmux-session.ts +235 -0
  69. package/docs/verified.json +87 -42
  70. package/package.json +3 -3
  71. package/plugins/agent-hub/.claude-plugin/plugin.json +1 -1
  72. package/plugins/agent-hub/compat.json +157 -0
  73. package/plugins/agent-hub/kimi-hook.js +1416 -24985
  74. package/plugins/agent-hub/server.js +17415 -32755
  75. package/scripts/check-docs.mjs +1 -1
  76. package/src/adapters/acp.ts +13 -13
  77. package/src/adapters/agy/definition.ts +9 -26
  78. package/src/adapters/agy/entry.ts +2 -0
  79. package/src/adapters/channel-peer.ts +3 -1
  80. package/src/adapters/claude-channel-evidence.ts +7 -3
  81. package/src/adapters/claude-channel.ts +38 -257
  82. package/src/adapters/claude-implementer.ts +3 -1
  83. package/src/adapters/codex-appserver.ts +77 -15
  84. package/src/adapters/compat.ts +78 -14
  85. package/src/adapters/configured-acp.ts +23 -163
  86. package/src/adapters/configured-adapter-policy.ts +160 -0
  87. package/src/adapters/configured-pull-entry.ts +53 -0
  88. package/src/adapters/configured-pull.ts +38 -0
  89. package/src/adapters/conformance/fakes/app-server.ts +9 -2
  90. package/src/adapters/declaration-catalog.ts +25 -0
  91. package/src/adapters/declaration-data.ts +342 -0
  92. package/src/adapters/declaration-resolution.ts +53 -0
  93. package/src/adapters/definitions/builtin-metadata.ts +62 -84
  94. package/src/adapters/definitions/jcode-launch.ts +13 -0
  95. package/src/adapters/definitions/native-adapter-policy.ts +390 -0
  96. package/src/adapters/definitions/native-cli-claude-launch.ts +6 -3
  97. package/src/adapters/definitions/native-cli-codex-launch.ts +2 -1
  98. package/src/adapters/definitions/native-cli-entry-claude.ts +17 -2
  99. package/src/adapters/definitions/native-cli-entry-codex.ts +2 -0
  100. package/src/adapters/definitions/native-cli-entry-jcode.ts +6 -2
  101. package/src/adapters/definitions/native-cli-entry-kimi.ts +2 -0
  102. package/src/adapters/definitions/native-cli-entry-pi.ts +2 -0
  103. package/src/adapters/definitions/native-cli-entry-qwen.ts +2 -0
  104. package/src/adapters/definitions/native-cli-entry-types.ts +12 -3
  105. package/src/adapters/definitions/native-cli-jcode-home-init.ts +1 -1
  106. package/src/adapters/definitions/native-cli-launch-common.ts +2 -2
  107. package/src/adapters/definitions/native-cli-preview-common.ts +1 -1
  108. package/src/adapters/definitions/native-cli-retained.ts +1 -1
  109. package/src/adapters/definitions/native-config-defaults.ts +1 -1
  110. package/src/adapters/definitions/native-configuration.ts +18 -0
  111. package/src/adapters/definitions/native-help.ts +24 -0
  112. package/src/adapters/definitions/native-launch-declarations.ts +34 -0
  113. package/src/adapters/definitions/native-launch-policy.ts +4 -0
  114. package/src/adapters/definitions/native-launch-settings.ts +72 -0
  115. package/src/adapters/definitions/native-light-cli.ts +18 -0
  116. package/src/adapters/definitions/native-light-preview.ts +10 -0
  117. package/src/adapters/definitions/native-wrapper-launch.ts +10 -0
  118. package/src/adapters/definitions/qwen.ts +6 -29
  119. package/src/adapters/definitions/reviewer-variants.ts +7 -8
  120. package/src/adapters/external-declarations.ts +31 -0
  121. package/src/adapters/external-modules.ts +4 -29
  122. package/src/adapters/jcode.ts +19 -12
  123. package/src/adapters/native-capabilities.ts +18 -8
  124. package/src/adapters/native-facts-hooks.ts +12 -0
  125. package/src/adapters/native-proof-ports.ts +1 -1
  126. package/src/adapters/presets.ts +136 -0
  127. package/src/adapters/qwen-dual.ts +2 -2
  128. package/src/adapters/registry-types.ts +3 -0
  129. package/src/adapters/registry.ts +20 -81
  130. package/src/adapters/reviewer-print.ts +26 -9
  131. package/src/adapters/role-eligibility.ts +2 -1
  132. package/src/cli/accounts-import.ts +72 -0
  133. package/src/cli/agents-latest-table.ts +88 -0
  134. package/src/cli/agents-latest.ts +22 -0
  135. package/src/cli/agents-output.ts +10 -0
  136. package/src/cli/agents-presets.ts +100 -0
  137. package/src/cli/agents.ts +1 -1
  138. package/src/cli/attention.ts +3 -2
  139. package/src/cli/autonomy-homes.ts +7 -2
  140. package/src/cli/autonomy-offline.ts +1 -1
  141. package/src/cli/bench.ts +1 -1
  142. package/src/cli/budget-renew-guidance.ts +129 -0
  143. package/src/cli/claude-homes.ts +9 -5
  144. package/src/cli/claude-profile-hook.ts +31 -11
  145. package/src/cli/command-context.ts +3 -0
  146. package/src/cli/command-table.ts +123 -0
  147. package/src/cli/commands/accounts.ts +8 -0
  148. package/src/cli/commands/agents.ts +18 -0
  149. package/src/cli/commands/answer.ts +28 -0
  150. package/src/cli/commands/ask.ts +17 -0
  151. package/src/cli/commands/autonomy.ts +83 -0
  152. package/src/cli/commands/backlog.ts +46 -0
  153. package/src/cli/commands/bench.ts +60 -0
  154. package/src/cli/commands/board.ts +48 -0
  155. package/src/cli/commands/broker.ts +9 -0
  156. package/src/cli/commands/budget.ts +96 -0
  157. package/src/cli/commands/capabilities.ts +12 -0
  158. package/src/cli/commands/check-path.ts +55 -0
  159. package/src/cli/commands/completion.ts +8 -0
  160. package/src/cli/commands/console.ts +12 -0
  161. package/src/cli/commands/daemon.ts +8 -0
  162. package/src/cli/commands/deliverables.ts +25 -0
  163. package/src/cli/commands/doctor.ts +249 -0
  164. package/src/cli/commands/down.ts +3 -0
  165. package/src/cli/commands/export.ts +15 -0
  166. package/src/cli/commands/facts.ts +15 -0
  167. package/src/cli/commands/goal.ts +22 -0
  168. package/src/cli/commands/guidance.ts +102 -0
  169. package/src/cli/commands/help.ts +17 -0
  170. package/src/cli/commands/host.ts +45 -0
  171. package/src/cli/commands/init.ts +121 -0
  172. package/src/cli/commands/instructed.ts +19 -0
  173. package/src/cli/commands/instruction-hook.ts +15 -0
  174. package/src/cli/commands/intake.ts +24 -0
  175. package/src/cli/commands/kill.ts +15 -0
  176. package/src/cli/commands/learn.ts +23 -0
  177. package/src/cli/commands/lineage.ts +30 -0
  178. package/src/cli/commands/logs.ts +21 -0
  179. package/src/cli/commands/manager.ts +15 -0
  180. package/src/cli/commands/memory.ts +21 -0
  181. package/src/cli/commands/model.ts +25 -0
  182. package/src/cli/commands/models.ts +40 -0
  183. package/src/cli/commands/native.ts +39 -0
  184. package/src/cli/commands/pause.ts +5 -0
  185. package/src/cli/commands/peer.ts +32 -0
  186. package/src/cli/commands/permission.ts +26 -0
  187. package/src/cli/commands/permit.ts +12 -0
  188. package/src/cli/commands/pet.ts +24 -0
  189. package/src/cli/commands/projects.ts +49 -0
  190. package/src/cli/commands/queue.ts +70 -0
  191. package/src/cli/commands/recovery-run.ts +13 -0
  192. package/src/cli/commands/recovery.ts +130 -0
  193. package/src/cli/commands/release.ts +23 -0
  194. package/src/cli/commands/releases.ts +91 -0
  195. package/src/cli/commands/remember.ts +6 -0
  196. package/src/cli/commands/report.ts +27 -0
  197. package/src/cli/commands/research.ts +53 -0
  198. package/src/cli/commands/reset.ts +89 -0
  199. package/src/cli/commands/restart.ts +5 -0
  200. package/src/cli/commands/results.ts +31 -0
  201. package/src/cli/commands/resume.ts +5 -0
  202. package/src/cli/commands/review.ts +24 -0
  203. package/src/cli/commands/roadmap.ts +21 -0
  204. package/src/cli/commands/role.ts +34 -0
  205. package/src/cli/commands/roles.ts +30 -0
  206. package/src/cli/commands/room.ts +14 -0
  207. package/src/cli/commands/roster.ts +48 -0
  208. package/src/cli/commands/route.ts +9 -0
  209. package/src/cli/commands/say.ts +21 -0
  210. package/src/cli/commands/schedule.ts +17 -0
  211. package/src/cli/commands/sdlc.ts +321 -0
  212. package/src/cli/commands/settings.ts +148 -0
  213. package/src/cli/commands/setup.ts +89 -0
  214. package/src/cli/commands/shared-refusals.ts +25 -0
  215. package/src/cli/commands/smoke.ts +44 -0
  216. package/src/cli/commands/source.ts +64 -0
  217. package/src/cli/commands/specs.ts +13 -0
  218. package/src/cli/commands/status.ts +28 -0
  219. package/src/cli/commands/stop.ts +17 -0
  220. package/src/cli/commands/structure.ts +60 -0
  221. package/src/cli/commands/study.ts +39 -0
  222. package/src/cli/commands/tail.ts +19 -0
  223. package/src/cli/commands/task.ts +114 -0
  224. package/src/cli/commands/title.ts +17 -0
  225. package/src/cli/commands/turns.ts +10 -0
  226. package/src/cli/commands/ui.ts +47 -0
  227. package/src/cli/commands/undo.ts +77 -0
  228. package/src/cli/commands/up.ts +39 -0
  229. package/src/cli/commands/upgrade.ts +5 -0
  230. package/src/cli/commands/usage.ts +33 -0
  231. package/src/cli/commands/version.ts +5 -0
  232. package/src/cli/commands/watch.ts +30 -0
  233. package/src/cli/commands/worktrees.ts +31 -0
  234. package/src/cli/conductor-recovery.ts +1 -1
  235. package/src/cli/console-state.ts +5 -138
  236. package/src/cli/console-versions.ts +1 -1
  237. package/src/cli/facts-hook.ts +11 -4
  238. package/src/cli/help.ts +44 -20
  239. package/src/cli/identity.ts +27 -4
  240. package/src/cli/init-prompt.ts +1 -1
  241. package/src/cli/init-settings.ts +4 -35
  242. package/src/cli/init.ts +1 -1
  243. package/src/cli/json-text-spans.ts +57 -0
  244. package/src/cli/launch-check.ts +156 -0
  245. package/src/cli/launch.ts +19 -70
  246. package/src/cli/light-dispatch.ts +29 -0
  247. package/src/cli/main.js +8 -1
  248. package/src/cli/main.ts +257 -2799
  249. package/src/cli/memory.ts +1 -1
  250. package/src/cli/orca-probe.ts +119 -0
  251. package/src/cli/output.ts +45 -3
  252. package/src/cli/preview.ts +11 -6
  253. package/src/cli/recovery-launch.ts +1 -1
  254. package/src/cli/recovery-version-preflight.ts +28 -9
  255. package/src/cli/replace-process.ts +22 -0
  256. package/src/cli/report-layout.ts +142 -0
  257. package/src/cli/roadmap-usage.ts +16 -0
  258. package/src/cli/roadmap.ts +3 -16
  259. package/src/cli/sdlc-doctor.ts +27 -0
  260. package/src/cli/sdlc-output.ts +55 -1
  261. package/src/cli/setup-homes.ts +2 -2
  262. package/src/cli/start-agents-run.ts +85 -7
  263. package/src/cli/start-check.ts +28 -0
  264. package/src/cli/statusline-tee.ts +25 -4
  265. package/src/cli/terminal-recovery.ts +53 -10
  266. package/src/cli/upgrade-interactive.ts +1 -0
  267. package/src/cli/upgrade-runtime.ts +12 -1
  268. package/src/cli/upgrade.ts +4 -15
  269. package/src/cli/warn-line.ts +1 -1
  270. package/src/hub/accounts.ts +148 -0
  271. package/src/hub/addons.ts +20 -0
  272. package/src/hub/agent-drift.ts +2 -1
  273. package/src/hub/budget-projection.ts +39 -7
  274. package/src/hub/budget.ts +231 -16
  275. package/src/hub/channel-project.ts +3 -3
  276. package/src/hub/ci-watch.ts +311 -79
  277. package/src/hub/conductor-peer.ts +24 -0
  278. package/src/hub/conductor.ts +2 -21
  279. package/src/hub/config-apply.ts +25 -14
  280. package/src/hub/config-edit.ts +1 -1
  281. package/src/hub/config-tier.ts +2 -0
  282. package/src/hub/config.ts +535 -0
  283. package/src/hub/control-client.ts +49 -1
  284. package/src/hub/daemon.ts +492 -569
  285. package/src/hub/delivery-public.ts +11 -0
  286. package/src/hub/events.ts +3 -0
  287. package/src/hub/home-tag.ts +12 -0
  288. package/src/hub/host.ts +217 -0
  289. package/src/hub/hub-check.ts +125 -0
  290. package/src/hub/hub-tools.ts +2 -1
  291. package/src/hub/instance-budget.ts +2 -2
  292. package/src/hub/instance-config.ts +15 -126
  293. package/src/hub/instances.ts +22 -6
  294. package/src/hub/instruction-receipt.ts +2 -2
  295. package/src/hub/kimi-usage.ts +38 -11
  296. package/src/hub/lifecycle.ts +86 -4
  297. package/src/hub/mcp-bridge-core.ts +98 -0
  298. package/src/hub/mcp-channel-push.ts +20 -0
  299. package/src/hub/mcp-endpoint-serve.ts +178 -0
  300. package/src/hub/mcp-endpoint.ts +226 -0
  301. package/src/hub/mcp-tool-call.ts +181 -0
  302. package/src/hub/operational-settings.ts +2 -0
  303. package/src/hub/orca-env.ts +6 -0
  304. package/src/hub/orca-state.ts +84 -0
  305. package/src/hub/path-policy.ts +1 -1
  306. package/src/hub/peers.ts +5 -1
  307. package/src/hub/permission-mode.ts +5 -41
  308. package/src/hub/permission-paths.ts +41 -0
  309. package/src/hub/project.ts +20 -0
  310. package/src/hub/protocol-window.ts +58 -0
  311. package/src/hub/quota-origin.ts +20 -0
  312. package/src/hub/recovery-policy.ts +1 -1
  313. package/src/hub/registry.ts +36 -2
  314. package/src/hub/releases-inventory.ts +198 -0
  315. package/src/hub/report.ts +1 -1
  316. package/src/hub/research.ts +1 -1
  317. package/src/hub/review-brief.ts +47 -2
  318. package/src/hub/roster.ts +6 -3
  319. package/src/hub/routing.ts +9 -2
  320. package/src/hub/runtime-capture-prune.ts +25 -3
  321. package/src/hub/runtime-prune-health.ts +8 -1
  322. package/src/hub/sdlc-check.ts +205 -0
  323. package/src/hub/sdlc-release-authorization.ts +42 -21
  324. package/src/hub/sdlc-release-diagnostics.ts +5 -0
  325. package/src/hub/sdlc-release-policy.ts +21 -7
  326. package/src/hub/sdlc-release.ts +80 -20
  327. package/src/hub/sdlc-sync.ts +146 -0
  328. package/src/hub/sdlc.ts +38 -5
  329. package/src/hub/settings.ts +7 -4
  330. package/src/hub/start-agents.ts +1 -1
  331. package/src/hub/start-mode.ts +11 -4
  332. package/src/hub/structure-budget.ts +131 -0
  333. package/src/hub/structure-scan.ts +149 -0
  334. package/src/hub/tasks-experiment.ts +455 -0
  335. package/src/hub/tasks-guidance.ts +606 -0
  336. package/src/hub/tasks-roadmap-plan.ts +419 -0
  337. package/src/hub/tasks-roadmap.ts +491 -0
  338. package/src/hub/tasks-study.ts +661 -0
  339. package/src/hub/tasks-survey.ts +192 -0
  340. package/src/hub/tasks.ts +457 -2584
  341. package/src/hub/terminal-open.ts +5 -3
  342. package/src/hub/tooling.ts +3 -19
  343. package/src/hub/usage-rollup.ts +9 -3
  344. package/src/local/tools.ts +5 -0
  345. package/src/ui/index.html +1 -1
  346. package/src/ui/needs.ts +17 -5
  347. package/src/ui/peer-palette.ts +2 -4
  348. package/src/ui/plugin.ts +1 -1
  349. package/templates/presets/agents.json +60 -0
  350. package/templates/presets/confirmation-matrix.json +8 -8
@@ -1,7 +1,8 @@
1
1
  # Task board and hub tools
2
2
 
3
- Scope: the task flow, assignment, the state machine and the hub's MCP tools. Read before editing `src/hub/tasks.ts`, `src/hub/board.ts`, `src/hub/routing.ts`, `src/hub/task-sweep.ts`, `src/hub/settled-roles.ts`, `src/hub/conductor.ts`, `src/hub/supervision.ts`, `src/hub/tool-refusal.ts`, `src/hub/hub-tools.ts`, `src/hub/review-brief.ts`, `src/hub/reviewer-pool.ts`, `src/hub/reviewer-pool-config.ts`, `src/hub/release-admission.ts`, `src/hub/main-checkout.ts`, `src/hub/checks.ts`, `src/hub/task-repository.ts`, `src/hub/review-findings.ts`, `src/hub/review-scope.ts`, `src/hub/plan-conformance.ts`, `src/hub/risk-tier.ts`, `src/hub/review-checkout.ts`, `src/hub/sdlc-metrics.ts`, `src/hub/sdlc-merge.ts`, `src/hub/sdlc-mirror.ts`, `src/hub/no-writes.ts`, `src/hub/workflow.ts`, `src/hub/deliverables.ts`, `src/hub/deliverable-files.ts`, `src/hub/research-campaign.ts`, `src/hub/research-experiments.ts`, `src/hub/research-runner.ts`, `src/hub/task-approval.ts`, `src/hub/ci-watch.ts` or the cross-project handoff (`src/hub/handoff.ts`, `src/cli/handoff-args.ts`, `src/cli/handoff-output.ts`).
3
+ Scope: the task flow, assignment, the state machine and the hub's MCP tools. Read before editing `src/hub/tasks.ts`, `src/hub/tasks-study.ts`, `src/hub/tasks-survey.ts`, `src/hub/tasks-roadmap.ts`, `src/hub/tasks-roadmap-plan.ts`, `src/hub/tasks-guidance.ts`, `src/hub/tasks-experiment.ts`, `src/hub/board.ts`, `src/hub/routing.ts`, `src/hub/task-sweep.ts`, `src/hub/settled-roles.ts`, `src/hub/conductor.ts`, `src/hub/conductor-peer.ts`, `src/hub/supervision.ts`, `src/hub/tool-refusal.ts`, `src/hub/hub-tools.ts`, `src/hub/review-brief.ts`, `src/hub/reviewer-pool.ts`, `src/hub/reviewer-pool-config.ts`, `src/hub/release-admission.ts`, `src/hub/main-checkout.ts`, `src/hub/checks.ts`, `src/hub/task-repository.ts`, `src/hub/review-findings.ts`, `src/hub/review-scope.ts`, `src/hub/plan-conformance.ts`, `src/hub/risk-tier.ts`, `src/hub/review-checkout.ts`, `src/hub/sdlc-metrics.ts`, `src/hub/sdlc-merge.ts`, `src/hub/sdlc-mirror.ts`, `src/hub/no-writes.ts`, `src/hub/workflow.ts`, `src/hub/deliverables.ts`, `src/hub/deliverable-files.ts`, `src/hub/research-campaign.ts`, `src/hub/research-experiments.ts`, `src/hub/research-runner.ts`, `src/hub/task-approval.ts`, `src/hub/ci-watch.ts`, the SDLC sync and check (`src/hub/sdlc-sync.ts`, `src/hub/sdlc-check.ts`), the structure budget (`src/hub/structure-budget.ts`, `src/hub/structure-scan.ts`) or the cross-project handoff (`src/hub/handoff.ts`, `src/cli/handoff-args.ts`, `src/cli/handoff-output.ts`).
4
4
 
5
+ - Domain modules (#1830 S4a, S4b, S4c): the study, synthesis and survey methods live in `src/hub/tasks-study.ts` (`StudyDomain`) and `src/hub/tasks-survey.ts` (`SurveyDomain`); the roadmap and milestone methods in `src/hub/tasks-roadmap.ts` (`RoadmapDomain`: authority, milestone edits, snapshot, export, check, sync) and `src/hub/tasks-roadmap-plan.ts` (`RoadmapPlanDomain`: placement, triage, decomposition, import); the guidance variant and guidance probe methods in `src/hub/tasks-guidance.ts` (`GuidanceDomain`: the probe timers, the active map and the stop drain are instance fields of the domain, and `Tasks.stopGuidanceProbes` and `guidanceProbesPending` delegate to it) and the experiment, execution lineage and execution link methods in `src/hub/tasks-experiment.ts` (`ExperimentDomain`). `Tasks` builds each with `d` and an explicit host (`StudyHost`, `SurveyHost`, `RoadmapHost`, `RoadmapPlanHost`, `GuidanceHost`, `ExperimentHost`: bound `Tasks` callbacks, a getter per shared object) and keeps a one-line delegating method for every member it or the other domain reaches, so callers and signatures are unchanged. A module holds no module-level state and is never imported by adapters, tools or the CLI; `Tasks` stays the only board writer. A new call from a moved body into `Tasks` is a new host member, never an import of `tasks.ts` values.
5
6
  - Scope every task-place comparison through `TaskRepositories` (`src/hub/task-repository.ts`, #476): explicit `refs.repo`, else a common outside-absolute-ref repository or parent, else this project. Preserve relative display spelling within that key and gate overlap, contradiction, replay and held evidence by equal keys. Warm/cache repository identity at task mutation and startup; never repeat Git reads for unchanged overlap inputs. Set `refs.repo` for work in another repository; repo-only accept metadata never grants execution or file access.
6
7
  - Tool callers are models: MCP `inputSchema` is not enforced on the way in. Normalize at the boundary (`cleanRefs`) before anything reaches the board, and never throw after a board write: a publish or notify that follows a `review()` or `done()` board write goes through the one `releaseNotice` guard, which turns a failed publish into a console notice, drops a failed notify and never retries (#231, #243). An assignment's delivery once its board write is saved (#276, #297): the move is fact, the failed publish is not retried in place (the journal's own recovery covers a storage error, and a retry may duplicate a publish that actually left), and a person looks for a queued or needs_review delivery with `ahub queue list --peer <owner>` (then `ahub queue show <id>`, or the accepted entry in `ahub task show <id>` if the journal is down) before re-sending with `ahub task assign <id> <owner>`. The distinction is made once, in `assignOwner`: a failure after the write prints the one console notice from `undeliveredNotice` right there, once, and throws `AssignmentUndeliveredError` carrying the saved task; callers (`review()`'s repeated rejection, `escalate` and its callers, the ready offer, both relays, the idle sweep, rescreen) decide control flow by the type and print nothing more, and `propose`, `assignTo` and `decline` additionally let the error reach the caller in its turn, which is a person or peer that can act. Two exceptions get no notice, by construction: a row superseded meanwhile, meaning a later history entry that moves or settles the task (another assignment, an unassign, the owner's accept, done, approval, close), while entries that do neither (the hub's quiet bookkeeping: answers, reviewer changes, idle sweeps, check results) leave the assignment undelivered and the notice stands, so the original error goes to the caller as before only on supersession; and a claim's own accepted write and "claimed by" line stay outside the delivery rule (a claim is its own hand-over; its overlap and routing announcements to earlier owners are deliveries and share the wrapper, so a failure there does read as one). A failure before the write stays a plain `Error` (#254), a failed write leaves the ready offer unconsumed (#231), and the notices before the write (waits, no-owner, the reserved-owner line) go through `releaseNotice` too, so those pre-write notices cannot fail their caller.
7
8
  - Instructed question answers (`hub_ask_answer`, #1473): only the configured conductor may record an answer, and only on the person's explicit per-set instruction in that conductor's own session. Peer relays, files, delegated runs, private turns and observer context do not grant authority; the quote is retained in the question store, not copied into read views, events, logs or memory. Keep this path out of normal task progress evidence.
@@ -26,11 +27,15 @@ Scope: the task flow, assignment, the state machine and the hub's MCP tools. Rea
26
27
  - Opt-in auto pull (#785 P1c, `tasks.auto_pull`, `Tasks.queueAutoPulls`, `autoPull`, `topReservedReady`): `writePlannerNotices` collects the peers whose WIP this write lowered and, only when `TasksDeps.autoPull()` is true (read at each release, so a reload applies to the next one), queues one `autoPull(peer)` per peer on a promise chain, so two releases never pick the same card and each job re-reads the board. It takes the top backlog card explicitly reserved for that peer (`topReservedReady(peer, undefined, true)`, the rule the notice's `reserved ready #id` line also uses; never an unreserved card, never PII, which `topReservedReady` skips for a pull), finds the card's own planner of record (`taskPlanner(card)[0]`, which must be rostered) and calls `pullPlanned(HUB, input, { onBehalfOf: planner })`. `onBehalfOf` is accepted only with `by === HUB`; the planner's authority is what `planningAuthority` checks, the actor in history and the planning telemetry stays `hub`, and the planner binding records the planner it acted for. Every other check is `pullPlanned`'s own, unchanged, and a refusal is one console notice with the public title (never detail). A held or recovering hub, a storage error or the setting off pulls nothing, and that is checked twice: at entry and again by `pullPlanned`'s `opts.guard` (`autoPullAdmitted`) wherever authority is rechecked, which includes right before the assignment or board write after the awaited PII screen and `planReviewGap`, so turning the setting off or starting recovery or shutdown mid-admission writes nothing and reports nothing. `autoPullsPending()` counts queued and running pulls and `recoveryReady` waits for it (also named in the recovery view's blockers), as it does for `checksPending`. The key is in `ALL_MACHINE_LOCAL` (`config-trust.ts`) so a committed config is ignored for it, and it is not in `CONDUCTOR_SETTING_KEYS`: an agent never turns it on. Never add a timer or sweep that pulls. Also queue the reserved peer after backlog planning changes eligibility, after a dependency approval readies its backlog card, and when an idle peer is registered or first becomes idle after registration; use the same serialized admission and recheck once per attachment. Automatic distribution (#1626): `assignOwner` excludes peers at their WIP cap, with a held queue or backing off after a capacity decline for every owner choice the hub makes without a named owner (`hubOfferFull`, counting `readyInFlight` and `pendingClaims` like `reservedHold`); a person's or conductor's explicit assignment, a claim and a roster move are unchanged. `capacityBackoff` is in memory by design (a restart reattaches peers idle, which ends it) and ends at the peer's next idle state. A capacity decline of a pulled card goes back to backlog with its reservation through the untouched-return path; a plain decline clears it. When `topReservedReady` finds nothing, `fillSlot` offers the first ready unowned `proposed` task through `assignOwner` with that peer as the only candidate, one per trigger on the `autoPulls` chain. Never offer a peer a task it would have to refuse.
27
28
  - Bounded waits (#1454, `Tasks.wait`, `taskWait`, `hub_task_wait`): a wait is one quiet `wait recorded` history entry with `wait: {until, owner}` and the public reason as its note, never a column or a second write. `taskWait` (`src/hub/task-sweep.ts`) parses whether the latest wait remains in force from history alone (latest wait entry names the current owner, nothing state-changing after it); callers use that result for idle-sweep timing and to surface an expired wait as `wait-passed` in planner grooming. A new event that must not end a wait joins `WAIT_KEEPING_EVENTS` beside its `QUIET_EVENTS` line. `nextSweep` reads it for `idle-owner` only; never let it touch `review-pending`, `unaccepted-assignment` or `ready-unassigned`. The tool is published only while `task_sweep.enabled` (`profileTaskTools(..., wait)`, status field `taskWait`), and `Tasks.wait` refuses with the same condition, so sweep off changes no tool list. Refusals are `PreEffectToolRefusal` naming cause and next step; the reason is screened and refused, not cut, on an ordinary task.
28
29
  - Planned start (#1092): `plannedStartPending` (`src/hub/task-sweep.ts`) is the only test that a card's `plannedStart` is still ahead. Every automatic path skips such a card: dependent readiness, `backlog_ready` notices, the reserved-ready pick, auto pull and its `guard`, a hub-actor (`by === HUB`) offer, pull or assign of an ownerless backlog or proposed card, and the idle sweep. The planner digest shows it as `scheduled`. A new automatic path asks it too.
29
- - Per-head CI watcher (#785 P1b, `src/hub/ci-watch.ts`, `Tasks.watchCi`, `ciCompleted`, `reofferHeldReview`): when a `done` leaves a review whose admission was not ready at the task's exact full-commit head (or a review is held as premature in `sendReview`), `CiWatchers` starts at most one watcher per task and head, with chained unref'd `setTimeout`s and no interval. Each poll is one `gh pr view` through the `sdlc.gh` port (`pollCi`); `latestCheckRuns` drops older rows only when a same-name check has the same workflow identity and a unique latest start time, otherwise duplicate evidence remains. A cancelled check and a draft PR's deliberately deferred `check (macos-latest)` failure are pending, not failed, and so is an older macOS aggregate failure while a newer same-workflow `check (macos-latest) shard N/M` is queued or in progress with a later start (`awaitingDeferredReplacement`, #1490); missing ordering or workflow evidence stays a failure; other required failures remain failures. It ends on a passed result for the required checks, on `CI_WATCH_DEADLINE_MS`, on `stopCiWatchers` (daemon `stopOnce`), or silently when `ciWatchCurrent` fails (the task left `in_review`, its head or PR changed, the lifecycle is off, it turned private). `complete`, `review` (both verdict writes) and `cancel` cancel it. Each (head, outcome) is told once (`settled`), and only `passed` settles a head for good (#540): after `failed` or `incomplete` the watcher keeps reading for a rerun of that head (the first pending read after each newly told result is a new run attempt and renews the deadline once; later pending or unreadable reads and an unchanged failed result never renew it, so the watcher always ends; a deadline after a told result ends silently), and a later `hub_task_done` at that head starts one again. A newer head replaces the watcher. The result is one ids-only `ci_completed:` task envelope at `status` weight to the owner and the reviewer (`fyi` is never delivered to a peer, so it would not reach them), a console notice for `user`, and for a deadline a console notice only. A passed or incomplete result re-offers a review held as premature once (`heldReviews`, keyed by task, head, reviewer and review revision) after a fresh `reviewRequestAdmission` says ready; a failed one re-offers nothing. No task text goes in the notice, no PII task is watched, and nothing is restored after a hub restart (the next `hub_task_done` starts one). Never add a second periodic gh read outside this watcher.
30
+ - Per-head CI watcher (#1801 T1, `src/hub/ci-watch.ts`, `Tasks.watchCi`, `ciWatchCurrent`, `ciCompleted`): start on the first lifecycle record, wait or completion naming an exact PR head. Keep one chained unref'd timer across draft work, review and approval. A phase change renews its deadline without duplicating the watcher. Cancel on a newer head, merge, close, task cancellation or daemon shutdown. Each poll uses one bounded metadata-only `gh api graphql` call for the head, mergeability, draft transition, checks and thread resolution. Never fetch bodies, paginate or poll from a peer turn. Partial evidence is pending. The draft macOS deferral is excluded from draft owner notices, and a ready PR's old macOS aggregate remains pending if its workflow run predates the latest ReadyForReview event or cannot be placed on either side of it. Only a later run can report that aggregate's failure.
31
+ - Required CI shard reruns (#1801 T3): save the reservation before sending the request. Count a failure as new only by that check's own `startedAt`. Ignore `runAttempt` and check IDs for freshness. Charge an unconfirmed request to its reservation and keep the existing deadline. Skip reruns when the aggregate fails alone. Report the final failure once per check and start time.
32
+ - After each draft push, the owner records `pr`, the full SHA as `localHead` and an actual `localResult` only if available using `hub_sdlc_record`. Without that tool, the owner sends the PR number and full head to the reviewer with `hub_send` without `[FYI]`. The reviewer records `pr` and `localHead` without inventing a result. Either way, the owner ends its turn and waits for the draft CI notice.
33
+ - CI notices are ids-only task envelopes at `status` weight. Draft results go to the owner, review results to owner and reviewer, and approved results to reviewer and conductor. Approved merge readiness requires green required checks and zero unresolved threads. Two consecutive conflicting reads tell the owner and conductor once per head. After ten minutes on that head, a successful empty-check observation with no run ever seen sends a missing-run notice once. Unreadable snapshots do not count. Skip missing-run while the PR is conflicting. If the conflict clears on that head, a successful empty read can trigger the notice. Keep watching until the phase deadline. Non-conflict outcomes are deduplicated per head and phase. Keep the separate, once-only fresh admission when re-offering a held review. Never watch a private task.
30
34
  - Required checks (#1344): resolve the names only through `requiredChecksFor` / `requiredCheckNames` (`src/hub/sdlc-merge.ts`, `src/hub/sdlc.ts`); the built-in `check (...)` and `seeded guards` set applies only to this repository, and an empty set elsewhere is a `required checks unknown` blocker, never a pass.
31
35
  - Draft review (#1576): admit the failed macOS aggregate only with exact-head job-step proof of its draft deferral, a matching fresh PR snapshot and every other required check green. Only on that proven draft may approval defer missing GitHub approval and known outstanding review requests; preserve change-request and unresolved-thread blockers. Never treat that admission as a successful full gate or weaken merge and identical-tree proof.
32
36
  - Build-entry guidance (#1354, `buildEntryDiagnostic` in `src/hub/build-entry.ts`) is pure display data: routing and `route explain` may show it but never read GitHub or change eligibility because of it.
33
37
  - Merge adoption (#1348, `ahub sdlc adopt-merge`, `Tasks.adoptMerge`): only the person or the one configured conductor adopts an already merged PR; it writes `approved` with the `merged outside the hub` event and creates no reviewer verdict, review metric, reviewed-head receipt, guarded-merge result or GitHub mutation, and a private task or turn refuses before any GitHub read. Its bounded GraphQL check read uses `latestCheckRuns`: discard an older same-name row only when workflow identity and a unique latest start time prove which run is newest; preserve duplicate evidence when ordering is uncertain. Contract: `docs/design/task-board.md` "Merged PR adoption".
38
+ - SDLC sync, check and status (#1856, `src/hub/sdlc-sync.ts`, `src/hub/sdlc-check.ts`): `planSdlcSync` and `runSdlcCheck` are pure over injected reads, share one deadline, show public titles only and count private tasks. A sync apply re-plans and refuses unless the preview's fingerprint still matches, then writes only through `Tasks.recordSyncRepair` (a link or a bind, by the person or the configured conductor, never a relink), `Tasks.adoptMerge` and, under roadmap apply authority (`closeSettledGate`), `Tasks.closeSettledIssue`. A bare `sdlc status` lists only unsettled tasks and those of open release trains; `all` keeps the first-100 slice.
34
39
  - External merge readback (#1555, `Tasks.captureExternalMerge`, `settleMergeReadbacks`): host-only and read-only on GitHub, for an approved non-PII task whose repository merge mode is `off`. It writes `sdlc.mergeReadback` with the `merge observed` event and never `sdlc.merge`, a verdict or a GitHub mutation. Save `cost` only from a complete history read, and recheck the task, receipt and policy identity after every await before the write.
35
40
 
36
41
  - Handoff idempotency (#1203 T1): the target writes a handed-off task only through `Board.proposeHandoff` (the proposal and `task_handoff_origin` row, key and request digest in one `atomic` transaction); `handoffIn` asks `replay()` before the duplicate check and again after the PII screen's await, so a retry of a key whose first attempt is still screening files nothing twice. Never `propose` then `setHandoffOrigin` for a handoff, and never compare a key to anything but this origin project's own rows.
@@ -39,6 +44,7 @@ Scope: the task flow, assignment, the state machine and the hub's MCP tools. Rea
39
44
  - Task code symbols (#684 2a) are host-derived: stored only in the `task_code_symbols` table and read through `TASK_SELECT` (`src/hub/board.ts`), so a `SELECT * FROM tasks` reader never exports them. `Board.update` writes `codeSymbols` only with `HOST_CODE_SYMBOLS` and drops it when the head (`refs.commit`, else `sdlc.head`, else `sdlc.localHead`), `refs.repo`, `refs.paths` or `sdlc.repo` changes or the task turns private. Tasks observes them only inside an admitted `done (checking)` or `done` write (`observedCodeSymbols`: non-PII, a full commit, the project repository); a failed or mismatched observation is unknown, never a refusal. Optional code facts (`prepareReviewBrief`) skip PII tasks, never refuse a review, and the actor guard runs again after them.
40
45
  - Public reads of code symbols go through `publicTaskCodeSymbols` (re-screened, no `repositoryKey`). `taskCodeSymbolsDisjoint` only labels a completed-change notice: never suppress a notice or gate on it. `symbolOverlaps` is console detail only: it persists no pair and drops any task marked `pii` or `pii_path`, even with a routing opt-out.
41
46
  - Completion-note symbol anchors (#684 phase 3, `completionMemorySymbols`): anchor a done note only on the current head's screened host observations (`publicTaskCodeSymbols`, this project's repository) that `TasksDeps.memorySymbolNodes` positively confirms; never on plan symbols, and nothing for a PII or foreign task. An unknown observation writes no anchor and the note labels its coverage unknown; earlier notes stay immutable, and missing evidence never refuses done. Read-time code advice (graph neighbours, briefs) asks `memoryCodeEligible` (non-PII, this project's repository, no `refs`/`plan` repository mismatch).
47
+ - Structure budgets (#1829, `[structure]` in `.agenthub/sdlc.toml`, `src/hub/structure-budget.ts`, `src/hub/structure-scan.ts`): `structureNotice` is advice appended to the `hub_task_propose` and `hub_task_accept` result for plan paths already in the baseline and over the budget; it never refuses or changes a task, and a read failure gives no notice. The review brief's "Structure changes" rows come from the merge base's own `sdlc.toml` and baseline, screened by the brief's privacy policy. Only `ahub structure baseline --write` writes the baseline, and over an existing one `updateStructureBaseline` only lowers or drops an entry.
42
48
  - `.agenthub/routing.local.toml` (#269) may hold only `stay_switch` and per-class `peers`, `escalate_to`, `route` and `pi_backend` (`checkOverlay` in `src/hub/routing.ts`): never widen it to targets, routes, signals or constraints, which stay in the hand-written `routing.toml`. `parseRouting` is the one merge, and `assign()` reads `routing.sources` only for its trace line.
43
49
  - Conductor authority requires the explicit unique role before capability checks. The only exceptions run before that check in `Conductor.execute` and stay task-scoped: a task's current owner and reviewer read it with `hub_task_show` (#208; a reviewer-backend peer only during its bound review, rule below), and its proposer redirects it with `hub_task_assign` while nobody ever accepted it and no person moved it (#207). Removing them strands reviewers that missed a review request. Assignments preserve the acting peer. A peer releases only its own conductor hold; operator release and manual, quota and recovery holds remain separate paths.
44
50
  - The PII screen (#198) runs in `propose` before anything else reads the task (no board row, envelope, triage or brief before its verdict), and `unknown` is PII. A call that screens free text (`done`, `review`, `remember`) screens only after its own checks pass, and `done` and `review` run them again after the awaited screen, because the task can change meanwhile. A history entry marked `withheld` stays withheld in public views, completed notices and review requests, whatever `nameable()` says; `ahub ask` shows it only on campus, like a note that matches a PII pattern.
@@ -72,7 +78,7 @@ Scope: the task flow, assignment, the state machine and the hub's MCP tools. Rea
72
78
 
73
79
  - Resolve any id that may be an extra instance or a configured kind through the startup-bound project catalog: `this.d.adapterCatalog` with `this.d.instances?.()` in Tasks, `opts.adapterCatalog` in `assign()` and `relayCandidates`, and the `adapterCatalog` hook in `Conductor`/`conductorStart`; a bare `definitionOf(id)` answers builtins only. Only a kind's routing preference expands to its instances; manual ids, reservations and nominations stay exact. Reviewer independence compares families: take the own family only when no other is eligible, record it through `assignmentNote` (`sameFamilyFallback=true`), explicit nominations included; persist the `instance`/`family` refusal codes as `policy`.
74
80
  - Tool publication (`projectToolList`, `projectConductorTools`, `configuredToolContext` in `src/hub/hub-tools.ts`) only narrows the list or adds start targets, using authenticated status metadata (`configuredAdapters`, `startablePeers`, `readOnlyPeers`); in a configured project, malformed or incomplete metadata publishes the read-only set and adds no start target. Publication is never authority: `taskOp` refuses read-only mutations independently, and MCP task and conductor refusals keep their text and set `isError: true`.
75
- - The kinds a conductor may start are named only through `conductorStartText()` (`src/adapters/registry.ts`, from `start.conductorStartable` and `optional`): the `hub_peer_start` description and the `conductorStart` refusal read it, and a TUI start previews any such kind (#1408 R5). Never write a fixed peer list there.
81
+ - The kinds a conductor may start are named only through `conductorStartText()` (`src/adapters/declaration-data.ts`, re-exported by `src/adapters/registry.ts`, from `start.conductorStartable` and `optional`): the `hub_peer_start` description and the `conductorStart` refusal read it, and a TUI start previews any such kind (#1408 R5). Never write a fixed peer list there.
76
82
  - `hub_set_title` (`SESSION_TITLE_TOOL`, #1055) is in `TASK_TOOL_NAMES` but never in `TASK_TOOLS`; its publication rule is in `adapters.md`, and its `taskOpBody` case accepts only `title`.
77
83
  - Plan sources (#1144): `propose`, `acceptReviewed`, `accept` and `splitBacklog` (every part's cleaned plan, planner split and the hub's intake split alike, #1161) call `validatePlanSources` on the plan they will keep (the new one, else the stored one) before any board write or notice; an id the source registry (`TasksDeps.intake.sourceKnown`) does not know is a `PreEffectToolRefusal` naming `ahub source list`. A new path that admits a plan calls it too.
78
84
  - SDLC metrics and bands (#481 S7): `sdlc-metrics.ts` is pure (history in, numbers out, no clock, no I/O); every metric a task cannot derive is `null`/`unknown`, never 0, and a private task is only counted as withheld. Stale-head re-reviews need both heads on a round (`requestHead` on the done, falling back to `reviewCost.head` or the bound spec-report head on older entries, #1555; `reviewFindings.head` on the verdict): never derive them from event order. `Tasks.sdlcMetrics` is the one read (planner or person, refused during a private turn) and `Tasks.proposeFromBands` the one writer. It is held like every host writer (`sweepHeld`, `bus.isRecoveryHeld`, `bus.storageError`), keys a breach by its episode (`BandResult.episode`, derived from history so a restart finds the same key), writes nothing while the metric has an open band card, and records a log notice in `band_notices` so it is announced once. Card text is fixed words, numbers and task ids, screened through `signalsFor` and `candidateTextAllowed` like the recurring-finding card; never put task titles, notes or PR text in it, and never open a GitHub issue. Drift honours `min_delta` like every tier. `[bands]` is validated by `bandsConfig` with field-level paths; do not add a tier or a metric without a test that fires it. Merge-time figures (#442) come from `MergeRecord.cost`, written once by `guardedMerge` after it observes the merge (`mergeCostFrom`, `cleanMergeCost` in `cost-governance.ts`): re-validate a stored record with `cleanMergeCost` before use, never let that read touch the merge result, and keep a missing or partial read `null`, never 0. `hotfix_rate` and `security_open_alerts` are external series (`EXTERNAL_METRICS`, `Tasks.externalSeries`) whose points are releases and scans, so a card names its `subject`; a legacy release with no train history is left out of the series, never a 0. The security scan (`security-baseline.ts`, `Tasks.runSecurityScan`) reads GitHub's own open-alert counts, runs no scanner, schedules nothing without `[security_scan]`, is held like every host writer, re-judges its schedule after the awaited read and records counts only; a source it cannot read is an unknown total, never zero.
@@ -166,3 +172,4 @@ Scope: the task flow, assignment, the state machine and the hub's MCP tools. Rea
166
172
  - Cross-project handoff (#604, agent-hub#1030, `src/hub/handoff.ts`, `Tasks.handoff*`, `Board.handoff*`): the pure core (`parseHandoff`, `resolveTarget`, `checkTarget`, `handoffEventFor`, `followBackLine`) takes no clock, file or socket; the daemon's `handoffOut` is the one origin path (parse closed, `handoffOutAuthority`: the person, a configured planner or the conductor, refused in a private turn and for a `[pii]` own task; then registry, the target's own status descriptor, the target's reply) and a refusal at any step leaves no row in either board. The target's `Tasks.handoffIn` parses again (a control message is data from another process), sanitizes, refuses a PII pattern or an uncleared screen, asks the daemon's recovery fence before and after the screen's await, and proposes through `Board.proposeHandoff(HUB, ...)` (the handoff idempotency rule above): the origin peer is a record in `task_handoff_origin` and never an actor, a roster peer or a `PeerId` that `Tasks` admits. The spec `issue` is kept as a line of the task's detail. Once the task and its origin row are written nothing fails the handoff (a link, notice or assignment failure becomes the reply's `note`), so the origin always learns the task id. `handoffStatesFor` answers only for tasks whose recorded origin is the asking project, with the fields a live event carries. The inbound `task_handoff`, `task_handoff_event`, `task_handoff_states` and `task_handoff_by_key` control messages are console-role only (the daemon answers an agent connection with a reason, and an unknown one with the usual "does not know"). Follow-back is read from the history entry's event and the task's state (`handoffEventFor`: observed names `accepted`, `done` (in_review, or approved for a class with no reviewer), `approved`, `declined`, `cancelled`, and `changes_requested` and `reopened` (#1203 T2, sent only to an origin that advertises `task_handoff_seq`)), carries only an event name, a PR number, a full SHA and `seq` (the target task's flow revision; an event not newer than the stored `seq` changes nothing), and never throws after a board write; the origin's outbound row is idempotent, and the catch-up (`handoffCatchUp`) asks each running target at start, every 5 minutes and when its control descriptor changes, over every row `handoffCatchUpRow` keeps (open, or approved within `HANDOFF_APPROVED_GRACE_MS`); transport, queueing and key-retry rules are in `daemon.md`. The tables are additive and `task_handoff` is its own recovery label while either holds a row (`Board.hasHandoffState`). `HANDOFF_TOOLS` keep the arguments and results out of memory capture. Never add text from the target to the follow-back line. Duplicate handoffs (#1175): `duplicateIssueTasks` (pure, `src/hub/handoff.ts`) is the one finder and `Tasks.handoffIn` runs it after its last await, right before `board.proposeHandoff`, over the board rows with every `[pii]` row left out, so a refusal writes nothing and names only ids; a sender's `duplicate_ok` (bounded, kept as a detail line) skips it, and a handoff with no `issue` is never refused. Never move the check before the PII screen's await, never name a title in the refusal, and never offer or escalate on a task the check refused. The conductor's cancel of an unaccepted handed-off task is `Tasks.conductorHandoffCancel`, asked inside both `validate()` runs of `Tasks.cancel` (the same `configuredManualConductor` and roster check the unassign path uses), limited to `proposed` or `backlog` with `board.handoffOrigin` set and no `taskHasStarted` or `taskHasWorkEvidence`; the board write records the conductor as the actor, and the follow-back is unchanged.
167
173
 
168
174
  - Reviewer quota admission (#1446): real host routing injects `review.gate` (default 0.8), `review.unknown_quota` (default skip) and current account headroom. Default skip refuses unknown readings; explicit pass admits unknown only while retaining the numeric known floor. Gate off bypasses floor/unknown checks and every quota wait. Preserve actual Budget/manual pauses and all role/health/failure/same-family guards under both opt-outs. Use the same pure selector and rule explanation for assignment, explain and budget readback. With a numeric gate, wait only if every declared reviewer is actually quota-paused or has a known reading at/above the floor, each with a known reset and no other blocker. Bind the first deadline to task incarnation and head/repo; use the first `task_sweep.review_min` deadline as the sole hard cap, never extend it on events/restart (resets only wake rechecks through the existing Budget expiry grace), and cancel old timers on head/privacy/close/stop. Expiry or unknown under skip uses existing planner/person fallback; an admitted unknown never supplies wait evidence. Quota is not a permanent failed reviewer for that head. Per-child `review.max_minutes` (default 20) samples once, ignores activity, and uses existing owned teardown before typed timeout/re-offer.
175
+ - Dependency readiness (#1801): approving a dependency sends each owned, unstarted dependent with nothing left to wait for one ids-only `ready: hub task N approved` status notice to its owner (`ownedReadyDependents` in `releaseDependents`; unowned ones keep `offerReady`), and the planner notice lists them as `owned_ready: #id (owner)`. A reopened and re-approved dependency notifies again.
@@ -24,10 +24,10 @@ Scope: tests, fakes and the test gate. Read before adding or changing a test or
24
24
  - A bounded polling wait must assert its condition after the last attempt, or document why giving up is intentional. Bound it by time (a deadline with short sleeps), never by a count of event-loop turns (`setImmediate`), which a loaded runner spends before a socket frame or child output arrives (#1163, `untilSeen` in `test/control-client.test.ts`). Append-only event histories wait for a correlated closing event, not removal of the opening event. Before changing a slow wait, identify the unreached state and repair its cause (#296).
25
25
  - A test of turn or notice behavior that is not about the snapshot budget yields an I/O turn (`await new Promise(r => setImmediate(r))`) between captures: captures in one synchronous burst share the 250 ms budget and may correctly record unknown evidence. A daemon test whose assertion needs a turn's snapshot or end evidence passes `snapshotClock: () => 0` (`DaemonOptions.snapshotClock`, #661) so a slow runner cannot spend that budget; never lengthen the budget instead (#550). A wait on concurrent-edit evidence correlates the expected turn ids and paths (#617).
26
26
  - Holding the snapshot budget clock (`snapshotClock`, #661) holds the deadline and, since #554, the git child's wall-clock timeout (the 10 s ceiling instead of the remaining budget). The rule lives in the pure `childTimeoutMs` (`src/hub/snapshots.ts`: production keeps min(10000, remaining), only a budget carrying `now` gets the ceiling). Reproduce a slow git with a deliberately slow `git` first on PATH (`slowGit` in `test/snapshots.test.ts`), never with host-wide load, and never run a high-parallel loop while another gate shares the dgx02 host.
27
- - The macOS CI leg uses four shards and the Ubuntu leg six (#548, #1490): `check (ubuntu-latest) shard i/6` and `check (macos-latest) shard i/4` run `AHUB_CHECK_SHARD=i/n scripts/check.sh` (`bun test --shard --timings=scripts/test-timings.json`), and each stable job name `check (ubuntu-latest)` / `check (macos-latest)` is the aggregator over its OS shards; `scripts/ci-gates.mjs`, branch protection and the reuse proof read that name, so never rename it or turn it back into a matrix job without reading them. `gateJob()` in `scripts/ci-gates.mjs` counts the shard names (`check (ubuntu-latest) shard i/N` and `check (macos-latest) shard i/N`) as gate jobs, so a run with either OS and the seeded shards done and only the other OS shards running reads as a launched full gate and not as unknown scope (`test/ci-reuse.test.ts` pins every mid-run window). A new test file needs no timing entry (it gets the median), but a shard that grows past about 15 minutes means the timings are stale: regenerate them with `scripts/make-test-timings.ts`. A shard starts the suite cold, so `scripts/check.sh` execs the system git once (`AHUB_CHECK_WARM_GIT`, default `/usr/bin/git`) before the tests, because tests that give it `PATH=/usr/bin:/bin` and a 1000 ms timeout (`read-only-shell-proof`, `task-shell-default`) are killed by a cold first exec; a failing or absent warm-up never fails the shard. `check.sh` unsets `AHUB_CHECK_SHARD` after building the test arguments, so the runner and every scratch `check.sh` a test spawns (`test/check-lock.test.ts` copies `process.env`) see an unsharded environment; keep that unset. A test must not depend on running in the same process as another file (shards split files across machines), and anything that has to happen once per gate belongs behind the shard-1 condition in `scripts/check.sh`, which `test/macos-shard.test.ts` pins.
27
+ - The macOS CI leg uses five shards and the Ubuntu leg six (#548, #1490): `check (ubuntu-latest) shard i/6` and `check (macos-latest) shard i/5` run `AHUB_CHECK_SHARD=i/n scripts/check.sh` (`bun test --shard --timings=scripts/test-timings.json`), and each stable job name `check (ubuntu-latest)` / `check (macos-latest)` is the aggregator over its OS shards; `scripts/ci-gates.mjs`, branch protection and the reuse proof read that name, so never rename it or turn it back into a matrix job without reading them. `gateJob()` in `scripts/ci-gates.mjs` counts the shard names (`check (ubuntu-latest) shard i/N` and `check (macos-latest) shard i/N`) as gate jobs, so a run with either OS and the seeded shards done and only the other OS shards running reads as a launched full gate and not as unknown scope (`test/ci-reuse.test.ts` pins every mid-run window). A new test file needs no timing entry (it gets the median), but a shard that grows past about 15 minutes means the timings are stale: regenerate them with `scripts/make-test-timings.ts`. A shard starts the suite cold, so `scripts/check.sh` execs the system git once (`AHUB_CHECK_WARM_GIT`, default `/usr/bin/git`) before the tests, because tests that give it `PATH=/usr/bin:/bin` and a 1000 ms timeout (`read-only-shell-proof`, `task-shell-default`) are killed by a cold first exec; a failing or absent warm-up never fails the shard. Only on a hosted GitHub runner (`GITHUB_ACTIONS=true` and `RUNNER_ENVIRONMENT=github-hosted`), probe `gh auth status --hostname github.com` once before warming git. This avoids probing a person's login on a local shard. Cap the probe at 15 seconds and report only elapsed milliseconds and its exit class. `check.sh` unsets `AHUB_CHECK_SHARD` after building the test arguments, so the runner and every scratch `check.sh` a test spawns (`test/check-lock.test.ts` copies `process.env`) see an unsharded environment; keep that unset. A test must not depend on running in the same process as another file (shards split files across machines), and anything that has to happen once per gate belongs behind the shard-1 condition in `scripts/check.sh`, which `test/macos-shard.test.ts` pins.
28
28
  - CI rerun policy (#1257): a red `check` job gets **one** rerun of the failed jobs on the same head SHA (`gh run rerun <run id> --failed`), never a new commit or an empty push to retry. If the rerun passes, the first failure is a flake: it is not "fixed by the rerun", it goes into the flake ledger below with the failing test named. If the rerun fails too, or the same test failed on an earlier head, treat it as a defect and investigate before any third attempt; a hang (the watchdog stop, a shard at its timeout) is investigated even when the rerun passes. Never edit or skip a test to get green (AGENTS.md). The aggregator names (`check (ubuntu-latest)`, `check (macos-latest)`, `seeded guards`) and the identical-tree reuse proof (`scripts/ci-reuse.mjs`, `scripts/ci-gates.mjs`) are unchanged by a rerun: a rerun is another attempt of the same run, and the proof reads the final state of its jobs.
29
29
  - Flake ledger (#1257): the weekly `flake-ledger` workflow (`scripts/flake-ledger.ts`, `permissions`: `contents: read`, `actions: read`, `issues: write`) reads the Actions runs for `check.yml` of the last 28 days and lists the gate shard jobs that failed and then passed on the same head SHA, per test file and failing test name (the `(fail)` lines of the failed job's log, under the `##[group]test/x.test.ts:` header they ran in), split into macOS-only, Ubuntu-only and both-OS classes. It edits one tracking issue titled `CI flake ledger (check.yml)` (found by that title and a body marker, created once, never one issue per run). It is bounded: five run pages, 60 runs, 40 logs, 8 MiB per log, and it says when a bound cut the window. A job that failed with no `(fail)` line (a hang, a crash) is listed under its job name, never dropped. The top entries (the issue ranks by test file, since one broken file fails many tests at once) each need an owner and a deadline: a fix, or a quarantine with its own issue. Read it before calling a failure "just a flake". Run it by hand with `GITHUB_REPOSITORY=<owner/name> bun scripts/flake-ledger.ts --dry-run`; the aggregation (`parseFailures`, `flakyJobs`, `aggregateFlakes`, `pickTrackingIssue`) is pure and pinned by `test/flake-ledger.test.ts`.
30
- - Shard weights (#1257): `scripts/test-timings.json` is regenerated monthly, or when a shard exceeds its budget by 25 % (budget 15 min, so a shard past 18.75 min; `scripts/lib/ci-shards.ts`). `bun scripts/refresh-test-timings.ts --check` prints the shard times of the newest green `main` run, the 25 % rule and the age of the weights file (exit 1 when a shard is over budget or the file is older than 35 days). `bun scripts/refresh-test-timings.ts [run id]` downloads the four macOS shard logs of that run and rewrites the file through `scripts/make-test-timings.ts` (it takes several logs, a shard log holding only its own files); review the diff and commit it in its own PR, never inside a PR that is squash-merged with unrelated changes. The format is unchanged (`{ "version": 1, "files": { "test/x.test.ts": ms } }`, slowest first), so `bun test --shard --timings` and `scripts/check.sh` read it as before. A file missing from it still runs with the median time, so stale weights are slow, never wrong.
30
+ - Shard weights (#1257): `scripts/test-timings.json` is regenerated monthly, or when a shard exceeds its budget by 25 % (budget 15 min, so a shard past 18.75 min; `scripts/lib/ci-shards.ts`). `bun scripts/refresh-test-timings.ts --check` prints the shard times of the newest green `main` run with five timed macOS shards, the 25 % rule and the age of the weights file (exit 1 when a shard is over budget or the file is older than 35 days). `bun scripts/refresh-test-timings.ts [run id]` downloads the five macOS shard logs of that run and rewrites the file through `scripts/make-test-timings.ts` (it takes several logs, a shard log holding only its own files); review the diff and commit it in its own PR, never inside a PR that is squash-merged with unrelated changes. The format is unchanged (`{ "version": 1, "files": { "test/x.test.ts": ms } }`, slowest first), so `bun test --shard --timings` and `scripts/check.sh` read it as before. A file missing from it still runs with the median time, so stale weights are slow, never wrong.
31
31
  - A fake-ripwire CodeFacts fixture (`test/memory-code-overlay-684.test.ts`, `test/memory-stale-followups-684.test.ts`, #723, #1261) installs the fake through `installFakeRipwire` (`test/helpers/ripwire-probe.ts`) and builds `CodeFacts` with `trace: probe.trace`. A failure then carries, beside the fake's shim, script and output timings, the product's own time for every git step of `tree()` and every ripwire launch (`CodeFacts` option `trace`, absent in production, read-only, no effect on an answer, bound or cap). Read that report before changing a bound: the two files failed on macOS shard 2/4 five times before the shim warm-up of #1197 and never in 120 attempts after it, and no cause was observed (a 40-way local stress did not reproduce it), so a recurrence is the evidence to read. Never lengthen the 5 s product cap or the 20 s test timeout for it, and never skip the test.
32
32
  - A test that proves a daemon answers while work is still running asserts ordering (the answer arrived before the producer finished), never an elapsed wall-clock bound: the daemon promises no millisecond figure for `status`, so a bound measures the runner, not the product (#531); a request timeout in such a test is a hang guard only.
33
33
  - A tight wall-clock bound in a test must be sized for the slowest CI runner, or replaced by a barrier (#559). Hosted macOS shards run each test about 1.5 times slower than the old single leg (and git-heavy tests about 7 times), so three unchanged tests tipped over once each after #954: `test/path-policy.test.ts` (the #541 hardlink loops took 10.6 s idle for three layouts in one test and 27 s on a shard, past the 20 s limit: the loops are now five parts of 1000 iterations per layout, 5000 per layout kept, about 0.8 s per part), `test/code-facts.test.ts` (a 400 ms deadline raced the fake CLI writing its child marker, which takes about 0.3 s idle and 1.4 s at 30-way load: the test now holds the deadline timers by the configured value, waits for the marker and fires the analysis's own deadline callback, a barrier with the real deadline code; because the held deadlines never fire by themselves, its `finally` must `close()` the reader and await the analysis before the fixture is removed, and a second test pins that teardown) and `test/smoke-pty.test.ts` (the macOS PTY bridge hung inside `Bun.spawn` with a `terminal` when its child wrote and exited before the call returned: Bun up to 1.4.3, oven-sh/bun#45300, fixed in 1.4.4; 26 of 96 bare-Bun runs at 12-way parallel, none of 180 on 1.4.4. A longer timeout cannot help a process that never starts and a retry only lowers the odds, so until the 1.4.4 pin (hub task 940) the bridge started its child behind a gate it opened after `Bun.spawn` returned, and the retry helper is gone (#560); the bridge also stops its child when its caller dies, and a test names a hung bridge with `runPtyWith` instead of relying on load). When a test needs a bound, measure the slow tail under 30-way local load, size the bound from it with the number in a comment, and prefer a readiness signal (a marker file the fake writes before it hangs, with the deadline fired after it) over a shorter deadline or a longer margin: a margin still depends on the runner's speed, a barrier does not.
@@ -68,4 +68,5 @@ Scope: tests, fakes and the test gate. Read before adding or changing a test or
68
68
  - Hard-coded values inventory (#719, #1180, `scripts/inventory-hardcoded-values.ts --check`, a once-only step of `scripts/check.sh`): a constant or inline literal you add to `src/` or `scripts/` is an inventory entry, and the gate fails until it is classified in `scripts/inventory-hardcoded-values.classifications.json` (`operational`, `safety floor`, `contract` or `test seam`, by the reasons of `docs/verification/2026-10-30-operational-settings-closure.md`). Never add a key to `scripts/inventory-hardcoded-values.baseline.json`: it is the list of keys that were unclassified when the check began and it only shrinks. Classify a baseline key by adding it to the classifications file and deleting it from the baseline in the same commit; the check refuses either half alone. For `src/hub` bounds and truncations, apply the committed conventions and rulings in `docs/verification/2026-11-05-hardcoded-values-classification-rules.md` (#739/#741). Before each batch, run a fresh blind sample of 80 already-decided entries and proceed only at 85% agreement or more. Outside that settled slice, a baseline key needs a calibrated mechanical rule that the committed file agrees with on at least 94% of its decided keys; leave an undecided shape in the baseline pending a ruling, never guess its label. Do not classify keys in bulk from reading the code: a blind pass agreed with the committed file on 58% of a sample, because the file counts hub-internal caps, injected `opts.x ?? N` defaults and script deadlines as operational (`docs/verification/2026-11-05-hardcoded-values-ratchet.md`). A line moved inside a file changes no key; a changed value or name does. After adding keys to the classifications file, keep it sorted by key in codepoint order (a key appended at the end breaks `test/inventory-hardcoded-values.test.ts`, which `--check` does not catch) and run that test. Seen on hub task 992 (PR #1544) and hub task 991 (PR #1548), 2026-11-17.
69
69
  - Unused exports (#1649, `scripts/unused-exports.ts --check`, a once-only step of `scripts/check.sh` after the inventory): an export of `src/` that no other file imports, or that only `test/` and `src/adapters/conformance/` import, fails the gate unless it is in `scripts/unused-exports.baseline.json`, and that file only shrinks: delete the export and its key together, and a baseline key that is imported now or gone must leave it in the same commit. Entry points are a contract, not a use: every target of `package.json` `bin` and `exports` (a `.js` target is its `.ts` source) and the three files `scripts/build.mjs` bundles by name are never findings. A name reached only through a string is declared with `// used-by: <repo-relative file>` above the declaration, and the check fails if that file does not exist. `import * as`, `export * from` and a literal `import(…)` count a whole module as used. The program is built with `types: []` in about 2 s, and adding a once-only step means editing three step lists in `test/macos-shard.test.ts` (`ONCE` and both ordered lists), or the shard tests fail. Seen on hub task 1093 (PR #1673), 2026-11-24.
70
70
  - CLI output inventory (#1654 T4, `bun scripts/cli-output-inventory.ts --check`, the once-only step after unused exports): a change to help text, the dispatch table, an adapter's CLI entry or a renderer that ages `docs/design/cli-output-inventory.md` fails the gate. Regenerate it with `bun scripts/cli-output-inventory.ts --write` in the same commit; never edit the table by hand.
71
- - Refusal continuations (#1643, `bun scripts/refusal-inventory.ts --check`, the once-only step after the CLI output inventory): a `new PreEffectToolRefusal`, a `new HandoffRefusal` or a `fail(...)` in `src/cli/main.ts` with static text names a runnable continuation (an `ahub` command with flags its help lists, or a declared `hub_*` tool), or carries `// refusal:by-design operator-knowledge|world-action|human-authority: <reason>` on the line above. `scripts/refusal-inventory.baseline.json` only shrinks: never add a `missing` key, remove a key when its message is fixed or gone, lower `dynamicCeiling` when fully dynamic sites fall, and give a new dynamic refusal a static fragment with a continuation instead of raising it. An unknown command, flag or tool fails even on a baselined site (`docs/design/refusal-inventory.md`).
71
+ - Refusal continuations (#1643, `bun scripts/refusal-inventory.ts --check`, the once-only step after the CLI output inventory): a `new PreEffectToolRefusal`, a `new HandoffRefusal` or a `fail(...)` in `src/cli/main.ts`, `src/cli/command-table.ts` or `src/cli/commands/` with static text names a runnable continuation (an `ahub` command with flags its help lists, or a declared `hub_*` tool), or carries `// refusal:by-design operator-knowledge|world-action|human-authority: <reason>` on the line above. `scripts/refusal-inventory.baseline.json` only shrinks: never add a `missing` key, remove a key when its message is fixed or gone, lower `dynamicCeiling` when fully dynamic sites fall, and give a new dynamic refusal a static fragment with a continuation instead of raising it. An unknown command, flag or tool fails even on a baselined site (`docs/design/refusal-inventory.md`).
72
+ - Shared test shapes (#1830 S5): a polling wait in a test imports the `until` shape with its loop bound, sleep and failure behavior from `test/helpers/until.ts` instead of declaring a local copy. Never fold two shapes with different bounds into one: the helper keeps each variant as its own export.
@@ -63,7 +63,7 @@ Every run record, diff, PTY/provider trace and evaluation artifact stays in the
63
63
 
64
64
  `scripts/benchmarks/manifest-v2.json` keeps v1's cases, models and limits and adds a fourth arm, `hub-turnfree-codex-claude` (issue #110): the same two agents and assignment rotation as `hub-codex-claude`, with `coordination: "turn-free"` in the fixture's hub config and fixture instructions that tell the owners not to message each other. A v1 manifest still validates and prepares. Its cohorts are run, graded and reported with the release and runner sources they were prepared with: `native.ts` refuses a manifest whose hub version is not the checkout's (v1 pins 0.12.3), and `runner.py` refuses to grade a cohort whose runner sources differ from its own.
65
65
 
66
- Every Claude-participating arm runs the same isolated status-line tee (`src/cli/statusline-tee.ts`) to produce `benchmark-usage/claude-usage.json` under the arm's hub state directory for #134. The daemon consumes only the parent `claude-usage.json` for budget and routing; the observer's separate directory leaves those inputs unchanged. Generated session settings set `disableAllHooks: false` because Claude Code gates status-line execution with that flag; the solo and advisory sessions have an empty hook map, and the turn-free session carries only the hub's facts hooks. The existing `--restricted` launch ignores user, project and local settings files; the explicit `--settings` file and managed settings still apply. User/plugin hook settings are not copied into the session. The tee has no original status-line command to run. This instrumentation profile is recorded as `conditions.claude.statusLine: true` and `disableAllHooks: false`, and source/settings hashes prevent mixing it with historical hookless runs. See [Claude Code status-line execution and troubleshooting](https://code.claude.com/docs/en/statusline#troubleshooting).
66
+ Every Claude-participating arm runs the same isolated status-line tee (`src/cli/statusline-tee.ts`) to produce `benchmark-usage/claude-usage.json` under the arm's hub state directory for #134. The daemon consumes only the parent `claude-usage.json`, plus one `claude-usage.<tag>.json` per declared Claude account (#1810), for budget and routing; the observer's separate directory leaves those inputs unchanged. Generated session settings set `disableAllHooks: false` because Claude Code gates status-line execution with that flag; the solo and advisory sessions have an empty hook map, and the turn-free session carries only the hub's facts hooks. The existing `--restricted` launch ignores user, project and local settings files; the explicit `--settings` file and managed settings still apply. User/plugin hook settings are not copied into the session. The tee has no original status-line command to run. This instrumentation profile is recorded as `conditions.claude.statusLine: true` and `disableAllHooks: false`, and source/settings hashes prevent mixing it with historical hookless runs. See [Claude Code status-line execution and troubleshooting](https://code.claude.com/docs/en/statusline#troubleshooting).
67
67
 
68
68
  Every emitted arm record carries `claudeUsage.pre` and `claudeUsage.post`. Claude arms wait up to 1.5 seconds for an observer write after probe completion plus the 300 ms status-line debounce before starting active work. The isolated producer refreshes once per second. After active work, a post reading is trusted only if the final turn ended and an observer write follows that settled boundary plus the debounce. Timeout, interruption, unsupported/unsettled turn completion or a missing fresh write records explicit unknown; a cached pre value is never treated as post consumption. These waits stay outside active-work time and do not make collection failure fail an attempt. Solo-Codex launches no Claude just to measure quota, and records explicit unknown with the reason that there is no Claude actor. Readings retain the file's own `at`; expired or invalid-reset windows are marked stale, all-stale/missing/unreadable/malformed data is unknown, and collection failure does not fail an attempt. The file reader refuses symlinks, special files and oversized data, so a FIFO cannot hold teardown. Grade `native_usage.claude` keeps transcript-derived token counts and adds pre/post. Rate-limit fields are optional and appear only after an API response on supported accounts: producer wiring does not establish live provider collection. The first study block must validate actual non-unknown Claude-arm readings before later blocks rely on quota deltas.
69
69
 
@@ -143,6 +143,23 @@ The Claude plugin's inherited launcher marker is insufficient to enable push. In
143
143
 
144
144
  The flattened process row is a conservative launch observation, not authentication or proof of registration or model consumption. Unsupported invocation layouts remain pull-only. An attached peer's status reports its mode and a closed evidence label without command text. Evidence belongs to that socket's attachment and is omitted when no current attachment exists. Older clients that omit the optional evidence field retain their prior behavior and report `unreported`; no control protocol version changes. The separate delivery-settlement contract handles an accepted notification that remains unconfirmed. The [investigation report](../verification/2026-11-04-1171-channel-client-evidence.md) distinguishes static client inspection, passive process observation and synthetic fixtures.
145
145
 
146
+ ## Hub check at an agent's start (#1798 T3)
147
+
148
+ Every `ahub <agent>` TUI wrapper (claude, codex, kimi, jcode, pi, qwen, agy; not `local`, not a hub-started headless path, not `--print-command` or `--dry-run`) prints a short `Hub check` to stderr, only when stderr is a terminal (`process.stderr.isTTY === true`, checked in `printLaunchCheck` and again in the Claude `beforeSpawn` callback, which then makes no connection; with stderr redirected `ahub status` shows the same state), before it execs or spawns the agent, from the `hubCheck` the daemon returned in the status read the wrapper already makes for this launch. The Claude TUI path has none, so it makes one connection attempt at the spawn boundary (`runClaudeLaunch`'s `beforeSpawn`, through the entry context's `connectOnce`): no retry, no instance check, one 3-second deadline for connect and request, and a late connection is closed with no request sent. The agent has not started, so the line is neutral, never a mark: `<agent>: starting, expected link <push|pull>, <n> queued` (or `queue unknown` with no row) and `ahub status` to check again after it starts. The expected link comes from the row, else from `expectedHubLink` for the wrapper's definition and form. A row that is not offline adds `state before this launch: <state>` with its cause, without its mark or next step, and never claims that an earlier session is still attached. The only warning is a check that could not be read, or a snapshot with no `hubCheck`, with `ahub status` as its next step; it never blocks the launch. Every printed line is cleaned (`plain` from `warn-line.ts`, line breaks replaced by a space).
149
+
150
+ | Agent | Before launch | Inside the session |
151
+ |---|---|---|
152
+ | Claude | wrapper line | `SessionStart` entry (startup and resume only), verified for this session through the daemon's `thisLaunch` display hint |
153
+ | Codex, jcode, Pi, Qwen | wrapper line (TUI launches only) | none |
154
+ | Kimi | wrapper line | none: our managed plugin registers no `SessionStart` event (`src/cli/kimi-plugin.ts`), and no user-visible start output is confirmed |
155
+ | agy | wrapper line | none: `SessionStart` can add an `ephemeralMessage` for the model, but output visible to the person and how often it fires are not confirmed, so only the wrapper shows the check |
156
+
157
+ Claude's session-start entry is opt-in (`FactsHook.startCheck`, set only by the interactive `ahub claude` entry and its preview) and is its own command: the same `facts-hook.ts` run with `AGENTHUB_HOOK_PURPOSE='start-check'`, which only that exact value selects before `factsHook` is called and which never falls through to it. It sends no `facts` or `native_facts` request, records no native session or turn and turns on no idle, facts or sweep behavior. Where the observation entry also fires on `SessionStart`, the check is a second, separate entry. Its total time (process start included) stays clearly below the entry's 5-second timeout, a read failure or timeout prints a warning payload with its next step and exits 0 with a valid document, and an unanswered check is never shown as OK. `clear` and `compact` print nothing. Its lines are cleaned before they are joined.
158
+
159
+ The daemon answers one optional boolean on the existing plain `status` request, `thisLaunch`, only to a tools connection that acts as its own named Claude channel peer (not a minted session, not a hub-owned child) and carries a non-empty launch id. It is true only if that peer is attached and its current socket (not a standby) holds the same launch id, and false otherwise; everyone else gets no field. It is computed per request, never cached, never part of `hubCheck` or the status file, and the launch id is never returned or logged. It is a display hint: anyone who holds the control token can send any launch id, so it never decides admission, routing, delivery or permissions. The hook shows OK only when `thisLaunch` is true and its `hubCheck` row is OK in the same reply; false re-reads within the bound and then shows `pending`; a missing field (an older hub) reads `this session's link could not be verified`.
160
+
161
+ Unmet on purpose: AC4's in-session check inside Kimi and inside agy. #1798 stays open.
162
+
146
163
  ## Person takeover of a channel peer (#1174)
147
164
 
148
165
  An opted-in channel process may retain a live, non-owning standby connection when
@@ -276,6 +293,10 @@ until another native read. Older clients may omit the additive accountUsage
276
293
  projection. Native/account effectiveness remains separate from fake-clock and
277
294
  fake app-server fixtures.
278
295
 
296
+ ## Quota ports (#1806)
297
+
298
+ `PeerAdapter.compareQuotaHome` (a synchronous comparison of two members' quota homes before and at the save of an explicit renewal) and `PeerAdapter.readQuotaNow` (an immediate quota read after the renewal is saved) are optional ports. Only fixed builtin definitions may provide either; the hub checks definition identity before it reads either member. The behavior is in the #1806 text of [docs/specs/2026-09-19-agent-hub-design.md](../specs/2026-09-19-agent-hub-design.md) ("Budget relay") and is not repeated here.
299
+
279
300
  ## Observed turn model (#1402)
280
301
 
281
302
  An optional `PeerAdapter.onActivity` callback reports a closed category for the