@staix/agent-hub 0.44.0 → 0.46.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 (168) hide show
  1. package/CHANGELOG.md +66 -0
  2. package/README.md +12 -11
  3. package/docs/adding-an-ai-tool.md +1 -0
  4. package/docs/agent-notes/adapters.md +35 -6
  5. package/docs/agent-notes/budget.md +2 -1
  6. package/docs/agent-notes/daemon.md +5 -1
  7. package/docs/agent-notes/local-worker.md +1 -1
  8. package/docs/agent-notes/security-review.md +3 -2
  9. package/docs/agent-notes/tasks.md +6 -2
  10. package/docs/agent-notes/tests.md +4 -3
  11. package/docs/design/adapters.md +20 -2
  12. package/docs/design/agent-hub-architecture.md +12 -0
  13. package/docs/design/agent-hub.md +1 -1
  14. package/docs/design/cli-output.md +2 -0
  15. package/docs/design/roadmap.md +158 -4
  16. package/docs/design/supervision.md +21 -1
  17. package/docs/design/task-board.md +32 -4
  18. package/docs/dogfood.md +28 -4
  19. package/docs/events.md +7 -3
  20. package/docs/influences.md +7 -0
  21. package/docs/memory.md +4 -4
  22. package/docs/operations.md +151 -36
  23. package/docs/quickstart.md +16 -4
  24. package/docs/research.md +16 -0
  25. package/docs/roadmap.json +4 -0
  26. package/docs/roadmap.md +9 -0
  27. package/docs/sdlc.md +15 -3
  28. package/docs/security.md +9 -7
  29. package/docs/smoke.md +1 -1
  30. package/docs/verification/2026-11-05-hardcoded-values-classification-rules.md +28 -0
  31. package/docs/verification/2026-11-19-claude-implementer-2.1.328.md +49 -0
  32. package/docs/verification/2026-11-20-claude-implementer-2.1.329.md +49 -0
  33. package/docs/verification/2026-11-20-sdlc-metrics-diagnosis.md +7 -0
  34. package/docs/verification/2026-11-21-0.45.0.md +69 -0
  35. package/docs/verification/2026-11-22-agy-1.5.14.md +27 -0
  36. package/docs/verification/2026-11-22-claude-instruction-hook.md +35 -0
  37. package/docs/verification/2026-11-22-codex-0171-reviewer-isolation.md +47 -0
  38. package/docs/verification/2026-11-22-instructed-ipc.md +9 -0
  39. package/docs/verification/2026-11-22-jcode-1.0.3.md +71 -0
  40. package/docs/verification/2026-11-22-jcode-separate-home.md +14 -0
  41. package/docs/verification/2026-11-22-qwen-0283-acp.md +28 -0
  42. package/docs/verification/2026-11-22-qwen-0283-dual-output.md +33 -0
  43. package/docs/verification/2026-11-22-roadmap-r5-view-receipt.md +63 -0
  44. package/docs/verification/2026-11-23-0.46.0.md +44 -0
  45. package/docs/verification/assets/1483-r5-detail-1440-light.png +0 -0
  46. package/docs/verification/assets/1483-r5-detail-390-light.png +0 -0
  47. package/docs/verification/assets/1483-r5-view-1440-dark.png +0 -0
  48. package/docs/verification/assets/1483-r5-view-1440-light.png +0 -0
  49. package/docs/verification/assets/1483-r5-view-390-dark.png +0 -0
  50. package/docs/verification/assets/1483-r5-view-390-light.png +0 -0
  51. package/docs/verification/assets/1483-r5-view-820-dark.png +0 -0
  52. package/docs/verification/assets/1483-r5-view-820-light.png +0 -0
  53. package/docs/verified.json +33 -27
  54. package/package.json +3 -2
  55. package/plugins/agent-hub/.claude-plugin/plugin.json +1 -1
  56. package/plugins/agent-hub/kimi-hook.js +4743 -4048
  57. package/plugins/agent-hub/kimi-review-policy-worker.js +5 -5
  58. package/plugins/agent-hub/server.js +1641 -1265
  59. package/plugins/agent-hub/skills/ahub/SKILL.md +17 -0
  60. package/plugins/agent-hub/skills/ahub-manage/SKILL.md +37 -0
  61. package/plugins/agent-hub/skills/ahub-status/SKILL.md +14 -0
  62. package/plugins/agent-hub/skills/ahub-use/SKILL.md +12 -0
  63. package/scripts/check-docs.mjs +9 -1
  64. package/src/adapters/acp.ts +11 -1
  65. package/src/adapters/claude-channel.ts +2 -1
  66. package/src/adapters/compat.ts +15 -14
  67. package/src/adapters/definitions/builtin-metadata.ts +2 -2
  68. package/src/adapters/definitions/native-cli-claude-setup.ts +9 -1
  69. package/src/adapters/definitions/native-cli-doctor.ts +8 -5
  70. package/src/adapters/definitions/native-cli-jcode-home-init.ts +158 -0
  71. package/src/adapters/definitions/native-cli-jcode-home.ts +72 -0
  72. package/src/adapters/definitions/native-cli-jcode-mcp.ts +20 -0
  73. package/src/adapters/definitions/native-cli-skills.ts +29 -0
  74. package/src/adapters/definitions/native-context.ts +10 -0
  75. package/src/adapters/jcode.ts +10 -0
  76. package/src/adapters/local-worker.ts +3 -2
  77. package/src/adapters/pi.ts +15 -4
  78. package/src/cli/claude-profile-hook.ts +40 -3
  79. package/src/cli/console-state.ts +58 -27
  80. package/src/cli/console-usage.ts +5 -3
  81. package/src/cli/console.ts +35 -4
  82. package/src/cli/help.ts +17 -10
  83. package/src/cli/identity.ts +4 -2
  84. package/src/cli/instruction-hook.ts +28 -0
  85. package/src/cli/jcode-mcp.ts +2 -1
  86. package/src/cli/main.js +8 -0
  87. package/src/cli/main.ts +149 -23
  88. package/src/cli/output-standard.ts +3 -55
  89. package/src/cli/output.ts +8 -2
  90. package/src/cli/recovery-package.ts +62 -13
  91. package/src/cli/roadmap-write.ts +59 -0
  92. package/src/cli/roadmap.ts +115 -4
  93. package/src/cli/sdlc-output.ts +4 -0
  94. package/src/cli/setup-homes.ts +1 -0
  95. package/src/cli/setup.ts +1 -1
  96. package/src/cli/skills-install.ts +463 -0
  97. package/src/cli/task-output.ts +1 -1
  98. package/src/cli/upgrade-presentation-flags.ts +1 -1
  99. package/src/cli/upgrade-runtime.ts +10 -6
  100. package/src/hub/agent-mem-range.ts +43 -0
  101. package/src/hub/board.ts +144 -5
  102. package/src/hub/budget-projection.ts +99 -0
  103. package/src/hub/check-runner.ts +25 -1
  104. package/src/hub/claude-launch-proof.ts +5 -1
  105. package/src/hub/conductor.ts +8 -3
  106. package/src/hub/config-apply.ts +6 -3
  107. package/src/hub/config-tier.ts +1 -1
  108. package/src/hub/config-trust.ts +1 -1
  109. package/src/hub/context-window.ts +1 -1
  110. package/src/hub/control-client.ts +9 -2
  111. package/src/hub/cost-governance.ts +11 -7
  112. package/src/hub/daemon.ts +707 -53
  113. package/src/hub/dogfood-read.ts +4 -2
  114. package/src/hub/edit-guard.ts +100 -0
  115. package/src/hub/events.ts +80 -9
  116. package/src/hub/execution-budget.ts +29 -8
  117. package/src/hub/facts.ts +57 -4
  118. package/src/hub/hub-tools.ts +3 -1
  119. package/src/hub/inference.ts +1 -1
  120. package/src/hub/instances.ts +10 -1
  121. package/src/hub/instructed-exact.ts +95 -0
  122. package/src/hub/instructed-intent.ts +64 -0
  123. package/src/hub/instructed-ipc.ts +33 -0
  124. package/src/hub/instructed-runtime.ts +19 -0
  125. package/src/hub/instruction-receipt.ts +218 -0
  126. package/src/hub/lifecycle.ts +6 -1
  127. package/src/hub/log-rotation.ts +130 -0
  128. package/src/hub/manager.ts +46 -3
  129. package/src/hub/memory-profile.ts +137 -21
  130. package/src/hub/no-writes.ts +1 -0
  131. package/src/hub/operational-authority.ts +3 -2
  132. package/src/hub/operational-settings.ts +2 -2
  133. package/src/hub/recovery-store.ts +49 -21
  134. package/src/hub/registry.ts +1 -1
  135. package/src/hub/research-experiments.ts +132 -0
  136. package/src/hub/research-quality.ts +8 -2
  137. package/src/hub/research-record.ts +35 -0
  138. package/src/hub/research.ts +128 -28
  139. package/src/hub/roadmap-check.ts +65 -0
  140. package/src/hub/roadmap-decompose.ts +139 -0
  141. package/src/hub/roadmap-export.ts +27 -0
  142. package/src/hub/roadmap-sync.ts +97 -0
  143. package/src/hub/roadmap.ts +59 -1
  144. package/src/hub/routing.ts +18 -1
  145. package/src/hub/runtime-capture-prune.ts +2 -1
  146. package/src/hub/sdlc-branch-ci.ts +128 -0
  147. package/src/hub/sdlc-merge.ts +6 -3
  148. package/src/hub/sdlc-metrics.ts +19 -5
  149. package/src/hub/sdlc.ts +73 -5
  150. package/src/hub/settings.ts +3 -1
  151. package/src/hub/snapshots.ts +13 -1
  152. package/src/hub/startup-event-seeds.ts +21 -15
  153. package/src/hub/startup-timing.ts +3 -1
  154. package/src/hub/supervision-proposals.ts +10 -2
  155. package/src/hub/supervision-rules.ts +26 -3
  156. package/src/hub/supervision.ts +7 -0
  157. package/src/hub/task-pr.ts +47 -0
  158. package/src/hub/task-worktree.ts +18 -11
  159. package/src/hub/tasks.ts +694 -44
  160. package/src/hub/ui.ts +6 -2
  161. package/src/hub/usage-rollup.ts +77 -22
  162. package/src/local/tools.ts +13 -1
  163. package/src/memory/client.ts +3 -2
  164. package/src/pi/extension.ts +15 -3
  165. package/src/pi/tool-receipts.ts +26 -0
  166. package/src/ui/index.html +342 -8
  167. package/src/ui/plugin.ts +6 -2
  168. package/src/ui/roadmap-model.ts +70 -0
package/CHANGELOG.md CHANGED
@@ -4,6 +4,72 @@ Issue and pull request numbers in the entries for 0.7.7 and earlier refer to the
4
4
 
5
5
  ## Unreleased
6
6
 
