@staix/agent-hub 0.35.0 → 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 (104) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/README.md +21 -4
  3. package/docs/agent-notes/README.md +60 -0
  4. package/docs/agent-notes/adapters.md +5 -2
  5. package/docs/agent-notes/bus.md +1 -0
  6. package/docs/agent-notes/daemon.md +5 -4
  7. package/docs/agent-notes/models.md +4 -3
  8. package/docs/agent-notes/tasks.md +8 -1
  9. package/docs/agent-notes/tests.md +1 -0
  10. package/docs/design/adapters.md +72 -0
  11. package/docs/design/agent-hub-architecture.md +1 -1
  12. package/docs/design/bus.md +8 -0
  13. package/docs/design/execution-reference.md +171 -11
  14. package/docs/design/guidance-experiments.md +438 -0
  15. package/docs/design/model-routes.md +628 -0
  16. package/docs/design/supervision.md +121 -0
  17. package/docs/design/task-board.md +111 -0
  18. package/docs/dogfood.md +15 -4
  19. package/docs/operations.md +291 -22
  20. package/docs/profiles.md +2 -2
  21. package/docs/quickstart.md +106 -1
  22. package/docs/research.md +4 -2
  23. package/docs/sdlc.md +108 -4
  24. package/docs/security.md +67 -5
  25. package/docs/specs/2026-09-19-agent-hub-design.md +5 -4
  26. package/docs/verification/2026-10-25-qwen-dual-output-t0.md +22 -0
  27. package/docs/verification/2026-11-09-qwen-0270-acp.md +181 -0
  28. package/docs/verification/2026-11-09-qwen-0270-model-setter-1317.md +46 -0
  29. package/docs/verification/2026-11-10-0.36.0.md +59 -0
  30. package/docs/verification/2026-11-10-claude-implementer-2.1.322.md +59 -0
  31. package/docs/verification/2026-11-10-qwen-0270-dual-output.md +367 -0
  32. package/docs/verification/2026-11-10-qwen-0271-dual-output.md +101 -0
  33. package/docs/verification/claude-shell-wrapper-native.py +1 -1
  34. package/docs/verified.json +27 -27
  35. package/package.json +1 -1
  36. package/plugins/agent-hub/.claude-plugin/plugin.json +1 -1
  37. package/plugins/agent-hub/kimi-hook.js +1201 -368
  38. package/plugins/agent-hub/server.js +1682 -431
  39. package/src/adapters/claude-channel.ts +7 -4
  40. package/src/adapters/compat.ts +10 -10
  41. package/src/adapters/local-worker.ts +1 -1
  42. package/src/adapters/qwen-dual.ts +324 -44
  43. package/src/cli/guidance.ts +67 -0
  44. package/src/cli/help.ts +10 -3
  45. package/src/cli/identity.ts +10 -3
  46. package/src/cli/init-prompt.ts +15 -2
  47. package/src/cli/init-required-checks.ts +122 -0
  48. package/src/cli/init-settings.ts +10 -4
  49. package/src/cli/init.ts +39 -3
  50. package/src/cli/lineage.ts +78 -0
  51. package/src/cli/main.ts +111 -10
  52. package/src/cli/setup-research.ts +10 -0
  53. package/src/hub/autonomy-defaults.ts +20 -9
  54. package/src/hub/board.ts +346 -4
  55. package/src/hub/build-entry.ts +11 -0
  56. package/src/hub/bus.ts +12 -0
  57. package/src/hub/ci-watch.ts +4 -4
  58. package/src/hub/config-apply.ts +2 -1
  59. package/src/hub/config-trust.ts +1 -0
  60. package/src/hub/control-client.ts +1 -1
  61. package/src/hub/daemon.ts +342 -20
  62. package/src/hub/delivery-hints.ts +4 -2
  63. package/src/hub/delivery-journal.ts +50 -2
  64. package/src/hub/delivery-public.ts +51 -0
  65. package/src/hub/dogfood-profile.ts +8 -4
  66. package/src/hub/execution-lineage-owner.ts +272 -0
  67. package/src/hub/execution-lineage.ts +52 -8
  68. package/src/hub/execution-links.ts +85 -0
  69. package/src/hub/guidance-variants.ts +398 -0
  70. package/src/hub/handoff.ts +1 -0
  71. package/src/hub/hub-tools.ts +43 -2
  72. package/src/hub/manager.ts +44 -2
  73. package/src/hub/memory-policy.ts +2 -2
  74. package/src/hub/peers.ts +1 -1
  75. package/src/hub/planning.ts +1 -1
  76. package/src/hub/progress.ts +24 -7
  77. package/src/hub/restart.ts +13 -0
  78. package/src/hub/roles.ts +26 -0
  79. package/src/hub/routing.ts +4 -1
  80. package/src/hub/sdlc-merge.ts +39 -1
  81. package/src/hub/sdlc-release.ts +1 -1
  82. package/src/hub/sdlc.ts +62 -11
  83. package/src/hub/settings.ts +2 -0
  84. package/src/hub/supervision-proposals.ts +405 -0
  85. package/src/hub/supervision-rules.ts +388 -0
  86. package/src/hub/supervision.ts +2 -0
  87. package/src/hub/task-approval.ts +2 -2
  88. package/src/hub/task-repository.ts +5 -0
  89. package/src/hub/tasks.ts +603 -50
  90. package/src/memory/capture.ts +2 -2
  91. package/src/models/relay.ts +9 -2
  92. package/src/models/route/config.ts +27 -0
  93. package/src/models/route/decision.ts +87 -15
  94. package/src/models/route/relay-selector.ts +8 -7
  95. package/src/models/route/runtime.ts +22 -16
  96. package/src/models/route/stage-diagnostics.ts +22 -0
  97. package/src/models/route/stage-evidence.ts +55 -0
  98. package/src/models/route/stage-fallback.ts +58 -0
  99. package/src/models/route/stage-input.ts +155 -0
  100. package/src/models/route/stage.ts +5 -147
  101. package/src/ui/guidance-panel.ts +156 -0
  102. package/src/ui/guidance-view.ts +43 -0
  103. package/src/ui/lineage-view.ts +34 -0
  104. package/src/ui/plugin.ts +71 -7
@@ -18,7 +18,7 @@ Or use the matching GitHub release:
18
18
 
19
19
  <!-- facts:install-tag -->
20
20
  ```bash
21
- bun add -g github:STAIxBWLB/agent-hub#v0.35.0
21
+ bun add -g github:STAIxBWLB/agent-hub#v0.36.0
22
22
  ahub setup
23
23
  ```
24
24
  <!-- /facts:install-tag -->
@@ -48,6 +48,12 @@ terminal in that project: it reviews the plan with you, applies it and follows
48
48
  it; other projects keep their version. It then names the `bun add -g` and
49
49
  `ahub setup` step when your global CLI or plugin is older than the new daemon.
50
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
+
51
57
  ## Upgrading to 0.35.0
52
58
 
53
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.
@@ -278,6 +284,105 @@ ahub say "Each of you: reply with your name." # broadcast
278
284
  ahub say @kimi "run the tests and report" # one peer
279
285
  ```
280
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
+
281
386
  ## The local worker
282
387
 
283
388
  `local` needs an OpenAI-compatible gateway. Put yours in `.agenthub/config.local.json`
package/docs/research.md CHANGED
@@ -14,7 +14,9 @@ In a project's `.agenthub/config.json`:
14
14
  ```
15
15
 
16
16
  Off by default; anything but `true` is off. While it is off the hub writes nothing and creates no file. The setting is
17
- applied live: a config reload takes it without a restart.
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).
18
20
 
19
21
  ## Where they go
20
22
 
@@ -24,7 +26,7 @@ directory, so `ahub research --all` can compare them. `ahub reset --all` does no
24
26
 
