@staix/agent-hub 0.51.0 → 0.52.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.
- package/CHANGELOG.md +35 -0
- package/README.md +1 -1
- package/docs/adding-an-ai-tool.md +24 -2
- package/docs/agent-notes/adapters.md +1 -0
- package/docs/agent-notes/budget.md +8 -2
- package/docs/agent-notes/daemon.md +13 -8
- package/docs/agent-notes/security-review.md +6 -5
- package/docs/agent-notes/tasks.md +5 -2
- package/docs/agent-notes/tests.md +4 -3
- package/docs/cooperbench.md +1 -1
- package/docs/design/adapters.md +4 -0
- package/docs/design/cli-output-inventory.md +162 -152
- package/docs/design/cli-output.md +4 -3
- package/docs/design/guidance-probes.md +1 -0
- package/docs/design/roadmap.md +2 -0
- package/docs/design/task-board.md +1 -0
- package/docs/dogfood.md +14 -0
- package/docs/events.md +4 -2
- package/docs/memory.md +5 -3
- package/docs/operations.md +210 -16
- package/docs/quickstart.md +12 -2
- package/docs/roles.md +1 -1
- package/docs/sdlc.md +26 -3
- package/docs/security.md +11 -5
- package/docs/specs/2026-09-19-agent-hub-design.md +43 -0
- package/docs/specs/2026-09-19-multi-project-design.md +4 -0
- package/docs/specs/2026-09-20-upgrade-recovery-design.md +17 -0
- package/docs/specs/mcp-endpoint.md +63 -0
- package/docs/verification/2026-11-30-capability-listing-shape-1808.md +45 -0
- package/docs/verification/2026-11-30-upgrade-keep-1807.md +174 -0
- package/docs/verification/2026-12-01-1811-confirmation-receipt.md +19 -0
- package/docs/verification/2026-12-01-1811-orca-agent-list.md +20 -0
- package/docs/verification/2026-12-01-1811-orca-pane-key.md +21 -0
- package/docs/verification/2026-12-02-1819-claude-process-after-renewal.md +54 -0
- package/docs/verification/2026-12-02-agy-1.5.21.md +74 -0
- package/docs/verification/2026-12-02-claude-implementer-2.1.334.md +44 -0
- package/docs/verification/2026-12-02-cli-import-graph.md +33 -0
- package/docs/verification/2026-12-03-0.52.0.md +150 -0
- package/docs/verification/2026-12-03-codex-0173-reviewer-isolation.md +53 -0
- package/docs/verification/2026-12-03-codex-0173-reviewer-tool-call.md +34 -0
- package/docs/verification/2026-12-03-jcode-1.3.0.md +25 -0
- package/docs/verification/agy/README.md +17 -0
- package/docs/verification/agy/cli-surface.ts +68 -0
- package/docs/verification/agy/interactive-bridge.ts +92 -0
- package/docs/verification/agy/interactive-session.ts +131 -0
- package/docs/verification/agy/launcher-nonce.ts +215 -0
- package/docs/verification/agy/native-hooks.ts +210 -0
- package/docs/verification/agy/originals/agent-hub-681/cli-surface.ts +87 -0
- package/docs/verification/agy/originals/agent-hub-681/native-hooks-adapted.ts +91 -0
- package/docs/verification/agy/originals/agent-hub-681/tui-actual.ts +200 -0
- package/docs/verification/agy/originals/agent-hub-684/probe.ts +107 -0
- package/docs/verification/agy/originals.json +25 -0
- package/docs/verification/agy/permission-new-functions.ts +128 -0
- package/docs/verification/agy/run-probe.py +108 -0
- package/docs/verification/agy/runtime.ts +171 -0
- package/docs/verification/agy/tmux-helper-control.ts +6 -0
- package/docs/verification/agy/tmux-session.ts +235 -0
- package/docs/verified.json +82 -41
- package/package.json +3 -3
- package/plugins/agent-hub/.claude-plugin/plugin.json +1 -1
- package/plugins/agent-hub/compat.json +157 -0
- package/plugins/agent-hub/kimi-hook.js +621 -865
- package/plugins/agent-hub/server.js +17423 -32962
- package/src/adapters/agy/definition.ts +7 -24
- package/src/adapters/channel-peer.ts +3 -1
- package/src/adapters/claude-channel.ts +38 -257
- package/src/adapters/claude-implementer.ts +3 -1
- package/src/adapters/codex-appserver.ts +77 -15
- package/src/adapters/compat.ts +74 -11
- package/src/adapters/configured-acp.ts +23 -163
- package/src/adapters/configured-adapter-policy.ts +160 -0
- package/src/adapters/configured-pull-entry.ts +53 -0
- package/src/adapters/configured-pull.ts +38 -0
- package/src/adapters/conformance/fakes/app-server.ts +9 -2
- package/src/adapters/declaration-catalog.ts +25 -0
- package/src/adapters/declaration-data.ts +342 -0
- package/src/adapters/declaration-resolution.ts +53 -0
- package/src/adapters/definitions/builtin-metadata.ts +61 -83
- package/src/adapters/definitions/jcode-launch.ts +13 -0
- package/src/adapters/definitions/native-adapter-policy.ts +390 -0
- package/src/adapters/definitions/native-cli-claude-launch.ts +3 -2
- package/src/adapters/definitions/native-cli-codex-launch.ts +2 -1
- package/src/adapters/definitions/native-cli-entry-jcode.ts +4 -2
- package/src/adapters/definitions/native-cli-entry-types.ts +9 -2
- package/src/adapters/definitions/native-cli-launch-common.ts +2 -2
- package/src/adapters/definitions/native-cli-retained.ts +1 -1
- package/src/adapters/definitions/native-configuration.ts +18 -0
- package/src/adapters/definitions/native-help.ts +24 -0
- package/src/adapters/definitions/native-launch-declarations.ts +34 -0
- package/src/adapters/definitions/native-launch-policy.ts +4 -0
- package/src/adapters/definitions/native-launch-settings.ts +72 -0
- package/src/adapters/definitions/native-light-cli.ts +18 -0
- package/src/adapters/definitions/native-light-preview.ts +10 -0
- package/src/adapters/definitions/native-wrapper-launch.ts +10 -0
- package/src/adapters/definitions/qwen.ts +6 -29
- package/src/adapters/definitions/reviewer-variants.ts +7 -8
- package/src/adapters/external-declarations.ts +31 -0
- package/src/adapters/external-modules.ts +4 -29
- package/src/adapters/jcode.ts +3 -12
- package/src/adapters/native-capabilities.ts +18 -8
- package/src/adapters/native-proof-ports.ts +1 -1
- package/src/adapters/presets.ts +136 -0
- package/src/adapters/qwen-dual.ts +2 -2
- package/src/adapters/registry-types.ts +3 -0
- package/src/adapters/registry.ts +20 -81
- package/src/adapters/reviewer-print.ts +26 -9
- package/src/adapters/role-eligibility.ts +2 -1
- package/src/cli/accounts-import.ts +72 -0
- package/src/cli/agents-latest-table.ts +88 -0
- package/src/cli/agents-latest.ts +22 -0
- package/src/cli/agents-output.ts +10 -0
- package/src/cli/agents-presets.ts +100 -0
- package/src/cli/agents.ts +1 -1
- package/src/cli/attention.ts +3 -2
- package/src/cli/autonomy-homes.ts +7 -2
- package/src/cli/budget-renew-guidance.ts +129 -0
- package/src/cli/claude-homes.ts +9 -5
- package/src/cli/command-context.ts +3 -0
- package/src/cli/command-table.ts +123 -0
- package/src/cli/commands/accounts.ts +8 -0
- package/src/cli/commands/agents.ts +18 -0
- package/src/cli/commands/answer.ts +28 -0
- package/src/cli/commands/ask.ts +17 -0
- package/src/cli/commands/autonomy.ts +83 -0
- package/src/cli/commands/backlog.ts +46 -0
- package/src/cli/commands/bench.ts +60 -0
- package/src/cli/commands/board.ts +48 -0
- package/src/cli/commands/broker.ts +9 -0
- package/src/cli/commands/budget.ts +96 -0
- package/src/cli/commands/capabilities.ts +12 -0
- package/src/cli/commands/check-path.ts +55 -0
- package/src/cli/commands/completion.ts +8 -0
- package/src/cli/commands/console.ts +12 -0
- package/src/cli/commands/daemon.ts +8 -0
- package/src/cli/commands/deliverables.ts +25 -0
- package/src/cli/commands/doctor.ts +249 -0
- package/src/cli/commands/down.ts +3 -0
- package/src/cli/commands/export.ts +15 -0
- package/src/cli/commands/facts.ts +15 -0
- package/src/cli/commands/goal.ts +22 -0
- package/src/cli/commands/guidance.ts +102 -0
- package/src/cli/commands/help.ts +17 -0
- package/src/cli/commands/host.ts +45 -0
- package/src/cli/commands/init.ts +121 -0
- package/src/cli/commands/instructed.ts +19 -0
- package/src/cli/commands/instruction-hook.ts +15 -0
- package/src/cli/commands/intake.ts +24 -0
- package/src/cli/commands/kill.ts +15 -0
- package/src/cli/commands/learn.ts +23 -0
- package/src/cli/commands/lineage.ts +30 -0
- package/src/cli/commands/logs.ts +21 -0
- package/src/cli/commands/manager.ts +15 -0
- package/src/cli/commands/memory.ts +21 -0
- package/src/cli/commands/model.ts +25 -0
- package/src/cli/commands/models.ts +40 -0
- package/src/cli/commands/native.ts +39 -0
- package/src/cli/commands/pause.ts +5 -0
- package/src/cli/commands/peer.ts +32 -0
- package/src/cli/commands/permission.ts +26 -0
- package/src/cli/commands/permit.ts +12 -0
- package/src/cli/commands/pet.ts +24 -0
- package/src/cli/commands/projects.ts +49 -0
- package/src/cli/commands/queue.ts +70 -0
- package/src/cli/commands/recovery-run.ts +13 -0
- package/src/cli/commands/recovery.ts +130 -0
- package/src/cli/commands/release.ts +23 -0
- package/src/cli/commands/releases.ts +9 -0
- package/src/cli/commands/remember.ts +6 -0
- package/src/cli/commands/report.ts +27 -0
- package/src/cli/commands/research.ts +53 -0
- package/src/cli/commands/reset.ts +89 -0
- package/src/cli/commands/restart.ts +5 -0
- package/src/cli/commands/results.ts +31 -0
- package/src/cli/commands/resume.ts +5 -0
- package/src/cli/commands/review.ts +24 -0
- package/src/cli/commands/roadmap.ts +21 -0
- package/src/cli/commands/role.ts +34 -0
- package/src/cli/commands/roles.ts +30 -0
- package/src/cli/commands/room.ts +14 -0
- package/src/cli/commands/roster.ts +48 -0
- package/src/cli/commands/route.ts +9 -0
- package/src/cli/commands/say.ts +21 -0
- package/src/cli/commands/schedule.ts +17 -0
- package/src/cli/commands/sdlc.ts +321 -0
- package/src/cli/commands/settings.ts +148 -0
- package/src/cli/commands/setup.ts +89 -0
- package/src/cli/commands/shared-refusals.ts +25 -0
- package/src/cli/commands/smoke.ts +44 -0
- package/src/cli/commands/source.ts +64 -0
- package/src/cli/commands/specs.ts +13 -0
- package/src/cli/commands/status.ts +28 -0
- package/src/cli/commands/stop.ts +17 -0
- package/src/cli/commands/structure.ts +60 -0
- package/src/cli/commands/study.ts +39 -0
- package/src/cli/commands/tail.ts +19 -0
- package/src/cli/commands/task.ts +114 -0
- package/src/cli/commands/title.ts +17 -0
- package/src/cli/commands/turns.ts +10 -0
- package/src/cli/commands/ui.ts +47 -0
- package/src/cli/commands/undo.ts +77 -0
- package/src/cli/commands/up.ts +39 -0
- package/src/cli/commands/upgrade.ts +5 -0
- package/src/cli/commands/usage.ts +33 -0
- package/src/cli/commands/version.ts +5 -0
- package/src/cli/commands/watch.ts +30 -0
- package/src/cli/commands/worktrees.ts +31 -0
- package/src/cli/console-state.ts +5 -138
- package/src/cli/console-versions.ts +1 -1
- package/src/cli/help.ts +37 -15
- package/src/cli/identity.ts +23 -4
- package/src/cli/launch-check.ts +1 -2
- package/src/cli/launch.ts +13 -82
- package/src/cli/light-dispatch.ts +29 -0
- package/src/cli/main.js +8 -1
- package/src/cli/main.ts +233 -2816
- package/src/cli/orca-probe.ts +119 -0
- package/src/cli/output.ts +31 -2
- package/src/cli/preview.ts +10 -5
- package/src/cli/recovery-version-preflight.ts +28 -9
- package/src/cli/replace-process.ts +22 -0
- package/src/cli/report-layout.ts +142 -0
- package/src/cli/roadmap-usage.ts +16 -0
- package/src/cli/roadmap.ts +3 -16
- package/src/cli/sdlc-doctor.ts +27 -0
- package/src/cli/sdlc-output.ts +55 -1
- package/src/cli/setup-homes.ts +1 -1
- package/src/cli/start-agents-run.ts +1 -1
- package/src/cli/statusline-tee.ts +25 -4
- package/src/cli/terminal-recovery.ts +53 -10
- package/src/cli/upgrade-interactive.ts +1 -0
- package/src/cli/upgrade-runtime.ts +11 -0
- package/src/cli/upgrade.ts +4 -15
- package/src/hub/accounts.ts +148 -0
- package/src/hub/addons.ts +20 -0
- package/src/hub/agent-drift.ts +2 -1
- package/src/hub/budget-projection.ts +39 -7
- package/src/hub/budget.ts +231 -16
- package/src/hub/channel-project.ts +3 -3
- package/src/hub/conductor-peer.ts +24 -0
- package/src/hub/conductor.ts +2 -21
- package/src/hub/config-apply.ts +24 -13
- package/src/hub/config-edit.ts +1 -1
- package/src/hub/config-tier.ts +2 -0
- package/src/hub/config.ts +31 -14
- package/src/hub/control-client.ts +48 -0
- package/src/hub/daemon.ts +421 -61
- package/src/hub/events.ts +3 -0
- package/src/hub/home-tag.ts +12 -0
- package/src/hub/host.ts +217 -0
- package/src/hub/hub-tools.ts +2 -1
- package/src/hub/instance-budget.ts +2 -2
- package/src/hub/instance-config.ts +15 -126
- package/src/hub/instances.ts +22 -6
- package/src/hub/instruction-receipt.ts +2 -2
- package/src/hub/kimi-usage.ts +38 -11
- package/src/hub/lifecycle.ts +86 -4
- package/src/hub/mcp-bridge-core.ts +98 -0
- package/src/hub/mcp-channel-push.ts +20 -0
- package/src/hub/mcp-endpoint-serve.ts +178 -0
- package/src/hub/mcp-endpoint.ts +226 -0
- package/src/hub/mcp-tool-call.ts +181 -0
- package/src/hub/operational-settings.ts +2 -0
- package/src/hub/orca-env.ts +6 -0
- package/src/hub/orca-state.ts +84 -0
- package/src/hub/peers.ts +5 -1
- package/src/hub/permission-mode.ts +2 -1
- package/src/hub/project.ts +20 -0
- package/src/hub/protocol-window.ts +58 -0
- package/src/hub/quota-origin.ts +20 -0
- package/src/hub/registry.ts +36 -2
- package/src/hub/report.ts +1 -1
- package/src/hub/research.ts +1 -1
- package/src/hub/review-brief.ts +47 -2
- package/src/hub/roster.ts +6 -3
- package/src/hub/routing.ts +9 -2
- package/src/hub/sdlc-check.ts +205 -0
- package/src/hub/sdlc-sync.ts +146 -0
- package/src/hub/sdlc.ts +33 -4
- package/src/hub/settings.ts +7 -4
- package/src/hub/start-agents.ts +1 -1
- package/src/hub/start-mode.ts +11 -4
- package/src/hub/structure-budget.ts +131 -0
- package/src/hub/structure-scan.ts +149 -0
- package/src/hub/tasks-experiment.ts +455 -0
- package/src/hub/tasks-guidance.ts +606 -0
- package/src/hub/tasks-roadmap-plan.ts +419 -0
- package/src/hub/tasks-roadmap.ts +491 -0
- package/src/hub/tasks-study.ts +661 -0
- package/src/hub/tasks-survey.ts +192 -0
- package/src/hub/tasks.ts +319 -2548
- package/src/hub/terminal-open.ts +5 -3
- package/src/hub/tooling.ts +3 -19
- package/src/hub/usage-rollup.ts +9 -3
- package/src/local/tools.ts +5 -0
- package/src/ui/index.html +1 -1
- package/src/ui/needs.ts +17 -5
- package/src/ui/peer-palette.ts +2 -4
- package/templates/presets/agents.json +60 -0
- package/templates/presets/confirmation-matrix.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,41 @@ 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.52.0
|
|
8
|
+
|
|
9
|
+
- Release N-1 for 0.52.x is published 0.51.0, which declares agent-mem `>=0.42.0 <1.0.0`; its fixture lock pins the 0.43.0 that the 0.51.0 release resolved (with cli-output 0.1.4 and mcp-stdio 0.5.0), with control protocol 17 (descriptor floor 16). Wire and protocol, daemon features, `hub.db` format and MCP tools are unchanged and compatible both ways. Exceptions: a 0.51.0 hub refuses at startup the settings this release adds (`[structure]` in `.agenthub/sdlc.toml`, `accounts` and `instances.<id>.account`, `host.shared`, `upgrade.bridge_window_days` and `bridge_window_min`, and a configured kind with `transport: "pull"` in `.agenthub/config.local.json`), so leave them unset until every hub that reads the file runs 0.52.0; the new commands (`ahub host`, `ahub accounts import`, `ahub agents presets` and `add`, `ahub structure`, `ahub sdlc check` and `sync`) are not in the 0.51.0 CLI. The declared agent-mem range rises (to 0.47.0 or later): hub notes may carry a writer `session` key, which a 0.51.0 hub on agent-mem 0.43.0 still reads from the same home, though an older strict `amem project import` skips JSONL notes that carry it. No capability or format ceiling is raised. The N-1 fixture and matrix pin that package; the separate protocol-16 fixture stays at 0.25.0.
|
|
10
|
+
- Probe mode refuses a hardlinked file as `hardlinked_target` on every run; on APFS, realpath could name another link of the same inode and report it as `outside_workspace` instead (Refs #541).
|
|
11
|
+
- Raise the agent-mem floor to 0.47.0 for capture-only MCP startup outside the placement inventory and placement diagnostics fixes (agent-mem#734, #731, #732).
|
|
12
|
+
- Hub-saved notes carry a pseudonymous writer session key when the daemon knows the session (#1879). The bundled agent-mem dependency now requires 0.46.0 or later in the current major-compatible range.
|
|
13
|
+
- Show the safe cause class when CI admission cannot verify full-gate evidence (Refs #548).
|
|
14
|
+
- A stale MCP endpoint socket is replaced automatically by a daemon that holds its project's fixed control port; a live socket or a daemon on another port keeps the refusal (Refs #1780).
|
|
15
|
+
- `ahub jcode` replaces its wrapper process with the Jcode TUI through `process.execve`, so no ahub process stays resident and the agent's exit status or signal reaches the caller directly (Refs #1778, T6a). A runtime without `execve`, or a program that cannot be found or run, keeps the spawn path; Codex, Claude, Kimi, Pi and Qwen are unchanged.
|
|
16
|
+
- `ahub version` and `ahub instruction-hook` run from the person's own shell without loading `src/cli/main.ts`: measured on an installed scratch tarball, each takes 10 ms and under 23 MB peak RSS (was 80 ms and 63 MB), inside the 40 ms and 40 MB budget; any flagged call or agent-marked caller still takes the shared path, and the import-graph check now guards the light path (#1778 T7).
|
|
17
|
+
- Reduce CLI startup cost and plugin bundle size (Refs #1778). On the measured Mac, `ahub version` went from 150 to 80 ms and the per-event instruction hook from 160 to 80 ms. Both still exceed the 40 ms and 40 MB targets. The Claude plugin bundle fell from 1,849,835 to 954,919 bytes; agent-mem 0.47.0 brings the released bundle back to 1,130,786 bytes.
|
|
18
|
+
- Qualify Antigravity CLI 1.5.21 for the agy peer (Refs #843): all five account-free legs passed, the exact provider declaration list is now 18 (run_workflow, swarm and update_steps added) and each new function reached the PreToolUse hook and was refused with no effect. The agy producers moved into `docs/verification/agy/` with a version parameter; receipt `docs/verification/2026-12-02-agy-1.5.21.md`.
|
|
19
|
+
- `ahub sdlc sync --write-roadmap` refreshes the tracked `docs/roadmap.json` and `docs/roadmap.md` in your worktree, and `--close-settled-issues` previews `gh issue close` for issues whose linked tasks are all settled with a merged PR and whose live body has no unchecked item; closing needs the person or the unique conductor with `roadmap.github_write` and is refused otherwise, naming the person's command. Both ride the same fingerprint and `--apply --confirm` revalidation, and no milestone is ever marked done or dropped (#1856).
|
|
20
|
+
- `ahub sdlc sync` previews board receipt repairs (an issue link from a single `#N` in the title, an open PR and its newer head, merged-PR adoption) as a deterministic plan with a SHA-256 fingerprint and writes nothing; `--apply --confirm <fingerprint>` re-plans, refuses on any board, origin or authority drift, and writes only through `recordSdlc` and `adoptMerge`. Ambiguous matches are reported, an `in_review` task never loses its reviewed head, and private tasks are only counted (#1856).
|
|
21
|
+
- `ahub sdlc check [--json]` audits the lifecycle setup in one read-only pass (config and roles, repository and required checks, active task bindings, roadmap hygiene), shares one 20 s GitHub deadline and counts private tasks without describing them; `ahub doctor` gains an offline `sdlc` row. The `draft_deferred_checks` sub-check is omitted until that setting exists (#1856).
|
|
22
|
+
- Add `ahub host --runtime <root>` and the `host.shared` setting (#1779 T3a): a project that sets `host.shared: true` runs inside one host process shared by the projects of its runtime, each keeping its own control port, token and state directory, with errors and `project stop` isolated per project. Off by default; the one-process-per-project path is unchanged.
|
|
23
|
+
- `ahub sdlc status` with no task now lists the unsettled tasks (and those of a release train that has not shipped), at most 100, and names the hidden settled count; `--all` keeps the earlier first-100 view and `status <task>` is unchanged (Refs #1856).
|
|
24
|
+
- Qualify Claude Code 2.1.334 for the headless implementer (Refs #888): the 2.1.332 procedure passed 22 of 22 cases on each binary with identical results; receipt `docs/verification/2026-12-02-claude-implementer-2.1.334.md`.
|
|
25
|
+
- Dependencies: @staix/cli-output 0.1.5 and @staix/agent-mem 0.45.0 or later (brings @staix/mcp-stdio 1.1.0). A fresh install no longer resolves an agent-mem whose cli-output pin differs from the hub's, which made 0.51.0's upgrade, restart and recovery checks refuse. Refs STAIxBWLB/cli-output#5.
|
|
26
|
+
- Projects with structure budgets get plan notices for over-budget baseline files and review briefs that show new structure findings (Refs #1829).
|
|
27
|
+
- Add `ahub accounts import --from orca` (#1811): a person-only command that reads `orca account list --json` once and prints an `accounts` block for `config.local.json`, with `<kind>-<n>` labels only (no email, id, organization or workspace name), a home placeholder where Orca gives none, and nothing written. The confirmation matrix now records the plugin-in-Orca-profile question as unverified, from a dated receipt.
|
|
28
|
+
- Finish the declared-accounts spec (#1810 T4 to T6): `instances.<id>.account` names a declared account of the instance's own kind (refused at config load when undeclared or of another kind) and a headless Codex or Claude instance starts with that account's home; `ahub setup` adds the declared Claude homes to the homes it discovers and lists each with its label; and a paused account's work can go to a peer of the same kind on another declared account, with a `budget_handoff` event naming both labels. `budget.cross_account_handoff: false` turns that off.
|
|
29
|
+
- Add the configured pull kind (#1809): a `transport: "pull"` declaration is a person-run TUI that reads its inbox through the hub bridge and is never pushed to; `ahub <kind>` starts it with its peer identity, `tasks` accepts only `false` so routing refuses it as an owner of any task, a `reviewer` role is refused at configuration load, `ahub agents add <preset> --pull` writes the declaration and prints the bridge registration command for that CLI, and `ahub doctor` reports a missing registration.
|
|
30
|
+
- Add declared accounts (#1810): `accounts` in untracked `.agenthub/config.local.json` names up to eight Claude or Codex homes by label. A Claude session reports its home at hello, the hub maps it to a label (never storing or showing the path), and the quota budget is keyed `claude:<label>` from one statusline reading per home. A project without `accounts` keeps today's keys. `instances.<id>.account` is not part of this change.
|
|
31
|
+
- Add agent presets (#1809): `ahub agents presets` lists gemini, opencode, kiro and copilot with their recorded CLI version and a `verified` or `untested` status (verified only when a receipt file exists), `ahub agents add <preset> [--as <kind>]` writes the launch line as a configured kind into the untracked `.agenthub/config.local.json`, and `ahub status` shows the preset and its status beside the kind.
|
|
32
|
+
- A corrupt stored budget renewal marker still stops the hub, and its error now names the recovery step (stop the hub and restore a trusted `hub.db` backup before retrying) without printing the row (Refs #1806).
|
|
33
|
+
- A peer whose delivery stays unaccepted for two minutes in a recorded Orca pane that Orca reports as blocked or waiting now raises one Attention item with the `orca terminal switch` command. The hub reads `orca agent list --json` once a minute per peer at most, bounded at five seconds, never for a peer without a recorded pane, and never answers the prompt (Refs #1811).
|
|
34
|
+
- Watch the Orca CLI the upgrade recovery depends on: `ahub doctor` and the plan of `ahub restart` and `ahub upgrade` check that `orca terminal list --json` and `orca worktree list --json` still carry the fields the recovery reads. A missing field fails the doctor row and blocks that project's Orca rows before anything is closed, and an Orca newer than 1.4.250 is only a note (Refs #1808).
|
|
35
|
+
- Each release now publishes its compatibility table as `plugins/agent-hub/compat.json`, and `ahub agents --latest` (person only, reads the network) says which release verifies each refused or trusted agent CLI version. It writes nothing and the hub makes no request for it (Refs #1808).
|
|
36
|
+
- A launch from an Orca pane also records the pane key, tab id and workspace id, so recovery finds the pane by its key (`tabId:leafId` of the listed row) when Orca has reassigned the handle and still names the peer as the agent in it, and a terminal opened for an extra implementer lands in the Orca workspace of its own worktree (the base peer and any unmatched root keep the project root's). Nothing is read from Orca outside an Orca pane or without `orca` on the path (Refs #1811).
|
|
37
|
+
- Quota renewal clears stale account readings and rejects repeated provider readings within reset-time jitter. The next budget gate still applies. Kimi counts only usage measured after renewal in its new window. Early quota warnings show reset and switch options and use a separate provider baseline for each reading source in windows open at renewal (Refs #1806).
|
|
38
|
+
- Watch the capability listings of Kimi, Qwen and Codex as three `COMPAT` entries without a `line`, so a newer CLI is reported, and let the person trust an exact untested version with `ahub agents trust` (the note says what trust covers). People who do not use shared capabilities see these rows in `ahub doctor` and `ahub agents` too, and only the capability listing is refused for an untrusted version, never the start of the CLI. The Kimi and Qwen listing-shape legs have a producer that was tested only with fake executables, so no real candidate has been measured, and a pass adds a drift row and never a PR or a verified version. The Codex leg has a macOS-only producer that runs the app-server under the seatbelt with a same-process network control, also tested only with fake executables. Raise the id limit of the daily watch, preparation and publish scripts from eight to sixteen. An `observe` gate entry never refuses, and a recovery preflight accepts it even when its version probe fails. Two watch-only entries, `codex-appserver` (the app-server `initialize` handshake, run under the same macOS sandbox and network control as the Codex listing leg) and `kimi-acp` (the ACP `initialize` and `session/new` handshake, on the Kimi listing producer's isolation), are tested only with fake executables, so no real candidate has been measured. The daily watch reports a leg of such an entry that failed with a proof failure or a timeout as a new `contract-drift` row in the tracking issue (read from a trusted `observe` marker in the manifest that a test pins to the version table); every other failure keeps its cause, and a version that cannot be read stays `unknown`. A third watch-only entry, `claude-channel` (its 2.1.332 is only the install reference, shown as "reference 2.1.332 (not verified)", and every version reads `observed`), has one leg that starts the installed Claude Code three times under that sandbox with random option names and checks that its parser does not name the launcher's development-channel flag as unknown (it does not prove that a live session accepts channel messages, and a real candidate may always be not-run; tested only with fake executables) (Refs #1808).
|
|
39
|
+
- Keep the Claude bridge session open after a wire mismatch. It reports the refusal and retries the project hub every five minutes. Configure the accepted bridge protocol window on restart and see its effective range in status (Refs #1807).
|
|
40
|
+
- Add `ahub structure check` for project file budgets and shared names, and `ahub structure baseline --write` to initialize or shrink the baseline (Refs #1829).
|
|
41
|
+
|
|
7
42
|
## 0.51.0
|
|
8
43
|
|
|
9
44
|
- Release N-1 for 0.51.x is published 0.50.0, which declares agent-mem `>=0.42.0 <1.0.0`; its fixture lock pins the 0.43.0 that the 0.50.0 release resolved (with cli-output 0.1.4 and mcp-stdio 0.5.0), with control protocol 17 (descriptor floor 16). Wire and protocol, file and format floors, CLI and MCP tools stay compatible both ways, with one exception: a 0.50.0 hub refuses the new optional `ci_shard_retries` field in `.agenthub/sdlc.toml` at startup, so leave it unset until every hub that reads the file runs 0.51.0. No capability or format ceiling is raised. The N-1 fixture and matrix pin that package; the separate protocol-16 fixture stays at 0.25.0.
|
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.
|
|
8
|
+
Status: 0.52.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
|
|
@@ -110,6 +110,16 @@ Configured kinds are headless and off roster by default. Before a start can succ
|
|
|
110
110
|
|
|
111
111
|
Grok declarations require explicit `--no-leader`, since native defaults can inherit ambient `[cli] use_leader`. Grok 1.0.62 remains unsupported: its isolated probe lacked initialize identity and refused session creation. The [T0 receipt](verification/2026-10-21-grok-config-acp-t0.md) records the remaining evidence. The full A3 schema and proof boundary are in the [spec amendment](specs/2026-09-19-agent-hub-design.md#amendment-config-only-acp-adapters-a3-451-486).
|
|
112
112
|
|
|
113
|
+
For `transport: "pull"` (#1809), declare `command`, `args`, `displayName`, `roles` and `versionArgs`;
|
|
114
|
+
`tasks` is optional and only `false` is accepted. `ahub <kind>` runs the command in the person's
|
|
115
|
+
terminal with `AGENTHUB_PEER_ID` and the project context set, after a version probe and a check that the
|
|
116
|
+
running hub loaded the kind and has it on the roster. The session reaches the hub through the bridge
|
|
117
|
+
(`plugins/agent-hub/server.js`) the person registered in that CLI, in the pull-only peer mode agy uses:
|
|
118
|
+
it reads `hub_inbox` and calls hub tools, and nothing is pushed. A `reviewer` role is refused at
|
|
119
|
+
configuration load, and routing refuses the kind as an owner of any task, whoever names it, because
|
|
120
|
+
the definition carries `tasks: false`. The hub never writes another tool's configuration:
|
|
121
|
+
`ahub agents add <preset> --pull` prints the registration command and `ahub doctor` reports a missing one.
|
|
122
|
+
|
|
113
123
|
For `transport: "print"`, declare `command`, `args`, `displayName`, `roles`,
|
|
114
124
|
`versionArgs`, `versionPin` and `timeoutS` (1 to 300 seconds). Supply one
|
|
115
125
|
`{prompt}` placeholder in `args` or set `stdin: true` with no placeholder.
|
|
@@ -127,6 +137,19 @@ resume or native launch overrides. AC5 remains a person-run receipt.
|
|
|
127
137
|
|
|
128
138
|
---
|
|
129
139
|
|
|
140
|
+
### Four ways to add a tool (#1809)
|
|
141
|
+
|
|
142
|
+
| Way | Use it when | You write | Transport | Surface | Roles | PII | Quota | Instances |
|
|
143
|
+
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
|
|
144
|
+
| Preset | the tool is gemini, opencode, kiro or copilot | `ahub agents add <preset>` (check `ahub agents presets` for `verified` or `untested`) | ACP stdio, no attach or leader selector; copilot has no ACP line | headless only, no TUI | planner, implementer, verifier, reviewer; no conductor | no PII (cloud trust) | quota unknown | headless instances |
|
|
145
|
+
| Config-only ACP | the tool speaks ACP over stdio | an `adapters.<kind>` entry by hand, as above | ACP stdio, no attach or leader selector | headless only, no TUI | planner, implementer, verifier, reviewer; no conductor | no PII (cloud trust) | quota unknown | headless instances |
|
|
146
|
+
| Config-only pull | you run the tool in your own terminal and it has an MCP client | a `transport: "pull"` entry, or `ahub agents add <preset> --pull`, then register the bridge in the tool yourself | the tool's own TUI over the hub bridge, no hub launch of an agent process | the person's TUI, pull-only, never pushed to | planner, implementer, verifier are recorded but grant no board role while `tasks` is false; no reviewer, owns no task (`tasks: false`) | no PII (cloud trust) | quota unknown | no instances |
|
|
147
|
+
| Config-only print | the tool answers one prompt per run | a `transport: "print"` entry, as above | print, one sandboxed process per message | headless only, no TUI | reviewer and advisor only, never owns a task | no PII (cloud trust) | quota unknown | no instances |
|
|
148
|
+
| External module | it needs its own start or session code | a module, section 5 | the headless ACP host port only, no own protocol | headless only | planner, implementer, verifier, reviewer; no conductor | no PII (cloud trust) | quota unknown | headlessInstances only |
|
|
149
|
+
| Built-in definition | it ships with the hub | an `AdapterDefinition`, section 3 | any the hub supports | any | any | on-prem allowed | readers allowed | any |
|
|
150
|
+
|
|
151
|
+
`test/agent-presets-1809.test.ts` tries each forbidden combination in this table and checks that its row says the same.
|
|
152
|
+
|
|
130
153
|
## 5. External Adapter Modules (#451 A4)
|
|
131
154
|
|
|
132
155
|
A person can authorize a bundled adapter in an untracked
|
|
@@ -178,8 +201,7 @@ a host default rather than isolation from a module that overrides its options. T
|
|
|
178
201
|
fields rather than silently ignoring them. See `validateExternalDefinition` for
|
|
179
202
|
the exact accepted subset.
|
|
180
203
|
|
|
181
|
-
External
|
|
182
|
-
#287 owns execution roots, CLI identity and recovery for them. Broadening the
|
|
204
|
+
External kinds may declare `headlessInstances` (a headless form and its roles); the loader refuses the builtin `instances` field and says to use `headlessInstances`. Execution roots, CLI identity and recovery for those instances were follow-up board task #287. Broadening the
|
|
183
205
|
module transport beyond the existing headless ACP host port also needs a reviewed
|
|
184
206
|
host contract (#625 phase 6); selecting a different native engine is not a generic extension.
|
|
185
207
|
|
|
@@ -13,6 +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
|
+
- Quota renewal calls the optional `PeerAdapter.compareQuotaHome` and `readQuotaNow` ports. Verify fixed builtin definition identity before reading either member. Refuse foreign products with either member present, even undefined. Compare synchronously before renewal and at the save boundary. Fall back to the next launch only when comparison returns undefined or the port is absent. A throw means unknown. Keep home paths in memory. Read quota only after saving, and preserve the success reply if the read throws.
|
|
16
17
|
- Adding a native peer: declare its `AdapterDefinition` under `src/adapters/definitions/` (or its own directory, as agy) and list it in `ADAPTERS` (`src/adapters/registry.ts`). `KNOWN_PEERS`, `OPTIONAL_PEERS`, `SUPPORTED_PEERS`, `START_MODE_PEERS` (a kind with both a TUI and a headless form), `ROLE_ORDER`, `HELP_ORDER` and `PLANNER_PEERS` are derived from it by `deriveAdapterLists`: set `optional`, `projection` (`roleRank`, `startRank`, `helpRank`, `plannerEligible`, `conductorEligible`, `reviewerEligible`; absent eligibility is false; a configured or external definition cannot) and, for an `ahub <kind>` launcher, `cli.entry`, `cli.usage`, `cli.preview` and `cli.startWords`, never a list edit (`builtinCliEntries(definitions)` projects the entries). The literal cross-release copies `KNOWN_PEERS` and `OPTIONAL_PEERS` in `src/hub/peer-catalog.ts` and `START_MODE_PEERS` in `src/hub/start-mode.ts` stay hand-kept for older coordinators: `test/registry-guard.test.ts` fails when one differs from the derived list. Adding a peer is the one change that updates their probe counts and `VENDORS` in `test/helpers/registry-inventory.ts` (`REGISTRY_COMPATIBILITY_PROBES`), the probe literal in `test/adapter-registry-a2.test.ts`, the `ADAPTERS` order in `test/adapter-registry.test.ts` and the literal in `test/adapter-catalog-a2.test.ts`; say so in the PR as an expected test change. `isSupportedPeer` answers from `ADAPTERS`, and for a declared instance from its kind's runtime definition unless the instance resolves to an unavailable reviewer variant; `isKnownPeer` and `defaultPeerRoles` answer from `definitionOf`; `STARTABLE_PEERS` reuses `SUPPORTED_PEERS`. Role eligibility (#1408) is read only through `roleEligibility` / `applyRoleCeiling` (`src/adapters/role-eligibility.ts`): a new kind changes the generated table in `docs/roles.md` (`renderEligibilityTable`; `test/roles-doc.test.ts` fails until the doc matches) and, when `conductorEligible`, the pinned conductor set in `test/conformance/conductor.test.ts`, and the conductor-start wording comes from `conductorStartText()` (`src/adapters/registry.ts`), never a text edit. It also adds the kind's `kinds` entry and its rows to `templates/presets/confirmation-matrix.json` (#999 T0): `test/confirmation-matrix.test.ts` fails without a tool-approval and a classed-action row per environment, and when the entry's forms, pull-only forms, conductor start or hub-mode fact differ from the definition. Add the same kind to `kinds` in `templates/presets/autonomous.json`, with a permission per form (`null` where the hub mode is `unmanaged`, or for `tui` under `unmanaged-in-tui`) and a start per environment: `test/autonomy.test.ts` fails when the preset and matrix kinds differ or a mode is unsupported. A builtin kind that reads a user skill directory joins `SKILL_HOSTS` and `hostSkillDir` (`src/adapters/definitions/native-cli-skills.ts`); one that reads none joins the exclusions in `test/skills-install.test.ts`.
|
|
17
18
|
- When an adapter lands, add its project config directories to `AGENT_CONFIG_SEGMENTS` (`src/hub/permission-paths.ts`); scoped automatic writes must ask there, while explicit approval and `never-ask` keep their existing behavior.
|
|
18
19
|
- 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.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Budget, pause and handoff
|
|
2
2
|
|
|
3
|
-
Scope: quota and native context readings, checkpoints, pause, handoff and resume, and the status line tee. Read before editing `src/hub/budget.ts`, `src/hub/window-kind.ts`, `src/hub/budget-notes.ts`, `src/hub/context-window.ts`, `src/cli/statusline-tee.ts`, `src/adapters/definitions/native-quota.ts`, `src/adapters/definitions/native-context.ts`, `src/hub/bus.ts`, `src/hub/delivery-journal.ts`, `src/hub/restart.ts` (pause persistence), the per-account fanout in `src/hub/instance-budget.ts`, the usage roll-up in `src/hub/usage-rollup.ts` or Kimi's count (`src/adapters/kimi-wire-usage.ts`, `src/hub/kimi-usage.ts`, `src/hub/token-window.ts`),
|
|
3
|
+
Scope: quota and native context readings, checkpoints, pause, handoff and resume, and the status line tee. Read before editing `src/hub/budget.ts`, `src/hub/window-kind.ts`, `src/hub/budget-notes.ts`, `src/hub/context-window.ts`, `src/cli/statusline-tee.ts`, `src/adapters/definitions/native-quota.ts`, `src/adapters/definitions/native-context.ts`, `src/hub/bus.ts`, `src/hub/delivery-journal.ts`, `src/hub/restart.ts` (pause persistence), the per-account fanout in `src/hub/instance-budget.ts`, the usage roll-up in `src/hub/usage-rollup.ts` or Kimi's count (`src/adapters/kimi-wire-usage.ts`, `src/hub/kimi-usage.ts`, `src/hub/token-window.ts`), the exhaustion projection (`src/hub/budget-projection.ts`), declared accounts (`src/hub/accounts.ts`, `src/hub/home-tag.ts`) or the renewal boundary (`src/hub/quota-origin.ts`).
|
|
4
4
|
|
|
5
5
|
- Reviewer quota admission opt-outs (#1467): keep defaults `review.gate = 0.8` and `review.unknown_quota = "skip"`. `unknown_quota = "pass"` admits unknown observations only, retaining the known floor and never treating admitted unknown as quota-wait evidence. Gate `"off"` bypasses floor/unknown checks and all quota waits, while actual Budget/manual pauses and every other routing guard remain binding. Report the active rule through the shared policy description; do not turn an opt-out into a reading, account transport, cleanup release or resume path. Require `reviewer_quota` on recovery for explicitly configured unknown policy, including skip, or gate off.
|
|
6
6
|
- Reviewer quota (#1446): accept only the pinned native outer Claude/Codex refusal frames in `native-quota.ts`, or the narrowly documented Kimi nonzero owned-child complete-stderr exception. Never match assistant/tool/model text. Keep reset unknown unless a typed native timestamp supplies it; credits do not affect admission. Record the hard pause through canonical-account `Budget.report` immediately when an admitted frame is observed (Kimi stderr only after confirmed settlement), independently of task fallback. Defer handoff until that owned attempt settles; only the existing Budget reset/resume policy releases the pause.
|
|
@@ -19,7 +19,7 @@ Scope: quota and native context readings, checkpoints, pause, handoff and resume
|
|
|
19
19
|
- Keep native context occupancy (`src/hub/context-window.ts`, readers in `src/adapters/definitions/native-context.ts`) separate from quota accounting; never use Codex's accumulated `total` as occupancy or estimate Pi counters. Host code reads quota and context only through `readNativeQuota` (`budget.ts`) and `readNativeContext` on the resolved definition's declared `budget.reader` / `budget.context`; no declared reader is unknown, never an empty reading (rule: `adapters.md`).
|
|
20
20
|
- Context checkpoint completion requires its request id and the current attached peer/native session. Invalidate its transport generation synchronously at a new peer claim, before asynchronous recall or attachment. Never pause, reassign or replace a session on context pressure; `ContextWindows.admission` (#802) only copies the reading for new-offer routing and never changes the crossing latch. Refuse private-turn, PII-pattern and all associated open PII-task summaries (owner or reviewer, including in_review, with the current routing policy; use `isClosedTaskState` to exclude approved and cancelled work) before local persistence or cloud memory; never broadcast checkpoint text.
|
|
21
21
|
- A quota or context checkpoint also snapshots each owned task's creation and ownership-change epoch (#1506). Before accepting a summary, require that task binding and the original peer/session to remain current. If ownership moved or the task was cancelled, refuse the stale answer with a body-free cause retained only until that request's original deadline; a new request replaces the refusal. A changed peer/session reveals no prior task ids.
|
|
22
|
-
- Invalid/stale context readings expose unknown and do not rearm a crossing. Latch a crossing only after its event is accepted; reconsider paused/recovery-held crossings after release with fresh current-session readings. Tee context fields contain finite numeric values or null only, bound to daemon instance, launcher and native session. Context and session go to the per-peer file `claudeStateFile(base, peer)` (the builtin keeps the unsuffixed name); `claude-usage.json` stays one shared file per account.
|
|
22
|
+
- Invalid/stale context readings expose unknown and do not rearm a crossing. Latch a crossing only after its event is accepted; reconsider paused/recovery-held crossings after release with fresh current-session readings. Tee context fields contain finite numeric values or null only, bound to daemon instance, launcher and native session. Context and session go to the per-peer file `claudeStateFile(base, peer)` (the builtin keeps the unsuffixed name); `claude-usage.json` stays one shared file per account. A session under an absolute `CLAUDE_CONFIG_DIR` also writes `claude-usage.<homeTag>.json` (#1810, `homeTag` in `src/hub/home-tag.ts`: a hash, never the path), which the daemon reports under `claude:<label>` for each declared Claude account; a reading in the shared file whose `home` tag is a declared home is skipped (`isDeclaredReading`), so it never pauses the default key.
|
|
23
23
|
|
|
24
24
|
- A provider hard refusal ends a reading override and supersedes a soft evaluation still awaiting its checkpoint; never let the obsolete checkpoint overwrite that pause. An ACP provider quota refusal reports a hard budget reading and confirms the live pause before the adapter requeues work, so the pause fences retries and the existing relay handles assignments. Use the observed window length for an unknown reset; repeated quota refusals while paused do not consume poison-envelope retries, except for an `invocation` request: it gets at most one automatic retry, only when `canRetryInvocation` says so, paused or not (rule: `bus.md`).
|
|
25
25
|
- Kimi's ACP `{used, size}` occupancy is a context reading (`acpContext`, source `acp_usage_update`) bound to the adapter's own session id: never a `tokens` event or a budget window, and an invalid shape reports unknown, not the previous value. A gate crossing sends a checkpoint request only to definitions with `budget.checkpoint` (Claude and Codex); an ACP peer gets the event and the notice (#285).
|
|
@@ -29,6 +29,7 @@ Scope: quota and native context readings, checkpoints, pause, handoff and resume
|
|
|
29
29
|
- `Budget.report` resolves the reporter and its account through `hooks.definitionOf` (the daemon's startup-bound project catalog; builtin-only when absent) and skips `user`, `hub` and a registered kind, configured and external module kinds included, with no `budget` block or with `budget.quotaExempt` (only local); an unregistered id keeps quota accounting. `budget.instrumented` (execution budget) never exempts quota.
|
|
30
30
|
|
|
31
31
|
- Key quota readings, pause records, overrides, checkpoints and handoffs by the canonical account (`hooks.account`, idempotent); telemetry keeps the reporter id and native context occupancy stays per instance. `instanceBudgetHooks` fans pause, resume, checkpoint and handoff out to every member, and `canHandOff` excludes the paused account's siblings. Startup normalization merges old alias pause rows without dropping a row or marking an unfinished handoff done. A manual pause stays per member. Reviewer and headless implementer variants keep their base kind's `budget.account`.
|
|
32
|
+
- Declared accounts (#1810, `src/hub/accounts.ts`): resolve a peer's budget key only through the daemon's `accountOf` (`accountKeyFor`): the bare kind for the default label and `<kind>:<label>` for a declared one, so a project without `accounts` keeps its keys. A home path stays in `config.local.json` and the `accounts.ts` return values; events, logs, status and CLI output carry labels only (`labelForHome`). With `budget.cross_account_handoff = false`, same-kind peers on other labels are siblings (`handoffSiblings`, and `canHandOff` compares the base kind), and a move across accounts writes one `budget_handoff` event with peer ids and labels only (`handoffEvents`).
|
|
32
33
|
- Release-cut quota admission (`releaseQuotaSnapshot` in `src/hub/daemon.ts`, #481 S11): an account has a quota source only when one of its members' definitions has `budget.reader`, or `budget.resetSoftTokensOnResume` with `kimi_tokens_5h > 0`. Without a source a registered account is reported `no quota source` and never defers; with one, an unknown, stale or below-gate reading defers. Manual and budget-record pauses defer for every attached peer.
|
|
33
34
|
|
|
34
35
|
- Window kinds (#285 AC6, AC8): classify a window only through `windowKind` (`src/hub/window-kind.ts`: `native`, `count`, `manual`); a reporter that knows its kind passes it (`ahub budget set` is `manual`, the Kimi count `count`). Readings are kept per window id and kind, never overwriting each other. The gate and `headroom` act only on `gating()`: a fresh `manual` reading replaces the others for its window, and the hub `count` never gates while a fresh `native` or `manual` reading exists. A hard refusal drops the `manual` reading of each window it reports. `status()` lists the gating reading first and marks the information-only fresh ones `superseded`; never gate or route from `status()` windows.
|
|
@@ -43,3 +44,8 @@ Scope: quota and native context readings, checkpoints, pause, handoff and resume
|
|
|
43
44
|
|
|
44
45
|
- Controlled recovery with retained reviewer accounting/wait history or explicitly configured reviewer quota keys requires `reviewer_quota`. Bind accounting replay completeness and safe ordered journal commitment through the existing snapshot integrity; missing/changed journal refuses restoration before optimistic counts can be published. Empty legacy state keeps older-target compatibility.
|
|
45
46
|
- Exhaustion projection (#1513): `projectExhaustion` (`src/hub/budget-projection.ts`) stays pure. An unusable reading answers `unknown` with a cause, never a time. The page's `PROJECTION_CAUSE`/`projectionText` in `src/ui/index.html` must render the same sentence as `projectionText` in `budget-projection.ts` (`test/budget-surfaces.test.ts` runs the page copy).
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
- Renewal (#1806): fence old soft readings with the durable canonical-account marker, cancel the pending checkpoint, and reuse resume's moved-task notice. Never write an override or remove a manual or conductor hold. A stalled handoff leaves renewal unsaved and keeps its own eventual notice. Switched Codex requires known app-server issuance after the saved boundary. Keep home comparisons in memory and out of all records. Keep switched Claude provider quota unknown with the soft gate off. A Claude launch/session ID alone does not prove a new account. While a Codex reviewer attempt is in flight, return unknown for its home comparison.
|
|
50
|
+
- Use the shared window-jitter comparison to reject equal provider usage after renewal, including when either reset time is missing. Manual readings and the trusted Kimi counter have their own admission rules. Preserve the provider forecast baseline through adjacent reset-time jitter and small dips. A missing reset time does not replace the last known reset time. For windows predating renewal, use the average provider usage rise over at least 15 minutes and at least five percentage points. Require a fresh native baseline after restart and keep hourly tokens out of this forecast. Keep forecast series separate by Claude session and launch or by Codex peer and process. Never serialize those IDs or let them influence admission. Keep the projection cache bound to the shown observation.
|
|
51
|
+
- Kimi renewal: admit only trusted hub counts of rows measured strictly after the saved canonical renewal. Apply the same cutoff to live and reviewer rows and replay. Replay also uses the existing resume filter on recording time. Reject future measurements from the renewed soft count, keeping usage events, attribution, dedupe ids and unreadable or tainted states.
|
|
@@ -30,14 +30,15 @@
|
|
|
30
30
|
|
|
31
31
|
- Console attention navigation selects a delivery only by an exact visible row id. A missing id or row prints read-only guidance; never select by peer or fall back to the first Queue row.
|
|
32
32
|
|
|
33
|
-
Scope: the operator console, control WS and its protocol, state files, the dashboard listener and settings, the Claude channel's reconnect, `ahub setup`, git snapshots, upgrade and recovery. Read before editing `src/adapters/definitions/native-recovery*.ts`, `src/adapters/definitions/native-policy-aux.ts`, `src/adapters/definitions/native-config-*.ts`, `src/adapters/definitions/native-cli-*.ts`, `src/cli/console.ts`, `src/cli/console-state.ts`, `src/cli/console-versions.ts`, `src/cli/attention.ts`, `src/ui/needs.ts`, `src/hub/daemon.ts`, `src/hub/config.ts`, `src/hub/ui.ts`, `src/hub/settings.ts`, `src/hub/control-client.ts`, `src/adapters/claude-channel.ts`, `src/hub/restart.ts`, `src/hub/recovery-store.ts`, `src/hub/snapshots.ts`, `src/hub/manager.ts`, `src/hub/lifecycle.ts`, the runtime selection and retention modules (`src/hub/project-runtime-state.ts`, `src/hub/project-runtime.ts`, `src/hub/runtime-capture-prune.ts`, `src/hub/runtime-prune-health.ts`, `src/hub/registry.ts`), `src/hub/crash.ts`, `src/hub/start-mode.ts`, `src/hub/terminal-open.ts`, `src/hub/recovery-error.ts`, `src/hub/db-timeout.ts`, `src/hub/db-schema.ts`, `src/hub/protocol-window.ts`, `src/hub/config-reload.ts`, `src/hub/config-apply.ts`, `src/hub/config-tier.ts`, `src/hub/config-edit.ts`, `src/hub/config-edit-host.ts`, `src/hub/claude-launch-proof.ts`, the session and provenance modules (`src/hub/session-identity.ts`, `src/hub/provenance.ts`, `src/hub/channel-project.ts`), `src/hub/recovery-continuity.ts`, `src/cli/recovery-presentation-options.ts`, `src/cli/setup.ts`, the default agent set (`src/hub/start-agents.ts`, `src/cli/start-agents-run.ts`), `src/cli/upgrade*.ts`, `src/cli/runtime-version-warning.ts`, `src/cli/terminal-recovery.ts`, `src/cli/recovery-package.ts`, `src/cli/facts-hook.ts`, `src/hub/usage.ts`, `src/hub/memory-profile.ts`, the memory code modules (`src/hub/memory-symbols.ts`, `src/hub/memory-code-overlay.ts`, `src/hub/memory-code-head.ts`, `src/hub/memory-stale-anchors.ts`, `src/cli/memory.ts`), the task brief host (`src/memory/brief.ts`, `src/hub/memory-plan-guard.ts`), `src/hub/native-hook-launch.ts`, `src/cli/output.ts`, `src/cli/warn-line.ts`, `src/ui/index.html`, the dashboard view models (`src/ui/roadmap-model.ts`, `src/ui/overview-model.ts`), the acon plugin (`src/ui/plugin.ts`, `src/ui/office-space.ts`, `src/cli/acon-register.ts`), `ahub study` (`src/cli/study.ts`, `src/cli/study-output.ts`), `src/hub/task-code-group.ts` (dashboard Code group), the agent drift sweep (`src/hub/agent-drift.ts`, `src/cli/agents.ts`) or the instance modules (`src/hub/instances.ts`, `src/hub/instance-config.ts`, `src/hub/instance-execution.ts`), or before adding a native peer.
|
|
33
|
+
Scope: the operator console, control WS and its protocol, state files, the dashboard listener and settings, the Claude channel's reconnect, `ahub setup`, git snapshots, upgrade and recovery. Read before editing `src/adapters/definitions/native-recovery*.ts`, `src/adapters/definitions/native-policy-aux.ts`, `src/adapters/definitions/native-config-*.ts`, `src/adapters/definitions/native-cli-*.ts`, `src/cli/console.ts`, `src/cli/console-state.ts`, `src/cli/report-layout.ts`, `src/cli/console-versions.ts`, `src/cli/attention.ts`, `src/ui/needs.ts`, `src/hub/daemon.ts`, `src/hub/config.ts`, `src/hub/ui.ts`, `src/hub/settings.ts`, `src/hub/control-client.ts`, `src/adapters/claude-channel.ts`, `src/hub/restart.ts`, `src/hub/recovery-store.ts`, `src/hub/snapshots.ts`, `src/hub/manager.ts`, `src/hub/lifecycle.ts`, the runtime selection and retention modules (`src/hub/project-runtime-state.ts`, `src/hub/project-runtime.ts`, `src/hub/runtime-capture-prune.ts`, `src/hub/runtime-prune-health.ts`, `src/hub/registry.ts`), `src/hub/crash.ts`, `src/hub/start-mode.ts`, `src/hub/terminal-open.ts`, `src/hub/recovery-error.ts`, `src/hub/db-timeout.ts`, `src/hub/db-schema.ts`, `src/hub/protocol-window.ts`, `src/hub/config-reload.ts`, `src/hub/config-apply.ts`, `src/hub/config-tier.ts`, `src/hub/config-edit.ts`, `src/hub/config-edit-host.ts`, `src/hub/claude-launch-proof.ts`, the session and provenance modules (`src/hub/session-identity.ts`, `src/hub/provenance.ts`, `src/hub/channel-project.ts`), `src/hub/recovery-continuity.ts`, `src/cli/recovery-presentation-options.ts`, `src/cli/setup.ts`, the default agent set (`src/hub/start-agents.ts`, `src/cli/start-agents-run.ts`), `src/cli/upgrade*.ts`, `src/cli/runtime-version-warning.ts`, `src/cli/terminal-recovery.ts`, `src/cli/recovery-package.ts`, `src/cli/facts-hook.ts`, `src/hub/usage.ts`, `src/hub/memory-profile.ts`, the memory code modules (`src/hub/memory-symbols.ts`, `src/hub/memory-code-overlay.ts`, `src/hub/memory-code-head.ts`, `src/hub/memory-stale-anchors.ts`, `src/cli/memory.ts`), the task brief host (`src/memory/brief.ts`, `src/hub/memory-plan-guard.ts`), `src/hub/native-hook-launch.ts`, `src/cli/output.ts`, `src/cli/warn-line.ts`, `src/ui/index.html`, the dashboard view models (`src/ui/roadmap-model.ts`, `src/ui/overview-model.ts`), the acon plugin (`src/ui/plugin.ts`, `src/ui/office-space.ts`, `src/cli/acon-register.ts`), `ahub study` (`src/cli/study.ts`, `src/cli/study-output.ts`), `src/hub/task-code-group.ts` (dashboard Code group), the agent drift sweep (`src/hub/agent-drift.ts`, `src/cli/agents.ts`) or the instance modules (`src/hub/instances.ts`, `src/hub/instance-config.ts`, `src/hub/instance-execution.ts`), the shared host (`src/hub/host.ts`), the MCP endpoint and its bridge core (`src/hub/mcp-endpoint.ts`, `src/hub/mcp-bridge-core.ts`), the Orca pane watch (`src/hub/orca-state.ts`), the light CLI path (`src/cli/light-dispatch.ts`), or before adding a native peer.
|
|
34
34
|
|
|
35
|
-
- The plugin bundle is installed apart from the daemon. Breaking a control WS message contract bumps `PROTOCOL` in `control-client.ts`; a new request answered as unknown or an optional field preserves it, as does additive optional public task metadata in `ui_snapshot` that older clients ignore (such as `deps` in #246).
|
|
35
|
+
- The plugin bundle is installed apart from the daemon. Breaking a control WS message contract bumps `PROTOCOL` in `control-client.ts`; a new request answered as unknown or an optional field preserves it, as does additive optional public task metadata in `ui_snapshot` that older clients ignore (such as `deps` in #246). When `PROTOCOL` advances, the release PR adds a row to `BRIDGE_PROTOCOL_RELEASES` (`src/hub/protocol-window.ts`), leaves the prior row frozen and runs `bun scripts/bridge-protocol-table.ts --write`.
|
|
36
|
+
- Bundle closure and the light path (#1778): the plugin bundle carries what `src/adapters/claude-channel.ts` imports, so it must not reach `src/hub/conductor.ts`, `src/hub/tasks.ts` or `src/hub/tooling.ts` (`test/channel-import-closure.test.ts`; instance configuration comes from `src/adapters/declaration-data.ts`), and `bun scripts/build.mjs --check` fails a stale bundle. `src/cli/light-dispatch.ts` (#1778 T7) runs `version` and `instruction-hook` from their `src/cli/commands/` modules without `main.ts` or `src/hub/config.ts`, and only when no agent, recovery or project marker is in the environment; `bun scripts/check-import-graph.ts --check` fails an import that reaches the shared setup from those entries.
|
|
36
37
|
- `hub_invoke` over the control WS (#445, #991): the daemon binds each admission to its socket and `rid` with an `AbortController` (`invocationRequests`, at most 64 per connection; a duplicate `rid` refuses). `request_cancel` and socket close abort it, and every check after an await confirms the socket is open and still maps that `rid` to the same controller before any effect. Clients go through `ControlClient.request`, whose `controlRequestTimeout` raises a `hub_invoke` wait to `INVOCATION_CONTROL_TIMEOUT_MS`; never call it with a shorter bound.
|
|
37
38
|
- Control write outcomes (#1106, `src/hub/tool-request.ts`): `toolWriteOperation` is the one list of writes whose transport result can be lost (`hub_task_propose`, `hub_review`, `delivery_complete`). After a timeout, a cancel or a closed socket, `ControlClient` answers `outcome: unknown` with the settling read (`toolWriteUnknownReply`), never a plain failure. Replay goes only through `ToolWriteRegistry`, keyed by `requestId` and `toolWriteScope`, with one bucket per actor. `toolWriteCurrent` rechecks authority and privacy before a retained result is returned. The channel strips MCP `request_id` before `taskOp`, and `Tasks` never reads it. An explicit key is refused before sending to a hub without `tool_write_idempotency`. `delivery_complete` keeps the journal's idempotence and never uses the registry. A new retryable write joins `toolWriteOperation`; never add a second key path.
|
|
38
39
|
- Control-write diagnostics (#1126, `src/hub/control-write-trace.ts`): `onControlMessage` wraps the original `onMessage`, keeps its name for the native-branch ratchet, and returns to it untraced before any argument traversal for a client that is not admitted. Privacy guards are factories over primitives (`controlWritePrivacyGuard`), raw-input screens are passed as lazy admission-only callbacks and never retained, and an expired trace is settled and suppressed without touching the operation. Never add a timeout, retry or authority decision to this path; a new boundary is one more closed `ControlWritePhase`, and a test that extracts these closures binds the real guards (tests.md).
|
|
39
40
|
- `peer_stop` is the console's or an admitted conductor's (`admitOperational(sock, "stop")`) and stops, through its adapter, only an owner whose adapter reports `hubOwned === true` and whose `form` is not `tui` (today headless ACP, Pi, local, print-reviewer, configured print and Claude implementer); a present `undefined` form refuses. Refuse native-terminal peers and recovery-held mutations; serialize with starts and permission changes, and refuse a recovery `prepare` while a stop runs. An admitted stop holds delivery through `BusOptions.deliveryHeld` before any teardown await (never a console pause that resume can undo, or a global recovery hold that blocks unrelated peers) and withdraws the peer's pending approvals before the adapter stops. A requested stop holds an in-flight delivery as `needs_review` with an ids-only stop reason, suppresses restart/escalation, and never resolves that delivery automatically.
|
|
40
|
-
- Console review guidance (#711): `r` on a task in review opens `
|
|
41
|
+
- Console review guidance (#711): `r` on a task in review opens the choice built by `reviewChoiceFor` (`src/cli/console-review.ts`, modelled on `modeChoice`) from the row or the open task detail, never a bare prefill; `a` and `c` prefill `review N approved|changes_requested ` with a guide line, a `changes_requested` line with no note is refused in `reduceConsole` before any effect, and the result of a review command is shown as a notice in panels mode (`reviewResult`). The console only prefills and runs `ahub review` as the person: never grant it extra authority, and keep a private task's title out of the choice line (`[pii]`). The CLI cause line (`agentShellCause`, `src/cli/identity.ts`) is printed for the `tools` identity and a person-only hub refusal only, never for the console identity, and never replaces the refusal.
|
|
41
42
|
- Console changed-symbols block (#684 2b): `symbolFields` (`src/cli/console-symbols.ts`) adds `symbols` after `plan` for a task_show-shaped detail only, from the public `codeSymbols`; never from a raw `Task`, never for a private task, never from a stored receipt (one with `repositoryKey` reads as unknown: only the screened public receipt is shown), never as a second copy of the match rule (`planSymbolMatches` in `review-brief.ts`). Unknown is `unknown (no code facts)`, never an empty list.
|
|
42
43
|
- Console Queue `D` (#713) only prefills `queue discard --peer <selected row's peer> --reason `; Enter refuses a missing peer or reason and arms a `y` confirm that names the count, then runs the person's `ahub queue discard ... --yes`. Without `--state` the confirm counts the peer's queued and unsettled failed rows; the console sends that form only when the hub's `features` list `queue_discard_states`, otherwise it sends `--state queued` (#1103). Beyond `list`, the `queue` op is the console's or an admitted conductor's (`admitOperational`, `show`/`resolve`/`discard` only); `discard` without `confirmed` only counts, and a confirmed one needs a reason, is refused during recovery or shutdown and discards row by row through `resolveDelivery` (rule: `bus.md`).
|
|
43
44
|
- Console Usage panel (#683 U3): tab `7`, text from `src/cli/console-usage.ts` (pure strings, no terminal or state import), rendered in `console-state.ts`, fetched in `console.ts` `refresh()` only while panel 7 is open. It reads the `usage` op and nothing else: no event-log read, no board field beyond the task id selected in Tasks. A refusal shows `usage unavailable`, never empty usage; an unknown counter is `unknown`, never 0; a private task is `#id [pii]` from the op's `taskPii`, never a title. The `usage` op folds with `catchUp(250)` and answers `behind: true` when it is not done: never answer from one pass of a big log. Keep Left/Right from 7 wrapping like Settings so the `1`..`5` cycle (#309) stays pinned, and keep PAUSE and 7D out of the width drop list.
|
|
@@ -46,7 +47,8 @@ Scope: the operator console, control WS and its protocol, state files, the dashb
|
|
|
46
47
|
- Dashboard Usage view (#683 U4): `uiSnapshot` builds `usage` only when the request's view is `agents`, never on a hidden view's poll. It folds with `catchUp(100)` and sets `behind: true` when that is not done, so a partial figure is never shown as the whole. A failed read answers `{ unavailable: true }`, never `undefined`, which the page reads as a hidden view and keeps the old figures. The snapshot carries task ids, a `pii` flag and numbers only, never a title; the page shows a private task as `#id [pii]`. Daily figures come only from `UsageRollup.daily` (rule: `budget.md`).
|
|
47
48
|
- Dashboard Code group (#684 2c): `codeGroup` (`src/hub/task-code-group.ts`) is the only dashboard classifier of changed symbols against `plan.symbols`, called in `uiSnapshot` with the public `codeSymbols`, `tasks.publicMetadataText` and `tasks.isPii`; the page (`codeGroupSection`) draws it and never matches names. A private task gets no `codeGroup`. A stored receipt (one with `repositoryKey`), a missing or an unknown one is `state: "unknown"`. A malformed or screened-out plan name is counted in `planWithheld` and marks the group incomplete, never dropped. Lists stop at `CODE_GROUP_MAX` (40) with the rest in `more`, and `counts` are totals. The memory view reads a `node` of up to 512 characters only when it starts with `symbol:` (200 otherwise).
|
|
48
49
|
- Worktree shelf (#1057, `worktreeShelf` and `worktreesView` in `src/hub/daemon.ts`; spec `docs/design/task-board.md`): never add a worktree or branch removal to the daemon (its only one stays the empty hub-made task worktree in `src/hub/task-worktree.ts`); shelf removal exists only in the person's `ahub worktrees tidy --confirm` (`src/cli/worktree-tidy.ts`), which `daemon.ts`, `worktree-shelf.ts`, `board.ts`, `ui.ts` and `plugin.ts` never import. GitHub is read only by `worktrees_refresh_prs` (`refreshPrStates`); a snapshot, `ahub worktrees` and the inbox alert never reach it, and `worktreesView` answers from its 30 s cache without awaiting git. The `worktrees` read is open to a tools caller outside a private turn; override set/clear and the refresh are console-only and refused for a live-test dashboard session. After the awaited git reads, ask the recovery/stopping fence again, then read and write the board with nothing awaited between. The board keeps only the person's Park/Pin (`worktree_override`), never a derived settled state, and accepts one only for a path the shelf just listed, never the main checkout or an instance worktree.
|
|
49
|
-
- Agent CLI drift (#843 AC3): the daemon's `sweepAgentDrift` (once after start, then `agentDriftEveryMs`, default one day, on its own timer apart from the task sweep) is the only caller of `noticeDrift` (`src/hub/agent-drift.ts`). It reads versions only through `agentVersionsAsync` (`src/cli/agents.ts`), which shares `probeTarget` and `probeRow` with the `ahub agents` probe: never add a second probe path, a network read or an install. The first probe is owed until one has run (`agentDriftOwed`): a daemon that starts inside a controlled recovery skips it and the 1 s tick pays it once `recoveryActive()` ends, so a restart or upgrade never waits a day for the first notice. `startDaemon` probes only when `agentDrift` is set (`lifecycle.ts` sets `true`; tests inject a function), so a test daemon never spawns a real CLI. Drift is an installed executable with a readable version whose state is not `verified`; a missing or unreadable one is silent. The notice carries id, version, state and the receipt path only, is marked per (id, version, planner) in `agent_drift_notices` before it is published to that planner alone (and forgotten if it cannot be queued, so only that planner is retried), and goes to `plannerPeers()` that are rostered; with none, nothing is recorded. `agentVersionsAsync` reads stdout as a stream with the 64 KiB cap enforced as it arrives (kill and cancel on overflow) and cancels the reader at its deadline and a short grace after the probe exits, so a descendant holding the pipe cannot hang it. Never put CLI output in it.
|
|
50
|
+
- Agent CLI drift (#843 AC3): the daemon's `sweepAgentDrift` (once after start, then `agentDriftEveryMs`, default one day, on its own timer apart from the task sweep) is the only caller of `noticeDrift` (`src/hub/agent-drift.ts`). It reads versions only through `agentVersionsAsync` (`src/cli/agents.ts`), which shares `probeTarget` and `probeRow` with the `ahub agents` probe: never add a second probe path, a network read or an install. The first probe is owed until one has run (`agentDriftOwed`): a daemon that starts inside a controlled recovery skips it and the 1 s tick pays it once `recoveryActive()` ends, so a restart or upgrade never waits a day for the first notice. `startDaemon` probes only when `agentDrift` is set (`lifecycle.ts` sets `true`; tests inject a function), so a test daemon never spawns a real CLI. Drift is an installed executable with a readable version whose state is not `verified`; a missing or unreadable one is silent. The notice carries id, version, state and the receipt path only, is marked per (id, version, planner) in `agent_drift_notices` before it is published to that planner alone (and forgotten if it cannot be queued, so only that planner is retried), and goes to `plannerPeers()` that are rostered; with none, nothing is recorded. `agentVersionsAsync` reads stdout as a stream with the 64 KiB cap enforced as it arrives (kill and cancel on overflow) and cancels the reader at its deadline and a short grace after the probe exits, so a descendant holding the pipe cannot hang it. Never put CLI output in it. The one network read, `ahub agents --latest` (#1808 T5, `src/cli/agents-latest.ts`), is person-run and the daemon never imports it, so no hub path reaches the network for it.
|
|
51
|
+
- Orca pane watch (#1811 T2, `OrcaPaneWatch` in `src/hub/orca-state.ts`): ask Orca only about a peer whose oldest delivery stayed unaccepted for 2 min and whose live launch record names a pane, at most once a minute per peer, with one `orca agent list --json --worktree id:<id>` read killed at 5 s, and never during recovery. Only a unique `blocked` or `waiting` row for that `paneKey` becomes an Attention item; an error, a timeout or any other shape clears it, and the hub never answers the prompt.
|
|
50
52
|
- SDLC band timer (#481 S7): the daemon's band interval (`bandsEveryMs`, default 5 min) is the only caller of `tasks.proposeFromBands`. It skips while stopping or in recovery, when `tasks.bandsState()` is not ready or `bandsHeld` holds, and when `board.statusRevision()` with the band signature is unchanged since the last pass that ran; it records that key after the write. A failure is one sanitized `hub.log` line. Writer rules: `tasks.md`.
|
|
51
53
|
- `ahub board` (#724): `renderBoard` prints one line per task only with a terminal width and without `--full`; `--full`, `ahub task show` and output without a width keep the full table and SDLC advice. `STAGE_CODES` (`src/cli/output.ts`) keys on blocker-text prefixes from `src/hub/sdlc.ts`: rewording a blocker there updates its code in the same PR. TITLE is cut, never wrapped; STAGE is never dropped (it falls back to the meter and the code); a PII row keeps its `(ahub task show N)` hint while 8 title columns remain.
|
|
52
54
|
- CLI output default (#814): a command prints for a person unless `--json` is given. The recovery and upgrade commands follow it too (`src/cli/upgrade-output.ts` composes `planLines`, `renderPlan`, `renderOperation`, `renderBlocked` and `choiceInstruction`, so the non-interactive text never says what the screens would not): a pipe and `--dry-run` print the plan with blockers, reconnect-only and fresh-start peers in stdout, `--json` keeps the document and the stderr lines (#206), and `recoveryDisplay` takes a pipe's width from `COLUMNS`. Hub tool text (`task show`, the backlog and release commands) is parsed on the CLI side by `showToolText` and rendered by `src/cli/task-output.ts`; `--json` prints the text byte for byte, unparseable text prints as it came, and a private task is rendered as the stub the hub sent, never asked for more. A command that takes free text reads `--json`, `--full` and `--color=` through `splitPresentation` (`edges`): only a leading or trailing run is a flag, and a value flag's value never is, so a reason keeps its words. `test/cli-json-guard.test.ts` also scans every file in `src/cli/` for a print of a hub tool's text (`console.log(await taskOp(<op>))`, or `console.log(x)` where `x` is bound from one) and passes only when the print is inside a `--json` branch, the op is in the named `SENTENCE_OPS` (ops whose daemon case returns prose, each checked against the daemon), or it is named debt with a reason (`TEXT_DEBT` for JSON ops a later task converts, `CONDUCTOR_DEBT` for the conductor-role commands, `REFUSAL_FALLBACK` for the refusal sentence printed after `--json` and the table were handled); a new JSON-returning op printed bare fails it, and an entry that matches no print fails too. Convert a command by rendering it through `showToolText`, never by adding it to a list. A renderer is a pure function in `src/cli/` (`sdlc-output.ts` for the `sdlc` read commands) and the call site keeps its own visible `if (options.json) console.log(JSON.stringify(...))`, so `test/cli-json-guard.test.ts` can see the branch. Never print JSON by default: add the command's `--json` branch, or name the site in the guard's `DATA_FORMAT` (JSON by purpose: `export`, `sdlc export`, `bench export`, the PreToolUse hook reply) with its reason. The guard accepts a `--json` branch only when the condition PROVES the flag (`selectsJson`): `X.json` on an option holder (`options`, `display`, `present`), `args|flags.includes("--json")`, a known alias, `&&` when either side does, `||` only when both do, `=== true`. Anything else (`!x`, `=== false`, `|| other`, `?? x`, a comparison, an unknown name) is not a guard, so a new shape fails until it is written one of these ways. A renderer table never exceeds the terminal: `grid` (`sdlc-output.ts`) wraps cells, then falls back to one labelled block per row, and keeps every identifier whole. `NOT_YET_CONVERTED` is debt the later #814 tasks delete; an entry that matches no site fails the test, so the list only shrinks. `sdlc` drops `--json`, `--full` and `--color=` from its operands only for its read subcommands (`sdlcOperands`): the others keep their argv exactly. A hub tool's JSON text that does not parse prints as it came, never as an empty report.
|
|
@@ -66,13 +68,16 @@ Scope: the operator console, control WS and its protocol, state files, the dashb
|
|
|
66
68
|
- `ahub setup` reads Claude Code's state from `--json` listings and takes one step at a time, re-reading after each; never match paths or names by substring. It installs and judges only the `user`-scope agent-hub plugin row; a `project` or `local` row is reported as preserved and never removed, and a marketplace removal that would remove one is blocked, not run (#1073).
|
|
67
69
|
- A copy of the git index keeps the original's mtime (`snapshot()`): git's racy-entry check compares entries with the index file's time in whole seconds, and a fresh copy makes a same-size edit look clean.
|
|
68
70
|
- State files that clients read (`status.json`, `control-token`) are written after the port is bound, and `status.json` via temp file + rename.
|
|
71
|
+
- Project context (#1779 T2): daemon code takes its root, state directory and child environment only from `ctx` (`daemonProjectContext` or `hostedProjectContext`, `src/hub/project.ts`), and a child bound to the project gets its variables only from `projectChildEnv(ctx)`. Never read `process.cwd()`, `AGENTHUB_STATE_DIR` or `AGENTHUB_PROJECT_DIR` under `src/hub`: `scripts/check-process-identity.ts` (run by `test/process-identity-check.test.ts`) fails such a read unless its exact line is on `ALLOWED` with its side and reason, and fails a stale entry.
|
|
72
|
+
- Shared host (#1779 T3a, `src/hub/host.ts`, `ahub host`): `host.shared` (off by default) runs a project's daemon in the one `Host` of its runtime. Only the winner of `Registry.claimHost` serves `hosts/<hash>.sock` or removes a stale one; a loser joins the answering host through `askHost` or fails closed, and a recovery operation or live test never runs shared. Launch a hosted project only through `launchHostedProject` inside `Host.within(id, ...)`, so an uncaught error stops that project alone; an unattributed one stops the whole host.
|
|
73
|
+
- MCP endpoint (#1780, `startMcpEndpoint` in `src/hub/mcp-endpoint.ts`): it starts only when the lifecycle passes `mcpHome`, so a test daemon never writes into the person's hub home; `run/` and `run/<projectId>/` stay `0700` and this user's, `mcp.sock` `0600`, and a refusal is logged while the hub runs without the endpoint. A session opens only on a valid hello (the control token compared in constant time, within 5 s and 8 KiB, from a pid `ps` reports as this user) and keeps an account label, never the home path. Only an `exclusiveOwner` daemon (it holds its fixed control port) replaces a stale socket, after a refused connect and the same inode on two `lstat`s; never add another unlink path.
|
|
69
74
|
- Open native memory through the shared profile-aware helper with an explicit current selector binding; never fall back to shared v1 after invalid/missing generation metadata. Check that binding at hub call-site entry and before candidate/counter writes, including callbacks retained across awaits; do not intercept store methods with proxies/private hooks or claim atomic in-flight cutover. Quiesce and close consumers before migration/selection changes, then reopen through the supported lifecycle. Keep the sidecar at the independent memory root, not inside the selected generation. Report memory availability separately from bus health; never hot-rebind or migrate as a startup repair (`docs/memory.md` §Selected memory profile).
|
|
70
75
|
- Take the memory project only from `memoryProjectFor` (the alias-resolved `memoryProjectKey` in the ambient memory home) in the daemon, `ahub memory` and `ahub goal`, or from `memoryProjectForStore` for a caller-injected store, which resolves the alias in that store's own `profile.home`; bind an injected sharded store with `bindProfileMemory(store, _, memoryProjectKey(cwd))` so a remap latches it unavailable; never use a raw `memoryProjectKey` as the project of a store, screen or raw command. The daemon resolves it once at start (falling back to the raw key, so the memory home never blocks startup) and passes both `project` and the raw `projectKey`, so the binding latches unavailable once the alias log maps the key elsewhere; a restart binds the new key.
|
|
71
76
|
- Ask whether a curated store holds a derived index only through `memoryIndexExists` (`src/hub/memory-profile.ts`, read-only directory listing): agent-mem names the file per index version (`index.db`, `index-v4.db` since 0.25.0), so never test or open a fixed `index.db`.
|
|
72
77
|
- Detect a curated split by `lstat` of `shards.json` (`splitMarked`), never `existsSync`. An inactive, malformed, dangling or unreadable marker throws `MEMORY_SPLIT_INCOMPLETE` before any shard read, and callers show that message instead of the generic profile refusal. On a split home open only through `openShardStore` with the canonical memory dir and a project key; never a plain `MemoryStore`, and refuse without a key. Profile inspection and `profile-check` on a split home read the shard seals (`shardProfileForProject` for each hub's own project), never the legacy selector (#536).
|
|
73
|
-
- The channel's reconnect loop stops on closes a retry cannot fix (`TERMINAL_CLOSES` in `claude-channel.ts`); a new daemon close code that means "do not come back" belongs there, or two clients fight over it forever.
|
|
74
|
-
- The channel advertises `tools.listChanged`; build its tool list only through `toolListFor` and
|
|
75
|
-
- Close 4000
|
|
78
|
+
- The channel's reconnect loop stops on closes a retry cannot fix (`TERMINAL_CLOSES` in `claude-channel.ts`); a new daemon close code that means "do not come back" belongs there, or two clients fight over it forever. Close 4426 (wire version mismatch) is not terminal: the session logs the cause and retries every `WIRE_MISMATCH_RETRY_MS` (5 min), so an upgraded hub takes it back without a restart.
|
|
79
|
+
- The channel advertises `tools.listChanged`; build its tool list only through `toolListFor`, a wrapper of `mcpToolList` in `src/hub/mcp-bridge-core.ts`, which also holds the instructions (`mcpServerOptions`); both take explicit `McpSurface` values and read no environment or file, so the MCP endpoint (#1780 T2a) can share them. Change the channel's tools or text there. Record `listedTools` from each `ListTools` reply, so a reconnect sends `sendToolListChanged` when the whole definitions differ or the lifecycle stays unreadable (#490).
|
|
80
|
+
- Close 4000 ends on its own (4426 retries on its own timer, above), so it is not in `TERMINAL_CLOSES`: the session stands by and reconnects only once `status.json` reports the peer offline and not `claiming`. One exception (#205, `peerHeld` in `claude-channel.ts`): a session with channel pushes also reconnects when the holder is reported `toolsOnly` and not `claiming`, and takes the peer; the daemon refuses the reverse with 4000. Reconnecting blind would evict whoever holds the id now, and the two would trade it forever. `status.json` is advisory: a reconnecting standby sends `standby: true`, and the daemon refuses it with 4000 while `standbyHeld` holds (a claim, or an open socket; only a channel-capable standby may replace a pull-only holder). A hello whose `launchId` differs from this instance's current `claude-launch` record closes with 4430, which is in `TERMINAL_CLOSES`; no launch id or no record keeps the old admission (#551). `claim()` happens at hello and `attach()` only after the preface, so the peer reads as offline in between: the daemon writes the status file at the claim and the flag covers that window.
|
|
76
81
|
- Peer takeover (#1174): `peer_takeover` is console-role only, with closed fields (`peer`, optional `standbyId` of at most 64 characters, no control or format characters), and `ahub peer takeover` is in `liveTestRefusal`. It refuses without detaching the owner when no eligible standby remains, and answers `outcome: "requested"`; attachment is confirmed only by status. A connection detached by the person (`detachedByPerson`) refuses every peer request with the fixed detached text, and the plugin stops reconnecting on 4405. Never treat a standby id or reported PID as session, launch or permission evidence.
|
|
77
82
|
- Channel push evidence (#1171): the plugin pushes only when `currentClaudeChannelEvidence()` (`src/adapters/claude-channel-evidence.ts`) reads `development-channel-launch` from the direct parent's bounded process row. The inherited `AGENTHUB_CHANNEL` marker alone, or unknown, malformed or changed-parent evidence, keeps it tools-only. The hello's `channelEvidence` is a closed, display-only label: an unlisted value becomes `unknown`, a missing one `unreported`. Never admit, deliver or authorize from it, and never walk ancestors.
|
|
78
83
|
- Adding a native peer requires testing the command emitted by the actual recovery driver, not only its inspection or launch helpers. Never let a generic non-Codex branch treat a new peer as Claude.
|
|
@@ -175,7 +180,7 @@ Scope: the operator console, control WS and its protocol, state files, the dashb
|
|
|
175
180
|
- Experiment comparisons (#599): preserve the separate conditional `research_comparisons` floor and integrity for plans, exact protocol/evaluator approvals and causal protocol-context rows. Never backfill legacy order from timestamps or carry approval to a changed hash. Keep the approval op under the console-only `study_` dispatch guard.
|
|
176
181
|
- Doctor memory capture (#1008, #1025): the `memory capture: <tool>` rows come only from `amem setup <tool> --json`, a preview that writes nothing (`readMemorySetup` in `src/cli/main.ts`: no shell, 10 s, 256 KiB), judged by the pure `nativeMemoryCaptureRow` (`src/adapters/definitions/native-cli-doctor.ts`). A plan not in the documented shape, a non-zero exit, a timeout or unparsable output is unknown, never ready; never read dotfiles text or a client's config, and do not scrub the caller's identity before the call.
|
|
177
182
|
- Handoff transport (#604): `handoffOut` connects to the target as a `console` role through `ControlClient` (same token file and machine user as every control message; the hello checks the target's project root and instance), and the target answers every handoff message, an unknown one included. `handoffNotifyOrigin` hangs off `board.onChange` inside its own try, so a task move never waits for, or fails because of, another project's daemon. A target is judged by its own `status.json` features (`checkTarget`), never by a guess from its version. The inbound `task_handoff` is refused while recovery is active, counts in `taskOpsInFlight` so a recovery commit waits for it, and hands `handoffIn` a fence (recovery or `stopping`) that it asks again right before the board write, after the PII screen's await. Keep `task_handoff` in `DAEMON_FEATURES` and its recovery guard beside `research_experiments`; no `PROTOCOL` bump, because a new message type is answered as unknown by an older hub and an optional field is ignored. Handoff diagnostics (#1203 T3): a connection failure to a target is classified by `handoffConnectFailure` from the error's `code` (4426, 4404, `AHUB_CONNECT_TIMEOUT`, anything else), never from its message, and every handoff failure log goes through `handoffLog`, which keeps the last cause per target (`handoffFailures`, read by `handoffListView`) and rate-limits the line with `handoffLogGate`; a new silent `catch` in the handoff block is a defect. `handoffListView` opens no connection (registry and descriptor files only), so `--list` never waits on a target. `hub_task_handoff_sync` is a control op and not in `hub-tools.ts`: an agent never sees it, and `Tasks.handoffSyncAuthority` refuses anyone but the person or the conductor. `handoffCatchUp(only, wait)` with `wait` waits for the running pass and then runs its own, so a sync answers after a pass that began when it was asked, but never for longer than `handoffSyncBoundMs` (20 s, below the CLI's 30 s control timeout): a slower pass makes it answer `syncing: true` with the list, and a sync must never end in the generic "no answer from the hub". Handoff sequence (#1203 T2): `recordHandoffOutbound` applies a write with a `seq` only when it is newer, inside the one statement; `handoffEvent` returns `recorded: false` for a stale one before it publishes, so never publish a follow-back before the write says `applied`. `handoffCatchUp` reads `handoffOutboundOpen` (no cap; `handoffOutbound` is the capped display list, never the catch-up's input), runs one pass at a time and queues a request that arrives meanwhile (the targets it names, or all) to be drained when the pass ends, so the guard never drops a watcher's request; `handoffWatch` asks once for the whole changed set; it asks in chunks of `HANDOFF_STATES_CHUNK`, and checks `stopping` between requests; its timers go in `intervals`. A new handoff event goes only to an origin that advertises `task_handoff_seq`. Handoff key (#1203 T1): `handoffOut` sends a key only to a target whose status descriptor lists `task_handoff_key`; a timeout or closed connection (`handoffOutcomeUnknown`, which reads the client's fixed wording and anchors it) is resent once with the same key, then asked by key (`task_handoff_by_key`), then `outcome_unknown`, never `invalid`. A refusal of the resend never settles an unknown first attempt (its PII screen may still file the task): it is kept as a note and the by-key lookup still runs. The caller's deadline covers the whole recovery: `controlRequestTimeout` gives `hub_task_handoff` `HANDOFF_CONTROL_TIMEOUT_MS`, built from the same `HANDOFF_*` budgets `handoffOut` spends, so the CLI and the MCP path (both ask for 30 s) receive `outcome_unknown` with the key instead of a generic timeout; change a budget there and the deadline moves with it. Never write the outbound row before an answer, and never reset an existing one (`handoffSent`). The follow-back envelope carries `refs.handoff` and no `refs.task`: a new envelope field that names a task in another project must not reuse `refs.task`, which the bus judges against this board.
|
|
178
|
-
- Staged upgrades (#1039): retain `status.protocol` at the compatibility floor and publish `protocolMin`/`protocolMax`; negotiate the highest common control version and preserve each attached channel's actual negotiated protocol in recovery metadata. New scoped recovery receipts use schema 3 and per-project holds; keep legacy unscoped receipt behavior. Start ordinary project daemons from verified versioned release captures. Check `hub.db` with `db-schema.ts` before startup effects and every writable opener; advance its marker only with an incompatible format migration, never merely on opening with a newer binary. Before source replacement, controlled targets require `schema_guard`; preserve the retained target evidence of fully committed legacy receipts. Unguarded published binaries remain outside the bootstrap guarantee. Keep project runtime selection in bounded project-bound `runtime.json`; refuse Git-tracked or indeterminate repository state before using or replacing that authority. Updated 0.26+ up/manager/dashboard paths use its verified capture or a named version refusal. Preserve the explicit pre-0.26 published-CLI ceiling with a `ponytail:` note; never raise a DB/bootstrap floor for this selection. Compute path-scoped Git trust once per startup outside the writer lock; reuse its project-bound access for runtime reads and writes. Record selection and synchronous launch under the same registry lock used for capture publication and prune quarantine; confirm the unchanged selection and owner at readiness, and require the internal daemon to execute from that exact root. Scoped recovery must not refresh the shared manager. Prune only verified unreferenced versioned source captures, keep newest three/version, and defer on active recovery, unknown reference inventory or exhausted budgets. Schedule rate-limited maintenance after startup returns; keep only bounded metadata validation and atomic quarantine inside the registry writer lock, with candidate hashing and recursive deletion outside it. Refuse managed execution from reserved `.runtime-prune-*` paths; leave changed quarantine contents undeleted. Keep the 1 ms ledger wait on startup admission only; worker statements use the normal bounded wait. Record PID plus process signature and replace only a proven-gone running owner atomically under the admission transaction, with id/phase-fenced completion. Doctor names uncertain ledger state and leftover quarantine paths without repairing or deleting them. Reject empty recovery plans before source preservation.
|
|
183
|
+
- Staged upgrades (#1039): retain `status.protocol` at the compatibility floor and publish `protocolMin`/`protocolMax`; negotiate the highest common control version and preserve each attached channel's actual negotiated protocol in recovery metadata. The accepted window is `acceptedBridgeWindow`: `bridgeProtocolWindow` over `BRIDGE_PROTOCOL_RELEASES`, the wider of `upgrade.bridge_window_days` (default 90) and the last `upgrade.bridge_window_min` protocol rows (default 3), validated by `bridgeWindowSettings` and clamped to `PROTOCOL_MIN`..`PROTOCOL`; a hello outside it closes 4426. New scoped recovery receipts use schema 3 and per-project holds; keep legacy unscoped receipt behavior. Start ordinary project daemons from verified versioned release captures. Check `hub.db` with `db-schema.ts` before startup effects and every writable opener; advance its marker only with an incompatible format migration, never merely on opening with a newer binary. Before source replacement, controlled targets require `schema_guard`; preserve the retained target evidence of fully committed legacy receipts. Unguarded published binaries remain outside the bootstrap guarantee. Keep project runtime selection in bounded project-bound `runtime.json`; refuse Git-tracked or indeterminate repository state before using or replacing that authority. Updated 0.26+ up/manager/dashboard paths use its verified capture or a named version refusal. Preserve the explicit pre-0.26 published-CLI ceiling with a `ponytail:` note; never raise a DB/bootstrap floor for this selection. Compute path-scoped Git trust once per startup outside the writer lock; reuse its project-bound access for runtime reads and writes. Record selection and synchronous launch under the same registry lock used for capture publication and prune quarantine; confirm the unchanged selection and owner at readiness, and require the internal daemon to execute from that exact root. Scoped recovery must not refresh the shared manager. Prune only verified unreferenced versioned source captures, keep newest three/version, and defer on active recovery, unknown reference inventory or exhausted budgets. Schedule rate-limited maintenance after startup returns; keep only bounded metadata validation and atomic quarantine inside the registry writer lock, with candidate hashing and recursive deletion outside it. Refuse managed execution from reserved `.runtime-prune-*` paths; leave changed quarantine contents undeleted. Keep the 1 ms ledger wait on startup admission only; worker statements use the normal bounded wait. Record PID plus process signature and replace only a proven-gone running owner atomically under the admission transaction, with id/phase-fenced completion. Doctor names uncertain ledger state and leftover quarantine paths without repairing or deleting them. Reject empty recovery plans before source preservation.
|
|
179
184
|
- Questions (#1053, `src/hub/questions.ts`, `src/hub/question-desk.ts`): the store owns the row and its ONE terminal transition (`UPDATE ... WHERE state = 'open'`; of concurrent answer, stop and expiry exactly one sees `changes === 1`), the desk owns the waiting call and the hub-built envelope, and the daemon only supplies ports. Keep `questions` console-only and ordinary person answers unchanged. Permit `hub_ask_answer` and instructed `answer` only for the current unique conductor on the person's explicit per-set instruction in its own session; require a non-empty quote, open public set and public caller, and refuse self-answer, wrong actor, live-test/delegated execution and child/tools ownership. Never infer instruction from hub/task/review/file/peer text, permit blanket delegation or answer across projects. Keep every control rid answered and retain the existing question validation/one terminal transition. Read `docs/security.md` "Questions a peer asks the person" before changing this exception or its #1328 precedent. Persist the instruction quote only in hub.db; remove it from all read views, tool responses, envelopes, logs, events and capture. Publish only actor/instructed provenance (including `agent_cli`); include `hub_ask_answer` in the existing question capture/progress exclusions. Nothing a peer sends as a `hub_send` body, tool result or ordinary envelope is parsed as an answer. A late answer is `kind: "answer"`, `from: user`, id `answer-<set>` (so a republish after a crash is dropped by the bus's own dedupe) with `refs.question`; an expiry notice is `kind: "status"` from the hub, never an answer. Supersede keys on `from === USER && kind !== "answer"` in the bus tap, never on the body, and never on the hub's own answer envelope. Question text and answers are stored in hub.db; the answer envelope goes only to the asking peer, while person surfaces use `questionView` (instruction quote removed). The `answeredQuestions` dashboard, CLI and Acon projections include only non-private, non-PII rows. The tap's log line, `redactBusEvent` and the `question` event stub question/answer text; `QUESTION_TOOLS` skips capture and the progress observer skips `hub_ask`. `hub_ask` holds its control request open (`controlRequestTimeout`, `request_cancel` through the shared `invocationRequests` map, so a closed socket or an aborted turn cancels the row) and Pi's bridge lifts its idle timeout for that one call. A new peer kind gets `questionWaitMs` on its definition (fixed builtins only, `assertNativeCapabilityScope`), never a wait chosen by the caller. The `questions` feature label is a recovery label: an older target ignores the table, so keep it in `DAEMON_FEATURES`. Start repair runs once after `ready`'s locals exist (`questionDesk.repair()` just before `ready = true`), and the sweep timer is pushed only after the desk exists.
|
|
180
185
|
- Completions (#1054 T2/T3, `src/hub/completions.ts`, `src/hub/completions-store.ts`): a run opens at the `turn_start` that consumes a `from: user` delivery (never the hub's own `answer`), only for a peer whose definition declares `settle`. An unattached pull-only peer creates none; a launcher-bound Kimi TUI opens one only after native readback proves a person origin. `settleCheck(peer)` is the ONE settle check and never throws; call it from every place a pending-work fact can change (turn end, `bus.onQueues`, a permission or question closing, an isolated check ending, `Tasks.checkEnded`, a native task notification or a native-background re-read). The bus takes a delivery out of its queue before the peer's idle reaches the state tap, so `queuedContinuations` also counts `dispatching` rows and `deliveredAwaitingTurn` (bounded to 10 s, `ponytail:` in the code); drop either and a continuation reads as nothing pending. Claude settles only on the verified native Stop (a lost channel or watchdog carries no id and never settles). Kimi TUI settles only on correlated final-turn readback plus a known-empty background inventory; a running or unknown inventory and an active native turn stay working. A `limit` or budget pause ends the run with no completion (`budget.record`), an explicit stop calls `quietStop`, and `completions` is a recovery feature label (`hasPending`: an open run or an unread completion). The store keys a completion by the run's first turn id (`UNIQUE`), so repeated restarts yield one `interrupted` completion; never reconstruct from `events.jsonl`, which cannot say who started a turn. Launcher end/socket loss also settles an open run `interrupted`, once. Receipts (#1054 T4/T5): `completion_receipts` has a UNIQUE index on `completion_id`, so `markSeen` is one compare-and-set and a mark-unread has exactly one row to delete; `result_seen` and `results` are console-role control cases (rid always) placed before `case "kill"`, and nothing else writes a receipt: never mark read from a snapshot, a status read, a listing or an envelope. The `result` need is level `watch` and is not in the `waiting`/`blocked` lists in `needs()`; keep it that way so a result never reads as something to act on. Reconstruction drops an open run whose peer has a budget pause record before it would settle it `interrupted` (persist before remove, per run), and `CompletionStore.prune` bounds the table to the newest 500 read completions at start; never prune an unread completion or an open run. The title of a result is computed at display (`resultView`), a stub when private, and no prompt or reply text is ever stored. Native-person results always stay private.
|
|
181
186
|
- `src/ui/roadmap-model.ts` and `src/ui/overview-model.ts` (#1514) are injected into the page by source (`/* ROADMAP_MODEL */` and `/* OVERVIEW_MODEL */` in `src/hub/ui.ts`). Keep them self-contained, with no imports or module closures. The roadmap view writes through `textContent` only; the `roadmap` snapshot block rides only `view: "roadmap"` and the `overview` block only `view: "overview"`. The Overview reads the same `taskSample` as `ahub sdlc metrics`; an underivable figure is `null` (shown `unknown`, never 0), and a private task is only counted in `withheld`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Security review
|
|
2
2
|
|
|
3
|
-
Scope: the security pass of a review (`REVIEW.md`), and any change under `src/local/`, `src/omniroute/`, `src/hub/envelope.ts`, `src/hub/memory-policy.ts`, `src/hub/project.ts`, `src/hub/tool-refusal.ts`, `.github/workflows/` or `scripts/release-*`. Read before reviewing such a change or giving a `security` finding. The boundaries themselves are described in `docs/security.md`.
|
|
3
|
+
Scope: the security pass of a review (`REVIEW.md`), and any change under `src/local/`, `src/omniroute/`, `src/hub/envelope.ts`, `src/hub/memory-policy.ts`, `src/hub/project.ts`, `src/hub/tool-refusal.ts`, `src/hub/mcp-endpoint.ts`, `src/hub/host.ts`, `src/hub/mcp-bridge-core.ts`, `.github/workflows/` or `scripts/release-*`. Read before reviewing such a change or giving a `security` finding. The boundaries themselves are described in `docs/security.md`.
|
|
4
4
|
|
|
5
5
|
## Rules for every security pass
|
|
6
6
|
|
|
@@ -17,8 +17,8 @@ Scope: the security pass of a review (`REVIEW.md`), and any change under `src/lo
|
|
|
17
17
|
|
|
18
18
|
- Every body rendered beside a hub-written header passes `sanitize()` (`src/hub/envelope.ts`). A new render path that skips it lets one agent forge another's header.
|
|
19
19
|
- The Claude channel escapes a leading `/` in every notification body (`channelBody` in `src/adapters/claude-channel.ts`), so a peer's body cannot read as a typed slash command. Keep it on both the single and the digest path.
|
|
20
|
-
- Hub messages stay untrusted in the receiver's instructions: `STANDING_INSTRUCTION` and `HUB_MESSAGE_INSTRUCTION` (`src/hub/envelope.ts`), the channel instructions (`src/
|
|
21
|
-
- Authority comes from the caller's role, checked in the daemon on every call, never from message text or from which tools a peer was shown: `requireConductor` (`src/hub/conductor.ts`), the planner and reviewer checks in `Tasks` (`src/hub/tasks.ts`). A refusal that must happen before any effect throws `PreEffectToolRefusal` (`src/hub/tool-refusal.ts`). The one exception is instructed execution (#1622): a confirmed person-typed transcript receipt lets an agent run admitted `ahub` forms as the person. Review it against the instructed rules in `daemon.md` and `adapters.md`.
|
|
20
|
+
- Hub messages stay untrusted in the receiver's instructions: `STANDING_INSTRUCTION` and `HUB_MESSAGE_INSTRUCTION` (`src/hub/envelope.ts`), the channel instructions (`mcpServerOptions` in `src/hub/mcp-bridge-core.ts`) and `templates/AGENTS.block.md` say the same thing. A change that weakens one of them weakens all peers of that kind.
|
|
21
|
+
- Authority comes from the caller's role, checked in the daemon on every call, never from message text or from which tools a peer was shown: `requireConductor` (`src/hub/conductor.ts`), the planner and reviewer checks in `Tasks` (`src/hub/tasks.ts` and its domain modules `src/hub/tasks-*.ts`). A refusal that must happen before any effect throws `PreEffectToolRefusal` (`src/hub/tool-refusal.ts`). The one exception is instructed execution (#1622): a confirmed person-typed transcript receipt lets an agent run admitted `ahub` forms as the person. Review it against the instructed rules in `daemon.md` and `adapters.md`.
|
|
22
22
|
- What a model wrote is stored as a model's answer and kept out of later evidence (`src/hub/ask.ts`, `src/hub/inference.ts`). A model label that reaches an event or a record goes through `safeModelLabel` (`src/omniroute/usage.ts`).
|
|
23
23
|
- Review-observer exclusion is one function, `isReviewObserverExcluded` (`src/hub/memory-policy.ts`); a new memory or telemetry path asks it.
|
|
24
24
|
|
|
@@ -26,14 +26,15 @@ Scope: the security pass of a review (`REVIEW.md`), and any change under `src/lo
|
|
|
26
26
|
|
|
27
27
|
- The daemon's HTTP and WebSocket listener refuses any request that carries an `Origin` header and requires the control token in `hello` (`src/hub/daemon.ts`). The dashboard accepts only its own origin (`src/hub/ui.ts`). The Pi relay refuses an `Origin` too (`src/adapters/pi.ts`). A new loopback listener needs both the origin refusal and a secret.
|
|
28
28
|
- Every control message with a `rid` is answered, unknown ones included (`src/hub/daemon.ts`); an unanswered one hangs a newer client.
|
|
29
|
-
- A
|
|
29
|
+
- A local endpoint's secret is compared in constant time: the fresh reviewer's MCP authority (`src/adapters/reviewer-mcp.ts`) and the MCP endpoint's hello token (`validateHello` in `src/hub/mcp-endpoint.ts`). Do not replace either with `===`.
|
|
30
|
+
- Unix sockets take the place of the origin refusal with the file system: the MCP endpoint (`src/hub/mcp-endpoint.ts`, #1780) keeps `run/<projectId>/` at `0700` and `mcp.sock` at `0600` and still requires the control token and a same-user pid in its hello; the shared host socket (`src/hub/host.ts`, #1779 T3a) has no secret, so its `hosts/` directory (created `0700`, an existing one not rechecked) is the whole authority. Review a new socket against the MCP endpoint's checks (`privateDirectory`, token, same-user pid).
|
|
30
31
|
|
|
31
32
|
## Data isolation and paths (companion `data-isolation`)
|
|
32
33
|
|
|
33
34
|
- PII is redacted where the envelope and the public view are built: `Tasks.publicTitle` and the task public view (`src/hub/tasks.ts`), event fields through the allowlists in `src/hub/operational-view.ts`. A new log line, notice, tool result or memory call that shows task text uses them; a redaction added at a call site is the finding.
|
|
34
35
|
- PII decisions ask `onCampus()` (`src/omniroute/client.ts`), never `!offCampus()`: unknown is not on campus.
|
|
35
36
|
- Paths resolve through `realPath` (`src/hub/project.ts`, from `@staix/agent-mem/platform`), and a deny or hub-owned check runs on the name the caller typed as well as the resolved one. The local worker's `guardPath` (`src/local/tools.ts`) checks names; never rebuild a real path from the names you were given.
|
|
36
|
-
- A lock is never removed on behalf of a dead holder with a check followed by an unlink. `SourceRegistry.locked` (`src/hub/sources.ts`) is the reference.
|
|
37
|
+
- A lock is never removed on behalf of a dead holder with a check followed by an unlink. `SourceRegistry.locked` (`src/hub/sources.ts`) is the reference. Two socket replacements are bound to a claim instead: the MCP endpoint replaces a stale `mcp.sock` only as `exclusiveOwner` (the daemon holding its fixed control port) after a refused connect and an unchanged inode, and `serveHost` removes a host socket only as the holder of `Registry.claimHost`. A new replacement needs such a claim.
|
|
37
38
|
- The gateway key and Access headers are read only under `src/omniroute/`.
|
|
38
39
|
|
|
39
40
|
## Supply chain and release (companion `supply-chain`)
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
# Task board and hub tools
|
|
2
2
|
|
|
3
|
-
Scope: the task flow, assignment, the state machine and the hub's MCP tools. Read before editing `src/hub/tasks.ts`, `src/hub/board.ts`, `src/hub/routing.ts`, `src/hub/task-sweep.ts`, `src/hub/settled-roles.ts`, `src/hub/conductor.ts`, `src/hub/supervision.ts`, `src/hub/tool-refusal.ts`, `src/hub/hub-tools.ts`, `src/hub/review-brief.ts`, `src/hub/reviewer-pool.ts`, `src/hub/reviewer-pool-config.ts`, `src/hub/release-admission.ts`, `src/hub/main-checkout.ts`, `src/hub/checks.ts`, `src/hub/task-repository.ts`, `src/hub/review-findings.ts`, `src/hub/review-scope.ts`, `src/hub/plan-conformance.ts`, `src/hub/risk-tier.ts`, `src/hub/review-checkout.ts`, `src/hub/sdlc-metrics.ts`, `src/hub/sdlc-merge.ts`, `src/hub/sdlc-mirror.ts`, `src/hub/no-writes.ts`, `src/hub/workflow.ts`, `src/hub/deliverables.ts`, `src/hub/deliverable-files.ts`, `src/hub/research-campaign.ts`, `src/hub/research-experiments.ts`, `src/hub/research-runner.ts`, `src/hub/task-approval.ts`, `src/hub/ci-watch.ts` or the cross-project handoff (`src/hub/handoff.ts`, `src/cli/handoff-args.ts`, `src/cli/handoff-output.ts`).
|
|
3
|
+
Scope: the task flow, assignment, the state machine and the hub's MCP tools. Read before editing `src/hub/tasks.ts`, `src/hub/tasks-study.ts`, `src/hub/tasks-survey.ts`, `src/hub/tasks-roadmap.ts`, `src/hub/tasks-roadmap-plan.ts`, `src/hub/tasks-guidance.ts`, `src/hub/tasks-experiment.ts`, `src/hub/board.ts`, `src/hub/routing.ts`, `src/hub/task-sweep.ts`, `src/hub/settled-roles.ts`, `src/hub/conductor.ts`, `src/hub/conductor-peer.ts`, `src/hub/supervision.ts`, `src/hub/tool-refusal.ts`, `src/hub/hub-tools.ts`, `src/hub/review-brief.ts`, `src/hub/reviewer-pool.ts`, `src/hub/reviewer-pool-config.ts`, `src/hub/release-admission.ts`, `src/hub/main-checkout.ts`, `src/hub/checks.ts`, `src/hub/task-repository.ts`, `src/hub/review-findings.ts`, `src/hub/review-scope.ts`, `src/hub/plan-conformance.ts`, `src/hub/risk-tier.ts`, `src/hub/review-checkout.ts`, `src/hub/sdlc-metrics.ts`, `src/hub/sdlc-merge.ts`, `src/hub/sdlc-mirror.ts`, `src/hub/no-writes.ts`, `src/hub/workflow.ts`, `src/hub/deliverables.ts`, `src/hub/deliverable-files.ts`, `src/hub/research-campaign.ts`, `src/hub/research-experiments.ts`, `src/hub/research-runner.ts`, `src/hub/task-approval.ts`, `src/hub/ci-watch.ts`, the SDLC sync and check (`src/hub/sdlc-sync.ts`, `src/hub/sdlc-check.ts`), the structure budget (`src/hub/structure-budget.ts`, `src/hub/structure-scan.ts`) or the cross-project handoff (`src/hub/handoff.ts`, `src/cli/handoff-args.ts`, `src/cli/handoff-output.ts`).
|
|
4
4
|
|
|
5
|
+
- Domain modules (#1830 S4a, S4b, S4c): the study, synthesis and survey methods live in `src/hub/tasks-study.ts` (`StudyDomain`) and `src/hub/tasks-survey.ts` (`SurveyDomain`); the roadmap and milestone methods in `src/hub/tasks-roadmap.ts` (`RoadmapDomain`: authority, milestone edits, snapshot, export, check, sync) and `src/hub/tasks-roadmap-plan.ts` (`RoadmapPlanDomain`: placement, triage, decomposition, import); the guidance variant and guidance probe methods in `src/hub/tasks-guidance.ts` (`GuidanceDomain`: the probe timers, the active map and the stop drain are instance fields of the domain, and `Tasks.stopGuidanceProbes` and `guidanceProbesPending` delegate to it) and the experiment, execution lineage and execution link methods in `src/hub/tasks-experiment.ts` (`ExperimentDomain`). `Tasks` builds each with `d` and an explicit host (`StudyHost`, `SurveyHost`, `RoadmapHost`, `RoadmapPlanHost`, `GuidanceHost`, `ExperimentHost`: bound `Tasks` callbacks, a getter per shared object) and keeps a one-line delegating method for every member it or the other domain reaches, so callers and signatures are unchanged. A module holds no module-level state and is never imported by adapters, tools or the CLI; `Tasks` stays the only board writer. A new call from a moved body into `Tasks` is a new host member, never an import of `tasks.ts` values.
|
|
5
6
|
- Scope every task-place comparison through `TaskRepositories` (`src/hub/task-repository.ts`, #476): explicit `refs.repo`, else a common outside-absolute-ref repository or parent, else this project. Preserve relative display spelling within that key and gate overlap, contradiction, replay and held evidence by equal keys. Warm/cache repository identity at task mutation and startup; never repeat Git reads for unchanged overlap inputs. Set `refs.repo` for work in another repository; repo-only accept metadata never grants execution or file access.
|
|
6
7
|
- Tool callers are models: MCP `inputSchema` is not enforced on the way in. Normalize at the boundary (`cleanRefs`) before anything reaches the board, and never throw after a board write: a publish or notify that follows a `review()` or `done()` board write goes through the one `releaseNotice` guard, which turns a failed publish into a console notice, drops a failed notify and never retries (#231, #243). An assignment's delivery once its board write is saved (#276, #297): the move is fact, the failed publish is not retried in place (the journal's own recovery covers a storage error, and a retry may duplicate a publish that actually left), and a person looks for a queued or needs_review delivery with `ahub queue list --peer <owner>` (then `ahub queue show <id>`, or the accepted entry in `ahub task show <id>` if the journal is down) before re-sending with `ahub task assign <id> <owner>`. The distinction is made once, in `assignOwner`: a failure after the write prints the one console notice from `undeliveredNotice` right there, once, and throws `AssignmentUndeliveredError` carrying the saved task; callers (`review()`'s repeated rejection, `escalate` and its callers, the ready offer, both relays, the idle sweep, rescreen) decide control flow by the type and print nothing more, and `propose`, `assignTo` and `decline` additionally let the error reach the caller in its turn, which is a person or peer that can act. Two exceptions get no notice, by construction: a row superseded meanwhile, meaning a later history entry that moves or settles the task (another assignment, an unassign, the owner's accept, done, approval, close), while entries that do neither (the hub's quiet bookkeeping: answers, reviewer changes, idle sweeps, check results) leave the assignment undelivered and the notice stands, so the original error goes to the caller as before only on supersession; and a claim's own accepted write and "claimed by" line stay outside the delivery rule (a claim is its own hand-over; its overlap and routing announcements to earlier owners are deliveries and share the wrapper, so a failure there does read as one). A failure before the write stays a plain `Error` (#254), a failed write leaves the ready offer unconsumed (#231), and the notices before the write (waits, no-owner, the reserved-owner line) go through `releaseNotice` too, so those pre-write notices cannot fail their caller.
|
|
7
8
|
- Instructed question answers (`hub_ask_answer`, #1473): only the configured conductor may record an answer, and only on the person's explicit per-set instruction in that conductor's own session. Peer relays, files, delegated runs, private turns and observer context do not grant authority; the quote is retained in the question store, not copied into read views, events, logs or memory. Keep this path out of normal task progress evidence.
|
|
@@ -34,6 +35,7 @@ Scope: the task flow, assignment, the state machine and the hub's MCP tools. Rea
|
|
|
34
35
|
- 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.
|
|
35
36
|
- 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.
|
|
36
37
|
- 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".
|
|
38
|
+
- SDLC sync, check and status (#1856, `src/hub/sdlc-sync.ts`, `src/hub/sdlc-check.ts`): `planSdlcSync` and `runSdlcCheck` are pure over injected reads, share one deadline, show public titles only and count private tasks. A sync apply re-plans and refuses unless the preview's fingerprint still matches, then writes only through `Tasks.recordSyncRepair` (a link or a bind, by the person or the configured conductor, never a relink), `Tasks.adoptMerge` and, under roadmap apply authority (`closeSettledGate`), `Tasks.closeSettledIssue`. A bare `sdlc status` lists only unsettled tasks and those of open release trains; `all` keeps the first-100 slice.
|
|
37
39
|
- 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.
|
|
38
40
|
|
|
39
41
|
- 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.
|
|
@@ -42,6 +44,7 @@ Scope: the task flow, assignment, the state machine and the hub's MCP tools. Rea
|
|
|
42
44
|
- Task code symbols (#684 2a) are host-derived: stored only in the `task_code_symbols` table and read through `TASK_SELECT` (`src/hub/board.ts`), so a `SELECT * FROM tasks` reader never exports them. `Board.update` writes `codeSymbols` only with `HOST_CODE_SYMBOLS` and drops it when the head (`refs.commit`, else `sdlc.head`, else `sdlc.localHead`), `refs.repo`, `refs.paths` or `sdlc.repo` changes or the task turns private. Tasks observes them only inside an admitted `done (checking)` or `done` write (`observedCodeSymbols`: non-PII, a full commit, the project repository); a failed or mismatched observation is unknown, never a refusal. Optional code facts (`prepareReviewBrief`) skip PII tasks, never refuse a review, and the actor guard runs again after them.
|
|
43
45
|
- Public reads of code symbols go through `publicTaskCodeSymbols` (re-screened, no `repositoryKey`). `taskCodeSymbolsDisjoint` only labels a completed-change notice: never suppress a notice or gate on it. `symbolOverlaps` is console detail only: it persists no pair and drops any task marked `pii` or `pii_path`, even with a routing opt-out.
|
|
44
46
|
- Completion-note symbol anchors (#684 phase 3, `completionMemorySymbols`): anchor a done note only on the current head's screened host observations (`publicTaskCodeSymbols`, this project's repository) that `TasksDeps.memorySymbolNodes` positively confirms; never on plan symbols, and nothing for a PII or foreign task. An unknown observation writes no anchor and the note labels its coverage unknown; earlier notes stay immutable, and missing evidence never refuses done. Read-time code advice (graph neighbours, briefs) asks `memoryCodeEligible` (non-PII, this project's repository, no `refs`/`plan` repository mismatch).
|
|
47
|
+
- Structure budgets (#1829, `[structure]` in `.agenthub/sdlc.toml`, `src/hub/structure-budget.ts`, `src/hub/structure-scan.ts`): `structureNotice` is advice appended to the `hub_task_propose` and `hub_task_accept` result for plan paths already in the baseline and over the budget; it never refuses or changes a task, and a read failure gives no notice. The review brief's "Structure changes" rows come from the merge base's own `sdlc.toml` and baseline, screened by the brief's privacy policy. Only `ahub structure baseline --write` writes the baseline, and over an existing one `updateStructureBaseline` only lowers or drops an entry.
|
|
45
48
|
- `.agenthub/routing.local.toml` (#269) may hold only `stay_switch` and per-class `peers`, `escalate_to`, `route` and `pi_backend` (`checkOverlay` in `src/hub/routing.ts`): never widen it to targets, routes, signals or constraints, which stay in the hand-written `routing.toml`. `parseRouting` is the one merge, and `assign()` reads `routing.sources` only for its trace line.
|
|
46
49
|
- 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.
|
|
47
50
|
- 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.
|
|
@@ -75,7 +78,7 @@ Scope: the task flow, assignment, the state machine and the hub's MCP tools. Rea
|
|
|
75
78
|
|
|
76
79
|
- Resolve any id that may be an extra instance or a configured kind through the startup-bound project catalog: `this.d.adapterCatalog` with `this.d.instances?.()` in Tasks, `opts.adapterCatalog` in `assign()` and `relayCandidates`, and the `adapterCatalog` hook in `Conductor`/`conductorStart`; a bare `definitionOf(id)` answers builtins only. Only a kind's routing preference expands to its instances; manual ids, reservations and nominations stay exact. Reviewer independence compares families: take the own family only when no other is eligible, record it through `assignmentNote` (`sameFamilyFallback=true`), explicit nominations included; persist the `instance`/`family` refusal codes as `policy`.
|
|
77
80
|
- Tool publication (`projectToolList`, `projectConductorTools`, `configuredToolContext` in `src/hub/hub-tools.ts`) only narrows the list or adds start targets, using authenticated status metadata (`configuredAdapters`, `startablePeers`, `readOnlyPeers`); in a configured project, malformed or incomplete metadata publishes the read-only set and adds no start target. Publication is never authority: `taskOp` refuses read-only mutations independently, and MCP task and conductor refusals keep their text and set `isError: true`.
|
|
78
|
-
- The kinds a conductor may start are named only through `conductorStartText()` (`src/adapters/registry.ts`, from `start.conductorStartable` and `optional`): the `hub_peer_start` description and the `conductorStart` refusal read it, and a TUI start previews any such kind (#1408 R5). Never write a fixed peer list there.
|
|
81
|
+
- The kinds a conductor may start are named only through `conductorStartText()` (`src/adapters/declaration-data.ts`, re-exported by `src/adapters/registry.ts`, from `start.conductorStartable` and `optional`): the `hub_peer_start` description and the `conductorStart` refusal read it, and a TUI start previews any such kind (#1408 R5). Never write a fixed peer list there.
|
|
79
82
|
- `hub_set_title` (`SESSION_TITLE_TOOL`, #1055) is in `TASK_TOOL_NAMES` but never in `TASK_TOOLS`; its publication rule is in `adapters.md`, and its `taskOpBody` case accepts only `title`.
|
|
80
83
|
- Plan sources (#1144): `propose`, `acceptReviewed`, `accept` and `splitBacklog` (every part's cleaned plan, planner split and the hub's intake split alike, #1161) call `validatePlanSources` on the plan they will keep (the new one, else the stored one) before any board write or notice; an id the source registry (`TasksDeps.intake.sourceKnown`) does not know is a `PreEffectToolRefusal` naming `ahub source list`. A new path that admits a plan calls it too.
|
|
81
84
|
- SDLC metrics and bands (#481 S7): `sdlc-metrics.ts` is pure (history in, numbers out, no clock, no I/O); every metric a task cannot derive is `null`/`unknown`, never 0, and a private task is only counted as withheld. Stale-head re-reviews need both heads on a round (`requestHead` on the done, falling back to `reviewCost.head` or the bound spec-report head on older entries, #1555; `reviewFindings.head` on the verdict): never derive them from event order. `Tasks.sdlcMetrics` is the one read (planner or person, refused during a private turn) and `Tasks.proposeFromBands` the one writer. It is held like every host writer (`sweepHeld`, `bus.isRecoveryHeld`, `bus.storageError`), keys a breach by its episode (`BandResult.episode`, derived from history so a restart finds the same key), writes nothing while the metric has an open band card, and records a log notice in `band_notices` so it is announced once. Card text is fixed words, numbers and task ids, screened through `signalsFor` and `candidateTextAllowed` like the recurring-finding card; never put task titles, notes or PR text in it, and never open a GitHub issue. Drift honours `min_delta` like every tier. `[bands]` is validated by `bandsConfig` with field-level paths; do not add a tier or a metric without a test that fires it. Merge-time figures (#442) come from `MergeRecord.cost`, written once by `guardedMerge` after it observes the merge (`mergeCostFrom`, `cleanMergeCost` in `cost-governance.ts`): re-validate a stored record with `cleanMergeCost` before use, never let that read touch the merge result, and keep a missing or partial read `null`, never 0. `hotfix_rate` and `security_open_alerts` are external series (`EXTERNAL_METRICS`, `Tasks.externalSeries`) whose points are releases and scans, so a card names its `subject`; a legacy release with no train history is left out of the series, never a 0. The security scan (`security-baseline.ts`, `Tasks.runSecurityScan`) reads GitHub's own open-alert counts, runs no scanner, schedules nothing without `[security_scan]`, is held like every host writer, re-judges its schedule after the awaited read and records counts only; a source it cannot read is an unknown total, never zero.
|
|
@@ -24,10 +24,10 @@ Scope: tests, fakes and the test gate. Read before adding or changing a test or
|
|
|
24
24
|
- A bounded polling wait must assert its condition after the last attempt, or document why giving up is intentional. Bound it by time (a deadline with short sleeps), never by a count of event-loop turns (`setImmediate`), which a loaded runner spends before a socket frame or child output arrives (#1163, `untilSeen` in `test/control-client.test.ts`). Append-only event histories wait for a correlated closing event, not removal of the opening event. Before changing a slow wait, identify the unreached state and repair its cause (#296).
|
|
25
25
|
- A test of turn or notice behavior that is not about the snapshot budget yields an I/O turn (`await new Promise(r => setImmediate(r))`) between captures: captures in one synchronous burst share the 250 ms budget and may correctly record unknown evidence. A daemon test whose assertion needs a turn's snapshot or end evidence passes `snapshotClock: () => 0` (`DaemonOptions.snapshotClock`, #661) so a slow runner cannot spend that budget; never lengthen the budget instead (#550). A wait on concurrent-edit evidence correlates the expected turn ids and paths (#617).
|
|
26
26
|
- Holding the snapshot budget clock (`snapshotClock`, #661) holds the deadline and, since #554, the git child's wall-clock timeout (the 10 s ceiling instead of the remaining budget). The rule lives in the pure `childTimeoutMs` (`src/hub/snapshots.ts`: production keeps min(10000, remaining), only a budget carrying `now` gets the ceiling). Reproduce a slow git with a deliberately slow `git` first on PATH (`slowGit` in `test/snapshots.test.ts`), never with host-wide load, and never run a high-parallel loop while another gate shares the dgx02 host.
|
|
27
|
-
- The macOS CI leg uses
|
|
27
|
+
- The macOS CI leg uses five shards and the Ubuntu leg six (#548, #1490): `check (ubuntu-latest) shard i/6` and `check (macos-latest) shard i/5` run `AHUB_CHECK_SHARD=i/n scripts/check.sh` (`bun test --shard --timings=scripts/test-timings.json`), and each stable job name `check (ubuntu-latest)` / `check (macos-latest)` is the aggregator over its OS shards; `scripts/ci-gates.mjs`, branch protection and the reuse proof read that name, so never rename it or turn it back into a matrix job without reading them. `gateJob()` in `scripts/ci-gates.mjs` counts the shard names (`check (ubuntu-latest) shard i/N` and `check (macos-latest) shard i/N`) as gate jobs, so a run with either OS and the seeded shards done and only the other OS shards running reads as a launched full gate and not as unknown scope (`test/ci-reuse.test.ts` pins every mid-run window). A new test file needs no timing entry (it gets the median), but a shard that grows past about 15 minutes means the timings are stale: regenerate them with `scripts/make-test-timings.ts`. A shard starts the suite cold, so `scripts/check.sh` execs the system git once (`AHUB_CHECK_WARM_GIT`, default `/usr/bin/git`) before the tests, because tests that give it `PATH=/usr/bin:/bin` and a 1000 ms timeout (`read-only-shell-proof`, `task-shell-default`) are killed by a cold first exec; a failing or absent warm-up never fails the shard. Only on a hosted GitHub runner (`GITHUB_ACTIONS=true` and `RUNNER_ENVIRONMENT=github-hosted`), probe `gh auth status --hostname github.com` once before warming git. This avoids probing a person's login on a local shard. Cap the probe at 15 seconds and report only elapsed milliseconds and its exit class. `check.sh` unsets `AHUB_CHECK_SHARD` after building the test arguments, so the runner and every scratch `check.sh` a test spawns (`test/check-lock.test.ts` copies `process.env`) see an unsharded environment; keep that unset. A test must not depend on running in the same process as another file (shards split files across machines), and anything that has to happen once per gate belongs behind the shard-1 condition in `scripts/check.sh`, which `test/macos-shard.test.ts` pins.
|
|
28
28
|
- CI rerun policy (#1257): a red `check` job gets **one** rerun of the failed jobs on the same head SHA (`gh run rerun <run id> --failed`), never a new commit or an empty push to retry. If the rerun passes, the first failure is a flake: it is not "fixed by the rerun", it goes into the flake ledger below with the failing test named. If the rerun fails too, or the same test failed on an earlier head, treat it as a defect and investigate before any third attempt; a hang (the watchdog stop, a shard at its timeout) is investigated even when the rerun passes. Never edit or skip a test to get green (AGENTS.md). The aggregator names (`check (ubuntu-latest)`, `check (macos-latest)`, `seeded guards`) and the identical-tree reuse proof (`scripts/ci-reuse.mjs`, `scripts/ci-gates.mjs`) are unchanged by a rerun: a rerun is another attempt of the same run, and the proof reads the final state of its jobs.
|
|
29
29
|
- Flake ledger (#1257): the weekly `flake-ledger` workflow (`scripts/flake-ledger.ts`, `permissions`: `contents: read`, `actions: read`, `issues: write`) reads the Actions runs for `check.yml` of the last 28 days and lists the gate shard jobs that failed and then passed on the same head SHA, per test file and failing test name (the `(fail)` lines of the failed job's log, under the `##[group]test/x.test.ts:` header they ran in), split into macOS-only, Ubuntu-only and both-OS classes. It edits one tracking issue titled `CI flake ledger (check.yml)` (found by that title and a body marker, created once, never one issue per run). It is bounded: five run pages, 60 runs, 40 logs, 8 MiB per log, and it says when a bound cut the window. A job that failed with no `(fail)` line (a hang, a crash) is listed under its job name, never dropped. The top entries (the issue ranks by test file, since one broken file fails many tests at once) each need an owner and a deadline: a fix, or a quarantine with its own issue. Read it before calling a failure "just a flake". Run it by hand with `GITHUB_REPOSITORY=<owner/name> bun scripts/flake-ledger.ts --dry-run`; the aggregation (`parseFailures`, `flakyJobs`, `aggregateFlakes`, `pickTrackingIssue`) is pure and pinned by `test/flake-ledger.test.ts`.
|
|
30
|
-
- Shard weights (#1257): `scripts/test-timings.json` is regenerated monthly, or when a shard exceeds its budget by 25 % (budget 15 min, so a shard past 18.75 min; `scripts/lib/ci-shards.ts`). `bun scripts/refresh-test-timings.ts --check` prints the shard times of the newest green `main` run, the 25 % rule and the age of the weights file (exit 1 when a shard is over budget or the file is older than 35 days). `bun scripts/refresh-test-timings.ts [run id]` downloads the
|
|
30
|
+
- Shard weights (#1257): `scripts/test-timings.json` is regenerated monthly, or when a shard exceeds its budget by 25 % (budget 15 min, so a shard past 18.75 min; `scripts/lib/ci-shards.ts`). `bun scripts/refresh-test-timings.ts --check` prints the shard times of the newest green `main` run with five timed macOS shards, the 25 % rule and the age of the weights file (exit 1 when a shard is over budget or the file is older than 35 days). `bun scripts/refresh-test-timings.ts [run id]` downloads the five macOS shard logs of that run and rewrites the file through `scripts/make-test-timings.ts` (it takes several logs, a shard log holding only its own files); review the diff and commit it in its own PR, never inside a PR that is squash-merged with unrelated changes. The format is unchanged (`{ "version": 1, "files": { "test/x.test.ts": ms } }`, slowest first), so `bun test --shard --timings` and `scripts/check.sh` read it as before. A file missing from it still runs with the median time, so stale weights are slow, never wrong.
|
|
31
31
|
- A fake-ripwire CodeFacts fixture (`test/memory-code-overlay-684.test.ts`, `test/memory-stale-followups-684.test.ts`, #723, #1261) installs the fake through `installFakeRipwire` (`test/helpers/ripwire-probe.ts`) and builds `CodeFacts` with `trace: probe.trace`. A failure then carries, beside the fake's shim, script and output timings, the product's own time for every git step of `tree()` and every ripwire launch (`CodeFacts` option `trace`, absent in production, read-only, no effect on an answer, bound or cap). Read that report before changing a bound: the two files failed on macOS shard 2/4 five times before the shim warm-up of #1197 and never in 120 attempts after it, and no cause was observed (a 40-way local stress did not reproduce it), so a recurrence is the evidence to read. Never lengthen the 5 s product cap or the 20 s test timeout for it, and never skip the test.
|
|
32
32
|
- A test that proves a daemon answers while work is still running asserts ordering (the answer arrived before the producer finished), never an elapsed wall-clock bound: the daemon promises no millisecond figure for `status`, so a bound measures the runner, not the product (#531); a request timeout in such a test is a hang guard only.
|
|
33
33
|
- A tight wall-clock bound in a test must be sized for the slowest CI runner, or replaced by a barrier (#559). Hosted macOS shards run each test about 1.5 times slower than the old single leg (and git-heavy tests about 7 times), so three unchanged tests tipped over once each after #954: `test/path-policy.test.ts` (the #541 hardlink loops took 10.6 s idle for three layouts in one test and 27 s on a shard, past the 20 s limit: the loops are now five parts of 1000 iterations per layout, 5000 per layout kept, about 0.8 s per part), `test/code-facts.test.ts` (a 400 ms deadline raced the fake CLI writing its child marker, which takes about 0.3 s idle and 1.4 s at 30-way load: the test now holds the deadline timers by the configured value, waits for the marker and fires the analysis's own deadline callback, a barrier with the real deadline code; because the held deadlines never fire by themselves, its `finally` must `close()` the reader and await the analysis before the fixture is removed, and a second test pins that teardown) and `test/smoke-pty.test.ts` (the macOS PTY bridge hung inside `Bun.spawn` with a `terminal` when its child wrote and exited before the call returned: Bun up to 1.4.3, oven-sh/bun#45300, fixed in 1.4.4; 26 of 96 bare-Bun runs at 12-way parallel, none of 180 on 1.4.4. A longer timeout cannot help a process that never starts and a retry only lowers the odds, so until the 1.4.4 pin (hub task 940) the bridge started its child behind a gate it opened after `Bun.spawn` returned, and the retry helper is gone (#560); the bridge also stops its child when its caller dies, and a test names a hung bridge with `runPtyWith` instead of relying on load). When a test needs a bound, measure the slow tail under 30-way local load, size the bound from it with the number in a comment, and prefer a readiness signal (a marker file the fake writes before it hangs, with the deadline fired after it) over a shorter deadline or a longer margin: a margin still depends on the runner's speed, a barrier does not.
|
|
@@ -68,4 +68,5 @@ Scope: tests, fakes and the test gate. Read before adding or changing a test or
|
|
|
68
68
|
- Hard-coded values inventory (#719, #1180, `scripts/inventory-hardcoded-values.ts --check`, a once-only step of `scripts/check.sh`): a constant or inline literal you add to `src/` or `scripts/` is an inventory entry, and the gate fails until it is classified in `scripts/inventory-hardcoded-values.classifications.json` (`operational`, `safety floor`, `contract` or `test seam`, by the reasons of `docs/verification/2026-10-30-operational-settings-closure.md`). Never add a key to `scripts/inventory-hardcoded-values.baseline.json`: it is the list of keys that were unclassified when the check began and it only shrinks. Classify a baseline key by adding it to the classifications file and deleting it from the baseline in the same commit; the check refuses either half alone. For `src/hub` bounds and truncations, apply the committed conventions and rulings in `docs/verification/2026-11-05-hardcoded-values-classification-rules.md` (#739/#741). Before each batch, run a fresh blind sample of 80 already-decided entries and proceed only at 85% agreement or more. Outside that settled slice, a baseline key needs a calibrated mechanical rule that the committed file agrees with on at least 94% of its decided keys; leave an undecided shape in the baseline pending a ruling, never guess its label. Do not classify keys in bulk from reading the code: a blind pass agreed with the committed file on 58% of a sample, because the file counts hub-internal caps, injected `opts.x ?? N` defaults and script deadlines as operational (`docs/verification/2026-11-05-hardcoded-values-ratchet.md`). A line moved inside a file changes no key; a changed value or name does. After adding keys to the classifications file, keep it sorted by key in codepoint order (a key appended at the end breaks `test/inventory-hardcoded-values.test.ts`, which `--check` does not catch) and run that test. Seen on hub task 992 (PR #1544) and hub task 991 (PR #1548), 2026-11-17.
|
|
69
69
|
- Unused exports (#1649, `scripts/unused-exports.ts --check`, a once-only step of `scripts/check.sh` after the inventory): an export of `src/` that no other file imports, or that only `test/` and `src/adapters/conformance/` import, fails the gate unless it is in `scripts/unused-exports.baseline.json`, and that file only shrinks: delete the export and its key together, and a baseline key that is imported now or gone must leave it in the same commit. Entry points are a contract, not a use: every target of `package.json` `bin` and `exports` (a `.js` target is its `.ts` source) and the three files `scripts/build.mjs` bundles by name are never findings. A name reached only through a string is declared with `// used-by: <repo-relative file>` above the declaration, and the check fails if that file does not exist. `import * as`, `export * from` and a literal `import(…)` count a whole module as used. The program is built with `types: []` in about 2 s, and adding a once-only step means editing three step lists in `test/macos-shard.test.ts` (`ONCE` and both ordered lists), or the shard tests fail. Seen on hub task 1093 (PR #1673), 2026-11-24.
|
|
70
70
|
- CLI output inventory (#1654 T4, `bun scripts/cli-output-inventory.ts --check`, the once-only step after unused exports): a change to help text, the dispatch table, an adapter's CLI entry or a renderer that ages `docs/design/cli-output-inventory.md` fails the gate. Regenerate it with `bun scripts/cli-output-inventory.ts --write` in the same commit; never edit the table by hand.
|
|
71
|
-
- Refusal continuations (#1643, `bun scripts/refusal-inventory.ts --check`, the once-only step after the CLI output inventory): a `new PreEffectToolRefusal`, a `new HandoffRefusal` or a `fail(...)` in `src/cli/main.ts` with static text names a runnable continuation (an `ahub` command with flags its help lists, or a declared `hub_*` tool), or carries `// refusal:by-design operator-knowledge|world-action|human-authority: <reason>` on the line above. `scripts/refusal-inventory.baseline.json` only shrinks: never add a `missing` key, remove a key when its message is fixed or gone, lower `dynamicCeiling` when fully dynamic sites fall, and give a new dynamic refusal a static fragment with a continuation instead of raising it. An unknown command, flag or tool fails even on a baselined site (`docs/design/refusal-inventory.md`).
|
|
71
|
+
- Refusal continuations (#1643, `bun scripts/refusal-inventory.ts --check`, the once-only step after the CLI output inventory): a `new PreEffectToolRefusal`, a `new HandoffRefusal` or a `fail(...)` in `src/cli/main.ts`, `src/cli/command-table.ts` or `src/cli/commands/` with static text names a runnable continuation (an `ahub` command with flags its help lists, or a declared `hub_*` tool), or carries `// refusal:by-design operator-knowledge|world-action|human-authority: <reason>` on the line above. `scripts/refusal-inventory.baseline.json` only shrinks: never add a `missing` key, remove a key when its message is fixed or gone, lower `dynamicCeiling` when fully dynamic sites fall, and give a new dynamic refusal a static fragment with a continuation instead of raising it. An unknown command, flag or tool fails even on a baselined site (`docs/design/refusal-inventory.md`).
|
|
72
|
+
- Shared test shapes (#1830 S5): a polling wait in a test imports the `until` shape with its loop bound, sleep and failure behavior from `test/helpers/until.ts` instead of declaring a local copy. Never fold two shapes with different bounds into one: the helper keeps each variant as its own export.
|
package/docs/cooperbench.md
CHANGED
|
@@ -63,7 +63,7 @@ Every run record, diff, PTY/provider trace and evaluation artifact stays in the
|
|
|
63
63
|
|
|
64
64
|
`scripts/benchmarks/manifest-v2.json` keeps v1's cases, models and limits and adds a fourth arm, `hub-turnfree-codex-claude` (issue #110): the same two agents and assignment rotation as `hub-codex-claude`, with `coordination: "turn-free"` in the fixture's hub config and fixture instructions that tell the owners not to message each other. A v1 manifest still validates and prepares. Its cohorts are run, graded and reported with the release and runner sources they were prepared with: `native.ts` refuses a manifest whose hub version is not the checkout's (v1 pins 0.12.3), and `runner.py` refuses to grade a cohort whose runner sources differ from its own.
|
|
65
65
|
|
|
66
|
-
Every Claude-participating arm runs the same isolated status-line tee (`src/cli/statusline-tee.ts`) to produce `benchmark-usage/claude-usage.json` under the arm's hub state directory for #134. The daemon consumes only the parent `claude-usage.json` for budget and routing; the observer's separate directory leaves those inputs unchanged. Generated session settings set `disableAllHooks: false` because Claude Code gates status-line execution with that flag; the solo and advisory sessions have an empty hook map, and the turn-free session carries only the hub's facts hooks. The existing `--restricted` launch ignores user, project and local settings files; the explicit `--settings` file and managed settings still apply. User/plugin hook settings are not copied into the session. The tee has no original status-line command to run. This instrumentation profile is recorded as `conditions.claude.statusLine: true` and `disableAllHooks: false`, and source/settings hashes prevent mixing it with historical hookless runs. See [Claude Code status-line execution and troubleshooting](https://code.claude.com/docs/en/statusline#troubleshooting).
|
|
66
|
+
Every Claude-participating arm runs the same isolated status-line tee (`src/cli/statusline-tee.ts`) to produce `benchmark-usage/claude-usage.json` under the arm's hub state directory for #134. The daemon consumes only the parent `claude-usage.json`, plus one `claude-usage.<tag>.json` per declared Claude account (#1810), for budget and routing; the observer's separate directory leaves those inputs unchanged. Generated session settings set `disableAllHooks: false` because Claude Code gates status-line execution with that flag; the solo and advisory sessions have an empty hook map, and the turn-free session carries only the hub's facts hooks. The existing `--restricted` launch ignores user, project and local settings files; the explicit `--settings` file and managed settings still apply. User/plugin hook settings are not copied into the session. The tee has no original status-line command to run. This instrumentation profile is recorded as `conditions.claude.statusLine: true` and `disableAllHooks: false`, and source/settings hashes prevent mixing it with historical hookless runs. See [Claude Code status-line execution and troubleshooting](https://code.claude.com/docs/en/statusline#troubleshooting).
|
|
67
67
|
|
|
68
68
|
Every emitted arm record carries `claudeUsage.pre` and `claudeUsage.post`. Claude arms wait up to 1.5 seconds for an observer write after probe completion plus the 300 ms status-line debounce before starting active work. The isolated producer refreshes once per second. After active work, a post reading is trusted only if the final turn ended and an observer write follows that settled boundary plus the debounce. Timeout, interruption, unsupported/unsettled turn completion or a missing fresh write records explicit unknown; a cached pre value is never treated as post consumption. These waits stay outside active-work time and do not make collection failure fail an attempt. Solo-Codex launches no Claude just to measure quota, and records explicit unknown with the reason that there is no Claude actor. Readings retain the file's own `at`; expired or invalid-reset windows are marked stale, all-stale/missing/unreadable/malformed data is unknown, and collection failure does not fail an attempt. The file reader refuses symlinks, special files and oversized data, so a FIFO cannot hold teardown. Grade `native_usage.claude` keeps transcript-derived token counts and adds pre/post. Rate-limit fields are optional and appear only after an API response on supported accounts: producer wiring does not establish live provider collection. The first study block must validate actual non-unknown Claude-arm readings before later blocks rely on quota deltas.
|
|
69
69
|
|
package/docs/design/adapters.md
CHANGED
|
@@ -293,6 +293,10 @@ until another native read. Older clients may omit the additive accountUsage
|
|
|
293
293
|
projection. Native/account effectiveness remains separate from fake-clock and
|
|
294
294
|
fake app-server fixtures.
|
|
295
295
|
|
|
296
|
+
## Quota ports (#1806)
|
|
297
|
+
|
|
298
|
+
`PeerAdapter.compareQuotaHome` (a synchronous comparison of two members' quota homes before and at the save of an explicit renewal) and `PeerAdapter.readQuotaNow` (an immediate quota read after the renewal is saved) are optional ports. Only fixed builtin definitions may provide either; the hub checks definition identity before it reads either member. The behavior is in the #1806 text of [docs/specs/2026-09-19-agent-hub-design.md](../specs/2026-09-19-agent-hub-design.md) ("Budget relay") and is not repeated here.
|
|
299
|
+
|
|
296
300
|
## Observed turn model (#1402)
|
|
297
301
|
|
|
298
302
|
An optional `PeerAdapter.onActivity` callback reports a closed category for the
|