@staix/agent-hub 0.43.0 → 0.45.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/CHANGELOG.md +61 -0
  2. package/README.md +3 -8
  3. package/docs/agent-notes/adapters.md +2 -2
  4. package/docs/agent-notes/daemon.md +4 -4
  5. package/docs/agent-notes/local-worker.md +2 -1
  6. package/docs/agent-notes/security-review.md +1 -1
  7. package/docs/agent-notes/tasks.md +5 -2
  8. package/docs/agent-notes/tests.md +4 -3
  9. package/docs/design/adapters.md +4 -2
  10. package/docs/design/agent-hub-architecture.md +2 -0
  11. package/docs/design/agent-hub.md +1 -1
  12. package/docs/design/roadmap.md +75 -2
  13. package/docs/design/supervision.md +34 -2
  14. package/docs/design/task-board.md +36 -2
  15. package/docs/dogfood.md +20 -5
  16. package/docs/events.md +9 -3
  17. package/docs/influences.md +7 -0
  18. package/docs/memory.md +4 -4
  19. package/docs/operations.md +84 -31
  20. package/docs/quickstart.md +14 -2
  21. package/docs/research.md +18 -0
  22. package/docs/roadmap.json +4 -0
  23. package/docs/roadmap.md +9 -0
  24. package/docs/sdlc.md +19 -4
  25. package/docs/security.md +4 -4
  26. package/docs/verification/2026-11-11-supervision-pilot-1221.md +864 -0
  27. package/docs/verification/2026-11-19-0.44.0.md +60 -0
  28. package/docs/verification/2026-11-19-claude-implementer-2.1.328.md +49 -0
  29. package/docs/verification/2026-11-20-claude-implementer-2.1.329.md +49 -0
  30. package/docs/verification/2026-11-20-sdlc-metrics-diagnosis.md +7 -0
  31. package/docs/verification/2026-11-21-0.45.0.md +69 -0
  32. package/docs/verification/2026-11-22-codex-0171-reviewer-isolation.md +47 -0
  33. package/docs/verified.json +32 -26
  34. package/package.json +2 -2
  35. package/plugins/agent-hub/.claude-plugin/plugin.json +1 -1
  36. package/plugins/agent-hub/kimi-hook.js +585 -264
  37. package/plugins/agent-hub/kimi-review-policy-worker.js +5 -5
  38. package/plugins/agent-hub/server.js +629 -293
  39. package/scripts/check-docs.mjs +9 -1
  40. package/src/adapters/acp.ts +11 -1
  41. package/src/adapters/compat.ts +3 -3
  42. package/src/adapters/definitions/builtin-metadata.ts +2 -2
  43. package/src/adapters/definitions/native-context.ts +10 -0
  44. package/src/adapters/jcode.ts +10 -0
  45. package/src/adapters/local-worker.ts +3 -2
  46. package/src/adapters/pi.ts +15 -4
  47. package/src/cli/console-state.ts +3 -1
  48. package/src/cli/help.ts +3 -1
  49. package/src/cli/identity.ts +2 -1
  50. package/src/cli/main.ts +12 -6
  51. package/src/cli/output.ts +2 -2
  52. package/src/cli/recovery-package.ts +16 -3
  53. package/src/cli/roadmap-write.ts +59 -0
  54. package/src/cli/roadmap.ts +81 -4
  55. package/src/cli/sdlc-output.ts +11 -1
  56. package/src/cli/upgrade-runtime.ts +10 -6
  57. package/src/cli/upgrade.ts +9 -3
  58. package/src/hub/agent-mem-range.ts +43 -0
  59. package/src/hub/board.ts +116 -2
  60. package/src/hub/bus.ts +4 -0
  61. package/src/hub/check-runner.ts +25 -1
  62. package/src/hub/claude-shell-wrapper.ts +2 -1
  63. package/src/hub/config-apply.ts +4 -2
  64. package/src/hub/config-trust.ts +1 -1
  65. package/src/hub/context-window.ts +1 -1
  66. package/src/hub/control-write-trace.ts +39 -2
  67. package/src/hub/cost-governance.ts +11 -7
  68. package/src/hub/daemon.ts +318 -53
  69. package/src/hub/dogfood-read.ts +4 -2
  70. package/src/hub/edit-guard.ts +100 -0
  71. package/src/hub/events.ts +79 -8
  72. package/src/hub/facts.ts +85 -2
  73. package/src/hub/hub-tools.ts +3 -1
  74. package/src/hub/lifecycle.ts +6 -1
  75. package/src/hub/log-rotation.ts +130 -0
  76. package/src/hub/memory-profile.ts +137 -21
  77. package/src/hub/no-writes.ts +1 -0
  78. package/src/hub/operational-authority.ts +3 -2
  79. package/src/hub/operational-settings.ts +2 -2
  80. package/src/hub/quota-events.ts +40 -0
  81. package/src/hub/recovery-store.ts +70 -24
  82. package/src/hub/report.ts +1 -1
  83. package/src/hub/research-experiments.ts +132 -0
  84. package/src/hub/research-quality.ts +13 -3
  85. package/src/hub/research-record.ts +38 -2
  86. package/src/hub/research.ts +128 -28
  87. package/src/hub/restart.ts +49 -2
  88. package/src/hub/roadmap-check.ts +65 -0
  89. package/src/hub/roadmap-decompose.ts +80 -0
  90. package/src/hub/roadmap-export.ts +27 -0
  91. package/src/hub/roadmap-sync.ts +97 -0
  92. package/src/hub/roadmap.ts +40 -0
  93. package/src/hub/runtime-capture-prune.ts +9 -1
  94. package/src/hub/runtime-prune-health.ts +5 -1
  95. package/src/hub/sdlc-branch-ci.ts +128 -0
  96. package/src/hub/sdlc-merge.ts +12 -5
  97. package/src/hub/sdlc-metrics.ts +33 -10
  98. package/src/hub/sdlc.ts +90 -10
  99. package/src/hub/settings.ts +1 -0
  100. package/src/hub/snapshots.ts +56 -1
  101. package/src/hub/startup-event-seeds.ts +21 -15
  102. package/src/hub/startup-timing.ts +3 -1
  103. package/src/hub/supervision-proposals.ts +10 -2
  104. package/src/hub/supervision-rules.ts +27 -4
  105. package/src/hub/supervision.ts +7 -0
  106. package/src/hub/task-pr.ts +47 -0
  107. package/src/hub/task-shell-command.ts +124 -0
  108. package/src/hub/task-worktree.ts +18 -11
  109. package/src/hub/tasks.ts +617 -45
  110. package/src/hub/usage-rollup.ts +35 -20
  111. package/src/hub/worktree-shelf.ts +2 -1
  112. package/src/local/sandbox.ts +2 -1
  113. package/src/local/shell-environment.ts +6 -0
  114. package/src/local/tools.ts +13 -1
  115. package/src/memory/brief.ts +10 -1
  116. package/src/memory/client.ts +3 -2
  117. package/src/pi/extension.ts +15 -3
  118. package/src/pi/tool-receipts.ts +26 -0