7
+ ## 0.46.0
8
+
9
+ - Release N-1 for 0.46.x is published 0.45.0, which declares agent-mem `>=0.33.0 <1.0.0`; its fixture lock pins the 0.33.0 that the 0.45.0 release resolved, with control protocol 17 (descriptor floor 16). The N-1 fixture and matrix pin that package, and the matrix now records the declared range apart from the resolved version; the separate protocol-16 fixture stays at 0.25.0. The isolated compatibility fixture covers old clients and plugins against the new daemon and new clients and plugins against the old daemon; it does not prove live-agent, rollback, or shared-home compatibility. The protocol window is unchanged; the daemon adds the `instructed_intent`, `instructed_exact` and `roadmap_instructed` features, and a recovery target without `roadmap_instructed` (0.45.0) is refused while an instructed milestone history entry is retained. The CLI adds `ahub instructed run`, the internal `ahub instruction-hook`, `ahub setup --undo`, `ahub init --no-jcode-home`, the `ahub roster add` preflight with `--yes`, `ahub roadmap decompose --publish` and `ahub budget execution configure --reason`; a 0.45.0 CLI does not offer these. The MCP tool set is unchanged; only the `hub_roadmap_decompose` and `hub_task_decline` descriptions changed. The declared agent-mem range is unchanged, and no memory home or sync format floor is raised.
10
+ - Pin `@staix/cli-output` 0.1.3 and use its header-aware wrapping for compatible inputs while preserving existing console output. Refs #1640, hub task 1082.
11
+ - Use the first-party `@staix/cli-output` standard-v1 tokens and color rules on an exact 0.1.2 pin while preserving hub output. Refs #1640, hub task 1077.
12
+ - Document and pin the instructed cross-project handoff refusal in both modes: the destination cannot check receipt revocation at its write. Refs #1622, hub task 1080.
13
+ - Admit `roadmap state <id> done|dropped` in intent and exact instructed mode: the milestone id must be literal in the person's prompt, the milestone history records the same `instructed`, `instructedPeer` and `instructionReceipt` keys task history does, and a recovery target must advertise the new `roadmap_instructed` feature while any such entry is retained. Final verdict, no undo. Refs #1622, hub task 1081.
14
+ - Admit screened exact backlog pin and pull-ready reasons and named local title changes, with receipt fences and a prior-title undo; intent free text and native Pi titles remain closed. Refs #1622, hub task 1079.
15
+ - Screen exact instructed backlog creation and public study approval before their effects; only person-typed command text is declassified, and intent creation remains closed. Refs #1622, hub task 1078.
16
+ - Permit a no-manifest task claim verdict from an exact instructed receipt, with its task, slot and verdict bound to the person's command. Refs #1622.
17
+ - Allow explicitly classified intent commands from a confirmed managed Claude instruction, with literal-id verdict checks and a ten-operation receipt bound. Refs #1622.
18
+ - Record the agy 1.5.14 verification attempt: the CLI surface and tmux helper legs pass, the hooks leg shows 17 provider tool declarations (new `run_workflow` and `swarm`) against the pinned 15, and the launcher-nonce leg cannot run for lack of its original producers, so 1.5.14 stays unverified (`docs/verification/2026-11-22-agy-1.5.14.md`). Refs #888, hub task 1055.
19
+ - Allow one classified exact hub command from a confirmed managed Claude instruction, with inherited IPC, user/peer provenance and person-only mode control. Refs #1622.
20
+ - Record hash-only pending Claude instruction evidence and confirm it against the bound native transcript; it grants no command authority. Refs #1622.
21
+ - `ahub init` creates a separate hub-owned jcode home (only the hub entry, your `jcode_mcp_allow` servers and the hub skills; prints the `jcode login` step and sets `jcode_home` in `config.local.json` on the rerun after you log in; `--no-jcode-home` skips it), and `ahub roster add <peer>` shows a preflight and asks before adding (`--yes` without a terminal). Refs #1627, hub task 1073.
22
+ - Make automatic work distribution respect capacity: every owner choice the hub makes on its own skips a peer at its WIP cap or with a held queue, a peer that capacity-declined is skipped until it next reports idle, a capacity decline of a pulled card returns it to backlog with its reservation, and with `tasks.auto_pull` on an idle or freed peer is offered the first ready unowned task it is eligible for. An explicit person or conductor assignment is unchanged, and the `hub_task_decline` description now tells agents to pass `capacity: true` whenever the reason is load (Refs #1626, hub task 1071).
23
+ - Add Claude plugin skills for hub status, management, use and person-run commands, with a doctor check. Refs #1622.
24
+ - Add a machine-local `jcode_mcp_allow` list (in `.agenthub/config.local.json`, per instance too, never settings-editable) of jcode MCP server names that `ahub doctor` accepts for the hub-owned jcode: allowed names read `ok` and are listed as allowed by the person, any other extra server still fails and is named, with the key as a hint, and an unreadable file still fails. Matching is by name only and launch is unchanged (Refs #1621, hub task 1056).
25
+ - Warn in `ahub doctor`'s `routing classes` row when a rostered peer that can implement (its roles or its adapter's say implementer) appears in no `[classes.*].peers` list of the routing the hub loaded: the row names the peer, says the hub never offers it work automatically, and names the routing file and the class lines to edit. A warning, never a failure, and a peer the person took off the roster or that cannot implement is not reported (Refs #1626, hub task 1069).
26
+ - Publish a held milestone-decomposition part as a GitHub issue: `ahub roadmap decompose <id> --publish` prints the spec issues and tasks it would create and writes nothing, and `--apply --confirm <fingerprint>` creates one issue per held `spec` part behind `roadmap.github_write`, joining the milestone through the same membership field the opt-in mirror uses. A second apply creates nothing, a second apply that overlaps a running one is refused instead of creating the same issues twice, a `task` part and a released draft get no issue, a private part is never published, and a refused `gh` call leaves the draft held with nothing linked (Refs #1480, hub task 1052).
27
+ - Install the hub's own skills on the other agent hosts from `ahub setup`: Codex, Kimi, Qwen, Jcode, Pi and agy each get their user skill directory written behind a `.ahub-skill.json` marker (`tool`, `version`, `sha256` of the tree). A tree the hub wrote is replaced only while its digest still matches; a locally modified, foreign or linked tree is reported and left alone, and `ahub setup --undo` removes only the hub's own unmodified trees. `ahub doctor` reports installed, stale, missing, modified, foreign or linked per host (Refs #1622, hub task 1063).
28
+ - Verify Qwen Code 0.28.3 for account-free ACP and dual-output TUI use, and 0.27.1 for ACP, on macOS arm64 (Refs #888, hub task 1025).
29
+ - Verify Jcode 1.0.3 for account-free serve, ACP, MCP, steering and hub delivery on macOS arm64, and widen its compatible line to `0.98.0` up to `1.1.0` so the 1.0.x releases launch as in-line. The new receipt also records that a jcode model turn stamps a local telemetry id even under `JCODE_NO_TELEMETRY=1`, while the usage outbox stays suppressed (`docs/verification/2026-11-22-jcode-1.0.3.md`; Refs #888, hub task 1076).
30
+ - Read and manage roadmap milestones from the dashboard and the console: a Roadmap view at key 8 with Now, Next and Later lanes, one card per milestone carrying its outcome, approval progress, spec freshness and linked work, a Milestone filter on the task board, a detail dialog, and an unplaced tray that reports private items as a count. Every write is a console op carrying the revision the page rendered, so a stale page is refused by name with nothing written, and drag, the ordered move buttons and the `done` and `dropped` states appear only in a person session. The console adds a Roadmap panel (9) while the hub reports the feature, listing lanes and progress and opening a milestone on Enter, and `ahub ui --all` gains a per-project roadmap summary read at most once a minute (Refs #1483, hub task 964).
31
+ - Forecast quota exhaustion: `ahub budget`, the console Usage detail and the dashboard's Usage budgets row print each window's `left` and when it would reach its limit at the hourly burn rate from the usage roll-up, over at most 24 hours and from the window's own opening when it opened inside that span, which the sentence says. Too few points, no burn, a reset that comes first or an unusable reading read `no forecast:` with the cause, never a time, and `--json` carries the same `left` and `projection`. A person's `ahub budget execution configure <config.json> --reason <text>` keeps the last reason with `person` and its time on the execution budget, and a configure without one changes the limits as before and keeps the previous reason (Refs #1513, hub task 977).
32
+
33
+ ## 0.45.0
34
+
35
+ - Release N-1 for 0.45.x is published 0.44.0, with exact agent-mem 0.30.0 and control protocol 17 (descriptor floor 16). The N-1 fixture and matrix pin that package; the separate protocol-16 fixture stays at 0.25.0. The isolated compatibility fixture covers old clients and plugins against the new daemon and new clients and plugins against the old daemon; it does not prove live-agent, rollback, or shared-home compatibility. The protocol window and CLI forms are unchanged. This release declares agent-mem `>=0.33.0 <1.0.0`, resolved to 0.33.0 by the lockfile, and does not automatically raise the memory home or sync format floor; compatibility after a person raises a floor requires separate verification.
36
+
37
+ - Add descriptive edit-governance factorial, sensitivity and evidenced cost-per-success helpers (Refs #1556, hub task 1008).
38
+ - Admit a verified draft head to review before macOS runs, while preserving the full exact-head merge gate (Refs #1576, hub task 1031).
39
+ - Accept new agent-mem minors automatically through the declared range `>=0.33.0 <1.0.0`, checked at load against the package's host API range `[1, 1]` (Refs #1611, hub task 1054). A package without valid `HOST_API_MIN` and `HOST_API_VERSION` is refused with the cause, never a module-link error. A minor may raise the store format floor, so roll back the hub together with the store. A new major stays a reviewed raise. Memory opens only for such a release (`Bun.semver.satisfies`), and the recovery package and `scripts/check-package.mjs` apply the same rule; `ahub doctor` and the memory client report the loaded release and, on refusal, its cause. A daily scheduled and dispatch workflow installs the newest in-range release beside the unchanged manifest and lockfile and runs the memory-surface gate against it. An in-place upgrade turns the sync-placement writer proof to `changed` until a person re-runs `amem migrate --sync-placement --dry-run`. This replaces the exact agent-mem pin (the interim `~0.32.1` range of #1605, hub task 1047, never shipped).
40
+ - Add opt-in edit route and read-receipt guards for hub-owned tools, plus edit supervision observations (Refs #1556, hub task 1007).
41
+ - Open or attach a verified GitHub PR for a managed worktree at task completion (Refs #1549, hub task 1019).
42
+ - The console keeps the selected row on screen in the Settings panel: the row window now leaves room for the notes above the table (#1607, hub task 1049).
43
+ - Propose the parts of a roadmap milestone: `ahub roadmap decompose <id>` and `hub_roadmap_decompose {id}` ask the hub's model how one milestone decomposes, reading only its public title and outcome, the goal or architecture specs it links and the issues it links. A part is kept only when it cites an id the model was shown and says whether it needs its own spec issue or goes straight to a task, and the answer is saved as a pending model answer; nothing is intaken, linked or published (Refs #1480, hub task 1050).
44
+ - Accept one proposed part of a milestone decomposition as a held intake draft: `ahub roadmap decompose <id> --accept <part>` and `hub_roadmap_decompose {id, accept}` create a backlog draft linked to the milestone that carries the part's `spec`/`task` kind, so nothing offers, pulls or routes it until the person releases it with `ahub intake approve`. Each part is accepted on its own, accepting the same part twice returns the draft the first accept made, and the reply is a public view, so a part the screen refuses is held privately and reads `[pii]` (Refs #1480, hub task 1051).
45
+ - Record codex-cli 0.171.0 reviewer evidence from model-free preparation only; 0.171.0 stays unverified because the one model-backed review persisted no verdict, and the compatibility list is unchanged (Refs #888, hub task 1024).
46
+ - Move the external project mentions from the README to `docs/influences.md` (#1589).
47
+ - Shorten two slow test files without loosening what they assert: the hang-watch gate fixtures are trimmed, with the measured reason `memory-store` cannot be halved (#1594), and a checkpoint test waits out the expiry its fixture already shortens (Refs #1578, #1595).
48
+
49
+
50
+ - Add `turn_end.edits` (closed counts of edit-tool and shell-route writes graded by read receipts, only on mutating turns with `research.enabled`) and a text-free `edits` block on research records v2, reported per leaf by `quality.json` with null (never 0) on tree-only surfaces (Refs #1556, hub task 1006).
51
+
52
+ - Exact-pin the first-party agent-mem dependency to 0.32.0, from 0.30.0 (hub task 1042). The 0.31.0 additions stay outside the paths this hub reads (the `held` placement realm outcome and the classified agent-marked CLI read causes), and its sync result shape and `SYNC_FAILURE_CAUSES` are unchanged. The 0.32.0 CLI changes also reach nothing here: the hub's one `amem` call previews `amem setup <tool> --json` and parses the answer with `JSON.parse`, so 2-space `--json` indentation and usage errors exiting 2 read the same, and it writes no capture hook or `amem ingest` call of its own, so piped ingest printing human text and the `amem_work_state_read` per-call policy snapshot change nothing it runs. `amem list`, `show` and `graph` keep byte parity and storage is unchanged.
53
+ - Check roadmap drift, preview an opt-in GitHub milestone mirror, and export validated public roadmap files (Refs #1482, hub task 951).
54
+ - Take the recovery driver's attachment-wait poll slice from the clock object it already accepts for `now` and `sleep`, defaulting to the same 1 s so no production timer or deadline moves, and let the `#489` deadline tests poll at 10 s: `test/upgrade-runtime.test.ts` drops from 126 s to 57 s on macOS with every 600, 650, 700 and 900 s assertion unchanged. The other four files of the ten-file table are left with measured per-file reasons (Refs #1578, hub task 1044).
55
+ - Report Pi prompt context occupancy and session model in headless and TUI modes, and bind verified TUI sessions to Record capture (Refs #1549).
56
+
57
+ - Read merged PR CI costs from complete branch-scoped evidence when GitHub omits run-to-PR links, including first-pass status and full-gate and macOS shard counts (Refs #1579, Refs #1555, hub task 1032).
58
+ - Make a failing gate name its step: `scripts/check.sh` prints one `check: FAILED step '<name>' (exit N)` line (and a GitHub annotation under Actions) for each once-only step, and for the test runner it adds the failing-test count (each test once, although Bun repeats every `(fail)` line in its end-of-run recap), the first failing test and the last test file started, or says the runner exited or was signalled with no `(fail)` line, plus the leaked-process scan. Exit statuses and pass/fail are unchanged (Refs #1577, Refs #1260).
59
+ - Retire a finished recovery receipt's runner db only while this process's own live claim still refuses a new owner, so two maintenance passes can no longer race a release against an unlink and crash a pass on the moved database (Refs #1260, Refs #1541, hub task 1040).
60
+ - Keep the staged-project-isolation test's two real daemons but run every await under a 45 s body deadline with 6 s cleanup waits under its own 90 s timeout, so a slow macOS shard fails the step it waited on instead of being cut by Bun's 20 s while a synchronous `ps` read is on the stack (Refs #1577, Refs #1260, hub task 1038).
61
+ - Split `post_ready` on the startup timings line into one boundary per step (`post_ready_handoff`, `_queue`, `_watch`, `_reconcile`, `_goals`, `_leases`, `_crash`, `_pi`, `_drift`), so the next live start names which step holds the 17 s that blocks control replies. Measurement only; no behavior changes (Refs #1445).
62
+ - Rotate `events.jsonl` (64 MiB segments, three kept) and `hub.log` (16 MiB, two kept) by size. A rotated segment is named by its starting byte, so every reader and every persisted offset (the usage roll-up, the live research tail) keeps its meaning across a rotation, and `ahub research backfill` gives the same records for a task whose events sit in a rotated segment. The oldest event segment is kept while it holds an open task's events (Refs #1546, hub task 1021).
63
+ - Drop a closed task's ephemeral state: its `touches` rows, the output tail and staged output of its finished isolated checks, and the settled results of a closed Pi session shrink to 2,000 characters with a shell exit code kept. Tasks, history, receipts and roll-ups are untouched (Refs #1555, hub task 1004).
64
+ - Remove the rooms-delivery replaced-presence flake: the test counted beta's own session-start presence request as an echo of the replacement reply, and now waits on beta's answer (Refs #1577, Refs #1260, hub task 1035).
65
+ - Remove the runtime-prune recovery flake: the test waits for the pass it admitted to record its terminal phase in the admission ledger instead of a fixed 50 ms delay that raced the worker's write, and an unreadable ledger is no longer read as zero rows (Refs #1260, Refs #1546, hub task 1037).
66
+ - Remove the conductor detached-restart flake: the test waits for the restart terminal receipt or the runner exit instead of fixed 10 s and 15 s budgets (Refs #1577, Refs #1260, hub task 1033).
67
+ - Verify Claude Code 2.1.328 and 2.1.329 as headless implementers with isolated model-free transport and wrapper receipts (Refs #888, hub task 1023).
68
+ - Read only the slice of `events.jsonl` a closing task needs when the live research writer builds its record, with the same row as `ahub research backfill` (Refs #1555, hub task 1003).
69
+ - Cache the memory sync policy version on the profile fence's stat tuple and stop asking the store for `bridgeStatus` there, so an unchanged home costs a stat per fence check instead of a full shard re-read (Refs #1545, hub task 1028).
70
+ - Allow a hub-managed worktree to be committed and checked before task handoff (Refs #1549, hub task 1018).
71
+ - Raise the ACP open-tool ceiling's default from the legacy 30 minutes to 60, and its cap to 120, because this repository's own instructions expect a gate run to wait up to 50 minutes (`dot remote verify --wait 50m`); a tool call that reports no progress for that long still ends the turn, and per-poll rearming and the watchdog floor are unchanged. A turn the ceiling cancels now names its cause: hub.log gets the ceiling and its minutes for a configured kind whose native diagnostics stay withheld, plus that peer's own launch (`ahub jcode`, or `ahub jcode --as <peer>` for an extra instance) and the held queue row the person settles, and a private turn's tool titles stay withheld with them (Refs #1601, hub task 1046).
72
+
7
73
  ## 0.44.0
8
74
 
9
75
  - Release N-1 for 0.44.x is published 0.43.0, with exact agent-mem 0.29.0 and control protocol 17 (descriptor floor 16). The N-1 fixture and matrix pin that package; the separate protocol-16 fixture stays at 0.25.0. The isolated compatibility fixture covers old clients and plugins against the new daemon and new clients and plugins against the old daemon; it does not prove live-agent, rollback, or shared-home compatibility. The protocol window and CLI forms are unchanged; the backlog pull MCP description now explicitly names planner-only authority. This release pins agent-mem 0.30.0 and does not automatically raise the memory home or sync format floor; compatibility after a person raises a floor requires separate verification.
package/README.md CHANGED
@@ -5,7 +5,7 @@ Code, Codex, Kimi Code, Pi and a hub-owned local worker (plus Qwen Code, Jcode a
5
5
  Antigravity if you want them) share a message bus, a task board and a memory, each
6
6
  connected through its own native interface.
7
7
 
8
- Status: 0.44.0, control protocol 17 (accepts 16). Bun + TypeScript, one loopback daemon per
8
+ Status: 0.46.0, control protocol 17 (accepts 16). Bun + TypeScript, one loopback daemon per
9
9
  project. Site: [agent-hub.staix.net](https://agent-hub.staix.net).
10
10
 
11
11
  Inspect bounded task and attempt metadata with `ahub lineage show`; admit external
@@ -37,7 +37,9 @@ its PID and keeps waiting for readiness. Completed starts write phase timings to
37
37
  `hub.log`; [startup diagnostics](docs/operations.md#install-and-start) explains
38
38
  the 120-second outer bound and the next step for unconfirmed readiness.
39
39
 
40
- `ahub setup` also registers agent-hub as a plugin of the family console
40
+ `ahub setup` also installs the hub's own skills for Codex, Kimi, Qwen, Jcode, Pi and agy behind a
41
+ `.ahub-skill.json` marker (`ahub setup --undo` removes only unmodified trees it wrote), and registers
42
+ agent-hub as a plugin of the family console
41
43
  ([agent-console](https://github.com/STAIxBWLB/agent-console), `acon ui`): the same dashboard
42
44
  appears as a panel for every registered project, and pending approvals, reviews assigned
43
45
  to you, questions agents ask you and, where acon supports them, unread results reach the
@@ -91,7 +93,8 @@ including [a new project with SDLC advise or enforce](docs/quickstart.md#a-new-p
91
93
  optional control bands turn a breach into a backlog card. `ahub roadmap` groups
92
94
  work into board-backed milestones with computed task, cached issue, spec and
93
95
  train progress; private tasks appear only as counts. Planner/conductor edits
94
- are separate from the person's done/dropped decisions ([roadmap](docs/design/roadmap.md)). Work that belongs to
96
+ are separate from the person's done/dropped decisions ([roadmap](docs/design/roadmap.md)). The dashboard's Roadmap view and the
97
+ console's Roadmap panel show its lanes and progress. Work that belongs to
95
98
  another project running agent-hub on this machine goes onto that project's board
96
99
  with `ahub task handoff` (agents: `hub_task_handoff`), and its state changes come
97
100
  back as task messages.
@@ -132,7 +135,7 @@ including [a new project with SDLC advise or enforce](docs/quickstart.md#a-new-p
132
135
  ([guidance probes](docs/design/guidance-probes.md)).
133
136
  - **Shared memory.** Decisions, contracts, fails and findings are kept through the
134
137
  first-party [`@staix/agent-mem`](https://github.com/STAIxBWLB/agent-mem) library,
135
- in process with no claude-mem worker (short- and long-term tiers, a typed graph,
138
+ in process (short- and long-term tiers, a typed graph,
136
139
  git sync between machines). Agents get
137
140
  it as a recall preface, as briefs on a task, and through bounded search tools.
138
141
  Managed headless peers can save compact `amem:` records from final answers; the
@@ -155,7 +158,10 @@ including [a new project with SDLC advise or enforce](docs/quickstart.md#a-new-p
155
158
  still ask. Every message records its sender's origin, and a session that is not
156
159
  the project's own peer appears as `<peer>~<origin>` with none of that peer's
157
160
  roles: sessions are distinguishable, which is provenance, not authentication.
158
- Budgets pause an
161
+ A managed Claude session can run hub commands on the person's typed instruction
162
+ (`/agent-hub:ahub`); a project with no retained choice starts in `intent` mode, and the
163
+ person changes it from a terminal with `ahub settings set instructed.mode off|exact|intent`.
164
+ Budgets forecast when each quota window would reach its limit (`ahub budget`) and pause an
159
165
  agent before it runs out of quota (at 99% of a window by default, the
160
166
  `budget.gate` setting), a reviewer is skipped when its known usage reaches 80% or
161
167
  its quota is unknown (`review.gate`, `review.unknown_quota`), and recovery never
@@ -222,18 +228,13 @@ Live checks that still need a real account or a person are listed in the
222
228
  | [Security notes](docs/security.md) | what the hub defends and what it does not |
223
229
  | [Design spec](docs/specs/2026-09-19-agent-hub-design.md) | how it is built and why |
224
230
  | [Smoke checklist](docs/smoke.md) | what has been verified against real agents |
231
+ | [Influences](docs/influences.md) | projects whose features informed agent-hub |
225
232
  | [Changelog](CHANGELOG.md), [Contributing](CONTRIBUTING.md) | releases and how to contribute |
226
233
 
227
234
  Coding agents that work on this repository follow [`AGENTS.md`](AGENTS.md) and
228
235
  [`docs/agent-notes/`](docs/agent-notes/).
229
236
  The managed agent guidance explains the marker-only no-reply path for a delivery that needs no answer (#1550).
230
237
 
231
- ## Origin
232
-
233
- The first idea came from [agent-bridge](https://github.com/raysonmeng/agent-bridge),
234
- which lets Claude Code and Codex talk to each other. agent-hub has since grown into a
235
- different system with its own goals and shares no code with it.
236
-
237
238
  ## License
238
239
 
239
240
  MIT
@@ -225,6 +225,7 @@ When adding or updating an adapter, verify each item before opening a PR:
225
225
 
226
226
  - [ ] **T0 Receipt Recorded**: Document native CLI version, observed hook payloads, and protocol outputs in `docs/verification/YYYY-MM-DD-<kind>-t0.md`.
227
227
  - [ ] **Registered in ADAPTERS**: the definition is declared under `src/adapters/definitions/` (or its own directory) with explicit `displayName`, `family`, `transport`, `trust` and `projection`, and listed in `ADAPTERS` (`src/adapters/registry.ts`). The peer lists are derived from it. The hand-kept cross-release copies in `src/hub/peer-catalog.ts` and `src/hub/start-mode.ts` and the pinned tests listed in `docs/agent-notes/adapters.md` change with it, and the PR names them as expected test changes.
228
+ - [ ] **Hub skills host**: for a builtin kind that reads a user skill directory, add it to `SKILL_HOSTS` and `hostSkillDir` in `src/adapters/definitions/native-cli-skills.ts` and record the directory's source in `docs/agent-notes/adapters.md` ("Other hosts' user skill directories"); for one that reads none, add it to the exclusions in `test/skills-install.test.ts`, which fails while `SKILL_HOSTS` differs from `SUPPORTED_PEERS` minus claude and local.
228
229
  - [ ] **Config Path Protection**: Agent configuration directories added to `AGENT_CONFIG_SEGMENTS` in `src/hub/permission-mode.ts`.
229
230
  - [ ] **PII Safety Verified**: Cloud models have `trust.onPrem: false`; verify PII markers refuse routing to this peer.
230
231
  - [ ] **Process Group Teardown**: Daemon-spawned processes use process groups and exit cleanly on stop.
@@ -13,7 +13,7 @@ Scope: the Codex, ACP and Pi adapters and the Pi extension (turn `generation` an
13
13
  - Registry load runs `assertDaemonEngine` and `assertNativeCapabilityScope` before publication. A definition that is not a fixed builtin (object identity in `fixedBuiltinDefinitions`, never a kind name) may not declare `start.acpCommand`, `start.upStart`, `attach.admission`, `budget.resetSoftTokensOnResume`, `session.crashIdentity`, `session.nativeRevert`, a `pi-rpc` or `claude-implementer` daemon port, `identity.currentChild`, `routing`, `projection`, `reviewerVariant`, `headlessVariant`, `reviewer`, `hooks.factsHook`, `cli.entry`, `cli.preview`, `cli.usage` or `instances.modelSelect`. Only `definitionOf(id, instances)` picks a kind's `reviewerVariant`, for a declared extra with `start_mode: "headless"`, roles exactly `["reviewer"]`, and either a variant whose `reviewer.declaration` is `"automatic"` (Claude, agy) or `review_mode: "fresh"` (Codex, Kimi); without that opt-in a reviewer-only Codex or Kimi instance keeps its native adapter. It picks a kind's `headlessVariant` (Claude, #525-4) for a declared headless extra whose roles include `implementer` and hold only `implementer` and `verifier`. Metadata-only reviewer variants never establish native peer support; `isSupportedPeer` shares the registry runtime/validated-instance predicate with the catalog and daemon. A new field that depends on fixed-builtin assumptions or host-global native state joins that list (`test/adapter-capability-scope.test.ts`). `trust.onPrem` admits PII work (rule: `tasks.md`).
14
14
  - Native branch ratchet (#625): `test/daemon-native-branches.test.ts` counts every call of a native class predicate (an `is*Peer` imported from an adapter module other than `registry.ts`) per enclosing function in `src/hub/daemon.ts` and `src/hub/claude-launch-proof.ts`, and the counts must equal `test/daemon-native-branches.json` (`predicate`, `function`, `count`, `reason`). A PR that adds, moves or removes such a call edits its row by hand with a concrete reason; never regenerate the table from a test. Bind a predicate alias with `const` only and never call one through a computed namespace key: the scan refuses both.
15
15
  - Native proof state (`frontendProxy`, builtin `statusNotice`, `revertTurn` with `session.nativeRevert`, the Claude launch proof and terminal execution root) is read in the daemon only after `isFixedBuiltinDefinition(definitionOf(peer))`: a same-name foreign definition gets none of it. A product of a definition that is not a fixed builtin may not have a `frontendProxy`, `statusNotice` or `revertTurn` member at all, even undefined (`assertNativeProofPorts`, run by `createFromDefinition` and the conformance kit). Use `frontendProxyState` for the daemon proxy reads: absence keeps the generic path, present undefined refuses with `frontend proxy state unknown`. Keep approval policies and restoration debt inside CodexPeer. The remaining Codex `actionEnforcement`/`actionGated` predicate is intentional until a separately specified action-policy port; never add it to `FrontendProxyPort`.
16
- - Adding a native peer: declare its `AdapterDefinition` under `src/adapters/definitions/` (or its own directory, as agy) and list it in `ADAPTERS` (`src/adapters/registry.ts`). `KNOWN_PEERS`, `OPTIONAL_PEERS`, `SUPPORTED_PEERS`, `START_MODE_PEERS` (a kind with both a TUI and a headless form), `ROLE_ORDER`, `HELP_ORDER` and `PLANNER_PEERS` are derived from it by `deriveAdapterLists`: set `optional`, `projection` (`roleRank`, `startRank`, `helpRank`, `plannerEligible`, `conductorEligible`, `reviewerEligible`; absent eligibility is false; a configured or external definition cannot) and, for an `ahub <kind>` launcher, `cli.entry`, `cli.usage`, `cli.preview` and `cli.startWords`, never a list edit (`builtinCliEntries(definitions)` projects the entries). The literal cross-release copies `KNOWN_PEERS` and `OPTIONAL_PEERS` in `src/hub/peer-catalog.ts` and `START_MODE_PEERS` in `src/hub/start-mode.ts` stay hand-kept for older coordinators: `test/registry-guard.test.ts` fails when one differs from the derived list. Adding a peer is the one change that updates their probe counts and `VENDORS` in `test/helpers/registry-inventory.ts` (`REGISTRY_COMPATIBILITY_PROBES`), the probe literal in `test/adapter-registry-a2.test.ts`, the `ADAPTERS` order in `test/adapter-registry.test.ts` and the literal in `test/adapter-catalog-a2.test.ts`; say so in the PR as an expected test change. `isSupportedPeer` answers from `ADAPTERS`, and for a declared instance from its kind's runtime definition unless the instance resolves to an unavailable reviewer variant; `isKnownPeer` and `defaultPeerRoles` answer from `definitionOf`; `STARTABLE_PEERS` reuses `SUPPORTED_PEERS`. Role eligibility (#1408) is read only through `roleEligibility` / `applyRoleCeiling` (`src/adapters/role-eligibility.ts`): a new kind changes the generated table in `docs/roles.md` (`renderEligibilityTable`; `test/roles-doc.test.ts` fails until the doc matches) and, when `conductorEligible`, the pinned conductor set in `test/conformance/conductor.test.ts`, and the conductor-start wording comes from `conductorStartText()` (`src/adapters/registry.ts`), never a text edit. It also adds the kind's `kinds` entry and its rows to `templates/presets/confirmation-matrix.json` (#999 T0): `test/confirmation-matrix.test.ts` fails without a tool-approval and a classed-action row per environment, and when the entry's forms, pull-only forms, conductor start or hub-mode fact differ from the definition. Add the same kind to `kinds` in `templates/presets/autonomous.json`, with a permission per form (`null` where the hub mode is `unmanaged`, or for `tui` under `unmanaged-in-tui`) and a start per environment: `test/autonomy.test.ts` fails when the preset and matrix kinds differ or a mode is unsupported.
16
+ - Adding a native peer: declare its `AdapterDefinition` under `src/adapters/definitions/` (or its own directory, as agy) and list it in `ADAPTERS` (`src/adapters/registry.ts`). `KNOWN_PEERS`, `OPTIONAL_PEERS`, `SUPPORTED_PEERS`, `START_MODE_PEERS` (a kind with both a TUI and a headless form), `ROLE_ORDER`, `HELP_ORDER` and `PLANNER_PEERS` are derived from it by `deriveAdapterLists`: set `optional`, `projection` (`roleRank`, `startRank`, `helpRank`, `plannerEligible`, `conductorEligible`, `reviewerEligible`; absent eligibility is false; a configured or external definition cannot) and, for an `ahub <kind>` launcher, `cli.entry`, `cli.usage`, `cli.preview` and `cli.startWords`, never a list edit (`builtinCliEntries(definitions)` projects the entries). The literal cross-release copies `KNOWN_PEERS` and `OPTIONAL_PEERS` in `src/hub/peer-catalog.ts` and `START_MODE_PEERS` in `src/hub/start-mode.ts` stay hand-kept for older coordinators: `test/registry-guard.test.ts` fails when one differs from the derived list. Adding a peer is the one change that updates their probe counts and `VENDORS` in `test/helpers/registry-inventory.ts` (`REGISTRY_COMPATIBILITY_PROBES`), the probe literal in `test/adapter-registry-a2.test.ts`, the `ADAPTERS` order in `test/adapter-registry.test.ts` and the literal in `test/adapter-catalog-a2.test.ts`; say so in the PR as an expected test change. `isSupportedPeer` answers from `ADAPTERS`, and for a declared instance from its kind's runtime definition unless the instance resolves to an unavailable reviewer variant; `isKnownPeer` and `defaultPeerRoles` answer from `definitionOf`; `STARTABLE_PEERS` reuses `SUPPORTED_PEERS`. Role eligibility (#1408) is read only through `roleEligibility` / `applyRoleCeiling` (`src/adapters/role-eligibility.ts`): a new kind changes the generated table in `docs/roles.md` (`renderEligibilityTable`; `test/roles-doc.test.ts` fails until the doc matches) and, when `conductorEligible`, the pinned conductor set in `test/conformance/conductor.test.ts`, and the conductor-start wording comes from `conductorStartText()` (`src/adapters/registry.ts`), never a text edit. It also adds the kind's `kinds` entry and its rows to `templates/presets/confirmation-matrix.json` (#999 T0): `test/confirmation-matrix.test.ts` fails without a tool-approval and a classed-action row per environment, and when the entry's forms, pull-only forms, conductor start or hub-mode fact differ from the definition. Add the same kind to `kinds` in `templates/presets/autonomous.json`, with a permission per form (`null` where the hub mode is `unmanaged`, or for `tui` under `unmanaged-in-tui`) and a start per environment: `test/autonomy.test.ts` fails when the preset and matrix kinds differ or a mode is unsupported. A builtin kind that reads a user skill directory joins `SKILL_HOSTS` and `hostSkillDir` (`src/adapters/definitions/native-cli-skills.ts`); one that reads none joins the exclusions in `test/skills-install.test.ts`.
17
17
  - When an adapter lands, add its project config directories to `AGENT_CONFIG_SEGMENTS` (`src/hub/permission-mode.ts`); scoped automatic writes must ask there, while explicit approval and `never-ask` keep their existing behavior.
18
18
  - Load external modules only at daemon startup from trusted untracked local declarations: verify the self-contained bundle and content pin before importing captured bytes. Keep CLI/reload paths metadata-only, modules restart-bound and never settings-editable, builtin capabilities restricted, and external-kind instances admitted only under the accepted #754 headless opt-in, live captured catalog, separate worktree and host-managed current-owner proof; preserve the live-module controlled-recovery refusal. Export conformance registrations and fake assets without starting them on import.
19
19
  - Bind scanned external runtime SDK imports to this daemon's own `/adapter` entry; never resolve them against project packages. Refuse `/conformance`, `bun:ffi`, `bun:test` and CommonJS loading at runtime. Isolate module refusals from hub startup and retain unknown module roster rows as inert when metadata is unavailable.
@@ -47,7 +47,7 @@ Scope: the Codex, ACP and Pi adapters and the Pi extension (turn `generation` an
47
47
  - A peer must set `busy` synchronously inside `deliver()`, otherwise the bus drains the next envelope into a running turn (Kimi answers `turn.agent_busy`). Outside a turn the adapter accepts an occupancy diagnostic (a `context-used` `usage_update` naming its current session) and nothing else: no token total, no chunk, nothing unnamed or for an offline peer (#285).
48
48
  - A watchdog-cancelled turn still reports later. Anything a turn does on completion must check it is still the current turn (`turn` generation in `acp.ts`, `activeTurns` in `codex-appserver.ts`). A rejected prompt other than a recognised quota refusal, or an abnormal prompt end, reports through the adapter's `onTurnFailure` (same shape in `acp.ts` and `pi.ts`), even when ACP streamed partial text; a stale cancelled turn never reports it; a rejected watchdog-cancelled ACP prompt during its journal-less wait is discarded with one log line, not requeued as on the earlier adapter.
49
49
  - After an ACP watchdog cancels a prompt on a bus without a journal, keep the peer busy with its inactivity watchdog cleared until that prompt settles; suppress its turn-scoped updates and permissions while still accepting session-bound occupancy diagnostics. Bound the wait by the existing 30 s ACP handshake deadline, go offline, never idle, with queued work retained if it expires, and revoke the wait on stop or transport loss; a durable delivery keeps its existing offline/needs_review path.
50
- - ACP tool ceiling (#542): a tool call announced (`tool_call`) and not yet `completed` or `failed` in the current turn keeps a silent busy turn alive past the watchdog, up to `AcpOptions.toolCeilingMs` (never below the watchdog) counted from the last protocol message. Re-arm with `touch(<remaining ceiling, at most the watchdog>)`, never a full extra watchdog, and clear the open calls at each `deliver()`. Past the ceiling, cancel as an ordinary watchdog; its log line names the open tools only on a turn that is not private (latch `isPrivateTurn`, fail closed when it throws), each title as one sanitized, quoted, cut line. The daemon passes `toolCeilingMs`, `activityBatchMs` and Jcode's `steerTimeoutMs` from `adapterOperationalReaders` (`adapter_timing.*`, #982) only when it constructs an adapter; an adapter never reads config itself, and an accepted edit never retimes a running launch.
50
+ - ACP tool ceiling (#542): a tool call announced (`tool_call`) and not yet `completed` or `failed` in the current turn keeps a silent busy turn alive past the watchdog, up to `AcpOptions.toolCeilingMs` (never below the watchdog) counted from the last protocol message. Re-arm with `touch(<remaining ceiling, at most the watchdog>)`, never a full extra watchdog, and clear the open calls at each `deliver()`. Past the ceiling, cancel as an ordinary watchdog; its log line names the open tools only on a turn that is not private (latch `isPrivateTurn`, fail closed when it throws), each title as one sanitized, quoted, cut line. Fire `onToolCeiling({ ceilingMs })` before that line and the cancel; it carries the number only, and the daemon turns it into the host sentence for a kind whose adapter log is withheld (Jcode, `jcodeToolCeilingCause(ceilingMs, peer)`, #1601), so never add a title or native text to it. The daemon passes `toolCeilingMs`, `activityBatchMs` and Jcode's `steerTimeoutMs` from `adapterOperationalReaders` (`adapter_timing.*`, #982) only when it constructs an adapter; an adapter never reads config itself, and an accepted edit never retimes a running launch.
51
51
  - Native capability listings (#445 C1, #985): keep vendor identities and listing shapes in `src/adapters/native-capabilities.ts`, never in `src/hub/capabilities.ts`. `capabilityManifest` lists only on a `NATIVE_PINS` version; any other version returns an empty manifest, never a guess, and a transport failure rejects rather than showing a stale list. Codex `skills/list` uses a negative hub id, and only `enabled: true` skills are listed. ACP keeps `available_commands_update` lists that arrive during `binding` keyed by session (`earlyCommands`, at most `EARLY_COMMANDS_MAX`), and the bind adopts only the bound session's list (#567).
52
52
  - Retire a cancelled Codex native turn until its exact completion or session teardown. Late start acceptance, answer frames and completion must not revive its audience or relabel uncertainty as `failed_safe`. If cancellation has no provable native id, keep the peer offline until verified reattachment.
53
53
  - Codex: the adapter never sends its own `initialize`. It is a proxy; hub requests use negative ids and their responses must not reach the TUI.
@@ -80,7 +80,7 @@ Scope: the Codex, ACP and Pi adapters and the Pi extension (turn `generation` an
80
80
  - Tag a Pi hub-tool refusal only at a proven pre-effect guard with `PreEffectToolRefusal`; return its exact error and settle its receipt. Never classify a generic/post-effect/storage failure or a legacy pending receipt from error text or current board state. After durable `markStale`, cancellation or output consumption, retain ordinary failure classification; a later binding/privacy rejection cannot prove that no effect occurred. Recheck task revision, owner/session generation and privacy across awaited bounded spec/check operations; never turn those tools into arbitrary host execution.
81
81
  - Version gate (#843): `PiPeer.startImpl` first awaits the preflight the production factory `createPi` passes as a separate constructor argument (keep it out of `PiOptions`: transport option identity), which runs `piVersionAsync` on the exact configured `pi.cmd` plus `--version` (owned group, 64 KiB, 10 s) against compat `pi`. Only a `PiVersionRefusal` reaches the caller as is (sanitized, 1000 characters); never wrap another start error in it. A fake Pi in a daemon fixture answers `--version` with a verified version.
82
82
  - Report each Pi owner exit once, with code/signal (unknown for an unobserved TUI exit), turn/tool activity and only the last tool name. Auto-restart only a current, started, unexpectedly idle headless owner on its verified persisted session, once per 60 s; preserve shutdown/requested-stop/recovery/startup/active-tool fences and never fall back fresh.
83
- - Keep Pi owner identity on the shared `processSignature`/`processLiveness` contract exported by the exact-pinned package's Node-safe `@staix/agent-mem/platform` entry, re-exported unchanged by `src/pi/process-signature.ts` for the startup claim, extension claim, TUI owner monitor, `recoveryReady` and verified teardown. Memory's `sync.lock` uses the same implementation. Preserve the Node-safe process-entry regression in `test/memory-parity.test.ts`, the existing Pi process behavior tests, the LC_ALL=C/TZ=UTC `ps` read and strict pid + start + command identity; never accept PID-only or a fuzzy command match.
83
+ - Keep Pi owner identity on the shared `processSignature`/`processLiveness` contract exported by the first-party package's Node-safe `@staix/agent-mem/platform` entry, re-exported unchanged by `src/pi/process-signature.ts` for the startup claim, extension claim, TUI owner monitor, `recoveryReady` and verified teardown. Memory's `sync.lock` uses the same implementation. Preserve the Node-safe process-entry regression in `test/memory-parity.test.ts`, the existing Pi process behavior tests, the LC_ALL=C/TZ=UTC `ps` read and strict pid + start + command identity; never accept PID-only or a fuzzy command match.
84
84
  - Return the shared `toolResultFailed` verdict as `/tool`'s `failed`; map only `failed === true` to Pi's `isError`. Preserve text and the older bridge's absent-flag behavior. The one exception is a person's `!command` whose process exit was observed: its `failed` is `exitCode !== 0` and the reply carries `exitCode`, from `onProcessExit` through `packPiShellResult`, never parsed from the output (#253).
85
85
  - Pi's bridge executes `/tool` only for the verified owner (`verifiedOwner()`: the claimed pid with its `processSignature`; a headless owner is pinned from the spawned process once `get_state` proved its session) with the current `sessionId` and turn `generation`, and admits `/budget` only for that owner and generation, checked again after the awaited admission. Refuse anything else before execution. `tool_abort` aborts that pending call, or fences its id when it arrives before the call (64 ids a turn, then every further call of that turn). A person's `!command` (`purpose: "idle_user_bash"`) is taken only in TUI mode from an idle owner on its one-use reservation, and it alone skips `piPermit`: never widen that to a model's bash call (#253).
86
86
  - Emit Pi's ceiling event at the pre-effect rejection boundary (`src/pi/ceiling.ts`), before `agent_end`. Accept only a valid current-session/current-generation signal during a running turn; retain the first signal and attach it to that turn's failure. Never classify a ceiling from free text. At `agent_settled`, mark a ceiling delivery completed with `ceiling steps <count>/<limit>` and pass `settledCeiling: true` only when that turn failed without cancellation, withdrawal or an execution/approval budget stop, and no managed tool was pending when the ceiling arrived or remains pending. Latch tool uncertainty at the ceiling even if tools settle later. Keep every other failed delivery held; never replay it. Observe explicit stop/recovery, roster or personal withdrawal and cancelled settlement once per logical turn through `onTurnAborted`, without failure handoff; internal model-failure teardown suppresses that observation. Call `onTurnSuccess` only for an actual nonerror, noncancelled settlement, never a ceiling.
@@ -96,7 +96,7 @@ Scope: the Codex, ACP and Pi adapters and the Pi extension (turn `generation` an
96
96
 
97
97
  - `src/adapters/qwen-dual.ts` drives Qwen's own TUI through `--input-file` and `--json-file`; it is started only by `ahub qwen --mode tui`, through the definition's `start.createTui` and the `qwen-dual` daemon port, both fixed-builtin capabilities (`assertNativeCapabilityScope`). Qwen's `start.forms` stays `["headless"]`: never add `tui` to it (that would make Qwen a start-mode peer the hub opens by itself, and would change `START_MODE_PEERS`, a cross-release probe). The launcher needs a terminal and the base `qwen` id; the daemon refuses a TUI start for a declared instance, off roster or while a headless Qwen runs.
98
98
  - Judge a Qwen TUI by `holdsTerminal()` (its bound owner verified alive, or a session seen with no owner bound), never by peer state: a detached TUI reads offline while Qwen keeps running. A headless start over a held terminal is refused and a TUI start answers `already`.
99
- - Gate the TUI on `COMPAT["qwen-dual"]` (verified 0.26.1, 0.27.0 and 0.27.1, no `line`), both before the start (`qwenDualVersionAsync`) and from the TUI's own `session_start` (version, `protocol_version` 2, the events read). Never widen the headless `qwen` entry for it, or the other way round: their receipts are separate.
99
+ - Gate the TUI on `COMPAT["qwen-dual"]` (verified 0.26.1, 0.27.0, 0.27.1 and 0.28.3, no `line`), both before the start (`qwenDualVersionAsync`) and from the TUI's own `session_start` (version, `protocol_version` 2, the events read). Never widen the headless `qwen` entry for it, or the other way round: their receipts are separate.
100
100
  - `deliver()` sets `busy` synchronously and appends one `submit`; a prompt that is not the hub's own (matched by its text) is the person typing: the peer stays busy, nothing is shared, no approval is asked of the console. A submit that starts with `/`, `!`, `@` or `?` gets an `[agent-hub]` first line: Qwen reads a submit as typed input (slash command, shell line, file include). A turn ends at an `assistant` whose `stop_reason` is not `tool_use` followed by `message_stop` (or a `result`); a `tool_use` message never ends it.
101
101
  - A Qwen background-task notice is not the person typing (#517): when a background shell finishes Qwen writes a `user` event of its own, which can land in the middle of a running hub turn, and several finished shells fold into one event. `isQwenTaskNotification` accepts exactly one or more whole `<task-notification>` envelopes (task id, kind, status header, blank line between envelopes) and nothing else; `onUser` judges the raw event, not `promptText` (which joins every text block and drops the rest): the content must be exactly one text block that is wholly the envelope, so a split or mixed-block event is a person's prompt. Such an event changes nothing: a running hub turn keeps its owner and is not failed, and an idle peer stays idle (never mark it busy for a notice nobody may answer). Read nothing inside an envelope beyond its header, and never loosen the shape: a prompt that only contains or resembles one is still a person's prompt and still settles a hub turn as uncertain. The old reading held 7 of 7 recorded `needs_review` queues; when a new Qwen event type shows up inside a turn, check the live `events.jsonl` against `onUser` before widening anything.
102
102
  - After appending a Qwen deny, retain a durable input fence and settle only the delivery as known `completed`; never report idle from the deny, a denied-turn assistant/Stop, a control response, file readability or elapsed time. Check the fence write before appending the deny. Release it only after a newly observed same-session personal USER and that personal turn's normal final assistant/message_stop under the same verified owner, or a verified fresh native generation. Expire the named 30 s wait to offline with an actionable notice, retain queued input and the fence, and keep observing those recovery proofs after expiry. Persist the fence across detach, stop and adoption; an adopted fence needs a new personal USER, never buffered history. The watchdog never cancels: keep stalled turns busy; never type into the terminal, signal a turn or invent an input/ACK schema.
@@ -112,11 +112,12 @@ Scope: the Codex, ACP and Pi adapters and the Pi extension (turn `generation` an
112
112
  - Empty-inbox polling advice (#681, `InboxPolling` in `src/hub/inbox-polling.ts`) is advisory: never refuse or delay an inbox read for it. The daemon computes it only for a pull-only peer after the pull completed, so a throw drops the advice, never the pulled envelopes; it counts only empty reads with no open, non-backlog task as owner or reviewer, and an assignment resets it. The plugin shows `[polling detected]` only for a well-formed `pollingAdvice` (count >= 3, minutes 0 to 10).
113
113
  - TUI launchers (Kimi, Jcode, agy) write the plugin bundle the hub reports in `status` into their MCP entry, and the CLI's own copy only when the hub reports none (#502). Only the Jcode start path checks the entry against the daemon's own `SERVER_JS` (`jcodeMcpReady`); Kimi TUI admission does not compare it.
114
114
  - Native CLI versions (#691): every version gate asks `assessVersion` in `src/adapters/compat.ts`; no other file holds a version constant. Add a version to `verified` only with a receipt in `docs/verification/`, and point the entry's `receipt` at the receipt a later version should repeat (the daily `scripts/agent-compat-watch.ts` names it, #849); a `line` is for contract gates only (an isolation gate never assumes a newer version compatible); the person's `ahub agents trust` admits one exact version on this machine and never skips a runtime proof; `ahub agents` with anything but `--json` stays `console` in `classifyPeerCommand` and refused in `liveTestRefusal` (`src/cli/identity.ts`). A version refusal starts with `VERSION_REFUSAL` and names only versions and the trust command; keep it that way so the daemon may show it.
115
- - Jcode (#529): accept the native version only through `jcodeVersionSupported` (compat `jcode` line, 0.98.0 up to 1.0.0), in the daemon preflight (`jcodeVersionAsync`: off the event loop, owning its process group, output capped at 64 KiB), the doctor probe (`jcodeVersion`) and ACP `expectedAgent`; never pin the minor, and lower `line.below` when a release breaks the contract. Every owned jcode process (probe, serve, ACP and TUI) gets `JCODE_OWNED_ENV`, and the private socket name ends in `.sock`.
115
+ - Jcode (#529): accept the native version only through `jcodeVersionSupported` (compat `jcode` line, 0.98.0 up to 1.1.0), in the daemon preflight (`jcodeVersionAsync`: off the event loop, owning its process group, output capped at 64 KiB), the doctor probe (`jcodeVersion`) and ACP `expectedAgent`; never pin the minor, and lower `line.below` when a release breaks the contract. Every owned jcode process (probe, serve, ACP and TUI) gets `JCODE_OWNED_ENV`, and the private socket name ends in `.sock`.
116
116
  - Jcode TUI (#464): use only the current owned launch's top-level `--socket`/`--resume` tuple after native saved-session proof. Prove the save only through `savedSession` (no-follow, single-link regular file, size-bounded, unchanged across the read, its `id` and `messages` matching) and refuse a requested model, provider profile or session that differs from the running launch with `JcodeOptionMismatch`, which names the flag, never its value (#559); both the launcher and `--print-command` report it through `refuseNamedOption` (#574). Hand the tuple only to a person's launcher through `native_tui_launch` (admission: `daemon.md`); a refused tuple throws `JcodeTuiRefusal` with one closed `JcodeTuiRefusalCode` per check, never a path, socket, session or launch id. The launcher turns a returned code into words only through `jcodeTuiCauseMessage` (#1093). The headless-after-recovery hint is `JcodePeer.statusNotice` (fixed `JCODE_HEADLESS_AFTER_RECOVERY`), shown only after a crash report or a resumed session and gone once a ready TUI launch was served (`tuiServed`); previews (`--dry-run`, or `--print-command` from anyone but a person) start nothing and never resolve it. Never synthesize a save or prompt to induce one. Ctrl-C during the save wait and frontend close retain ACP; preserve session/load identity refusal and headless owned recovery metadata, and never record the TUI as a managed terminal (`recordTerminalLaunch`): Jcode has no terminal recovery adapter (#564).
117
117
  - Jcode steer (#572): reach a busy owned jcode only through `nativeSteer` on its private server socket, never by cancelling its turn: `ping` must list `soft_interrupt_ids`, `subscribe` uses `target_session_id` (the ACP session id) and `continue_on_disconnect`, `state` must report `is_processing` (a soft interrupt sent while idle starts a turn by itself), then `soft_interrupt {content, urgent: false, client_id}`. `canSend` rechecks the captured turn, busy state, owned server process, socket identity and session immediately before the write. Every refusal before the send is `failed_safe` with nothing sent; a sent message that is not acknowledged, or whose turn cannot be confirmed, is `needs_review`, never `failed_safe` or `completed`. Read `currentTurn()` before sending and adopt only through `AcpPeer.adoptIntoTurn(turn, ...)`, which refuses a different or ended turn; adopted senders join the turn answer's audience (`replyParent` and `replyAudience` over the turn envelopes, so the hop cap holds), and each steer receipt is `accepted` at once and settles with the turn (`completed` on a normal end, `needs_review` on a cancel, failure, stop or watchdog). Headless Kimi and Qwen have no steer: status reports their waiting important messages only through `importantWaitingStatus` (`src/hub/daemon.ts`) past `budget.stale_min`. A turn that ends and restarts between jcode's `state` reply and the write still receives the message, held `needs_review` and adopted into nobody: keep that ceiling until upstream offers an atomic per-turn steer, and never add a cancel-to-deliver path.
118
- - Jcode MCP set (#572): `jcode acp` and `jcode serve` start every server named in `<JCODE_HOME>/mcp.json` and the project's `.jcode/mcp.json`, `.mcp.json` and `.claude/mcp.json`, and no flag or variable selects them (`--mcp-tools`, `JCODE_MCP_TOOLS`, `JCODE_DISABLED_TOOLS` and `JCODE_DISABLE_CLAUDE_MCP` do not). Do not paper over it: `ahub doctor` lists the extra names through `jcodeExtraMcpServers` (`src/adapters/definitions/native-cli-jcode-mcp.ts`), names only, those four paths only, no home search, no link followed. Below the project root or home, `.jcode` and `.claude` must be real directories and the file a regular file (per-component `lstat`, an `O_NOFOLLOW` open and an `fstat` identity recheck); a system alias at or above the configured root stays allowed. Revisit if upstream adds a server selector.
118
+ - Jcode MCP set (#572): `jcode acp` and `jcode serve` start every server named in `<JCODE_HOME>/mcp.json` and the project's `.jcode/mcp.json`, `.mcp.json` and `.claude/mcp.json`, and no flag or variable selects them (`--mcp-tools`, `JCODE_MCP_TOOLS`, `JCODE_DISABLED_TOOLS` and `JCODE_DISABLE_CLAUDE_MCP` do not). Do not paper over it: `ahub doctor` lists the extra names through `jcodeExtraMcpServers` (`src/adapters/definitions/native-cli-jcode-mcp.ts`), names only, those four paths only, no home search, no link followed. Below the project root or home, `.jcode` and `.claude` must be real directories and the file a regular file (per-component `lstat`, an `O_NOFOLLOW` open and an `fstat` identity recheck); a system alias at or above the configured root stays allowed. Revisit if upstream adds a server selector. The person's machine-local `jcode_mcp_allow` (#1621; top level, or per instance, tier 3, never settings-editable) only changes what doctor accepts, through `splitJcodeMcpServers`: matching is by name, so a different server under an allowed name also passes (`ponytail:` comment). Never widen it to read a server's command or args, and never use it to change what jcode loads.
119
119
  - Extra Jcode instances (#685, #368): one `JcodePeer` per declared id (at most 8), each with its own `jcode_home`, socket and state. The person authenticates inside Jcode; the hub passes `-p`, `--model` and `--provider-profile` exactly as declared, handles no model credential or URL, and only checks that the home is a directory the person owns (`jcodeHomeRefusal`: no read or write under it). Never put `AGENTHUB_PEER_ID` in the shared `.jcode/mcp.json` entry (`jcodeMcpEntry`): every owned launch supplies it through `peerChildEnv(<id>)` or the TUI launch env, together with its `AGENTHUB_LAUNCH_ID`. The MCP server with no `AGENTHUB_PEER_ID` in tools mode refuses every tool and never defaults to a peer id. The daemon admits a `tools` hello for a peer whose definition is `owned-acp` only when it carries the launch id of that peer's current owned launch (`JcodePeer.ownsLaunch`, from `jcodeLaunches`); never trust the env alone. `jcode --as <id>` never opens a TUI. Declare the semantic `instances.nativeHome` on a definition, never compare the kind name (`registry-guard`); it is a fixed-builtin capability that `assertNativeCapabilityScope` refuses elsewhere. `checkJcodeInstanceHomes` (`src/hub/instances.ts`, run once at daemon startup) refuses a home equal to or nested in the base Jcode's or another instance's; compare homes only through its `canonicalHome` (`realPath`, case-folded on a volume that folds case, inode), never `resolve()` text. The preview of `--as <id>` passes the instance to `previewJcode` so it shows the daemon's real flags.
120
+ - Hub-owned Jcode home (#1627, `src/adapters/definitions/native-cli-jcode-home*.ts`): `ahub init` reads only the allowed entries of the person's own `mcp.json` and never writes it. It never copies or links auth. It writes the new home's files 0600, and sets `jcode_home` only after that home holds a login.
120
121
  - Jcode defers MCP tools (#912, `JCODE_DEFERRED_TOOLS_INSTRUCTION` in `src/hub/envelope.ts`): a Jcode peer lists only its built-in tools until the model searches for an MCP tool, so without a hint it reports the hub tools missing and answers in its final message. The guidance is written in exactly one place, that constant, and `JcodePeer` sends it through `jcodePreamble` (`src/adapters/jcode.ts`) ahead of the role contract, once with a session's first prompt, for the base peer and every extra instance. Never copy it into `STANDING_INSTRUCTION`, `templates/AGENTS.block.md` or a profile template (the Jcode bullet there is the same text in every template, and `test/jcode-deferred-tools.test.ts` pins both), and never change Jcode's own deferral or cache settings from the hub. The tools it names must exist, and the server name must be `JCODE_MCP_NAME`.
121
122
  - Antigravity P1 (`src/adapters/agy/`): keep it optional, cloud, off roster by default, implementer/verifier only and pull-only. Until per-mode native prompt behavior is verified, reject hub permission/unattended mappings, headless starts and resume selectors; do not infer a quota source. The launcher refuses extra instances, any `agy --version` not admitted by `assessVersion("agy", ...)` (`COMPAT.agy` in `src/adapters/compat.ts` is the verified-set/warning-line source of truth; exact person trust is separate, #691), and a hub without the `native_hook_launch` feature.
122
123
  - A project MCP entry the hub wrote is its own after the project directory moved (#1423): the directory fields are compared by real path (`sameDirectory`, `src/adapters/same-directory.ts`), not by text: `AGENTHUB_PROJECT_DIR` in the Jcode entry (`foreignField`), and `AGENTHUB_PROJECT_DIR` and `AGENTHUB_STATE_DIR` in agy's MCP entry and hook commands; a refusal names the differing field and the remedy. `jcodeMcpReady` still requires the exact current entry, so the launcher rewrites a moved one. Never loosen the rest of the shape (command, args, mode, peer id): only the directory fields follow a symlink. Kimi's entry is rewritten from the current paths and has no ownership check.
@@ -158,3 +159,31 @@ Scope: the Codex, ACP and Pi adapters and the Pi extension (turn `generation` an
158
159
  - The floor (#999 T3, `action_policy.floor`) is the only place the classifier is told a push or pull request is ordinary: `classifyAction(..., floor?: FloorFacts)` runs `floorPush` and `floorPullRequest` only for a bare command (an `unwrapped` wrapper, `-c`, `--git-dir`, `--work-tree`, an expansion or a `cd` it cannot place keeps the class), and without a `FloorFacts` argument it is byte-identical to before. The flag is read only through `ActionBudgets.floorOn()`; the daemon's `floorFacts(peer)` supplies the facts per execution root (the default branch from the same authoritative remote read as the task shell, cached and refreshed at every `action_policy` reload; `inOwnRepository` only when git proves the top level is that root and its origin is the project's repository). A fact that is missing or unproven is the strict case; never add an allowed form to `floorRefspec` or `floorPullRequest` without a test that pushes the matching unforced and forced, default-branch, tag and opaque variants. A new allowed class change belongs there and in `test/action-floor.test.ts`, never in the shared `classify` branches.
159
160
  - Floor facts hold only until the first earlier segment on the line that could change them. In `floorInert` (`src/hub/action-class.ts`), `FLOOR_INERT_PROGRAMS` and `FLOOR_INERT_GIT` are allowlists: any other program or git subcommand, a `FIND_WRITERS` primary, `rg --pre` or a glob argument ends the facts for the rest of the line. Before adding a program or git subcommand to either allowlist, show that no form of it can write a file, git config or a ref, or run another command, and add a test in `test/action-floor.test.ts` where its writing form still asks. Adding to `FIND_WRITERS` only makes the floor stricter. Revisit if the facts are ever re-read per segment. A redirect to a device file is not an output for the destroy rule (#725, #1193): `DEVICE_OUTPUTS` in `src/hub/action-class.ts` lists exactly `/dev/null` and `/dev/tty`, matched as written and never resolved, prefix-matched or normalized. `/dev/stdout`, `/dev/stderr` and every `/dev/fd/<n>` (1 and 2 included) stay destroys, because on Linux they reopen the file fd 1 or 2 already points at and a `>` truncates it (`sh -c 'echo x >/dev/stdout' >>/tmp/log`; the person's ruling after review of PR #1202); so do `/dev/sda`, `/dev//null` and `/dev/null/x`, and a device target never hides a real one beside it. The redirect is still recorded (`redirected`), so the read-only fast path in `floorInert` stays closed. Add a device to the list only with proof that opening it for writing cannot change a file and that no descriptor stands behind it, and a test in `test/action-class.test.ts` beside the lookalike rows.
160
161
  - 2026-11-02 (#1089): a terminal the hub opens for a start through Orca (`src/hub/terminal-open.ts`, #269) is opened in the worktree `resolveStartTerminalWorktree` finds by asking `orca worktree list` for the one whose path equals this project's root, never in `ORCA_WORKTREE_ID`: that variable names the terminal this process was started from, which is another project's when `ahub --project`, the dashboard manager or an upgrade brought the project up. `startTerminalCandidate` (the environment or a recorded launch) only answers the synchronous "could Orca be used" question in `available()`. The match is exact because `ahub <peer>` compares the terminal's worktree root with the project root by equality; a parent, a child and an archived entry are not matches, two matches and a cut-off list that lacks the root are refusals, and each refusal names the cause and the next step and carries no path. Verified against Orca 1.4.245: `worktree list --json` rows carry `id` and `path`, with `truncated` and `totalCount` beside them. A change to that shape is found by the fake-Orca test in `test/start-modes.test.ts` only if its fixture is updated with it, so recheck the real output when Orca moves (the read-only probe is `orca worktree list --json`; never create or write to a live pane).
162
+
163
+ ## Other hosts' user skill directories (#1622)
164
+
165
+ `ahub setup` installs the hub's skills (`plugins/agent-hub/skills/`) into each other host's user skill directory.
166
+ Established from each host's own source or help output, not from a shared convention:
167
+
168
+ - Codex `@openai/codex`: `_codex_home()/skills`, so `$CODEX_HOME/skills` (default `~/.codex/skills`).
169
+ - Kimi Code: `$KIMI_CODE_HOME/skills` or `~/.kimi-code/skills`; project skills sit in `.kimi-code/skills/`.
170
+ - Qwen Code: `getGlobalQwenDir()/skills`, so `$QWEN_HOME/skills` or `~/.qwen/skills` (it also reads `~/.agents/skills`).
171
+ - Jcode: the global `~/.jcode/skills/<name>/SKILL.md` under `$JCODE_HOME`; it also reads `.claude/skills` and `.codex/skills`.
172
+ - Pi: the global agent dir's `skills`, so `$PI_CODING_AGENT_DIR/skills` or `~/.pi/agent/skills`.
173
+ - agy: `~/.gemini/config/skills/<name>/` (its global config directory).
174
+
175
+ The directories are `hostSkillDir` and `SKILL_HOSTS` in `src/adapters/definitions/native-cli-skills.ts`, with the other
176
+ native facts, so no host name appears in the installer engine (`src/cli/skills-install.ts`) and the #451 registry
177
+ inventory stays empty outside `src/adapters/`. It writes a `.ahub-skill.json` marker (`tool`, `version`, `sha256` of the
178
+ tree) with each copy and replaces a tree only while that digest still matches; the check is repeated at the write, so a
179
+ tree that changed while the confirmation question was open is kept. A host with no config directory gets no install and
180
+ an `absent` state; setup never creates a host home. Never follow a link: a linked skills directory, a linked skill
181
+ directory, or a link inside the tree, is reported and left alone, while a symlinked host config home is the host's own
182
+ choice and is resolved with `realPath` (`src/hub/project.ts`), never `realpathSync`. The file count and size are bounded
183
+ before anything is written, and `ahub setup --undo` removes only the hub's own unmodified trees. Tests use fixture homes
184
+ only and never read or write a real agent home.
185
+
186
+ - Exact instructed CLI (#1622): derive argv only from the confirmed native transcript receipt; admit only the explicit classified form list, refuse private turns and PII tasks, and close the receipt before execution. Use the daemon-captured installed runtime outside project and peer write roots; the child uses inherited Bun IPC and never a WebSocket. Preserve the current managed-session and launcher checks through the effect, and never log prompt arguments.
187
+ - Intent instructed CLI (#1622): admit agent-selected argv only through its closed list of id, peer and enum forms, a current confirmed receipt and the existing inherited IPC boundary. Person verdicts are the exception to reversibility: match the literal item id, and both task id and slot for a claim, against the confirmed prompt. Reserve each of at most ten operations, and recheck the session and privacy until the effect. Spending settings, free-text forms and other closed classes remain refused. Record the person's instructed provenance, never the prompt text.
188
+ - Screened exact forms (`screen: true`) pass each input (the receipt args, the argv, plus the study contract or the previous title) through `publicMetadataText` and `screenPii` with `SCREEN_TIMEOUT_MS`. Reconfirm the receipt after each screen and before consuming it. A screen is not declassification. `INSTRUCTION_CONTROL_TIMEOUT_MS` budgets three screens: adding a fourth input raises that bound in the same change.
189
+ - `plugins/agent-hub/skills/ahub/SKILL.md` lists the admitted exact and intent forms. Change it in the same PR as `exactForm`/`intentForm`, because no test binds the two. Keep `disable-model-invocation: true` on the `ahub` skill.
@@ -1,6 +1,6 @@
1
1
  # Budget, pause and handoff
2
2
 
3
- Scope: quota and native context readings, checkpoints, pause, handoff and resume, and the status line tee. Read before editing `src/hub/budget.ts`, `src/hub/window-kind.ts`, `src/hub/budget-notes.ts`, `src/hub/context-window.ts`, `src/cli/statusline-tee.ts`, `src/adapters/definitions/native-quota.ts`, `src/adapters/definitions/native-context.ts`, `src/hub/bus.ts`, `src/hub/delivery-journal.ts`, `src/hub/restart.ts` (pause persistence), the per-account fanout in `src/hub/instance-budget.ts`, the usage roll-up in `src/hub/usage-rollup.ts` or Kimi's count (`src/adapters/kimi-wire-usage.ts`, `src/hub/kimi-usage.ts`, `src/hub/token-window.ts`).
3
+ Scope: quota and native context readings, checkpoints, pause, handoff and resume, and the status line tee. Read before editing `src/hub/budget.ts`, `src/hub/window-kind.ts`, `src/hub/budget-notes.ts`, `src/hub/context-window.ts`, `src/cli/statusline-tee.ts`, `src/adapters/definitions/native-quota.ts`, `src/adapters/definitions/native-context.ts`, `src/hub/bus.ts`, `src/hub/delivery-journal.ts`, `src/hub/restart.ts` (pause persistence), the per-account fanout in `src/hub/instance-budget.ts`, the usage roll-up in `src/hub/usage-rollup.ts` or Kimi's count (`src/adapters/kimi-wire-usage.ts`, `src/hub/kimi-usage.ts`, `src/hub/token-window.ts`), or the exhaustion projection (`src/hub/budget-projection.ts`).
4
4
 
5
5
  - Reviewer quota admission opt-outs (#1467): keep defaults `review.gate = 0.8` and `review.unknown_quota = "skip"`. `unknown_quota = "pass"` admits unknown observations only, retaining the known floor and never treating admitted unknown as quota-wait evidence. Gate `"off"` bypasses floor/unknown checks and all quota waits, while actual Budget/manual pauses and every other routing guard remain binding. Report the active rule through the shared policy description; do not turn an opt-out into a reading, account transport, cleanup release or resume path. Require `reviewer_quota` on recovery for explicitly configured unknown policy, including skip, or gate off.
6
6
  - Reviewer quota (#1446): accept only the pinned native outer Claude/Codex refusal frames in `native-quota.ts`, or the narrowly documented Kimi nonzero owned-child complete-stderr exception. Never match assistant/tool/model text. Keep reset unknown unless a typed native timestamp supplies it; credits do not affect admission. Record the hard pause through canonical-account `Budget.report` immediately when an admitted frame is observed (Kimi stderr only after confirmed settlement), independently of task fallback. Defer handoff until that owned attempt settles; only the existing Budget reset/resume policy releases the pause.
@@ -42,3 +42,4 @@ Scope: quota and native context readings, checkpoints, pause, handoff and resume
42
42
  - Kimi's consumption (#285 phase 2, delayed drain #1281, sliced drain #1283): `src/adapters/kimi-wire-usage.ts` is the only reader of Kimi's wire log and `src/hub/kimi-usage.ts` the only owner of the Kimi count; `daemon.ts` supplies ports (events, budget, clock, session id, unreferenced scheduler) and binds the session at a turn start (no read), calls `collectKimiUsage` at a turn end, a `usage_update` and an offline transition, and schedules at most three coalesced follow-ups (250 ms, 1,000 ms, 2,000 ms). With a scheduler, one invocation reads and commits one slice, then yields with a 0 ms continuation while the same cue's backlog remains (at most 16 slices per burst). Discovery is fresh on every slice; do not cache the agent set. Without a scheduler, the original synchronous 16-pass behavior remains for compatibility. Stop, offline and session replacement cancel delayed work; offline preserves the final synchronous `collect -> drop`, with rows durable only later as the documented ceiling. A native row time selects a unique interval among the most recent 32 captured turns; no unique match gives `unattributed`. Late rows never rewrite an earlier `turn_end` or increment a later turn. A successful reader slice commits offsets only after its rows are recorded; restart seeding counts only rows recorded after the last `budget_resume` of a soft-token peer (`kimiSeedRows`). Tests never reach the person's `~/.kimi-code`: `test/hub-home.ts` sets `KIMI_CODE_HOME` to a temp dir. Never feed `budget.report(kimi, tokens)` from an ACP total or an estimate, and never change `kimiCountedTokens` without the AC5 test: cache reads are recorded, not counted. An unreadable log, an unknown row shape or an untested `protocol_version` is unknown (reading dropped via `Budget.forget(peer, "tokens", "count")`, so only the count's own reading goes; one notice), never a partial count. A usage row's text never leaves the reader: four integers, a model label and the row time. A resume clears the window (`kimiUsage.reset()`).
43
43
 
44
44
  - Controlled recovery with retained reviewer accounting/wait history or explicitly configured reviewer quota keys requires `reviewer_quota`. Bind accounting replay completeness and safe ordered journal commitment through the existing snapshot integrity; missing/changed journal refuses restoration before optimistic counts can be published. Empty legacy state keeps older-target compatibility.
45
+ - Exhaustion projection (#1513): `projectExhaustion` (`src/hub/budget-projection.ts`) stays pure. An unusable reading answers `unknown` with a cause, never a time. The page's `PROJECTION_CAUSE`/`projectionText` in `src/ui/index.html` must render the same sentence as `projectionText` in `budget-projection.ts` (`test/budget-surfaces.test.ts` runs the page copy).
@@ -1,5 +1,8 @@
1
1
  # Daemon, control protocol and recovery
2
2
 
3
+ - Claude instruction evidence (#1622): `instruction-hook` is an allowed hook form, never a person command or authority grant. Store only bounded pending hash, prompt ID and metadata; confirm only against the current peer/session transcript under a setup-managed Claude home and current private `ahub claude` launch, an unused human command row from a probed version with matching prompt ID and canonical hash. Pending rows grant nothing, including on unsupported versions. Exact mode consumes one confirmed receipt before launching the daemon-captured installed CLI over inherited Bun IPC; its host-only context rechecks session, privacy, runtime and receipt until the effect, and its audit and user history carry the receipt and peer. Unknown evidence refuses. Close on Stop, expiry or ten operations. Never put prompt text in events, bus, memory, logs or status. The instructed tier lives in `src/hub/instructed-exact.ts`, `src/hub/instructed-intent.ts`, `src/hub/instructed-ipc.ts`, `src/hub/instructed-runtime.ts`, `src/hub/instruction-receipt.ts` and `src/cli/instruction-hook.ts`; the roadmap view model in `src/ui/roadmap-model.ts`.
4
+ - Intent mode (#1622): revalidate the same transcript and host evidence for every operation, serialize and reserve at most ten uses, and require each verdict id literally in the confirmed prompt (both task id and slot for a claim). Agent-selected argv goes only through the explicit id, peer and enum list; free text, spending and all other closed classes remain refused. Preserve the person-only mode witness and the `instructed_intent` recovery floor.
5
+
3
6
  - Instructed SDLC configuration (#1432): `createConfigEditor.configureSdlc` is the only conductor exception to person-owned structural edits. Require a direct own-session person-instruction claim, current unique conductor/session/root, public non-observer input and no child/recovery/shutdown context before planning and again after loader/intent hooks. Allow only off/advise and required check names; reject if either actual file or running lifecycle is enforce. Keep init, generic settings and protected lifecycle fields person-only; never treat this claim as release consent. Require retained intent before the existing revision/backup writer; distinguish result-audit failure after save. Read `docs/sdlc.md` "Instructed conductor configuration" when changing this exception.
4
7
 
5
8
  - Keep external-channel behavior in `src/adapters/channel-peer.ts`; the daemon owns socket authentication, admission and generation binding. In core, dispatch through `PeerAdapter` ports; call an adapter-owned native type predicate only at a site with a row in `test/daemon-native-branches.json` (rule: `adapters.md`). Preserve the Codex `unidentified-cancellation` status notice while its attached session is latched; clear it on verified reattachment or TUI detachment.
@@ -118,7 +121,7 @@ Scope: the operator console, control WS and its protocol, state files, the dashb
118
121
  - `native_hook_launch` (#543) is console-only and needs a definition with `hooks.factsHook`; one launch per peer. Refuse `begin` during recovery or shutdown, off roster or while the peer is attached. `end` needs the matching `launchId` and is the only request besides `status` and `kill` a stopping hub admits; closing the launcher's socket ends its launch. Both settle an open run `interrupted` once. Accept `native_facts` only from the tools role for the current `instanceId` and `launchId`, the latched native session and socket generation, and workspace paths whose `realPath` is the project. When a launch records `nativeHome`, its transcript index must be exactly `<nativeHome>/session_index.jsonl`. Close a `ws-pull` peer's hello without `channel: false` with 4403.
119
122
  - `native_tui_launch` (#464) is console-only and resolves only a running owned `JcodePeer` under its own kind id (`tuiLaunch`). Refuse it while stopping, during recovery, off roster, during that peer's roster change or requested stop, or when `jcodeMcpReady` fails against the daemon's `SERVER_JS`; a `binding` must name the current `launchId` and `sessionId`. Failures answer fixed errors with details withheld (a `JcodeOptionMismatch` names only the flag in `option`, #559) plus one closed cause `code` (a `JcodeTuiRefusalCode`, or `hub_busy`, `not_running`, `mcp_stale`, `bad_request`), logged as one `hub.log` line (#1093), and the launch tuple (socket, env) goes only into that console reply, never into `status`, `status.json` or a log. A launcher sends it only when the hub's `features` list `native_tui_launch`.
120
123
 
121
- - When preserving a recovery source, copy only the exact-pinned `@staix/agent-mem` package through `preserveRuntimeDependencies` in `src/cli/recovery-package.ts`; include its identity and bytes in `packageDigest`. Never copy the whole node_modules tree or link a preserved source to a mutable installation. Verify preserved sources with `ownDependencies: true` so a missing or symlinked memory copy cannot resolve an ancestor installation. Verify staged releases with `dependencyRoot` bound to their retained install directory; never resolve beyond it. Keep no-dependency release digests compatible.
124
+ - When preserving a recovery source, copy only the hub's declared first-party `@staix/agent-mem` and exact `@staix/cli-output` packages through `preserveRuntimeDependencies` in `src/cli/recovery-package.ts`; include their identities and runtime bytes in `packageDigest` without changing digests of older packages that lack the output dependency. Never copy the whole node_modules tree or link a preserved source to a mutable installation. Verify preserved sources with `ownDependencies: true` so a missing or symlinked dependency cannot resolve an ancestor installation. Verify staged releases with `dependencyRoot` bound to their retained install directory; never resolve beyond it. Keep no-dependency release digests compatible.
122
125
  - Release checker and committed release policy (#1120, #1381): `scripts/check-docs.mjs` is the one file outside `RUNTIME_ASSETS` that a capture carries (`RELEASE_CHECKER` in `src/cli/recovery-package.ts`, copied only when the source has it and refused when it is not a regular file), and `captureLayout` in `src/hub/runtime-capture-prune.ts` accepts an optional `scripts/` holding exactly that file, so captures made before #1120 still prune. It is deliberately not in `packageDigest`: widening the digest makes every already-staged release refuse as "cached release changed". `readDocEvidenceDetailed` returns `{ unavailable }` for a missing or failing checker and `ReleaseAuthorizations` turns that into its own refusal; only evidence that was read and is not fresh may say "stale documentation". Keep its spawn arguments unchanged (seed `release-committed-doc-metadata`). For the complete policy, receipt and `releasePolicyNotices` contract, read `tasks.md`'s Release authorization rule when changing that boundary. The production `ReleaseAuthorizations` host port in `daemon.ts` reads policy from the candidate commit; keep that injected port fail-closed.
123
126
 
124
127
  - Render staleness only through the call-scoped privacy preflight and bounded metadata probe (`memory-staleness.ts`); on a tree not modified during the call, private/denied/observed-symlink/unknown paths never produce a marker. Retain the explicit same-user concurrent-swap ceiling in docs/memory.md and the probe-loop ponytail. Keep hints out of stored rows and route native brief decoration after selection so one batch shares its probe budget.
@@ -174,3 +177,4 @@ Scope: the operator console, control WS and its protocol, state files, the dashb
174
177
  - Staged upgrades (#1039): retain `status.protocol` at the compatibility floor and publish `protocolMin`/`protocolMax`; negotiate the highest common control version and preserve each attached channel's actual negotiated protocol in recovery metadata. New scoped recovery receipts use schema 3 and per-project holds; keep legacy unscoped receipt behavior. Start ordinary project daemons from verified versioned release captures. Check `hub.db` with `db-schema.ts` before startup effects and every writable opener; advance its marker only with an incompatible format migration, never merely on opening with a newer binary. Before source replacement, controlled targets require `schema_guard`; preserve the retained target evidence of fully committed legacy receipts. Unguarded published binaries remain outside the bootstrap guarantee. Keep project runtime selection in bounded project-bound `runtime.json`; refuse Git-tracked or indeterminate repository state before using or replacing that authority. Updated 0.26+ up/manager/dashboard paths use its verified capture or a named version refusal. Preserve the explicit pre-0.26 published-CLI ceiling with a `ponytail:` note; never raise a DB/bootstrap floor for this selection. Compute path-scoped Git trust once per startup outside the writer lock; reuse its project-bound access for runtime reads and writes. Record selection and synchronous launch under the same registry lock used for capture publication and prune quarantine; confirm the unchanged selection and owner at readiness, and require the internal daemon to execute from that exact root. Scoped recovery must not refresh the shared manager. Prune only verified unreferenced versioned source captures, keep newest three/version, and defer on active recovery, unknown reference inventory or exhausted budgets. Schedule rate-limited maintenance after startup returns; keep only bounded metadata validation and atomic quarantine inside the registry writer lock, with candidate hashing and recursive deletion outside it. Refuse managed execution from reserved `.runtime-prune-*` paths; leave changed quarantine contents undeleted. Keep the 1 ms ledger wait on startup admission only; worker statements use the normal bounded wait. Record PID plus process signature and replace only a proven-gone running owner atomically under the admission transaction, with id/phase-fenced completion. Doctor names uncertain ledger state and leftover quarantine paths without repairing or deleting them. Reject empty recovery plans before source preservation.
175
178
  - Questions (#1053, `src/hub/questions.ts`, `src/hub/question-desk.ts`): the store owns the row and its ONE terminal transition (`UPDATE ... WHERE state = 'open'`; of concurrent answer, stop and expiry exactly one sees `changes === 1`), the desk owns the waiting call and the hub-built envelope, and the daemon only supplies ports. Keep `questions` console-only and ordinary person answers unchanged. Permit `hub_ask_answer` and instructed `answer` only for the current unique conductor on the person's explicit per-set instruction in its own session; require a non-empty quote, open public set and public caller, and refuse self-answer, wrong actor, live-test/delegated execution and child/tools ownership. Never infer instruction from hub/task/review/file/peer text, permit blanket delegation or answer across projects. Keep every control rid answered and retain the existing question validation/one terminal transition. Read `docs/security.md` "Questions a peer asks the person" before changing this exception or its #1328 precedent. Persist the instruction quote only in hub.db; remove it from all read views, tool responses, envelopes, logs, events and capture. Publish only actor/instructed provenance (including `agent_cli`); include `hub_ask_answer` in the existing question capture/progress exclusions. Nothing a peer sends as a `hub_send` body, tool result or ordinary envelope is parsed as an answer. A late answer is `kind: "answer"`, `from: user`, id `answer-<set>` (so a republish after a crash is dropped by the bus's own dedupe) with `refs.question`; an expiry notice is `kind: "status"` from the hub, never an answer. Supersede keys on `from === USER && kind !== "answer"` in the bus tap, never on the body, and never on the hub's own answer envelope. Question text and answers are stored in hub.db; the answer envelope goes only to the asking peer, while person surfaces use `questionView` (instruction quote removed). The `answeredQuestions` dashboard, CLI and Acon projections include only non-private, non-PII rows. The tap's log line, `redactBusEvent` and the `question` event stub question/answer text; `QUESTION_TOOLS` skips capture and the progress observer skips `hub_ask`. `hub_ask` holds its control request open (`controlRequestTimeout`, `request_cancel` through the shared `invocationRequests` map, so a closed socket or an aborted turn cancels the row) and Pi's bridge lifts its idle timeout for that one call. A new peer kind gets `questionWaitMs` on its definition (fixed builtins only, `assertNativeCapabilityScope`), never a wait chosen by the caller. The `questions` feature label is a recovery label: an older target ignores the table, so keep it in `DAEMON_FEATURES`. Start repair runs once after `ready`'s locals exist (`questionDesk.repair()` just before `ready = true`), and the sweep timer is pushed only after the desk exists.
176
179
  - Completions (#1054 T2/T3, `src/hub/completions.ts`, `src/hub/completions-store.ts`): a run opens at the `turn_start` that consumes a `from: user` delivery (never the hub's own `answer`), only for a peer whose definition declares `settle`. An unattached pull-only peer creates none; a launcher-bound Kimi TUI opens one only after native readback proves a person origin. `settleCheck(peer)` is the ONE settle check and never throws; call it from every place a pending-work fact can change (turn end, `bus.onQueues`, a permission or question closing, an isolated check ending, `Tasks.checkEnded`, a native task notification or a native-background re-read). The bus takes a delivery out of its queue before the peer's idle reaches the state tap, so `queuedContinuations` also counts `dispatching` rows and `deliveredAwaitingTurn` (bounded to 10 s, `ponytail:` in the code); drop either and a continuation reads as nothing pending. Claude settles only on the verified native Stop (a lost channel or watchdog carries no id and never settles). Kimi TUI settles only on correlated final-turn readback plus a known-empty background inventory; a running or unknown inventory and an active native turn stay working. A `limit` or budget pause ends the run with no completion (`budget.record`), an explicit stop calls `quietStop`, and `completions` is a recovery feature label (`hasPending`: an open run or an unread completion). The store keys a completion by the run's first turn id (`UNIQUE`), so repeated restarts yield one `interrupted` completion; never reconstruct from `events.jsonl`, which cannot say who started a turn. Launcher end/socket loss also settles an open run `interrupted`, once. Receipts (#1054 T4/T5): `completion_receipts` has a UNIQUE index on `completion_id`, so `markSeen` is one compare-and-set and a mark-unread has exactly one row to delete; `result_seen` and `results` are console-role control cases (rid always) placed before `case "kill"`, and nothing else writes a receipt: never mark read from a snapshot, a status read, a listing or an envelope. The `result` need is level `watch` and is not in the `waiting`/`blocked` lists in `needs()`; keep it that way so a result never reads as something to act on. Reconstruction drops an open run whose peer has a budget pause record before it would settle it `interrupted` (persist before remove, per run), and `CompletionStore.prune` bounds the table to the newest 500 read completions at start; never prune an unread completion or an open run. The title of a result is computed at display (`resultView`), a stub when private, and no prompt or reply text is ever stored. Native-person results always stay private.
180
+ - `src/ui/roadmap-model.ts` is injected into the page by source (`/* ROADMAP_MODEL */` in `src/hub/ui.ts`). Keep it self-contained, with no imports or module closures. The roadmap view writes through `textContent` only, and the `roadmap` snapshot block rides only `view: "roadmap"`.
@@ -10,7 +10,7 @@ Scope: the hub-native local worker, its tools, path guard, denylist and seatbelt
10
10
  - The sandbox denies home reads by default (toolchain dirs, the project and its real git dir excepted) and all network, loopback included: claude-mem and the Codex app-server listen on loopback without auth. Tests that bind a local port therefore fail when the worker runs them, also with `local.bash_network: true` (the egress proxy keeps loopback closed, and the proxy variables send a test's plain-HTTP `fetch` to the proxy, which refuses it); that is the intended trade-off, and `"direct"` is the switch until a later release removes it.
11
11
  - The seatbelt profile refuses the `.git` name itself at any depth (creation, rename, symlink, gitfile), `config`, `config.worktree` and `hooks` directly under it, `commondir` at any depth below it or below an external git dir, and `.agenthub` anywhere in the project, every name folded against the 16 code points HFS+ ignores (#270). Every `modules/` tree the project can reach (the common dir's, the worktree's own, every linked worktree's under `<common>/worktrees/<wt>/modules/` as a pattern so a tree or worktree that does not exist yet is covered, #518, and each discovered submodule's own `modules/`) refuses EVERY write that is not inside a discovered submodule git dir (#520): nothing is exempt by name, so a fake git dir called `refs`, `logs` or anything else cannot be planted for a later unsandboxed `git submodule update --init` to reuse. Inside each discovered git dir `D` the refusals are anchored to `D`: `D/config`, `D/config.worktree` (folded in both halves), `D/hooks` and what is below it, and `D/worktrees/*/config.worktree`, with `D/worktrees`, each `D/worktrees/<name>` and `D/hooks` refused as directory entries too, so none can be moved out, edited and put back; a submodule's own linked worktrees keep a `modules/` of their own at `D/worktrees/<name>/modules`, which gets the same everything-not-discovered refusal by pattern (so one that does not exist yet is covered) and has its `modules` entry refused as a target; `D/logs`, `D/objects` and `D/index` stay writable, and since #1123 `D/refs`, `D/packed-refs`, `D/HEAD` and `D/worktrees` are refused like the project's own (`gitRefRules` gets the discovered dirs), so commit, branch, tag and rebase fail in a submodule too, and a submodule really named `refs` or `logs` is protected like any other. `hooks` is anchored by path depth (`hooksUnder`), never by an unanchored any-prefix name, which also matched a project under a directory named `hooks`. The worktrees container and each worktree git dir are refused as directory entries too (otherwise an ancestor can be moved out of the protected path, edited and moved back), and so are the discovered git dirs, the modules root and the components in between (rename, replace, symlink, recreate). Keep every regex literal under 1024 bytes (UTF-8 bytes, not characters), and never put the git path and a folded name in one literal: the root is its own `require-all` filter, so the folded literals are the same size at any path length (`test/sandbox.test.ts` asserts it). Known residuals: a nested repository in bare layout (the hub never runs git there; docs/security.md), folded spellings of the components between `.git` and a submodule's git dir on a volume that folds names (the 1024-byte SBPL literal cannot hold a folded path; external git dirs carry the same residual since #270), and the submodules of a repository nested inside the project (only the project's own common dir is discovered). An external git dir's `config`/`config.worktree`/`hooks` rules, and the pattern rules for every linked worktree git dir under `<common>/worktrees/`, cover only its own children plus the hooks directory's contents: at any depth they would deny refs named `config` or `hooks` in a worktree or submodule project. The fold is a group alternation, never a character class (the seatbelt regex engine is byte-oriented and a quantifier after a multi-byte class member binds to its last byte), and every pattern keeps its `^` anchor (an unanchored starred alternation does not match). Folded literals never contain the project root: an SBPL string literal dies at 1024 bytes. The cost: `git init`, `git clone` and `git worktree add` do not run inside the sandbox, and neither do `git worktree remove`, `git worktree prune` of a stale record, `git clean -ffd` with a nested repository, `git submodule update --init` (its git dir's `config` write is refused), or `rm -rf` of a directory holding a `.git`.
12
12
  - The shared object store `<common>/objects` takes only NEW loose objects from a sandboxed command (`objectStoreRules` in `src/local/deny.ts`, #864): every write under `objects/info` (alternates, http-alternates, commit-graph) and `objects/pack` is refused, so are the `objects`, `objects/info` and `objects/pack` entries, the unlink or rename of a fan-out directory, and data, unlink, mode and flags writes to an existing loose object. Keep loose-object creation allowed (sandboxed `git add`, `commit`, `stash` need it) and never reopen packs or `objects/info` for a sandboxed command: git reads packs before loose objects and never rehashes on read, so either one replaces content that every checkout and the #845 host add/commit/push trust. `test/sandbox.test.ts` "(#864)" proves it with the real sandbox-exec. The cost: `git gc`, `repack`, `fetch`, `maintenance` and `commit-graph write` run outside the sandbox. A hardlink to an existing loose object is refused too (into the project and into the command's own temp dir); keep that case in the test. Residual: an object id that does not exist yet can be planted before git writes it; a local checkout then shows the planted bytes, and a push of that commit is rejected by the receiving side, which rehashes what it receives ("missing necessary objects"). The upgrade path is host-side git writes as in #845.
13
- - Build every git invocation outside the sandbox through the single implementation exported by exact-pinned `@staix/agent-mem/platform` (`memoryGitArgv`/`memoryGitEnv`/`memoryGitSync`), re-exported as `hubGitArgv`/`hubGitEnv`/`hubGitSync` by `src/hub/git.ts`. Keep the git export identity, behavior and direct-spawn tripwire checks in `test/hub-git.test.ts` passing; retain home compatibility and Node-safe process-entry checks in `test/memory-parity.test.ts`. The sandboxed git tool in `src/local/tools.ts` retains its own behavior. Use `{ credentials: true }` only for the memory repository the hub creates itself, never a project's repository. Use the core deny policy re-exported by `src/local/deny.ts` for guards, sandbox rules and capture; do not add another denylist.
13
+ - Build every git invocation outside the sandbox through the single implementation exported by the first-party `@staix/agent-mem/platform` entry (`memoryGitArgv`/`memoryGitEnv`/`memoryGitSync`), re-exported as `hubGitArgv`/`hubGitEnv`/`hubGitSync` by `src/hub/git.ts`. Keep the git export identity, behavior and direct-spawn tripwire checks in `test/hub-git.test.ts` passing; retain home compatibility and Node-safe process-entry checks in `test/memory-parity.test.ts`. The sandboxed git tool in `src/local/tools.ts` retains its own behavior. Use `{ credentials: true }` only for the memory repository the hub creates itself, never a project's repository. Use the core deny policy re-exported by `src/local/deny.ts` for guards, sandbox rules and capture; do not add another denylist.
14
14
  - SBPL strings go through `sbplString` (the plain `"..."` form). In the raw `#"..."` form a backslash escapes nothing, so a `"` in a path ends the literal and the whole profile fails to parse.
15
15
  - Seatbelt sees absolute paths, so `local.deny` entries are anchored under the project root.
16
16
  - `guardPath` walks with `lstat`, never `existsSync`, which follows symlinks.
@@ -16,8 +16,9 @@ Scope: the security pass of a review (`REVIEW.md`), and any change under `src/lo
16
16
  ## Agents and messages (companion `agents`)
17
17
 
18
18
  - Every body rendered beside a hub-written header passes `sanitize()` (`src/hub/envelope.ts`). A new render path that skips it lets one agent forge another's header.
19
+ - The Claude channel escapes a leading `/` in every notification body (`channelBody` in `src/adapters/claude-channel.ts`), so a peer's body cannot read as a typed slash command. Keep it on both the single and the digest path.
19
20
  - Hub messages stay untrusted in the receiver's instructions: `STANDING_INSTRUCTION` and `HUB_MESSAGE_INSTRUCTION` (`src/hub/envelope.ts`), the channel instructions (`src/adapters/claude-channel.ts`) and `templates/AGENTS.block.md` say the same thing. A change that weakens one of them weakens all peers of that kind.
20
- - Authority comes from the caller's role, checked in the daemon on every call, never from message text or from which tools a peer was shown: `requireConductor` (`src/hub/conductor.ts`), the planner and reviewer checks in `Tasks` (`src/hub/tasks.ts`). A refusal that must happen before any effect throws `PreEffectToolRefusal` (`src/hub/tool-refusal.ts`).
21
+ - Authority comes from the caller's role, checked in the daemon on every call, never from message text or from which tools a peer was shown: `requireConductor` (`src/hub/conductor.ts`), the planner and reviewer checks in `Tasks` (`src/hub/tasks.ts`). A refusal that must happen before any effect throws `PreEffectToolRefusal` (`src/hub/tool-refusal.ts`). The one exception is instructed execution (#1622): a confirmed person-typed transcript receipt lets an agent run admitted `ahub` forms as the person. Review it against the instructed rules in `daemon.md` and `adapters.md`.
21
22
  - What a model wrote is stored as a model's answer and kept out of later evidence (`src/hub/ask.ts`, `src/hub/inference.ts`). A model label that reaches an event or a record goes through `safeModelLabel` (`src/omniroute/usage.ts`).
22
23
  - Review-observer exclusion is one function, `isReviewObserverExcluded` (`src/hub/memory-policy.ts`); a new memory or telemetry path asks it.
23
24
 
@@ -40,7 +41,7 @@ Scope: the security pass of a review (`REVIEW.md`), and any change under `src/lo
40
41
  - When reviewing Pi dependency preparation, also check the Pi dependencies rule in `docs/agent-notes/adapters.md` and the Pi prepared dependencies section in `docs/security.md`.
41
42
  - Workflow actions are pinned by commit SHA with the version in a comment; `test/workflow-pins.test.ts` refuses a tag. Workflow `permissions` stay at the minimum each job needs (`.github/workflows/`).
42
43
  - The dependency volume key covers everything that decides `node_modules` (`dependencyKey` in `src/hub/check-runner.ts`); a manifest with an install lifecycle script is refused, never keyed. Never add `--ignore-scripts` or a writable shared cache to make a run pass.
43
- - Runtime dependencies stay at zero third-party packages; `@staix/agent-mem` stays exact-pinned.
44
+ - Runtime dependencies stay at zero third-party packages; the first-party `@staix/cli-output` is pinned to an exact version (`scripts/check-package.mjs`), and `@staix/agent-mem` stays on a declared range (`>=X.Y.Z <M.0.0`, floor 0.33.0 or later), so a plain in-range release with a supported host API ships without a hub change and a new major needs a reviewed raise.
44
45
  - Publishing happens only in the tag workflow through trusted publishing; the guarded tag (`scripts/release-tag.ts`) needs the person's consent. A change that adds a token, a second publish path or a way around the consent check is Important.
45
46
 
46
47
  ## A security audit turn
@@ -23,11 +23,12 @@ Scope: the task flow, assignment, the state machine and the hub's MCP tools. Rea
23
23
  - The planner "board changed" notice (#758, only with the lifecycle on) is built from what was added to a card's history since the last scan (`Tasks.groomNotices`, `groomScan`), never from the status revision alone: skip the peer whose own entry it was (`entry.by`), tell only the card's planners (`taskPlanner`, #525-2), send a planning revision or dependency change (a `planning` entry, or `deps` that differ from the last scan whatever wrote them: a propose with `after`, a split) and a card's creation (a peer's propose, a split child, a generated card) at task weight, since new work and its dependencies are what a plan review consolidates, and replace an unsettled copy (`sendGroomNotice` withdraws it by the `The board changed` prefix) so a planner meets the latest revision once, and send state moves, reviews and assignments at `fyi` weight (recorded, no turn), at most once per planner per current `tasks.groom_fyi_window_min` (default `GROOM_FYI_WINDOW_MS`, 10 minutes); read the host config at each notice flush, never capture it at construction. The hub's own bookkeeping entries (`by` is `hub` with no `planning`: lifecycle links, idle sweeps, holds, plan observations) tell nobody and spend no window; a deps change with no new entry has no known author, so no planner is skipped for it. Scan every configured planner, not only the attached ones, so a change made while one was offline is kept for it. The first notice a planner gets after a hub start is task weight. Keep the scan out of the status revision and never read history that is not new.
24
24
  - Planner work-ready notices (#785 P1a, `writePlannerNotices`): a write that can free a reserved owner's WIP or release backlog (done, approval, decline, cancel, backlog return or pull, untouched return, pull undo) takes `capacityBefore` (the `wip()` of the task's owner and reservation) before its board write and calls `writePlannerNotices` after it. Each rostered planner of the task (`taskPlanner`) gets one ids-only `task` envelope starting `Planner work ready:`: `capacity_released: <peer> WIP <n>; reserved ready #<id>|none` for a peer whose WIP dropped, and, when the write approved the task, `backlog_ready: #<id>` for each backlog dependent with nothing left to wait for. Merge the lines of that planner's unsettled copies, read back from `bus.pendingEnvelopes` (they survive a restart; never keep them in memory), withdraw them, then publish, so at most one stays queued per planner; all of it runs inside `releaseNotice`. The notice only wakes the planner: never pull, reserve or assign from it, and never put a title or note in it.
25
25
  - Person-run cards (#1176, `needsPerson` / column `needs_person`): the mark is the person's alone (`planBacklog` refuses an agent that sets or clears it or plans a marked card), and every way an agent could be offered the card checks it: `topReservedReady` (auto pull and the planner notice), the one pull gate in `pullPlanned`, `offerReady`, `releaseReady` (not a stall), `assign()` (pure, before any routing, so `route explain` agrees), `nextSweep`, and the two `plannerWip` queries; and the other doors: `splitBacklog` (agent refused in `Tasks` before and after the screen and in the board transaction; the person's children inherit the mark), `accept` and `acceptReviewed`, `assignTo` for the owner role, `relevant` (drops a queued offer), and `planBacklog` (refuses a mark on an owned card). A new way to offer a card to an agent must check `needsPerson` too; `test/person-run-cards.test.ts` has a mutation-checked test per gate.
26
- - Opt-in auto pull (#785 P1c, `tasks.auto_pull`, `Tasks.queueAutoPulls`, `autoPull`, `topReservedReady`): `writePlannerNotices` collects the peers whose WIP this write lowered and, only when `TasksDeps.autoPull()` is true (read at each release, so a reload applies to the next one), queues one `autoPull(peer)` per peer on a promise chain, so two releases never pick the same card and each job re-reads the board. It takes the top backlog card explicitly reserved for that peer (`topReservedReady(peer, undefined, true)`, the rule the notice's `reserved ready #id` line also uses; never an unreserved card, never PII, which `topReservedReady` skips for a pull), finds the card's own planner of record (`taskPlanner(card)[0]`, which must be rostered) and calls `pullPlanned(HUB, input, { onBehalfOf: planner })`. `onBehalfOf` is accepted only with `by === HUB`; the planner's authority is what `planningAuthority` checks, the actor in history and the planning telemetry stays `hub`, and the planner binding records the planner it acted for. Every other check is `pullPlanned`'s own, unchanged, and a refusal is one console notice with the public title (never detail). A held or recovering hub, a storage error or the setting off pulls nothing, and that is checked twice: at entry and again by `pullPlanned`'s `opts.guard` (`autoPullAdmitted`) wherever authority is rechecked, which includes right before the assignment or board write after the awaited PII screen and `planReviewGap`, so turning the setting off or starting recovery or shutdown mid-admission writes nothing and reports nothing. `autoPullsPending()` counts queued and running pulls and `recoveryReady` waits for it (also named in the recovery view's blockers), as it does for `checksPending`. The key is in `ALL_MACHINE_LOCAL` (`config-trust.ts`) so a committed config is ignored for it, and it is not in `CONDUCTOR_SETTING_KEYS`: an agent never turns it on. Never add a timer or sweep that pulls. Also queue the reserved peer after backlog planning changes eligibility, after a dependency approval readies its backlog card, and when an idle peer is registered or first becomes idle after registration; use the same serialized admission and recheck once per attachment.
26
+ - Opt-in auto pull (#785 P1c, `tasks.auto_pull`, `Tasks.queueAutoPulls`, `autoPull`, `topReservedReady`): `writePlannerNotices` collects the peers whose WIP this write lowered and, only when `TasksDeps.autoPull()` is true (read at each release, so a reload applies to the next one), queues one `autoPull(peer)` per peer on a promise chain, so two releases never pick the same card and each job re-reads the board. It takes the top backlog card explicitly reserved for that peer (`topReservedReady(peer, undefined, true)`, the rule the notice's `reserved ready #id` line also uses; never an unreserved card, never PII, which `topReservedReady` skips for a pull), finds the card's own planner of record (`taskPlanner(card)[0]`, which must be rostered) and calls `pullPlanned(HUB, input, { onBehalfOf: planner })`. `onBehalfOf` is accepted only with `by === HUB`; the planner's authority is what `planningAuthority` checks, the actor in history and the planning telemetry stays `hub`, and the planner binding records the planner it acted for. Every other check is `pullPlanned`'s own, unchanged, and a refusal is one console notice with the public title (never detail). A held or recovering hub, a storage error or the setting off pulls nothing, and that is checked twice: at entry and again by `pullPlanned`'s `opts.guard` (`autoPullAdmitted`) wherever authority is rechecked, which includes right before the assignment or board write after the awaited PII screen and `planReviewGap`, so turning the setting off or starting recovery or shutdown mid-admission writes nothing and reports nothing. `autoPullsPending()` counts queued and running pulls and `recoveryReady` waits for it (also named in the recovery view's blockers), as it does for `checksPending`. The key is in `ALL_MACHINE_LOCAL` (`config-trust.ts`) so a committed config is ignored for it, and it is not in `CONDUCTOR_SETTING_KEYS`: an agent never turns it on. Never add a timer or sweep that pulls. Also queue the reserved peer after backlog planning changes eligibility, after a dependency approval readies its backlog card, and when an idle peer is registered or first becomes idle after registration; use the same serialized admission and recheck once per attachment. Automatic distribution (#1626): `assignOwner` excludes peers at their WIP cap, with a held queue or backing off after a capacity decline for every owner choice the hub makes without a named owner (`hubOfferFull`, counting `readyInFlight` and `pendingClaims` like `reservedHold`); a person's or conductor's explicit assignment, a claim and a roster move are unchanged. `capacityBackoff` is in memory by design (a restart reattaches peers idle, which ends it) and ends at the peer's next idle state. A capacity decline of a pulled card goes back to backlog with its reservation through the untouched-return path; a plain decline clears it. When `topReservedReady` finds nothing, `fillSlot` offers the first ready unowned `proposed` task through `assignOwner` with that peer as the only candidate, one per trigger on the `autoPulls` chain. Never offer a peer a task it would have to refuse.
27
27
  - Bounded waits (#1454, `Tasks.wait`, `taskWait`, `hub_task_wait`): a wait is one quiet `wait recorded` history entry with `wait: {until, owner}` and the public reason as its note, never a column or a second write. `taskWait` (`src/hub/task-sweep.ts`) parses whether the latest wait remains in force from history alone (latest wait entry names the current owner, nothing state-changing after it); callers use that result for idle-sweep timing and to surface an expired wait as `wait-passed` in planner grooming. A new event that must not end a wait joins `WAIT_KEEPING_EVENTS` beside its `QUIET_EVENTS` line. `nextSweep` reads it for `idle-owner` only; never let it touch `review-pending`, `unaccepted-assignment` or `ready-unassigned`. The tool is published only while `task_sweep.enabled` (`profileTaskTools(..., wait)`, status field `taskWait`), and `Tasks.wait` refuses with the same condition, so sweep off changes no tool list. Refusals are `PreEffectToolRefusal` naming cause and next step; the reason is screened and refused, not cut, on an ordinary task.
28
28
  - Planned start (#1092): `plannedStartPending` (`src/hub/task-sweep.ts`) is the only test that a card's `plannedStart` is still ahead. Every automatic path skips such a card: dependent readiness, `backlog_ready` notices, the reserved-ready pick, auto pull and its `guard`, a hub-actor (`by === HUB`) offer, pull or assign of an ownerless backlog or proposed card, and the idle sweep. The planner digest shows it as `scheduled`. A new automatic path asks it too.
29
29
  - Per-head CI watcher (#785 P1b, `src/hub/ci-watch.ts`, `Tasks.watchCi`, `ciCompleted`, `reofferHeldReview`): when a `done` leaves a review whose admission was not ready at the task's exact full-commit head (or a review is held as premature in `sendReview`), `CiWatchers` starts at most one watcher per task and head, with chained unref'd `setTimeout`s and no interval. Each poll is one `gh pr view` through the `sdlc.gh` port (`pollCi`); `latestCheckRuns` drops older rows only when a same-name check has the same workflow identity and a unique latest start time, otherwise duplicate evidence remains. A cancelled check and a draft PR's deliberately deferred `check (macos-latest)` failure are pending, not failed, and so is an older macOS aggregate failure while a newer same-workflow `check (macos-latest) shard N/M` is queued or in progress with a later start (`awaitingDeferredReplacement`, #1490); missing ordering or workflow evidence stays a failure; other required failures remain failures. It ends on a passed result for the required checks, on `CI_WATCH_DEADLINE_MS`, on `stopCiWatchers` (daemon `stopOnce`), or silently when `ciWatchCurrent` fails (the task left `in_review`, its head or PR changed, the lifecycle is off, it turned private). `complete`, `review` (both verdict writes) and `cancel` cancel it. Each (head, outcome) is told once (`settled`), and only `passed` settles a head for good (#540): after `failed` or `incomplete` the watcher keeps reading for a rerun of that head (the first pending read after each newly told result is a new run attempt and renews the deadline once; later pending or unreadable reads and an unchanged failed result never renew it, so the watcher always ends; a deadline after a told result ends silently), and a later `hub_task_done` at that head starts one again. A newer head replaces the watcher. The result is one ids-only `ci_completed:` task envelope at `status` weight to the owner and the reviewer (`fyi` is never delivered to a peer, so it would not reach them), a console notice for `user`, and for a deadline a console notice only. A passed or incomplete result re-offers a review held as premature once (`heldReviews`, keyed by task, head, reviewer and review revision) after a fresh `reviewRequestAdmission` says ready; a failed one re-offers nothing. No task text goes in the notice, no PII task is watched, and nothing is restored after a hub restart (the next `hub_task_done` starts one). Never add a second periodic gh read outside this watcher.
30
30
  - Required checks (#1344): resolve the names only through `requiredChecksFor` / `requiredCheckNames` (`src/hub/sdlc-merge.ts`, `src/hub/sdlc.ts`); the built-in `check (...)` and `seeded guards` set applies only to this repository, and an empty set elsewhere is a `required checks unknown` blocker, never a pass.
31
+ - Draft review (#1576): admit the failed macOS aggregate only with exact-head job-step proof of its draft deferral, a matching fresh PR snapshot and every other required check green. Only on that proven draft may approval defer missing GitHub approval and known outstanding review requests; preserve change-request and unresolved-thread blockers. Never treat that admission as a successful full gate or weaken merge and identical-tree proof.
31
32
  - Build-entry guidance (#1354, `buildEntryDiagnostic` in `src/hub/build-entry.ts`) is pure display data: routing and `route explain` may show it but never read GitHub or change eligibility because of it.
32
33
  - Merge adoption (#1348, `ahub sdlc adopt-merge`, `Tasks.adoptMerge`): only the person or the one configured conductor adopts an already merged PR; it writes `approved` with the `merged outside the hub` event and creates no reviewer verdict, review metric, reviewed-head receipt, guarded-merge result or GitHub mutation, and a private task or turn refuses before any GitHub read. Its bounded GraphQL check read uses `latestCheckRuns`: discard an older same-name row only when workflow identity and a unique latest start time prove which run is newest; preserve duplicate evidence when ordering is uncertain. Contract: `docs/design/task-board.md` "Merged PR adoption".
33
34
  - External merge readback (#1555, `Tasks.captureExternalMerge`, `settleMergeReadbacks`): host-only and read-only on GitHub, for an approved non-PII task whose repository merge mode is `off`. It writes `sdlc.mergeReadback` with the `merge observed` event and never `sdlc.merge`, a verdict or a GitHub mutation. Save `cost` only from a complete history read, and recheck the task, receipt and policy identity after every await before the write.
@@ -42,6 +43,8 @@ Scope: the task flow, assignment, the state machine and the hub's MCP tools. Rea
42
43
  - Conductor authority requires the explicit unique role before capability checks. The only exceptions run before that check in `Conductor.execute` and stay task-scoped: a task's current owner and reviewer read it with `hub_task_show` (#208; a reviewer-backend peer only during its bound review, rule below), and its proposer redirects it with `hub_task_assign` while nobody ever accepted it and no person moved it (#207). Removing them strands reviewers that missed a review request. Assignments preserve the acting peer. A peer releases only its own conductor hold; operator release and manual, quota and recovery holds remain separate paths.
43
44
  - The PII screen (#198) runs in `propose` before anything else reads the task (no board row, envelope, triage or brief before its verdict), and `unknown` is PII. A call that screens free text (`done`, `review`, `remember`) screens only after its own checks pass, and `done` and `review` run them again after the awaited screen, because the task can change meanwhile. A history entry marked `withheld` stays withheld in public views, completed notices and review requests, whatever `nameable()` says; `ahub ask` shows it only on campus, like a note that matches a PII pattern.
44
45
  - `taskOp` (`src/hub/daemon.ts`) lists full PII rows only when `onPrem` holds: an in-process peer whose definition sets `trust.onPrem` (only the local worker) inside a PII turn (#230). Every other caller, the local worker's ordinary turns included, gets stubs. `assign()` (`src/hub/routing.ts`) is the PII gate: it admits PII work only for `trust.onPrem`, and an unknown id is never on-prem. `relayCandidates` only orders the preferred handoff peers by the same field; never treat its order as the gate.
46
+ - A roadmap part accepted with `ahub roadmap decompose <id> --accept <part>` is the person's own intake hold, not a second state: `Tasks.roadmapDecomposePart` stages a `draft` backlog task through `propose` with the host Symbol `HOST_ROADMAP_DRAFT`, links it as a milestone `task`, and keys it by (answer, part) in `milestone_decomposition_accepts`, so a repeat returns the same draft. That Symbol is the only way a non-person stages a draft, and it still needs `backlog` and the configured planner or conductor; releasing it stays `ahub intake approve`, and the reply is `publicView`, so a private part reads `[pii]`. The accept is single-flight per (answer, part) through `decompositionAccepts`, so a concurrent accept reads the first one's row instead of making a second draft, and everything after `propose` runs through `releaseNotice`: never add a bare call to that tail, or a settled milestone would refuse a caller whose draft is already saved.
47
+ - A decomposition part reaches GitHub only from a preview: `ahub roadmap decompose <id> --publish` plans one `POST repos/<repo>/issues` per held `spec` part and writes nothing, and `--apply --confirm <fingerprint>` runs that exact plan behind `roadmapApplyAuthority` (`roadmap.github_write`), recording `milestone_decomposition_publishes` so a second apply creates nothing. The repo is `roadmapRepository()` (host-sampled, never an argument), the membership field is `milestoneMembershipField()`, the one construction `planRoadmapMirror` PATCHes, so no second link path exists, and the created issue is then linked as a milestone `issue` or `roadmapSync` would plan to detach it. `task` parts, released drafts and private parts get no issue (a private one is counted in `skippedPrivate` and never named), and everything after a successful create runs through `releaseNotice`, so a refused `gh` call leaves the draft held with nothing linked. One apply runs per milestone at a time (`roadmapPublishes`): a retried call whose first attempt is still creating is refused with the cause and the next step, and each create re-reads `decompositionPublish` first, because `INSERT OR IGNORE` would hide the duplicate row while GitHub kept both issues.
45
48
  - `review()` reads `escalateAfter()` (`tasks.escalate_after`, 1-10, default `ESCALATE_AFTER` = 3) at each `changes_requested` verdict, so a reload applies from the next verdict; never capture it at construction or compare against a literal (#488).
46
49
  - A guard in `tasks.ts` or `conductor.ts` passes `preEffect` (throws `PreEffectToolRefusal`, `src/hub/tool-refusal.ts`) only before the operation's first board or hold write; a throw after a write, a readback failure or a wrapped error stays a plain `Error` (#254). The Pi side of the rule is in `adapters.md`.
47
50
  - Supervision reasons use structured enums, never history notes, check output or approval titles. Round signatures survive restart; later summaries count only newly joined tasks.
@@ -115,6 +118,7 @@ Scope: the task flow, assignment, the state machine and the hub's MCP tools. Rea
115
118
 
116
119
  - Planner walk and reviewer independence (#525-3): `plannerWalk` and `implementers` in `src/hub/routing.ts` are pure; the planner is chosen only inside `assign()` (`planners`, `namedPlanner`, `keptPlanner` in, `Assignment.planner`/`plannerReason` out), and `Tasks` never picks one outside it. `Tasks.weights()` is the one place `planners` is built (rostered holders of `d.roles`, sorted), so every `assign()` path and `explain` agree. Pass a bound task as `keptPlanner` to that same walk: its explanation names the binding as `kept`; drafts and legacy null bindings still rotate, and explanation never writes a binding or history. Rotation is `task.id mod n` over every holder and is never renumbered by availability; a named planner is exact and never replaced. I-2 (`implemented this task`) lives in `blocked()` for the reviewer role as its last capability/independence check before queue admission, so the legacy, named and pool paths share it and it only ever removes an otherwise eligible candidate; when I-2 removed every otherwise eligible reviewer, the person reviews with `reviewBlocked`, never an implementer.
117
120
  - Owned implementer child (#747): `propose`, `acceptReviewed`, `done` (through `complete()`), `recordSdlc`, `review` (in `valid()`), `correct` and `remember` take `requestCheck(by)` (`TasksDeps.requestAuthority`) at entry and call it after every await, before the next write; a new await on those paths adds a call, and its refusal stays pre-effect. The child's tool surface is the fixed `IMPLEMENTER_HUB_TOOL_NAMES` (`src/hub/hub-tools.ts`); never widen it from project roles.
121
+ - Instructed execution (#1622): a Tasks write reached by an instructed form runs as `user`, and `requestCheck(by)` then rechecks that the instruction is current. Call it after every await, before the next write. Every history entry that write adds spreads `instructedHistory(by)`.
118
122
  - Shell branch binding (#845, `Tasks.bindShellBranch`): the daemon's host shell wrapper path is its only caller, and it is the only writer of the hub's `shell branch bound` entry (the branch and a sha256 of the worktree root, setting `refs.branch` in the same write). It binds only for the current owner of an `in_progress` or `changes_requested` non-PII task in this project's repository, outside a private turn, whose verified execution root (`TasksDeps.executionRoot`) is not the project root and is the binding's worktree. It refuses a branch that differs from an earlier binding or from `refs.branch`, or that another open task in the same repository holds, and rechecks `current()`, the private turn and the flow revision right before the write. Every failure returns `false` (no grant), never a throw. It records host-observed evidence, never a branch a tool call claims, and grants no execution by itself. The entry is in `QUIET_EVENTS`: it neither moves nor settles the task, so it never makes a running check's result late, supersedes an assignment or counts as a move for review admission (#880).
119
123
  - Invocation audit (#991, `Tasks.recordInvocation`): the daemon's invocation admission and `finishInvocation` are its only callers; no hub tool reaches it. The `invocation` history entry carries host-owned metadata only (`InvocationHistory`: ids, caller, target, capability, digest, class, approval, `argsSha256`, outcome), never arguments or results, because `publicView` copies it unscreened. At `queued` it rechecks task scope (non-PII task and turn, open and not backlog, caller is owner or reviewer), and a failed audit refuses the invocation before it runs; never catch that and proceed. The entry is in `QUIET_EVENTS`: it neither moves nor settles the task.
120
124
  - Deliverables (#509a, `src/hub/deliverables.ts`, `src/hub/deliverable-files.ts`): the hub hashes each file itself under the owner's verified execution root (`TasksDeps.executionRoot`, the daemon's `ownerWriteRoot`; an unproven root refuses); never accept a caller's hash, size or unknown field. Vet and hash before any board write and refuse pre-effect; a `done (checking)` carries its records to `complete()`, never a later read. An approval rereads the delivered files: a reviewer's verdict is refused before any write unless every file is `unchanged`, and only the person approves moved files, which are rehashed and named in the note. A file the hub cannot read or vouch for is `unknown`, never `unchanged`. Peer-facing records go through `publicDeliverables`: for a PII task or a `pii.paths` file, id, hash and size only.
@@ -131,7 +135,7 @@ Scope: the task flow, assignment, the state machine and the hub's MCP tools. Rea
131
135
  - Declared needs (#1081, 2026-11-02): `needs_network` and `needs_worktree` are task signals set only by an explicit `true` in `Tasks.propose` (never inferred from text). `assign()` in `routing.ts` reads each as a refusal code (`network`, `worktree`) against `PeerCapabilities.network` / `.worktree === false`, and `Tasks.declaredNeedCheck` repeats both at accept, before any write: that check is what stops a sandboxed peer from accepting work, failing at `git worktree add` (#270) and leaving an empty branch ref (#621, #565). `peerCapabilities` in `daemon.ts` is the only producer: unsandboxed peers are `true` for both, hub-sandboxed peers have `worktree` from `TaskWorktrees.available()` (#1115: true only where the hub can make the worktree, else false with its cause and next step) and `network` from `sandboxNetwork !== false` (the one `local.bash_network` setting). Unknown (no entry) is never a refusal. Keep the four lists together when you add a need: `RoutingRefusalCode`, `TASK_STALL_CODES`, the `requireCapabilities` filter and `declaredNeedCheck`.
132
136
  - Hub-made task worktree (#1115, 2026-11-02, `src/hub/task-worktree.ts`): `Tasks.accept` calls `hubWorktreeFor` right before `acceptanceCapacity` and the accept write, only for a hub-sandboxed owner (`TaskWorktrees.applies`), a non-PII task, and write-class work (`writesRepository(task.class)` in `routing.ts`: `implement` and `bulk_edit`, #1129) or a declared `needs_worktree`, and clears it again (`undoWorktree`) when anything throws before the write. `Tasks.decline` and `Tasks.cancel` call `releaseHubWorktree` after their board write. The daemon's `hub_task_done` case calls `tasks.worktreeHandoff` BEFORE `tasks.done` and passes its `{ commit, branch }` refs on, so `Tasks.done` itself is untouched and its head gates see an ordinary full-SHA refile; keep the hook out of `done`. The sandbox profile is not changed by this hook. Since #1123 it refuses ref, HEAD, packed-refs and worktree-admin writes, so a sandboxed peer cannot commit at all and the hub's commit is the only one; still never trust what is under `.git`, and commit only when the branch tip equals the recorded base or the hub's own last commit (the record lives in `<state>/task-worktrees.json`, which no sandbox root contains), because a rule can be loosened later and a same-user process is outside the sandbox. Since #1129 the hook covers every write-class task, so a hub-sandboxed owner of `implement` or `bulk_edit` work always has a hub worktree and a hub commit; keep `writesRepository` the one definition that routing and `Tasks` both read.
133
137
  - Focused-check dependency preparation (#1447): after a task is accepted, the hub may prepare the task worktree's dependencies and report a fixed prepared/not-prepared result in that owner's task context. Preparation is advisory; do not treat it as a check result or replace the remote/full verification gates.
134
- - Roadmap milestones and placement (#1479/#1481): `docs/design/roadmap.md` is the contract. `Board` stores rows and links; every external write goes through `Tasks` with revision and privacy checks. Triage suggestions are inert until accepted; GitHub import is person-only and dry-run by default. Keep private membership count-only and preserve the recovery compatibility check.
138
+ - Roadmap milestones and placement (#1479/#1481): `docs/design/roadmap.md` is the contract. `Board` stores rows and links; every external write goes through `Tasks` with revision and privacy checks. Triage suggestions are inert until accepted; GitHub import is person-only and dry-run by default. A decomposition (#1480 R2 part 1) is inert too: a part is kept only when it cites an id the prompt offered, and nothing reads `milestone_decompositions` until a later R2 part intakes one. Keep private membership count-only and preserve the recovery compatibility check.
135
139
  - Pi step-ceiling escalation (#1447): `step_limit` is a distinct task-move reason from `inference_failed`; only a settled ceiling can receive the bounded, acceptance/session-bound continuation. See the dogfood row for coverage and live-proof limits.
136
140
  - Paged `hub_task_list` (#1083, 2026-11-02, `src/hub/task-list-page.ts`, the `hub_task_list` case in `daemon.ts`): an agent (`by !== USER`) always gets `{tasks, total, next?}` and the console gets the bare array unless it names `limit`, `cursor`, `ids` or `detail`; keep that split, because `ahub board`/`ahub tasks` and `test/cli-json-guard.test.ts` read the array. Build every row with the existing `listRow` (it starts from `tasks.publicView`, so PII stays a stub and the `board-column-started-projection` seed text is unchanged) and only then reduce it with `compactRow`; never build a compact row from the raw `Task`. The cursor is a keyset (`updated.id`), not an offset. A new caller of `hub_task_list` as a peer reads `.tasks`, or passes `ids` for one task. Do not raise the 200 cap or the default 50 without re-running the 600-task size test.
137
141
  - Urgent accept and the WIP refusal (#1080, 2026-11-02): `acceptanceCapacity` takes an `urgent` mode, and only `accept` passes `"displace"`; `acceptReviewed` and the early check in `accept` pass `"check"`, which never writes. `displaceOffers` runs immediately before the accept write, after every gate (spec, plan, study), so a refused accept can never have taken back an offer. It takes back only offers the owner never accepted (`displaceable`: state proposed, owned, not pinned, not urgent, no `taskHasStarted`), newest handed first, and only as many as the limit needs; if they are not enough it takes none and refuses. The refusal comes from `wipSplit` and names accepted, offered and reserved separately, with a next step. Do not widen `displaceable` to accepted or urgent work, and do not call the displace mode from any other path.