@staix/agent-hub 0.34.1 → 0.36.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 (213) hide show
  1. package/CHANGELOG.md +73 -0
  2. package/README.md +53 -7
  3. package/docs/adding-an-ai-tool.md +2 -2
  4. package/docs/addons/claude-mem.md +4 -4
  5. package/docs/addons/open-code-review.md +1 -1
  6. package/docs/agent-notes/README.md +66 -0
  7. package/docs/agent-notes/adapters.md +14 -7
  8. package/docs/agent-notes/budget.md +1 -1
  9. package/docs/agent-notes/bus.md +2 -1
  10. package/docs/agent-notes/daemon.md +9 -7
  11. package/docs/agent-notes/local-worker.md +1 -1
  12. package/docs/agent-notes/models.md +5 -2
  13. package/docs/agent-notes/tasks.md +9 -2
  14. package/docs/agent-notes/tests.md +6 -0
  15. package/docs/design/adapters.md +182 -2
  16. package/docs/design/agent-hub-architecture.md +64 -2
  17. package/docs/design/agent-hub.md +6 -0
  18. package/docs/design/bus.md +26 -0
  19. package/docs/design/execution-reference.md +306 -0
  20. package/docs/design/guidance-experiments.md +438 -0
  21. package/docs/design/model-routes.md +628 -0
  22. package/docs/design/supervision.md +121 -0
  23. package/docs/design/task-board.md +121 -0
  24. package/docs/dogfood.md +45 -13
  25. package/docs/events.md +38 -20
  26. package/docs/memory.md +21 -7
  27. package/docs/operations.md +824 -40
  28. package/docs/profiles.md +2 -2
  29. package/docs/quickstart.md +117 -4
  30. package/docs/research.md +73 -13
  31. package/docs/roles.md +1 -1
  32. package/docs/sdlc.md +117 -11
  33. package/docs/security.md +153 -15
  34. package/docs/smoke.md +14 -0
  35. package/docs/specs/2026-09-19-agent-hub-design.md +13 -7
  36. package/docs/verification/2026-10-25-qwen-dual-output-t0.md +22 -0
  37. package/docs/verification/2026-11-07-compat-python-startup-1248.md +51 -0
  38. package/docs/verification/2026-11-07-compat-receipt-harness-1248.md +105 -0
  39. package/docs/verification/2026-11-07-compat-receipt-producers-1248.md +96 -0
  40. package/docs/verification/2026-11-07-compat-workflow-1248.md +94 -0
  41. package/docs/verification/2026-11-07-daemon-startup-1232.md +169 -0
  42. package/docs/verification/2026-11-07-jcode-receipt-reconstruction-1248.md +118 -0
  43. package/docs/verification/2026-11-07-kimi-delayed-usage.md +34 -0
  44. package/docs/verification/2026-11-07-kimi-review-watch-1284.md +115 -0
  45. package/docs/verification/2026-11-08-agy-1.5.3.md +96 -0
  46. package/docs/verification/2026-11-08-agy-acp-t0.md +56 -0
  47. package/docs/verification/2026-11-08-hub-visual-1058.md +161 -0
  48. package/docs/verification/2026-11-08-jcode-0991-model-setter-1317.md +143 -0
  49. package/docs/verification/2026-11-08-kimi-252-model-setter-1317.md +137 -0
  50. package/docs/verification/2026-11-08-kimi-tui-completion-1282.md +45 -0
  51. package/docs/verification/2026-11-08-kimi-wire-yield-1283.md +31 -0
  52. package/docs/verification/2026-11-08-live-model-override-1317.md +250 -0
  53. package/docs/verification/2026-11-08-qwen-0269-acp.md +138 -0
  54. package/docs/verification/2026-11-08-qwen-0269-model-setter-1317.md +91 -0
  55. package/docs/verification/2026-11-09-0.35.0.md +129 -0
  56. package/docs/verification/2026-11-09-headless-records-1320.md +157 -0
  57. package/docs/verification/2026-11-09-qwen-0270-acp.md +181 -0
  58. package/docs/verification/2026-11-09-qwen-0270-model-setter-1317.md +46 -0
  59. package/docs/verification/2026-11-10-0.36.0.md +59 -0
  60. package/docs/verification/2026-11-10-claude-implementer-2.1.322.md +59 -0
  61. package/docs/verification/2026-11-10-qwen-0270-dual-output.md +367 -0
  62. package/docs/verification/2026-11-10-qwen-0271-dual-output.md +101 -0
  63. package/docs/verification/claude-permission-transport-native.py +10 -3
  64. package/docs/verification/claude-shell-wrapper-native.py +8 -8
  65. package/docs/verified.json +245 -15
  66. package/package.json +3 -3
  67. package/plugins/agent-hub/.claude-plugin/plugin.json +1 -1
  68. package/plugins/agent-hub/kimi-hook.js +21230 -0
  69. package/plugins/agent-hub/kimi-review-policy-worker.js +217 -0
  70. package/plugins/agent-hub/server.js +4359 -1071
  71. package/scripts/check-docs.mjs +12 -1
  72. package/src/adapters/acp-model-policy.ts +56 -0
  73. package/src/adapters/acp.ts +175 -5
  74. package/src/adapters/agy/entry.ts +8 -5
  75. package/src/adapters/agy/hooks.ts +65 -15
  76. package/src/adapters/channel-peer.ts +33 -1
  77. package/src/adapters/claude-channel.ts +7 -4
  78. package/src/adapters/claude-implementer.ts +16 -3
  79. package/src/adapters/codex-appserver.ts +118 -8
  80. package/src/adapters/codex-review-isolation.ts +3 -1
  81. package/src/adapters/compat.ts +18 -13
  82. package/src/adapters/definitions/builtin-metadata.ts +8 -1
  83. package/src/adapters/definitions/native-cli-entry-kimi.ts +76 -7
  84. package/src/adapters/definitions/native-cli-preview-common.ts +2 -2
  85. package/src/adapters/definitions/native-cli-preview-kimi.ts +9 -2
  86. package/src/adapters/definitions/reviewer-variants.ts +3 -1
  87. package/src/adapters/kimi-review-policy-worker.js +2 -0
  88. package/src/adapters/kimi-review-policy-worker.ts +85 -0
  89. package/src/adapters/kimi-review-policy.ts +68 -0
  90. package/src/adapters/kimi-review.ts +41 -41
  91. package/src/adapters/kimi-tui-facts.ts +153 -0
  92. package/src/adapters/kimi-wire-usage.ts +33 -8
  93. package/src/adapters/local-worker.ts +60 -21
  94. package/src/adapters/model-token.ts +3 -0
  95. package/src/adapters/pi.ts +27 -5
  96. package/src/adapters/qwen-dual.ts +324 -44
  97. package/src/adapters/registry-types.ts +34 -3
  98. package/src/adapters/registry.ts +1 -0
  99. package/src/adapters/reviewer-policy-watch.ts +86 -0
  100. package/src/adapters/reviewer-print.ts +80 -18
  101. package/src/cli/agents.ts +1 -1
  102. package/src/cli/facts-hook.ts +4 -2
  103. package/src/cli/guidance.ts +67 -0
  104. package/src/cli/help.ts +13 -5
  105. package/src/cli/identity.ts +13 -3
  106. package/src/cli/init-prompt.ts +15 -2
  107. package/src/cli/init-required-checks.ts +122 -0
  108. package/src/cli/init-settings.ts +10 -4
  109. package/src/cli/init.ts +39 -3
  110. package/src/cli/kimi-facts-hook.ts +11 -0
  111. package/src/cli/kimi-plugin.ts +157 -0
  112. package/src/cli/lineage.ts +78 -0
  113. package/src/cli/main.ts +159 -19
  114. package/src/cli/model.ts +52 -0
  115. package/src/cli/output.ts +23 -1
  116. package/src/cli/reset.ts +1 -1
  117. package/src/cli/setup-research.ts +10 -0
  118. package/src/cli/status-lines.ts +8 -4
  119. package/src/hub/autonomy-defaults.ts +20 -9
  120. package/src/hub/board.ts +346 -4
  121. package/src/hub/budget.ts +1 -1
  122. package/src/hub/build-entry.ts +11 -0
  123. package/src/hub/bus.ts +52 -2
  124. package/src/hub/ci-watch.ts +4 -4
  125. package/src/hub/code-facts.ts +10 -3
  126. package/src/hub/completions.ts +3 -1
  127. package/src/hub/config-apply.ts +3 -1
  128. package/src/hub/config-trust.ts +1 -0
  129. package/src/hub/control-client.ts +1 -1
  130. package/src/hub/daemon.ts +1387 -121
  131. package/src/hub/deliverable-files.ts +38 -5
  132. package/src/hub/delivery-hints.ts +4 -2
  133. package/src/hub/delivery-journal.ts +50 -2
  134. package/src/hub/delivery-public.ts +51 -0
  135. package/src/hub/dogfood-profile.ts +9 -5
  136. package/src/hub/envelope.ts +1 -1
  137. package/src/hub/events.ts +28 -18
  138. package/src/hub/execution-lineage-owner.ts +272 -0
  139. package/src/hub/execution-lineage.ts +164 -0
  140. package/src/hub/execution-links.ts +85 -0
  141. package/src/hub/execution-reference.ts +36 -0
  142. package/src/hub/guidance-variants.ts +398 -0
  143. package/src/hub/handoff.ts +1 -0
  144. package/src/hub/hub-tools.ts +62 -2
  145. package/src/hub/instances.ts +4 -3
  146. package/src/hub/kimi-events.ts +46 -0
  147. package/src/hub/kimi-usage.ts +132 -29
  148. package/src/hub/lifecycle.ts +31 -15
  149. package/src/hub/limits.ts +13 -4
  150. package/src/hub/manager.ts +58 -3
  151. package/src/hub/memory-policy.ts +4 -3
  152. package/src/hub/memory-sync-attestation.ts +54 -0
  153. package/src/hub/memory-sync-state.ts +20 -5
  154. package/src/hub/model-overrides.ts +115 -0
  155. package/src/hub/native-hook-launch.ts +12 -3
  156. package/src/hub/operational-view.ts +2 -2
  157. package/src/hub/peers.ts +28 -1
  158. package/src/hub/permission-mode.ts +1 -1
  159. package/src/hub/person-figures.ts +88 -0
  160. package/src/hub/planning.ts +1 -1
  161. package/src/hub/progress.ts +24 -7
  162. package/src/hub/report.ts +38 -4
  163. package/src/hub/research-dataset.ts +158 -0
  164. package/src/hub/research-memory.ts +68 -0
  165. package/src/hub/research-quality.ts +118 -0
  166. package/src/hub/research-record.ts +279 -0
  167. package/src/hub/research.ts +126 -27
  168. package/src/hub/restart.ts +27 -0
  169. package/src/hub/roles.ts +26 -0
  170. package/src/hub/routing.ts +4 -1
  171. package/src/hub/sdlc-merge.ts +39 -1
  172. package/src/hub/sdlc-release.ts +1 -1
  173. package/src/hub/sdlc.ts +62 -11
  174. package/src/hub/settings.ts +5 -0
  175. package/src/hub/startup-event-seeds.ts +51 -0
  176. package/src/hub/startup-readiness.ts +65 -0
  177. package/src/hub/startup-timing.ts +38 -0
  178. package/src/hub/supervision-proposals.ts +405 -0
  179. package/src/hub/supervision-rules.ts +388 -0
  180. package/src/hub/supervision.ts +2 -0
  181. package/src/hub/task-approval.ts +2 -2
  182. package/src/hub/task-repository.ts +5 -0
  183. package/src/hub/tasks.ts +632 -59
  184. package/src/hub/ui.ts +9 -5
  185. package/src/hub/visual-assets.ts +50 -0
  186. package/src/hub/visual.ts +257 -0
  187. package/src/memory/brief.ts +169 -14
  188. package/src/memory/capture.ts +4 -3
  189. package/src/memory/recall.ts +46 -5
  190. package/src/memory/record-provenance.ts +82 -0
  191. package/src/memory/records.ts +116 -0
  192. package/src/models/relay.ts +9 -2
  193. package/src/models/route/adec.ts +190 -0
  194. package/src/models/route/config.ts +64 -3
  195. package/src/models/route/decision-evidence.ts +83 -0
  196. package/src/models/route/decision.ts +215 -0
  197. package/src/models/route/relay-selector.ts +8 -7
  198. package/src/models/route/runtime.ts +35 -22
  199. package/src/models/route/stage-diagnostics.ts +22 -0
  200. package/src/models/route/stage-evidence.ts +55 -0
  201. package/src/models/route/stage-fallback.ts +58 -0
  202. package/src/models/route/stage-input.ts +155 -0
  203. package/src/models/route/stage.ts +5 -147
  204. package/src/ui/guidance-panel.ts +156 -0
  205. package/src/ui/guidance-view.ts +43 -0
  206. package/src/ui/index.html +134 -6
  207. package/src/ui/lineage-view.ts +34 -0
  208. package/src/ui/plugin.ts +136 -11
  209. package/templates/AGENTS.block.md +1 -1
  210. package/templates/config.json +1 -1
  211. package/templates/profiles/general.json +1 -1
  212. package/templates/profiles/research.json +1 -1
  213. package/templates/profiles/writing.json +1 -1