package/CHANGELOG.md CHANGED
@@ -4,6 +4,67 @@ 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.45.0
8
+
9
+ - 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.
10
+
11
+ - Add descriptive edit-governance factorial, sensitivity and evidenced cost-per-success helpers (Refs #1556, hub task 1008).
12
+ - Admit a verified draft head to review before macOS runs, while preserving the full exact-head merge gate (Refs #1576, hub task 1031).
13
+ - Accept new agent-mem minors automatically through the declared range `>=0.33.0 <1.0.0`, checked at load against the package's host API range `[1, 1]` (Refs #1611, hub task 1054). A package without valid `HOST_API_MIN` and `HOST_API_VERSION` is refused with the cause, never a module-link error. A minor may raise the store format floor, so roll back the hub together with the store. A new major stays a reviewed raise. Memory opens only for such a release (`Bun.semver.satisfies`), and the recovery package and `scripts/check-package.mjs` apply the same rule; `ahub doctor` and the memory client report the loaded release and, on refusal, its cause. A daily scheduled and dispatch workflow installs the newest in-range release beside the unchanged manifest and lockfile and runs the memory-surface gate against it. An in-place upgrade turns the sync-placement writer proof to `changed` until a person re-runs `amem migrate --sync-placement --dry-run`. This replaces the exact agent-mem pin (the interim `~0.32.1` range of #1605, hub task 1047, never shipped).
14
+ - Add opt-in edit route and read-receipt guards for hub-owned tools, plus edit supervision observations (Refs #1556, hub task 1007).
15
+ - Open or attach a verified GitHub PR for a managed worktree at task completion (Refs #1549, hub task 1019).
16
+ - The console keeps the selected row on screen in the Settings panel: the row window now leaves room for the notes above the table (#1607, hub task 1049).
17
+ - Propose the parts of a roadmap milestone: `ahub roadmap decompose <id>` and `hub_roadmap_decompose {id}` ask the hub's model how one milestone decomposes, reading only its public title and outcome, the goal or architecture specs it links and the issues it links. A part is kept only when it cites an id the model was shown and says whether it needs its own spec issue or goes straight to a task, and the answer is saved as a pending model answer; nothing is intaken, linked or published (Refs #1480, hub task 1050).
18
+ - Accept one proposed part of a milestone decomposition as a held intake draft: `ahub roadmap decompose <id> --accept <part>` and `hub_roadmap_decompose {id, accept}` create a backlog draft linked to the milestone that carries the part's `spec`/`task` kind, so nothing offers, pulls or routes it until the person releases it with `ahub intake approve`. Each part is accepted on its own, accepting the same part twice returns the draft the first accept made, and the reply is a public view, so a part the screen refuses is held privately and reads `[pii]` (Refs #1480, hub task 1051).
19
+ - Record codex-cli 0.171.0 reviewer evidence from model-free preparation only; 0.171.0 stays unverified because the one model-backed review persisted no verdict, and the compatibility list is unchanged (Refs #888, hub task 1024).
20
+ - Move the external project mentions from the README to `docs/influences.md` (#1589).
21
+ - Shorten two slow test files without loosening what they assert: the hang-watch gate fixtures are trimmed, with the measured reason `memory-store` cannot be halved (#1594), and a checkpoint test waits out the expiry its fixture already shortens (Refs #1578, #1595).
22
+
23
+
24
+ - Add `turn_end.edits` (closed counts of edit-tool and shell-route writes graded by read receipts, only on mutating turns with `research.enabled`) and a text-free `edits` block on research records v2, reported per leaf by `quality.json` with null (never 0) on tree-only surfaces (Refs #1556, hub task 1006).
25
+
26
+ - Exact-pin the first-party agent-mem dependency to 0.32.0, from 0.30.0 (hub task 1042). The 0.31.0 additions stay outside the paths this hub reads (the `held` placement realm outcome and the classified agent-marked CLI read causes), and its sync result shape and `SYNC_FAILURE_CAUSES` are unchanged. The 0.32.0 CLI changes also reach nothing here: the hub's one `amem` call previews `amem setup <tool> --json` and parses the answer with `JSON.parse`, so 2-space `--json` indentation and usage errors exiting 2 read the same, and it writes no capture hook or `amem ingest` call of its own, so piped ingest printing human text and the `amem_work_state_read` per-call policy snapshot change nothing it runs. `amem list`, `show` and `graph` keep byte parity and storage is unchanged.
27
+ - Check roadmap drift, preview an opt-in GitHub milestone mirror, and export validated public roadmap files (Refs #1482, hub task 951).
28
+ - Take the recovery driver's attachment-wait poll slice from the clock object it already accepts for `now` and `sleep`, defaulting to the same 1 s so no production timer or deadline moves, and let the `#489` deadline tests poll at 10 s: `test/upgrade-runtime.test.ts` drops from 126 s to 57 s on macOS with every 600, 650, 700 and 900 s assertion unchanged. The other four files of the ten-file table are left with measured per-file reasons (Refs #1578, hub task 1044).
29
+ - Report Pi prompt context occupancy and session model in headless and TUI modes, and bind verified TUI sessions to Record capture (Refs #1549).
30
+
31
+ - Read merged PR CI costs from complete branch-scoped evidence when GitHub omits run-to-PR links, including first-pass status and full-gate and macOS shard counts (Refs #1579, Refs #1555, hub task 1032).
32
+ - Make a failing gate name its step: `scripts/check.sh` prints one `check: FAILED step '<name>' (exit N)` line (and a GitHub annotation under Actions) for each once-only step, and for the test runner it adds the failing-test count (each test once, although Bun repeats every `(fail)` line in its end-of-run recap), the first failing test and the last test file started, or says the runner exited or was signalled with no `(fail)` line, plus the leaked-process scan. Exit statuses and pass/fail are unchanged (Refs #1577, Refs #1260).
33
+ - Retire a finished recovery receipt's runner db only while this process's own live claim still refuses a new owner, so two maintenance passes can no longer race a release against an unlink and crash a pass on the moved database (Refs #1260, Refs #1541, hub task 1040).
34
+ - Keep the staged-project-isolation test's two real daemons but run every await under a 45 s body deadline with 6 s cleanup waits under its own 90 s timeout, so a slow macOS shard fails the step it waited on instead of being cut by Bun's 20 s while a synchronous `ps` read is on the stack (Refs #1577, Refs #1260, hub task 1038).
35
+ - Split `post_ready` on the startup timings line into one boundary per step (`post_ready_handoff`, `_queue`, `_watch`, `_reconcile`, `_goals`, `_leases`, `_crash`, `_pi`, `_drift`), so the next live start names which step holds the 17 s that blocks control replies. Measurement only; no behavior changes (Refs #1445).
36
+ - Rotate `events.jsonl` (64 MiB segments, three kept) and `hub.log` (16 MiB, two kept) by size. A rotated segment is named by its starting byte, so every reader and every persisted offset (the usage roll-up, the live research tail) keeps its meaning across a rotation, and `ahub research backfill` gives the same records for a task whose events sit in a rotated segment. The oldest event segment is kept while it holds an open task's events (Refs #1546, hub task 1021).
37
+ - Drop a closed task's ephemeral state: its `touches` rows, the output tail and staged output of its finished isolated checks, and the settled results of a closed Pi session shrink to 2,000 characters with a shell exit code kept. Tasks, history, receipts and roll-ups are untouched (Refs #1555, hub task 1004).
38
+ - Remove the rooms-delivery replaced-presence flake: the test counted beta's own session-start presence request as an echo of the replacement reply, and now waits on beta's answer (Refs #1577, Refs #1260, hub task 1035).
39
+ - Remove the runtime-prune recovery flake: the test waits for the pass it admitted to record its terminal phase in the admission ledger instead of a fixed 50 ms delay that raced the worker's write, and an unreadable ledger is no longer read as zero rows (Refs #1260, Refs #1546, hub task 1037).
40
+ - Remove the conductor detached-restart flake: the test waits for the restart terminal receipt or the runner exit instead of fixed 10 s and 15 s budgets (Refs #1577, Refs #1260, hub task 1033).
41
+ - Verify Claude Code 2.1.328 and 2.1.329 as headless implementers with isolated model-free transport and wrapper receipts (Refs #888, hub task 1023).
42
+ - Read only the slice of `events.jsonl` a closing task needs when the live research writer builds its record, with the same row as `ahub research backfill` (Refs #1555, hub task 1003).
43
+ - Cache the memory sync policy version on the profile fence's stat tuple and stop asking the store for `bridgeStatus` there, so an unchanged home costs a stat per fence check instead of a full shard re-read (Refs #1545, hub task 1028).
44
+ - Allow a hub-managed worktree to be committed and checked before task handoff (Refs #1549, hub task 1018).
45
+ - Raise the ACP open-tool ceiling's default from the legacy 30 minutes to 60, and its cap to 120, because this repository's own instructions expect a gate run to wait up to 50 minutes (`dot remote verify --wait 50m`); a tool call that reports no progress for that long still ends the turn, and per-poll rearming and the watchdog floor are unchanged. A turn the ceiling cancels now names its cause: hub.log gets the ceiling and its minutes for a configured kind whose native diagnostics stay withheld, plus that peer's own launch (`ahub jcode`, or `ahub jcode --as <peer>` for an extra instance) and the held queue row the person settles, and a private turn's tool titles stay withheld with them (Refs #1601, hub task 1046).
46
+
47
+ ## 0.44.0
48
+
49
+ - Release N-1 for 0.44.x is published 0.43.0, with exact agent-mem 0.29.0 and control protocol 17 (descriptor floor 16). The N-1 fixture and matrix pin that package; the separate protocol-16 fixture stays at 0.25.0. The isolated compatibility fixture covers old clients and plugins against the new daemon and new clients and plugins against the old daemon; it does not prove live-agent, rollback, or shared-home compatibility. The protocol window and CLI forms are unchanged; the backlog pull MCP description now explicitly names planner-only authority. This release pins agent-mem 0.30.0 and does not automatically raise the memory home or sync format floor; compatibility after a person raises a floor requires separate verification.
50
+
51
+ - Document the supervision shadow pilot results, coverage limits, and unknown total cost (Refs #1221, hub task 866).
52
+
53
+ - Default sandboxed Bun and npm caches to each command's writable temporary directory, while retaining caller overrides (Refs #1549, hub task 1017).
54
+ - Exact-pin the first-party agent-mem dependency to 0.30.0 (hub task 1029).
55
+ - Yield while screening task intent briefs and recheck host state in bounded batches to keep assignment responsive (Refs #1545, hub task 1014).
56
+ - Pull ready reserved backlog work when planning or a peer attachment makes it eligible, and name planner authority in backlog guidance (Refs #1547, hub task 1013).
57
+ - Raise the default total backstop AHUB_CHECK_HANG_S of scripts/check.sh from 2250 s to 2700 s; AHUB_CHECK_QUIET_S stays 300 and is still what catches a hang (Refs #1564, hub task 1022).
58
+ - Record observed merge costs, carried-spec timing and per-source security scan availability (Refs #1555).
59
+ - Record quota rows on meaningful changes and a 15-minute heartbeat while preserving measured silence gaps (Refs #1555).
60
+ - Control-write telemetry now attributes synchronous slices after an await and microtask-bound spans that settle before the loop probe, while genuine async waits stay waits (Refs #1545, hub task 1015).
61
+ - Shrink restart.json (store bus.seen once, cut completed delivery bodies to 256 characters) and keep only the 5 newest restart.released and restart.abandoned copies (Refs #1546, hub task 1010). An older hub importing the new restart.json into a fresh journal sees an empty nested seen, so its dedupe history starts empty.
62
+ - Add in-memory read receipts and an observation-only in-place shell write classifier (Refs #1556, hub task 1005).
63
+ - After five consecutive exhausted snapshot bursts, routine boundaries skip capture for ten minutes and record unknown evidence; the next boundary retries (hub task 996, Refs #1550).
64
+ - A failed agent CLI task command no longer records a second "refused" audit unless the daemon says authority refused it (Refs #1547, hub task 1012).
65
+ - Record isolated check outcomes as text-free task evidence for matching-head metrics and supervision (Refs #1555).
66
+ - A start under recovery coordination no longer schedules a runtime prune that is bound to defer, the recovery runner schedules one after it releases its lock, a recovery-only deferral starts no one-hour cooldown, and doctor no longer fails runtime pruning for it (Refs #1546, hub task 1011).
67
+
7
68
  ## 0.43.0
8
69
 
9
70
  - Release N-1 for 0.43.x is published 0.42.0, with exact agent-mem 0.28.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 fixture exercises old client and plugin against the new daemon and the new client and plugin against the old daemon. It does not establish live-agent, rollback or shared-home compatibility. The wire and the MCP tool set are unchanged from 0.42.0. The CLI adds `ahub upgrade --all-stopped`, lets `ahub upgrade --to <v>` retarget a stopped project, and makes `memory.sync_interval_min` settable with `ahub settings set`; a 0.42.0 CLI does not offer these. Task history gains an optional `requestHead` on `done` entries, which 0.42.0 ignores. This release pins agent-mem 0.29.0 while 0.42.0 pins 0.28.0; agent-mem 0.29.0 raises no sync/home format floor and builds its derived index as a separate version-5 file while 0.28.0 keeps its version-4 file, so both can share a memory home; file compatibility beyond these fixtures remains subject to the release verification report.
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.43.0, control protocol 17 (accepts 16). Bun + TypeScript, one loopback daemon per
8
+ Status: 0.45.0, control protocol 17 (accepts 16). Bun + TypeScript, one loopback daemon per
9
9
  project. Site: [agent-hub.staix.net](https://agent-hub.staix.net).
10
10
 
11
11
  Inspect bounded task and attempt metadata with `ahub lineage show`; admit external
@@ -132,7 +132,7 @@ including [a new project with SDLC advise or enforce](docs/quickstart.md#a-new-p
132
132
  ([guidance probes](docs/design/guidance-probes.md)).
133
133
  - **Shared memory.** Decisions, contracts, fails and findings are kept through the
134
134
  first-party [`@staix/agent-mem`](https://github.com/STAIxBWLB/agent-mem) library,
135
- in process with no claude-mem worker (short- and long-term tiers, a typed graph,
135
+ in process (short- and long-term tiers, a typed graph,
136
136
  git sync between machines). Agents get
137
137
  it as a recall preface, as briefs on a task, and through bounded search tools.
138
138
  Managed headless peers can save compact `amem:` records from final answers; the
@@ -222,18 +222,13 @@ Live checks that still need a real account or a person are listed in the
222
222
  | [Security notes](docs/security.md) | what the hub defends and what it does not |
223
223
  | [Design spec](docs/specs/2026-09-19-agent-hub-design.md) | how it is built and why |
224
224
  | [Smoke checklist](docs/smoke.md) | what has been verified against real agents |
225
+ | [Influences](docs/influences.md) | projects whose features informed agent-hub |
225
226
  | [Changelog](CHANGELOG.md), [Contributing](CONTRIBUTING.md) | releases and how to contribute |
226
227
 
227
228
  Coding agents that work on this repository follow [`AGENTS.md`](AGENTS.md) and
228
229
  [`docs/agent-notes/`](docs/agent-notes/).
229
230
  The managed agent guidance explains the marker-only no-reply path for a delivery that needs no answer (#1550).
230
231
 
231
- ## Origin
232
-
233
- The first idea came from [agent-bridge](https://github.com/raysonmeng/agent-bridge),
234
- which lets Claude Code and Codex talk to each other. agent-hub has since grown into a
235
- different system with its own goals and shares no code with it.
236
-
237
232
  ## License
238
233
 
239
234
  MIT
@@ -47,7 +47,7 @@ Scope: the Codex, ACP and Pi adapters and the Pi extension (turn `generation` an
47
47
  - A peer must set `busy` synchronously inside `deliver()`, otherwise the bus drains the next envelope into a running turn (Kimi answers `turn.agent_busy`). Outside a turn the adapter accepts an occupancy diagnostic (a `context-used` `usage_update` naming its current session) and nothing else: no token total, no chunk, nothing unnamed or for an offline peer (#285).
48
48
  - A watchdog-cancelled turn still reports later. Anything a turn does on completion must check it is still the current turn (`turn` generation in `acp.ts`, `activeTurns` in `codex-appserver.ts`). A rejected prompt other than a recognised quota refusal, or an abnormal prompt end, reports through the adapter's `onTurnFailure` (same shape in `acp.ts` and `pi.ts`), even when ACP streamed partial text; a stale cancelled turn never reports it; a rejected watchdog-cancelled ACP prompt during its journal-less wait is discarded with one log line, not requeued as on the earlier adapter.
49
49
  - After an ACP watchdog cancels a prompt on a bus without a journal, keep the peer busy with its inactivity watchdog cleared until that prompt settles; suppress its turn-scoped updates and permissions while still accepting session-bound occupancy diagnostics. Bound the wait by the existing 30 s ACP handshake deadline, go offline, never idle, with queued work retained if it expires, and revoke the wait on stop or transport loss; a durable delivery keeps its existing offline/needs_review path.
50
- - ACP tool ceiling (#542): a tool call announced (`tool_call`) and not yet `completed` or `failed` in the current turn keeps a silent busy turn alive past the watchdog, up to `AcpOptions.toolCeilingMs` (never below the watchdog) counted from the last protocol message. Re-arm with `touch(<remaining ceiling, at most the watchdog>)`, never a full extra watchdog, and clear the open calls at each `deliver()`. Past the ceiling, cancel as an ordinary watchdog; its log line names the open tools only on a turn that is not private (latch `isPrivateTurn`, fail closed when it throws), each title as one sanitized, quoted, cut line. The daemon passes `toolCeilingMs`, `activityBatchMs` and Jcode's `steerTimeoutMs` from `adapterOperationalReaders` (`adapter_timing.*`, #982) only when it constructs an adapter; an adapter never reads config itself, and an accepted edit never retimes a running launch.
50
+ - ACP tool ceiling (#542): a tool call announced (`tool_call`) and not yet `completed` or `failed` in the current turn keeps a silent busy turn alive past the watchdog, up to `AcpOptions.toolCeilingMs` (never below the watchdog) counted from the last protocol message. Re-arm with `touch(<remaining ceiling, at most the watchdog>)`, never a full extra watchdog, and clear the open calls at each `deliver()`. Past the ceiling, cancel as an ordinary watchdog; its log line names the open tools only on a turn that is not private (latch `isPrivateTurn`, fail closed when it throws), each title as one sanitized, quoted, cut line. Fire `onToolCeiling({ ceilingMs })` before that line and the cancel; it carries the number only, and the daemon turns it into the host sentence for a kind whose adapter log is withheld (Jcode, `jcodeToolCeilingCause(ceilingMs, peer)`, #1601), so never add a title or native text to it. The daemon passes `toolCeilingMs`, `activityBatchMs` and Jcode's `steerTimeoutMs` from `adapterOperationalReaders` (`adapter_timing.*`, #982) only when it constructs an adapter; an adapter never reads config itself, and an accepted edit never retimes a running launch.
51
51
  - Native capability listings (#445 C1, #985): keep vendor identities and listing shapes in `src/adapters/native-capabilities.ts`, never in `src/hub/capabilities.ts`. `capabilityManifest` lists only on a `NATIVE_PINS` version; any other version returns an empty manifest, never a guess, and a transport failure rejects rather than showing a stale list. Codex `skills/list` uses a negative hub id, and only `enabled: true` skills are listed. ACP keeps `available_commands_update` lists that arrive during `binding` keyed by session (`earlyCommands`, at most `EARLY_COMMANDS_MAX`), and the bind adopts only the bound session's list (#567).
52
52
  - Retire a cancelled Codex native turn until its exact completion or session teardown. Late start acceptance, answer frames and completion must not revive its audience or relabel uncertainty as `failed_safe`. If cancellation has no provable native id, keep the peer offline until verified reattachment.
53
53
  - Codex: the adapter never sends its own `initialize`. It is a proxy; hub requests use negative ids and their responses must not reach the TUI.
@@ -80,7 +80,7 @@ Scope: the Codex, ACP and Pi adapters and the Pi extension (turn `generation` an
80
80
  - Tag a Pi hub-tool refusal only at a proven pre-effect guard with `PreEffectToolRefusal`; return its exact error and settle its receipt. Never classify a generic/post-effect/storage failure or a legacy pending receipt from error text or current board state. After durable `markStale`, cancellation or output consumption, retain ordinary failure classification; a later binding/privacy rejection cannot prove that no effect occurred. Recheck task revision, owner/session generation and privacy across awaited bounded spec/check operations; never turn those tools into arbitrary host execution.
81
81
  - Version gate (#843): `PiPeer.startImpl` first awaits the preflight the production factory `createPi` passes as a separate constructor argument (keep it out of `PiOptions`: transport option identity), which runs `piVersionAsync` on the exact configured `pi.cmd` plus `--version` (owned group, 64 KiB, 10 s) against compat `pi`. Only a `PiVersionRefusal` reaches the caller as is (sanitized, 1000 characters); never wrap another start error in it. A fake Pi in a daemon fixture answers `--version` with a verified version.
82
82
  - Report each Pi owner exit once, with code/signal (unknown for an unobserved TUI exit), turn/tool activity and only the last tool name. Auto-restart only a current, started, unexpectedly idle headless owner on its verified persisted session, once per 60 s; preserve shutdown/requested-stop/recovery/startup/active-tool fences and never fall back fresh.
83
- - Keep Pi owner identity on the shared `processSignature`/`processLiveness` contract exported by the exact-pinned package's Node-safe `@staix/agent-mem/platform` entry, re-exported unchanged by `src/pi/process-signature.ts` for the startup claim, extension claim, TUI owner monitor, `recoveryReady` and verified teardown. Memory's `sync.lock` uses the same implementation. Preserve the Node-safe process-entry regression in `test/memory-parity.test.ts`, the existing Pi process behavior tests, the LC_ALL=C/TZ=UTC `ps` read and strict pid + start + command identity; never accept PID-only or a fuzzy command match.
83
+ - Keep Pi owner identity on the shared `processSignature`/`processLiveness` contract exported by the first-party package's Node-safe `@staix/agent-mem/platform` entry, re-exported unchanged by `src/pi/process-signature.ts` for the startup claim, extension claim, TUI owner monitor, `recoveryReady` and verified teardown. Memory's `sync.lock` uses the same implementation. Preserve the Node-safe process-entry regression in `test/memory-parity.test.ts`, the existing Pi process behavior tests, the LC_ALL=C/TZ=UTC `ps` read and strict pid + start + command identity; never accept PID-only or a fuzzy command match.
84
84
  - Return the shared `toolResultFailed` verdict as `/tool`'s `failed`; map only `failed === true` to Pi's `isError`. Preserve text and the older bridge's absent-flag behavior. The one exception is a person's `!command` whose process exit was observed: its `failed` is `exitCode !== 0` and the reply carries `exitCode`, from `onProcessExit` through `packPiShellResult`, never parsed from the output (#253).
85
85
  - Pi's bridge executes `/tool` only for the verified owner (`verifiedOwner()`: the claimed pid with its `processSignature`; a headless owner is pinned from the spawned process once `get_state` proved its session) with the current `sessionId` and turn `generation`, and admits `/budget` only for that owner and generation, checked again after the awaited admission. Refuse anything else before execution. `tool_abort` aborts that pending call, or fences its id when it arrives before the call (64 ids a turn, then every further call of that turn). A person's `!command` (`purpose: "idle_user_bash"`) is taken only in TUI mode from an idle owner on its one-use reservation, and it alone skips `piPermit`: never widen that to a model's bash call (#253).
86
86
  - Emit Pi's ceiling event at the pre-effect rejection boundary (`src/pi/ceiling.ts`), before `agent_end`. Accept only a valid current-session/current-generation signal during a running turn; retain the first signal and attach it to that turn's failure. Never classify a ceiling from free text. At `agent_settled`, mark a ceiling delivery completed with `ceiling steps <count>/<limit>` and pass `settledCeiling: true` only when that turn failed without cancellation, withdrawal or an execution/approval budget stop, and no managed tool was pending when the ceiling arrived or remains pending. Latch tool uncertainty at the ceiling even if tools settle later. Keep every other failed delivery held; never replay it. Observe explicit stop/recovery, roster or personal withdrawal and cancelled settlement once per logical turn through `onTurnAborted`, without failure handoff; internal model-failure teardown suppresses that observation. Call `onTurnSuccess` only for an actual nonerror, noncancelled settlement, never a ceiling.
@@ -13,7 +13,7 @@
13
13
  - Keep `export const LIVE_TEST_SUPPORTED = true;` in `src/cli/identity.ts`: delegated recovery staging reads this declaration before any source effect.
14
14
  - A delegated non-recovery command runs only after `recordDelegatedCliAudit` committed `delegated` against a hub whose `features` list `cli_audit_delegated`, that instance's console `cli_audit_ack` confirmed retention, and `ControlClient.pinInstance` pinned the invocation to it; a refused feature, failed ack or changed consumer executes nothing (#410). Upgrade, restart and recovery record delegation only in the operation receipt (`delegatedAudits` through `createOperation` or `recordRecoveryDelegation`). The daemon counts an audit retained only after `event()` returned true.
15
15
  - For conductor recovery (#900), keep source-issued private continuity separate from public actor/audit metadata; recheck the same initiator and every affected project at effect boundaries. Compare candidate config and routing with the running accepted policy. Verify and use the same captured startup inputs before any adapter import; never publish a later raw-file reread. Keep captured TUI restoration and unknown source/target evidence person-only. Derive target feature floors from verified target bytes, never a request or receipt claim (`docs/operations.md`, "Conductor-bound restart and recovery continuation").
16
- - Conductor operational refusals (#812, #839): throw `OperationalAuthorityError` (`src/hub/operational-authority.ts`) for an authority refusal, never a plain `Error`. Only it sets `authorityRefused: true` and its scope on the reply, which the control `reply` wrapper audits once as a refused `agent_cli` event; any other failure of a labelled request keeps its own error with `authorityRefused: false` and is never audited as refused, and the CLI's `fail` audits only when `authorityRefused` is not `false`. An unreachable or dead hub is "authorization unavailable", never a missing conductor role. `publicOperationalView` is cached on the board status revision, config revision, routing and the private-path policy: a new input to that projection joins the cache key.
16
+ - Conductor operational refusals (#812, #839): throw `OperationalAuthorityError` (`src/hub/operational-authority.ts`) for an authority refusal, never a plain `Error`. Only it sets `authorityRefused: true` and its scope on the reply, which the control `reply` wrapper audits once as a refused `agent_cli` event; any other failure of a labelled request keeps its own error with `authorityRefused: false` and is never audited as refused, and the CLI's `fail` audits only when `authorityRefused` is not `false`. For a command that is not a conductor operation, `taskOp` audits `refused` only when the reply says `authorityRefused: true`; a domain error keeps the one up-front `run` record (#1547). An unreachable or dead hub is "authorization unavailable", never a missing conductor role. `publicOperationalView` is cached on the board status revision, config revision, routing and the private-path policy: a new input to that projection joins the cache key.
17
17
 
18
18
  - Peer DOING (#878): `observeDoing` is the only writer and `doingRows` the only reader (`src/hub/daemon.ts`, helpers in `src/hub/peer-doing.ts`). Decide privacy at observation (`contextPii`, held review input (`reviewObserverHeld`) or a last delivery holding an `isReviewObserverExcluded` envelope, or a refusing or throwing `tasks.publicMetadataText` latches a stub) and again at display (an open PII task owned or reviewed, a private turn, or the same review-input screens); reuse those screens, never add one. `status()` adds it only with `includeDoing` (the `status` reply and the dashboard snapshot), so `writeStatus` never writes it to `status.json`; the conductor's `hub_status` gets the same rows, each non-stub value framed by `publicConductorStatus` as untrusted (`sanitize`d text, `untrusted: true`, and `from` with `doingNote`, or `note: INCOMING_LABEL_NOTE` for a `label` row); never give an agent DOING text without that frame. A `label` row (`unnamedSessionLabel`: an unnamed `title: "hub"` session's first acknowledged incoming delivery, #1055) reaches only the console, the dashboard and the conductor (`includeIncomingLabels`); every other status reader gets `unnamed`. The console `title` op and `hub_set_title` both go through `setSessionTitle` (writer rule: `adapters.md`), and `session-title-inputs.json` keeps only session, delivery and envelope ids (`sessionTitleBindings`, `titlePersistence: "native"` peers only), never a name, body or label. Claude's title comes from the transcript path the facts hook reported and `claudeTranscript` validated, read through `readAiTitle` (1 MiB per read, lines over 64 KiB skipped); its current item only from PreToolUse input, never the transcript; every cached TaskUpdate subject, current or not, is screened when it is learned (`contextPii` or `tasks.publicMetadataText` refusing or throwing, via `ClaudeTodoSource`), keeps that verdict and passes it to `observeDoing` as `learnedPrivate`. A doing failure never changes a facts reply.
19
19
  - Observed turn models (#1402): `turn_end` carries `model` and `modelEvidence` only from `PeerAdapter.observedModel()` (rule in `adapters.md`), and the operational view admits them only through `safeModelLabel` and `MODEL_EVIDENCE` (`src/hub/operational-view.ts`). `noteObservedModel` keeps a peer's last `served` or `session` model that `isNativeModelToken` accepts, bound to the adapter that reported it and dropped when the peer goes offline; status and `ahub model list` show it as `observed (served|session)` only when no override, instance, launch or native baseline model is known, never a `configured` grade.
@@ -118,7 +118,7 @@ Scope: the operator console, control WS and its protocol, state files, the dashb
118
118
  - `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
119
  - `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
120
 
121
- - When preserving a recovery source, copy only the exact-pinned `@staix/agent-mem` package through `preserveRuntimeDependencies` in `src/cli/recovery-package.ts`; include its identity and bytes in `packageDigest`. Never copy the whole node_modules tree or link a preserved source to a mutable installation. Verify preserved sources with `ownDependencies: true` so a missing or symlinked memory copy cannot resolve an ancestor installation. Verify staged releases with `dependencyRoot` bound to their retained install directory; never resolve beyond it. Keep no-dependency release digests compatible.
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.
122
122
  - 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
123
 
124
124
  - 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.
@@ -132,7 +132,7 @@ Scope: the operator console, control WS and its protocol, state files, the dashb
132
132
  - The memory client (#752) is the in-process amem `MemoryClient` built once in `startDaemon` from the alias-resolved `memoryProject`, the bound store and candidates, `screenMemory` and the capture binding; its `check` rechecks that binding and the project before each call. `DaemonOptions.memoryClient` is a host-only seam, never read from configuration or a tool; `memory.worker_url` is ignored legacy configuration, never a destination. Local capture takes `memoryProject`, never the project chain. Shutdown aborts `syncStop`, awaits `syncRun`, then closes `memory`, the candidates and the store, in that order.
133
133
  - Symbol anchors (#769, #770): resolve `memorySymbols` only in the `prepareReviewBrief` pass that fills `reviewSymbols`, under the same key and eviction, through `resolveMemorySymbolNodes` (a positive, unambiguous `exists` at the brief's head, at most `MEMORY_SYMBOL_LIMIT` candidates within `MEMORY_SYMBOL_START_BUDGET_MS`); a filled key is reused by the completion pass, a PII task is never resolved, and one that turns PII or changes owner meanwhile resolves unknown. `memorySymbolNodes` answers only for a non-PII task whose `codeSymbols.head` is its `refs.commit`. Raw and normalized symbol forms are query compatibility only (`taskMemoryQueryNodes`, `planGuardNodes`): never rewrite a stored note or id. `ahub doctor --stale-anchors` (`memoryStaleAnchorsCommand`, `src/cli/memory.ts`) is read-only: it never creates a missing profile, machine or shard, never edits, deletes or promotes a note, and reports unavailable, private or ambiguous evidence as unknown, never stale.
134
134
  - Read-time code neighbours (#771): derive them only through `memoryCode` and publish only through `currentMemoryCode` (`src/hub/daemon.ts`), which rechecks the memory binding, the overlay head against its `readMemoryCodeHead` proof and every node's canonical id, and screens each attached note again; never store derived `calls` edges or neighbours in amem. Neighbour queries run through `codeFacts.neighbours` with `priority: "optional"`, so review and completion queries win. Only `symbol:` starts query: the dashboard only through `uiMemorySnapshot` for the `memory` view with `codeNeighbours: true` and a node of at most 512 bytes (`ui_snapshot` answers a failure with `memory view unavailable`), and `hub_memory_graph` only after `memory_read`, rechecking the caller's connection generation, private turn and PII context after the await. Console task detail reads `taskMemoryResult(task, true)`, which never starts a query; its `relatedMemory` is a count or `unknown`. A PII task or turn never queries. Keep the cache ceilings (32 entries, 30 s known, 5 s unknown, 5 s between derive starts), and keep direct path/title/symbol notes in `taskMemoryResult` independent of code availability: an optional code failure never drops them.
135
- - Task briefs (#779): with a memory store, `Briefs.forTask` (`src/memory/brief.ts`) takes relevance, ordering and line text from agent-mem's `buildIntentBrief` through `taskIntentBrief` (`src/hub/daemon.ts`); the hub keeps only policy and binding. Screen rows through `screenMemory` and `publicMetadataText` with the local deny paths, and recheck `allowed`/`assertCurrent` (same task revision and owner, config revision, not stopping, no PII task, private turn or PII context) after every await. An `unknown` result or a changed context gives no brief, never a partial one. Host plan-guard fails (`priority`) keep the front of the brief even when the library's cap left them out, and the per-peer dedupe and `brief_items` cap apply to whole library rows. Derived code neighbours only add `symbol:` selectors and a failed derive never removes direct intent memory. `src/hub/memory-plan-guard.ts` only adapts the library's `planGuardNodes` and `matchingPlanFails` to the task shape: never add matching logic there.
135
+ - Task briefs (#779): with a memory store, `Briefs.forTask` (`src/memory/brief.ts`) takes relevance, ordering and line text from agent-mem's `buildIntentBrief` through `taskIntentBrief` (`src/hub/daemon.ts`); the hub keeps only policy and binding. Screen rows through `screenMemory` and `publicMetadataText` with the local deny paths, and recheck stopping, config revision and private turn at every library check; revalidate the memory binding, task revision, owner, task PII and peer PII context before and after source reads, after each bounded scan yield and before publication. Other async host operations retain their fresh checks after awaits. An `unknown` result or a changed context gives no brief, never a partial one. Host plan-guard fails (`priority`) keep the front of the brief even when the library's cap left them out, and the per-peer dedupe and `brief_items` cap apply to whole library rows. Derived code neighbours only add `symbol:` selectors and a failed derive never removes direct intent memory. `src/hub/memory-plan-guard.ts` only adapts the library's `planGuardNodes` and `matchingPlanFails` to the task shape: never add matching logic there.
136
136
 
137
137
  - Bind adapter and instance declarations once at startup through the daemon-local `adapterCatalog` (`createProjectAdapterCatalog(loadedConfig.adapters, externalDefinitions)`, the definitions `loadExternalAdapterDefinitions` imported at startup; a reload passes the same `externalDefinitions` to `loadConfig` and imports nothing), its `definitionOf` closure and the `configuredIds`/`extraIds` catalogs; never publish them to the global registry or take them from a request. `adapters` and `instances` are restart-class, and `adapters` is `NEVER_EDITABLE` and in `ALL_MACHINE_LOCAL`. Settings rows come only from `projectSettings(declarations, adapterCatalog)`; a `locked` row (a read-only instance's permission) is refused by `checkSettingValue` and `settingRefusal` for every authority, and the console and dashboard never arm an edit or undo for it.
138
138
  - Configured ACP starts (`startPeerBody`): before effects refuse native launch overrides (model, route, backend, unattended, provider profile, session file, fresh) and an invalid session selector; answer `already` only for the same requested native session and never pass `qwen_cmd`; after a failed start keep the owner with `pendingOwnedProcess` on the bus, let `peer_stop` admit that offline owner and refuse starts until it is confirmed gone, reporting only a withheld-detail reason. In `taskOp`, refuse a read-only instance's op outside `READ_ONLY_HUB_TOOLS` before effects. Publish `configuredAdapters`, `startablePeers` and `readOnlyPeers` in status as bounded ids only. Keep controlled recovery refused (`session.recoveryRefusal`); crash resume passes only a bounded, control-free recorded `sessionId`, never a recorded model.
@@ -149,7 +149,7 @@ Scope: the operator console, control WS and its protocol, state files, the dashb
149
149
 
150
150
  - Classify HEAD moves with bounded, append-fenced per-worktree reflog evidence. Exclude only incoming checkout/merge/pull/proven-fast-forward reset paths; preserve commit/amend/cherry-pick and sequencer replay changes. Take a rebase/pull --rebase start checkout's incoming paths from the single `merge-base --all` of old and upstream to upstream (no base or several is unknown), so replayed own commits stay attributed; a proven fast-forward reset stays incoming even when its target holds the peer's commit from another worktree (#612). Batch `diff-tree --stdin` only for single-parent pick and commit rows; diff squash, fixup, reword and edit rows one by one. Never exclude paths still dirty against end HEAD (autostash/checkout -m included). Unreadable or ambiguous movement/capture evidence is unknown, never an exclusion. Compute a concurrent change set once and publish no more than one conditional notice per affected task. Keep per-task-pair research events. Cache only raw checkout-branch probes within one synchronous burst, and reapply current privacy screening on every status rendering (#576).
151
151
 
152
- - Share one monotonic 250 ms snapshot Git budget until the next event-loop I/O turn. Repository/HEAD probes, capture and end diffs consume the same remaining deadline; exhaustion or unreadable diff evidence records unknown trees and no attribution/undo, with one diagnostic per burst. Never substitute a stale baseline or apply a late result (#576). `DaemonOptions.snapshotClock` is host-only (tests hold it, rule: `tests.md`): never read it from configuration or a tool, production leaves it unset (`performance.now`), and the share stays 250 ms with `snapshotBurstMs` still clamped to it. Every deadline comparison goes through `budgetNow(budget)`, never `performance.now()` against `budget.deadline`.
152
+ - Share one monotonic 250 ms snapshot Git budget until the next event-loop I/O turn. Repository/HEAD probes, capture and end diffs consume the same remaining deadline; exhaustion or unreadable diff evidence records unknown trees and no attribution/undo, with one diagnostic per burst for a non-routine capture; a routine turn boundary logs only when its exhaustion starts a cooldown. Never substitute a stale baseline or apply a late result (#576). `DaemonOptions.snapshotClock` is host-only (tests hold it, rule: `tests.md`): never read it from configuration or a tool, production leaves it unset (`performance.now`), and the share stays 250 ms with `snapshotBurstMs` still clamped to it. Every deadline comparison goes through `budgetNow(budget)`, never `performance.now()` against `budget.deadline`. `SnapshotCooldown` (`src/hub/snapshots.ts`, #1550) counts one exhaustion per execution root per burst and, after `SNAPSHOT_COOLDOWN_FAILURES` in a row, skips routine boundary captures for `SNAPSHOT_COOLDOWN_MS` with unknown evidence; keep it in memory only and never let a skipped boundary reuse an earlier tree.
153
153
 
154
154
  - Channel tool-result hints (#493, #221): `withPendingHint` (`src/adapters/claude-channel.ts`) appends fresh `delivery_holds` counts, and drops the "call hub_inbox" advice whenever the same reply carries a held-delivery hint, because `bus.pull` refuses under that hold and the advice would send the session into a refused read. A `hub_inbox` result that already says how many messages remain unread adds only the important count, never a second queued count. A `hub_inbox` result that renders its own held or accepted metadata (`HELD_HINT_INCLUDED`) gets no second held hint and no polling advice, and unavailable metadata adds the inspect step instead of "Nothing is waiting" (#1172). Held bodies (`renderHeldInbox`, #1359) go in their own second content block, the first block keeping queued and local messages, and a render failure is a fixed warning that keeps the normal pull. Do not add a Claude client-version gate on steer without a probe of the older client and an optional hello field that carries the version (background: README).
155
155
  - For optional Record read projections, bind `recordReadVersion` to memory/profile, privacy, execution cwd and effective Record policy, not the global config revision. Preserve already-admitted public recall across unrelated roster reloads; keep capture-generation and delivery-membership fences independent.
@@ -4,12 +4,13 @@ Scope: the hub-native local worker, its tools, path guard, denylist and seatbelt
4
4
 
5
5
  - Before editing a probe-only lifecycle, capability or sandbox branch, read `docs/design/guidance-probes.md` (T2 confined adapter contract).
6
6
  - Nothing the local worker executes may run outside `sandboxedExec`; a new tool that spawns a process goes through it, and a tool that touches a path goes through `guardPath`.
7
+ - Use `sandboxCommandEnvironment` for the per-command `TMPDIR` and package-manager cache defaults in both `sandboxedExec` and the sandboxed host shell wrapper; explicit cache values win, and the owned temp directory is removed after the command.
7
8
  - The headless Claude host wrapper (#845, `HostShellWrapper` in `src/hub/claude-shell-wrapper.ts`) runs its read-only and check/test/build grants under this same `profile()` plus a deny-only refinement (`src/hub/task-shell-sandbox.ts`, and the hub state dir): it repeats `sandboxedExec`'s own-temp allow suffix and its `readOnlyData` broad-write guard, so change both places together, and keep the refinement deny-only. The wrapper and the read-only shell proof take their fixed environment from `hostShellEnvironment` (`src/local/shell-environment.ts`), which must equal the baseline `sandboxedExec` builds inline (`test/claude-shell-wrapper.test.ts` compares them); never inherit a native agent's environment there.
8
9
  - A timeout or abort in `sandboxedExec` marks the result `(killed: <signal>, timeout?)` from its own `killRequested` flag, never only from the exit signal: a shell may report its killed child as a normal exit 137.
9
10
  - The sandbox denies home reads by default (toolchain dirs, the project and its real git dir excepted) and all network, loopback included: claude-mem and the Codex app-server listen on loopback without auth. Tests that bind a local port therefore fail when the worker runs them, also with `local.bash_network: true` (the egress proxy keeps loopback closed, and the proxy variables send a test's plain-HTTP `fetch` to the proxy, which refuses it); that is the intended trade-off, and `"direct"` is the switch until a later release removes it.
10
11
  - The seatbelt profile refuses the `.git` name itself at any depth (creation, rename, symlink, gitfile), `config`, `config.worktree` and `hooks` directly under it, `commondir` at any depth below it or below an external git dir, and `.agenthub` anywhere in the project, every name folded against the 16 code points HFS+ ignores (#270). Every `modules/` tree the project can reach (the common dir's, the worktree's own, every linked worktree's under `<common>/worktrees/<wt>/modules/` as a pattern so a tree or worktree that does not exist yet is covered, #518, and each discovered submodule's own `modules/`) refuses EVERY write that is not inside a discovered submodule git dir (#520): nothing is exempt by name, so a fake git dir called `refs`, `logs` or anything else cannot be planted for a later unsandboxed `git submodule update --init` to reuse. Inside each discovered git dir `D` the refusals are anchored to `D`: `D/config`, `D/config.worktree` (folded in both halves), `D/hooks` and what is below it, and `D/worktrees/*/config.worktree`, with `D/worktrees`, each `D/worktrees/<name>` and `D/hooks` refused as directory entries too, so none can be moved out, edited and put back; a submodule's own linked worktrees keep a `modules/` of their own at `D/worktrees/<name>/modules`, which gets the same everything-not-discovered refusal by pattern (so one that does not exist yet is covered) and has its `modules` entry refused as a target; `D/logs`, `D/objects` and `D/index` stay writable, and since #1123 `D/refs`, `D/packed-refs`, `D/HEAD` and `D/worktrees` are refused like the project's own (`gitRefRules` gets the discovered dirs), so commit, branch, tag and rebase fail in a submodule too, and a submodule really named `refs` or `logs` is protected like any other. `hooks` is anchored by path depth (`hooksUnder`), never by an unanchored any-prefix name, which also matched a project under a directory named `hooks`. The worktrees container and each worktree git dir are refused as directory entries too (otherwise an ancestor can be moved out of the protected path, edited and moved back), and so are the discovered git dirs, the modules root and the components in between (rename, replace, symlink, recreate). Keep every regex literal under 1024 bytes (UTF-8 bytes, not characters), and never put the git path and a folded name in one literal: the root is its own `require-all` filter, so the folded literals are the same size at any path length (`test/sandbox.test.ts` asserts it). Known residuals: a nested repository in bare layout (the hub never runs git there; docs/security.md), folded spellings of the components between `.git` and a submodule's git dir on a volume that folds names (the 1024-byte SBPL literal cannot hold a folded path; external git dirs carry the same residual since #270), and the submodules of a repository nested inside the project (only the project's own common dir is discovered). An external git dir's `config`/`config.worktree`/`hooks` rules, and the pattern rules for every linked worktree git dir under `<common>/worktrees/`, cover only its own children plus the hooks directory's contents: at any depth they would deny refs named `config` or `hooks` in a worktree or submodule project. The fold is a group alternation, never a character class (the seatbelt regex engine is byte-oriented and a quantifier after a multi-byte class member binds to its last byte), and every pattern keeps its `^` anchor (an unanchored starred alternation does not match). Folded literals never contain the project root: an SBPL string literal dies at 1024 bytes. The cost: `git init`, `git clone` and `git worktree add` do not run inside the sandbox, and neither do `git worktree remove`, `git worktree prune` of a stale record, `git clean -ffd` with a nested repository, `git submodule update --init` (its git dir's `config` write is refused), or `rm -rf` of a directory holding a `.git`.
11
12
  - The shared object store `<common>/objects` takes only NEW loose objects from a sandboxed command (`objectStoreRules` in `src/local/deny.ts`, #864): every write under `objects/info` (alternates, http-alternates, commit-graph) and `objects/pack` is refused, so are the `objects`, `objects/info` and `objects/pack` entries, the unlink or rename of a fan-out directory, and data, unlink, mode and flags writes to an existing loose object. Keep loose-object creation allowed (sandboxed `git add`, `commit`, `stash` need it) and never reopen packs or `objects/info` for a sandboxed command: git reads packs before loose objects and never rehashes on read, so either one replaces content that every checkout and the #845 host add/commit/push trust. `test/sandbox.test.ts` "(#864)" proves it with the real sandbox-exec. The cost: `git gc`, `repack`, `fetch`, `maintenance` and `commit-graph write` run outside the sandbox. A hardlink to an existing loose object is refused too (into the project and into the command's own temp dir); keep that case in the test. Residual: an object id that does not exist yet can be planted before git writes it; a local checkout then shows the planted bytes, and a push of that commit is rejected by the receiving side, which rehashes what it receives ("missing necessary objects"). The upgrade path is host-side git writes as in #845.
12
- - Build every git invocation outside the sandbox through the single implementation exported by exact-pinned `@staix/agent-mem/platform` (`memoryGitArgv`/`memoryGitEnv`/`memoryGitSync`), re-exported as `hubGitArgv`/`hubGitEnv`/`hubGitSync` by `src/hub/git.ts`. Keep the git export identity, behavior and direct-spawn tripwire checks in `test/hub-git.test.ts` passing; retain home compatibility and Node-safe process-entry checks in `test/memory-parity.test.ts`. The sandboxed git tool in `src/local/tools.ts` retains its own behavior. Use `{ credentials: true }` only for the memory repository the hub creates itself, never a project's repository. Use the core deny policy re-exported by `src/local/deny.ts` for guards, sandbox rules and capture; do not add another denylist.
13
+ - Build every git invocation outside the sandbox through the single implementation exported by the first-party `@staix/agent-mem/platform` entry (`memoryGitArgv`/`memoryGitEnv`/`memoryGitSync`), re-exported as `hubGitArgv`/`hubGitEnv`/`hubGitSync` by `src/hub/git.ts`. Keep the git export identity, behavior and direct-spawn tripwire checks in `test/hub-git.test.ts` passing; retain home compatibility and Node-safe process-entry checks in `test/memory-parity.test.ts`. The sandboxed git tool in `src/local/tools.ts` retains its own behavior. Use `{ credentials: true }` only for the memory repository the hub creates itself, never a project's repository. Use the core deny policy re-exported by `src/local/deny.ts` for guards, sandbox rules and capture; do not add another denylist.
13
14
  - SBPL strings go through `sbplString` (the plain `"..."` form). In the raw `#"..."` form a backslash escapes nothing, so a `"` in a path ends the literal and the whole profile fails to parse.
14
15
  - Seatbelt sees absolute paths, so `local.deny` entries are anchored under the project root.
15
16
  - `guardPath` walks with `lstat`, never `existsSync`, which follows symlinks.
@@ -40,7 +40,7 @@ Scope: the security pass of a review (`REVIEW.md`), and any change under `src/lo
40
40
  - 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
41
  - 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
42
  - The dependency volume key covers everything that decides `node_modules` (`dependencyKey` in `src/hub/check-runner.ts`); a manifest with an install lifecycle script is refused, never keyed. Never add `--ignore-scripts` or a writable shared cache to make a run pass.
43
- - Runtime dependencies stay at zero third-party packages; `@staix/agent-mem` stays exact-pinned.
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
44
  - 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
45
 
46
46
  ## A security audit turn
@@ -23,13 +23,15 @@ 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: the only trigger is the write that freed the slot.
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.
27
27
  - Bounded waits (#1454, `Tasks.wait`, `taskWait`, `hub_task_wait`): a wait is one quiet `wait recorded` history entry with `wait: {until, owner}` and the public reason as its note, never a column or a second write. `taskWait` (`src/hub/task-sweep.ts`) parses whether the latest wait remains in force from history alone (latest wait entry names the current owner, nothing state-changing after it); callers use that result for idle-sweep timing and to surface an expired wait as `wait-passed` in planner grooming. A new event that must not end a wait joins `WAIT_KEEPING_EVENTS` beside its `QUIET_EVENTS` line. `nextSweep` reads it for `idle-owner` only; never let it touch `review-pending`, `unaccepted-assignment` or `ready-unassigned`. The tool is published only while `task_sweep.enabled` (`profileTaskTools(..., wait)`, status field `taskWait`), and `Tasks.wait` refuses with the same condition, so sweep off changes no tool list. Refusals are `PreEffectToolRefusal` naming cause and next step; the reason is screened and refused, not cut, on an ordinary task.
28
28
  - Planned start (#1092): `plannedStartPending` (`src/hub/task-sweep.ts`) is the only test that a card's `plannedStart` is still ahead. Every automatic path skips such a card: dependent readiness, `backlog_ready` notices, the reserved-ready pick, auto pull and its `guard`, a hub-actor (`by === HUB`) offer, pull or assign of an ownerless backlog or proposed card, and the idle sweep. The planner digest shows it as `scheduled`. A new automatic path asks it too.
29
29
  - Per-head CI watcher (#785 P1b, `src/hub/ci-watch.ts`, `Tasks.watchCi`, `ciCompleted`, `reofferHeldReview`): when a `done` leaves a review whose admission was not ready at the task's exact full-commit head (or a review is held as premature in `sendReview`), `CiWatchers` starts at most one watcher per task and head, with chained unref'd `setTimeout`s and no interval. Each poll is one `gh pr view` through the `sdlc.gh` port (`pollCi`); `latestCheckRuns` drops older rows only when a same-name check has the same workflow identity and a unique latest start time, otherwise duplicate evidence remains. A cancelled check and a draft PR's deliberately deferred `check (macos-latest)` failure are pending, not failed, and so is an older macOS aggregate failure while a newer same-workflow `check (macos-latest) shard N/M` is queued or in progress with a later start (`awaitingDeferredReplacement`, #1490); missing ordering or workflow evidence stays a failure; other required failures remain failures. It ends on a passed result for the required checks, on `CI_WATCH_DEADLINE_MS`, on `stopCiWatchers` (daemon `stopOnce`), or silently when `ciWatchCurrent` fails (the task left `in_review`, its head or PR changed, the lifecycle is off, it turned private). `complete`, `review` (both verdict writes) and `cancel` cancel it. Each (head, outcome) is told once (`settled`), and only `passed` settles a head for good (#540): after `failed` or `incomplete` the watcher keeps reading for a rerun of that head (the first pending read after each newly told result is a new run attempt and renews the deadline once; later pending or unreadable reads and an unchanged failed result never renew it, so the watcher always ends; a deadline after a told result ends silently), and a later `hub_task_done` at that head starts one again. A newer head replaces the watcher. The result is one ids-only `ci_completed:` task envelope at `status` weight to the owner and the reviewer (`fyi` is never delivered to a peer, so it would not reach them), a console notice for `user`, and for a deadline a console notice only. A passed or incomplete result re-offers a review held as premature once (`heldReviews`, keyed by task, head, reviewer and review revision) after a fresh `reviewRequestAdmission` says ready; a failed one re-offers nothing. No task text goes in the notice, no PII task is watched, and nothing is restored after a hub restart (the next `hub_task_done` starts one). Never add a second periodic gh read outside this watcher.
30
30
  - Required checks (#1344): resolve the names only through `requiredChecksFor` / `requiredCheckNames` (`src/hub/sdlc-merge.ts`, `src/hub/sdlc.ts`); the built-in `check (...)` and `seeded guards` set applies only to this repository, and an empty set elsewhere is a `required checks unknown` blocker, never a pass.
31
+ - Draft review (#1576): admit the failed macOS aggregate only with exact-head job-step proof of its draft deferral, a matching fresh PR snapshot and every other required check green. Only on that proven draft may approval defer missing GitHub approval and known outstanding review requests; preserve change-request and unresolved-thread blockers. Never treat that admission as a successful full gate or weaken merge and identical-tree proof.
31
32
  - Build-entry guidance (#1354, `buildEntryDiagnostic` in `src/hub/build-entry.ts`) is pure display data: routing and `route explain` may show it but never read GitHub or change eligibility because of it.
32
33
  - Merge adoption (#1348, `ahub sdlc adopt-merge`, `Tasks.adoptMerge`): only the person or the one configured conductor adopts an already merged PR; it writes `approved` with the `merged outside the hub` event and creates no reviewer verdict, review metric, reviewed-head receipt, guarded-merge result or GitHub mutation, and a private task or turn refuses before any GitHub read. Its bounded GraphQL check read uses `latestCheckRuns`: discard an older same-name row only when workflow identity and a unique latest start time prove which run is newest; preserve duplicate evidence when ordering is uncertain. Contract: `docs/design/task-board.md` "Merged PR adoption".
34
+ - External merge readback (#1555, `Tasks.captureExternalMerge`, `settleMergeReadbacks`): host-only and read-only on GitHub, for an approved non-PII task whose repository merge mode is `off`. It writes `sdlc.mergeReadback` with the `merge observed` event and never `sdlc.merge`, a verdict or a GitHub mutation. Save `cost` only from a complete history read, and recheck the task, receipt and policy identity after every await before the write.
33
35
 
34
36
  - Handoff idempotency (#1203 T1): the target writes a handed-off task only through `Board.proposeHandoff` (the proposal and `task_handoff_origin` row, key and request digest in one `atomic` transaction); `handoffIn` asks `replay()` before the duplicate check and again after the PII screen's await, so a retry of a key whose first attempt is still screening files nothing twice. Never `propose` then `setHandoffOrigin` for a handoff, and never compare a key to anything but this origin project's own rows.
35
37
  - Completed-change notices (#713, one per recipient per done, accepted work only, superseding by `completedFor`): rule in `bus.md`.
@@ -41,6 +43,7 @@ Scope: the task flow, assignment, the state machine and the hub's MCP tools. Rea
41
43
  - Conductor authority requires the explicit unique role before capability checks. The only exceptions run before that check in `Conductor.execute` and stay task-scoped: a task's current owner and reviewer read it with `hub_task_show` (#208; a reviewer-backend peer only during its bound review, rule below), and its proposer redirects it with `hub_task_assign` while nobody ever accepted it and no person moved it (#207). Removing them strands reviewers that missed a review request. Assignments preserve the acting peer. A peer releases only its own conductor hold; operator release and manual, quota and recovery holds remain separate paths.
42
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.
43
45
  - `taskOp` (`src/hub/daemon.ts`) lists full PII rows only when `onPrem` holds: an in-process peer whose definition sets `trust.onPrem` (only the local worker) inside a PII turn (#230). Every other caller, the local worker's ordinary turns included, gets stubs. `assign()` (`src/hub/routing.ts`) is the PII gate: it admits PII work only for `trust.onPrem`, and an unknown id is never on-prem. `relayCandidates` only orders the preferred handoff peers by the same field; never treat its order as the gate.
46
+ - A roadmap part accepted with `ahub roadmap decompose <id> --accept <part>` is the person's own intake hold, not a second state: `Tasks.roadmapDecomposePart` stages a `draft` backlog task through `propose` with the host Symbol `HOST_ROADMAP_DRAFT`, links it as a milestone `task`, and keys it by (answer, part) in `milestone_decomposition_accepts`, so a repeat returns the same draft. That Symbol is the only way a non-person stages a draft, and it still needs `backlog` and the configured planner or conductor; releasing it stays `ahub intake approve`, and the reply is `publicView`, so a private part reads `[pii]`. The accept is single-flight per (answer, part) through `decompositionAccepts`, so a concurrent accept reads the first one's row instead of making a second draft, and everything after `propose` runs through `releaseNotice`: never add a bare call to that tail, or a settled milestone would refuse a caller whose draft is already saved.
44
47
  - `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).
45
48
  - 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`.
46
49
  - Supervision reasons use structured enums, never history notes, check output or approval titles. Round signatures survive restart; later summaries count only newly joined tasks.
@@ -130,7 +133,7 @@ Scope: the task flow, assignment, the state machine and the hub's MCP tools. Rea
130
133
  - Declared needs (#1081, 2026-11-02): `needs_network` and `needs_worktree` are task signals set only by an explicit `true` in `Tasks.propose` (never inferred from text). `assign()` in `routing.ts` reads each as a refusal code (`network`, `worktree`) against `PeerCapabilities.network` / `.worktree === false`, and `Tasks.declaredNeedCheck` repeats both at accept, before any write: that check is what stops a sandboxed peer from accepting work, failing at `git worktree add` (#270) and leaving an empty branch ref (#621, #565). `peerCapabilities` in `daemon.ts` is the only producer: unsandboxed peers are `true` for both, hub-sandboxed peers have `worktree` from `TaskWorktrees.available()` (#1115: true only where the hub can make the worktree, else false with its cause and next step) and `network` from `sandboxNetwork !== false` (the one `local.bash_network` setting). Unknown (no entry) is never a refusal. Keep the four lists together when you add a need: `RoutingRefusalCode`, `TASK_STALL_CODES`, the `requireCapabilities` filter and `declaredNeedCheck`.
131
134
  - Hub-made task worktree (#1115, 2026-11-02, `src/hub/task-worktree.ts`): `Tasks.accept` calls `hubWorktreeFor` right before `acceptanceCapacity` and the accept write, only for a hub-sandboxed owner (`TaskWorktrees.applies`), a non-PII task, and write-class work (`writesRepository(task.class)` in `routing.ts`: `implement` and `bulk_edit`, #1129) or a declared `needs_worktree`, and clears it again (`undoWorktree`) when anything throws before the write. `Tasks.decline` and `Tasks.cancel` call `releaseHubWorktree` after their board write. The daemon's `hub_task_done` case calls `tasks.worktreeHandoff` BEFORE `tasks.done` and passes its `{ commit, branch }` refs on, so `Tasks.done` itself is untouched and its head gates see an ordinary full-SHA refile; keep the hook out of `done`. The sandbox profile is not changed by this hook. Since #1123 it refuses ref, HEAD, packed-refs and worktree-admin writes, so a sandboxed peer cannot commit at all and the hub's commit is the only one; still never trust what is under `.git`, and commit only when the branch tip equals the recorded base or the hub's own last commit (the record lives in `<state>/task-worktrees.json`, which no sandbox root contains), because a rule can be loosened later and a same-user process is outside the sandbox. Since #1129 the hook covers every write-class task, so a hub-sandboxed owner of `implement` or `bulk_edit` work always has a hub worktree and a hub commit; keep `writesRepository` the one definition that routing and `Tasks` both read.
132
135
  - Focused-check dependency preparation (#1447): after a task is accepted, the hub may prepare the task worktree's dependencies and report a fixed prepared/not-prepared result in that owner's task context. Preparation is advisory; do not treat it as a check result or replace the remote/full verification gates.
133
- - Roadmap milestones and placement (#1479/#1481): `docs/design/roadmap.md` is the contract. `Board` stores rows and links; every external write goes through `Tasks` with revision and privacy checks. Triage suggestions are inert until accepted; GitHub import is person-only and dry-run by default. Keep private membership count-only and preserve the recovery compatibility check.
136
+ - Roadmap milestones and placement (#1479/#1481): `docs/design/roadmap.md` is the contract. `Board` stores rows and links; every external write goes through `Tasks` with revision and privacy checks. Triage suggestions are inert until accepted; GitHub import is person-only and dry-run by default. A decomposition (#1480 R2 part 1) is inert too: a part is kept only when it cites an id the prompt offered, and nothing reads `milestone_decompositions` until a later R2 part intakes one. Keep private membership count-only and preserve the recovery compatibility check.
134
137
  - Pi step-ceiling escalation (#1447): `step_limit` is a distinct task-move reason from `inference_failed`; only a settled ceiling can receive the bounded, acceptance/session-bound continuation. See the dogfood row for coverage and live-proof limits.
135
138
  - Paged `hub_task_list` (#1083, 2026-11-02, `src/hub/task-list-page.ts`, the `hub_task_list` case in `daemon.ts`): an agent (`by !== USER`) always gets `{tasks, total, next?}` and the console gets the bare array unless it names `limit`, `cursor`, `ids` or `detail`; keep that split, because `ahub board`/`ahub tasks` and `test/cli-json-guard.test.ts` read the array. Build every row with the existing `listRow` (it starts from `tasks.publicView`, so PII stays a stub and the `board-column-started-projection` seed text is unchanged) and only then reduce it with `compactRow`; never build a compact row from the raw `Task`. The cursor is a keyset (`updated.id`), not an offset. A new caller of `hub_task_list` as a peer reads `.tasks`, or passes `ids` for one task. Do not raise the 200 cap or the default 50 without re-running the 600-task size test.
136
139
  - Urgent accept and the WIP refusal (#1080, 2026-11-02): `acceptanceCapacity` takes an `urgent` mode, and only `accept` passes `"displace"`; `acceptReviewed` and the early check in `accept` pass `"check"`, which never writes. `displaceOffers` runs immediately before the accept write, after every gate (spec, plan, study), so a refused accept can never have taken back an offer. It takes back only offers the owner never accepted (`displaceable`: state proposed, owned, not pinned, not urgent, no `taskHasStarted`), newest handed first, and only as many as the limit needs; if they are not enough it takes none and refuses. The refusal comes from `wipSplit` and names accepted, offered and reserved separately, with a next step. Do not widen `displaceable` to accepted or urgent work, and do not call the displace mode from any other path.
@@ -9,7 +9,7 @@ Scope: tests, fakes and the test gate. Read before adding or changing a test or
9
9
  - A fixture that walks a policy table (a `COMPAT` entry list, a registry) derives its per-entry values from the table, never a fixed list of keys or versions a planned entry is not in: the compat watch test builds every served version and the ahead/unknown row from `COMPAT[id]`, so an added entry (`pi`, #843 AC2) is covered without editing the test.
10
10
  - Tests that are not about batching build the bus with `batchMs: 0`; with the default 15 s window a lone status envelope looks like a lost message.
11
11
  - A test that writes an executable shim and then times a product call through it (a `git` wrapper on `PATH`, as `test/memory-code-head-684.test.ts` does) runs the shim once by absolute path first, outside the measured region: the first exec of a newly written executable costs about 250 ms on macOS (#519). Never widen the product's bound or weaken the assertion for it.
12
- - A test timeout that fires while `Bun.spawnSync` runs can start the next test inside spawnSync's own event loop (Bun 1.3.14 and 1.4.2; not rechecked on 1.4.4; background: README). `scripts/check.sh` runs tests with a 20 s timeout and under `scripts/hang-watch.sh`; a test that spawns and reads the process table gets a timeout of its own, never above 20 s: an explicit larger timeout overrides the gate's `--timeout 20000`, so shorten the scenario instead.
12
+ - A test timeout that fires while `Bun.spawnSync` runs can start the next test inside spawnSync's own event loop (Bun 1.3.14 and 1.4.2; not rechecked on 1.4.4; background: README). `scripts/check.sh` runs tests with a 20 s timeout and under `scripts/hang-watch.sh`; a test that spawns and reads the process table gets a timeout of its own, never above 20 s: an explicit larger timeout overrides the gate's `--timeout 20000`, so shorten the scenario instead. Narrow exception (person's ruling 2026-11-20, #1577): a test that must keep a real multi-second process may set its own timeout above 20 s only when its body has a deadline, every cleanup wait is bounded, and the body deadline plus the cleanup bounds stay below the test timeout, so the timeout can never fire inside a `spawnSync`. The instances are `test/conductor-recovery-process.test.ts` (60 s: 30 s body deadline, post-receipt waits of 6 s each, cleanup waits of 3 s each) and `test/staged-project-isolation.test.ts` (90 s: 45 s body deadline, cleanup waits of 6 s each; its body keeps two real daemons and a real upgrade CLI child and took 14.7 s in a green macOS shard run, so the gate's 20 s left no room for a slower one).
13
13
  - Sandboxed commands and the MLX server get a fixed environment (`PATH`, `HOME` and their own keys), so test knobs for their fakes travel in a wrapper script or argv, not in `process.env`. Daemon-owned peer children use `peerChildEnv`, which drops `ORCA_*` and replaces agent identity markers; a person-owned native launch preserves only its own pane's `ORCA_*` context while dropping inherited agent identity.
14
14
  - Bind agent identity markers explicitly in native/CLI fixture children. The full gate starts the test runner without inherited agent markers (including `AGENTHUB_DELIVERY_ONLY`) and without an `ahub claude` session's hub variables (`AGENTHUB_PROJECT_DIR`, `AGENTHUB_STATE_DIR`, `AGENTHUB_INSTANCE_ID`, `AGENTHUB_LAUNCH_ID`); a new variable a native session exports and a fixture child reads joins that `env -u` list in `scripts/check.sh`. Never weaken production marker detection to make them pass.
15
15
  - A fixture that spawns the real channel plugin (`src/adapters/claude-channel.ts` or `plugins/agent-hub/server.js`) to act as a peer runs it with `cwd` at the hub's project root, made with `realPath` (the macOS temp dir is a symlink). The plugin chooses its hub through `channelProject` (rule: `daemon.md`), so from another cwd it joins the wrong hub, joins as a distinct session or connects nowhere. Only tools mode with both `AGENTHUB_STATE_DIR` and `AGENTHUB_PROJECT_DIR` set skips that check. A fixture whose plugin must push as a channel (not fall back to tools mode) injects the parent row with `syntheticClaudeParentEvidenceSetup()` (`test/fakes/claude-channel-parent.ts`, #1171), which replaces only `claudeParentCommandPort.read`; the production marker and classifier still run, so never stub `classifyClaudeParentCommand` or skip the evidence check. For an unchanged published bundle with an inlined observer port, use the published-leg raw port-fact injection in `test/published-protocol-compat.test.ts`: bootstrap its import with Bun's built-in `mock.module` only for `child_process` and `node:child_process`, export the real functions and replace only `spawnSync` for `/bin/ps -ww -p <direct-parent-pid> -o command=`. Return `SYNTHETIC_CLAUDE_PARENT_COMMAND` from the same fixture helper and delegate every other call. Preserve the bundle bytes, classifier, inherited marker, parent-identity check, assertions and timeouts. This synthetic host observation is not native-launch acceptance. A second opted-in session attached while a fixture owner holds the peer stays a standby (#1174): close the owner and wait for offline before attaching the session under test (`test/channel-inbox-daemon.test.ts`).
@@ -39,7 +39,8 @@ Scope: tests, fakes and the test gate. Read before adding or changing a test or
39
39
 
40
40
  - `scripts/check.sh` pins the test environment (#610): `GIT_CONFIG_GLOBAL=/dev/null`, `NO_COLOR` unset, `TERM=xterm-256color`, temp root under the OS per-user temp dir, agent markers cleared. A test that needs a person's git config or color settings sets them itself. `--changed` selects tests with `scripts/changed-tests.mjs`: changed tests (nested suites included) plus every test that names a changed file directly; docs need none; any other changed file no test names, and any gate, package or shared-fixture change, runs everything.
41
41
  - `scripts/check.sh` holds the repo's heavy-job slot (`<git common dir>/ahub-heavy.lock`, #398) for the whole run, so a test never runs the real gate; `test/check-lock.test.ts` runs a copy in a scratch repo.
42
- - The whole-suite watchdog is `scripts/hang-watch.sh PID SECONDS [PROGRESS_FILE QUIET_SECONDS]` (#115, #516). `scripts/check.sh` sends bun's stderr (where it prints results) through a fifo to `scripts/progress-tee.sh FILE`, which forwards every line unchanged and appends one byte to FILE per `(pass)`, `(fail)`, `(skip)` or `(todo)` line and per test file header (under mawk only with `-W interactive`: mawk reads a pipe in blocks, so without it nothing counts until the input ends, #883); the watchdog stops the suite when FILE has not grown for `AHUB_CHECK_QUIET_S` (default 300, set in `.github/workflows/check.yml`, above the 120 s of the longest explicit test timeout). That is the hang detector, so a slow suite that keeps passing tests is never cut, and a test that logs without finishing is not progress. `AHUB_CHECK_HANG_S` (default in `scripts/check.sh`, 2250 s since #1086: 1.5 times the longest of two measured full runs on dgx02, 1487 s of test time; hosted values for both OSes in `.github/workflows/check.yml`; #378, #593) is only the backstop for a run that keeps printing results while hung: raise it, with the job's `timeout-minutes` (room above it for setup), only when a healthy run nears it, never for a hung test, and keep the per-test 20 s timeout. The two-argument form (no file) is the old total-time bound, still used by the CI timing job and `scripts/seeded-check.ts`. A fifo and a filter of its own, never a pipe (`$!` must stay bun's pid) and never a process substitution (it cannot be waited on with a bound); `scripts/progress-tee.sh` is in the `--changed` FULL list. `test/hang-watch.test.ts` covers the watchdog, the filter and the fifo wiring.
42
+ - A red gate names its step (#1577 entry 3): `scripts/check.sh` wraps each once-only step in `step NAME CMD...` and prints `check: FAILED step '<name>' (exit N)` through `failed_line` (plus a `::error` annotation under GitHub Actions); after `bun test` it adds the failing-test count, the first `(fail)` line and the last test file header, read from the summary file `scripts/progress-tee.sh FILE SUMMARY` writes, or says the runner exited or was signalled with no `(fail)` line, and names the leak scan. That count is distinct `(fail)` rows: bun prints every failing test again in its `N tests failed:` recap after the last file, byte for byte, and the recap carries no file header, so the last header is still the file that was running. A new step in the gate goes through `step`, and `test/check-failure-names.test.ts` runs the real script against a fake `bun` to prove each path. It changes no exit status and adds no retry.
43
+ - The whole-suite watchdog is `scripts/hang-watch.sh PID SECONDS [PROGRESS_FILE QUIET_SECONDS]` (#115, #516). `scripts/check.sh` sends bun's stderr (where it prints results) through a fifo to `scripts/progress-tee.sh FILE`, which forwards every line unchanged and appends one byte to FILE per `(pass)`, `(fail)`, `(skip)` or `(todo)` line and per test file header (under mawk only with `-W interactive`: mawk reads a pipe in blocks, so without it nothing counts until the input ends, #883); the watchdog stops the suite when FILE has not grown for `AHUB_CHECK_QUIET_S` (default 300, set in `.github/workflows/check.yml`, above the 120 s of the longest explicit test timeout). That is the hang detector, so a slow suite that keeps passing tests is never cut, and a test that logs without finishing is not progress. `AHUB_CHECK_HANG_S` (default in `scripts/check.sh`, 2700 s since #1564: healthy full runs exceeded the earlier 2250 s backstop while still reporting passing tests; hosted values for both OSes in `.github/workflows/check.yml`; #378, #593) is only the backstop for a run that keeps printing results while hung: raise it, with the job's `timeout-minutes` (room above it for setup), only when a healthy run nears it, never for a hung test, and keep the per-test 20 s timeout. The two-argument form (no file) is the old total-time bound, still used by the CI timing job and `scripts/seeded-check.ts`. A fifo and a filter of its own, never a pipe (`$!` must stay bun's pid) and never a process substitution (it cannot be waited on with a bound); `scripts/progress-tee.sh` is in the `--changed` FULL list. `test/hang-watch.test.ts` covers the watchdog, the filter and the fifo wiring.
43
44
  - A seed's named test must run on Linux, where the seeded job runs: a darwin-only test reports no result there and fails the job (#382). Cover a macOS-only protection with its regression test instead.
44
45
 
45
46
  - The `closing-refs` workflow (`.github/workflows/closing-refs.yml`, #760) runs `scripts/check-closing-refs.mjs` (PR number from argv or `PR_NUMBER`) on `opened`, `edited`, `reopened` and `synchronize`: it reads `gh pr view --json closingIssuesReferences,body,title,commits` and fails when GitHub would close an issue the title and body only mention with `Refs`, a negation or a qualifier (`Refs #15. Does not close #15.` and `Refs #15. Partially fixes #15.` fail, `Refs #15.` and `Fixes #15` pass), or when a commit message has a closing keyword, negated or not, for an issue the title and body do not mean (a squash merge carries it). An issue linked only in the sidebar passes. A keyword is meant only when nothing earlier in its sentence (ending at `.`, `!`, `?`, `;` or a line break, never a comma) matches `NEGATION`; widen that list, never narrow it to let a qualified close pass (background: README). `mentioned`, `keywordReferences`, `intentionalCloses`, `closingMisuse` and `commitMisuse` are pure and covered by `test/closing-refs.test.ts` with the real `gh` shape (`repository.name`, `repository.owner.login`); its command test puts a fake `gh` first on `PATH`, never the real one. Run it by hand with `GITHUB_REPOSITORY=<owner/repo> node scripts/check-closing-refs.mjs <number>`.
@@ -49,7 +50,7 @@ Scope: tests, fakes and the test gate. Read before adding or changing a test or
49
50
  - A daemon test that writes a config file and then calls `settings_reload` passes `configWatch: false` (`DaemonOptions`, #546), unless the watcher is what it tests. The daemon's file watcher (100 ms poll, 100 ms debounce) publishes the same bytes, so whichever of the two runs second reports `applied: []`, and a watcher pass between a preview and its confirm replaces the confirmation token. Never lengthen a sleep or loosen `applied` for it; the watcher has its own tests in `test/settings-reload-daemon.test.ts`.
50
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`.
51
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`).
52
- - Raising the `@staix/agent-mem` exact pin moves its version literal in `test/memory.test.ts`, `test/memory-profile.test.ts`, `test/memory-profile-daemon.test.ts` and `test/doctor-model-aliases.test.ts` in the same PR. Any other test edit in a pin 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`.
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`.
53
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
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.
55
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.
@@ -528,12 +528,14 @@ When a quote-bearing review reaches a peer without a stable native session ID, t
528
528
 
529
529
  The local worker binds review observer exclusion to its actual input envelopes before awaiting model or tool work. An anchored `hub_review` submission latches that exclusion for the rest of the batch/turn, including sibling and later tool calls. While latched, `hub_remember` and `hub_task_propose` are refused before reaching the host task tools; the caller can retry them in a later ordinary turn. Such turns do not call capture, commit review messages into later model history, or put provider error text and partial model text in failure logs. A later ordinary local turn resumes ordinary history and capture without inheriting the review payload. This is distinct from the PII policy: a public review package retains ordinary task authority and does not acquire an on-campus-only model route. Vendor-native histories remain owned by their adapters; the hub's current-turn and named-parent observer provenance is described in [the bus contract](bus.md#review-observer-provenance-1056).
530
530
 
531
- ## Headless Record boundaries (#1320)
531
+ ## Owned Record boundaries (#1320, #1549)
532
532
 
533
- Only a host-owned getter supplies the imported agent-mem instruction at an admitted headless turn boundary, after owned input and busy state exist and before the native prompt/model request. Multi-call local turns keep one fixed prompt. Native-client prompts, steer, Claude hooks and isolated reviewers keep their separate surfaces. A getter failure omits optional Record guidance and does not change ordinary routing. The production getter reads the public `recordsEnabled(activeHome, executionCwd)` accessor from the exact-pinned amem package; either machine or repository false disables the optional Record path. Its boolean revision is not a privacy-policy fingerprint: current package and hub screens are rechecked separately before effects.
533
+ Only a host-owned getter supplies the imported agent-mem instruction at an admitted headless turn boundary or a verified Pi TUI hub-delivered turn boundary, after owned input and busy state exist and before the native prompt/model request. Pi TUI binding requires a current verified process and session, and keeps the same turn, owner, privacy and policy fences as headless. Multi-call local turns keep one fixed prompt. Native-client prompts, steer, Claude hooks and isolated reviewers keep their separate surfaces. A getter failure omits optional Record guidance and does not change ordinary routing. The production getter reads the public `recordsEnabled(activeHome, executionCwd)` accessor from the exact-pinned amem package; either machine or repository false disables the optional Record path. Its boolean revision is not a privacy-policy fingerprint: current package and hub screens are rechecked separately before effects.
534
534
 
535
535
  Model final output uses a host-only final-answer callback distinct from explicit send tools and diagnostic messages. Only normal completion can append Record rows; partial output is stripped for sharing without certifying a settled record. Capture binds immutable owner, turn, session/generation, execution cwd, profile and policy identity. Replacement, exclusion or unsafe steering revokes the frame before any later append. This grants no task, permission, native consumption or model acceptance authority.
536
536
 
537
+ Pi context occupancy is the last assistant prompt's input plus cache read and cache write counters against the current native model's context window, never cumulative consumption. The extension reports model and occupancy through the authenticated owner bridge; the adapter admits readings only for the current verified session and turn. Missing or invalid components remain unknown. The verified TUI session's native model is session evidence, while a configured choice without native observation remains configured evidence.
538
+
537
539
 
538
540
  ## Restoration launch diagnostics (#1426)
539
541
 
@@ -37,6 +37,8 @@ The [design ledger](../specs/2026-09-19-agent-hub-design.md) records history; cu
37
37
 
38
38
  `src/hub/daemon.ts` is the project runtime's composition root. It owns the local control service, peer registry, `Bus`, `Tasks`, configuration, policy admission, and recovery coordination. A project has one local daemon and task board; its peers communicate through that daemon. The boundary keeps transport code from becoming a second source of role or recovery authority ([#625](https://github.com/STAIxBWLB/agent-hub/issues/625), [#900](https://github.com/STAIxBWLB/agent-hub/issues/900)).
39
39
 
40
+ After five consecutive exhausted routine snapshot bursts, the resolved execution worktree skips capture for ten minutes; skipped snapshot, diff, HEAD-move and submodule evidence remains unknown. A stored empty path list paired with a missing tree never establishes that no edits occurred. The next boundary retries and success clears the in-memory streak (#1550 AC3).
41
+
40
42
  `PeerAdapter` in [peers.ts](../../src/hub/peers.ts) is the shared native-runtime interface. Fixed adapters translate host lifecycle, messages, permissions, and delivery receipts into it; daemon-owned policy decides what those facts permit. Claude's plugin channel uses MCP over stdio and the authenticated control connection, Codex uses the app-server proxy, and Kimi supports a pull-only TUI by default or explicitly selected headless ACP mode. Keeping protocol translation outside task policy prevents vendor-specific branches there ([#625](https://github.com/STAIxBWLB/agent-hub/issues/625), [#316](https://github.com/STAIxBWLB/agent-hub/issues/316)).
41
43
 
42
44
  External adapter modules are opt-in, pinned at startup, and limited to the accepted headless ACP contract; a module does not gain a generic native lifecycle or sandbox authority. That limit exists because imported code executes in the daemon's trust domain, so source pinning and an explicit capability ceiling are necessary ([#754](https://github.com/STAIxBWLB/agent-hub/issues/754)).
@@ -50,7 +50,7 @@ and the CLI, preserving unknown evidence and count-only private membership
50
50
  | Messages have durable delivery evidence, and uncertain attempts are distinct from task completion. | A restart, failed notification or retry must not silently repeat work or approve a task ([#37](https://github.com/STAIxBWLB/agent-hub/issues/37), [#1079](https://github.com/STAIxBWLB/agent-hub/issues/1079)). |
51
51
  | Hub-owned traffic uses in-process model routes and OmniRoute; native subscription traffic keeps its native authentication. | This separates peer policy, per-call model selection and provider credentials without a second routing sidecar ([#553](https://github.com/STAIxBWLB/agent-hub/issues/553)). |
52
52
  | Host policy screens private task and turn text before shared projection, memory or model use, with positive campus admission where PII-sensitive inference requires it. | A missing network fact or a model-selected destination is not privacy authorization ([#198](https://github.com/STAIxBWLB/agent-hub/issues/198), [#230](https://github.com/STAIxBWLB/agent-hub/issues/230)). |
53
- | Portable memory comes from exact-pinned first-party amem; the hub keeps caller and privacy policy. Legacy claude-mem is import-only. | One storage core avoids competing memory implementations and dependence on an external worker for runtime recall and capture ([#752](https://github.com/STAIxBWLB/agent-hub/issues/752)). |
53
+ | Portable memory comes from first-party amem on a declared range below the next major, gated by its host API range; the hub keeps caller and privacy policy. Legacy claude-mem is import-only. | One storage core avoids competing memory implementations and dependence on an external worker for runtime recall and capture ([#752](https://github.com/STAIxBWLB/agent-hub/issues/752)). |
54
54
  | Code review, automated checks, hosted CI and native/live verification remain distinct evidence. | A code-only reviewer or a passing fixture cannot certify a real account, sandbox or provider interaction ([#852](https://github.com/STAIxBWLB/agent-hub/issues/852)). |
55
55
  | Ordinary peer, configured conductor and person authority are different; release consent originates in the person's explicit decision. | Model output and relayed peer messages cannot grant privileged operational or release authority ([#812](https://github.com/STAIxBWLB/agent-hub/issues/812), [#1063](https://github.com/STAIxBWLB/agent-hub/issues/1063)). |
56
56