@staix/agent-hub 0.38.0 → 0.39.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 (144) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/README.md +17 -7
  3. package/docs/adding-an-ai-tool.md +6 -4
  4. package/docs/agent-notes/README.md +16 -0
  5. package/docs/agent-notes/adapters.md +4 -2
  6. package/docs/agent-notes/budget.md +8 -0
  7. package/docs/agent-notes/daemon.md +15 -8
  8. package/docs/agent-notes/local-worker.md +1 -1
  9. package/docs/agent-notes/security-review.md +55 -0
  10. package/docs/agent-notes/tasks.md +15 -4
  11. package/docs/agent-notes/tests.md +3 -2
  12. package/docs/design/adapters.md +51 -0
  13. package/docs/design/agent-hub-architecture.md +29 -1
  14. package/docs/design/task-board.md +151 -5
  15. package/docs/dogfood.md +20 -6
  16. package/docs/events.md +3 -3
  17. package/docs/memory.md +5 -5
  18. package/docs/operations.md +177 -28
  19. package/docs/profiles.md +100 -8
  20. package/docs/quickstart.md +32 -4
  21. package/docs/research.md +6 -3
  22. package/docs/roles.md +52 -0
  23. package/docs/sdlc.md +187 -1
  24. package/docs/security.md +50 -11
  25. package/docs/text-projection.md +1 -0
  26. package/docs/verification/2026-11-13-claude-implementer-2.1.323.md +59 -0
  27. package/docs/verification/2026-11-13-codex-01672-reviewer-isolation.md +69 -0
  28. package/docs/verification/2026-11-14-0.39.0.md +51 -0
  29. package/docs/verified.json +48 -25
  30. package/package.json +3 -3
  31. package/plugins/agent-hub/.claude-plugin/plugin.json +1 -1
  32. package/plugins/agent-hub/kimi-hook.js +1953 -460
  33. package/plugins/agent-hub/server.js +2019 -498
  34. package/src/adapters/acp-model-policy.ts +1 -1
  35. package/src/adapters/acp-session-model.ts +35 -0
  36. package/src/adapters/acp.ts +14 -0
  37. package/src/adapters/agy/definition.ts +1 -1
  38. package/src/adapters/agy/hooks.ts +7 -0
  39. package/src/adapters/claude-channel.ts +1 -1
  40. package/src/adapters/claude-implementer.ts +8 -0
  41. package/src/adapters/claude-print-child.ts +26 -2
  42. package/src/adapters/claude-print.ts +4 -0
  43. package/src/adapters/codex-appserver.ts +90 -16
  44. package/src/adapters/codex-review-isolation.ts +2 -0
  45. package/src/adapters/compat.ts +4 -4
  46. package/src/adapters/conformance/fakes/acp-server.ts +11 -2
  47. package/src/adapters/conformance/fakes/app-server.ts +5 -1
  48. package/src/adapters/conformance/fakes/pi-rpc.ts +1 -1
  49. package/src/adapters/definitions/builtin-metadata.ts +6 -6
  50. package/src/adapters/definitions/native-cli-jcode-mcp.ts +18 -3
  51. package/src/adapters/definitions/native-quota.ts +122 -0
  52. package/src/adapters/definitions/native-recovery.ts +3 -0
  53. package/src/adapters/definitions/qwen.ts +1 -1
  54. package/src/adapters/kimi-review.ts +23 -0
  55. package/src/adapters/kimi-wire-usage.ts +39 -16
  56. package/src/adapters/local-worker.ts +6 -3
  57. package/src/adapters/pi-state-model.ts +12 -0
  58. package/src/adapters/pi.ts +22 -0
  59. package/src/adapters/print-result-model.ts +24 -0
  60. package/src/adapters/registry-types.ts +10 -1
  61. package/src/adapters/registry.ts +19 -2
  62. package/src/adapters/reviewer-print.ts +130 -15
  63. package/src/adapters/role-eligibility.ts +99 -0
  64. package/src/adapters/same-directory.ts +16 -0
  65. package/src/cli/agy-mcp.ts +18 -7
  66. package/src/cli/console-state.ts +3 -1
  67. package/src/cli/free-text.ts +20 -0
  68. package/src/cli/handoff-args.ts +1 -1
  69. package/src/cli/help.ts +61 -6
  70. package/src/cli/identity.ts +10 -4
  71. package/src/cli/init-prompt.ts +31 -2
  72. package/src/cli/init-roles.ts +156 -0
  73. package/src/cli/init-settings.ts +24 -2
  74. package/src/cli/init.ts +139 -17
  75. package/src/cli/main.ts +194 -49
  76. package/src/cli/model.ts +1 -1
  77. package/src/cli/output.ts +56 -1
  78. package/src/cli/preview.ts +1 -1
  79. package/src/cli/recovery-launch.ts +114 -0
  80. package/src/cli/recovery-package.ts +14 -7
  81. package/src/cli/recovery-version-preflight.ts +104 -0
  82. package/src/cli/role-doctor.ts +39 -0
  83. package/src/cli/sdlc-output.ts +66 -1
  84. package/src/cli/study-output.ts +54 -0
  85. package/src/cli/study.ts +14 -1
  86. package/src/cli/terminal-recovery.ts +14 -0
  87. package/src/cli/upgrade-presentation.ts +4 -0
  88. package/src/cli/upgrade-restore-state.ts +12 -3
  89. package/src/cli/upgrade-runtime.ts +40 -2
  90. package/src/cli/upgrade.ts +8 -4
  91. package/src/hub/advisor-survey.ts +139 -0
  92. package/src/hub/audit-source.ts +66 -0
  93. package/src/hub/board.ts +479 -14
  94. package/src/hub/budget.ts +54 -4
  95. package/src/hub/conductor.ts +14 -8
  96. package/src/hub/config-apply.ts +2 -1
  97. package/src/hub/config-edit-host.ts +77 -5
  98. package/src/hub/considered-findings.ts +47 -0
  99. package/src/hub/control-client.ts +1 -1
  100. package/src/hub/daemon.ts +343 -58
  101. package/src/hub/deliverable-files.ts +17 -1
  102. package/src/hub/dogfood-profile.ts +3 -2
  103. package/src/hub/events.ts +23 -2
  104. package/src/hub/folder-trigger.ts +11 -4
  105. package/src/hub/hub-tools.ts +88 -16
  106. package/src/hub/kimi-usage.ts +34 -2
  107. package/src/hub/lifecycle-schema.ts +3 -3
  108. package/src/hub/memory-profile.ts +9 -1
  109. package/src/hub/memory-sync-state.ts +1 -0
  110. package/src/hub/model-overrides.ts +2 -1
  111. package/src/hub/no-writes.ts +2 -0
  112. package/src/hub/operational-authority.ts +6 -1
  113. package/src/hub/operational-view.ts +5 -1
  114. package/src/hub/peers.ts +2 -0
  115. package/src/hub/plan-conformance.ts +20 -2
  116. package/src/hub/quota-account.ts +34 -0
  117. package/src/hub/recovery-policy.ts +18 -4
  118. package/src/hub/research-evidence.ts +51 -3
  119. package/src/hub/research.ts +77 -13
  120. package/src/hub/restart.ts +14 -0
  121. package/src/hub/review-budget.ts +88 -0
  122. package/src/hub/review-findings.ts +93 -12
  123. package/src/hub/reviewer-pool-config.ts +6 -2
  124. package/src/hub/reviewer-pool.ts +39 -6
  125. package/src/hub/routing.ts +7 -3
  126. package/src/hub/sdlc-merge.ts +1 -1
  127. package/src/hub/sdlc-queue.ts +14 -4
  128. package/src/hub/sdlc-release.ts +1 -1
  129. package/src/hub/sdlc.ts +10 -6
  130. package/src/hub/security-audit.ts +178 -0
  131. package/src/hub/security-pass.ts +115 -0
  132. package/src/hub/settings.ts +11 -5
  133. package/src/hub/source-read.ts +80 -2
  134. package/src/hub/sources.ts +57 -9
  135. package/src/hub/startup-event-seeds.ts +5 -3
  136. package/src/hub/startup-timing.ts +1 -0
  137. package/src/hub/synthesis-readiness.ts +279 -0
  138. package/src/hub/tasks.ts +1083 -69
  139. package/src/hub/text-projection.ts +11 -1
  140. package/src/memory/capture.ts +2 -1
  141. package/src/ui/index.html +3 -0
  142. package/src/ui/office-model.ts +11 -3
  143. package/src/ui/office-space.ts +50 -30
  144. package/src/ui/plugin.ts +21 -11
