@staix/agent-hub 0.45.0 → 0.46.1

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 (108) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +10 -4
  3. package/docs/adding-an-ai-tool.md +1 -0
  4. package/docs/agent-notes/adapters.md +33 -4
  5. package/docs/agent-notes/budget.md +2 -1
  6. package/docs/agent-notes/daemon.md +5 -1
  7. package/docs/agent-notes/security-review.md +3 -2
  8. package/docs/agent-notes/tasks.md +3 -1
  9. package/docs/agent-notes/tests.md +1 -1
  10. package/docs/design/adapters.md +16 -0
  11. package/docs/design/agent-hub-architecture.md +12 -0
  12. package/docs/design/cli-output.md +2 -0
  13. package/docs/design/roadmap.md +86 -5
  14. package/docs/design/task-board.md +2 -2
  15. package/docs/dogfood.md +15 -0
  16. package/docs/events.md +2 -2
  17. package/docs/operations.md +103 -21
  18. package/docs/quickstart.md +15 -3
  19. package/docs/security.md +7 -5
  20. package/docs/smoke.md +1 -1
  21. package/docs/verification/2026-11-05-hardcoded-values-classification-rules.md +28 -0
  22. package/docs/verification/2026-11-22-agy-1.5.14.md +27 -0
  23. package/docs/verification/2026-11-22-claude-instruction-hook.md +35 -0
  24. package/docs/verification/2026-11-22-instructed-ipc.md +9 -0
  25. package/docs/verification/2026-11-22-jcode-1.0.3.md +71 -0
  26. package/docs/verification/2026-11-22-jcode-separate-home.md +14 -0
  27. package/docs/verification/2026-11-22-qwen-0283-acp.md +28 -0
  28. package/docs/verification/2026-11-22-qwen-0283-dual-output.md +33 -0
  29. package/docs/verification/2026-11-22-roadmap-r5-view-receipt.md +63 -0
  30. package/docs/verification/2026-11-23-0.46.0.md +44 -0
  31. package/docs/verification/2026-11-24-0.46.1.md +48 -0
  32. package/docs/verification/assets/1483-r5-detail-1440-light.png +0 -0
  33. package/docs/verification/assets/1483-r5-detail-390-light.png +0 -0
  34. package/docs/verification/assets/1483-r5-view-1440-dark.png +0 -0
  35. package/docs/verification/assets/1483-r5-view-1440-light.png +0 -0
  36. package/docs/verification/assets/1483-r5-view-390-dark.png +0 -0
  37. package/docs/verification/assets/1483-r5-view-390-light.png +0 -0
  38. package/docs/verification/assets/1483-r5-view-820-dark.png +0 -0
  39. package/docs/verification/assets/1483-r5-view-820-light.png +0 -0
  40. package/docs/verified.json +23 -23
  41. package/package.json +3 -2
  42. package/plugins/agent-hub/.claude-plugin/plugin.json +1 -1
  43. package/plugins/agent-hub/kimi-hook.js +6053 -5509
  44. package/plugins/agent-hub/server.js +1300 -1087
  45. package/plugins/agent-hub/skills/ahub/SKILL.md +17 -0
  46. package/plugins/agent-hub/skills/ahub-manage/SKILL.md +37 -0
  47. package/plugins/agent-hub/skills/ahub-status/SKILL.md +14 -0
  48. package/plugins/agent-hub/skills/ahub-use/SKILL.md +12 -0
  49. package/src/adapters/claude-channel.ts +2 -1
  50. package/src/adapters/compat.ts +12 -11
  51. package/src/adapters/definitions/native-cli-claude-setup.ts +9 -1
  52. package/src/adapters/definitions/native-cli-doctor.ts +8 -5
  53. package/src/adapters/definitions/native-cli-jcode-home-init.ts +158 -0
  54. package/src/adapters/definitions/native-cli-jcode-home.ts +72 -0
  55. package/src/adapters/definitions/native-cli-jcode-mcp.ts +20 -0
  56. package/src/adapters/definitions/native-cli-skills.ts +29 -0
  57. package/src/cli/claude-profile-hook.ts +40 -3
  58. package/src/cli/console-state.ts +55 -26
  59. package/src/cli/console-usage.ts +5 -3
  60. package/src/cli/console.ts +35 -4
  61. package/src/cli/help.ts +15 -10
  62. package/src/cli/identity.ts +2 -1
  63. package/src/cli/instruction-hook.ts +28 -0
  64. package/src/cli/jcode-mcp.ts +2 -1
  65. package/src/cli/main.js +8 -0
  66. package/src/cli/main.ts +138 -18
  67. package/src/cli/output-standard.ts +3 -55
  68. package/src/cli/output.ts +8 -2
  69. package/src/cli/recovery-package.ts +53 -12
  70. package/src/cli/roadmap.ts +37 -3
  71. package/src/cli/setup-homes.ts +1 -0
  72. package/src/cli/setup.ts +1 -1
  73. package/src/cli/skills-install.ts +463 -0
  74. package/src/cli/task-output.ts +1 -1
  75. package/src/cli/upgrade-presentation-flags.ts +1 -1
  76. package/src/hub/board.ts +42 -4
  77. package/src/hub/budget-projection.ts +99 -0
  78. package/src/hub/claude-launch-proof.ts +5 -1
  79. package/src/hub/conductor.ts +8 -3
  80. package/src/hub/config-apply.ts +3 -2
  81. package/src/hub/config-tier.ts +1 -1
  82. package/src/hub/config-trust.ts +1 -1
  83. package/src/hub/control-client.ts +9 -2
  84. package/src/hub/daemon.ts +457 -26
  85. package/src/hub/events.ts +1 -1
  86. package/src/hub/execution-budget.ts +29 -8
  87. package/src/hub/hub-tools.ts +2 -2
  88. package/src/hub/inference.ts +1 -1
  89. package/src/hub/instances.ts +10 -1
  90. package/src/hub/instructed-exact.ts +95 -0
  91. package/src/hub/instructed-intent.ts +64 -0
  92. package/src/hub/instructed-ipc.ts +33 -0
  93. package/src/hub/instructed-runtime.ts +19 -0
  94. package/src/hub/instruction-receipt.ts +218 -0
  95. package/src/hub/manager.ts +46 -3
  96. package/src/hub/registry.ts +1 -1
  97. package/src/hub/roadmap-decompose.ts +60 -1
  98. package/src/hub/roadmap-sync.ts +2 -2
  99. package/src/hub/roadmap.ts +19 -1
  100. package/src/hub/routing.ts +18 -1
  101. package/src/hub/runtime-capture-prune.ts +2 -1
  102. package/src/hub/settings.ts +2 -1
  103. package/src/hub/tasks.ts +194 -12
  104. package/src/hub/ui.ts +6 -2
  105. package/src/hub/usage-rollup.ts +42 -2
  106. package/src/ui/index.html +342 -8
  107. package/src/ui/plugin.ts +6 -2
  108. package/src/ui/roadmap-model.ts +70 -0
