@staix/agent-hub 0.36.0 → 0.38.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 +27 -0
- package/README.md +6 -2
- package/THIRD_PARTY_NOTICES.md +0 -18
- package/docs/agent-notes/README.md +13 -3
- package/docs/agent-notes/daemon.md +4 -4
- package/docs/agent-notes/local-worker.md +1 -0
- package/docs/agent-notes/models.md +2 -1
- package/docs/agent-notes/tasks.md +1 -1
- package/docs/agent-notes/tests.md +1 -2
- package/docs/contracts/companion-cli-v1.json +70 -0
- package/docs/design/adapters.md +43 -2
- package/docs/design/agent-hub-architecture.md +9 -1
- package/docs/design/guidance-probes.md +1167 -0
- package/docs/design/model-routes.md +437 -12
- package/docs/dogfood.md +12 -13
- package/docs/events.md +20 -1
- package/docs/memory.md +3 -3
- package/docs/operations.md +123 -151
- package/docs/profiles.md +1 -1
- package/docs/quickstart.md +15 -3
- package/docs/research.md +1 -1
- package/docs/sdlc.md +5 -3
- package/docs/security.md +25 -1
- package/docs/specs/2026-09-19-agent-hub-design.md +9 -7
- package/docs/specs/2026-10-04-switchyard-source-port-design.md +3 -1
- package/docs/verification/2026-11-08-qwen-0269-model-setter-1317.md +25 -11
- package/docs/verification/2026-11-09-qwen-0270-model-setter-1317.md +21 -6
- package/docs/verification/2026-11-11-0.37.0.md +40 -0
- package/docs/verification/2026-11-11-0.38.0.md +41 -0
- package/docs/verification/2026-11-11-guidance-probe-t2-1226.md +153 -0
- package/docs/verification/2026-11-11-guidance-probe-t3-1226.md +85 -0
- package/docs/verification/2026-11-11-guidance-probe-t4-1226.md +65 -0
- package/docs/verification/2026-11-11-qwen-setter-suggestions-off.md +167 -0
- package/docs/verified.json +25 -25
- package/package.json +3 -4
- package/plugins/agent-hub/.claude-plugin/plugin.json +1 -1
- package/plugins/agent-hub/kimi-hook.js +2403 -1444
- package/plugins/agent-hub/server.js +2480 -1509
- package/src/adapters/channel-peer.ts +7 -1
- package/src/adapters/claude-channel.ts +2 -1
- package/src/adapters/compat.ts +1 -1
- package/src/adapters/local-probe.ts +233 -0
- package/src/adapters/local-worker.ts +232 -21
- package/src/cli/console-state.ts +25 -6
- package/src/cli/console-versions.ts +99 -0
- package/src/cli/console.ts +13 -1
- package/src/cli/help.ts +2 -1
- package/src/cli/init.ts +3 -1
- package/src/cli/install-paths.ts +7 -2
- package/src/cli/main.ts +78 -7
- package/src/cli/output.ts +8 -4
- package/src/cli/runtime-version-warning.ts +2 -2
- package/src/cli/sdlc-output.ts +9 -5
- package/src/cli/upgrade-runtime.ts +1 -1
- package/src/hub/bus.ts +2 -2
- package/src/hub/config-apply.ts +4 -2
- package/src/hub/config-trust.ts +6 -1
- package/src/hub/control-client.ts +5 -2
- package/src/hub/daemon.ts +195 -13
- package/src/hub/envelope.ts +6 -1
- package/src/hub/events.ts +3 -2
- package/src/hub/guidance-probe-store.ts +1044 -0
- package/src/hub/guidance-probes.ts +692 -0
- package/src/hub/inference.ts +18 -5
- package/src/hub/manager.ts +24 -1
- package/src/hub/operational-authority.ts +14 -1
- package/src/hub/peers.ts +5 -0
- package/src/hub/person-command.ts +25 -0
- package/src/hub/ports.ts +1 -1
- package/src/hub/progress.ts +23 -16
- package/src/hub/report.ts +2 -0
- package/src/hub/research.ts +1 -0
- package/src/hub/restart.ts +7 -0
- package/src/hub/sdlc-release-authorization.ts +139 -17
- package/src/hub/sdlc-release-policy.ts +100 -0
- package/src/hub/sdlc-release.ts +59 -7
- package/src/hub/supervision.ts +3 -2
- package/src/hub/tasks.ts +363 -7
- package/src/local/probe-errors.ts +28 -0
- package/src/local/probe-sandbox.ts +224 -0
- package/src/local/probe-types.ts +110 -0
- package/src/local/probe-workspace.ts +426 -0
- package/src/local/sandbox.ts +71 -2
- package/src/local/tools.ts +135 -9
- package/src/models/route/advisor-trigger.ts +88 -0
- package/src/models/route/config.ts +21 -17
- package/src/models/route/conversation-view.ts +179 -0
- package/src/models/route/decision-evidence.ts +1 -1
- package/src/models/route/decision.ts +114 -19
- package/src/models/route/escalation-control.ts +30 -0
- package/src/models/route/hub-prompts.ts +97 -0
- package/src/models/route/judge-choice.ts +155 -0
- package/src/models/route/judge-replies.ts +102 -0
- package/src/models/route/labels.ts +14 -70
- package/src/models/route/observation-signals.ts +250 -0
- package/src/models/route/plan-execute-choice.ts +27 -0
- package/src/models/route/relay-selector.ts +2 -2
- package/src/models/route/runtime.ts +115 -52
- package/src/models/route/turn-state.ts +77 -0
- package/src/omniroute/client.ts +3 -0
- package/src/ui/guidance-panel.ts +34 -2
- package/src/ui/guidance-view.ts +33 -0
- package/src/ui/plugin.ts +80 -23
- package/src/version.ts +4 -0
- package/templates/AGENTS.block.md +14 -14
- package/templates/adec/README.md +32 -0
- package/templates/adec/ahub.plan-execute.json +23 -0
- package/templates/adec/ahub.stage.json +23 -0
- package/templates/profiles/general.json +1 -1
- package/templates/profiles/research.json +1 -1
- package/templates/profiles/writing.json +1 -1
- package/LICENSES/Apache-2.0.txt +0 -204
- package/src/models/route/advisor.ts +0 -102
- package/src/models/route/escalation.ts +0 -82
- package/src/models/route/judge.ts +0 -23
- package/src/models/route/normalize.ts +0 -103
- package/src/models/route/plan-execute.ts +0 -52
- package/src/models/route/prompts.ts +0 -8
- package/src/models/route/signals.ts +0 -247
- package/src/models/route/state.ts +0 -54
- package/src/models/route/text.ts +0 -61
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,33 @@ 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.38.0
|
|
8
|
+
|
|
9
|
+
- Commands the hub hands a person run as printed (#1399). The needs_review hold notice, `ahub status` held rows and `ahub queue show` give `cd <project> && ahub queue resolve <id> --revision N --action <suggested> --reason "<kind> from <sender> to <peer>"` plus the other actions with one clause each, in place of `--action completed|retry|discard --reason <text>`. Agents are told, in the managed AGENTS block and in their session instructions, to pass such a command on unshortened.
|
|
10
|
+
- The managed AGENTS block is reordered (rules before transport, all-agent rules out of the pull-only bullet) and has one source: the `general`, `research` and `writing` profiles now append their own paragraph to `templates/AGENTS.block.md` and no longer carry a drifted copy, so they gain the `[FYI]` action rule, the no-polling rule and the one-heavy-job rule they lacked. Compatibility: an existing project keeps its old block until `ahub init` runs there; `ahub doctor` flags `hub instructions` and prints the commands. A project's own `profile_overrides.agents` still replaces the whole block.
|
|
11
|
+
- The block no longer fixes the heavy-job limit at one (#1399): it tells agents to start a build or full test run through the machine's admission tool (`dot admit`, whose `admission.slots.heavy_per_repo` the person sets) and to respect a deferral, and to keep to one per repository only where no such tool exists. No setting was added: the number lives in the machine's tool, not in tracked project text.
|
|
12
|
+
- Guidance probes (#1226 T3): host-sealed receipts in a private table, the outcome denominator (a missing or reconciled receipt counts as `unknown`, never `failed`), explicit crash reconcile and an owned-output prune that keeps receipts and manifests (#1397). Constructor-only and unwired; no live trial.
|
|
13
|
+
- Guidance probes (#1226 T4, fake-provider part): `ahub guidance probe receipts --id HASH [--json]`, the matching control op and a read-only `probe` view in the Guidance panel show sealed receipts, the denominator, comparability reasons and retention state; `test/guidance-probe-gate.test.ts` runs the fake lifecycle end to end (#1400). The live local-worker trial (AC7) is still open.
|
|
14
|
+
|
|
15
|
+
Release N-1 for 0.38.x is 0.37.0 (exact `@staix/agent-mem` 0.24.0, control protocol 17 with descriptor floor 16); `test/fixtures/release-n-1` and `test/published-protocol-compat.test.ts` now pin it. Compatibility: the wire protocol window is unchanged at 16 through 17; the new `guidance_probe_receipts` daemon feature and control op are optional, and a 0.37.0 daemon answers the op as unknown. Files: `hub.db` gains an additive `guidance_probe_receipts` table created with `CREATE TABLE IF NOT EXISTS` and no `hub_schema` bump, so 0.37.0 opens a 0.38.0 database and ignores it. The exact `@staix/agent-mem` pin stays 0.24.0. A project initialised by an earlier release keeps its AGENTS.md block until `ahub init --yes` is run again; `ahub doctor` warns until then.
|
|
16
|
+
|
|
17
|
+
## 0.37.0
|
|
18
|
+
|
|
19
|
+
- R2 accepts anchored Markdown/quote-decorated advisor verdicts, an optional `Verdict:` prefix and a surrounding JSON fence for escalation. Escalation uses owned bounds of 12 recent assistant turns, 1500 Unicode code points per serialized message and 16000 points for the assembled transcript, including explicit truncation markers; original discarded points remain counted. These limits provide no quality or eight-second latency guarantee. Arbitrary leading prose, unbalanced markup, more than eight nested decoration groups and malformed/multiple/non-JSON fences remain unparsed.
|
|
20
|
+
- Hub-owned advisor/escalation triggers and judge semantics use newly authored routing units (#1352 R2). Optional plan/execute and judge model/effort questions use the existing adec policy binding in off/shadow mode; fallback model/input are preserved and enforce remains refused. Judge observations use `decisionTarget: judge` and earn no executor, progress, outcome or usage credit. New prompt wording invalidates the former live judge-request digests; prompt-quality live checks remain manual and unrun.
|
|
21
|
+
- R2 explicitly chooses a 512-entry, one-hour scope store: idle expiry is renewed by successful reads and writes, so active escalation latches, execution phase and advisor budgets persist, backward clocks clear retained state, and opaque scope keys are capped at 4096 bytes. Advisor budgets and stalled markers retain separate 1024-entry FIFO lifetimes; only inserting a new key can trim its ledger. Reply input is bounded at 64 KiB and local feedback/reason at 4096 bytes. These declared limits and the ledger-capacity correction are compatibility differences, not claims of measured legacy-default equivalence.
|
|
22
|
+
- The Orca, Herdr and Claude Code companions moved out of `integrations/` into STAIxBWLB/ahub-orca, STAIxBWLB/ahub-herdr and STAIxBWLB/ahub-claude, each with its own CI and release channel; ahub reads and ships none of them, and they read ahub only through `docs/contracts/companion-cli-v1.json` (#1387). `integrations/README.md` names the repositories and the contract's change rule. Compatibility: no runtime, package or protocol change; the npm file list is unchanged. The 0.36.0 entries below remain the record of what shipped then.
|
|
23
|
+
- The exact `@staix/agent-mem` pin moves from 0.23.1 to 0.24.0 (#1396, task #883). 0.24.0 adds `CaptureStore.countOutsideRecent`; its storage formats are unchanged and its root exports are additive. Raise a shared home's curated format floor to 0.24.0 only after every hub that shares the home runs 0.37.0.
|
|
24
|
+
- The replaced routing implementation is retired (#1393, #1352 R3): the nine derived modules, the eight source-port vector suites, the upstream checker and the Apache license copy and notice that covered them are removed from the source and the npm package. The hub-owned routes, the stage compatibility facade, decision-evidence v1, route events and configuration behaviour stay. Port offset 3 stays reserved (`RESERVED_SIDECAR`). The Tabler Icons MIT notice is unchanged.
|
|
25
|
+
- Guidance probes (#1226 T1, T2): a private manifest and reservation ledger with person- or conductor-only `ahub guidance probe register|start|show|cancel`, one probe lane per project and experiment-wide budgets charged before any effect (#1391), and a confined host-only adapter that runs a fresh private LocalPeer session with read, write and edit tools only, under a deny-default macOS sandbox profile (#1395). Production execution stays unavailable: no daemon runner is wired, so `start` runs only injected fakes, and no real model or worker trial has run. `hub.db` gains additive `guidance_probe_*` tables.
|
|
26
|
+
- `ahub console` shows agent-hub versions (#1386): a versions line for the daemon, the console, the global `ahub` and the installed Claude plugin, an AHUB column per peer once a peer reports a version, and the agent-hub version and restart step in peer detail. Channel and tools clients now send their version in `hello`; an older daemon ignores the field.
|
|
27
|
+
- Space polls reuse incremental snapshots (#1382): per-project cursors, `changed: false` for an unchanged scene and one shared computation across concurrent viewers. Plugin-side only; daemons still build full scenes.
|
|
28
|
+
- `ahub sdlc authorize-release` reads the version source and documentation policy from the candidate commit's shared `.agenthub/config.json` (#1383), so a project without `package.json` can release from its release notes or its tag. A local or uncommitted configuration cannot loosen the policy, and a candidate that commits `docs/verified.json` keeps the documentation gate.
|
|
29
|
+
- The companion CLI contract v1 (`docs/contracts/companion-cli-v1.json`) is guarded by a test that runs `ahub status --json` and `ahub projects --json` against a scratch hub (#1388).
|
|
30
|
+
- Qwen 0.26.9 and 0.27.0 setter receipts with `ui.enableFollowupSuggestions=false` correct the earlier A/B/B reading (#1384): the third request in those receipts is unidentified, not a proven failure.
|
|
31
|
+
|
|
32
|
+
Release N-1 for 0.37.x is 0.36.0 (exact `@staix/agent-mem` 0.23.1, control protocol 17 with descriptor floor 16); `test/fixtures/release-n-1` and `test/published-protocol-compat.test.ts` now pin it. Compatibility: the wire protocol window is unchanged at 16 through 17; the optional `clientVersion` in `hello` is ignored by 0.36.0. Files: `hub.db` gains additive `guidance_probe_manifests`, `guidance_probe_lanes` and `guidance_probe_sessions` tables created with `CREATE TABLE IF NOT EXISTS` and no `hub_schema` bump, so 0.36.0 opens a 0.37.0 database and ignores them. The agent-mem 0.24.0 storage formats equal 0.23.1's; the shared home floor stays where the person set it until every hub runs 0.37.0. CLI: `ahub guidance probe` is new and person- or conductor-only; no command or flag was removed. MCP tools: no tool was added or removed.
|
|
33
|
+
|
|
7
34
|
## 0.36.0
|
|
8
35
|
|
|
9
36
|
- Claude Code 2.1.322 is a receipt-verified headless implementer version (#888, task 868): the model-free permission-transport and host shell-wrapper producers pass on it with 2.1.319 as the control (`docs/verification/2026-11-10-claude-implementer-2.1.322.md`).
|
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.38.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
|
|
@@ -114,6 +114,10 @@ including [a new project with SDLC advise or enforce](docs/quickstart.md#a-new-p
|
|
|
114
114
|
`ahub guidance create|list|show|withdraw` and the MCP tools share task authority
|
|
115
115
|
and public projections; the producer console's Guidance panel is read-only.
|
|
116
116
|
Section diffs remain advisory, without activation, permissions or probes.
|
|
117
|
+
`ahub guidance probe register|start|show|cancel` (the person or the configured
|
|
118
|
+
conductor) records a bounded private probe declaration; only a fake fixture
|
|
119
|
+
lifecycle runs, and production has no probe runner
|
|
120
|
+
([guidance probes](docs/design/guidance-probes.md)).
|
|
117
121
|
- **Shared memory.** Decisions, contracts, fails and findings are kept through the
|
|
118
122
|
first-party [`@staix/agent-mem`](https://github.com/STAIxBWLB/agent-mem) library,
|
|
119
123
|
in process with no claude-mem worker (short- and long-term tiers, a typed graph,
|
|
@@ -189,7 +193,7 @@ show an unverified writer's cause and the person-run next step.
|
|
|
189
193
|
[#258](https://github.com/STAIxBWLB/agent-hub/issues/258)).
|
|
190
194
|
|
|
191
195
|
Live checks that still need a real account or a person are listed in the
|
|
192
|
-
[release verification report](docs/verification/2026-11-
|
|
196
|
+
[release verification report](docs/verification/2026-11-11-0.37.0.md) and the
|
|
193
197
|
[smoke checklist](docs/smoke.md).
|
|
194
198
|
|
|
195
199
|
## Documentation
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -1,23 +1,5 @@
|
|
|
1
1
|
# Third-party notices
|
|
2
2
|
|
|
3
|
-
## NVIDIA NeMo Switchyard
|
|
4
|
-
|
|
5
|
-
The TypeScript routing modules in `src/models/route/` contain modified ports from NVIDIA NeMo Switchyard, commit `c8848511a7e2e1d605070c7a68905bdc24c6481a`. These portions are licensed under Apache-2.0; see [the license](LICENSES/Apache-2.0.txt). The remainder of agent-hub retains its existing MIT license.
|
|
6
|
-
|
|
7
|
-
Switchyard
|
|
8
|
-
Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
9
|
-
|
|
10
|
-
This product is licensed under the Apache License, Version 2.0 (the "License").
|
|
11
|
-
You may obtain a copy of the License in the LICENSE file at the root of this
|
|
12
|
-
repository, or at:
|
|
13
|
-
|
|
14
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
15
|
-
|
|
16
|
-
Unless required by applicable law or agreed to in writing, software distributed
|
|
17
|
-
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
18
|
-
CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
|
19
|
-
specific language governing permissions and limitations under the License.
|
|
20
|
-
|
|
21
3
|
## Tabler Icons
|
|
22
4
|
|
|
23
5
|
The inline icon sprite in `src/ui/index.html` (the dashboard's navigation, help, close, star, arrow and checking icons) contains the SVG
|
|
@@ -2,11 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
Human explanation. Agent instructions: the area notes in this directory.
|
|
4
4
|
|
|
5
|
+
Issue #1381 records the package-only release guard blocking a project with no package manifest or documentation checker. The release policy was bound to the candidate commit because choosing a different source or exempting docs relaxes that guard; the shared committed file makes that choice reviewable in the same Git candidate. The runtime/local configuration is a different authority and does not define this consent.
|
|
6
|
+
|
|
5
7
|
On 2026-11-10, #1352 R1 separated newly authored stage evidence, fallback and
|
|
6
8
|
whole-wire sizing from the remaining legacy route modules. The models note
|
|
7
9
|
points at the stage contract and its single switch planner; generic decision
|
|
8
|
-
evidence v1, the remaining route decisions and notice cleanup
|
|
9
|
-
ownership boundaries.
|
|
10
|
+
evidence v1, the remaining route decisions and notice cleanup had separate
|
|
11
|
+
ownership boundaries. R2 supplied the hub-owned decisions and prompts; R3 retires
|
|
12
|
+
the derived modules, their upstream checker and Apache notice while preserving
|
|
13
|
+
the unrelated Tabler Icons notice and the reserved port offset.
|
|
14
|
+
|
|
15
|
+
R2 keeps optional model selection separate from host decisions: ADEc may suggest
|
|
16
|
+
an alias/effort for an existing plan phase or judge call, while the hub retains
|
|
17
|
+
phase transitions, review/escalation rules and fallback execution. The off and
|
|
18
|
+
shadow modes preserve that boundary; sample policy text cannot grant authority
|
|
19
|
+
or substantiate a live model-quality claim.
|
|
10
20
|
|
|
11
21
|
In the #1055 review, the new title-binding lookup preceded invocation,
|
|
12
22
|
pending-delivery and supervision bookkeeping in `Bus.onDelivered`. The bus's
|
|
@@ -42,7 +52,7 @@ behavior would have hidden the missing dependency.
|
|
|
42
52
|
Background moved out of the area notes for 0.12.45:
|
|
43
53
|
|
|
44
54
|
- Instance execution git budget (#225, daemon.md): `resolveInstanceExecutionCwd` runs synchronously on the daemon's event loop (an extra-instance start, `turn_revert`) with up to four git calls, measured at about 15 ms on a warm local repository. One shared 5 s allowance holds the loop at most 5 s, not 4 x 5 s. It stays synchronous because the CLI and recovery callers are; an async twin for the two daemon call sites is the upgrade if a typical resolution ever costs more than a few ms.
|
|
45
|
-
- Claude steer version gate (#493, #221, daemon.md): mid-turn consumption of a steered important message was proven only on Claude Code 2.1.302 (`docs/verification/2026-10-18-493-claude-busy-channel.md`); on an older client a dropped mid-turn notification stays `accepted` until a person resolves it. The hello does not carry the
|
|
55
|
+
- Claude steer version gate (#493, #221, daemon.md): mid-turn consumption of a steered important message was proven only on Claude Code 2.1.302 (`docs/verification/2026-10-18-493-claude-busy-channel.md`); on an older client a dropped mid-turn notification stays `accepted` until a person resolves it. The hello does not carry the Claude Code version (its `clientVersion`, #1385, is the agent-hub version and display only), and the oldest working version is unknown, so a gate would be a guess that could disable a working path.
|
|
46
56
|
- Planner reservation and done gates (tasks.md): in #378 a same-value planner write laundered a person's reservation; in #382 advise recorded overlapping dones, and an owner could neither relink a PR nor be stopped from carrying a head to a new PR.
|
|
47
57
|
- Process-tree stops (adapters.md): three review rounds of #113 found snapshot gaps while the tree ran (groups of its own, an unreadable first read, a child started during the grace period).
|
|
48
58
|
- Local worker (local-worker.md): a bare `private/` deny entry once denied all of `/private/var`; `existsSync` made a dangling link look like a new file, so a write landed at its target.
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
|
|
21
21
|
- 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.
|
|
22
22
|
|
|
23
|
-
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/attention.ts`, `src/ui/needs.ts`, `src/hub/daemon.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/ui/index.html`, 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.
|
|
23
|
+
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/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/ui/index.html`, 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.
|
|
24
24
|
|
|
25
25
|
- 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).
|
|
26
26
|
- `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.
|
|
@@ -32,7 +32,7 @@ Scope: the operator console, control WS and its protocol, state files, the dashb
|
|
|
32
32
|
- 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`).
|
|
33
33
|
- 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.
|
|
34
34
|
- Dashboard snapshot `view` (#683 U4): the daemon's `ui_snapshot` and the manager's forward pass a request's `view` only through `dashboardView` (`DASHBOARD_VIEWS` in `src/hub/ui.ts`); keep that list equal to the page's `DASHBOARD_VIEWS` in `src/ui/index.html`. Any other value is dropped, never forwarded.
|
|
35
|
-
- acon plugin (#935): `src/ui/plugin.ts` never bypasses `uiAction`'s whitelist or `DASHBOARD_VIEWS`. It reaches project hubs only through `projectConsole` (`src/hub/manager.ts`), the same listing and forwarding `ahub ui --all` uses; widen neither for the plugin. Its inbox verbs map to the hub's own `permit` with an option the request offers, and an advisory supervision row's two verbs to the hub's own forwarded `supervision` action (#1368). The `guidance` panel (#1376) is the one panel outside `DASHBOARD_VIEWS`: read-only `list`/`show` through `projectConsole(...).guidance`, never an action. A question's `answer` and a result's receipts (`result_seen`, `results_read_all`, `results_unread_last`, #1054 T6) are the exceptions, and none goes through `projectConsole(...).act` or the `FORWARDED` list from the plugin (the receipts use the `receipt` port beside `answer`, with `receiptEvidence` in `src/ui/plugin-results.ts` checking the same console person meta; the page of `ahub ui` reaches the same three writes as dashboard actions, refused for a live-test session by both `ui.ts` and the daemon). The answer's route is (#1053 T5): `action()` checks the console's person `meta` first, then calls the dedicated `projectConsole(...).answer` port, which sends `answer { surface: "acon", person }` as a console-role control message. `answer` is advertised in `capabilities.actions` (`QUESTION_ACTIONS`) so acon lets the page send it, and is never in `FORWARDED`; widening the dashboard whitelist for it would let a dashboard page answer without person evidence. Acon types are type-only imports from the exact-pinned `@staix/agent-console/contract` entry, never hand-copied. Its panel is built from `renderDashboard()` by exact rewrites that throw when a target line moves: when you edit a rewritten line in `src/ui/index.html` (post, the cookie helper, `$`, the theme `apply`, the view key listener, the title update or the landmark tags), update `panelAssets()` in the same PR. `lifecycle.ts` is loaded lazily there, because it reaches the daemon and CLI files acon's import scan reads. `ahub setup` registers it only through `registerAconPlugin` (`src/cli/acon-register.ts`): `console/plugins/ahub.json` under the hub home names the module and its sha256 (directories 0700, written to a temp file and renamed); the package export `./ui-plugin` is pinned by `scripts/check-package.mjs`. The Space panel (#1012, `src/ui/office-space.ts`) maps only the #264-allowlisted `officeModel` scene, pinned by the #264 marker fixture in `test/acon-plugin.test.ts`; never feed it an envelope body, task detail, path or symbol. A Space snapshot answers within acon's 5 s: the listing
|
|
35
|
+
- acon plugin (#935): `src/ui/plugin.ts` never bypasses `uiAction`'s whitelist or `DASHBOARD_VIEWS`. It reaches project hubs only through `projectConsole` (`src/hub/manager.ts`), the same listing and forwarding `ahub ui --all` uses; widen neither for the plugin. Its inbox verbs map to the hub's own `permit` with an option the request offers, and an advisory supervision row's two verbs to the hub's own forwarded `supervision` action (#1368). The `guidance` panel (#1376) is the one panel outside `DASHBOARD_VIEWS`: read-only `list`/`show` through `projectConsole(...).guidance`, never an action. A question's `answer` and a result's receipts (`result_seen`, `results_read_all`, `results_unread_last`, #1054 T6) are the exceptions, and none goes through `projectConsole(...).act` or the `FORWARDED` list from the plugin (the receipts use the `receipt` port beside `answer`, with `receiptEvidence` in `src/ui/plugin-results.ts` checking the same console person meta; the page of `ahub ui` reaches the same three writes as dashboard actions, refused for a live-test session by both `ui.ts` and the daemon). The answer's route is (#1053 T5): `action()` checks the console's person `meta` first, then calls the dedicated `projectConsole(...).answer` port, which sends `answer { surface: "acon", person }` as a console-role control message. `answer` is advertised in `capabilities.actions` (`QUESTION_ACTIONS`) so acon lets the page send it, and is never in `FORWARDED`; widening the dashboard whitelist for it would let a dashboard page answer without person evidence. Acon types are type-only imports from the exact-pinned `@staix/agent-console/contract` entry, never hand-copied. Its panel is built from `renderDashboard()` by exact rewrites that throw when a target line moves: when you edit a rewritten line in `src/ui/index.html` (post, the cookie helper, `$`, the theme `apply`, the view key listener, the title update or the landmark tags), update `panelAssets()` in the same PR. `lifecycle.ts` is loaded lazily there, because it reaches the daemon and CLI files acon's import scan reads. `ahub setup` registers it only through `registerAconPlugin` (`src/cli/acon-register.ts`): `console/plugins/ahub.json` under the hub home names the module and its sha256 (directories 0700, written to a temp file and renamed); the package export `./ui-plugin` is pinned by `scripts/check-package.mjs`. The Space panel (#1012, `src/ui/office-space.ts`) maps only the #264-allowlisted `officeModel` scene, pinned by the #264 marker fixture in `test/acon-plugin.test.ts`; never feed it an envelope body, task detail, path or symbol. A Space snapshot answers within acon's 5 s: it reuses the same action generation's last listing under `runningFreshMs` (10 s) and serves an older one while one refresh runs; with none it waits half of `SPACE_BUDGET_MS` and falls back to the last listing (a late one still replaces it). Projects are read concurrently, each office snapshot asked from its last cursor (`after`) and joined while pending per project, instance and generation (`officeFlights`, #1380); a late project is left out of that poll but keeps its baseline, a refusal or a restarted instance drops it. Only an explicit `changed: false` from the same `instanceId` reuses the cached office model (a restarted daemon restarts its ui sequence at zero); every full reply goes through `officeModel`, and `officeSpace` always gets the current clock so message arcs expire. Concurrent polls join one `spaceFlight`; its cursor hashes the listing, the project cursors and the scene, and an equal `after` answers `changed: false`. `pollMs` stays under acon's 3000 ms link gap. The inbox snapshot (#727, #1196) answers within 1 s at p95: the project listing is the one in-flight listing Space also joins (`runningWithin`, half of `inboxProjectBudgetMs`, falling back to the last listing), the running projects' `agents` snapshots are asked at once, each within `inboxProjectBudgetMs` (a project that is late keeps its last rows and their `at`) and joined while pending in the same action generation and instance (`projectFlights`), so a slow project is asked once, not once per poll; concurrent polls join one computation, a result under `inboxFreshMs` is served as it is, one under `inboxStaleMs` is served while one refresh runs (nothing runs while nobody polls), and `action()` bumps a generation before and after it so a computation that started earlier never becomes the cache. The reply holds at most `INBOX_MAX_ITEMS` (50) items, decisions first, with `more`; the `seen` bookkeeping runs before the cut, so a cut item keeps its `at`. Never put a per-request hub call back into `inbox()` outside that single flight.
|
|
36
36
|
- 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`).
|
|
37
37
|
- 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).
|
|
38
38
|
- 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.
|
|
@@ -64,7 +64,7 @@ Scope: the operator console, control WS and its protocol, state files, the dashb
|
|
|
64
64
|
- 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.
|
|
65
65
|
- Cross-version recovery must use the authenticated source protocol for prepare/commit/abort and the target protocol after startup. Prove the transition against a real prior release before claiming compatibility.
|
|
66
66
|
- Preserve `task_cancel` target-feature preflight before source holds, capture or commit. Reuse stored target features only after verifying the same retained root and digest; legacy receipts still capable of commit must obtain feature proof. Do not apply pre-commit compatibility checks to sources already past commit. Every prepare, including the lease renewal before a terminal close and after a resume, sends the operation's stored `targetFeatures` (#478).
|
|
67
|
-
- A recovery target-feature floor (`task_cancel`, `invocation` while the invocation ledger has an open (`queued` or `delivered`) row, `peer_instances`, `role_stages` while a declared Claude-kind instance holds `implementer`, `task_planners` while a list/instance planner is configured or `Board.hasPlannerState()` finds a task/release binding or plan-review authorship marker, `release_trains` while a configured train is active or frozen, `reviewer_pool` while a fresh reviewer or `review.pool` is configured, `configured_acp` while the project declares `adapters`, `external_adapter_modules` while external module definitions are loaded, `external_adapter_instances` with `external_adapter_modules` and `peer_instances` while an external module-kind instance is declared, `conductor_recovery` while `Board.hasConductorManualState()` finds open conductor manual-assignment intent, `project_autonomy` while the daemon holds retained autonomy consent or a raw `config.json` or `config.local.json` has a top-level `_autonomy` key (an unreadable file refuses as unknown), `calendar_schedules` while a raw `schedules` entry has a `cron` or `tz` key (#1017: an older target refuses the key at load), `research_records` while `Board.hasResearchState()` or a raw `config.json` or `config.local.json` `research` object names `runners` (unreadable refuses as unknown), `research_dispatch`, `research_dropped_offers`, `research_experiments`, `research_comparisons` and `research_evidence` while `Board.hasResearchDispatchState()`, `hasResearchDroppedOffers()`, `hasResearchExperimentState()`, `hasResearchComparisonState()` and `hasResearchEvidenceState()` find rows (each research digest joins `integrity()` only when its rows exist), `research_runners` under the runner registration rule below, `review_comments` while `Board.hasReviewCommentsState()` finds stored comments or packages (its `reviewComments` digest joins `integrity()` only then), `review_observer_input_state` while the journal (`hasReviewInputState`) or a live or recovery-snapshot peer holds review input (unreadable refuses as unknown), `accepted_delivery_settlement` while `Bus.hasAcceptedTimeoutHolds()` finds a timeout hold (unreadable refuses as unknown), `action_policy_floor` while the raw `config.json` or `config.local.json` names `action_policy.floor`, true or false, even where the key is ignored or normalized away: an older target parses the raw key and rejects it before any trust rule, so check raw file presence, never the effective config (#582, seen twice), `model_overrides` while runtime model overrides are stored, `visuals` while visual records or a raw `visuals` config key exist, `guidance_variants` while `Board.hasGuidanceVariants()` finds rows (#1367) and `execution_lineage` while `Board.hasExecutionReferences()` finds declared references (#1341); for these
|
|
67
|
+
- A recovery target-feature floor (`task_cancel`, `invocation` while the invocation ledger has an open (`queued` or `delivered`) row, `peer_instances`, `role_stages` while a declared Claude-kind instance holds `implementer`, `task_planners` while a list/instance planner is configured or `Board.hasPlannerState()` finds a task/release binding or plan-review authorship marker, `release_trains` while a configured train is active or frozen, `reviewer_pool` while a fresh reviewer or `review.pool` is configured, `configured_acp` while the project declares `adapters`, `external_adapter_modules` while external module definitions are loaded, `external_adapter_instances` with `external_adapter_modules` and `peer_instances` while an external module-kind instance is declared, `conductor_recovery` while `Board.hasConductorManualState()` finds open conductor manual-assignment intent, `project_autonomy` while the daemon holds retained autonomy consent or a raw `config.json` or `config.local.json` has a top-level `_autonomy` key (an unreadable file refuses as unknown), `calendar_schedules` while a raw `schedules` entry has a `cron` or `tz` key (#1017: an older target refuses the key at load), `research_records` while `Board.hasResearchState()` or a raw `config.json` or `config.local.json` `research` object names `runners` (unreadable refuses as unknown), `research_dispatch`, `research_dropped_offers`, `research_experiments`, `research_comparisons` and `research_evidence` while `Board.hasResearchDispatchState()`, `hasResearchDroppedOffers()`, `hasResearchExperimentState()`, `hasResearchComparisonState()` and `hasResearchEvidenceState()` find rows (each research digest joins `integrity()` only when its rows exist), `research_runners` under the runner registration rule below, `review_comments` while `Board.hasReviewCommentsState()` finds stored comments or packages (its `reviewComments` digest joins `integrity()` only then), `review_observer_input_state` while the journal (`hasReviewInputState`) or a live or recovery-snapshot peer holds review input (unreadable refuses as unknown), `accepted_delivery_settlement` while `Bus.hasAcceptedTimeoutHolds()` finds a timeout hold (unreadable refuses as unknown), `action_policy_floor` while the raw `config.json` or `config.local.json` names `action_policy.floor`, true or false, even where the key is ignored or normalized away: an older target parses the raw key and rejects it before any trust rule, so check raw file presence, never the effective config (#582, seen twice), `model_overrides` while runtime model overrides are stored, `visuals` while visual records or a raw `visuals` config key exist, `guidance_probes` while `GuidanceProbeStore.hasRecords()` finds retained probe declarations or held work (#1391), `guidance_variants` while `Board.hasGuidanceVariants()` finds rows (#1367) and `execution_lineage` while `Board.hasExecutionReferences()` finds declared references (#1341); for these four a read that throws refuses as unknown) lives in `incompatibleRecoveryTarget`, which every existing check site calls, and its name in `DAEMON_FEATURES`; never check a floor at one site only.
|
|
68
68
|
- Project autonomy (`autonomyCommand` in `src/hub/daemon.ts`, `writeAutonomyPreset` in `src/hub/settings.ts`): the `autonomy` control message is console-only; its operations come only from `planAutonomy` and `autonomyRemovalKeys`, never from the request; `off` removes the fixed key list and clears consent whatever `_autonomy` says. `_autonomy` is inert metadata, never approval provenance. Retained consent is created only by `createAutonomyConsent(...).confirm` inside the daemon (console `on`, or startup under a trusted `readAutonomyDefaults` opt-in with an exact plan match), never by a CLI or offline writer; a config `never-ask` takes effect only for a peer in `autonomyConfirmed`.
|
|
69
69
|
- Defer hub notices only for an authenticated recovery `prepare` or `commit` whose target features include `recovery_deferred_hub`, or for a restored daemon. Otherwise `setRecoveryHold(true)` moves the deferred notices into queues before commit records expected integrity, and a bare `fenceRecovery` defers nothing. Abort and lease expiry release the bus hold before clearing the operation; if that release fails, keep the operation and let expiry retry on its 1 s timer (#478).
|
|
70
70
|
- A restored daemon releases deferred hub notices before `tasks` is initialized (#1353), and the bus's `silence` hook (`src/hub/daemon.ts`) runs for them: keep its Tasks-independent exclusions (user, hub and digest senders, `fyi`, non-chat kinds, the user recipient) ahead of `turnFree()` and any `tasks` call (`test/deferred-hub-startup.test.ts`).
|
|
@@ -108,7 +108,7 @@ Scope: the operator console, control WS and its protocol, state files, the dashb
|
|
|
108
108
|
- `native_tui_launch` (#464) is console-only and resolves only a running owned `JcodePeer` under its own kind id (`tuiLaunch`). Refuse it while stopping, during recovery, off roster, during that peer's roster change or requested stop, or when `jcodeMcpReady` fails against the daemon's `SERVER_JS`; a `binding` must name the current `launchId` and `sessionId`. Failures answer fixed errors with details withheld (a `JcodeOptionMismatch` names only the flag in `option`, #559) plus one closed cause `code` (a `JcodeTuiRefusalCode`, or `hub_busy`, `not_running`, `mcp_stale`, `bad_request`), logged as one `hub.log` line (#1093), and the launch tuple (socket, env) goes only into that console reply, never into `status`, `status.json` or a log. A launcher sends it only when the hub's `features` list `native_tui_launch`.
|
|
109
109
|
|
|
110
110
|
- When preserving a recovery source, copy only the exact-pinned `@staix/agent-mem` package through `preserveRuntimeDependencies` in `src/cli/recovery-package.ts`; include its identity and bytes in `packageDigest`. Never copy the whole node_modules tree or link a preserved source to a mutable installation. Verify preserved sources with `ownDependencies: true` so a missing or symlinked memory copy cannot resolve an ancestor installation. Verify staged releases with `dependencyRoot` bound to their retained install directory; never resolve beyond it. Keep no-dependency release digests compatible.
|
|
111
|
-
- Release checker
|
|
111
|
+
- Release checker and committed release policy (#1120, #1381): `scripts/check-docs.mjs` is the one file outside `RUNTIME_ASSETS` that a capture carries (`RELEASE_CHECKER` in `src/cli/recovery-package.ts`, copied only when the source has it and refused when it is not a regular file), and `captureLayout` in `src/hub/runtime-capture-prune.ts` accepts an optional `scripts/` holding exactly that file, so captures made before #1120 still prune. It is deliberately not in `packageDigest`: widening the digest makes every already-staged release refuse as "cached release changed". `readDocEvidenceDetailed` returns `{ unavailable }` for a missing or failing checker and `ReleaseAuthorizations` turns that into its own refusal; only evidence that was read and is not fresh may say "stale documentation". Keep its spawn arguments unchanged (seed `release-committed-doc-metadata`). For the complete policy, receipt and `releasePolicyNotices` contract, read `tasks.md`'s Release authorization rule when changing that boundary. The production `ReleaseAuthorizations` host port in `daemon.ts` reads policy from the candidate commit; keep that injected port fail-closed.
|
|
112
112
|
|
|
113
113
|
- Render staleness only through the call-scoped privacy preflight and bounded metadata probe (`memory-staleness.ts`); on a tree not modified during the call, private/denied/observed-symlink/unknown paths never produce a marker. Retain the explicit same-user concurrent-swap ceiling in docs/memory.md and the probe-loop ponytail. Keep hints out of stored rows and route native brief decoration after selection so one batch shares its probe budget.
|
|
114
114
|
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Scope: the hub-native local worker, its tools, path guard, denylist and seatbelt sandbox. Read before editing `src/adapters/local-worker.ts`, `src/local/`, `src/memory/capture.ts` (reads the denylist), `src/hub/facts.ts` (denylist and large-file stamps), `src/hub/git.ts`, the grant filter in `src/hub/permission-mode.ts`, or the sandbox root in `src/hub/instance-execution.ts`.
|
|
4
4
|
|
|
5
|
+
- Before editing a probe-only lifecycle, capability or sandbox branch, read `docs/design/guidance-probes.md` (T2 confined adapter contract).
|
|
5
6
|
- Nothing the local worker executes may run outside `sandboxedExec`; a new tool that spawns a process goes through it, and a tool that touches a path goes through `guardPath`.
|
|
6
7
|
- The headless Claude host wrapper (#845, `HostShellWrapper` in `src/hub/claude-shell-wrapper.ts`) runs its read-only and check/test/build grants under this same `profile()` plus a deny-only refinement (`src/hub/task-shell-sandbox.ts`, and the hub state dir): it repeats `sandboxedExec`'s own-temp allow suffix and its `readOnlyData` broad-write guard, so change both places together, and keep the refinement deny-only. The wrapper and the read-only shell proof take their fixed environment from `hostShellEnvironment` (`src/local/shell-environment.ts`), which must equal the baseline `sandboxedExec` builds inline (`test/claude-shell-wrapper.test.ts` compares them); never inherit a native agent's environment there.
|
|
7
8
|
- A timeout or abort in `sandboxedExec` marks the result `(killed: <signal>, timeout?)` from its own `killRequested` flag, never only from the exit signal: a shell may report its killed child as a normal exit 137.
|
|
@@ -7,7 +7,7 @@ Scope: the model relay and its journal, the hub's own inference and its slots, O
|
|
|
7
7
|
- The PII screen (`screenPii`, #198) is the exception: it fails closed. Every failure (timeout, no or off-campus model, an answer outside `clear` / `pii <category>`, text over `SCREEN_MAX_BYTES` UTF-8 bytes, since a token is at least a byte) is `unknown`, which `Tasks` handles as PII. It never goes through the inference backoff, asks the gateway only after `onCampus()` and with `onCampusOnly`, takes the on-device generation slot under its own deadline (`acquire(abort.signal, 0)` first, one look and `MlxBusyError` when all are taken: a taken slot sends it to the campus gateway, and only off campus does it wait; on campus a failing or still-loading device hands over to the gateway after 60% of the deadline), sends temperature 0 and `reasoning_effort: "none"` on both paths so a reasoning model cannot spend its 32 tokens thinking, and never puts the text in a log line, an error or an event.
|
|
8
8
|
- An `Inference.complete` call that carries PII text (`ahub ask` over PII evidence or a PII question, a private intake `split`) passes `onCampusOnly`: the model is pinned from `fixedModel()` before any gateway await and the transport refuses the Access endpoint. Its `allowed` predicate is read before the call, after the gateway probe and after the answer; `false` or a throw returns `undefined`. The intake split's JSON is never trusted by `Inference`; its caller validates it (`parseIntakeSplit`).
|
|
9
9
|
- Secrets stay inside `OmniRoute`: never put the key or Access values in a log line, an error message, a return value or routing configuration.
|
|
10
|
-
- Keep model selection in process
|
|
10
|
+
- Keep model selection in process in the hub-owned route implementation, with optional adec model/effort choices. Read `docs/design/model-routes.md` before changing stage evidence, fallback, input sizing or switch contracts. Keep stage-only evidence separate from generic decision evidence v1. Treat legacy routing tables as retired and never rewrite operator files during load.
|
|
11
11
|
- Shared inference slots must recover after a hub process dies, without evicting a live owner. Cancellation has to reach slot acquisition from the relay caller, not just exist in the helper signature.
|
|
12
12
|
- Stay/switch (#197): `hub/auto` and local stage routes apply `stay_switch` only through `planStageSwitch` (`src/models/route/stage-fallback.ts`), never at a call site; `shadow` must not change a routing decision (the recorded-decision golden test in `test/route-relay.test.ts`). No route summarizes, trims or rewrites the forwarded conversation: a tier that cannot fit is filtered out. A PII route's planner never sees the conversation size (no prefill bound) and its event omits `prefillTokens`.
|
|
13
13
|
- A change to the model-routing keys of `templates/routing.toml` (`hub_routes`, `local`, `fixed_model`, `stay_switch`, the `[pi]` windows) carries a model-routing receipt (#637 part 2): `bun scripts/benchmarks/model-routing-gate.ts --receipt`, plus `--live` by hand when an alias or a judge moves. The corpus drives the real `HubRouteRuntime`; see "Model-routing promotion rule" in `docs/agent-notes/benchmarks.md`.
|
|
@@ -16,4 +16,5 @@ Scope: the model relay and its journal, the hub's own inference and its slots, O
|
|
|
16
16
|
- MLX owner and generation identity read `ps lstart` with LC_ALL=C/TZ=UTC pinned (#177): unpinned, a record written under one environment reads as a foreign process under another, and the fail-closed paths would refuse the hub's own server.
|
|
17
17
|
|
|
18
18
|
- Optional adec `decision` routes (#554) default off and support shadow only; reject enforce at load with the #554 follow-up and do not keep an application or gateway effort path. Shadow must preserve the recorded stage model, effort and conversation. Send only bounded host-screened evidence after positive campus admission for sensitive turns; sensitive evidence is dimensions only, and remote/review-observer-excluded turns skip the service. Re-read current board/turn privacy and observer facts across awaits and before service HTTP effects and route metadata emission; changed or unavailable authority refuses the stale turn, never a model fallback around that refusal. Keep one opaque user-turn id through the tool loop; let adec recheck its pins and hard rules, rather than caching valid picks in the hub. Validate returned pairs against the route list, retain the heuristic on client failures/no_candidate, and keep evidence, arguments, secrets and service error prose out of route events. Never route PII screening, pure peer assignment or escalation authority through this service. A stage route asks it only through `ambiguousStage` (`classifier = "decision"`, `ambiguous_band` default `0.05`, `abs(score - confidence_threshold) <= band`): membership decides only whether the question is asked, the answer is recorded and changes no tier, the two tiers with effort `none` are the only options, and `ambiguous_band = 0` asks nothing.
|
|
19
|
+
- R2 host model/effort choices for `plan_execute`, `advisor` and `escalation` remain default-off and shadow-only. They are suggestions only: keep the plan phase, advisor/escalation trigger and verdict, privacy/currentness fences, and actual fallback execution in the hub; do not add effort application, authority transfer, or phase/purpose event fields. Judge-choice route metadata uses only the checked `decisionTarget: "judge"` marker and remains outside executor label/progress/usage accounting. The ADEc templates are placeholders with `onPrem: false` until a person verifies the serving location; no live or gain claim follows from fixtures.
|
|
19
20
|
- The offline triage evaluation (`scripts/decision-eval.ts`, #554 AC5) is a person-run leg, never CI. It serializes `hub.db` from a read-only connection into one consistent image and reads that copy (never separate `hub.db`/`-wal`/`-shm` copies, which a checkpointing writer can leave on different WAL generations), keeps only planner-classified non-PII rows (no `triaged` or `class defaulted` history, no `pii`/`pii_path` signal, public text), and compares `Inference.triage` against a loopback adec `/v1/route` or `/v1/systemone`, each adec turn id carrying a fresh per-run id so no earlier pin is reused. It is evidence for D5 only: wiring a decider into `Tasks.triage`, `assign()` or the PII screen is a separate decision, and a change here never touches them.
|
|
@@ -93,7 +93,7 @@ Scope: the task flow, assignment, the state machine and the hub's MCP tools. Rea
|
|
|
93
93
|
- `review.same_family = "never"` (#820) is read only inside `assign()` through `reviewPool.sameFamily`, which `Tasks.health()` and `reviewPoolOptions` pass from `d.review.same_family` (absent for the default `"fallback"`, so default routing stays byte-identical). It removes every same-family reviewer: the selector's last-resort loop (`selectReviewerPool` `sameFamily`), the legacy `automatic` fallback, a named same-family reviewer (refused with code `family`, `same family as <owner>; review.same_family is never`) and the planner escape unless the planner holds the reviewer role and is of another family. Nobody left means `reviewer = "user"` with `reviewBlocked`, never `sameFamilyFallback`, and that holds for any automatic exhaustion (all offline, no candidate, no declared instance), never `reviewer: none, done will approve directly`; the person fallback is keyed on the setting, not on an eligible same-family candidate. Keep it out of call sites: `Tasks` never tests the family itself.
|
|
94
94
|
- `Tasks.retryReviewer` is host-only (the daemon's reviewer `onUnavailable`), never a tool or CLI path. It acts only while the failed peer is still the reviewer of an `in_review`, non-PII task, with the same review head, the request's `reviewRequestRevision` and a current child generation; `valid()` rechecks all of it after every await and right before the write, which also passes the flow revision. A manually named reviewer's `no_verdict` and a no-verdict with no declared pool go only to the person; other manually named failures keep explicit person control. Confirm fallback only after accepted reviewer publication or a person offer and a fresh binding/generation check; failed publication or notification never confirms settlement. Each failed peer is tried once per head and round (`reviewerFailure` history). `reviewRequestRevision` counts only role events (`done`, `reviewer changed`, `reviewer unavailable`, ownership), so bookkeeping never fences a request; keep `refs.reviewRevision` and `refs.commit` on the review envelope.
|
|
95
95
|
- Release trains (#481 S11): change trains only through `Tasks.newRelease`, `configureRelease`, `assignRelease` and `cutRelease` (planner or person), and refuse every `hub_release_*` in a PII turn. `assignRelease` writes only `release` and refuses a frozen, shipped or dropped release on either side; private or pinned scope is person-only. One active or frozen train at a time. A cut freezes only through `Board.freezeRelease` after a fresh `releaseWindow` (host lease from `readReleaseHostAdmission`, quota, `current()`, at most 5 s old); unknown evidence defers, and the window is closed in `finally`. A cut never publishes, tags or upgrades, and upgrade and recovery never consult `releaseWindow`. Keep two of `RELEASE_TRAIN_HISTORY_LIMIT` slots for cut and ship; a configuration no-op appends nothing. An S9 plan receipt survives only contiguous planning revisions that changed exactly `["release"]`.
|
|
96
|
-
- Release authorization (#481 S6, `src/hub/sdlc-release-authorization.ts`): the console user or the one configured conductor through `sdlc authorize-release` creates one under the same admission as `sdlc merge` (tools role, matching configured conductor, no `toolsOwner`, private turn or caller PII context). Keep the actual asker in receipt `by` and the audit, and the cooperative explicit-person-instruction rule in AGENTS.md Releasing.
|
|
96
|
+
- Release authorization (#481 S6, `src/hub/sdlc-release-authorization.ts`): the console user or the one configured conductor through `sdlc authorize-release` creates one under the same admission as `sdlc merge` (tools role, matching configured conductor, no `toolsOwner`, private turn or caller PII context). Keep the actual asker in receipt `by` and the audit, and the cooperative explicit-person-instruction rule in AGENTS.md Releasing. Read policy only from `.agenthub/config.json` committed at the candidate commit; ignore `.agenthub/config.local.json` release keys with a notice and keep release policy outside runtime `HubConfig` and settings reload. Defaults are `release.version: package.json` and `release.docs: checker`; `release.version` may be `release-notes` with a safe `release.notesPath` template or `none`, and `release.docs: none` is recorded as an explicit exemption without a freshness digest. Bind consent to the current HEAD, the configured source's exact version, the origin identity and docs policy; recheck source, policy, HEAD and origin after any await and on every guard. The read-only release report may select only the most recent receipt matching exact HEAD, repo, origin and committed policy; revalidate the notes blob for that receipt version, never infer a tag-only version or use a stale receipt, and leave version undetermined without an eligible authorization. `docs:none` reports the exemption without a docs read. It lives in daemon memory only: a restart revokes it and the event is audit, never restored. `release-guard` and `release-guard-hook` are refused in a private turn; a tag push needs a matching receipt, and npm publish also a clean tracked worktree and committed package version that independently identifies the configured target. Never accept authorization from a tool, a task receipt or a file.
|
|
97
97
|
- `Board.update`'s untouched-return exception is the only way owned or accepted work returns to backlog: keep every condition (exact event, owner and reviewer null, state, `expectedFlowRevision`, non-empty note, no work evidence) and reach it only through `Tasks.returnUntouchedToBacklog` (#481 S9). Optional return `fields` accepts only `reserved`, follows the existing reservation authority and target-admission rules before and after screening, and saves the reservation with Board-derived planning history and revision in the same state write before capacity notices or auto-pull; omitted fields retain the plan (#1154).
|
|
98
98
|
- The main-checkout note (`mainCheckoutWarning`, `src/hub/main-checkout.ts`, #572) is advisory text in the `hub_task_done` result, the review request and status, never a refusal. A branch name or other metadata the hub reads from outside the board reaches task text only after `Tasks.publicMetadataText` (PII patterns, secret shapes, private paths) and a plain ref-name check; otherwise use the generic sentence that carries none of it.
|
|
99
99
|
|
|
@@ -20,8 +20,7 @@ Scope: tests, fakes and the test gate. Read before adding or changing a test or
|
|
|
20
20
|
- A fixture that needs a port takes it from a free-port probe, never a fixed number, which collides with whatever holds it on a shared runner (#548). The probe binds `127.0.0.1`, matching the loopback server that takes the port (#232).
|
|
21
21
|
- `ahub upgrade` without `--to` asks the registry (`npm view`) and hands a target newer than the CLI to `bun x` (#272): a test that reaches either puts a fake `npm` first on `PATH` and a recording stand-in for `process.execPath`, as `test/upgrade-cli.test.ts` does. The interactive screens are tested through a scripted `ScreenIO`; a CLI test that needs them marks `process.stdin` and `process.stdout` as terminals in a wrapper script.
|
|
22
22
|
- Cross-process fixtures wait for the consuming client to process its handshake (the channel connected diagnostic), not merely the daemon's attached/idle state. Deadline-routing fixtures hold and release responses at the fallback decision; do not place a fixed sleep between deadline fractions and assume scheduler headroom (#287). Receipt-order fixtures use the normal watchdog for ordinary I/O, trigger expiry after observed native acceptance, and await a consumed transport barrier before asserting on late results.
|
|
23
|
-
- Companion tests
|
|
24
|
-
- A Claude Code companion test (#1349, #1365) loads the host-only `.tsx` hooks (`integrations/claude-code/hooks/*.tsx`) with a dynamic `import()` of a `new URL(..., import.meta.url).href`, never a static import, so the project typecheck (no `jsx` in `tsconfig.json`) never compiles them (`test/claude-code-companion-model-input.test.ts`).
|
|
23
|
+
- Companion tests moved with the companions to STAIxBWLB/ahub-orca, ahub-herdr and ahub-claude (#1387); read their `AGENTS.md` there. What stays here is `test/companion-contract.test.ts`, which holds ahub to `docs/contracts/companion-cli-v1.json`: a daemon fixture with positive and absent optional fields, the `shellQuote` vectors, the needs and `pausedNote` producer cases and the guard that ahub names no companion.
|
|
25
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).
|
|
26
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).
|
|
27
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.
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
{
|
|
2
|
+
"contract": "companion-cli",
|
|
3
|
+
"version": 1,
|
|
4
|
+
"since": "0.37.0",
|
|
5
|
+
"about": "The only things the companion repositories (STAIxBWLB/ahub-orca, ahub-herdr, ahub-claude) may assume about ahub. Removing or renaming a listed path, changing a listed closed set, an argv form, the exit code or the stderr prefix needs companion-cli-v2.json beside this file and a hub_task_handoff to each companion repository. Adding a field needs neither. test/companion-contract.test.ts holds ahub to it.",
|
|
6
|
+
"types": {
|
|
7
|
+
"semver": "string matching MAJOR.MINOR.PATCH with an optional -pre or +build suffix",
|
|
8
|
+
"string": "non-empty string",
|
|
9
|
+
"absolute-path": "string starting with /",
|
|
10
|
+
"count": "non-negative safe integer",
|
|
11
|
+
"count-map": "object whose keys are in values and whose values are counts",
|
|
12
|
+
"enum": "string in values",
|
|
13
|
+
"true": "the boolean true",
|
|
14
|
+
"false": "the boolean false",
|
|
15
|
+
"prefixed": "string equal to one of values or starting with one of prefixes",
|
|
16
|
+
"object": "plain object"
|
|
17
|
+
},
|
|
18
|
+
"commands": [
|
|
19
|
+
{ "argv": ["status", "--json"], "reads": "status" },
|
|
20
|
+
{ "argv": ["--project", "<id|root>", "status", "--json"], "reads": "status" },
|
|
21
|
+
{ "argv": ["projects", "--json"], "reads": "projects" },
|
|
22
|
+
{ "argv": ["ui"] },
|
|
23
|
+
{ "argv": ["--project", "<id|root>", "ui"] },
|
|
24
|
+
{ "argv": ["console"] },
|
|
25
|
+
{ "argv": ["--project", "<id|root>", "console"] },
|
|
26
|
+
{ "bin": "acon", "argv": ["ui"] }
|
|
27
|
+
],
|
|
28
|
+
"noHub": { "exitCode": 1, "stderrPrefix": "ahub: no hub running for " },
|
|
29
|
+
"status": {
|
|
30
|
+
"version": { "type": "semver", "presence": "always" },
|
|
31
|
+
"projectId": { "type": "string", "presence": "always" },
|
|
32
|
+
"cwd": { "type": "absolute-path", "presence": "always" },
|
|
33
|
+
"tasks": { "type": "count-map", "presence": "always", "values": ["backlog", "proposed", "in_progress", "in_review", "approved", "changes_requested", "cancelled"] },
|
|
34
|
+
"peers": { "type": "object", "presence": "always" },
|
|
35
|
+
"peers.<id>.state": { "type": "enum", "presence": "always", "values": ["idle", "busy", "paused", "offline"] },
|
|
36
|
+
"peers.<id>.queued": { "type": "count", "presence": "always" },
|
|
37
|
+
"peers.<id>.attached": { "type": "false", "presence": "when the peer has no adapter attached; absent otherwise" },
|
|
38
|
+
"peers.<id>.needsReview": { "type": "count", "presence": "when nonzero; absent when zero" },
|
|
39
|
+
"peers.<id>.pullOnly": { "type": "true", "presence": "when the peer reads messages only through hub_inbox; absent otherwise" },
|
|
40
|
+
"peers.<id>.paused": { "type": "prefixed", "presence": "when paused; absent otherwise", "values": ["manual"], "prefixes": ["budget: "] },
|
|
41
|
+
"needs": { "type": "object", "presence": "always" },
|
|
42
|
+
"needs.act": { "type": "count", "presence": "always" },
|
|
43
|
+
"needs.watch": { "type": "count", "presence": "always" },
|
|
44
|
+
"needs.state": { "type": "string", "presence": "always" },
|
|
45
|
+
"needs.first": { "type": "object", "presence": "when any item needs the person; absent otherwise" },
|
|
46
|
+
"needs.first.kind": { "type": "string", "presence": "with needs.first; \"approval\" is a pending permission request" },
|
|
47
|
+
"needs.first.level": { "type": "enum", "presence": "with needs.first", "values": ["act", "watch"] },
|
|
48
|
+
"needs.first.until": { "type": "count", "presence": "when the item expires (milliseconds since the epoch)" },
|
|
49
|
+
"needs.first.peer": { "type": "string", "presence": "when the item belongs to a peer" }
|
|
50
|
+
},
|
|
51
|
+
"projects": {
|
|
52
|
+
"[]": { "type": "object", "presence": "one per registered project" },
|
|
53
|
+
"[].id": { "type": "string", "presence": "always" },
|
|
54
|
+
"[].root": { "type": "absolute-path", "presence": "always" },
|
|
55
|
+
"[].state": { "type": "string", "presence": "always; readers recognise running and stopped, any other value reads as unknown" }
|
|
56
|
+
},
|
|
57
|
+
"shellQuote": [
|
|
58
|
+
{ "in": "it's $(x)", "out": "'it'\\''s $(x)'" },
|
|
59
|
+
{ "in": "", "out": "''" },
|
|
60
|
+
{ "in": "a b", "out": "'a b'" },
|
|
61
|
+
{ "in": "'", "out": "''\\'''" },
|
|
62
|
+
{ "in": "''", "out": "''\\'''\\'''" },
|
|
63
|
+
{ "in": "$(x)", "out": "'$(x)'" },
|
|
64
|
+
{ "in": "`x`", "out": "'`x`'" },
|
|
65
|
+
{ "in": "a\nb", "out": "'a\nb'" },
|
|
66
|
+
{ "in": "é", "out": "'é'" },
|
|
67
|
+
{ "in": "\\", "out": "'\\'" },
|
|
68
|
+
{ "in": "a;b&c|d", "out": "'a;b&c|d'" }
|
|
69
|
+
]
|
|
70
|
+
}
|
package/docs/design/adapters.md
CHANGED
|
@@ -161,6 +161,18 @@ takeover or permission evidence. It carries no environment, argv, cwd, credentia
|
|
|
161
161
|
or text, adds no event, log or memory payload, and is withheld from `status.json` and every
|
|
162
162
|
non-console reader. The field is additive and optional; no control protocol version changes.
|
|
163
163
|
|
|
164
|
+
Status `peerVersions` says, per peer, which agent-hub code that peer has loaded (#1385). It sits
|
|
165
|
+
beside `peers`, as `roleInfo` does, so the legacy peer row keeps its shape (#295). The optional
|
|
166
|
+
`hubClient` port belongs to an adapter whose agent-hub code runs in another process (the Claude
|
|
167
|
+
channel's `WsPeer`); an adapter without it runs inside the daemon and reports
|
|
168
|
+
`ahub: { runs: "daemon", version }`. With the port, the entry reports `runs: "client"` and the version
|
|
169
|
+
the attached socket's hello sent as `clientVersion`, `unreported` for a hello without one, and no
|
|
170
|
+
`ahub` field while nothing is attached. `ahubTools` lists the sorted distinct versions the peer's
|
|
171
|
+
open `tools` connections reported. The daemon keeps a reported version only when it is a plain
|
|
172
|
+
semver of at most 64 characters (`displayVersion`, `src/version.ts`); anything else is unreported.
|
|
173
|
+
The fields are display only, never compatibility, admission or protocol evidence, and are
|
|
174
|
+
additive: an older daemon ignores `clientVersion`, and an older console ignores both fields.
|
|
175
|
+
|
|
164
176
|
## Accepted channel delivery settlement (#1172)
|
|
165
177
|
|
|
166
178
|
Only an attached push channel opts into explicit disposition of its own accepted delivery. An `accepted` receipt acknowledges that the notification was accepted by the channel transport; it is not a native handling or task-completion signal. The host reads `bus.accepted_settle_ms` from accepted configuration on its existing maintenance sweep, defaulting to ten minutes. A row that remains unconfirmed becomes `needs_review` with no replay. `hub_inbox` returns bounded id/revision metadata for the channel's accepted and held rows, including when an accepted push prevents the pull itself. The plugin renders that metadata and avoids both an empty-inbox claim and polling advice while there is an actionable row. Important, task and review timeouts produce one durable status-kind, status-priority conductor message containing ids only when the existing `conductor.feed` policy is on; `feed: off` remains an opt-out. Pull-only sessions do not gain the explicit accepted-disposition port.
|
|
@@ -185,10 +197,35 @@ retains ownership and the profile for an explicit stop retry ([#1284](https://gi
|
|
|
185
197
|
|
|
186
198
|
Permission decisions are bound to the authenticated caller and current session. A hub CLI call inside an agent session acts as that peer, not as the person; role and task checks still apply at each tool boundary. Permission modes are person-controlled, and a conductor role does not grant them. This avoids turning a received message into user consent ([#193](https://github.com/STAIxBWLB/agent-hub/issues/193), [#242](https://github.com/STAIxBWLB/agent-hub/issues/242)).
|
|
187
199
|
|
|
200
|
+
## Confined guidance probe lifecycle (#1226 T2)
|
|
201
|
+
|
|
202
|
+
The host-only `LocalPeer.runProbe` / `stopProbe` path reuses the local model/tool
|
|
203
|
+
loop on a fresh private peer that never joins Bus or ordinary recovery. Ordinary
|
|
204
|
+
`deliver` retains its existing behavior. Probe purpose suppresses ordinary
|
|
205
|
+
capture, history, messaging, titles, route/usage/progress observers and learning;
|
|
206
|
+
private correlated admissions and usage records remain separate. Stop closes
|
|
207
|
+
new admissions and joins the actual run and owned cleanup before claiming
|
|
208
|
+
quiescence. Unknown work retains its handle and hold.
|
|
209
|
+
|
|
210
|
+
The [guidance probe contract](guidance-probes.md#t2-confined-adapter-contract)
|
|
211
|
+
owns the complete-request binding, role input matrix, fixed model, resource
|
|
212
|
+
reservations, path guards and verified deny-only sandbox. Its v1 tool capability
|
|
213
|
+
is read/write/edit only. No arbitrary subprocess, hub, memory, package or network
|
|
214
|
+
tool is available. The adapter factory is not wired into the daemon; source and
|
|
215
|
+
fake-model checks and the model-free macOS boundary canary are separate from a
|
|
216
|
+
real model/worker trial, which has not been authorized.
|
|
217
|
+
|
|
188
218
|
## Model, account, and memory boundaries
|
|
189
219
|
|
|
190
220
|
Subscription-based native CLIs keep their own account authentication; those credentials are not pooled through the hub. Hub-owned inference, including internal summaries and local-worker model calls, uses the in-process model route and OmniRoute provider boundary. Prompt text may inform configured routing, but it cannot grant credential access or replace host routing policy. The optional local-worker adec consumer (#554) releases only bounded host-screened evidence, after campus/privacy and observer admission; native account, TUI, reviewer and task-assignment authority are unchanged. Shadow preserves the gateway model/effort and conversation; enforcement is refused at configuration load and no pair is applied. An explicit live model override bypasses the decision service. Current board/turn privacy and observer authority fence the optional request across waits and its proposal before telemetry; an authority change refuses the stale turn, and the refusal is not converted into a fixed-model fallback. There is no new gateway or native turn/spawn effort path. This separates native subscription identity from hub service credentials ([#553](https://github.com/STAIxBWLB/agent-hub/issues/553)).
|
|
191
221
|
|
|
222
|
+
R2 uses that same separation for `plan_execute` phase and `advisor`/`escalation`
|
|
223
|
+
judge model/effort suggestions. The hub retains phase transitions, judge
|
|
224
|
+
triggers and verdicts, escalation confirmation and actual fallback execution;
|
|
225
|
+
the service has no authority over native account identity, peer assignment or
|
|
226
|
+
provider calls. A `decisionTarget: "judge"` event is bounded metadata, not a
|
|
227
|
+
served-model or usage record.
|
|
228
|
+
|
|
192
229
|
The PII screen is distinct from ordinary optional inference. It may use an on-device model; a gateway screen requires positive on-campus admission and `onCampusOnly`. If no allowed path returns a closed `clear` or PII verdict before the deadline, the result is unknown and handled as private. This keeps network and model uncertainty from becoming a disclosure ([#198](https://github.com/STAIxBWLB/agent-hub/issues/198)).
|
|
193
230
|
|
|
194
231
|
Runtime memory capture and recall use the in-process `@staix/agent-mem` package, screened and invoked by host integration. claude-mem is off by default and import-only; there is no worker HTTP or model-summary path in the runtime. This avoids a parallel capture route with different privacy checks ([#752](https://github.com/STAIxBWLB/agent-hub/issues/752), [agent-mem#13](https://github.com/STAIxBWLB/agent-mem/issues/13)).
|
|
@@ -241,8 +278,12 @@ its existing native-identity admission, independently of Kimi reviewer isolation
|
|
|
241
278
|
compatibility. Only Kimi Code CLI 2.5.2 headless is currently enabled, through
|
|
242
279
|
`session/set_config_option` with `configId: model` and the
|
|
243
280
|
[model-free setter receipt](../verification/2026-11-08-kimi-252-model-setter-1317.md).
|
|
244
|
-
Qwen remains unavailable
|
|
245
|
-
|
|
281
|
+
Qwen remains unavailable pending a separate setter admission. Its historical
|
|
282
|
+
A/B/B evidence did not retain the third request's purpose. The
|
|
283
|
+
[suggestions-off receipt](../verification/2026-11-11-qwen-setter-suggestions-off.md)
|
|
284
|
+
records ordinary A/B/A on exact 0.26.9 and 0.27.0 under isolated normal settings;
|
|
285
|
+
this adds candidate evidence, without enabling a production setter or qualifying
|
|
286
|
+
real accounts, default-on suggestions, TUI or Linux. Jcode headless A/B/A passed, but its shared-TUI turn fence
|
|
246
287
|
across failover remains unqualified; its production setter stays unavailable. A native TUI or external adapter cannot acquire a setter from an
|
|
247
288
|
advertisement or a registry label.
|
|
248
289
|
|
|
@@ -130,7 +130,15 @@ recovery transaction and bus recovery hold are clear.
|
|
|
130
130
|
## Models and memory
|
|
131
131
|
|
|
132
132
|
|
|
133
|
-
Peer selection, hub-owned model routing, and provider access are distinct layers. Task routing chooses a peer; the in-process route selects a model for hub-owned inference; OmniRoute owns provider keys, provider fallback, and usage. Native CLIs retain their own account and provider configuration; subscription OAuth credentials are not pooled through the gateway.
|
|
133
|
+
Peer selection, hub-owned model routing, and provider access are distinct layers. Task routing chooses a peer; the in-process route selects a model for hub-owned inference; OmniRoute owns provider keys, provider fallback, and usage. Native CLIs retain their own account and provider configuration; subscription OAuth credentials are not pooled through the gateway. Routing runs in process through the hub-owned route implementation. An opt-in `decision` route may consult the loopback agent-decide policy service; execution and provider access remain in the hub and OmniRoute, with the existing heuristic as the consumer fallback. This keeps worker-provider credentials and provider failover in one gateway; the optional policy consult does not proxy the worker's inference traffic ([#553](https://github.com/STAIxBWLB/agent-hub/issues/553)).
|
|
134
|
+
|
|
135
|
+
For the later host-route question slice, the same loopback service can suggest
|
|
136
|
+
an alias/effort for an existing `plan_execute` phase or `advisor`/`escalation`
|
|
137
|
+
judge call. The phase, host trigger, verdict parsing, escalation latch and
|
|
138
|
+
executor fallback remain owned by the hub; shadow records the proposal without
|
|
139
|
+
applying it. The judge observation is separately marked in route metadata and
|
|
140
|
+
does not create a served-model or usage claim. The ADEc policy examples are
|
|
141
|
+
placeholders, not deployed configuration or evidence of model quality.
|
|
134
142
|
|
|
135
143
|
Person-owned live model overrides (#1317) are runtime state in `hub.db`, not
|
|
136
144
|
configuration edits. The host owns person admission, desired-versus-applied
|