package/CHANGELOG.md CHANGED
@@ -4,6 +4,51 @@ 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.39.0
8
+
9
+ - Release N-1 for 0.39.x is 0.38.0 (exact `@staix/agent-mem` 0.24.0, control protocol 17 with descriptor floor 16); `test/fixtures/release-n-1` and `test/published-protocol-compat.test.ts` now pin it. Compatibility: the wire protocol window is unchanged at 16 through 17; the new daemon features `reviewer_quota`, `research_synthesis`, `research_evidence_withdrawal` and `advisor_surveys` are optional, and a 0.38.0 daemon answers their control ops as unknown. Files: `hub.db` gains additive tables (`advisor_surveys`, `advisor_survey_findings`, `considered_findings`, `security_audits`, `security_audit_findings`) created with `CREATE TABLE IF NOT EXISTS`, and `security_audit_findings` gains the additive columns `settled_by` and `settled_as`; there is no `hub_schema` bump, so 0.38.0 opens a 0.39.0 database and ignores them. The exact `@staix/agent-mem` pin moves to 0.26.0 (entry below).
10
+ - Reviewer quota is part of reviewer admission (hub task 924, #1446). A typed backend quota failure records a reviewer budget pause, and `review.gate` (default 0.8) skips a reviewer whose known quota reading is at or above the floor. Routing names each skipped reviewer and why, `review.max_minutes` (default 20) caps a review turn, and when every declared reviewer is paused or over the floor with a known reset, the review waits for the earliest reset instead of falling back to the person.
11
+ - Explicit opt-outs for reviewer quota admission (hub task 928, #1467). `review.gate: "off"` bypasses the floor and the unknown-reading check and disables quota waits; `review.unknown_quota: "pass"` admits a reviewer whose quota reading is unknown (the default `skip` refuses it). Budget and manual pauses still block. The admitting rule appears in `ahub route explain` and task history, the unknown-reading skip names both settings, and `ahub budget` reports the effective reviewer policy.
12
+ - Advisor surveys and a considered-findings ledger (hub task 897, #1403 T7). `ahub sdlc survey start [--focus ...]` opens a read-only planner task that reports findings in one bounded shape; vetting turns high and medium confidence findings into backlog plan cards and low confidence ones into investigate cards. Rejected findings go into an append-only considered ledger keyed by repository, pass and semantic id, so an unchanged rejected path shows "rejected before" instead of coming back. Malformed `hub_survey_report` input is refused with the field, the rule and the resend step.
13
+ - The person or the unique configured conductor can stage SDLC lifecycle settings on the person's explicit instruction (hub task 916, #1432). `ahub sdlc configure` accepts only `mode` off or advise and `required_checks`, through the structural editor's validation, revision fence, backup and atomic write; the change is pending until the next hub start. Enforce, security, eval checks and the other settings keep their person-only boundary.
14
+ - Claude Code 2.1.323 is a verified headless implementer version (hub task 921, #888), with the model-free transport and host-wrapper receipt in `docs/verification/2026-11-13-claude-implementer-2.1.323.md` (2.1.322 as control, 44 of 44 cases pass).
15
+ - Offline synthesis readiness for research (hub task 699, #931 T3). `ahub study evidence` reads the screened public evidence links (`--task` for bounded authoring bindings), and `ahub study check` binds the registered Markdown and BibTeX ids and hashes, the current claim revisions and the complete latest-link inventory into a readiness report with separate citation, source and locator, person-judgment and contract results. Missing, truncated, stale or privacy-unknown evidence reports not ready; nothing is fetched.
16
+ - The acon console shows each project as a Space group (hub task 923, #1375). A scene declares one group per project and stamps it on every actor, zone and card, so actor names are bare; desks carry the project's configured roles (at most 4 names) and a working actor's `since`. The plugin declares its snapshot reuse window.
17
+ - A restore launch refused by the version gate is diagnosed at once instead of after the full readiness wait (hub task 917, #1426). Restoration observes a nonce-bound launch outcome between wait slices and records `version_refused` or `launch_exit`; preview and staging check the configured executable's version against the verified set and machine trust first and name the peer, the version and the trust or install step.
18
+ - The daemon's startup timings split `task_runtime` into the sub-phases `task_checks`, `task_ports`, `task_board` and `task_recovery` (hub task 922, #1445), so a slow start names the slow part. #1445 stays open for the speed-up itself.
19
+ - A quota-paused Codex account re-reads its native quota every 60 seconds until the pause resumes (hub task 918, #1440). `ahub budget` shows a paused account's reset-credit count and expiry and whether ordinary usage or credits fund it, from an allowlist of native fields only.
20
+ - `ahub init` points a project that still has GSD planning (`STATE.md` with GSD frontmatter) at the new "Moving from GSD" section of `docs/sdlc.md`, which maps GSD artifacts to `ahub sdlc` and lists the person's commands in order (hub task 915, #1431).
21
+ - An unreserved planner pull names each peer's routing refusal next to the WIP, hold and exclusion reasons, and says to reserve a peer with `hub_backlog_plan fields.reserved` and pull again (hub task 919, #1430).
22
+ - An unconfigured sharded memory home is quiet like the other homes (hub task 930, Refs #1173). agent-mem words a missing sync remote three ways, and the host matched only "no sync remote" and "no generation sync remote configured", so a sharded home with no remote logged `hub memory sync failed` and its status read unknown. `quietSyncError` now also matches "no shard sync remote configured", and `classifyMemorySyncFailure` classifies that exact text as the `remote` cause, so the status is the neutral not-configured one. The other shard wordings (an invalid remote, a visibility refusal) stay real failures.
23
+ - The exact `@staix/agent-mem` pin moves from 0.25.0 to 0.26.0 (hub task 929). 0.26.0 returns the transport's existing no-remote error before policy screening when a home has no sync remote configured (STAIxBWLB/agent-mem#387, STAIxBWLB/agent-mem#388), so unconfigured homes use the existing neutral quiet-sync handling, including the sharded diagnostic from merged hub task 930; `inspectSyncPolicy` completes on generation and sharded homes above 8 MiB (STAIxBWLB/agent-mem#384, STAIxBWLB/agent-mem#394) and an incomplete `input-bound` result may carry an optional `bound` receipt, while `complete` and `reason` are unchanged; non-project hook-spool attribution and retirement add a counted `nonproject_unattributed` drop reason (STAIxBWLB/agent-mem#385, STAIxBWLB/agent-mem#386). No formats.json floor, index file name or storage format changes; N-1 compatibility is stated per surface in agent-mem's CHANGELOG 0.26.0 section. Surfacing `bound` in `ahub memory declined` stays optional follow-up work, not part of this pin.
24
+ - The conductor's start texts and type read the adapter definitions (hub task 902, #1408 T4, R5). `ConductorStart` is no longer `"claude" | "codex" | "pi"` for a terminal start: any startable kind whose person-set mode is tui returns the hub's own preview command, and `launcherPreview` takes any builtin id. The refusal for a kind the conductor may not start and the `hub_peer_start` description are built by `conductorStartText` (`src/adapters/registry.ts`) from `conductorStartable`, `optional` and the start forms, so a new kind is named without a text edit; the refusal now reads "only claude, codex, kimi, pi and local, plus the opt-in qwen and jcode, may be started by the conductor" and the tool description lists the same kinds, kimi and the TUI kinds included. `docs/operations.md` and `docs/roles.md` now say the planner default `claude` comes from the `roles` block of `templates/config.json` (copied by `ahub init`) and how to change it. Behavior is unchanged: which peers a conductor starts, and in which mode, is still decided by the definitions and the person's start mode.
25
+ - An evidence read whose inventory changed meanwhile now reports its origins as unknown instead of failing (hub task 926, a follow-up of #931, which stays open). `Tasks.evidenceOrigins` read the claim's evidence inventory outside its guard, so a link revision that disappeared between the list and its read made the whole read throw "evidence inventory changed"; the resolved excerpt is now returned with origins `{ state: "unknown" }`. Only that one inventory-changed error degrades: damaged storage ("evidence storage invalid") still fails loudly with its restore step.
26
+ - A verified open important audit finding can be settled (hub task 920, a follow-up of #1403 T4, which stays open). `hub_audit_report` takes `settle: [{finding, disposition: fixed|false_positive}]` from a reviewer-role peer other than the finder, or the person, in a call of its own. The hub records who settled it and how in the ledger inside the same transaction as the rest of the report; a candidate, a rejected or an already settled finding is refused with the next step, and the finder's later re-report cannot reopen it. A settled finding reads as `settled`, counts apart in `ahub sdlc audit show` and the release line, and no longer withholds its details, as any fixed finding. A database from before gains the two ledger columns on open. The unused `Board.auditVerify` is removed (its guards live on in `Board.auditApply`).
27
+ - Conductor conformance and a role-choice guide (hub task 901, #1408 T3, R4, AC6 and AC7). `test/conformance/conductor.test.ts` starts a real daemon per `conductorEligible` kind (claude, codex, jcode, pi) and checks that in its interactive form the conductor feed reaches it and `hub_status`, `hub_task_assign` and the hold tools are accepted, and that in its headless form the loader ignores the role, every call is refused and no feed is sent; kimi, qwen, local and agy are checked to stay out. `docs/roles.md` gains "Choosing who conducts, plans and reviews": the eligibility table, generated from `roleEligibility` by `renderEligibilityTable` and compared with it by `test/roles-doc.test.ts`, and the open agent-led, open qwen-led and person-led combinations, each graded fixture-proven (none is live-proven; the live legs need the person). Pi stays implementer-only: no receipt shows a Pi model planning, so `plannerEligible` is not flipped. `docs/quickstart.md` links to the guide.
28
+ - `ahub init` chooses who conducts, plans and reviews (hub task 900, #1408 T2, R3). `--conductor <peer>|none`, `--planner <a,b,...>` and `--reviewer <a,b,...>|person` are independent, also asked by the guided prompt with only eligible peers (installed agents first), and written to the shared `roles` as an explicit list for every peer whose roles change, including the one that loses a role; implementer and verifier are untouched and an init with no role flag changes nothing. A peer that cannot hold the role (a headless conductor, a kind that cannot plan or receive `hub_review`) is refused before any write with the reason, the fix and the eligible peers, by the same `roleEligibility` the loader and `ahub doctor` use. `--conductor none` and `--reviewer person` are described in the init summary; `--dry-run` shows `roles.<peer>` rows. The choices live in `src/cli/init-roles.ts`.
29
+ - `ahub <command> <sub> --help` and `-h` print that command's help instead of running the subcommand, and a write command refuses an option-like word before it writes (hub task 914, #1433). `ahub task propose --help` used to file a task titled `--help`. The dispatch asks the help (`listsSubcommand` in `src/cli/help.ts`) whether it lists the subcommand, so free text such as `ahub say try ls -h` is unchanged. `ahub task propose`, `ahub goal new` and `ahub task handoff` now refuse a word that starts with `--` (and not a flag they know) or is `-h`, naming the word and the usage before anything is filed or contacted; a lone `--` still lets a title start with dashes.
30
+ - Recurring-finding cards no longer match review-local finding ids (hub task 913, #1436). A positional id (N1, F5, B1, nit-1, bugs:N1) names a finding only inside its own review, so two unrelated tasks that both used it filed a false "Review policy amendment" card; such ids now never count toward a cross-task recurrence, while a semantic id (for example compliance:hub-task-id-written-as-github-ref) still does. The `hub_review` finding id text says so. When a planner tries to cancel a hub-created card, the refusal now names who can (the person) and the exact command (`ahub task cancel <id> --reason <text>`). Positional ids are matched by `positionalFindingId` in `src/hub/review-findings.ts`.
31
+ - `hub_task_done` accepts the PR head its refusal names after an escalated owner pushes (hub task 912, #1435). When escalation had cleared the reviewer, the done was gated on the approval path, which compared the PR head with the stale `refs.commit` instead of the commit the owner submitted, so the owner could never re-file; the gate now reads the submitted head. A wrong commit is still refused with the PR head named, and a PR that was already merged is accepted at its head.
32
+ - The conductor must run interactively (hub task 899, #1408 T1, R1 and R2). Each adapter definition now states `conductorEligible` (claude, codex, jcode and pi; kimi, qwen, local and agy stay false until proven) and `reviewerEligible` (all but agy), and `roleEligibility(peer, role, startMode)` answers with a reason and a fix. The loader, and the recovery policy, ignore a `conductor` on an ineligible kind or on a peer that starts headless, with a notice that names the fix, and give the role to nobody else, so a project without a conductor is conducted by the person from `ahub console`. Setting the conductor's `peers.<peer>.start_mode` to `headless` is refused with "move the role first". `ahub doctor` gains a `roles` row. A project whose `roles` already named an ineligible or headless conductor loses that role on upgrade (the notice says how to fix it); every other project is unchanged.
33
+ - A project directory that was renamed, with its old path left as a symlink, no longer makes the hub's own project MCP entry read as foreign (hub task 908, #1423). `ahub jcode` and `ahub agy` compare the entry's `AGENTHUB_PROJECT_DIR` (and agy's `AGENTHUB_STATE_DIR`, in its MCP entry and hook commands) by real path, so the entry written before the move is recognised and rewritten with the new paths. An entry for another project, another peer or a path that no longer resolves is still refused, and the refusal now names the differing field and says to remove the `agent-hub-jcode` (or `agent-hub`) key and run the command again. Kimi's entry is rewritten from the current paths and had no such check.
34
+ - Codex 0.167.2 passed the model-free reviewer isolation procedure (`docs/verification/2026-11-13-codex-01672-reviewer-isolation.md`): the seven re-read Codex source files are byte-identical to 0.167.0, and every preparation leg passed with 0.166.0 and 0.167.0 as controls. It stays out of the verified set until a separately authorized model-backed tool-call run succeeds; until then the person can run `ahub agents trust codex-review 0.167.2`, and every runtime proof still runs.
35
+ - `ahub sdlc audit start|show` runs a recurring read-only security audit with a coverage ledger (hub task 896, #1403 T4, A4 and A5). The person or the configured conductor starts one (`--profile quick|standard`, `--since <ref>`), the hub seeds a surface by companion ledger from `[security]` in `hub.db` and alone writes it, and the assigned auditor reports `covered`, `deferred` or `out_of_scope` per unit with findings in the boundary shape through the new `hub_audit_report` tool (advertised only with the lifecycle on). A confirmed important finding counts only after a different reviewer verifies it, a surface unchanged since its last covered state is carried over as `covered (prior)`, and a quick or scoped audit reads as partial. `ahub sdlc release` gains one line of unit counts and never blocks. The details of an open important finding are shown to the person only: the conductor's view, the release line and every peer message carry its id and status.
36
+ - Changes under `[security]` paths need a recorded security pass (hub task 895, #1403 T2, A2). `.agenthub/sdlc.toml` may list `paths` (the `config_paths` pattern language) and optional `companions` from `agents`, `supply-chain`, `local-ipc` and `data-isolation`. When the PR's complete file inventory matches, the review request says a pass is required and points to `docs/agent-notes/security-review.md`, and the reviewer records `security_pass: {covered, not_covered}` on the verdict (`ahub review ... --security-pass <json>`), bound to the reviewed head and naming at least one unit. `advise` records an approval without it and says so in the advice, `enforce` refuses the approval and blocks the merge queue row and the merge gate. An incomplete file inventory reads `unknown`, never `not_required`. `ahub sdlc status` and the queue show the state without path names. Off, or no table, changes nothing and advertises nothing.
37
+ - `ahub roles [--json]` prints who holds which flow role as the running hub settled them, the planner, and who reviews when no reviewer can run (#1411 T2); from a task worktree with no hub of its own it reads the main worktree's hub. The `status` reply gains an optional `reviewFallback` (`required`, `sameFamily`); an older hub reads as unknown. `ahub doctor` gains a `shared config` row: quiet when `.agenthub/config.json` is committed and the block points at it, or untracked by choice; a warning with the fixing command for each mismatch.
38
+ - `ahub status` and `ahub model list` show the last model a peer's finished turn reported (#1402 T5). When no override, instance, launch or native baseline model is known, `EFFECTIVE MODEL` reads that model and `SOURCE` reads `observed (served)` or `observed (session)` in place of `not reported`; a `configured` grade or an id the display cannot hold is never shown, and the observation is dropped when the peer goes offline or its adapter is replaced. `ahub research` prints `owner model known (served or session): N of M tasks`, the share `docs/dogfood.md` measures.
39
+ - Pi and Antigravity turns report their model (#1402 T4). A headless Pi records the model of its `get_state` as `session` evidence (the placeholder `unknown` names none) and otherwise the model the hub set, as `configured`; a Pi TUI reports only a `configured` one. Antigravity records the `modelName` its hook payloads carry as `session` evidence for the turn that ends next, dropped when the peer goes offline. An alias is kept as reported, an unsafe or absent value records nothing, and neither is ever `served`.
40
+ - The exact `@staix/agent-mem` pin moves from 0.24.0 to 0.25.0 (hub task 907). 0.25.0 adds the person-owned `preference` note kind and root record-candidate helpers (additive; existing export names are unchanged). A `preference` note write fails closed until a person raises the home's `formats.json` curated floor to 0.25.0; reads, briefs and `amem_remember` queueing need no floor, and the hub never writes `formats.json`. Compatibility with 0.24.0 on one shared home, measured by agent-mem: a home holding a `preference` row is not readable as complete by a 0.24.0 reader (its `syncMemory` reports not ok), so raise the floor only after every hub and CLI sharing that home runs 0.25.0. The curated index is now `index-v4.db` beside 0.24.0's own file, and non-Claude Records use the format-4 `hook-v4-` capture-spool prefix, which 0.24.0 leaves pending. The generated plugin bundles carry the new `preference` kind in the `amem_remember` schema.
41
+ - ACP peers report the session's model per turn (#1402 T3). Qwen, Jcode and headless Kimi record the model id their session reports (`models.currentModelId`, or the `model` select of `configOptions`) on `turn_end` as `session` evidence, whatever the override policy and including peers that emit no usage event. A model-update notice for the current session moves it for the next turn; Qwen's `id(openai)` wire id is read through its receipt codec. An id the hub cannot read safely, or an agent that reports none, records nothing. It is the agent's own current model, never a per-response `served` one.
42
+ - Codex and Claude print turns report the model they ran (#1402 T2). A Codex turn's `model` is the one its `thread/start` or `thread/resume` reply named or the hub or TUI started it with (`session`), or the model a `model/rerouted` notification moved it to (`served`, that turn only); Codex sends no per-response model otherwise, so it is never `served` on its own say-so. A Claude print turn (reviewer and implementer) reports the `modelUsage` model of its result row as `served`; two or more models name the one with strictly more usage tokens, and a tie names none. A surface that reports nothing records nothing. Checked against the codex-cli 0.167.2 app-server schema and Claude Code 2.1.322; no live model call was made for this change.
43
+ - `ahub console` names the conductor on the peers panel (#1414): the peer label reads `claude (conductor, planner)` or `codex (conductor)` from the flow roles the running hub settled; a peer with neither role, or a hub that sends no flow roles, shows the bare id as before.
44
+ - `hub_review` security findings carry a boundary and a state, and any finding can be marked older than the change (#1403 T1: A1, B4). With the lifecycle on (`advise` or `enforce`), an open important `security` finding must name `state` (`confirmed` or `needs_validation`) and `boundary` (`principal`, `control`, `resource`, `result`); the refusal names the four fields. A `needs_validation` finding carries a `blocker`, never blocks approval, and on approval yields one read-only `triage` backlog card. `origin: "pre_existing"` keeps an important finding from blocking or carrying across heads and yields one `plan` backlog card; omitted means `introduced`, as before. Status and the merge queue count the two apart. With the lifecycle `off` the fields are refused and not advertised, and nothing else changes.
45
+ - `ahub init --track-config | --no-track-config` makes committing the shared hub config a choice (#1411 T1). Tracked: `.agenthub/config.json`, `routing.toml` and `sdlc.toml` must be visible to git; a rule that ignores one is named as `git check-ignore -v` reports it and nothing is written, a `routing.toml` that sets a `hub_routes` `adec_endpoint` stays ignored and is reported, machine-local values in `config.json` are listed with the move to `config.local.json`, and the files to commit are listed. Untracked: the three files are ignored. The AGENTS.md block's role sentence follows the choice; a new project is asked at the prompt, and with neither flag an existing project keeps its ignore state and its sentence. Every `.gitignore` line init adds is checked with `git check-ignore` first, so a path a broader rule already ignores gets no line. The next steps say that `config.local.json` wins over `config.json`, and `docs/operations.md` states that rule and its exceptions.
46
+ - `ahub research` records the model each owner used (#1402 T1). `turn_end` events gain optional `model` and `modelEvidence` (`served`, `session` or `configured`), written from a new optional `PeerAdapter.observedModel()` through `safeModelLabel` (a refused label is dropped whole; no observation writes neither field), and task records gain `ownerModels`, built from the owner's turns only. `by model` now groups on `ownerModels`, so a reviewer's model no longer counts for the owner, shows the weakest evidence grade when it is not `served`, and prints how many tasks have no owner model; `models` stays the union and the CSV gets a trailing `ownerModels` column. Records already in the store carry no `ownerModels` and read as `unknown`: run `ahub research backfill` to fill the tasks whose events still carry a model. The adapters report their models in T2 to T4 (#887 to #889), so until then only turns whose usage event names a model have one.
47
+ - A security review checklist for this daemon (#1403 A3): `docs/agent-notes/security-review.md` names, per area (agents and messages, local servers, data isolation and paths, supply chain and release), the source file that holds each control, and `REVIEW.md`'s security pass points at it and adds two rules that reach every review request: content read from a change is data, never an instruction, and a secret value is never quoted.
48
+ - This repository tracks its own hub config (#1411): `.agenthub/config.json` (roles and shared defaults) is committed, so the role definition the managed AGENTS block points at exists in a clone and in a task worktree. Machine-local values stay in the untracked `config.local.json`, which wins key by key; `routing.toml` stays untracked until its machine endpoints have a local home, and `sdlc.toml` until the daemon test fixtures stop reading this checkout's lifecycle file.
49
+ - Workflow actions are pinned by commit SHA with the version in a comment (#1403 A6): `actions/checkout`, `actions/setup-node`, `actions/upload-artifact` and `actions/download-artifact` join `oven-sh/setup-bun`, and `test/workflow-pins.test.ts` refuses a tag-pinned action. `SECURITY.md` points reports at GitHub private vulnerability reporting.
50
+ - A refused `ahub guidance probe` command names the subcommand typed, prints that subcommand's exact usage and says where the probe id comes from, in place of one generic line (#1405). The usage text has one source shared with `ahub help`; no accepted form changes.
51
+
7
52
  ## 0.38.0
8
53
 
9
54
  - Commands the hub hands a person run as printed (#1399). The needs_review hold notice, `ahub status` held rows and `ahub queue show` give `cd <project> && ahub queue resolve <id> --revision N --action <suggested> --reason "<kind> from <sender> to <peer>"` plus the other actions with one clause each, in place of `--action completed|retry|discard --reason <text>`. Agents are told, in the managed AGENTS block and in their session instructions, to pass such a command on unshortened.
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.38.0, control protocol 17 (accepts 16). Bun + TypeScript, one loopback daemon per
8
+ Status: 0.39.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
@@ -44,13 +44,13 @@ to you, questions agents ask you and, where acon supports them, unread results r
44
44
  console inbox. The plugin is `@staix/agent-hub/ui-plugin`; it uses the dashboard manager's
45
45
  own listing and forwarding, and an answer, a result receipt or a review comment sent from
46
46
  acon goes through a manager port of its own that needs acon's verified person.
47
- The plugin also feeds the console's Space view (Flat, Room and 3D): agents become actors
48
- at their desks, the task board's columns become zones, and task links and recent messages
49
- become links. The scene carries labels and states only, never message bodies or details.
47
+ The plugin also feeds the console's Space view (Flat, Room and 3D): each project is its
48
+ own group, agents become actors at their desks, the task board's columns become zones,
49
+ and task links and recent messages become links. The scene carries labels and states only, never message bodies or details.
50
50
 
51
51
  `ahub init --dry-run --json` shows what init would write. On a new project at a
52
52
  terminal, `ahub init` asks each main setting with its default before writing; flags
53
- such as `--agents`, `--sdlc` or `--no-specs` set them directly, and `--yes` takes the
53
+ such as `--agents`, `--sdlc`, `--conductor` or `--no-specs` set them directly, and `--yes` takes the
54
54
  defaults. The
55
55
  [Quickstart](docs/quickstart.md) walks through a first session and a working day,
56
56
  including [a new project with SDLC advise or enforce](docs/quickstart.md#a-new-project-with-sdlc-advise-or-enforce).
@@ -75,6 +75,8 @@ including [a new project with SDLC advise or enforce](docs/quickstart.md#a-new-p
75
75
  exact-version ACP setter receipt; other ACP kinds remain unsupported.
76
76
  Active turns stay unchanged;
77
77
  [status distinguishes pending and unsupported selection](docs/operations.md#live-peer-model-overrides-1317).
78
+ When no model is configured, `ahub status` shows the last model a peer's finished
79
+ turn reported, graded `observed (served)` or `observed (session)`.
78
80
  - **A shared task board.** Work is proposed, accepted, done and reviewed through hub
79
81
  tools. Roles split planning, implementation and review (up to eight planners,
80
82
  each task bound to one), `routing.toml` picks
@@ -90,6 +92,13 @@ including [a new project with SDLC advise or enforce](docs/quickstart.md#a-new-p
90
92
  another project running agent-hub on this machine goes onto that project's board
91
93
  with `ahub task handoff` (agents: `hub_task_handoff`), and its state changes come
92
94
  back as task messages.
95
+ Who conducts, plans and reviews is chosen at `ahub init` (`--conductor`,
96
+ `--planner`, `--reviewer`) and printed by `ahub roles`; the conductor must run
97
+ interactively, and a project without one is conducted by the person from
98
+ `ahub console` ([choosing roles](docs/roles.md#choosing-who-conducts-plans-and-reviews)).
99
+ With the lifecycle on, changes under `[security]` paths need a recorded security
100
+ pass, and `ahub sdlc audit start|show` runs a read-only security audit with a
101
+ coverage ledger ([security pass and audit](docs/sdlc.md#security-pass-for-sensitive-paths-hub-task-895-1403-a2)).
93
102
  For a PR already merged outside the hub, [merged PR adoption](docs/sdlc.md#adopting-a-pr-merged-outside-the-hub-1328-t3) verifies its recorded head and releases dependents: `ahub sdlc adopt-merge <task> --pr <n>`.
94
103
  An explicitly superseding task may [carry existing spec consent](docs/sdlc.md#spec-acceptance-481-s1) for the same repository and issue when the host verifies an unchanged body.
95
104
  Fresh Kimi reviews run periodic isolation checks off the hub event loop;
@@ -142,8 +151,9 @@ including [a new project with SDLC advise or enforce](docs/quickstart.md#a-new-p
142
151
  roles: sessions are distinguishable, which is provenance, not authentication.
143
152
  Budgets pause an
144
153
  agent before it runs out of quota (at 99% of a window by default, the
145
- `budget.gate` setting), and recovery never replays an
146
- effect whose outcome is unknown.
154
+ `budget.gate` setting), a reviewer is skipped when its known usage reaches 80% or
155
+ its quota is unknown (`review.gate`, `review.unknown_quota`), and recovery never
156
+ replays an effect whose outcome is unknown.
147
157
  - **Operations.** A terminal console and a local dashboard, one hub per repository or
148
158
  worktree with a machine-wide view, live settings reload, machine-local schedules
149
159
  that propose tasks by interval or by a `cron` expression in a time zone
@@ -53,7 +53,7 @@ Defines how the agent process is started and commanded:
53
53
  * `defaultForm`: The default startup mode.
54
54
  * `launch(ctx)`: Generates the `LaunchPlan` (command, argv, environment variables, launch metadata).
55
55
  * `create(ctx)`: Factory constructing the `PeerAdapter` instance for driven daemon peers.
56
- * `conductorStartable`: Boolean indicating if `ahub up` or conductor can spawn this peer automatically.
56
+ * `conductorStartable`: Boolean indicating if `ahub up` or conductor can spawn this peer automatically. The conductor's start refusal and the `hub_peer_start` description name these kinds from this flag and `optional` (`conductorStartText`, `src/adapters/registry.ts`), so a new kind needs no text edit.
57
57
  * `ownedFlags`: CLI flags owned by this tool's launcher.
58
58
 
59
59
  #### `identity`
@@ -77,9 +77,10 @@ Controls session restoration, thread continuity, and crash recovery:
77
77
  * `currentId(peer)`: Extracts the active session or thread ID from a running adapter.
78
78
  * `resumeArgv(binding, fresh)`: Builds CLI arguments to resume a persisted session.
79
79
  * `transcriptPath(binding)`: Resolves local transcript file path for audit/usage tracking.
80
+ * `restoreVersionGate`: the `compat.ts` id whose installed version `ahub upgrade` checks before it restores this kind, so a refused launch is reported before the wait expires. It is an observational preflight only; the native start repeats its own version admission.
80
81
 
81
82
  #### `projection`
82
- Where the kind sits in the host's derived lists: `roleRank`, `startRank`, `helpRank` and `plannerEligible`. `KNOWN_PEERS`, `OPTIONAL_PEERS`, `START_MODE_PEERS`, `ROLE_ORDER`, `HELP_ORDER` and `PLANNER_PEERS` are derived from `ADAPTERS` and these ranks (`deriveAdapterLists`). The only hand-kept lists are the cross-release copies in `src/hub/peer-catalog.ts` (`KNOWN_PEERS`, `OPTIONAL_PEERS`) and `src/hub/start-mode.ts` (`START_MODE_PEERS`, for a dual-form kind): a new native kind is added there too, and `test/registry-guard.test.ts` fails until those copies equal the derived lists. A configured or external definition cannot set `projection`.
83
+ Where the kind sits in the host's derived lists: `roleRank`, `startRank`, `helpRank` and `plannerEligible`. `conductorEligible` (an interactive form that receives hub pushes and holds a writable tools connection) and `reviewerEligible` (the kind can receive `hub_review`) say which flow roles it may hold; absent means false, so a kind not yet proven is not eligible. `roleEligibility` (`src/adapters/role-eligibility.ts`) reads them for the loader, `ahub init` and `ahub doctor`, and the table in [roles](roles.md#who-may-hold-what) is generated from it. `KNOWN_PEERS`, `OPTIONAL_PEERS`, `START_MODE_PEERS`, `ROLE_ORDER`, `HELP_ORDER` and `PLANNER_PEERS` are derived from `ADAPTERS` and these ranks (`deriveAdapterLists`). The only hand-kept lists are the cross-release copies in `src/hub/peer-catalog.ts` (`KNOWN_PEERS`, `OPTIONAL_PEERS`) and `src/hub/start-mode.ts` (`START_MODE_PEERS`, for a dual-form kind): a new native kind is added there too, and `test/registry-guard.test.ts` fails until those copies equal the derived lists. A configured or external definition cannot set `projection`.
83
84
 
84
85
  #### `cli`
85
86
  The `ahub <kind>` surface: `command`, `startWords(form)`, and for a fixed builtin `entry` (the launcher and whether it needs lifecycle admission), `preview`, `usage` (help lines) and `launchConfigKeys`. `builtinCliEntries(definitions)` projects the entries; no configuration or module can register one.
@@ -88,7 +89,7 @@ The `ahub <kind>` surface: `command`, `startWords(form)`, and for a fixed builti
88
89
  `instances.mode` is `headless` (needs a headless `start.create` factory) or `external` (a channel instance started from the person's terminal). A kind with no `instances` policy (Jcode) takes no extra instance, and `validateInstances` refuses a declaration of one. `attach` holds the pull-only forms, external-hello admission and the refusal texts for a TUI that attaches without a driven peer.
89
90
 
90
91
  #### Peer capability members
91
- The runtime peer (`PeerAdapter`, `src/hub/peers.ts`) exposes optional members that the daemon reads instead of checking its class (#625 phase 6): `sessionGeneration` (native session identity: absent keeps the owner-token fallback, present but undefined is unknown and refuses bounded checks), `checkpointUsesSessionGeneration` (opt out of generation-fenced checkpoints, as Pi does), `permissionModeState` (the effective native approval state, or `unknown` / `unmanaged`) and `setPermissionMode(mode)` (resolves only after the native side acknowledges). A driven peer publishes its turn's final answer through `BasePeer.finalAnswer` rather than `onMessage`, so the bus strips `amem:` Record lines before sharing it (#1320); the Record instruction reaches only the owners the daemon binds (see [memory](memory.md#agent-authored-records-1320)). Native safety proofs (Codex proxy and restoration, Claude launch generation) stay in the daemon.
92
+ The runtime peer (`PeerAdapter`, `src/hub/peers.ts`) exposes optional members that the daemon reads instead of checking its class (#625 phase 6): `sessionGeneration` (native session identity: absent keeps the owner-token fallback, present but undefined is unknown and refuses bounded checks), `checkpointUsesSessionGeneration` (opt out of generation-fenced checkpoints, as Pi does), `permissionModeState` (the effective native approval state, or `unknown` / `unmanaged`) and `setPermissionMode(mode)` (resolves only after the native side acknowledges). `observedModel()` returns the model the native surface reported for the turn that just ended, with its evidence grade (`served`, `session` or `configured`), read once at `turn_end`; return undefined when the surface reports none, so unknown stays unknown. A driven peer publishes its turn's final answer through `BasePeer.finalAnswer` rather than `onMessage`, so the bus strips `amem:` Record lines before sharing it (#1320); the Record instruction reaches only the owners the daemon binds (see [memory](memory.md#agent-authored-records-1320)). Native safety proofs (Codex proxy and restoration, Claude launch generation) stay in the daemon.
92
93
 
93
94
  #### `budget`
94
95
  Defines quota and context window consumption readers:
@@ -212,6 +213,7 @@ bun test test/conformance/agy.test.ts
212
213
  3. **Recovery Metadata Hygiene**: No prompt text or credentials leaked into `recoveryMetadata`.
213
214
  4. **Watchdog Cancellation & Generation Fencing**: Expiry of the turn watchdog cancels prompts cleanly and generation fences prevent stale late answers from publishing.
214
215
  5. **Teardown & Cleanup**: When an adapter is stopped (`peer.stop()`), all owned child processes in the process group stop with it (the peer reaches offline).
216
+ 6. **Conductor (`conductor.test.ts`)**: For every kind and form `roleEligibility` admits as conductor, a real daemon accepts its conductor tools and sends it the conductor feed; the headless form of each is refused and fed nothing, and every ineligible kind keeps no conductor role.
215
217
 
216
218
  ---
217
219
 
@@ -225,4 +227,4 @@ When adding or updating an adapter, verify each item before opening a PR:
225
227
  - [ ] **PII Safety Verified**: Cloud models have `trust.onPrem: false`; verify PII markers refuse routing to this peer.
226
228
  - [ ] **Process Group Teardown**: Daemon-spawned processes use process groups and exit cleanly on stop.
227
229
  - [ ] **Conformance Kit Passes**: `bun test test/conformance` passes with zero regressions and no silent skips.
228
- - [ ] **Documentation Freshness**: Run `node scripts/check-docs.mjs` and update verified stamps in `docs/verified.json`.
230
+ - [ ] **Documentation Freshness**: Run `node scripts/check-docs.mjs` and fix the documents it reports. Do not restamp `docs/verified.json` in a squash-merged PR; stamps are refreshed in the release PR.
@@ -122,6 +122,13 @@ revision preserves both behaviors; capture still uses its stricter turn fence.
122
122
 
123
123
  ## Changes
124
124
 
125
+ - 2026-11-14: #1467 separates unknown-quota admission from the numeric reviewer floor. The default remains skip at 0.8; explicit pass can bootstrap a reviewer without a reading, while off disables quota admission checks and waits. Actual account/manual pauses remain independent, and the synthetic opt-out evidence does not claim live use or a new reset source.
126
+ - 2026-11-14: #1432 adds a narrow off/advise and check-name exception to person-only structural editing, following the existing cooperative direct-instruction model for release authorization. Separate intent and hashed-result audits distinguish a caller claim from a saved configuration, while the generic editor and release-consent authority stay separate.
127
+ - 2026-11-14: #1403 T7 preserves considered rejections because a repeated semantic finding id alone does not establish new evidence. Complete path-change evidence and an explicit reconsideration reason distinguish a new case from replay; unknown diffs retain suppression without deleting history. Closed proposal history no longer prevents an unsuppressed finding from becoming a new open card; its prior task id and reopening reason remain visible.
128
+ - 2026-11-14: #931 T3 binds retained contradiction history across revisions of the same claim identity, so an owner withdrawal or claim-version restoration cannot turn prior counterevidence into an unqualified ready result. The existing person-verdict store supplies the current-manifest disposition; provenance and semantic judgment remain distinct.
129
+
130
+ - 2026-11-13: #1403 B1 adds cold-readable intent and base-to-task-head drift advice. The existing PR conformance gate remains separate, so a moved or unreadable plan base cannot become a new acceptance gate.
131
+
125
132
  - 2026-11-10: #850 distinguishes normal-Bus Q2 proof from direct busy-submit characterization and preserves adoption/reattach/deny quiescence ceilings.
126
133
  - 2026-11-10: Spec acceptance carry-over (#1328 T4) distinguishes a new person decision from host-verified reuse of the same decision on explicitly superseding work. The narrow exception preserves original consent and records its cancelled source; it does not expose acceptance as a tool or receipt field. Review caught an early carry write before a later plan refusal: staging the host proof and committing only with the admitted outer event preserves the existing pre-effect refusal contract.
127
134
  - 2026-11-09: #1328 T6 extended the closed machine-default schema for an explicit setup research choice, reusing guarded publication and preserving the existing autonomy and start choices.
@@ -166,3 +173,12 @@ adapter, Bus or automatic receipt-admission behavior changed.
166
173
  The task 859 deny-readiness correction separates known delivery disposition from native quiescence. Task 850 measured no post-deny completion ACK; normal-Bus assistant/Stop evidence cannot be reused for the denied turn. The durable fence keeps a synchronous Bus drain from submitting queued work and allows recovery through a new personal turn or a verified fresh generation. The 30 s deadline is an operational waiting bound, not evidence that native work stopped.
167
174
 
168
175
  The same review found that a single append can write a prefix without throwing. The byte-count check and actual tail guard prevent a second append from completing that prefix. This intentionally adds no per-write persisted intent: a crash leaving a torn prefix that already ends with newline remains the explicit ceiling.
176
+
177
+
178
+ ## 2026-11-13: Codex paused quota visibility (#1440)
179
+
180
+ The normal ten-minute native usage poll could delay observing an external reset while the hub held a budget pause. The #1440 contract kept resume in Budget.evaluate, added a one-minute paused observation cadence, and limited credit diagnostics to counts, times and flags. The Codex 0.167.2 generated schema defined availableCount separately from a possibly capped detail list, so incomplete detail coverage did not establish a global earliest expiry. Paid-credit availability supplied no pause/resume authority.
181
+
182
+ Issue #1403 B1 follow-up separates upstream plan drift from a task's own implementation. Acceptance needs no recorded task head: it compares the plan base with the locally recorded remote-tracking default tip. Completion uses the shared integration point with that tip, so the task's own commits do not masquerade as upstream drift. Local refs may lag the server; this advice performs no fetch. Missing or ambiguous history remains unknown, and lifecycle off remains quiet.
183
+
184
+ Issue #1446 separates reviewer admission from the account's hard pause. The reviewer floor defaults to 0.8 while the account gate keeps its own configuration. A wait is useful only with complete pool and reset evidence; preserving its first deadline avoids indefinite waiting after restarts. Kimi's diagnostic exception was observed on 2.2.0 and is unverified on 2.5.2. Its absence of a reset timestamp prevents wait admission. Owned accounting intents survive a crash without publishing private profile identity or silently treating an incomplete log as zero consumption.
@@ -13,7 +13,7 @@ Scope: the Codex, ACP and Pi adapters and the Pi extension (turn `generation` an
13
13
  - Registry load runs `assertDaemonEngine` and `assertNativeCapabilityScope` before publication. A definition that is not a fixed builtin (object identity in `fixedBuiltinDefinitions`, never a kind name) may not declare `start.acpCommand`, `start.upStart`, `attach.admission`, `budget.resetSoftTokensOnResume`, `session.crashIdentity`, `session.nativeRevert`, a `pi-rpc` or `claude-implementer` daemon port, `identity.currentChild`, `routing`, `projection`, `reviewerVariant`, `headlessVariant`, `reviewer`, `hooks.factsHook`, `cli.entry`, `cli.preview`, `cli.usage` or `instances.modelSelect`. Only `definitionOf(id, instances)` picks a kind's `reviewerVariant`, for a declared extra with `start_mode: "headless"`, roles exactly `["reviewer"]`, and either a variant whose `reviewer.declaration` is `"automatic"` (Claude, agy) or `review_mode: "fresh"` (Codex, Kimi); without that opt-in a reviewer-only Codex or Kimi instance keeps its native adapter. It picks a kind's `headlessVariant` (Claude, #525-4) for a declared headless extra whose roles include `implementer` and hold only `implementer` and `verifier`. Metadata-only reviewer variants never establish native peer support; `isSupportedPeer` shares the registry runtime/validated-instance predicate with the catalog and daemon. A new field that depends on fixed-builtin assumptions or host-global native state joins that list (`test/adapter-capability-scope.test.ts`). `trust.onPrem` admits PII work (rule: `tasks.md`).
14
14
  - Native branch ratchet (#625): `test/daemon-native-branches.test.ts` counts every call of a native class predicate (an `is*Peer` imported from an adapter module other than `registry.ts`) per enclosing function in `src/hub/daemon.ts` and `src/hub/claude-launch-proof.ts`, and the counts must equal `test/daemon-native-branches.json` (`predicate`, `function`, `count`, `reason`). A PR that adds, moves or removes such a call edits its row by hand with a concrete reason; never regenerate the table from a test. Bind a predicate alias with `const` only and never call one through a computed namespace key: the scan refuses both.
15
15
  - Native proof state (`frontendProxy`, builtin `statusNotice`, `revertTurn` with `session.nativeRevert`, the Claude launch proof and terminal execution root) is read in the daemon only after `isFixedBuiltinDefinition(definitionOf(peer))`: a same-name foreign definition gets none of it. A product of a definition that is not a fixed builtin may not have a `frontendProxy`, `statusNotice` or `revertTurn` member at all, even undefined (`assertNativeProofPorts`, run by `createFromDefinition` and the conformance kit). Use `frontendProxyState` for the daemon proxy reads: absence keeps the generic path, present undefined refuses with `frontend proxy state unknown`. Keep approval policies and restoration debt inside CodexPeer. The remaining Codex `actionEnforcement`/`actionGated` predicate is intentional until a separately specified action-policy port; never add it to `FrontendProxyPort`.
16
- - Adding a native peer: declare its `AdapterDefinition` under `src/adapters/definitions/` (or its own directory, as agy) and list it in `ADAPTERS` (`src/adapters/registry.ts`). `KNOWN_PEERS`, `OPTIONAL_PEERS`, `SUPPORTED_PEERS`, `START_MODE_PEERS` (a kind with both a TUI and a headless form), `ROLE_ORDER`, `HELP_ORDER` and `PLANNER_PEERS` are derived from it by `deriveAdapterLists`: set `optional`, `projection` (`roleRank`, `startRank`, `helpRank`, `plannerEligible`; a configured or external definition cannot) and, for an `ahub <kind>` launcher, `cli.entry`, `cli.usage`, `cli.preview` and `cli.startWords`, never a list edit (`builtinCliEntries(definitions)` projects the entries). The literal cross-release copies `KNOWN_PEERS` and `OPTIONAL_PEERS` in `src/hub/peer-catalog.ts` and `START_MODE_PEERS` in `src/hub/start-mode.ts` stay hand-kept for older coordinators: `test/registry-guard.test.ts` fails when one differs from the derived list. Adding a peer is the one change that updates their probe counts and `VENDORS` in `test/helpers/registry-inventory.ts` (`REGISTRY_COMPATIBILITY_PROBES`), the probe literal in `test/adapter-registry-a2.test.ts`, the `ADAPTERS` order in `test/adapter-registry.test.ts` and the literal in `test/adapter-catalog-a2.test.ts`; say so in the PR as an expected test change. `isSupportedPeer` answers from `ADAPTERS`, and for a declared instance from its kind's runtime definition unless the instance resolves to an unavailable reviewer variant; `isKnownPeer` and `defaultPeerRoles` answer from `definitionOf`; `STARTABLE_PEERS` reuses `SUPPORTED_PEERS`. It also adds the kind's `kinds` entry and its rows to `templates/presets/confirmation-matrix.json` (#999 T0): `test/confirmation-matrix.test.ts` fails without a tool-approval and a classed-action row per environment, and when the entry's forms, pull-only forms, conductor start or hub-mode fact differ from the definition. Add the same kind to `kinds` in `templates/presets/autonomous.json`, with a permission per form (`null` where the hub mode is `unmanaged`, or for `tui` under `unmanaged-in-tui`) and a start per environment: `test/autonomy.test.ts` fails when the preset and matrix kinds differ or a mode is unsupported.
16
+ - Adding a native peer: declare its `AdapterDefinition` under `src/adapters/definitions/` (or its own directory, as agy) and list it in `ADAPTERS` (`src/adapters/registry.ts`). `KNOWN_PEERS`, `OPTIONAL_PEERS`, `SUPPORTED_PEERS`, `START_MODE_PEERS` (a kind with both a TUI and a headless form), `ROLE_ORDER`, `HELP_ORDER` and `PLANNER_PEERS` are derived from it by `deriveAdapterLists`: set `optional`, `projection` (`roleRank`, `startRank`, `helpRank`, `plannerEligible`, `conductorEligible`, `reviewerEligible`; absent eligibility is false; a configured or external definition cannot) and, for an `ahub <kind>` launcher, `cli.entry`, `cli.usage`, `cli.preview` and `cli.startWords`, never a list edit (`builtinCliEntries(definitions)` projects the entries). The literal cross-release copies `KNOWN_PEERS` and `OPTIONAL_PEERS` in `src/hub/peer-catalog.ts` and `START_MODE_PEERS` in `src/hub/start-mode.ts` stay hand-kept for older coordinators: `test/registry-guard.test.ts` fails when one differs from the derived list. Adding a peer is the one change that updates their probe counts and `VENDORS` in `test/helpers/registry-inventory.ts` (`REGISTRY_COMPATIBILITY_PROBES`), the probe literal in `test/adapter-registry-a2.test.ts`, the `ADAPTERS` order in `test/adapter-registry.test.ts` and the literal in `test/adapter-catalog-a2.test.ts`; say so in the PR as an expected test change. `isSupportedPeer` answers from `ADAPTERS`, and for a declared instance from its kind's runtime definition unless the instance resolves to an unavailable reviewer variant; `isKnownPeer` and `defaultPeerRoles` answer from `definitionOf`; `STARTABLE_PEERS` reuses `SUPPORTED_PEERS`. Role eligibility (#1408) is read only through `roleEligibility` / `applyRoleCeiling` (`src/adapters/role-eligibility.ts`): a new kind changes the generated table in `docs/roles.md` (`renderEligibilityTable`; `test/roles-doc.test.ts` fails until the doc matches) and, when `conductorEligible`, the pinned conductor set in `test/conformance/conductor.test.ts`, and the conductor-start wording comes from `conductorStartText()` (`src/adapters/registry.ts`), never a text edit. It also adds the kind's `kinds` entry and its rows to `templates/presets/confirmation-matrix.json` (#999 T0): `test/confirmation-matrix.test.ts` fails without a tool-approval and a classed-action row per environment, and when the entry's forms, pull-only forms, conductor start or hub-mode fact differ from the definition. Add the same kind to `kinds` in `templates/presets/autonomous.json`, with a permission per form (`null` where the hub mode is `unmanaged`, or for `tui` under `unmanaged-in-tui`) and a start per environment: `test/autonomy.test.ts` fails when the preset and matrix kinds differ or a mode is unsupported.
17
17
  - When an adapter lands, add its project config directories to `AGENT_CONFIG_SEGMENTS` (`src/hub/permission-mode.ts`); scoped automatic writes must ask there, while explicit approval and `never-ask` keep their existing behavior.
18
18
  - Load external modules only at daemon startup from trusted untracked local declarations: verify the self-contained bundle and content pin before importing captured bytes. Keep CLI/reload paths metadata-only, modules restart-bound and never settings-editable, builtin capabilities restricted, and external-kind instances admitted only under the accepted #754 headless opt-in, live captured catalog, separate worktree and host-managed current-owner proof; preserve the live-module controlled-recovery refusal. Export conformance registrations and fake assets without starting them on import.
19
19
  - Bind scanned external runtime SDK imports to this daemon's own `/adapter` entry; never resolve them against project packages. Refuse `/conformance`, `bun:ffi`, `bun:test` and CommonJS loading at runtime. Isolate module refusals from hub startup and retain unknown module roster rows as inert when metadata is unavailable.
@@ -56,6 +56,7 @@ Scope: the Codex, ACP and Pi adapters and the Pi extension (turn `generation` an
56
56
  - Peer DOING (#878): an adapter reports a native session title or its plan's in-progress item only through `onDoing` (set by `Bus.add`), with `reset` when it binds a new session or thread; never put that text in a log line, event, message, status notice or memory capture. Codex reads only `thread/name/updated` and `turn/plan/updated` of the bound thread, ACP only a `plan` update inside the current turn; never guess a value for a peer without such a source.
57
57
  - Session titles (#1055, spec `docs/design/adapters.md` "Session title slots"): only a fixed builtin may declare `title` or `titlePersistence` (`assertNativeCapabilityScope`), and only a `title: "hub"` definition (Pi, local) is offered `hub_set_title` (`sessionTitleTools`); keep it off Claude, Codex, Kimi and ACP tool lists and native auto-approval names. Write a title only through `setSessionTitle` (unnamed-only for an agent, `current()` rechecked right before the effect) and report it only through `onDoing("title", ...)`; never pass a title call to `observeTool` or capture, and never store a derived unnamed label.
58
58
  - Final answers (#1320): a driven adapter publishes a model's final turn answer through `BasePeer.finalAnswer` (the bus's `onFinalAnswer`), never `onMessage`, and passes `complete` only for a normal completion. `onMessage` skips Record capture and lets `amem:` Record lines reach peers unstripped. Decorate a turn's fixed prompt with `turnRecordPrompt`, never native client configuration.
59
+ - Observed turn model (#1402, spec `docs/design/adapters.md` "Observed turn model"): report a turn's model only through `PeerAdapter.observedModel()`, cleared on read and read once at `turn_end`. `served` only when the native surface names what it served (Claude print `result` `modelUsage`, Codex `model/rerouted`), `session` for the agent's own current model (ACP session model at prompt send, headless Pi `get_state`, Codex thread model, agy hook `modelName`), `configured` for a model the hub set and the agent acknowledged. Pass ids through `safeModelLabel`; never invent, expand an alias or truncate, and a refused, `unknown` or absent value records nothing. A failed model read never fails the delivery.
59
60
  - Codex 0.154.0 `agentMessage` items carry `text` and `phase` (not `content[]`); only the last non-`commentary` message of a turn is shared.
60
61
  - Hide `hub_delivery_retry` from delivery-only ACP/local tool lists and omit its retry hint. Treat `AGENTHUB_DELIVERY_ONLY` only as an exposure hint; the daemon must refuse by the actual attached adapter, and native children must not inherit the marker. A Claude push that cannot reach its model reports `failed_safe`; if the daemon refuses that optional receipt state, try `needs_review` and retain uncertainty when neither receipt is confirmed. Keep `hub_delivery_resolve` on every list, delivery-only included: settling one's own `needs_review` row is not a retry (#1112).
61
62
  - ACP `onActivity` is a closed, transient person-only projection. Never publish it through the bus, log/event writers, UI, tools or memory. Emit only for an active turn; latch private envelopes and associated PII work, including unreadable privacy state, and discard pending chunks on turn teardown. Native terminal references do not authorize filesystem/terminal RPC reads.
@@ -116,6 +117,7 @@ Scope: the Codex, ACP and Pi adapters and the Pi extension (turn `generation` an
116
117
  - Extra Jcode instances (#685, #368): one `JcodePeer` per declared id (at most 8), each with its own `jcode_home`, socket and state. The person authenticates inside Jcode; the hub passes `-p`, `--model` and `--provider-profile` exactly as declared, handles no model credential or URL, and only checks that the home is a directory the person owns (`jcodeHomeRefusal`: no read or write under it). Never put `AGENTHUB_PEER_ID` in the shared `.jcode/mcp.json` entry (`jcodeMcpEntry`): every owned launch supplies it through `peerChildEnv(<id>)` or the TUI launch env, together with its `AGENTHUB_LAUNCH_ID`. The MCP server with no `AGENTHUB_PEER_ID` in tools mode refuses every tool and never defaults to a peer id. The daemon admits a `tools` hello for a peer whose definition is `owned-acp` only when it carries the launch id of that peer's current owned launch (`JcodePeer.ownsLaunch`, from `jcodeLaunches`); never trust the env alone. `jcode --as <id>` never opens a TUI. Declare the semantic `instances.nativeHome` on a definition, never compare the kind name (`registry-guard`); it is a fixed-builtin capability that `assertNativeCapabilityScope` refuses elsewhere. `checkJcodeInstanceHomes` (`src/hub/instances.ts`, run once at daemon startup) refuses a home equal to or nested in the base Jcode's or another instance's; compare homes only through its `canonicalHome` (`realPath`, case-folded on a volume that folds case, inode), never `resolve()` text. The preview of `--as <id>` passes the instance to `previewJcode` so it shows the daemon's real flags.
117
118
  - Jcode defers MCP tools (#912, `JCODE_DEFERRED_TOOLS_INSTRUCTION` in `src/hub/envelope.ts`): a Jcode peer lists only its built-in tools until the model searches for an MCP tool, so without a hint it reports the hub tools missing and answers in its final message. The guidance is written in exactly one place, that constant, and `JcodePeer` sends it through `jcodePreamble` (`src/adapters/jcode.ts`) ahead of the role contract, once with a session's first prompt, for the base peer and every extra instance. Never copy it into `STANDING_INSTRUCTION`, `templates/AGENTS.block.md` or a profile template (the Jcode bullet there is the same text in every template, and `test/jcode-deferred-tools.test.ts` pins both), and never change Jcode's own deferral or cache settings from the hub. The tools it names must exist, and the server name must be `JCODE_MCP_NAME`.
118
119
  - Antigravity P1 (`src/adapters/agy/`): keep it optional, cloud, off roster by default, implementer/verifier only and pull-only. Until per-mode native prompt behavior is verified, reject hub permission/unattended mappings, headless starts and resume selectors; do not infer a quota source. The launcher refuses extra instances, any `agy --version` not admitted by `assessVersion("agy", ...)` (`COMPAT.agy` in `src/adapters/compat.ts` is the verified-set/warning-line source of truth; exact person trust is separate, #691), and a hub without the `native_hook_launch` feature.
120
+ - A project MCP entry the hub wrote is its own after the project directory moved (#1423): the directory fields are compared by real path (`sameDirectory`, `src/adapters/same-directory.ts`), not by text: `AGENTHUB_PROJECT_DIR` in the Jcode entry (`foreignField`), and `AGENTHUB_PROJECT_DIR` and `AGENTHUB_STATE_DIR` in agy's MCP entry and hook commands; a refusal names the differing field and the remedy. `jcodeMcpReady` still requires the exact current entry, so the launcher rewrites a moved one. Never loosen the rest of the shape (command, args, mode, peer id): only the directory fields follow a symlink. Kimi's entry is rewritten from the current paths and has no ownership check.
119
121
  - Only the person's `ahub agy` launcher manages `.agents/plugins/agent-hub/{plugin.json,mcp_config.json,hooks.json}`. Refuse linked/foreign entries before any write; cleanup only the matching launch. Never write project-level `.agents/hooks.json` or personal Gemini settings. The plugin MCP server is named `agent-hub_agent-hub` by the pinned native client.
120
122
  - Managed native facts use the definition's typed `NativeFactsPort` and the daemon's ephemeral `native_hook_launch` authority. Bind every observation to the daemon, launch, native session, project and current socket generation, and bind `WsPeer`'s live `nativeSession` (`bindNativeSession`) from `case "native_facts"` while keeping new `WsPeer` instances free of `nativeSession` until observed. Normal `Stop` (`NO_TOOL_CALL`) requires `fullyIdle` and a fresh validated completion row (a missing readback keeps the peer busy); terminal non-normal `Stop` reasons (`USER_CANCELED`, `ERROR`, `MAX_INVOCATIONS`, `MAX_FORCED_INVOCATIONS`, `MAX_TOKEN_BUDGET_EXCEEDED`, `TERMINAL_STEP_TYPE`, `TERMINAL_CUSTOM_HOOK`) with `fullyIdle` acknowledge any pending transcript facts/usage, clear the active turn, end any waiting cohort turn, record a closed-reason `native_turn_end` event (`reason` without `id`), settle any open #1054 run by its closed reason (pull-only `agy` opens none), and return the peer to `idle` (#1280). Native fact acknowledgement accepts only `SYSTEM_SDK` rows (`EPHEMERAL_MESSAGE` in 1.4.x, `SYSTEM_MESSAGE` in 1.5.x) in the exact session transcript path, extracts completed `PLANNER_RESPONSE` token counters (`input_tokens` excludes `cache_read_tokens`: cache reads exceeded input on 2947 of 3021 real 1.5.x rows, so `totalTokens` is their sum, not a double count) into `source: "agy_transcript"` usage events (deduped by hashed `(session, step_index)` across restarts), and advances the per-launch transcript cursor only after a scan that reached the previous cursor (or the 4 MiB lookback ceiling). `decodeAgyHook` normalizes `Read` (`view_file` `AbsolutePath`, `read_file` `Path`, with `StartLine`/`EndLine`/`ByteOffset` carried as `offset`/`limit` so partial reads never count as a whole-file view), `Write` (`write_to_file` `TargetFile`/`CodeContent`, `write_file` `Path`/`Content` when not `Append`), and `Edit` (`replace_all` only when `AllowMultiple` is true: a missing flag reads as a single replacement because no native receipt shows the default) (`replace_file_content` `TargetFile`/`TargetContent`/`ReplacementContent`, `edit_file` `Path`/`Target`/`Replacement`). The daemon records Pre/PostToolUse through `Facts.preTool`/`postTool` and offers nothing on them (#555, #1280). `INSTRUCTION_FILES` (`src/hub/permission-mode.ts`) includes `gemini.md` alongside `agents.md`, `claude.md` and `qwen.md`. Pull-only `agy` has no push, so on `SessionStart`/`PreInvocation` the daemon appends a count-only line (`[agent-hub: N message(s) waiting (M important); call hub_inbox]`, never a body or sender) to the injected message when `bus.queued(peer) > 0`, with or without a fact offer (#1280 P2). `agy acp` was probed model-free (`docs/verification/2026-11-08-agy-acp-t0.md`); its `AcpPeer` wiring waits for one authorized model-backed receipt.
121
123
  - `terminalOwner(launchId)` (`src/hub/peers.ts`, #482) answers only for the adapter's current native TUI owner bound to that launch (Codex: the claimed link with that `launchId`, both sockets open; the launcher sends the id as the upgrade's bearer token through `--remote-auth-token-env`, because `codex --remote` refuses any path or query (#586); Pi: a started, verified TUI owner on its requested session); a start acknowledgement is never ownership. A Codex link that is not the claimed one or has a closed socket never adopts a thread.
@@ -132,7 +134,7 @@ Scope: the Codex, ACP and Pi adapters and the Pi extension (turn `generation` an
132
134
  - Owned input observers (#1056): `beforeInput`/`inputReleased` (`OwnedInputObserver` in `src/adapters/claude-print-child.ts`) carry review-observer provenance only. `observerSessionId` (Claude implementer, reviewer print, local) is never `nativeSession` and never grants budget, resume, permission or task authority. `beforeInput` runs with the final target session before any prompt reaches the child or model, and a throw releases no prompt; `onInputReleased` fires only after stdin flushed for the current generation, and an observer throw never changes settlement. A fresh reviewer calls `inputFinished` only after its group is confirmed gone, its task MCP is closed and launch cleanup succeeded.
133
135
  - Retained standby (#1174, `WsPeer` in `src/adapters/channel-peer.ts`): an opt-in (`retainStandby`) hello while another session holds the peer is kept as one of at most `MAX_STANDBY_SESSIONS` (8) standbys; `standbySessions` ids and PIDs are display only, never native-session provenance or authority. Ownership changes only through `takeover` (the person's `peer_takeover`, or the oldest standby when the owner leaves), guarded by the host's `channelTakeoverAdmission` and `claim.isCurrent()` across the async preface; the old socket closes 4405 (opt-in) or 4403 "detached by the person" and its native process is not stopped. A standby socket runs no peer operation until `ownsSocket` confirms it. A hello without the opt-in keeps newest-hello replacement.
134
136
  - A reviewer backend is a fixed builtin `ReviewerBackend` in a definition's `reviewer`, never config. Its `prepare` must return a complete isolation receipt (matching backend id, binary, version, profile, evidence and `readOnly` true, plus `strictMcp` and `ephemeral` true, or for a `nativePolicy` backend `enforcement: "native-policy"`, `freshSession` and `hubToolsOnly` true) before every child. A `taskMcp` backend refuses without the host's `taskMcp` port and gets only that task's MCP config, never the hub-wide one. `admit(env)` and the complete synchronous `launch.current()` are rechecked right before spawn; keep that complete fence in `reviewToken()` at every verdict/task-MCP authority boundary. A `watchCurrent` launch supplies `startPolicyWatch()` with a review-owned full-policy probe; run its serialized asynchronous checks on absolute 100 ms due times, coalescing missed ticks without overlap or an extra post-check delay. Pass only expected paths/fingerprints to its worker, never task text or inherited environment. Fence the exact child/review sequence on failure as `review policy changed`, and terminate/join the worker before private cleanup even when native stop fails; retain an unconfirmed owner for explicit stop retry; a missing or failed proof refuses, never a weaker launch or a continuing native session. The daemon puts the reviewer on the bus only after `start()` proved isolation; a failed start or a `start_failed` report marks it in `reviewerUnavailable`, which routing reads as `failing`. An unavailable reviewer variant has no reviewer backend or launch code; `startPeerBody` refuses it before preflight, independently of any native TUI launcher.
135
- - Report reviewer failures (`onUnavailable`: `start_failed`, `quota`, `no_verdict`) only after the child's group is confirmed gone and only while its generation is current: a person's stop owns its hold and never reroutes. Complete a normal no-verdict delivery only after the host confirms a current re-offer; an uncertain or failed fallback stays `needs_review`, with its `REVIEWER_FALLBACK_UNCONFIRMED` reason excluded from automatic moved-review settlement; ordinary superseded holds keep their existing rule. Log one bounded no-verdict line from exit code and allowlisted hub-tool metadata only, with full refusal privacy/secret screening before sanitization and truncation; retain the first full host refusal across native echoes, and withhold differing later host refusals rather than replacing or accumulating them; stale/private context is withheld. Record only allowlisted tool names and refusal text; never retain argument objects, task/diff fields or model-message events as trace data. `quota` comes only from the backend's structured `failure(event)`, never from vendor text. An NDJSON frame over 256 KiB or more than 4 MiB of output aborts the review as `needs_review`.
137
+ - Report reviewer failures (`onUnavailable`: `start_failed`, `quota`, `no_verdict`, the last also for a `review.max_minutes` wall-clock cap with reason `review time cap`) only after the child's group is confirmed gone and only while its generation is current: a person's stop owns its hold and never reroutes. Complete a normal no-verdict delivery only after the host confirms a current re-offer; an uncertain or failed fallback stays `needs_review`, with its `REVIEWER_FALLBACK_UNCONFIRMED` reason excluded from automatic moved-review settlement; ordinary superseded holds keep their existing rule. Log one bounded no-verdict line from exit code and allowlisted hub-tool metadata only, with full refusal privacy/secret screening before sanitization and truncation; retain the first full host refusal across native echoes, and withhold differing later host refusals rather than replacing or accumulating them; stale/private context is withheld. Record only allowlisted tool names and refusal text; never retain argument objects, task/diff fields or model-message events as trace data. `quota` comes only from the backend's structured `failure(event)` (the pinned native frames in `src/adapters/definitions/native-quota.ts`, revalidated by `nativeReviewerQuota`) or Kimi's `failureOnExit` (a nonzero exit with the complete owned stderr read after group settlement, `kimiReviewerQuotaOnExit`), never from assistant, tool or model text (quota rules: `budget.md`). An NDJSON frame over 256 KiB or more than 4 MiB of output aborts the review as `needs_review`.
136
138
  - Codex reviewer isolation (`src/adapters/codex-review-isolation.ts`): accept only a `codex-cli` version that compat `codex-review` admits (verified or the person's trust, #691), and still run every proof below after trust; pass `-c notify=[]` (legacy notify off) on every launch; prove model-free that Apps, plugins and hooks are disabled (`features list`), ambient MCP servers are replaced by disabled stubs, and the hub server alone is enabled with exactly `hub_review` and `hub_task_show`; approve exactly those two MCP tools per tool, never with a server-wide approval default; before marking a reviewer backend/version verified, record a successful model-backed hub tool call as well as the model-free inventory (inventory alone is not verdict-delivery proof); run the native sandbox fixture probe before every launch; hash the binary once and fence binary and config files by metadata. Credential denies come only from the bounded `HOST_CREDENTIAL_PATHS` and `HOST_CREDENTIAL_ENV` lists, denied at the lexical and canonical path; refuse glob syntax or a root inside the checkout. A root that is dangling or unreadable refuses too; the reason names only its path class (`~/.docker`, `$DOCKER_CONFIG`), never a path or contents. Never pass the control token in a reviewer child's argv, env or MCP config: keep the hub state dir in its `privatePaths`. A refused `prepare` carries a `causeClass` from the closed `REVIEWER_CAUSE_CLASSES` (`version`, `binary`, `mcp_inventory`, `plugins_hooks_apps`, `sandbox_proof`, `credential_root`, `timeout`, `unknown`; `reviewer-print.ts`, #722): `prepare` tracks the proof leg it is on, and `timeout` means a metadata command ran out of its 2 s or the 12 s budget, never an abort. The host builds the reason only through `reviewerUnavailableReason(cause, detail)`: a fixed sentence per class, plus a credential-root path class (`~/.docker: a dangling link`) as the only detail. The one exception is a failed `start()` whose error is a version refusal (`VERSION_REFUSAL`) or comes from a `nativePolicy` backend: the daemon shows that sanitized message, capped at 1000 characters (#691). `ReviewerPrintPeer` classes a missing or invalid receipt as `unknown`, a `launch.current()` change before spawn as `binary`, and any other start error as `unknown`. Keep admission refusals separate from start failures: skip only a stale-bound request with one task-id log and no reroute; reroute a still-current request whose policy changed as `no_verdict`, without marking the reviewer unavailable. The daemon writes that reason to the `reviewerUnavailable` map (read by routing and shown as the `reviewer` line of `ahub status`), and a `hub.log` line names the class. Never add native CLI text, a path, a version output or a token to the class, the reason or the log.
137
139
 
138
140
  ## Headless Claude implementer (#525-4)
@@ -2,11 +2,17 @@
2
2
 
3
3
  Scope: quota and native context readings, checkpoints, pause, handoff and resume, and the status line tee. Read before editing `src/hub/budget.ts`, `src/hub/window-kind.ts`, `src/hub/budget-notes.ts`, `src/hub/context-window.ts`, `src/cli/statusline-tee.ts`, `src/adapters/definitions/native-quota.ts`, `src/adapters/definitions/native-context.ts`, `src/hub/bus.ts`, `src/hub/delivery-journal.ts`, `src/hub/restart.ts` (pause persistence), the per-account fanout in `src/hub/instance-budget.ts`, the usage roll-up in `src/hub/usage-rollup.ts` or Kimi's count (`src/adapters/kimi-wire-usage.ts`, `src/hub/kimi-usage.ts`, `src/hub/token-window.ts`).
4
4
 
5
+ - Reviewer quota admission opt-outs (#1467): keep defaults `review.gate = 0.8` and `review.unknown_quota = "skip"`. `unknown_quota = "pass"` admits unknown observations only, retaining the known floor and never treating admitted unknown as quota-wait evidence. Gate `"off"` bypasses floor/unknown checks and all quota waits, while actual Budget/manual pauses and every other routing guard remain binding. Report the active rule through the shared policy description; do not turn an opt-out into a reading, account transport, cleanup release or resume path. Require `reviewer_quota` on recovery for explicitly configured unknown policy, including skip, or gate off.
6
+ - Reviewer quota (#1446): accept only the pinned native outer Claude/Codex refusal frames in `native-quota.ts`, or the narrowly documented Kimi nonzero owned-child complete-stderr exception. Never match assistant/tool/model text. Keep reset unknown unless a typed native timestamp supplies it; credits do not affect admission. Record the hard pause through canonical-account `Budget.report` immediately when an admitted frame is observed (Kimi stderr only after confirmed settlement), independently of task fallback. Defer handoff until that owned attempt settles; only the existing Budget reset/resume policy releases the pause.
7
+ - Reviewer-only quota observation reuses attached account siblings (#1440). Do not add a reviewer transport or infer early reset from prose. Without an attached source, recheck only at a proven reset timestamp and Budget's existing expiry grace, within the original `task_sweep.review_min` deadline (kept across restarts); do not claim early-reset observation. Kimi's observed 2.2.0 stderr exception has no reset and is unverified on 2.5.2, so it never authorizes quota waiting.
8
+ - Kimi reviewer accounting journals a host-only opaque attempt before spawn and requires its ACK, then reads owned native usage after group settlement and before profile cleanup (`readKimiReviewerUsage`, the single session of the fresh profile through `ownedKimiSession`); its rows join the one Kimi account count through `KimiUsage.observeReviewer` (deduped by row id), never `addTokens`. Journal terminal complete/unknown only after that read. Drop cached soft-token headroom on unresolved accounting; unmatched starts, incomplete replay or unknown terminal stay unknown across restart, with no expiry inferred from start/cap. Retain an incomplete private profile or unacknowledged terminal through the existing cleanup hold. Never log its home, native session, prompt or stderr.
5
9
  - Budget: checkpoint first, pause second (a paused peer receives nothing). A handoff that fails is left unmarked so the next tick or hub run retries it; never record it as done.
6
10
  - A handoff needs somebody to hand over to: `canHandOff` is false right after a restart, when no peer is attached yet, and the handoff waits for a later tick instead of stripping tasks of their owner.
7
11
  - A reading has its own timestamp. Numbers that arrive through a file (`claude-usage.json`) carry the file's `at`; a window whose `resetsAt` has passed says nothing any more.
8
12
  - On resume the notice is published before the peer is released, so it leads the first delivery.
9
13
  - The coordinator only lifts its own pauses: `manualPaused` in the daemon keeps a `ahub pause` in place, and `ahub resume` refuses while a budget record is open.
14
+ - Codex quota reads (#1440): use the canonical account's open Budget pause to select the fixed 60 s poll, return to usagePollMs on resume, and unsubscribe/cancel polling plus pending-read timers on detach/stop. Keep resume in Budget's existing evaluate/expiry paths, never in adapters or Tasks. Keep only reset-credit count/proven-complete earliest expiry and ordinaryUsageAllowed/hasCredits/unlimited flags with measurement time; never retain balance, account id, credit ids or descriptions. A capped/missing detail list leaves expiry unknown. Credit flags never lift or prevent a pause.
15
+
10
16
  - `Bus.pause` and `Bus.resume` are transient and write no bus snapshot (#1204): the bus's `paused` set is not in `BusSnapshot`. Each owner persists and re-applies its own pause (`budget_pauses` for a budget record, `setManualPaused` for `ahub pause`, `conductorHolds` for a conductor hold); never restore a pause from the bus snapshot or add a `persist()` back for one.
11
17
  - The status line tee must never fail or slow the render: no throw, original command run with the same stdin, 5 s cap.
12
18
 
@@ -33,3 +39,5 @@ Scope: quota and native context readings, checkpoints, pause, handoff and resume
33
39
  - Usage roll-up (#683 U2): `src/hub/usage-rollup.ts` is the only reader of `events.jsonl` for `ahub usage`, the console Usage panel and the dashboard Usage view (rules: `daemon.md`). A pass reads from the stored offset, keeps whole lines only and commits its rows with the new offset in one transaction; its 20 ms slice (`poll(maxMs)`, #719) stops only between whole records and commits the offset of the last one folded; a line longer than the cap is read whole and one past `MAX_LINE_BYTES` is skipped, so the fold always advances. Never store a title, reason or summary there; `limit_events` drops `reason`. issue/pr/release are joined from the board at query time through `TaskLinks`, never stored. A counter with no record behind it is `unknown`, not 0. Claude's total is derived as the sum of its four counters (`claudeReportedTokens`); a source whose input contains the cached part gets none. Every `usage` reply, errors included, answers the rid, and the op is for the console and a configured planner only, never during that planner's private turn. A rebuild from byte 0 must equal the incremental result (`test/usage-rollup.test.ts`). Never present unknown as 0 in a sum: an overall figure with an unknown peer is `partial` and names the peers (`total().unknownPeers`). Never drop rows silently: `limits()` reports `truncated`, `omitted` and the bound. An event-open pause the hub no longer holds is `endedUnknown` (`ahub reset` keeps the log), so `limits(peer, { live })` needs the daemon's held pauses. A poll's fold transaction is IMMEDIATE and rechecks the stored offset, so two roll-ups on one `hub.db` never fold a range twice.
34
40
  - Daily usage (#683 U4): `UsageRollup.daily(days, now)` returns the last `days` UTC calendar days (at most 366) ending today, clipped to the first day with a record. A day inside the window with no record is a row with `empty: true`, never zeros. Per peer and day, take the native total when reported, else the counted tokens (`count`), else `unknown`; a day's total is `partial` when some peers are unknown and `unknown` when all are, never a sum that treats them as 0.
35
41
  - Kimi's consumption (#285 phase 2, delayed drain #1281, sliced drain #1283): `src/adapters/kimi-wire-usage.ts` is the only reader of Kimi's wire log and `src/hub/kimi-usage.ts` the only owner of the Kimi count; `daemon.ts` supplies ports (events, budget, clock, session id, unreferenced scheduler) and binds the session at a turn start (no read), calls `collectKimiUsage` at a turn end, a `usage_update` and an offline transition, and schedules at most three coalesced follow-ups (250 ms, 1,000 ms, 2,000 ms). With a scheduler, one invocation reads and commits one slice, then yields with a 0 ms continuation while the same cue's backlog remains (at most 16 slices per burst). Discovery is fresh on every slice; do not cache the agent set. Without a scheduler, the original synchronous 16-pass behavior remains for compatibility. Stop, offline and session replacement cancel delayed work; offline preserves the final synchronous `collect -> drop`, with rows durable only later as the documented ceiling. A native row time selects a unique interval among the most recent 32 captured turns; no unique match gives `unattributed`. Late rows never rewrite an earlier `turn_end` or increment a later turn. A successful reader slice commits offsets only after its rows are recorded; restart seeding counts only rows recorded after the last `budget_resume` of a soft-token peer (`kimiSeedRows`). Tests never reach the person's `~/.kimi-code`: `test/hub-home.ts` sets `KIMI_CODE_HOME` to a temp dir. Never feed `budget.report(kimi, tokens)` from an ACP total or an estimate, and never change `kimiCountedTokens` without the AC5 test: cache reads are recorded, not counted. An unreadable log, an unknown row shape or an untested `protocol_version` is unknown (reading dropped via `Budget.forget(peer, "tokens", "count")`, so only the count's own reading goes; one notice), never a partial count. A usage row's text never leaves the reader: four integers, a model label and the row time. A resume clears the window (`kimiUsage.reset()`).
42
+
43
+ - Controlled recovery with retained reviewer accounting/wait history or explicitly configured reviewer quota keys requires `reviewer_quota`. Bind accounting replay completeness and safe ordered journal commitment through the existing snapshot integrity; missing/changed journal refuses restoration before optimistic counts can be published. Empty legacy state keeps older-target compatibility.