package/CHANGELOG.md CHANGED
@@ -4,6 +4,38 @@ 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.1
8
+
9
+ - Resolve `@staix/agent-mem` 0.38.0 in `bun.lock` so the repository's tests and CI run on the version a fresh install resolves; the declared range `>=0.33.0 <1.0.0` is unchanged. The recovery package refuses a ranged `@staix/cli-output` pin with the output message again when agent-mem declares it. Refs #1664, hub task 1084.
10
+
11
+ - Let the recovery package accept agent-mem 0.37.0 and later, which declares exactly the pinned `@staix/cli-output`, so `ahub upgrade`, restart staging and conductor recovery work on a fresh install; any other dependency, a range or a nested `node_modules` is still refused. Closes #1664, hub task 1083.
12
+
13
+ ## 0.46.0
14
+
15
+ - 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.
16
+ - 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.
17
+ - 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.
18
+ - 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.
19
+ - 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.
20
+ - 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.
21
+ - 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.
22
+ - 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.
23
+ - Allow explicitly classified intent commands from a confirmed managed Claude instruction, with literal-id verdict checks and a ten-operation receipt bound. Refs #1622.
24
+ - 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.
25
+ - 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.
26
+ - Record hash-only pending Claude instruction evidence and confirm it against the bound native transcript; it grants no command authority. Refs #1622.
27
+ - `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.
28
+ - 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).
29
+ - Add Claude plugin skills for hub status, management, use and person-run commands, with a doctor check. Refs #1622.
30
+ - 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).
31
+ - 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).
32
+ - 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).
33
+ - 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).
34
+ - 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).
35
+ - 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).
36
+ - 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).
37
+ - 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).
38
+
7
39
  ## 0.45.0
8
40
 
9
41
  - 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.
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.45.0, control protocol 17 (accepts 16). Bun + TypeScript, one loopback daemon per
8
+ Status: 0.46.1, 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.
@@ -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
@@ -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.
@@ -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 hub's declared `@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. agent-mem may declare only `@staix/cli-output` at the hub's exact pin (0.37.0 and later do); refuse any other entry, a range, or a nested `node_modules` under agent-mem, because the digest hashes only the shared top-level copy (#1664).
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"`.
@@ -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 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
+ - 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,7 +23,7 @@ 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.
@@ -44,6 +44,7 @@ Scope: the task flow, assignment, the state machine and the hub's MCP tools. Rea
44
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.
45
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
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.
47
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).
48
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`.
49
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.
@@ -117,6 +118,7 @@ Scope: the task flow, assignment, the state machine and the hub's MCP tools. Rea
117
118
 
118
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.
119
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)`.
120
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).
121
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.
122
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.
@@ -51,7 +51,7 @@ Scope: tests, fakes and the test gate. Read before adding or changing a test or
51
51
  - A daemon test of a tool that reaches a public host passes the host-only transport seam (`DaemonOptions.webFetchTransport`, #553) and asserts what the daemon handed the tool, never a real round trip or a longer wait. The tool, the proxy URL and the allowlist stay the daemon's own; only the request is replaced. The proxy's own behaviour has its tests in `test/proxy.test.ts` and the web-proxy block of `test/web-fetch.test.ts`.
52
52
  - The preload leaves `HOME` unchanged and clears inherited `CLAUDE_CONFIG_DIR` and `CODEX_HOME`; tests that need fixture selectors set them after preload. A test that spawns `ahub setup`, `ahub autonomy` or `ahub init` under machine defaults, or reaches `discoverClaudeHomes` or the profile hook, sets `HOME`, `CLAUDE_CONFIG_DIR`, `AGENTHUB_HOME` and `AMEM_HOME` to temp directories, as `test/autonomy-machine-cli.test.ts` does; unit tests pass `{ home, env }` instead of `process.env`. A test that runs `ahub doctor` through the CLI also sets `CODEX_HOME` to a temp directory and puts a fake `amem` first on PATH, because doctor runs `amem setup <tool> --json` (#1025, `test/doctor-memory-capture.test.ts`).
53
53
  - The `@staix/agent-mem` dependency is a declared range (`>=X.Y.Z <M.0.0`), so tests read the installed release (`import.meta.resolve` plus its `package.json`) instead of a literal: `test/memory.test.ts`, `test/memory-profile.test.ts`, `test/memory-profile-daemon.test.ts`, `test/doctor-model-aliases.test.ts` and the recovery-package fixtures derive their expected version that way, and a range raise moves only `package.json` and `bun.lock`. Any other test edit in a range raise adapts a fixture to a changed package contract (an index file name, a transport read before screening) with a comment naming the package version; never weaken an assertion to pass a raise. A test that names a package file reads the name from what the store creates (`indexFileOf` in `test/memory-store.test.ts`), never a fixed `index.db`.
54
- - `test/fixtures/release-n-1` and `test/fixtures/protocol-v16` are separately exact-locked published packages (own `bun.lock`, installed by `scripts/check.sh`), never root dependencies, and `PUBLISHED_FIXTURES` in `test/published-protocol-compat.test.ts` pins their versions and compatibility metadata. In a minor release PR, retarget release N-1 to the latest stable patch of the preceding minor together with the version bump; update its package manifest, lockfile and `PUBLISHED_FIXTURES` row, including the exact amem dependency and protocol read from the published package (AGENTS.md Releasing step 1, procedure in `docs/operations.md` #1164). The guard requires the fixture minor to be the package minor minus one. protocol-v16 stays at its version while protocol 16 is promised (#1168).
54
+ - `test/fixtures/release-n-1` and `test/fixtures/protocol-v16` are separately exact-locked published packages (own `bun.lock`, installed by `scripts/check.sh`), never root dependencies, and `PUBLISHED_FIXTURES` in `test/published-protocol-compat.test.ts` pins their versions and compatibility metadata. In a minor release PR, retarget release N-1 to the latest stable patch of the preceding minor together with the version bump; update its package manifest (an `overrides` entry pins amem to an exact version when the published package declares a range), lockfile and `PUBLISHED_FIXTURES` row, with `memoryRange` as the published package declares it, `memoryVersion` as the fixture lock resolves it, and the protocol read from the published package (AGENTS.md Releasing step 1, procedure in `docs/operations.md` #1164). The guard requires the fixture minor to be the package minor minus one. protocol-v16 stays at its version while protocol 16 is promised (#1168).
55
55
  - Keep CI's Bun version sourced from `.bun-version` through the pinned setup-bun action; update the version file rather than adding per-job version literals.
56
56
  - Release verification requires both OS checks and the aggregate `seeded guards` success for an identical tree, a tag matching `package.json` on `origin/main`, and fresh ancestor-bound documentation stamps. Preserve the separate npm OIDC publish job and GitHub Release write job; neither job gets the other's credential authority.
57
57
  - `test/conformance/` runs real adapters against fake transports. The shared kit and the transport fakes live in `src/adapters/conformance/` (public `@staix/agent-hub/conformance`); `test/conformance/kit.ts` and the matching `test/fakes/*.ts` only re-export them, so change the packaged file, and `--changed` runs everything for it; `test/conformance/enrollment.ts` enrolls every `ADAPTERS` definition, each `:reviewer` variant and each `:implementer` (`headlessVariant`) variant. Record a case that does not apply in its `UNSUPPORTED` or `UNSUPPORTED_LEGS` map with a concrete reason naming the dedicated coverage, never `test.skip` or synthetic success, and never change native production behavior to satisfy a generic case.
@@ -50,6 +50,22 @@ Optional ports have explicit meaning: absent keeps the generic path, while prese
50
50
 
51
51
  Adapters translate different interaction surfaces without changing the peer's task identity. Claude's plugin channel connects through MCP and the hub control service; Codex is proxied through app-server; ACP peers share an ACP transport; Pi uses its extension bridge. Kimi defaults to a pull-only TUI, with headless ACP as a separate selected form under the same peer id. The TUI does not inherit headless push, session, or recovery behavior. Keeping forms distinct lets the hub preserve the native user interaction model while enforcing one role and delivery policy ([#316](https://github.com/STAIxBWLB/agent-hub/issues/316), [#625](https://github.com/STAIxBWLB/agent-hub/issues/625)).
52
52
 
53
+ ## Exact instructed CLI authority
54
+
55
+ A managed Claude session may request one exact command from a confirmed instruction receipt. The daemon derives the command from the session transcript, never from the tools client's request. It admits only explicitly classified console or conductor forms outside the closed trust, permission, machine-local path, irreversible deletion, release, identity and PII classes. Unknown forms stay closed. Exact mode consumes the receipt before execution; Stop, expiry, a session replacement, privacy changes or loss of managed-launch proof revoke an in-flight operation.
56
+
57
+ The exact list includes a no-manifest task claim verdict with a task id, slot and closed verdict value. The confirmed command supplies all three; the child cannot substitute any of them. File-backed claim verdicts and extra model metadata remain closed.
58
+
59
+ Exact backlog creation accepts only the title typed by the person in the confirmed command. Exact study approval names an existing campaign and revision; its created content comes from the public board contract. The daemon screens the instruction, operands and any study contract before the effect and rechecks the receipt and referenced state. The screen is not declassification: agent-authored public text remains closed.
60
+
61
+ Exact `backlog pin` and `pull-ready` use the person-typed reason after screening the confirmed instruction and operands. The board rechecks instruction authority after its own asynchronous screen and records the receipt in planning history. Exact `title` is restricted to a named hub-local session: the confirmed command, operands and previous title are screened, the receipt and previous title are checked at the local write, and the result supplies the person-run undo. Unnamed sessions and native Pi title writes stay closed; their undo or revocation fence is not proven. `backlog plan` stays closed because its JSON fields require quotes refused by the exact tokenizer.
62
+
63
+ In intent mode the tools client selects a command, and the daemon admits only the closed intent forms against that session's confirmed receipt. The receipt admits at most ten operations; a person verdict also requires its literal item id in the person's confirmed prompt, and a task claim verdict requires both task id and slot. Person verdicts are an explicit exception to reversibility and have no undo. An operation is reserved before execution and Stop, expiry, session replacement, privacy changes or loss of launch proof revoke its in-flight authority. Spending settings and the same dangerous classes remain closed. Fresh mode witnesses default to intent; retained off and exact witnesses keep their values.
64
+
65
+ Intent does not admit role settings, which are trust settings, or file-backed claim verdicts. Intent task creation, splitting, study approval and free-text forms remain deferred pending a person-approved declassification design. Exact backlog split remains closed because the exact tokenizer rejects the quotes required by its JSON operand. Cross-project handoff is closed in both instructed modes because the destination cannot check receipt revocation at its write. Roadmap settlement is admitted for `roadmap state <id> done|dropped` only (#1622 family 4): the milestone id must be written literally in the person's prompt, exact mode admits the same form, and the history entry records the instructed provenance (`docs/design/roadmap.md`). Other roadmap states stay with the person.
66
+
67
+ The daemon starts its own captured installed CLI using Bun IPC and routes that child's messages through the existing control handler with host-owned receipt and peer provenance. The child never opens a WebSocket. A runtime in any checkout, project root or peer write root is refused. Same-user debugging, socket duplication, or modification of the installed package remains outside this proof.
68
+
53
69
  ## Qwen deny input fence (#888)
54
70
 
55
71
  A successfully appended `allowed: false` has a known delivery disposition, but
@@ -45,6 +45,18 @@ External adapter modules are opt-in, pinned at startup, and limited to the accep
45
45
 
46
46
  The control WebSocket binds to loopback, requires a per-run token and rejects browser-origin requests. That token is not an OS security boundary against a same-user process that can read it. The agent-session identity path classifies CLI calls as the acting peer rather than the person, so received text cannot grant the person's authority. This keeps caller identity honest without claiming a hostile-process boundary ([#193](https://github.com/STAIxBWLB/agent-hub/issues/193)).
47
47
 
48
+ The Claude instruction hook records only bounded pending evidence and grants no authority. Exact mode may consume one confirmed receipt to execute a closed, classified command through a daemon-owned installed CLI over inherited IPC; the control request supplies no command or arguments. Confirmation is host-only: it binds a fresh prompt ID and canonical hash to an unused human command record in the daemon's own peer/session transcript under a setup-managed Claude home and current private managed launch. Stop, expiry and an operation limit close the evidence. A same-user process able to alter the session transcript or its environment is outside this provenance boundary.
49
+
50
+ Exact task claim verdicts admit only the no-manifest task id, slot and verdict form. These operands come from the confirmed transcript, and the one-use receipt is consumed before recording the verdict; no file-backed or model-metadata variant is admitted.
51
+
52
+ Exact backlog creation and study approval screen the confirmed instruction and the command operands before any effect. Only text the person typed in the exact command is declassified; screening does not declassify agent-authored text. Study approval is limited to an existing public campaign and its screened, unchanged board content. Unknown or private screening results fail closed.
53
+
54
+ Exact backlog pinning and planned pulls screen the person-typed reason and recheck receipt authority after asynchronous admission, immediately before the board write. A named hub-local session title can be changed only after screening the old and new title and fencing the old title and receipt at the synchronous local write; the previous title is returned for a person-run undo. Unnamed and native Pi sessions remain closed for instructed title writes. JSON-backed backlog planning remains closed under the exact tokenizer.
55
+
56
+ Intent mode accepts a command selected by the tools client only from its explicit list and revalidates the confirmed session evidence for each use. Reversible forms are limited to ids, peer names and enums; explicitly listed person verdicts are the exception and have no undo. A verdict requires the literal item id in the confirmed prompt; a task claim requires both the task id and slot. Ten operations, Stop or expiry close the receipt. Spending settings, other closed classes, PII and private turns do not gain authority. The agent must perform only the person's requested work. User-origin history and audit retain the instructed peer and receipt, never the prompt text.
57
+
58
+ An absent mode witness means the current default intent without writing a row; only off and exact display copies seed a witness, and an unreadable copy seeds off. An explicit intent witness or raw intent config requires a recovery target with `instructed_intent`. An older target may recover a project with only the implicit default, using its narrower exact default; it cannot parse an explicit intent value.
59
+
48
60
  Authority is role-scoped: the person retains decisions requiring judgment or consent; one configured conductor may perform audited operations within its project; ordinary peers receive role- and task-bound operations. Release consent remains person-originated: the person may record it, or the conductor may record it only on the person's explicit instruction in that session. That provenance is cooperative, not daemon-verifiable; model text, tasks, reviews, files, and peer relays do not count. This prevents task content from silently becoming authorization ([#812](https://github.com/STAIxBWLB/agent-hub/issues/812), [#481](https://github.com/STAIxBWLB/agent-hub/issues/481), [#787](https://github.com/STAIxBWLB/agent-hub/issues/787), [#1063](https://github.com/STAIxBWLB/agent-hub/issues/1063)).
49
61
 
50
62
  Native tools keep their vendor permission and execution boundaries. The local worker applies path and permission checks to its tools, and runs command execution through a host-supported sandbox; the hub does not sandbox vendor-native tools or claim all ACP commands are isolated. This avoids confusing a hub permission mode with execution confinement ([#39](https://github.com/STAIxBWLB/agent-hub/issues/39), [#270](https://github.com/STAIxBWLB/agent-hub/issues/270)).
@@ -16,6 +16,8 @@ paths:
16
16
 
17
17
  # CLI output standard v1
18
18
 
19
+ The canonical standard is the first-party package's [standard-v1.md](https://github.com/STAIxBWLB/cli-output/blob/v0.1.3/docs/standard-v1.md). The notes below describe the hub's implementation and compatibility boundaries. The hub uses shared Report primitives, paint and wrapping. A fallback preserves legacy code-point splitting and non-positive widths pending [cli-output issue 36](https://github.com/STAIxBWLB/cli-output/issues/36); the existing table stays local pending [issue 37](https://github.com/STAIxBWLB/cli-output/issues/37).
20
+
19
21
  Version 1. This is a contract for the `ahub` family and every CLI under development; a change to it bumps the version. It is committed under the design-spec vocabulary as `type: module` because `ahub specs check` accepts only goal, architecture, module and submodule (issue #1484 asked for `type: contract`; the validator's fixed vocabulary wins, and the `contract` tag marks the intent).
20
22
 
21
23
  ## Why