package/docs/profiles.md CHANGED
@@ -139,11 +139,11 @@ The existing ahub report --dogfood command adds a profile section when the selec
139
139
 
140
140
  Rows include profile totals and class-alias groups with the stored base class. A task keeps its recorded profile across later configuration changes. Public custom aliases remain bounded identifiers; private custom aliases are withheld. Task titles, paths, notes, checklist prose and model text are not exported. Private pii/pii_path tasks are counted by id and number.
141
141
 
142
- A missing, incomplete or unsupported source produces JSON null, rendered as unknown in the readable report. A complete source can prove zero recorded events; it cannot prove zero events for a category that has no recorder. Source completeness and flow scope distinguish history-backed totals from recorded-window observations. Profile bindings, including event-only fallback, are capped at 500; a capped window reports incomplete/unknown totals rather than extrapolating. Automatic approvals are flow transitions, not reviewer rounds or first-pass review samples.
142
+ A missing, incomplete or unsupported source produces JSON null, rendered as unknown in the readable report. A complete source can prove zero recorded events; it cannot prove zero events for a category that has no recorder. Source completeness and flow scope distinguish history-backed totals from recorded-window observations. Profile bindings, including event-only fallback, are capped at 500; a capped window reports incomplete/unknown totals rather than extrapolating. Automatic approvals and merge adoptions (`merged outside the hub`, #1348) are flow transitions, not reviewer rounds or first-pass review samples.
143
143
 
144
144
  | Row group | Existing evidence | Unmeasured ceiling |
145
145
  | --- | --- | --- |
146
- | Flow | Bound task history and complete task-event windows; observed automatic approvals | Undated approvals, incomplete history and first-pass review without history remain unknown |
146
+ | Flow | Bound task history and complete task-event windows; observed automatic approvals and merge adoptions | Undated approvals, incomplete history and first-pass review without history remain unknown |
147
147
  | Review | Explicit verdicts and structured public unmet-criteria ids | Profile checklist prose has no item-id recorder; private criterion ids are withheld |
148
148
  | Overlap | Recorded path/section notices and later matching pair/path edit facts | Observed path-edit pairs imply no authorship or causation; section edit confirmation remains unknown |
149
149
  | Deliverables | Deduplicated ids in recorded deliverable histories | No new file reads; changed-since-approval and current unknown states remain unknown |
@@ -4,7 +4,7 @@ agent-hub lets the coding agents on one machine work as peers in one project dir
4
4
 
5
5
  ## Install
6
6
 
7
- Needs [Bun](https://bun.sh) 1.4.2 or newer and macOS (Linux works without the `local` worker's `bash` and `git` tools, which need the macOS sandbox).
7
+ Needs [Bun](https://bun.sh) <!-- facts:bun-floor -->1.4.2<!-- /facts:bun-floor --> or newer and macOS (Linux works without the `local` worker's `bash` and `git` tools, which need the macOS sandbox).
8
8
 
9
9
  Node alone is not supported. Keep `bun` on PATH even if you install with npm.
10
10
  The registry package uses the `staix` organization scope. Install from npm:
@@ -16,10 +16,12 @@ ahub setup # installs the channel plugin and a pr
16
16
 
17
17
  Or use the matching GitHub release:
18
18
 
19
+ <!-- facts:install-tag -->
19
20
  ```bash
20
- bun add -g github:STAIxBWLB/agent-hub#v0.31.0
21
+ bun add -g github:STAIxBWLB/agent-hub#v0.36.0
21
22
  ahub setup
22
23
  ```
24
+ <!-- /facts:install-tag -->
23
25
 
24
26
  From a clone instead: `git clone`, `bun install`, `bun link`.
25
27
 
@@ -46,6 +48,18 @@ terminal in that project: it reviews the plan with you, applies it and follows
46
48
  it; other projects keep their version. It then names the `bun add -g` and
47
49
  `ahub setup` step when your global CLI or plugin is older than the new daemon.
48
50
 
51
+ ## Upgrading to 0.36.0
52
+
53
+ The `@staix/agent-mem` pin stays at 0.23.1. In SDLC `advise` or `enforce`, a repository other than `STAIxBWLB/agent-hub` with no configured required checks now reports `required checks unknown` for review readiness and CI watches instead of assuming the native `seeded guards` floor (#1344): set `required_checks` in `.agenthub/sdlc.toml` (`ahub settings edit sdlc.toml`) and restart the hub ([required checks](sdlc.md#required-checks-at-initialization)). After a hub deny, Qwen's dual-output TUI keeps later input fenced until a new personal turn completes in the Qwen terminal or a verified fresh generation starts, and reports offline after 30 s ([Qwen TUI](operations.md#qwens-own-tui-driven-through-dual-output-286-part-3), #1371). `hub_inbox` can also show an agent its own held messages as a read-only view that settles nothing (#1359). Newly verified agent versions: Claude Code 2.1.322 as the headless implementer (#1377), the Qwen dual-output TUI on 0.27.0 and 0.27.1 (#1364, #1378) and Qwen basic ACP on 0.27.0 (#1355); the headless `qwen` ACP entry still refuses 0.27.1. Before saving a machine research default with `ahub setup --research` or `--no-research` (#1347), upgrade every hub and CLI on the machine: a version before 0.36 treats the whole `~/.agenthub/defaults.json` as untrusted, so its machine autonomy preset falls back to off ([research records](operations.md#research-records)). Nothing else changes until you use it: `supervision.mode` (machine-local, off by default) stores bounded supervision proposals in `shadow` and also shows them in the console inbox in `advisory`, where only an explicit accept or dismiss acts ([supervision proposals](operations.md#supervision-proposals), #1362, #1368); `ahub guidance create|list|show|withdraw` records advisory role variants on a task (#1363, #1367, #1376); `ahub lineage show|link` reads bounded execution lineage and admits declared references ([execution lineage](operations.md#execution-lineage-1220-t2), #1341, #1358); a `stage` route with `classifier = "decision"` asks adec only inside its ambiguity band, off or shadow only (#1370, #1373); `ahub sdlc adopt-merge <task> --pr <n>` settles a task whose PR was merged outside the hub (#1348); `ahub init` in `advise` or `enforce` proposes the repository's required checks (#1344) and takes `--research`/`--no-research` (#1347); an explicitly superseding task can carry unchanged spec consent (#1361); and the optional Claude Code companion stays fixture-only with manual session-only placement (#1349, #1365, #1369). N-1 is published 0.35.0 and control remains 16 through 17.
54
+
55
+ `ahub upgrade` does not update the global CLI or the shared Claude plugin: run `bun add -g @staix/agent-hub@0.36.0` and then `ahub setup` yourself, and `ahub doctor` warns while either is older than a running daemon.
56
+
57
+ ## Upgrading to 0.35.0
58
+
59
+ The hub now exact-pins `@staix/agent-mem` 0.23.1 (0.34.x pinned 0.22.1), and managed headless peers (Codex, headless Kimi, Qwen, Jcode, Pi, `local`) start saving compact `amem:` Record lines from their final answers; the hub strips those lines from shared replies (#1320). Upgrade every hub, global `amem` CLI and native amem hook that shares a memory home together: a 0.22.1 hook drain silently discards Record format-3 spool entries, and 0.22.1 refuses the `records` key even when false. To turn Records off, set `records: false` in the amem configuration only after every install is upgraded ([agent-authored records](operations.md#agent-authored-records)). Machine memory sync now supplies amem's placement attestation on every pass (#1173); a refused writer shows as cause `writer` in `ahub status` and the dashboard, with the next step. The budget gate default is 0.99 instead of 0.9 (#1292), but a project whose tracked `.agenthub/config.json` has `"gate": 0.9` from an older `ahub init` keeps 0.9 until you remove that key or run `ahub settings set budget.gate <value>`. On Kimi 2.5.2, `ahub kimi` installs a launch-scoped plugin so turns you start in its TUI leave results (#1282), and `ahub agy` turns off agy's self-update for the run (#1286). Nothing else changes until you use it: `ahub model set|clear|list` (person only) selects a supported peer's next-turn model (#1321), peers can post bounded visuals with `hub_visual` (#1315), and `ahub research export --dataset <dir>` writes per-project research datasets (#1290). N-1 is published 0.34.1 and control remains 16 through 17.
60
+
61
+ `ahub upgrade` does not update the global CLI or the shared Claude plugin: run `bun add -g @staix/agent-hub@0.35.0` and then `ahub setup` yourself, and `ahub doctor` warns while either is older than a running daemon.
62
+
49
63
  ## Upgrading to 0.34.1
50
64
 
51
65
  `ahub upgrade` reads npm 12's `npm view --json` output again; with npm 12, 0.34.0 and earlier refused both the default target and `--to`. Update the global CLI to 0.34.1 first, either `bun add -g @staix/agent-hub@0.34.1` or, if you installed with dotfiles, `dot ai family install ahub --version 0.34.1`; then run `ahub upgrade` in each project. If you must run an older CLI's upgrade on npm 12, put npm 11 first on PATH for that run (`npm i --prefix ~/.cache/npm11 npm@11`, then `PATH="$HOME/.cache/npm11/node_modules/.bin:$PATH" ahub upgrade`). Nothing else changes.
@@ -230,7 +244,7 @@ The restarted Claude planner gets the release-train tools (`hub_release_new`, `h
230
244
 
231
245
  Jcode must be 0.98.0 or later, below 1.0.0; 0.94.0 is no longer accepted, so `ahub doctor` fails its Jcode row for an older install and the peer does not start (#529). Every owned jcode process runs with `JCODE_NO_TELEMETRY=1`.
232
246
 
233
- Since 0.12.37 the hub opens a split memory home through its shards (#534); the current exact `@staix/agent-mem` pin is 0.22.1. Before anyone runs `amem migrate --shards` on a memory home, every hub using that home must run 0.12.37 or later: an older hub does not see the split and keeps writing the old layout. `ahub memory profile-check` is split-aware and compares each hub with its own project's shard (#536). See [memory profiles and rollout](memory.md#selected-memory-profile).
247
+ Since 0.12.37 the hub opens a split memory home through its shards (#534); the current exact `@staix/agent-mem` pin is 0.23.1. Before anyone runs `amem migrate --shards` on a memory home, every hub using that home must run 0.12.37 or later: an older hub does not see the split and keeps writing the old layout. `ahub memory profile-check` is split-aware and compares each hub with its own project's shard (#536). See [memory profiles and rollout](memory.md#selected-memory-profile).
234
248
 
235
249
  From 0.12.30 or earlier, existing Jcode project MCP entries need one refresh before conductor or dashboard starts. Once per project, the person runs:
236
250
 
@@ -270,6 +284,105 @@ ahub say "Each of you: reply with your name." # broadcast
270
284
  ahub say @kimi "run the tests and report" # one peer
271
285
  ```
272
286
 
287
+ ## A new project with SDLC advise or enforce
288
+
289
+ This flow uses the default lifecycle in a new Git repository. `advise` reports
290
+ lifecycle gaps; `enforce` blocks the corresponding transitions until their
291
+ evidence is current. Ownership, privacy and WIP rules still apply in both modes.
292
+ SDLC defaults to off, and guarded merge has its own opt-in policy.
293
+
294
+ Run bare `ahub init` from the person's terminal in the new repository to get the
295
+ guided prompt. Choose `advise` or `enforce` when asked. Init proposes required checks
296
+ from this repository's latest completed default-branch CI run, falling back to
297
+ literal workflow job names, and the person confirms or edits the names. For an
298
+ unattended choice, `ahub init --sdlc enforce --yes` takes the discovered names.
299
+ If discovery cannot determine them, give the exact names explicitly, for example
300
+ with `--required-checks 'unit,lint'` after replacing `unit,lint` with this
301
+ repository's required jobs. Enforce without known names refuses before writing.
302
+ The mode and check names are written to `.agenthub/sdlc.toml`.
303
+ See [required checks](sdlc.md#required-checks-at-initialization) for discovery
304
+ limits and repository-specific configuration.
305
+
306
+ Research recording is another init choice: `--research` or `--no-research` sets
307
+ `research.enabled` in this project's untracked `.agenthub/config.local.json`. A new project otherwise uses the trusted
308
+ machine choice saved by an explicit `ahub setup --research` or
309
+ `ahub setup --no-research`, else off. Init reads that default, never writes it.
310
+ Before saving a shared machine default, follow the
311
+ [upgrade-all-hubs caveat](operations.md#research-records). Setting flags select
312
+ values directly. `--yes` skips questions; `--dry-run` previews without questions or
313
+ writes.
314
+
315
+ Review `git status --short` and `git diff`, then commit `AGENTS.md`,
316
+ `.agenthub/config.json`, `.agenthub/routing.toml`, `.agenthub/sdlc.toml` and other
317
+ shared init changes such as `.gitignore` as applicable. Keep
318
+ `.agenthub/config.local.json`, `.agenthub/routing.local.toml` and runtime state
319
+ untracked. Start through `ahub up` or the dedicated launchers such as
320
+ `ahub claude` and `ahub codex`, as in [First session](#first-session), so the
321
+ managed session receives its hub integration. Pull-only surfaces use `hub_inbox`.
322
+
323
+ Use actual task/issue ids and the full lowercase commit SHA for `<head>` below.
324
+ The normal lifecycle is:
325
+
326
+ 1. **Planner:** propose the work with `hub_task_propose`, including the intended
327
+ plan and repository. Proposal/route guidance identifies the snapshot's next
328
+ missing step; live admission rechecks currentness.
329
+ 2. **Owner or task planner:** record the spec issue with `hub_sdlc_record`.
330
+ The planner's stage-identity record contains only `stage`, `repo` and `issue`
331
+ in its receipt, with a planner or owner/planner stage (`spec` in the default
332
+ lifecycle). See [lifecycle commands](sdlc.md#initial-commands).
333
+ 3. **Person:** read the linked issue, then run
334
+ `ahub sdlc accept <task> --issue <n>` (add `--repo owner/repo` if needed).
335
+ This is a person-only command, not an agent-shell or live-test delegation.
336
+ An eligible replacement may reuse existing consent as described below.
337
+ 4. **Planner:** read `hub_planner_groom`, then record `hub_plan_review` with the
338
+ `revision` equal to the current `planningRevision`, a reason and appropriate
339
+ review/CI scopes. The [plan-review contract](sdlc.md#planner-plan-review-481-s9)
340
+ defines currentness
341
+ and planner independence.
342
+ 5. **Owner:** accept with `hub_task_accept` and the reviewed plan, then implement
343
+ and run the project's required local checks. Acceptance re-reads spec and
344
+ plan evidence; an offer alone is not acceptance.
345
+ 6. **Owner:** commit and push, open the PR, record its identity with
346
+ `hub_sdlc_record` (`receipt.pr`), and obtain the configured required checks
347
+ green on that exact head. `ahub sdlc explain <task>` names missing, pending and failed checks.
348
+ 7. **Owner:** call `hub_task_done` while the PR is still open, with its full
349
+ commit in `refs.commit`, the summary and check evidence. Follow any queued
350
+ check or readiness result before asking for a verdict.
351
+ 8. **Assigned reviewer:** review that head and record the verdict with
352
+ `hub_review`. The person's equivalent is
353
+ `ahub review <task> approved --head <head>` or a changes-requested verdict.
354
+ 9. **Person or current configured conductor:** preview with
355
+ `ahub sdlc merge <task> --dry-run`. Actual guarded merge requires an explicit
356
+ `auto_merge = "on"` policy for the repository (default off). After applying
357
+ that file change with a hub restart, use `ahub sdlc merge <task>`. If the policy
358
+ was already enabled when the reviewer approved, the automatic path can merge
359
+ after that verdict. See
360
+ [guarded merge](sdlc.md#guarded-merge-786) for every evidence gate.
361
+
362
+ The [entry-gate order and exact diagnostics](sdlc.md#named-ci-and-build-entry-diagnostics-1328-t2)
363
+ identify who repairs a missing prerequisite. A plan-review hold is separate from
364
+ peer eligibility, and an owner offer can precede person spec acceptance.
365
+
366
+ Recovery uses the existing evidence boundaries:
367
+
368
+ - **PR already merged:** the person or current configured conductor uses
369
+ `ahub sdlc adopt-merge <task> --pr <n>`. It needs the task's recorded full head,
370
+ matching merged PR and green required checks, with clean finding/review
371
+ coverage. Eligible states are `in_progress`, `in_review` and
372
+ `changes_requested`; see [merge adoption](sdlc.md#adopting-a-pr-merged-outside-the-hub-1328-t3).
373
+ - **Known plan departure:** amend the plan through the owner/planner flow, or
374
+ the person can run `ahub sdlc accept-departure <task> <head> <reason...>` for a
375
+ currently known, complete departure on that head. Repair unknown coverage before
376
+ departure consent; see [plan conformance](sdlc.md#plan-conformance-481-s2).
377
+ - **Obsolete work:** create the newer replacement and record the same repository
378
+ and issue first. The person can then cancel the old task with an explicit local
379
+ reference, for example `ahub task cancel 12 --reason "superseded work" --superseded-by "#13"`
380
+ when task 13 replaces task 12. At the replacement's build admission, the host
381
+ may carry the original consent only for an unchanged issue body and current
382
+ public source/destination context. Carry does not copy plan review or head/CI
383
+ evidence. Cancellation is not approval and releases no dependent tasks; see
384
+ [spec acceptance](sdlc.md#spec-acceptance-481-s1).
385
+
273
386
  ## The local worker
274
387
 
275
388
  `local` needs an OpenAI-compatible gateway. Put yours in `.agenthub/config.local.json`
@@ -308,7 +421,7 @@ More: `ahub help`. How it is built and why: [`docs/specs/2026-09-19-agent-hub-de
308
421
 
309
422
  ## Shared memory
310
423
 
311
- The hub exact-pins the first-party `@staix/agent-mem` 0.22.1 core, including 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.
424
+ The hub exact-pins the first-party `@staix/agent-mem` <!-- facts:agent-mem-pin -->0.23.1<!-- /facts:agent-mem-pin --> core, including 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.
312
425
 
313
426
  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.
314
427
 
package/docs/research.md CHANGED
@@ -1,8 +1,9 @@
1
1
  # Research records
2
2
 
3
- Opt-in records of how each task went, kept across projects for management and research (#247). They are built only
4
- from a project's `events.jsonl`, so they hold ids, states, counts, tokens and times, never a title, detail, plan, note,
5
- path, message body or check output.
3
+ Opt-in records of how each task went, kept across projects for management and research (#247). They are built from a
4
+ project's `events.jsonl` and, since schema v2 (#1277), from read-only views of its board history and delivery journal
5
+ that are reduced to closed values on the way in, so they hold ids, states, counts, tokens, times and closed vocabularies,
6
+ never a title, detail, plan, note, path, message body or check output.
6
7
 
7
8
  ## Turning them on
8
9
 
@@ -13,7 +14,9 @@ In a project's `.agenthub/config.json`:
13
14
  ```
14
15
 
15
16
  Off by default; anything but `true` is off. While it is off the hub writes nothing and creates no file. The setting is
16
- read when the hub starts.
17
+ applied live: a config reload takes it without a restart. `ahub init --research` or `--no-research` writes it to the untracked
18
+ `.agenthub/config.local.json` instead; a new project takes the machine default a person saved with `ahub setup --research`
19
+ or `--no-research`, else off (#1347).
17
20
 
18
21
  ## Where they go
19
22
 
@@ -23,11 +26,13 @@ directory, so `ahub research --all` can compare them. `ahub reset --all` does no
23
26
 
24
27
  ## When a record is written
25
28
 
26
- When a task is approved (a review approves it, or its owner reports a task without a reviewer done), the hub waits
29
+ When a task reaches a terminal board state (a review approves it, its owner reports a task without a reviewer done, `ahub sdlc adopt-merge` adopts its PR merged outside the hub (#1348), or it is cancelled), the hub waits
27
30
  until no open turn is attributed to the task (the turn that approved it ends after the approval, and its usage arrives
28
31
  later still), checking every 10 s for at most 30 minutes, then appends one task record built from that project's
29
- events. A hub that stops first writes it once its peers have stopped. Approval is final on the board, so each task has
30
- one record, and the first record written for a task is final. A failing write is one `hub.log` line per hub run and
32
+ events and the board. A hub that stops first writes it once its peers have stopped. A terminal state is final on the
33
+ board, so each task has one record, and the first record written for a task is final with one exception: the guarded merge
34
+ writes its receipt after the approval, so a later pass appends the same task once more when it brings merge figures the
35
+ held record lacked (readers keep the latest row of a task). A v2 row also replaces a held v1 row of the same task. A failing write is one `hub.log` line per hub run and
31
36
  never changes the task flow.
32
37
 
33
38
  `ahub research backfill` builds the same records from a project's existing `events.jsonl` (marked
@@ -37,16 +42,20 @@ waits for its turns freezes that record without them.
37
42
  A task is identified by project, id and proposal time (`createdAt`), because `ahub reset --all` starts the ids again
38
43
  while the store keeps the older records.
39
44
 
40
- ## Task record (`agent-hub.research/v1`, `kind: "task"`)
45
+ ## Task record (`agent-hub.research/v2`, `kind: "task"`)
46
+
47
+ Schema v2 is additive: a v1 file still loads (a v1 row reads as `outcome: "approved"`, and the file is never rewritten), and
48
+ `ahub research` and `ahub research addons` read both. Every statistic about approved tasks filters on `outcome`.
41
49
 
42
50
  | Field | Meaning |
43
51
  | --- | --- |
44
52
  | `project` | the project key above |
45
53
  | `task` | the board's task id |
46
54
  | `class`, `pii` | the task's class; whether it was a PII task (its record holds counts only, like any other) |
47
- | `outcome` | `approved` |
48
- | `createdAt`, `startedAt`, `approvedAt` | proposal, first `in_progress`, approval (ISO) |
49
- | `wallMs` | from `startedAt` to `approvedAt`, null when the start is not in the events |
55
+ | `outcome` | `approved` or `cancelled` (v2): every task in a terminal board state has a record; a v1 row is always `approved` |
56
+ | `createdAt`, `startedAt`, `approvedAt` | proposal, first `in_progress`, approval (ISO); `approvedAt` is null on a cancelled record |
57
+ | `closedAt` | v2: when the task reached its terminal state (the approval or the cancellation) |
58
+ | `wallMs` | from `startedAt` to the terminal state, null when the start is not in the events |
50
59
  | `activeMs`, `turns`, `filesChanged` | sums over the turns attributed to the task (`turn_end`), the ones ending after the approval included |
51
60
  | `sessionRoles` | optional attributed-turn preamble preparations: peer, turn id, role ids/layers/hashes; `roles: []` means prepared without catalog guidance, `roles: null` means unknown; older events leave the field absent. No role bodies or proof of model consumption |
52
61
  | `owners`, `reviewer` | the owners in the order they held the task (an owner who gets it back appears again; reports by owner count the task once per owner); the last reviewer |
@@ -65,6 +74,57 @@ while the store keeps the older records.
65
74
  | `briefs` | #258: task briefs handed over for the task (`delivered`) and how many carried a hub-memory fail note (`withFail`), from `memory_brief` events; absent when none was recorded |
66
75
  | `peers` | with `tooling`: every peer with an event attributed to the task (a turn, tokens, a route), fingerprinted or not, so a peer without a fingerprint makes the task unknown for an add-on rather than off |
67
76
 
77
+ ### v2 blocks (#1277)
78
+
79
+ Every value is a count, a duration or a member of a closed vocabulary. A value that cannot be derived is `null`, never 0,
80
+ and `quality.json` counts it as unknown. Journal-derived fields are null unless the journal is known to hold every delivery from the
81
+ task's proposal on: the journal prunes its oldest-updated terminal rows beyond a cap and keeps unresolved rows, review-package receipts and retry parents, so the
82
+ oldest surviving row proves nothing. The record uses the oldest-updated unprotected terminal row that survived as its bound (every pruned row is no newer than it, and a
83
+ delivery is created no later than it is updated), and treats the journal as unknown when its own review-input coverage is incomplete; board-derived fields are null when `hub.db` could not be read.
84
+
85
+ | Field | Meaning |
86
+ | --- | --- |
87
+ | `cancelCause` | only on a cancelled record: `cancelled`, `declined`, `escalated`, `stale` or `unknown`, taken only from an explicit closed `cause` the board retains on the cancellation. The board keeps only a free-text note today, so it reads `unknown`; a cause is never inferred from the note, from an earlier decline or escalation, or from who cancelled |
88
+ | `declines`, `escalations` | intermediate declines and escalations (history events, not terminal), counted next to `reassignments` |
89
+ | `review` | `rounds` (verdicts that are not evidence-only), `firstPass`, `findings` by pass (`bugs`, `security`, `compliance`) each with `important`, `nit`, `open`, `fixed`, `falsePositive`, `accepted` (distinct findings at their last disposition; null when no verdict carried a structured report or the task is `[pii]`), `reviewerFamily`, `ownerFamily`, `scope` (`code`, `full`, `delta`, `none`, `unknown`), `evidenceOnly`, `context` (`fresh`, `continuing`, `unknown`), `staleHeadReReviews` |
90
+ | `delivery` | `count` (envelopes that named the task), `firstDeliveryMs` (`p50`, `p95` of the journal's completed deliveries), `needsReview`, `failed`, `discarded` (journal states), `dropped` (`fyi`, `hop`) |
91
+ | `merge` | `ciRuns`, `ciReruns`, `githubReviews` and `approvedToMergedMs` from the receipt the guarded merge wrote, `doneToApprovedMs` from the events' own times |
92
+ | `specs` | `covering`, `unchanged`, `acked`, `errors` from the latest done's spec report; an incomplete report is unknown |
93
+ | `memory` | `briefs`, `briefNotes`, `fails` from `memory_brief` events (a known 0 when briefs were being reported in the log and the task got none, null when the log shows none at all); `rendered`, `delivered`, `cited`, `failsExposed`, `failsCited`, `failRetrySignal` (#1279) are counts of distinct entries from agent-mem's own machine-local counters for the task, never an id: `rendered` entries put into a delivery attributed to the task, `delivered` of those whose delivery the journal acknowledged, `cited` of those that a hub-screened done summary, review note, `spec_ack` reason, message or `hub_remember` text named by `mem:<id>` (exact match, no judgment), `failsExposed` and `failsCited` the same over fail notes, `failRetrySignal` the exposed fail notes the plan's paths or symbols touch that were not cited by approval: a signal for a reviewer to read, never an outcome, since it does not say the approach was retried. All six are null with no counter row for the task (sidecar off, a private task, rows aged out of the sidecar's 90 days), `delivered` is null while no delivery is known to have completed, and the fail figures are null when a rendered entry can no longer be read |
94
+ | `person` | #1278: what the person was asked and did for the task, from the four events above. `permissions` (`asked`, `allowed`, `denied`, `expired`), `questions` (`asked`, `answered`, `expired`), `completions`, `cliRefusals`, `latencyMs` (`sum`, `n`, `unknown`) and `consoleConfirmations`. An interaction counts for a task only when its event names one; `unattributed` is counted apart (in `ahub report --by task`) and never folded into a task. `latencyMs.sum` adds only recorded latencies of PERSON-answered permissions and questions (an answer with a `surface`); a person answer without a latency reading raises `n` and `unknown` and adds nothing to `sum`, and an automatic answer, an expiry and a cancellation are not the person's minutes. Every part is null for a task that began before the first `hub_start` with `personAttribution` (the log cannot say), and a known 0 after it when no interaction happened, in the record and in `ahub report --by task` alike (one function decides, `src/hub/person-figures.ts`). `consoleConfirmations` stays null: the hub records no event for a console confirmation, whose approval arrives as the permission's `answered`. Not observed: an interaction inside a vendor TUI the hub cannot see |
95
+ | `stalls` | persisted idle-ladder entries on the task's history (the stall table itself is cleared when a task closes); null without the board |
96
+ | `handoffs` | `in`, `out` from the handoff tables |
97
+ | `cohort` | `silent`, `advisory` or `none` |
98
+
99
+ The record reads the board through a read-only handle (`readEvidence`): titles, details, plans, refs and notes are never
100
+ decoded, and the journal's envelope bodies are never read.
101
+
102
+ ## Dataset export (`ahub research export --dataset <dir> [--since] [--all]`)
103
+
104
+ Writes `<dir>/<project key>/tasks.jsonl`, `manifest.json` and `quality.json` for this project, or for every registered
105
+ project that has research records with `--all` (read-only, on this machine, with the same project-key hashing as the
106
+ record file names). It is built to leave the machine, so it is an allowlist:
107
+
108
+ - a peer is only a family name (`claude`, `codex`, `kimi`, ...), resolved through the project's own config for an instance
109
+ id, and `unknown` when none is known (never guessed from the id's spelling); `profile`, `role`, `roleIdentity` and
110
+ `sessionRoles`, which carry project-chosen names, are dropped;
111
+ - the target must be inside your home directory, not the home itself, and outside every registered project and its state
112
+ directory (compared as real paths, so a symlink out of the home or into a project does not pass); a project directory
113
+ that is a symbolic link is refused;
114
+ - files are written whole (a temporary file, then a rename), owner-only, and the manifest last, so a directory with a
115
+ manifest is complete.
116
+
117
+ `manifest.json`: `schema`, `hubVersion`, `projectKeyHash`, `window` (`since`, `until`), `peers` (families), `counts`
118
+ (`tasks`, `approved`, `cancelled`, `labels`), `recordedAt`. `--format` and `--dataset` exclude each other.
119
+
120
+ `quality.json` (#44 AC0, `agent-hub.research-quality/v1`): `fields` (per v2 field: `n` records and how many are
121
+ `unknown`, null or the vocabulary's own `unknown`), `quota` per family (`readings`, `gaps` over one hour, their total
122
+ `gapMs`, `stalenessP95Ms` between readings, and `clock`: how many readings used the event's time or their own
123
+ `measuredAt`), `budget` (pauses and resumes per family, and `handoffs`: the owner moves a budget pause drove, counted from the `reassigned` task events whose board reason is `budget`, once per move; null when the window holds no task event at all, never 0), `outcomes` per family of the last owner and class, `events`
124
+ (the types present with counts, and the ones the report expects that did not occur), and `tokenAttribution` (`total` and the
125
+ share by `delivery`, `single_open`, `unattributed`; null shares when nothing was counted). The 2026-10-21 field analysis found
126
+ 40.2% of token increments unattributed: a dataset now says so itself.
127
+
68
128
  ## Label record (`kind: "label"`)
69
129
 
70
130
  `ahub task label <id> ok|regressed|reverted|incomplete|wrong|abandoned [--created <time>]` appends
@@ -92,7 +152,7 @@ names the agent (empty for the person).
92
152
  and no brief recorded (shown once any record has a brief).
93
153
 
94
154
  They are computed each time from the records; nothing derived is stored. `ahub research export [--format jsonl|csv]
95
- [--since] [--all]` writes the records for outside analysis; the CSV columns are, in order: project, task, class, pii,
155
+ [--since] [--all]` writes the records for outside analysis (`--dataset <dir>` writes the per-project dataset below); the CSV columns are, in order: project, task, class, pii,
96
156
  outcome, createdAt, startedAt, approvedAt, wallMs, activeMs, owners, reviewer, reviewRounds, changesRequested, checkPassed,
97
157
  checkFailed, dones, reassignments, firstPass, stuck, overlaps, conflicts, testsPass, testsFail, tokens, turns,
98
158
  filesChanged, models, label, labelBy, writerVersion, writerSource. The CSV is a flat subset; JSONL carries every field.
@@ -122,4 +182,4 @@ either side a difference is inconclusive. This is field data: the sides differ i
122
182
  association, not cause. Controlled arms are `ahub bench run --addon <name>=on|off` (docs/bench.md), and the decisions
123
183
  taken from both are in `docs/addons/`.
124
184
 
125
- Agents may read the measures and export (ids and counts only); `backfill` is the person's or the configured conductor's (#933), and an agent labels only its own task.
185
+ Agents may read the measures and export (ids and counts only), `--dataset` included; `backfill` is the person's or the configured conductor's (#933), and an agent labels only its own task.
package/docs/roles.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  # Definitions and layers
8
8
 
9
- - Shipped definitions live at `templates/roles/dev|research/<id>.md`. The first catalog has six dev and five research roles. Other shipped groups wait for the #251 measurement.
9
+ - Shipped definitions live at `templates/roles/<group>/<id>.md`: six dev and five research roles, plus four writing and two ops roles that the domain packs use ([profiles](profiles.md)).
10
10
  - Project definitions at `.agenthub/roles/<id>.md` replace the same shipped id. Machine-level definitions are deferred. Files are bounded regular files, at most 8 KiB, with no symlink/hardlink targets; project directories cannot be symlinks. Scanning is flat and capped at 64 files.
11
11
  - A flat header declares id, name, group, summary, base, classes and source. Id equals the file stem. Base is one or more existing flow roles excluding conductor; classes name today's seven base task classes. At least one declared base must already be held by a peer receiving that session guidance.
12
12
  - Exactly six nonempty sections, in order: Scope, Not in scope, Deliverables, Hub use, Review duties, Evidence. Rendered body is at most 2000 characters. No extra heading/personality section, code block, command-shaped line, emoji, control or non-ASCII punctuation. This syntactic lint is not an instruction-safety classifier; project text is labelled untrusted guidance and cannot change daemon authority checks.
package/docs/sdlc.md CHANGED
@@ -1,8 +1,40 @@
1
1
  # Playbook lifecycle for agent-hub (#257, #481)
2
2
 
3
+ ## Required checks at initialization
4
+
5
+ For the complete new-project sequence, see [the quickstart guide](quickstart.md#a-new-project-with-sdlc-advise-or-enforce).
6
+
7
+ `ahub init --sdlc advise|enforce` proposes the repository's required check names.
8
+ Discovery is one bounded operation: at most three capped GitHub reads (the default
9
+ branch, the latest completed default-branch run with limit 1, then that run's jobs
10
+ with a 100-job cap), with a 5-second bound per read and a 20-second overall deadline.
11
+ A local `origin/HEAD` avoids the default-branch read. A missing tool, failed read,
12
+ timeout or truncated job inventory falls back to `.github/workflows/*.yml`.
13
+ Fallback accepts complete literal block-style job names (the job id when `name`
14
+ is absent). Matrices, expressions, aliases and reusable workflows require an
15
+ explicit `--required-checks <a,b,...>` override; the fallback does not guess expanded
16
+ names. Workflow reads refuse links and bound files and bytes. Names follow the
17
+ existing SDLC limit of 32 distinct checks, each at most 120 characters.
18
+
19
+ The guided prompt shows the found names after choosing advise/enforce and lets
20
+ the person confirm or edit them. `--yes` accepts discovery; `--required-checks`
21
+ skips discovery. Existing configured names, including the matching `[repos]` table, are retained
22
+ unless explicitly replaced. Enforce with no known names refuses before any initialization write.
23
+
24
+ Only `STAIxBWLB/agent-hub` retains the native three-check fallback including
25
+ `seeded guards`. Other repositories without configured checks report
26
+ `required checks unknown: set required_checks in .agenthub/sdlc.toml`, including
27
+ cached review admission; their CI watcher cannot report success from an empty set.
28
+ Repository-specific `[repos]` checks are included in review admission and CI watches.
29
+
30
+ `ahub settings get sdlc.mode` and `ahub settings get sdlc.required_checks` show the
31
+ running and file values (`--json` exposes `value` and `fileValue`). A file that
32
+ cannot load is unknown. These reads grant no settings write capability; edit the
33
+ file through `ahub settings edit sdlc.toml` and restart to apply it.
34
+
3
35
  ## Authority and evidence
4
36
 
5
- 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 only the 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 one GitHub write is the guarded merge of an approved task (#786, below), off by default.
6
38
 
7
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.
8
40
 
@@ -36,7 +68,7 @@ Stored `implement` and `verify` stage ids read as `build` and `test`. A write th
36
68
  | S5 | Continuous evals for agent configuration | Gate mechanism only: `config_paths` mark a configuration PR and the configured `eval_check` is then required, with its pass rate and suite version recorded. No suite is chosen, created or defaulted: suite choice pending the person (#251/#266) |
37
69
  | S6 | Production approval gate | Person-only commit/version/docs receipt and opt-in Git tag pre-push guard; report stays read-only |
38
70
  | S7 | Metrics, deterministic control bands and follow-up intent | `ahub sdlc metrics`, optional `[bands]` with log, diagnose and propose tiers, one card per breach episode; merge-time review and CI figures recorded from the merged PR; release metrics (interval, lead time, hotfix rate) and a `hotfix_rate` band; an opt-in scheduled security-scan baseline (`[security_scan]`, `security_open_alerts` band). Only the per-release gates-run record remains unbuilt (design spec amendment) |
39
- | S8 | Compliance acceptance-criteria checklist | Head-bound checklist retained; legacy workflow and phase compatibility deprecated; task import removed |
71
+ | S8 | Compliance acceptance-criteria checklist | Head-bound checklist retained; legacy workflow and phase receipts refused since 0.13.0; task import removed |
40
72
  | S9 | Planner grooming and plan review | Read-only digest, current plan-review receipt at build admission, all-mode WIP and accepted-untouched return |
41
73
  | S10 | Planner cost governance | Typed review/CI scope, premature-review admission, identical-tree CI reuse and read-only cost report |
42
74
 
@@ -68,16 +100,19 @@ Head-bound review/approval gates, bounded custom definitions, read-only merge/re
68
100
 
69
101
  ## Initial commands
70
102
 
71
- A per-project `.agenthub/sdlc.toml` may set `mode = "advise"` and `required_checks = ["check (ubuntu-latest)", "check (macos-latest)", "seeded guards"]`; the optional `eval_check` and `config_paths` are described under the eval gate below. Omit the file for off. A missing/empty check set is unknown, never a green approval gate. The built-in stage order follows the table above; changing the file applies at the next hub start.
103
+ For `STAIxBWLB/agent-hub`, a per-project `.agenthub/sdlc.toml` may set `mode = "advise"` and `required_checks = ["check (ubuntu-latest)", "check (macos-latest)", "seeded guards"]`; other repositories use their own check names from [initialization](#required-checks-at-initialization). The optional `eval_check` and `config_paths` are described under the eval gate below. Omit the file for off. A missing/empty check set is unknown, never a green approval gate. The built-in stage order follows the table above; changing the file applies at the next hub start.
72
104
 
73
105
  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.
74
106
 
75
- `ahub sdlc status` lists bounded local projections without polling every remote PR. `ahub sdlc explain 12` or `status 12` performs a fresh structured readback, with a console-only boundary and 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.
107
+ `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.
76
108
 
77
109
  # Spec acceptance (#481 S1)
78
110
 
79
111
  - The person accepts a task's spec issue with `ahub sdlc accept <task> --issue <n> [--repo owner/repository]` (the repository defaults to the task's receipt). Agent shells and live tests are refused. The hub reads the issue's `lastEditedAt` and `updatedAt` through a fixed GraphQL query and stores them with the issue identity and the time of acceptance; it never reads or stores the body. `hub_sdlc_record` cannot write an acceptance, and relinking the receipt to another repository or issue drops it.
80
- - Build entry is the `implement` or `bulk_edit` task's acceptance (`hub_task_accept`), or a recorded stage change into a build stage by anyone but the person. In enforce, build entry needs a current acceptance: the hub rereads the issue and refuses with `spec acceptance missing`, `spec changed after acceptance` (the body was edited; comments only move `updatedAt` and do not count), `spec edit time unknown` (the readback failed) or `spec issue unknown` (the receipt names no issue). Advise posts the same text as a notice and lets the work start; off reads nothing.
112
+ - Build entry is the `implement` or `bulk_edit` task's acceptance (`hub_task_accept`), or a recorded stage change into a build stage by anyone but the person. Enforce names missing issue/acceptance prerequisites in the [entry-gate order below](#named-ci-and-build-entry-diagnostics-1328-t2), then re-reads the body edit time: `spec changed after acceptance` means a body edit (comments only move `updatedAt`), and `spec edit time unknown` means the readback could not establish it. Advise reports lifecycle gaps as notices without blocking them; off performs no lifecycle read.
113
+ - At build entry, a replacement may carry existing person consent from an older cancelled task only when its entire local `supersededBy` is `task #N`, `#N` or `N` for this destination, both tasks name the same canonical repository and issue, and a fresh host GitHub read proves the same `lastEditedAt`. Explicit `null` means no body edit; missing or unavailable edit metadata is unknown. Caller timestamps and comments-only `updatedAt` changes cannot grant or revoke this carry. A different issue/repository or edited body requires the person to accept again.
114
+ - Carry reads metadata for at most 32 matching older cancelled sources (a 33rd row makes the result unknown), with each raw JSON field capped at 64 KiB and the total projection at 256 KiB. Unknown, malformed or truncated metadata, cold repository scope, private source/destination/context or changed actor/policy, source cancellation revision/consent metadata or destination flow/identity during readback leaves consent absent. Source history is not read, and unrelated historical note changes are not compared. Whole local references exclude prose, qualified projects and URLs; older-only sources exclude cycles. No source body, detail, plan or history is scanned.
115
+ - Spec validation itself is read-only. After the existing outer admission succeeds, the host atomically preserves the original person's `acceptedAt` and records a `spec acceptance carried` HUB history entry with the source task and cancellation revision alongside that outer event. A refused plan/stage/completion admission or a failed atomic consent/outer-event transaction retains the original task and history. Only the acceptance identity/edit fields move; the destination keeps its own plan review, artifact/head and lifecycle evidence. A repeated gate does not append another carry entry. Manual acceptance stays person-only and receipts cannot supply consent.
81
116
  - `ahub sdlc status <task>` and `explain` show `spec: {issue, state}` (`missing`, `current`, `changed` or `unknown`) when the lifecycle is enabled and the receipt names an issue. The spec state is not a merge-readiness blocker: its gate is build entry.
82
117
 
83
118
  # Acceptance-criteria checklist
@@ -164,6 +199,8 @@ The package-owned scripts/check-docs.mjs accepts --json with the same normal/--r
164
199
 
165
200
  The release reader additionally requests --committed: manifest, README and package metadata come from the captured HEAD, and dirty documentation/evidence files block freshness. A working-tree restamp cannot certify a commit that still contains stale stamps. The ordinary checker continues to support working-tree review before those stamps are committed.
166
201
 
202
+ The manifest must list `README.md`, every agent note and every page directly under `docs/` and `docs/addons/` except the dated records `docs/smoke.md` and `docs/gsd-collaboration-analysis.md`; a missing entry is an error. CI's `decision` job reports stale stamps as warnings on every PR, even when the gate is reused; only the release PR restamps (#1268).
203
+
167
204
  # Guarded merge (#786)
168
205
 
169
206
  `.agenthub/sdlc.toml` takes `auto_merge = "off" | "dry-run" | "on"` (default `off`) and optional `[repos."owner/name"]` tables with `required_checks` and `auto_merge`. A table's mode overrides the top-level one for that repository; its `required_checks` come first, then the top-level list, so a repository without branch protection is gated by what this file names (an empty set refuses: `required checks unknown`). Unknown keys are refused with a field path. The file is read once at start.
@@ -172,6 +209,50 @@ Two triggers, neither blocking: an approving `hub_review` at the PR's current he
172
209
 
173
210
  `on` runs exactly `gh pr merge <pr> --repo <repo> --squash --match-head-commit <head>` (a closed argv shape checked right before the call) and reads the PR back: only GitHub reporting `MERGED` is a merge, whatever the exit code. Never `--admin`, never a ref update used to perform the merge, and no `--auto` while the repository does not allow auto-merge (a person's repository setting). `dry-run` reports the same decision and the argv it would run and runs nothing; `off` reads nothing. Logs and notices name the task number and gates only. The verdict mirror is described in the next section.
174
211
 
212
+ ## Adopting a PR merged outside the hub (#1328 T3)
213
+
214
+ If a PR was merged before its task could finish the normal review flow, the
215
+ person or the current configured conductor runs:
216
+
217
+ ```sh
218
+ ahub sdlc adopt-merge <task> --pr <n>
219
+ ```
220
+
221
+ The task must already establish its repository. `--pr` can bind a missing PR
222
+ link; a conflicting recorded PR or repository refuses. The hub reads that
223
+ repository and PR and requires it merged at the task's last recorded full head,
224
+ with every configured required check green at that head and no open Important
225
+ finding. Unresolved or unknown review threads, pending or unknown review
226
+ requests, and an explicit change request refuse too. A GitHub approval is not
227
+ required when review coverage is complete and clean. The hub observes one
228
+ bounded GraphQL snapshot with checks bound to its head commit. Missing, pending,
229
+ failed or unknown checks refuse with their names and
230
+ a next step. A missing artifact, missing full head, changed task or policy,
231
+ stale actor/session or a held hub also refuses without changing the task.
232
+
233
+ Eligible task states are exactly `in_progress`, `in_review` and
234
+ `changes_requested`, with all Important findings dispositioned. `proposed` and
235
+ `backlog` tasks must be assigned and accepted first. `approved` and `cancelled`
236
+ are already closed. Each refusal names the state and the next step. The Board
237
+ transition is host-only and requires the current flow revision; the generic
238
+ state transition table is unchanged.
239
+
240
+ A successful adoption records `merged outside the hub` as the actual person's
241
+ or conductor's action, moves the task to `approved`, and releases dependents as
242
+ an ordinary approval does. It does not invent a reviewer verdict or reviewed
243
+ head, run `gh pr merge`, post a review, or remove a branch or worktree. A task
244
+ already approved or cancelled is not adopted again.
245
+ Observed `sdlc.head` follows the proven PR head; older local/reviewed metadata
246
+ remain unchanged and noncurrent. Normal settlement observers receive the
247
+ approval (origin follow-back, supervision, research recording and release/profile
248
+ timing), without adding a review verdict or automatic-done count. Release timing
249
+ never counts an adoption that occurred after the release.
250
+
251
+ Private tasks and private
252
+ turns refuse for every actor before GitHub reads; use the person's local review
253
+ workflow for private work. `--live-test` cannot delegate this approval as the
254
+ person.
255
+
175
256
  ## Merge result and cleanup (#786 T2)
176
257
 
177
258
  Post-run reads make at most three attempts within a shared six-second budget. Only a GitHub MERGED observation with its merge commit permits cleanup; the CLI exit is recorded separately, including a nonzero exit when GitHub confirms the merge. Non-merged, missing or unreadable evidence records the bounded result and leaves branches alone. Off and dry-run create no merge record or cleanup effects.
@@ -217,7 +298,7 @@ The predecessor is the newest non-draft entry from GitHub's descending release l
217
298
 
218
299
  # Delivery readback commands and surfaces (#257)
219
300
 
220
- `ahub sdlc queue <owner/repository>` and `ahub sdlc release <owner/repository> [live-issue...]` issue console-only readbacks. They also run through the existing console command path. The dashboard's Delivery evidence section uses labelled inputs and read-only buttons, textContent output and existing project/instance/generation fences; switching projects discards old reports and input. The report never changes task state or grants a permission. Private document names are removed at the Tasks public projection. Ledger issue state remains metadata, never native-success proof or release permission.
301
+ `ahub sdlc queue <owner/repository>` and `ahub sdlc release <owner/repository> [live-issue...]` are read-only readbacks, open to any agent as a public view. They also run through the existing console command path. The dashboard's Delivery evidence section uses labelled inputs and read-only buttons, textContent output and existing project/instance/generation fences; switching projects discards old reports and input. The report never changes task state or grants a permission. Private document names are removed at the Tasks public projection. Ledger issue state remains metadata, never native-success proof or release permission.
221
302
 
222
303
  The all-project manager forwards both delivery reads through the same scoped console connection with a 30-second cap, beyond their shared 20-second read budget. Stale/unknown project or instance identities and unknown operations remain refused.
223
304
 
@@ -294,11 +375,11 @@ At plan review, batch small related fixes into one area branch and PR; keep rele
294
375
 
295
376
  The planner can provide scope with `hub_plan_review`; the person can run `ahub sdlc plan-review <task> <revision> <reason...> --review full --reviewers 1 --ci full`. Tasks records the explicit scope on the plan and its revision-bound receipt. A file-list update retains omitted cost fields; an explicit scope change cannot replace a reviewed scope during enforce acceptance. Old plans and receipts remain unspecified and are never filled by guessing. Advise reports missing scope. In enforce, every newly recorded receipt needs both scopes; an existing scope-less receipt remains valid until a non-release planning revision changes, with the same complete-history exception under S11. Enforce acceptance cannot add owner-supplied cost keys to that legacy receipt; the planner must record an explicit scope first.
296
377
 
297
- A review request is premature if its task head does not match the PR head, configured required checks are not green, or a pending bot thread is unanswered. A resolved thread is settled; an unresolved one needs a user reply after its last bot comment. The hub reads identity, timestamps, authorship type and resolution only, never comment bodies. Without explicit required checks the native floor is both OS checks plus `seeded guards`. Advise reports the gap; enforce refuses before the requesting done/cohort writes. If only quiet task-history events arrive during an advise readback, the evidence is discarded and review continues with unknown readiness, without another external read. A reviewer change is allowed because the reviewer is re-derived before the write; it is not an authority or readiness receipt. Mode, owner, privacy, receipt, authority and other history drift still refuse; enforce remains unchanged. A private turn may finish its own PII task in advise with a generic unknown-readiness notice and no remote metadata read; the private-turn refusal for ordinary work remains. Delayed checks revalidate before completing; a refused completion sends a private-aware notice to call `hub_task_done` again only while the task is still in progress with the owner that started the check. Otherwise only the console notice is recorded. Background roster/quota role changes remain fact, but enforce holds a new review envelope without an admission readback; refresh it through a manual reviewer assignment after CI and replies are ready. The brief and verdict coverage belong to #520, separate from this admission.
378
+ A review request is premature if its task head does not match the PR head, configured required checks are not green, or a pending bot thread is unanswered. A resolved thread is settled; an unresolved one needs a user reply after its last bot comment. The hub reads identity, timestamps, authorship type and resolution only, never comment bodies. Without explicit required checks the native floor is both OS checks plus `seeded guards` for `STAIxBWLB/agent-hub` only; another repository reports `required checks unknown: set required_checks in .agenthub/sdlc.toml` (#1344). Advise reports the gap; enforce refuses before the requesting done/cohort writes. If only quiet task-history events arrive during an advise readback, the evidence is discarded and review continues with unknown readiness, without another external read. A reviewer change is allowed because the reviewer is re-derived before the write; it is not an authority or readiness receipt. Mode, owner, privacy, receipt, authority and other history drift still refuse; enforce remains unchanged. A private turn may finish its own PII task in advise with a generic unknown-readiness notice and no remote metadata read; the private-turn refusal for ordinary work remains. Delayed checks revalidate before completing; a refused completion sends a private-aware notice to call `hub_task_done` again only while the task is still in progress with the owner that started the check. Otherwise only the console notice is recorded. Background roster/quota role changes remain fact, but enforce holds a new review envelope without an admission readback; refresh it through a manual reviewer assignment after CI and replies are ready. The brief and verdict coverage belong to #520, separate from this admission.
298
379
 
299
380
  **Evidence in the review request (#824).** A fresh reviewer cannot run tests or read `gh`, so the request carries the hub's own reading of the admission it already made, for every reviewer: `Hub-verified at <head>: required checks <names> passed at this exact head; no bot review thread is waiting for a reply` (plus `via identical-tree run <n>` when the hub reused one), or in advise mode `Hub-verified at <head>: not ready: <blockers>`. No admission (lifecycle off) and a PII task get no block, and no new `gh` call is made for it: it renders what `reviewRequestAdmission` read. `ReviewReadiness.checks` names the required checks that were judged. When the admission is ready and the hub ran no check of its own, the checklist's check line says CI passed at this exact head and that test execution or CI evidence is not an unmet item (name a specific missing test or behaviour instead); otherwise the old wording stays. The text comes only from the hub's reads and recorded `check passed` events, never from the builder's summary or a `hub_sdlc_record` claim, and a review-only reviewer still gets no builder summary (#223 R2).
300
381
 
301
- CI controllers are serialized per pull request (`check-pr-<number>`) and for main pushes and ordinary dispatches (`check-main`), for the entire workflow and without canceling an admitted controller (#609); macOS timing dispatches use their own macos-timing group. Within a PR `queue: single` lets a newer pending run replace the older pending one; main keeps `queue: max`, which preserves up to 100 waiting controllers ([GitHub concurrency documentation](https://docs.github.com/en/actions/how-tos/write-workflows/choose-when-workflows-run/control-workflow-concurrency)). Different PRs run side by side: a repository-wide lock serialized every PR (17-18 min alone, 40-54 min with 4-5 PRs in flight on 2026-10-20). Two groups admitting the same tree at the same instant can run it twice; that duplicate costs one run and never a false green. Required job names and read-only token permissions are unchanged. Before PR or push gates, `scripts/ci-reuse.mjs` reuses successful full proof for the identical Git tree, including its workflow. On reuse the two OS matrix jobs still expand and report their exact required names, while the seeded aggregate reports its exact name. They run only a `Reuse verified identical-tree full gate` marker step naming the original proof; full setup and gates are skipped. Skipped jobs and successful reuse-reporting jobs never count as fresh full proof. A running identical-tree gate refuses duplicate admission; unknown active coverage refuses safely. Only a 404, a timeout on the individual read limit, or malformed successful proof is dropped: a failed successful-run list drops that proof phase, while a failed commit or jobs read drops only that candidate and continues the bounded search. Other failures (5xx, 403, 429, response size bounds, authentication and unclassified errors) remain unknown. Exhausting the overall deadline or request budget stays unknown even when a request reports a timeout. Without verified proof, a complete empty active scan requires a fresh gate. An unreadable, truncated or unidentifiable active inventory, or exhaustion of the shared request budget or deadline, stays unknown and refuses admission. The release reader (`--require`) still refuses without verified identical-tree full proof. Metadata reads are bounded to 100 recent successes/active runs and 240 calls within 60 seconds. Pending serialized controllers are not admitted gates. Run focused tests and `scripts/check.sh --changed` locally; CI carries the full-suite gate; a known flake warrants only one rerun of its failed job with recorded evidence.
382
+ CI controllers are serialized per pull request (`check-pr-<number>`) and for main pushes and ordinary dispatches (`check-main`), for the entire workflow and without canceling an admitted controller (#609); macOS timing dispatches use their own macos-timing group. Within a PR `queue: single` lets a newer pending run replace the older pending one; main keeps `queue: max`, which preserves up to 100 waiting controllers ([GitHub concurrency documentation](https://docs.github.com/en/actions/how-tos/write-workflows/choose-when-workflows-run/control-workflow-concurrency)). Different PRs run side by side: a repository-wide lock serialized every PR (17-18 min alone, 40-54 min with 4-5 PRs in flight on 2026-10-20). Two groups admitting the same tree at the same instant can run it twice; that duplicate costs one run and never a false green. Required job names and read-only token permissions are unchanged. Before PR or push gates, `scripts/ci-reuse.mjs` reuses successful full proof for the identical Git tree, including its workflow. On reuse the shard jobs are skipped, and the aggregate jobs `check (ubuntu-latest)`, `check (macos-latest)` and `seeded guards` report their exact required names. They run only a `Reuse verified identical-tree full gate` marker step naming the original proof; full setup and gates are skipped. Skipped jobs and successful reuse-reporting jobs never count as fresh full proof. A running identical-tree gate refuses duplicate admission; unknown active coverage refuses safely. Only a 404, a timeout on the individual read limit, or malformed successful proof is dropped: a failed successful-run list drops that proof phase, while a failed commit or jobs read drops only that candidate and continues the bounded search. Other failures (5xx, 403, 429, response size bounds, authentication and unclassified errors) remain unknown. Exhausting the overall deadline or request budget stays unknown even when a request reports a timeout. Without verified proof, a complete empty active scan requires a fresh gate. An unreadable, truncated or unidentifiable active inventory, or exhaustion of the shared request budget or deadline, stays unknown and refuses admission. The release reader (`--require`) still refuses without verified identical-tree full proof. Metadata reads are bounded to 100 recent successes/active runs and 240 calls within 60 seconds. Pending serialized controllers are not admitted gates. Run focused tests and `scripts/check.sh --changed` locally; CI carries the full-suite gate; a known flake warrants only one rerun of its failed job with recorded evidence.
302
383
 
303
384
  `hub_sdlc_costs` and the person's `ahub sdlc costs [owner/repo]` report linked merged PRs without changing the board. A review round is a board done-to-verdict handoff, not each reviewer in a multi-reviewer round. An observed handoff still counts when its declared scope was none. The report counts distinct check-workflow run ids, extra attempts (`run_attempt - 1`), full re-reviews, delta rounds and summed review intervals, with GitHub review counts alongside them. Unspecified scope and unavailable evidence stay unknown/incomplete. Only current public links are projected; a private counterpart withholds the whole PR. Up to 16 linked PR reads share 20 seconds; each PR covers at most 100 commits, reviews and recent check-workflow runs, and the pure aggregator bounds 500 tasks, 200 PRs and 10,000 history entries. Truncation is explicit. S10 exposes pure band-breach proposal data; S7 owns rolling baselines, band configuration, automatic scheduling and board-card creation.
304
385
 
@@ -405,11 +486,11 @@ Tracked npm cleanliness compares the cached index to HEAD and raw tracked blob b
405
486
 
406
487
  Release preparation is an agent task; the release decision remains the person's. Consent may be recorded by the person or by the configured conductor on the explicit version-naming instruction above; preparation alone grants no consent. A hub captured before #1120 has no `scripts/check-docs.mjs` in its runtime copy, so `ahub sdlc authorize-release` there refuses with "documentation checker ... is missing from the running hub" (not "stale documentation"): record consent from a hub that carries the checker, either `ahub upgrade` to a release that includes #1120 or a hub started from the candidate checkout with `bun src/cli/main.js`, and never restamp documents to get past it.
407
488
 
408
- `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 CHANGELOG section (the Unreleased entries move under the version, Unreleased stays empty), 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.
489
+ `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.
409
490
 
410
491
  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).
411
492
 
412
- `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; 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`).
493
+ `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`).
413
494
 
414
495
  The scripts and their pure helpers live in `scripts/release-prepare.ts`, `scripts/release-tag.ts` and `scripts/lib/release-plan.ts`; they are maintainer tooling and are not part of the published package. The deterministic recovery barriers of #787 AC3 are not needed by either leg and are not part of this change.
415
496
 
@@ -427,4 +508,29 @@ A report, translation or slide deck has no commit, so the artifact identity is t
427
508
  - **Private records.** For a PII task, or a file under `pii.paths`, the record is private: every peer view, review request, status and log shows the id, hash and size only, `(path withheld)` in the request. The board keeps the path so the file can be found again, as it keeps the rest of a PII task's text. A path that matches a PII pattern is withheld the same way.
428
509
  - `hub_sdlc_record` with `deliverables` records them on a `lifecycle` entry, through the same hashing and the same owner, reviewer or console authority; a receipt without them is the old call.
429
510
  - Limit: a daemon from before this slice ignores `deliverables` on `hub_task_done` (the plugin is installed apart from the daemon), so restart the hub after an upgrade before relying on it; a done that names deliverables and shows no `Deliverables` block in its review request was recorded without them.
430
- - Not in this slice: `ahub deliverables [--task <id>]` and the dashboard column (#509 AC3, the next slice), and a hash of a file the hub cannot read.
511
+ - `ahub deliverables [--task <id>] [--approved] [--check]` lists them (#509 AC3). Not in this slice: a hash of a file the hub cannot read.
512
+
513
+ ## Named CI and build-entry diagnostics (#1328 T2)
514
+
515
+ Exact-head review blockers name each required check and its state, for example
516
+ `exact-head full CI is not green: missing seeded guards; pending check (macos-latest)`.
517
+ Failed, duplicate and unknown checks are named too. Incomplete inventories remain
518
+ unknown, and identical-tree reuse still requires its full proof and snapshot recheck.
519
+ Complete cached and fresh review evidence use the same diagnostic formatter.
520
+
521
+ Enforce build-entry guidance names the first missing snapshot step in this order:
522
+
523
+ 1. `spec issue not recorded (owner/planner: hub_sdlc_record)`
524
+ 2. `spec not accepted (person: ahub sdlc accept <task> --issue <n>)`
525
+ 3. `plan not reviewed (planner: hub_plan_review)`
526
+
527
+ Proposal results and route explanations carry this guidance separately from peer
528
+ eligibility. A plan-review hold is recorded as a ready hold, never as
529
+ `no-eligible-peer`; that label remains a peer-eligibility outcome. Assignment stays
530
+ pure and receives snapshot guidance as data. Candidate choice and the existing
531
+ plan-only offer gate remain unchanged: an owner offer may precede person spec
532
+ acceptance. Acceptance still runs live spec checks before live plan checks, with
533
+ its existing authority and currentness fences. Snapshot guidance never certifies
534
+ that an accepted spec or reviewed issue is still current. Unavailable, private or
535
+ closed plan evidence retains its original diagnostic lead and planner action. Private task projections
536
+ withhold these issue-specific diagnostics.