25
27
  ## When a record is written
26
28
 
27
- When a task reaches a terminal board state (a review approves it, its owner reports a task without a reviewer done, or it is cancelled), 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
28
30
  until no open turn is attributed to the task (the turn that approved it ends after the approval, and its usage arrives
29
31
  later still), checking every 10 s for at most 30 minutes, then appends one task record built from that project's
30
32
  events and the board. A hub that stops first writes it once its peers have stopped. A terminal state is final on the
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
 
@@ -68,7 +100,7 @@ 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
 
@@ -77,7 +109,10 @@ A person records ids and a claimed local receipt with `ahub sdlc record 12 '{"re
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
@@ -174,6 +209,50 @@ Two triggers, neither blocking: an approving `hub_review` at the PR's current he
174
209
 
175
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.
176
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
+
177
256
  ## Merge result and cleanup (#786 T2)
178
257
 
179
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.
@@ -296,7 +375,7 @@ At plan review, batch small related fixes into one area branch and PR; keep rele
296
375
 
297
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.
298
377
 
299
- 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.
300
379
 
301
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).
302
381
 
@@ -430,3 +509,28 @@ A report, translation or slide deck has no commit, so the artifact identity is t
430
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.
431
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.
432
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.
package/docs/security.md CHANGED
@@ -10,7 +10,7 @@ agent-hub connects agents that can each run commands. This page says what the hu
10
10
  - **Control-write diagnostics carry metadata only (#1126).** The daemon's write spans and event-loop probe record a closed set of operation kinds, phases, task numbers and durations, never task text, paths, ids of transports, actors or sessions, credentials, error text or external output, and nothing for a PII task or a private turn. A frame from a client that has not authenticated is never inspected for them. Retention is capped (128 requests, 256 spans, 512 recent intervals, five-minute expiry) and a record in `hub.log` is at most 2,048 bytes; client timing on stderr is off unless `AHUB_CONTROL_WRITE_TIMING=1`.
11
11
  - **Permission prompts stay on unless an operator selects a permission mode.** `ask` leaves native decisions unchanged. `ask-when-needed` grants scoped Claude file tools or Pi/local writes and edits, and a headless Claude implementer's proven shell commands through the host wrapper (#845, below); Kimi and Codex use their own native policies. `never-ask` requires explicit runtime confirmation, a person's console `y` for a config default at hub start, or retained autonomy consent bound to that peer's exact never-ask value in the untracked `config.local.json` (#999, below). Without one of these the peer runs in `ask`. Kimi's and `local`'s permission requests are relayed to the console and cancelled after `approvals.timeout_s` (default 120 s) of silence; the macOS notification for a waiting request carries the peer and the tool name only. The one exception is the hub's own tools (`hub_send` and the task tools, matched by exact name): Kimi's requests for them are approved once without a prompt and logged by name, the same trust Codex gets through `approval_mode` in the hub's config. They invoke hub-owned operations rather than arbitrary file or shell tools, and every call passes the hub's own checks. A call the always-ask policy classes (below) is never approved this way, whatever its title. Identity comes from the exact permission title, or from the earlier tool-call title bound to the same call id and resolved against the configured MCP servers when the permission title contains argument JSON (Qwen). Payload text and unrelated display titles never establish identity. Configured ACP kinds (#451) never get this exception: a request whose title spells a hub tool exactly still goes to the person approval path, and only a mapped native mode changes what the agent itself asks. For ACP agents, a payload longer than the console shows is marked as cut and never offers a session-wide grant. Pi's write, edit, shell and git write requests are relayed the same way and can be answered `Always allow <tool> until Pi restarts`: later calls of that tool by the same Pi start skip the prompt but stay inside the path guard and sandbox. The grant covers every later call of that tool whatever its payload, is kept in memory only, cannot be given from the dashboard, and each call it allows is logged by tool name. A Pi or `local` request whose call was cancelled or whose turn ended is withdrawn at once: a later answer is refused and grants nothing, an `Always allow` included. One shell command runs without a hub approval: the `!command` a person types in the managed Pi TUI. It stays inside the same sandbox and denylist, and the hub takes it only from the verified owner process of a Pi in TUI mode, while Pi is idle, on a reservation that is used once; a model's own bash call never takes that path (issue #253). `--unattended` turns prompts off, says so loudly, and is never the default; a classed call from a hub-owned ACP peer, the local worker or Pi still waits for a person under it.
12
12
  - **A committed config cannot choose launch commands, credential files, data endpoints, permission modes or a wider sandbox.** The machine-local fields (`kimi_cmd`, `permission_modes`, `codex_bin`, `pi.cmd`, `checks`, `mlx.bin`, `mlx.runtimeDir`, `mlx.modelPath`, `omniroute.urls`, `omniroute.access_hosts`, the `omniroute` key files, `memory.worker_url` (still accepted, ignored since 0.16.0), `local.read_allow`, `local.bash_network`, `local.network_allow`, `local.doc_read`, `local.web_fetch`, `terminal.open`, `tasks.auto_pull`, `tasks.queue_backpressure`, `context.max_assignment_used`, `schedules` (the `every`, `cron` and `tz` forms alike), `folder_triggers`, `corpus.paths`, `invocation`, `start.agents`, `instances`, `action_policy`, `rooms`) apply only from a config file git confirms nobody committed (`instances`, `action_policy` and `rooms` are read only from an untracked `.agenthub/config.local.json`; in `config.json` they are ignored even when untracked): `.agenthub/config.json` or `.agenthub/config.local.json`, matched by file identity so no other spelling the file system accepts slips past, and `.agenthub` itself not a committed symlink or submodule. Without a repository, or when git fails, they keep their defaults; an empty value always means the default. "Untracked" is answered by the repository that contains the project: a checkout copied or extracted into an unrelated repository, or into an ignored directory of one, is trusted like your own files. So a cloned repository cannot choose a launch command, a completion check, a gateway to send a key file to, a memory endpoint, a permission mode, the command that opens a terminal, which agents `ahub up` opens terminals for, a folder the hub reads, work proposed on a timer, a host a model may fetch from, which of your agents' skills other peers may call, or a wider sandbox. A command in `checks` runs as you, outside the local worker's sandbox, like a git hook. So do the `setup` and `verify` commands of a benchmark suite (issue #251): `ahub bench run <suite.json>` is a person's command, refused from an agent session, and it resets the work tree for each attempt, so it runs only with `bench.enabled`, at the root of a clean repository that tracks nothing under `.agenthub/`. Nothing in `routing.toml` or in task text is ever run. `routing.toml` and the other shared fields still come from the checkout, and they matter: `routing.toml` picks the models the local worker and the hub's inference use at your gateway and can turn the PII constraint off, and roles and budget shape who does what. Review them in a repository you do not trust. The hub's own git calls outside the sandbox (snapshots, facts, config trust, project discovery, memory recall, the bench runner) all use the single hardened implementation in the exact-pinned first-party `@staix/agent-mem/platform` package, re-exported by `src/hub/git.ts`, which disables the programs a repository's configuration can name — the file-system monitor, hooks, external diff, the pager, and the credential and askpass helpers, with prompts failing closed — so a config that ever does get written cannot run code with the hub's rights. Of those, the monitor, hooks and external diff are reachable by commands the hub issues (the planted-program test exercises all three; a `diff --no-index` reads the repo's config, so that call also passes `--no-ext-diff` and `--no-textconv`); the pager is not (every call pipes stdout). Credential and askpass helpers are disabled for project repositories; memory sync alone may use credentials for its own memory repository, without prompts. The cost: `core.fsmonitor=false` also turns off a person's enabled built-in monitor for the hub's own calls, so the per-turn snapshot's `add -A` scans the whole tree (the snapshot Git calls of one burst share a 250 ms budget, each call at most 10 s; a boundary that runs out is recorded as unknown, never as a stale baseline) (#576). git has no global switch for filter drivers, and of the hub's commands only the snapshot's `add`/`restore` would run one (its driver command lives in the protected `.git/config`).
13
- - **Telemetry holds no bodies.** `.agenthub/state/events.jsonl` (issue #40) records envelope ids, routing and sizes, task ids and states, overlapping paths and token counts, and the task id (with a PII flag) that each usage and token record is attributed to. It never records a message body, a task title or detail, and marks private (PII) envelopes and tasks as such. Budget pauses, resumes and quota resets carry the peer, window, times and the hub's own reason text, and a person's release authorization its commit, version and docs digest. The usage roll-up (#683) folds the usage, token and limit records into `hub.db` and joins issue, PR and release from the board when read; `ahub usage` and the console's Usage panel answer only the console and a configured planner, and a planner not during a private turn. Kimi's token records (#285) are counted from its own session wire log under its home: only the four token integers, the model label and the row time are copied, and the record id is an opaque hash, never a path, session id or text. agy's (#1280) are read from its session transcript through the hook-gated readback the same way: the token integers and an opaque hash of session and step. A person's model override (`model_change`, #1317) records the peer, the previous and new model ids and the next-turn boundary; a visual (#1058) its id, kind, byte and image counts and optional task id. The log stays on the machine; `ahub export` only prints it. Two opt-in stores copy numbers from it into your home directory, shared by every project on the machine (directories mode 700, files 600): research records (issue #247, `research.enabled`) in `~/.agenthub/research/` hold per approved or cancelled task (record v2) the ids, states, counts, tokens, times and PII flag the events hold, counts and closed words only, a person's label from a closed list, and a hash in place of the project id, and `ahub research export --dataset <dir>` writes an allowlisted copy meant to leave the machine (peers reduced to family names, project-chosen role and profile names dropped, owner-only files in a directory inside the home and outside every registered project, compared as real paths); benchmark runs (issue #251) in `~/.agenthub/bench/` hold suite name and hash, arm label, the attached peers' ids, models and permission modes, task ids, outcomes, exit codes, counts, tokens and times, never suite text or a command's output.
13
+ - **Telemetry holds no bodies.** `.agenthub/state/events.jsonl` (issue #40) records envelope ids, routing and sizes, task ids and states, overlapping paths and token counts, and the task id (with a PII flag) that each usage and token record is attributed to. It never records a message body, a task title or detail, and marks private (PII) envelopes and tasks as such. Budget pauses, resumes and quota resets carry the peer, window, times and the hub's own reason text, and a person's release authorization its commit, version and docs digest. The usage roll-up (#683) folds the usage, token and limit records into `hub.db` and joins issue, PR and release from the board when read; `ahub usage` and the console's Usage panel answer only the console and a configured planner, and a planner not during a private turn. Kimi's token records (#285) are counted from its own session wire log under its home: only the four token integers, the model label and the row time are copied, and the record id is an opaque hash, never a path, session id or text. agy's (#1280) are read from its session transcript through the hook-gated readback the same way: the token integers and an opaque hash of session and step. A person's model override (`model_change`, #1317) records the peer, the previous and new model ids and the next-turn boundary; a visual (#1058) its id, kind, byte and image counts and optional task id. The log stays on the machine; `ahub export` only prints it. Two opt-in stores copy numbers from it into your home directory, shared by every project on the machine (directories mode 700, files 600): research records (issue #247, `research.enabled`; a person's explicit `ahub setup --research` or `--no-research` saves the default for new projects in the owner-only `~/.agenthub/defaults.json`, which `ahub init` only reads, and a missing, unreadable or untrusted file means off, #1347) in `~/.agenthub/research/` hold per approved or cancelled task (record v2) the ids, states, counts, tokens, times and PII flag the events hold, counts and closed words only, a person's label from a closed list, and a hash in place of the project id, and `ahub research export --dataset <dir>` writes an allowlisted copy meant to leave the machine (peers reduced to family names, project-chosen role and profile names dropped, owner-only files in a directory inside the home and outside every registered project, compared as real paths); benchmark runs (issue #251) in `~/.agenthub/bench/` hold suite name and hash, arm label, the attached peers' ids, models and permission modes, task ids, outcomes, exit codes, counts, tokens and times, never suite text or a command's output.
14
14
  - **Snapshots stay in your repository.** Per-turn snapshots (issue #33) are git objects in the project's own object store, written through a temporary index; nothing is referenced, pushed or copied elsewhere, and `git gc` prunes them. They hold what the work tree held, including untracked files that are not ignored, so keep secrets in ignored files. They carry the repository's own permissions, and nothing caps their disk use but `git gc`. A turn of a peer holding an open PII task is not snapshotted; a PII file left in the project is snapshotted by later turns like any other file. `ahub undo` restores only files whose current content is exactly what the turn left.
15
15
  - **The edit hook reads, never decides.** `ahub check-path --hook` (issue #32) reads hub.db and returns context for Claude and a line for you; it sets no permission decision, so your permission rules stay in charge. It names other owners' task ids, titles and states, which then reach Claude's model; PII tasks are left out.
16
16
  - **The session record holds identities only.** `.agenthub/state/sessions.json` (issue #37, mode 600) keeps each attached peer's recovery metadata: launch options, session and thread ids, Pi's session file path. No message or task text; loss notices name deliveries by id, sender and public task title. The Pi continuity bookmark that recovery keeps across stop and archive (`.agenthub/state/recovery-continuity.json`, mode 600, at most 16 KiB) holds identities only too: operation and project ids, the project root, and Pi's session id, session file, backend and model name; a bookmark that is not a private regular file, is larger than that or names another project or operation reads as invalid, which is kept distinct from no bookmark.
@@ -768,6 +768,7 @@ External adapter modules (#451 A4) are the one way to run adapter code that ship
768
768
  - Hub tools are auto-approved by the exact `mcp__agent-hub__<tool>` name Qwen reports for the call and never by prefix, title or argument text. Everything else asks the console, and an always-ask class call (#636) is never auto-approved. A prompt answered in the Qwen terminal withdraws the hub's pending approval: a late answer finds nothing to grant.
769
769
  - Identity: the adapter attaches only a Qwen whose `session_start` states a verified version, protocol 2 and the events the hub reads, and it binds the running owner from the host's process table (the root of the process tree whose argv names this adapter's input file: Qwen 0.26.1 runs as a wrapper, a node launcher and a `cli.js` child that all name it; two separate roots is no owner), never from a message the launcher sends. The hub never signals that process and never types into its terminal; the person's terminal owns it.
770
770
  - Environment: `ahub qwen --mode tui` execs Qwen in the person's own environment (Qwen needs their PATH, HOME and provider key, which the daemon never copies) with the hub's peer marker over it. Every other `AGENTHUB_*` variable but `AGENTHUB_HOME`, the other agents' vendor markers, and recovery and unattended authority are dropped, so a Qwen started from another agent's shell never carries that agent's identity, launch id or mode.
771
+ - A hub deny is not a readiness signal (#1371). The denied delivery completes without an answer, and later queued input stays unsubmitted behind a durable fence until a new personal turn completes in the Qwen terminal or a verified fresh native generation starts; the denied turn's own Stop, a readable event file again, a replayed `session_start` or a hub restart does not release it, and the peer reports offline after 30 s. A short or unconfirmed input write holds the delivery `needs_review` and appends nothing more.
771
772
  - Not defended: a person who gives Qwen yolo mode, an agent that Qwen runs and that writes the file through a path this lexical check does not recognise, and another process of the same user (the usual same-user boundary of the state directory).
772
773
 
773
774
  ## Global attention metadata (#280, phase 3)
@@ -883,7 +884,7 @@ Current daemons advertise `task_cancel` in hello and status metadata. A current
883
884
 
884
885
  Stall causes are persisted and deduplicated by cause and replanning revision. Planner advice joins its next delivery as bounded ids-only context; it does not manufacture an ordinary task turn. Pull-only offer attention clears only after acceptance, decline, supersession or durable positive evidence for that exact offer and recipient. Operator, hub or owner completion of an uncertain delivery is not evidence that the offer was read.
885
886
 
886
- `hub_delivery_retry` grants an eligible recipient one retry of its own `needs_review` work, never pause removal. `hub_delivery_resolve` (#1112) lets a local agent mark only its own `needs_review` row `completed` or `discard`, at the revision `hub_inbox` showed, with a public, screened reason recorded under its actor. An attached Claude push-channel session may also settle its own `accepted` row that way (#1172); any other peer's `accepted` row is refused. It never replays the originals or changes task state. An unknown id, another peer's row and a row in neither state share one refusal, so the answer never confirms another peer's row. A channel `accepted` row that gets neither native completion nor that disposition within `bus.accepted_settle_ms` (default ten minutes) becomes `needs_review` with no replay. With `conductor.feed` on, the configured conductor gets one ids-only notice for an important, task or review timeout. The person, the hub, a remote peer, a paused or held peer, and recovery, shutdown or storage holds are refused. A row that carries an invocation stays person-only, because its outcome is uncertain. An explicit `hub_inbox` read may return newly queued messages behind such a hold, never the held originals, and only when no recovery, pause, lifecycle or storage fence applies. Durable per-original evidence survives journal pruning; unknown retry history or a used retry requires the person. Hub presence prefaces are excluded from attempted-work identity, so a shared context preface does not consume an unrelated message's retry. Delivery-only local and ACP peers (including Jcode) cannot invoke recipient retry; tool exposure hints do not replace the daemon's actual-adapter guard. Their held work requires person resolution. Before transport handoff, storage failure preserves the queue and preface; after handoff an uncertain effect is never automatically replayed.
887
+ `hub_delivery_retry` grants an eligible recipient one retry of its own `needs_review` work, never pause removal. `hub_delivery_resolve` (#1112) lets a local agent mark only its own `needs_review` row `completed` or `discard`, at the revision `hub_inbox` showed, with a public, screened reason recorded under its actor. An attached Claude push-channel session may also settle its own `accepted` row that way (#1172); any other peer's `accepted` row is refused. It never replays the originals or changes task state. An unknown id, another peer's row and a row in neither state share one refusal, so the answer never confirms another peer's row. A channel `accepted` row that gets neither native completion nor that disposition within `bus.accepted_settle_ms` (default ten minutes) becomes `needs_review` with no replay. With `conductor.feed` on, the configured conductor gets one ids-only notice for an important, task or review timeout. The person, the hub, a remote peer, a paused or held peer, and recovery, shutdown or storage holds are refused. A row that carries an invocation stays person-only, because its outcome is uncertain. An explicit `hub_inbox` read may return newly queued messages behind such a hold, and only when no recovery, pause, lifecycle or storage fence applies. It may also show the caller's own held originals (#1359) as a read-only inspection: at most 32 of its own `needs_review` rows (and `accepted` rows only for the current explicit-settlement channel) within the host pull byte budget, through the public queue body projection (private and missing tasks and private envelopes stubbed, unsafe metadata withheld, bodies sanitized); the caller cannot name another recipient, and the view never retries, resolves, acknowledges or changes an attempt. A held review inspection stays excluded from observer capture across restart until an explicit disposition. Durable per-original evidence survives journal pruning; unknown retry history or a used retry requires the person. Hub presence prefaces are excluded from attempted-work identity, so a shared context preface does not consume an unrelated message's retry. Delivery-only local and ACP peers (including Jcode) cannot invoke recipient retry; tool exposure hints do not replace the daemon's actual-adapter guard. Their held work requires person resolution. Before transport handoff, storage failure preserves the queue and preface; after handoff an uncertain effect is never automatically replayed.
887
888
 
888
889
  A declared instance whose only role is reviewer gets review requests, task messages addressed to it and the person's messages; agent chat, digests and presence are discarded and journaled, and it gets no memory recall (task 223). The headless Claude reviewer runs one new `claude -p` per review with `--setting-sources ""`, `--strict-mcp-config`, `--no-session-persistence`, tools limited to Read, Grep, Glob, `hub_review` and `hub_task_show`, and `dontAsk`. Its prompt holds hub facts and a bounded diff, never the builder's summary, and its `hub_task_show` drops the builder's notes. Changes touching `local.deny` or `pii.paths` are withheld and passed as `Read` deny rules, which Claude enforces, not the hub. Private tasks are never given to it. Its `hub_review` counts only while the child started for that task still runs; a stop or exit revokes it first, and surviving processes hold the delivery as `needs_review` and keep the reviewer busy.
889
890
 
@@ -891,7 +892,7 @@ A terminal Claude implementer or verifier instance (#525-5) owns write-class tas
891
892
 
892
893
  A planner-only instance (#525-6: `planner` without `implementer` or `verifier`) plans on the project checkout, so a declared `worktree` is refused. A Codex planner's `thread/start` and `thread/resume` are requested read-only, and a thread is adopted only when Codex's reply positively confirms a read-only sandbox; an unconfirmed or malformed reply refuses that RPC and closes the link before the hub adopts the thread or delivers work, and the current roles are rechecked before each injection. This is an initial ceiling, not confinement of the person's attached TUI, which can change its native sandbox later. A declared planner-only Claude channel instance gets no automatic grant from its facts hook for any tool but Read, LS, Glob and Grep, whatever the permission mode.
893
894
 
894
- The headless Claude implementer (#525-4) runs one owned `claude -p` child per turn in its declared worktree, with `--setting-sources ""`, `--strict-mcp-config`, native permission mode `default`, the hub's managed PreToolUse hook and `--permission-prompt-tool mcp__agent-hub__hub_permission_request`; never `--bare`, `acceptEdits`, `dontAsk` or `bypassPermissions`, and `never-ask` is refused. Each task keeps its own persisted session; unscoped chat reuses one only while exactly one task is in progress, and a `hub_inbox` read refuses a batch attributed to another task. The approval path fails closed: `hub_permission_request` is accepted only from the current child's launch and generation, goes to the console's existing approval queue and `approvals.timeout_s`, and offers allow-once and deny only, with no allow-always or session grant. A timeout, a prompt failure, a disconnect, a hub that is down or refusing, or a stale child binding answers deny; a failed hook decides nothing, so the call still waits for a person. The approval title is the tool name and a JSON rendering of the arguments passed through `sanitize()` and the public-text screen (any PII, secret or private-path match withholds the whole value as `[withheld]`, before any cut), never task text, cut at 600 characters with a `[cut, N chars]` marker; the original arguments stay with the child and are not logged. The MCP wire cannot tell a native permission dispatch from a call the model makes itself; a person allow still refers only to its original arguments. Automatic Bash authorization uses the separate single-use host wrapper contract below, never a caller-supplied tool id as native provenance. A stop holds an uncertain delivery until the owned process group is confirmed gone. The [native permission receipt](verification/2026-10-23-headless-claude-permissions.md) is model-free on Claude Code 2.1.309, [repeated on 2.1.310](verification/2026-10-26-claude-implementer-2.1.310.md), [on 2.1.314](verification/2026-10-31-claude-implementer-2.1.314.md), [on 2.1.316](verification/2026-10-31-claude-implementer-2.1.316.md) and [on 2.1.318](verification/2026-11-05-claude-implementer-2.1.318.md); it is not sandbox proof, and a real account, model and person interaction remains a live leg.
895
+ The headless Claude implementer (#525-4) runs one owned `claude -p` child per turn in its declared worktree, with `--setting-sources ""`, `--strict-mcp-config`, native permission mode `default`, the hub's managed PreToolUse hook and `--permission-prompt-tool mcp__agent-hub__hub_permission_request`; never `--bare`, `acceptEdits`, `dontAsk` or `bypassPermissions`, and `never-ask` is refused. Each task keeps its own persisted session; unscoped chat reuses one only while exactly one task is in progress, and a `hub_inbox` read refuses a batch attributed to another task. The approval path fails closed: `hub_permission_request` is accepted only from the current child's launch and generation, goes to the console's existing approval queue and `approvals.timeout_s`, and offers allow-once and deny only, with no allow-always or session grant. A timeout, a prompt failure, a disconnect, a hub that is down or refusing, or a stale child binding answers deny; a failed hook decides nothing, so the call still waits for a person. The approval title is the tool name and a JSON rendering of the arguments passed through `sanitize()` and the public-text screen (any PII, secret or private-path match withholds the whole value as `[withheld]`, before any cut), never task text, cut at 600 characters with a `[cut, N chars]` marker; the original arguments stay with the child and are not logged. The MCP wire cannot tell a native permission dispatch from a call the model makes itself; a person allow still refers only to its original arguments. Automatic Bash authorization uses the separate single-use host wrapper contract below, never a caller-supplied tool id as native provenance. A stop holds an uncertain delivery until the owned process group is confirmed gone. The [native permission receipt](verification/2026-10-23-headless-claude-permissions.md) is model-free on Claude Code 2.1.309, [repeated on 2.1.310](verification/2026-10-26-claude-implementer-2.1.310.md), [on 2.1.314](verification/2026-10-31-claude-implementer-2.1.314.md), [on 2.1.316](verification/2026-10-31-claude-implementer-2.1.316.md) [on 2.1.318](verification/2026-11-05-claude-implementer-2.1.318.md), [on 2.1.319](verification/2026-11-06-claude-implementer-2.1.319.md) and [on 2.1.322](verification/2026-11-10-claude-implementer-2.1.322.md); it is not sandbox proof, and a real account, model and person interaction remains a live leg.
895
896
 
896
897
  The #845 host shell wrapper is the only automatic Bash path for a headless implementer. In `ask-when-needed`, a complete public input must pass the existing #816 read-only proof or the closed task-command proof, with an active owned task and registered worktree. Enabled action-policy classes still ask, and `ask`, PII handling and the `never-ask` refusal are unchanged. The native request and authenticated host response both name wrapper protocol 1, so an older plugin cannot drop the rewrite and execute an original command automatically.
897
898
 
@@ -899,16 +900,18 @@ A grant uses a random, expiring single-use nonce and an in-memory record bound t
899
900
 
900
901
  Task branch authority uses recorded `refs.branch`, otherwise a host-observed non-default attached branch on the first eligible task-command request, excluding `main`, `master`, unknown/detached HEAD and another open task's branch. The binding is a normal `Tasks` write with history and an opaque canonical-root hash; a changed branch or worktree asks and never rebinds. Push grants accept only `git push origin <bound>` or `git push -u origin <bound>`; force, refspec, deletion and other remotes ask. Every origin push URL is checked against the captured project repository and PR argv pins that repository. Execution uses an explicit same-branch refspec; configured remote.origin.push/mirror refuses. Project/worktree PATH directories and aliases are removed, and gh child Git inherits core SAFE_CONFIG through fixed environment configuration. PR body-file content is bounded, screened and snapshotted into executed --body bytes. See [the design contract](specs/2026-09-19-agent-hub-design.md#headless-implementer-host-shell-execution-845) for the exact closed forms and [the native receipt](verification/2026-10-26-headless-claude-shell-context.md) for verification limits.
901
902
 
902
- The fresh Codex reviewer (#519) needs `review_mode: "fresh"` and a compat-admitted Codex (receipt-verified 0.146.0, 0.163.0 and 0.164.0; `ahub agents` shows the current policy); an unverified/untrusted version is unavailable. Before each review it requires a model-free isolation receipt: binary and config unchanged, only the two hub tools in the configured MCP inventory (each approved by its own name, never by a server-wide default, #783), plugins, hooks and Apps disabled (Apps by a separate feature readback), and a named filesystem profile whose fixtures prove public reads, private-path denial (exact, glob and symlink), standard host credential denial and write denial. Credential and tool-home roots are denied even with an empty `local.deny`; that list does not cover every personal file. A dangling or unreadable credential root refuses the reviewer, and the reason names only its path class (`~/.docker`, `$DOCKER_CONFIG`), never the path or its contents. A failed per-review start names one class from a closed list (`version`, `binary`, `mcp_inventory`, `plugins_hooks_apps`, `sandbox_proof`, `credential_root`, `timeout`, `unknown`) with a fixed sentence in the unavailable reason, `hub.log` and the `reviewer` line of `ahub status`; it never carries a path, native CLI text or a token (#722). Its shell is sandboxed read-only, not Claude's Read/Grep/Glob whitelist. Network and web search are configured disabled but not observed: managed requirements can still select cached web search, and no run has shown the review selecting the profile through `default_permissions`. A failed receipt or start never falls back to a continuing native session, and a child that ends without a saved verdict is never approval. The agy reviewer slot is an unavailable placeholder and never runs; it binds nothing, so agy's own `hub_task_show` reads are not fenced as a review (#792).
903
+ The fresh Codex reviewer (#519) needs `review_mode: "fresh"` and a compat-admitted Codex (receipt-verified 0.146.0, 0.163.0, 0.164.0 and 0.166.0; `ahub agents` shows the current policy); an unverified/untrusted version is unavailable. Before each review it requires a model-free isolation receipt: binary and config unchanged, only the two hub tools in the configured MCP inventory (each approved by its own name, never by a server-wide default, #783), plugins, hooks and Apps disabled (Apps by a separate feature readback), and a named filesystem profile whose fixtures prove public reads, private-path denial (exact, glob and symlink), standard host credential denial and write denial. Credential and tool-home roots are denied even with an empty `local.deny`; that list does not cover every personal file. A dangling or unreadable credential root refuses the reviewer, and the reason names only its path class (`~/.docker`, `$DOCKER_CONFIG`), never the path or its contents. A failed per-review start names one class from a closed list (`version`, `binary`, `mcp_inventory`, `plugins_hooks_apps`, `sandbox_proof`, `credential_root`, `timeout`, `unknown`) with a fixed sentence in the unavailable reason, `hub.log` and the `reviewer` line of `ahub status`; it never carries a path, native CLI text or a token (#722). Its shell is sandboxed read-only, not Claude's Read/Grep/Glob whitelist. Network and web search are configured disabled but not observed: managed requirements can still select cached web search, and no run has shown the review selecting the profile through `default_permissions`. A failed receipt or start never falls back to a continuing native session, and a child that ends without a saved verdict is never approval. The agy reviewer slot is an unavailable placeholder and never runs; it binds nothing, so agy's own `hub_task_show` reads are not fenced as a review (#792).
903
904
 
904
905
  The fresh Kimi reviewer (#533) needs `review_mode: "fresh"` and a compat-admitted Kimi Code (receipt-verified 2.2.0, 2.3.0, 2.3.1, 2.3.2, 2.4.1 and 2.5.1; `ahub agents` shows the current policy) with its native OAuth login; an unverified/untrusted version, or a failed preparation, is unavailable. The [2.3.0](verification/2026-10-22-kimi-qwen-compat.md), [2.3.1](verification/2026-10-25-kimi-231-reviewer-compat.md) and [2.5.1](verification/2026-11-06-kimi-251-reviewer-compat.md) receipts are model-free and do not prove real login or a model review. It is a native tool-authority boundary, not a sandbox: no Seatbelt wraps it, and same-user native code is not isolated from the filesystem or network. Each review starts a new child in a private `KIMI_CODE_HOME` with managed-provider-only config, a clean temporary working directory and an empty skills directory. Its agent may use only `hub_review` and `hub_task_show`, served by a loopback MCP session bound to the task, head and review revision that never carries the hub's control token; it has no native read, file or shell tool and sees only the screened review brief and host facts. Its `credentials/` and `oauth/` directories and `device_id` link to the person's native ones, so refresh keeps Kimi's own lock and atomic rename; no token is copied and `KIMI_DISABLE_OAUTH_LOCK` is never set. A stop revokes its verdict authority before termination; killing it mid-refresh may require a native re-login. Private tasks are never given to it, and a child that ends without a saved verdict is never approval.
905
906
 
906
- The review brief (#520) withholds private changes whole (both sides of a move) and counts them; a rule file that fails the private-data screen is named, not shown. Attributes and rules are read at the merge base, so a change cannot loosen its own review. Optional changed symbols (#684) come from ripwire 0.6.7 on the daemon's host PATH, run as an owned process on a disposable snapshot of the task's commit; each path, name and kind passes the hub's public metadata screen before the brief, the console's task detail or the dashboard shows it, a private task stores and shows none, and a failed or missing read is `unknown`, never a gate. Spec acceptance, plan review, plan conformance, premature-review, cost, test-integrity (#481 S4), issue and PR identity linking (#694) and dogfood scorecard (#687) reads fetch GitHub metadata only (edit times, check states, thread authorship and resolution, changed file names, open PR heads, workflow run conclusions), never issue bodies, comments or patches. Issue identity linking at propose and accept (#723) parses the task's title and refs locally, reads nothing from GitHub and skips PII tasks. The CI workflow keeps `contents: read` and `actions: read`.
907
+ The review brief (#520) withholds private changes whole (both sides of a move) and counts them; a rule file that fails the private-data screen is named, not shown. Attributes and rules are read at the merge base, so a change cannot loosen its own review. Optional changed symbols (#684) come from ripwire 0.6.7 on the daemon's host PATH, run as an owned process on a disposable snapshot of the task's commit; each path, name and kind passes the hub's public metadata screen before the brief, the console's task detail or the dashboard shows it, a private task stores and shows none, and a failed or missing read is `unknown`, never a gate. Spec acceptance, plan review, plan conformance, premature-review, cost, test-integrity (#481 S4), issue and PR identity linking (#694) and dogfood scorecard (#687) reads fetch GitHub metadata only (edit times, check states, thread authorship and resolution, changed file names, open PR heads, workflow run conclusions), never issue bodies, comments or patches. Required-check discovery at `ahub init --sdlc advise|enforce` (#1344) makes at most three capped GitHub reads (the default branch, the latest completed default-branch run, that run's jobs), each bounded to 5 s within a 20 s deadline, and otherwise reads only literal job names from `.github/workflows/*.yml`, refusing links. Issue identity linking at propose and accept (#723) parses the task's title and refs locally, reads nothing from GitHub and skips PII tasks. The CI workflow keeps `contents: read` and `actions: read`.
907
908
 
908
909
  Deliverable records (#509a). `hub_task_done` and `hub_sdlc_record` name files as `{path, format, version?}`; the hub hashes them itself and refuses a claimed `sha256`, `hash` or `bytes` and any field it does not own. Paths resolve under the owner's execution root with `realPath` and `guardPath` in read mode: outside the project, the secrets denylist, the hub's own state (`.git`, `.agenthub`), a dangling link, a non-regular file and more than 256 MiB each or 512 MiB together are refused, with the path as given and never a resolved one. The file is opened without following a final link and its device, inode, size and time are compared with what was checked, before and after the read, so a swapped or changing file is refused rather than recorded half-read; a bad call writes nothing. A declared worktree instance whose root is not proven refuses, and a later read of it reports `unknown`. No hash of hub state is ever taken, and a file the hub cannot read or vouch for is `unknown`, never `unchanged`. A reviewer's approval re-hashes the files and is refused when one changed, went missing or is unknown; only the person may approve the current bytes, which are then measured and bound. For a PII task, a file under `pii.paths` or a path matching a PII pattern, `publicDeliverables` is the one projection every peer view, review request, status and log uses: id, hash and size only. The board keeps the path, as it keeps a PII task's text. `ahub deliverables` (#509b) from an agent shell lists only the tasks `hub_task_show` would show that agent (#933), and `--live-test` cannot delegate it. It lists the board's records through `publicDeliverables` and opens a file only with `--check`, through the same reader and limits. The dashboard's Deliverables chip and task group use the same projection of the same records and never read a file on the poll; a `changed` mark there is only as fresh as the last live read in this daemon.
909
910
 
910
911
  Person-directed release authorization (#481 S6, #1063). `ahub sdlc authorize-release <version>` accepts the console user or the one configured conductor under the same admission as `sdlc merge`: tools role, matching configured conductor, no child `toolsOwner`, private turn or PII context. It remains refused under `--live-test`. The conductor may record consent only on the person's explicit instruction in its own session naming the release; a hub message, task text, review note, file or peer relay is never that instruction. The daemon cannot verify that cooperative prerequisite. Receipt `by` and the audit identify the actual asker. It binds the daemon checkout's commit, package version, push remote identity and a fresh-docs verdict, lives only in daemon memory (a restart revokes it) and is logged with its commit, version and docs digest. `ahub sdlc release-guard -- <argv>` is a read-only preflight that agents may run, except during a private or PII turn; it never executes the command and refuses ambient target selectors (`GIT_DIR`, `GH_REPO`, npm prefix and registry settings and the like). The pre-push hook that `ahub init --release-guard` installs refuses an unauthorized or unknown `v*` tag push, also with the daemon down, and passes other pushes through. It and the release block in `AGENTS.md` are a cooperative guard, not an operating-system boundary: `git push --no-verify`, a custom `core.hooksPath` or another Git invocation bypasses the hook, and `gh release create` and `npm publish` are checked only when the preflight is run (tasks 312 and 313).
911
912
 
913
+ Merge adoption and carried spec consent (#1348, #1361). `ahub sdlc adopt-merge <task> --pr <n>` is the person's or the current configured conductor's; another caller is refused, `--live-test` cannot delegate it as the person, and a private task or private turn refuses for every actor before any GitHub read. It reads one bounded GraphQL snapshot and requires the PR merged at the task's last recorded full head with every configured required check green there, no unresolved or unknown review thread, no pending or unknown review request, no change request and no open Important finding. It records `merged outside the hub` under the actual actor and moves the task to `approved`, without inventing a reviewer verdict or reviewed head, running `gh pr merge` or removing a branch or worktree. A superseding task may carry an older cancelled task's person spec consent only for the same canonical repository and issue, named by a whole local `supersededBy` reference, when a fresh host GitHub read proves the same issue `lastEditedAt`; no issue body is read, caller timestamps cannot grant it, unknown or truncated metadata leaves consent absent, and manual acceptance stays person-only.
914
+
912
915
  SDLC metrics and control bands (#481 S7). `ahub sdlc metrics` and `hub_sdlc_metrics` are planner or person only, read-only, and refused during a private or PII turn. A private task is counted as withheld and read for nothing else; the report calls no model and makes no GitHub read. Band breaches are written only by the daemon's evaluator through Tasks, never while it is stopping, recovering or has a storage error. A `diagnose` or `propose` card is a backlog task (`triage` or `plan`) whose text is fixed words, numbers and task ids, never task text; it passes the PII signal check and the candidate-text screen before it is written, and no GitHub issue is created. A `log` breach is one hub notice, remembered in the board's `band_notices` table as a marker (`<metric>:#<task>:log`, checked against a fixed pattern) and a time, nothing else.
913
916
 
914
917
  Design specs (#1097, #1102, #1107). `hub_specs` is read-only and refused during a private or PII turn. PII tasks and private turns publish no spec paths through task notices. `spec_ack` on `hub_task_done` is refused for private work and while specs review is off. Each id and reason must be public metadata, a withheld reason is refused, and the acknowledgements are recorded at the exact head. `ahub specs stamp` is person-only: refused for an agent identity and under `--live-test`, and refused without a terminal even with `--yes`. After the person answers, it rechecks HEAD, the state of each covered path and every target file's bytes, and any change refuses the whole run.
@@ -1351,6 +1354,17 @@ and authority facts are rechecked across every await, a changed authority
1351
1354
  refuses the stale turn, and route events keep closed metadata only, never
1352
1355
  evidence, credentials or service error prose.
1353
1356
 
1357
+ A `stage` route with `classifier = "decision"` (#1373) uses the same endpoint
1358
+ rules and modes and asks only when its own score lies within `ambiguous_band`
1359
+ (default 0.05, at most 0.5) of its threshold, once per user turn. The question
1360
+ carries the route's closed numeric stage evidence (signals, dimensions and
1361
+ scores) and the two configured tiers, never the conversation projection; a PII
1362
+ or private turn sends only dimensions and needs a positive `onCampus()`. The
1363
+ answer is recorded and changes no tier, model, effort or conversation. A held
1364
+ answer is reused only while its privacy and observer facts still hold, and a
1365
+ change across the request refuses the stale turn. The PII screen, `assign()` and
1366
+ the escalation and advisor triggers never use it.
1367
+
1354
1368
  ## Bounded visual attachments (#1058)
1355
1369
 
1356
1370
  `hub_visual` stores a validated acon `VisualPayload` in `hub.db` under hub
@@ -1369,6 +1383,54 @@ asset read repeats the guard and hash check, with the acon provider binding the
1369
1383
  project and instance. Raw tool input and results never reach observer capture,
1370
1384
  even on refusal.
1371
1385
 
1386
+ ## Supervision proposals (#1221)
1387
+
1388
+ `supervision.mode` is machine-local and off by default: a committed
1389
+ `.agenthub/config.json` cannot turn it on. `shadow` stores bounded proposals and
1390
+ does nothing else (no inbox row, notice or turn); `advisory` may also show a
1391
+ pending one in the console inbox. The queue holds at most 100 pending proposals,
1392
+ three per task revision, and keeps 400 terminal rows for dedupe; one read
1393
+ returns at most 50, and a reading past a bound is refused and counted. Rules read
1394
+ only public structured facts (task history, the hub's own deliverable measurement
1395
+ and declared-overlap rows), never notes, review findings, transcripts or file
1396
+ bodies, and a private task is never proposed on, read or decided. Only a present
1397
+ role on the task (its owner or reviewer, a configured planner, the conductor or
1398
+ the person) reads or decides a proposal, and there is no supervisor role. An
1399
+ accept runs the one existing action the proposal names through that action's own
1400
+ authority, so an `escalate` is accepted only by the conductor or the person; a
1401
+ refusal starts nothing. There is no automatic pause, retry, cancel, reroute,
1402
+ approval or rollback, no resident worker and no timer, and an action whose
1403
+ outcome the hub could not observe is recorded `unknown` and never retried.
1404
+
1405
+ ## Guidance variants (#1225)
1406
+
1407
+ `ahub guidance create|list|show|withdraw` and the matching hub tools record
1408
+ immutable advisory role variants on one task. Writes follow task-role admission:
1409
+ the person or the task's current rostered owner; an agent cannot write under
1410
+ review, every actor is refused on an approved or cancelled task, a conductor
1411
+ designation grants nothing, and the CLI refuses `--live-test` person promotion.
1412
+ Private turns, review-observer input and PII tasks refuse every actor before any
1413
+ id, count or body is read. Raw role snapshots and variant bytes stay in private
1414
+ local hub tables, separate from the task, its history, public views, bus notices
1415
+ and memory. Reads return a closed metadata projection and a screened section diff;
1416
+ the rationale texts and experiment id are field-screened and shown as `withheld`
1417
+ when they do not clear. Bounds are 8192 bytes per role file and 32768 bytes per
1418
+ record. The tools' arguments and results never reach observer capture, and a
1419
+ variant grants no activation, permission, role or probe.
1420
+
1421
+ ## Execution lineage (#1220)
1422
+
1423
+ `ahub lineage show` and `hub_lineage_show` read a bounded public metadata
1424
+ neighborhood: at most 100 nodes, 200 edges and 256 KiB per page, with explicit
1425
+ truncation. They expose no titles, prompts, paths, session ids or review bodies;
1426
+ unsupported, missing and denied reads share one unavailable shape, and only an
1427
+ authorized diagnostic operator sees a reason. `ahub lineage link` and
1428
+ `hub_lineage_link` admit an inert declared reference through Tasks under the
1429
+ task's current actor, revision, project and privacy; a stale or changed one
1430
+ refuses without writing. A reference never fetches its producer or attests to a
1431
+ runner outcome, and foreign project keys stay opaque. The acon console reads the
1432
+ same page through a provider port with no new action.
1433
+
1372
1434
  ## Questions a peer asks the person (#1053)
1373
1435
 
1374
1436
  `hub_ask` lets any peer put a structured question (one to four questions, two to eight options each) to the person. A question is not a permission: it is its own record in `hub.db` (`questions`), has its own control messages, and never expires as a denial.
@@ -3510,17 +3510,18 @@ the queue.
3510
3510
 
3511
3511
  - T0 ran live on Qwen Code 0.26.1 under an isolated HOME ([verification](../verification/2026-10-25-qwen-dual-output-t0.md)): Q2, Q3, Q5 and Q6 pass, Q4 fails. The owner decided on 2026-10-25 to build Part 3 with the two limits below stated, so AC9's condition reads "Q2, Q3, Q5 and Q6 pass; Q4's limit is stated".
3512
3512
  - Launch: `ahub qwen --mode tui` runs `qwen --input-file <in> --json-file <out> --mcp-config <hub server> --approval-mode default` in the person's terminal, as `ahub pi --mode tui` does. Both files live under the project state dir, mode 0600. The event file is a regular file the adapter tails from a saved offset.
3513
- - Version gate: a separate compat entry for the dual-output contract, verified 0.26.1 only. It does not widen the headless `qwen` entry, whose ACP receipts are separate.
3514
- - Delivery: `deliver()` sets busy synchronously and appends one `{"type":"submit","text"}` line with the digest. Qwen queues a submit that arrives during a turn and runs it after that turn ends.
3513
+ - Version gate: a separate compat entry for the dual-output contract, verified 0.26.1, exact 0.27.0 and exact 0.27.1 (matched account-free receipts for [0.27.0](../verification/2026-11-10-qwen-0270-dual-output.md) and [0.27.1](../verification/2026-11-10-qwen-0271-dual-output.md)). It does not widen the headless `qwen` entry, whose ACP receipts are separate.
3514
+ - Delivery: `deliver()` sets busy synchronously and appends one `{"type":"submit","text"}` line with the digest. Required Q2 follows the actual normal Bus/QwenDualPeer path: a second envelope is enqueued while the first fixture-provider response is held; only one submit is present before release. After the first non-tool-use assistant and its message_stop, the second user/provider/final-assistant/message_stop must have distinct, ordered event indices. The direct-native-busy-submit claim from the original 0.26.1 receipt was not reproduced by the v2 producer's matched 0.26.1 control; it is recorded characterization, not a substitute Q2 pass/fail. The [2026-11-10 receipt](../verification/2026-11-10-qwen-0270-dual-output.md) records ruling `fa75c5f2-fc78-42a1-85dc-cf206e6a7825` and the revised procedure, whose matched private 0.26.1/candidate 0.27.0 Q2 runs pass two distinct normal-Bus turns; the remaining required Q3/Q5/Q6/Q7 pair also passed, supporting exact 0.27.0 admission with Q4's existing external-stop limit stated.
3515
3515
  - Turn end: Qwen emits no `result` event in this mode. A turn ends at an `assistant` event whose `stop_reason` is not `tool_use`, followed by `message_stop`; that assistant text is the turn's shared answer. A `result` event, if a later build emits one, also ends the turn.
3516
3516
  - Approvals: `control_request` with `subtype: can_use_tool` goes to the hub approval path, and the answer is `{"type":"confirmation_response","request_id","allowed"}`. Allow or deny only. The hub's own tools are approved by the exact `tool_name` (`mcp__<server>__<tool>`), never by prefix. A `control_response` for a pending request that the hub did not answer means the person answered in the TUI: withdraw the hub's pending approval. A `control_response` error for a stale id is logged, never retried.
3517
- - Limit 1, deny: a hub deny cancels Qwen's whole turn and Qwen emits nothing for it. After sending `allowed: false` the adapter ends the turn itself (idle, no shared answer, a notice that the turn was denied).
3517
+ - Limit 1, deny: an appended hub deny settles the delivery as known `completed`, without a shared answer, but supplies no native completion ACK. Persist `denyPending: true` before appending it and retain a continuous input fence. Only a newly observed same-session personal USER followed by that personal turn's normal final assistant/message_stop under the same verified owner, or a verified fresh native launch generation, releases the fence. Denied-turn pairs, approval responses, orphan Stops, replayed session starts and file readability do not. The 30 s operational wait expires offline with queued messages unsubmitted and an actionable terminal/restart notice; the durable fence remains and passive recovery still observes those proofs. Detach/adoption invalidate unfinished proof, and adoption cannot reuse buffered personal frames. See [adapter contract](../design/adapters.md#qwen-deny-input-fence-888).
3518
+ - Input writes: append one full UTF8 Buffer once, require the exact byte count, and never retry a remainder. Short/throwing writes retain `needs_review` and offline; non-newline input tails before append or attachment fence input until a verified fresh generation, never personal completion. The live uncertain-write latch is RAM-only and crash detection reads the actual tail. A torn prefix ending in newline remains undetected; a durable per-write intent record is the upgrade path if observed.
3518
3519
  - Limit 2, no external stop: the input protocol has only `submit` and `confirmation_response`, and SIGINT does not stop a turn. The inactivity watchdog never cancels a Qwen TUI turn. It reports the stalled turn to the person (status, console and dashboard: "stalled; press Esc in the Qwen terminal") and keeps the peer busy. The hub never types into the terminal or signals the process to stop a turn.
3519
3520
  - Prompt channel: the input file is a prompt channel. Qwen's own write and shell tools reach it only through approval, and the hub's approval path refuses any write or command that names the state dir. No other peer can write it.
3520
3521
  - Detached: the TUI keeps working when nobody reads the event file (T0 Q5). A daemon that cannot read the file treats the peer as detached, not idle; on reattach the adapter resumes from its saved offset.
3521
3522
  - Recovery: `qwen -r <session_id>` with the same two files resumes the conversation, does not replay earlier submits, and appends to the event file. The adapter records `session_id` from `system/session_start` and resumes from its saved offset, so events from before the restart are not processed twice.
3522
3523
  - Implementation notes (#449, measured on 0.26.1 where stated):
3523
- - Files and state: `<state dir>/qwen/qwen-dual/{input.jsonl,events.jsonl,mcp.json,state.json}`; `state.json` holds `session_id`, the read offset, a generation counter and the bound owner (pid with its `processSignature`). `ahub qwen --mode tui` is explicit only: Qwen's `start.forms` stays `["headless"]`, so Qwen is not a start-mode peer and the hub never opens this terminal itself. The TUI driver is the definition's `start.createTui` on the `qwen-dual` daemon port, a fixed-builtin capability.
3524
+ - Files and state: `<state dir>/qwen/qwen-dual/{input.jsonl,events.jsonl,mcp.json,state.json}`; `state.json` holds `session_id`, the read offset, a generation counter and the bound owner (pid with its `processSignature`), plus the optional host-only `denyPending: true` input fence. `ahub qwen --mode tui` is explicit only: Qwen's `start.forms` stays `["headless"]`, so Qwen is not a start-mode peer and the hub never opens this terminal itself. The TUI driver is the definition's `start.createTui` on the `qwen-dual` daemon port, a fixed-builtin capability.
3524
3525
  - Gate: checked twice, by `qwen --version` against `COMPAT["qwen-dual"]` before any file is made, and by the TUI's own `session_start` (version, `protocol_version` 2, the events the adapter reads). An unverified TUI is not attached and the person gets a notice.
3525
3526
  - Event file: Qwen opens an existing `--json-file` at byte 0 without truncating it (it overwrote the head of a 3 KB file in place), so appending after a restart is not what it does. A fresh or resumed launch therefore starts from empty files (the old event file is kept as `events.prev.jsonl`, the saved offset restarts at 0 for the new file), and a hub restart while the person's Qwen keeps running adopts it and reads on from the saved offset with no launch. Qwen starts reading the input file at its size at start, so earlier submits are not replayed either way.
3526
3527
  - Owner: bound from the host's process table (the one process whose argv contains `--input-file <this adapter's file>`; two matches is no owner), at `session_start` and then every second. No launcher message is trusted for it. When the owner is gone the peer goes offline, an open hub turn settles `needs_review` and a notice says the terminal ended. The hub never signals it.
@@ -18,3 +18,25 @@
18
18
  ## Consequence for #286 AC9
19
19
 
20
20
  AC9 is conditional on Q2 to Q6 passing. Q4 fails, so the condition does not hold as written. Building Part 3 anyway needs an owner decision and a spec amendment that names the two limits: the watchdog reports a stalled Qwen TUI turn to the person instead of stopping it, and the adapter itself marks the turn ended when the hub sends a deny, because Qwen emits nothing for it.
21
+
22
+ ## Later Q2 reproduction boundary (2026-11-10)
23
+
24
+ The historical Q2 Pass above describes this original real-model run and is not a
25
+ new exact-artifact qualification. The fixed-provider v2 workload later failed
26
+ its two-user-turn assertion on a private matched 0.26.1 control as well as newer
27
+ candidates ([0.26.8 receipt](2026-11-06-qwen-0268-dual-output.md)). That did not
28
+ reproduce the original native-busy-submit queue observation. The extra provider
29
+ POSTs are unclassified, so no underlying native cause is inferred.
30
+
31
+ Ruling fa75c5f2-fc78-42a1-85dc-cf206e6a7825 defines required Q2 at the actual normal
32
+ Bus/QwenDualPeer boundary with two distinct user/final-stop turns, while direct
33
+ native-busy-submit behavior remains recorded characterization. The
34
+ [2026-11-10 receipt](2026-11-10-qwen-0270-dual-output.md) records the revised
35
+ procedure and its own evidence: the private matched 0.26.1 and candidate 0.27.0
36
+ normal-Bus Q2 runs each passed two distinct turns, and the matching required
37
+ Q3/Q5/Q6/Q7 pair subsequently passed with the existing Q4 limit. A separate
38
+ direct-busy characterization on both artifacts observed one user/assistant/Stop
39
+ with both markers in one assistant.
40
+ This does not retrospectively reproduce the native-busy-submit claim. The
41
+ original account/global-install harness is
42
+ not the account-free procedure for that new qualification.