@staix/agent-hub 0.39.0 → 0.40.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 +39 -0
- package/README.md +12 -6
- package/docs/adding-an-ai-tool.md +1 -1
- package/docs/agent-notes/README.md +7 -0
- package/docs/agent-notes/adapters.md +5 -3
- package/docs/agent-notes/benchmarks.md +2 -0
- package/docs/agent-notes/budget.md +1 -0
- package/docs/agent-notes/bus.md +1 -0
- package/docs/agent-notes/daemon.md +8 -3
- package/docs/agent-notes/local-worker.md +3 -1
- package/docs/agent-notes/security-review.md +1 -0
- package/docs/agent-notes/tasks.md +7 -2
- package/docs/agent-notes/tests.md +7 -7
- package/docs/contracts/companion-cli-v1.json +4 -0
- package/docs/design/adapters.md +91 -0
- package/docs/design/agent-hub-architecture.md +17 -0
- package/docs/design/agent-hub.md +10 -0
- package/docs/design/bus.md +7 -0
- package/docs/design/cli-output.md +183 -0
- package/docs/design/execution-reference.md +6 -1
- package/docs/design/roadmap.md +191 -0
- package/docs/design/task-board.md +34 -0
- package/docs/dogfood.md +11 -4
- package/docs/events.md +4 -4
- package/docs/memory.md +3 -3
- package/docs/operations.md +153 -41
- package/docs/profiles.md +1 -0
- package/docs/quickstart.md +17 -4
- package/docs/sdlc.md +3 -1
- package/docs/security.md +40 -4
- package/docs/verification/2026-11-14-codex-0169-reviewer-isolation.md +70 -0
- package/docs/verification/2026-11-14-codex-0169-reviewer-tool-call.md +48 -0
- package/docs/verification/2026-11-14-pi-152-compat.md +45 -0
- package/docs/verification/2026-11-15-0.40.0.md +39 -0
- package/docs/verification/2026-11-16-pi-loopback-1447.md +39 -0
- package/docs/verification/pi-152-model-free.ts +57 -0
- package/docs/verification/pi-152-native.mjs +21 -0
- package/docs/verified.json +22 -22
- package/package.json +3 -3
- package/plugins/agent-hub/.claude-plugin/plugin.json +1 -1
- package/plugins/agent-hub/kimi-hook.js +332 -89
- package/plugins/agent-hub/kimi-review-policy-worker.js +16 -11
- package/plugins/agent-hub/server.js +417 -160
- package/src/adapters/agy/definition.ts +1 -1
- package/src/adapters/claude-channel.ts +1 -1
- package/src/adapters/codex-review-isolation.ts +61 -17
- package/src/adapters/compat.ts +7 -7
- package/src/adapters/definitions/builtin-metadata.ts +6 -6
- package/src/adapters/definitions/native-config-defaults.ts +1 -1
- package/src/adapters/definitions/native-config-policy.ts +1 -1
- package/src/adapters/definitions/qwen.ts +1 -1
- package/src/adapters/local-worker.ts +5 -3
- package/src/adapters/pi.ts +54 -11
- package/src/adapters/registry-types.ts +2 -1
- package/src/adapters/reviewer-print.ts +2 -1
- package/src/cli/answer-args.ts +11 -3
- package/src/cli/console-question.ts +1 -1
- package/src/cli/console-state.ts +95 -10
- package/src/cli/console.ts +6 -2
- package/src/cli/error-format.ts +19 -0
- package/src/cli/help.ts +290 -25
- package/src/cli/identity-audit.ts +8 -7
- package/src/cli/identity.ts +17 -0
- package/src/cli/init.ts +102 -9
- package/src/cli/main.js +2 -2
- package/src/cli/main.ts +57 -21
- package/src/cli/output-standard.ts +56 -0
- package/src/cli/output.ts +143 -8
- package/src/cli/roadmap.ts +215 -0
- package/src/cli/smoke-pty-bridge.ts +7 -24
- package/src/cli/task-output.ts +3 -1
- package/src/cli/upgrade-presentation-flags.ts +2 -2
- package/src/hub/board.ts +200 -3
- package/src/hub/bus.ts +9 -0
- package/src/hub/check-runner.ts +3 -4
- package/src/hub/ci-watch.ts +19 -4
- package/src/hub/control-client.ts +1 -1
- package/src/hub/daemon.ts +245 -43
- package/src/hub/events.ts +2 -2
- package/src/hub/execution-reference.ts +1 -1
- package/src/hub/github-import.ts +81 -0
- package/src/hub/hub-tools.ts +34 -9
- package/src/hub/install-policy.ts +23 -0
- package/src/hub/lifecycle-schema.ts +2 -2
- package/src/hub/no-writes.ts +3 -0
- package/src/hub/operational-authority.ts +3 -1
- package/src/hub/operational-view.ts +1 -1
- package/src/hub/pi-failure.ts +7 -0
- package/src/hub/question-desk.ts +26 -7
- package/src/hub/questions.ts +33 -5
- package/src/hub/restart.ts +7 -0
- package/src/hub/roadmap-triage.ts +86 -0
- package/src/hub/roadmap-unplaced.ts +169 -0
- package/src/hub/roadmap-view.ts +83 -0
- package/src/hub/roadmap.ts +127 -0
- package/src/hub/sdlc-merge.ts +5 -4
- package/src/hub/sdlc-queue.ts +3 -3
- package/src/hub/sdlc.ts +37 -2
- package/src/hub/specs-task.ts +7 -0
- package/src/hub/task-sweep.ts +29 -2
- package/src/hub/task-worktree.ts +37 -0
- package/src/hub/tasks.ts +381 -7
- package/src/pi/dependency-publish.ts +50 -0
- package/src/pi/extension.ts +1 -1
- package/src/pi/launch.ts +1 -1
- package/src/pi/task-dependencies.ts +249 -0
- package/src/ui/index.html +53 -13
- package/src/ui/plugin-questions.ts +5 -0
- package/src/ui/plugin.ts +6 -1
- package/templates/config.json +1 -1
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
Scope: tests, fakes and the test gate. Read before adding or changing a test or fake under `test/` or `src/adapters/conformance/`, or editing `scripts/check.sh`, `scripts/hang-watch.sh`, `scripts/progress-tee.sh`, `scripts/seeded-check.ts`, `scripts/seeds.json`, `scripts/lib/ts-ast.ts`, `scripts/changed-tests.mjs`, `scripts/check-closing-refs.mjs`, `.github/workflows/closing-refs.yml`, `scripts/release-prepare.ts`, `scripts/release-tag.ts` or `scripts/lib/release-plan.ts`.
|
|
4
4
|
|
|
5
5
|
- A fake's gated action that never sees its gate skips the action; never fall through to a late, unsynchronized action. Owned-group tests inject `AcpOwnedGroupPorts`; a test never signals a process group it did not spawn.
|
|
6
|
-
- When a production closure gains a dependency, find its VM fixtures by the closure and its callers as well as the new dependency name. Bind every transitive host port and actual imported policy helper, including asynchronous read paths, and run each affected extracted closure. Keep native identity checks on real unstarted instances; never replace a policy predicate with an always-true stub or weaken existing assertions to accommodate a moved dependency.
|
|
7
|
-
- On Bun 1.4.2, preserve original fields before `toMatchObject` with asymmetric matchers, or assert primitive fields and strings separately; never use a matcher-mutated value for a later content/canary assertion. Recheck this restriction when upgrading Bun.
|
|
6
|
+
- When a production closure gains a dependency, find its VM fixtures by the closure and its callers as well as the new dependency name. Bind every transitive host port and actual imported policy helper, including asynchronous read paths, and run each affected extracted closure. When changing question-tool observer exclusions in `src/hub/daemon.ts`, bind the actual `QUESTION_TOOLS` import in `test/review-privacy-wiring.test.ts` and run that test alongside the question tests. Keep native identity checks on real unstarted instances; never replace a policy predicate with an always-true stub or weaken existing assertions to accommodate a moved dependency.
|
|
7
|
+
- On Bun 1.4.2 and 1.4.4 (rechecked 2026-11-14, hub task 940: after `expect(value).toMatchObject({ text: expect.stringContaining("x") })` the fields read back as matcher objects), preserve original fields before `toMatchObject` with asymmetric matchers, or assert primitive fields and strings separately; never use a matcher-mutated value for a later content/canary assertion. Recheck this restriction when upgrading Bun.
|
|
8
8
|
- A daemon fixture that routes write-class work (`implement`, `bulk_edit`) to a hub-sandboxed peer (Pi, `local`) runs in a throwaway repository made with `gitProject()` (`test/fakes/git-project.ts`), never in `ROOT`: the agent-hub checkout carries the machine's git config (a hosted runner's checkout has an `includeIf` credentials entry the hub refuses), so such a test passes on one machine and fails on another, and it would make a hub worktree and `task/*` branch inside the checkout under test (#1129). Before calling a hosted-only failure a flake, reproduce the runner's condition in a scratch clone.
|
|
9
9
|
- A fixture that walks a policy table (a `COMPAT` entry list, a registry) derives its per-entry values from the table, never a fixed list of keys or versions a planned entry is not in: the compat watch test builds every served version and the ahead/unknown row from `COMPAT[id]`, so an added entry (`pi`, #843 AC2) is covered without editing the test.
|
|
10
10
|
- Tests that are not about batching build the bus with `batchMs: 0`; with the default 15 s window a lone status envelope looks like a lost message.
|
|
11
11
|
- A test that writes an executable shim and then times a product call through it (a `git` wrapper on `PATH`, as `test/memory-code-head-684.test.ts` does) runs the shim once by absolute path first, outside the measured region: the first exec of a newly written executable costs about 250 ms on macOS (#519). Never widen the product's bound or weaken the assertion for it.
|
|
12
|
-
- A test timeout that fires while `Bun.spawnSync` runs can start the next test inside spawnSync's own event loop (Bun 1.3.14 and 1.4.2; background: README). `scripts/check.sh` runs tests with a 20 s timeout and under `scripts/hang-watch.sh`; a test that spawns and reads the process table gets a timeout of its own, never above 20 s: an explicit larger timeout overrides the gate's `--timeout 20000`, so shorten the scenario instead.
|
|
12
|
+
- A test timeout that fires while `Bun.spawnSync` runs can start the next test inside spawnSync's own event loop (Bun 1.3.14 and 1.4.2; not rechecked on 1.4.4; background: README). `scripts/check.sh` runs tests with a 20 s timeout and under `scripts/hang-watch.sh`; a test that spawns and reads the process table gets a timeout of its own, never above 20 s: an explicit larger timeout overrides the gate's `--timeout 20000`, so shorten the scenario instead.
|
|
13
13
|
- Sandboxed commands and the MLX server get a fixed environment (`PATH`, `HOME` and their own keys), so test knobs for their fakes travel in a wrapper script or argv, not in `process.env`. Daemon-owned peer children use `peerChildEnv`, which drops `ORCA_*` and replaces agent identity markers; a person-owned native launch preserves only its own pane's `ORCA_*` context while dropping inherited agent identity.
|
|
14
14
|
- Bind agent identity markers explicitly in native/CLI fixture children. The full gate starts the test runner without inherited agent markers (including `AGENTHUB_DELIVERY_ONLY`) and without an `ahub claude` session's hub variables (`AGENTHUB_PROJECT_DIR`, `AGENTHUB_STATE_DIR`, `AGENTHUB_INSTANCE_ID`, `AGENTHUB_LAUNCH_ID`); a new variable a native session exports and a fixture child reads joins that `env -u` list in `scripts/check.sh`. Never weaken production marker detection to make them pass.
|
|
15
15
|
- A fixture that spawns the real channel plugin (`src/adapters/claude-channel.ts` or `plugins/agent-hub/server.js`) to act as a peer runs it with `cwd` at the hub's project root, made with `realPath` (the macOS temp dir is a symlink). The plugin chooses its hub through `channelProject` (rule: `daemon.md`), so from another cwd it joins the wrong hub, joins as a distinct session or connects nowhere. Only tools mode with both `AGENTHUB_STATE_DIR` and `AGENTHUB_PROJECT_DIR` set skips that check. A fixture whose plugin must push as a channel (not fall back to tools mode) injects the parent row with `syntheticClaudeParentEvidenceSetup()` (`test/fakes/claude-channel-parent.ts`, #1171), which replaces only `claudeParentCommandPort.read`; the production marker and classifier still run, so never stub `classifyClaudeParentCommand` or skip the evidence check. For an unchanged published bundle with an inlined observer port, use the published-leg raw port-fact injection in `test/published-protocol-compat.test.ts`: bootstrap its import with Bun's built-in `mock.module` only for `child_process` and `node:child_process`, export the real functions and replace only `spawnSync` for `/bin/ps -ww -p <direct-parent-pid> -o command=`. Return `SYNTHETIC_CLAUDE_PARENT_COMMAND` from the same fixture helper and delegate every other call. Preserve the bundle bytes, classifier, inherited marker, parent-identity check, assertions and timeouts. This synthetic host observation is not native-launch acceptance. A second opted-in session attached while a fixture owner holds the peer stays a standby (#1174): close the owner and wait for offline before attaching the session under test (`test/channel-inbox-daemon.test.ts`).
|
|
@@ -24,13 +24,13 @@ 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
|
-
-
|
|
27
|
+
- The macOS CI leg uses four shards and the Ubuntu leg six (#548, #1490): `check (ubuntu-latest) shard i/6` and `check (macos-latest) shard i/4` 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. `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
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 four 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
|
-
- 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 the bridge
|
|
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.
|
|
34
34
|
- A request that a test expects a stop or shutdown to cut gets its rejection handler where the request is created, never after the awaited teardown: a late `catch` races the reset and the run fails on an unhandled rejection.
|
|
35
35
|
- Run `bun scripts/seeded-check.ts` before reporting the seeded-guard gate complete. After changing seeded guard logic, run its affected seeds even when search-anchor counts are unchanged. Put asynchronous calls inside `resolves`/`rejects` expectations so a mutated refusal fails a named assertion. Keep the `scripts/seeds.json` cases sequential; require the same named test green before its seeded assertion fails. Seed rot, survivors, setup/compiler failures, timeout/watchdog termination and process leaks fail the gate. A change that moves or rewrites a line a `scripts/seeds.json` case searches for updates that case's search and replacement in the same PR (seed rot fails the gate), keeping its mutant effect and named test. `scripts/check.sh`, `--changed` included, never runs the seeds, so rot shows only in CI's `seeded guards` job (the `profile-cli-dry-flags` anchor needed a search-text update in both #1100 and #1110, 2026-11-02). Before pushing a change to a file `scripts/seeds.json` names, confirm every anchor still matches once: `bun -e 'const f=require("fs");for(const x of JSON.parse(f.readFileSync("scripts/seeds.json","utf8")).seeds){const n=f.readFileSync(x.file,"utf8").split(x.search).length-1;if(n!==1)console.log("seed rot:",x.id,n)}'` prints nothing when every anchor is intact. Never run the full seed runner from a unit test or mutate the source checkout; inspect preserved failed fixtures before removing them. CI runs it as four sequential Linux shards (`--shard i/4`) beside the ordinary check, separately from `scripts/check.sh`; the required `seeded guards` job passes only when every shard passed, or when the decision job reused a verified identical-tree full gate (`admission == 'reuse'`). Keep that job name: branch protection and `scripts/ci-gates.mjs` read it (#457). On seed rot the checker names the anchor's symbol at a base commit and where it is now (`seedRotContext`): `--base <commit>` sets that base (CI passes the PR base from a `fetch-depth: 0` checkout; keep both), and without it the base is `merge-base origin/main HEAD`. The context is evidence only: it never relaxes the one exact match, and an unavailable base says so instead of guessing.
|
|
36
36
|
- `scripts/lib/ts-ast.ts` is the one TypeScript AST helper for scripts and source-scanning tests (`parseSource`, `callSites`, `symbolSpans`, `enclosingSymbol`, `findSymbol`; inline HTML scripts keep their offsets). It gives lexical locations only, never resolved call edges, and stays dev tooling: never import it from `src/`.
|
|
@@ -50,12 +50,12 @@ Scope: tests, fakes and the test gate. Read before adding or changing a test or
|
|
|
50
50
|
- A daemon test of a tool that reaches a public host passes the host-only transport seam (`DaemonOptions.webFetchTransport`, #553) and asserts what the daemon handed the tool, never a real round trip or a longer wait. The tool, the proxy URL and the allowlist stay the daemon's own; only the request is replaced. The proxy's own behaviour has its tests in `test/proxy.test.ts` and the web-proxy block of `test/web-fetch.test.ts`.
|
|
51
51
|
- The preload leaves `HOME` unchanged and clears inherited `CLAUDE_CONFIG_DIR` and `CODEX_HOME`; tests that need fixture selectors set them after preload. A test that spawns `ahub setup`, `ahub autonomy` or `ahub init` under machine defaults, or reaches `discoverClaudeHomes` or the profile hook, sets `HOME`, `CLAUDE_CONFIG_DIR`, `AGENTHUB_HOME` and `AMEM_HOME` to temp directories, as `test/autonomy-machine-cli.test.ts` does; unit tests pass `{ home, env }` instead of `process.env`. A test that runs `ahub doctor` through the CLI also sets `CODEX_HOME` to a temp directory and puts a fake `amem` first on PATH, because doctor runs `amem setup <tool> --json` (#1025, `test/doctor-memory-capture.test.ts`).
|
|
52
52
|
- Raising the `@staix/agent-mem` exact pin moves its version literal in `test/memory.test.ts`, `test/memory-profile.test.ts`, `test/memory-profile-daemon.test.ts` and `test/doctor-model-aliases.test.ts` in the same PR. Any other test edit in a pin raise adapts a fixture to a changed package contract (an index file name, a transport read before screening) with a comment naming the package version; never weaken an assertion to pass a raise. A test that names a package file reads the name from what the store creates (`indexFileOf` in `test/memory-store.test.ts`), never a fixed `index.db`.
|
|
53
|
-
- `test/fixtures/release-n-1` and `test/fixtures/protocol-v16` are separately exact-locked published packages (own `bun.lock`, installed by `scripts/check.sh`), never root dependencies, and `PUBLISHED_FIXTURES` in `test/published-protocol-compat.test.ts` pins their versions.
|
|
53
|
+
- `test/fixtures/release-n-1` and `test/fixtures/protocol-v16` are separately exact-locked published packages (own `bun.lock`, installed by `scripts/check.sh`), never root dependencies, and `PUBLISHED_FIXTURES` in `test/published-protocol-compat.test.ts` pins their versions and compatibility metadata. In a minor release PR, retarget release N-1 to the latest stable patch of the preceding minor together with the version bump; update its package manifest, lockfile and `PUBLISHED_FIXTURES` row, including the exact amem dependency and protocol read from the published package (AGENTS.md Releasing step 1, procedure in `docs/operations.md` #1164). The guard requires the fixture minor to be the package minor minus one. protocol-v16 stays at its version while protocol 16 is promised (#1168).
|
|
54
54
|
- Keep CI's Bun version sourced from `.bun-version` through the pinned setup-bun action; update the version file rather than adding per-job version literals.
|
|
55
55
|
- Release verification requires both OS checks and the aggregate `seeded guards` success for an identical tree, a tag matching `package.json` on `origin/main`, and fresh ancestor-bound documentation stamps. Preserve the separate npm OIDC publish job and GitHub Release write job; neither job gets the other's credential authority.
|
|
56
56
|
- `test/conformance/` runs real adapters against fake transports. The shared kit and the transport fakes live in `src/adapters/conformance/` (public `@staix/agent-hub/conformance`); `test/conformance/kit.ts` and the matching `test/fakes/*.ts` only re-export them, so change the packaged file, and `--changed` runs everything for it; `test/conformance/enrollment.ts` enrolls every `ADAPTERS` definition, each `:reviewer` variant and each `:implementer` (`headlessVariant`) variant. Record a case that does not apply in its `UNSUPPORTED` or `UNSUPPORTED_LEGS` map with a concrete reason naming the dedicated coverage, never `test.skip` or synthetic success, and never change native production behavior to satisfy a generic case.
|
|
57
57
|
|
|
58
|
-
- Keep the CI admission lock around the whole controller workflow, not just its decision job, in its per-PR (`check-pr-<number>`, `queue: single
|
|
58
|
+
- Keep the CI admission lock around the whole controller workflow, not just its decision job, in its per-PR (`check-pr-<number>`, `queue: single`, `cancel-in-progress` true: a newer head replaces the older run, pending or in progress, #1490) or main (`check-main`, `queue: max`, never cancelled) group, never with `cancel-in-progress: true` beside `queue: max` (GitHub refuses it) (#609); a cancelled run or a fresh draft-deferred run is never a successful full gate (the draft's macOS aggregate fails when the gate runs, and `successfulFullGate` needs all three required jobs `success`). Two groups admitting one tree at once is an accepted duplicate run, never a reason to fail closed on another tree. Preserve successful identical-tree full proof and required job names; a skipped job, pending controller or unavailable active inventory is never a successful full gate. In `readFullGateAdmission`, lost successful proof (404, malformed proof, a per-read timeout) only means a fresh gate runs; unknown active coverage and the global read ceilings (`GateReadLimitError`) stay unknown and refuse. A GitHub 429 or 5xx on one read is retried at most twice after a short backoff (#872), only while the shared deadline leaves room for the backoff, and every retry counts against the 240-read budget; never extend retries to any other status, a timeout or malformed data. CI checks out the PR head (`pull_request.head.sha`), not a merge with main: after a fix lands on main, merge main into the branch before reading CI as proof. CI reuse tests use fixed metadata fixtures and never dispatch real duplicate workflows.
|
|
59
59
|
|
|
60
60
|
- Headless-reviewer tests run `test/fakes/fake-claude-print.ts` and headless Claude implementer tests run `test/fakes/fake-claude-implementer.ts` through `command` or a PATH stand-in (the implementer with `HOME` and `CLAUDE_CONFIG_DIR` in a temp dir), and fresh Codex reviewer tests run `test/fakes/fake-codex-reviewer.ts` through `codex_bin`; a test that reaches the daemon's reviewer or implementer start must never run the real `claude` or `codex`. The fake's sandbox markers test host admission only, never native isolation. Fresh Kimi reviewer tests set and restore `KIMI_CODE_HOME` to a fixture native home (the backend links that home's `credentials/`, `oauth/` and `device_id`, else the person's `~/.kimi-code`) and run `test/fakes/fake-kimi-reviewer.ts` through `command` or a PATH stand-in, never the real `kimi`. Qwen TUI tests run `test/fakes/qwen-dual.ts` (scripted by submit text) as the launched Qwen or the daemon's `qwen_cmd` (an adapter unit test also passes its own `table`), never the real `qwen`. agy tests put a fake `agy` first on PATH and set `HOME` to a temp dir before any transcript readback (`readAgyTranscript` reads `$HOME/.gemini`). Code-facts tests build `new CodeFacts({ env })` with a PATH whose first `ripwire` is a wrapper around `test/fakes/fake-ripwire.ts` (`FAKE_RIPWIRE_MODE` selects its failures) or an inline fake installed with `installFakeRipwire` (`test/helpers/ripwire-probe.ts`, #1197), or inject Tasks' `prepareReviewBrief`; never rely on an installed ripwire, which CI does not have. `installFakeRipwire` runs the shim once outside the measured region, and `withProbe` and the probe's `watch` append where each call spent its time when a test fails; read that before calling a fake-ripwire failure a flake, and never widen the 5 s per-call cap or the 20 s timeout for it.
|
|
61
61
|
- Turn-model and reviewer-quota fixtures use the existing fakes' opt-in knobs, never a new fake or a real agent (#1402, #1440, #1446): `FAKE_CLAUDE_MODEL_USAGE` adds a result row's `modelUsage` to `fake-claude-print.ts` and `fake-claude-implementer.ts`, `--model-id <id>` (with `--model-shape config` for the `configOptions` form) makes the ACP and Pi fakes report a session model, a `REROUTE:<model>` prompt makes the Codex app-server fake emit `model/rerouted`, its `rateLimitsRead` argument scripts `account/rateLimits/read`, and `FAKE_CODEX_REVIEW_QUOTA=1` makes `fake-codex-reviewer.ts` refuse its review turn with a usage-limit error. The Kimi reviewer fakes write a native 1.5 usage wire under the fixture home, never a quota frame.
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
"string": "non-empty string",
|
|
9
9
|
"absolute-path": "string starting with /",
|
|
10
10
|
"count": "non-negative safe integer",
|
|
11
|
+
"nullable-fraction": "null or a finite number from 0 to 1 inclusive",
|
|
11
12
|
"count-map": "object whose keys are in values and whose values are counts",
|
|
12
13
|
"enum": "string in values",
|
|
13
14
|
"true": "the boolean true",
|
|
@@ -34,6 +35,9 @@
|
|
|
34
35
|
"peers": { "type": "object", "presence": "always" },
|
|
35
36
|
"peers.<id>.state": { "type": "enum", "presence": "always", "values": ["idle", "busy", "paused", "offline"] },
|
|
36
37
|
"peers.<id>.queued": { "type": "count", "presence": "always" },
|
|
38
|
+
"peers.<id>.context": { "type": "object", "presence": "when a context reading is available; absent otherwise" },
|
|
39
|
+
"peers.<id>.context.used": { "type": "nullable-fraction", "presence": "with peers.<id>.context" },
|
|
40
|
+
"peers.<id>.context.freshness": { "type": "enum", "presence": "with peers.<id>.context", "values": ["fresh", "stale", "unknown"] },
|
|
37
41
|
"peers.<id>.attached": { "type": "false", "presence": "when the peer has no adapter attached; absent otherwise" },
|
|
38
42
|
"peers.<id>.needsReview": { "type": "count", "presence": "when nonzero; absent when zero" },
|
|
39
43
|
"peers.<id>.pullOnly": { "type": "true", "presence": "when the peer reads messages only through hub_inbox; absent otherwise" },
|
package/docs/design/adapters.md
CHANGED
|
@@ -360,6 +360,97 @@ External adapter modules are an explicit, person-owned, machine-local opt-in. Th
|
|
|
360
360
|
|
|
361
361
|
Kimi 2.5.2's own TUI also earns completions, but only through the `ahub kimi` launcher's ephemeral `native_hook_launch` and local plugin (#1282). The plugin record binds the launch to its owner pid and process signature. A different launch may replace it only when that owner is proven gone; an active or unknown owner, including one from another project sharing the native home, is left unchanged. Replacement and cleanup share one fail-closed lock per native home, with no automatic stale-lock deletion. If begin or setup fails, the launcher reports the cause and starts the plain TUI without completion receipts. Quiet background/final-turn re-reads back off from 250 ms to 1 s, and the 2 s Stop deadline also arms them. A hook is a candidate observation, never proof. The daemon admits only the exact `kimi-tui` compat version and binds the observation to daemon, launch, native home, native session, project and current socket generation. The transcript's `turn.prompt` supplies the origin and turn id; its final `turn.ended` supplies the outcome. `prompt.completed` and `prompt.aborted`, when present, must agree with that turn; a notification may omit both id forms, so the native notification id or turn id is the fallback identity. A blocked Stop has no final row, so it cannot settle. StopFailure needs `failed`, Interrupt stays quiet with no result, and launcher loss or daemon reconstruction creates at most one `interrupted`. Every native-person result is private because the hook path cannot prove it is public. Headless ACP keeps `prompt-response`; an unverified TUI version or a launch without these readbacks keeps the old no-completion behavior. Native background task files supply the count or an explicit unknown; work or an unreadable inventory never settles. A 250 ms re-read covers missing TaskStarted/Notification hooks without turning elapsed time into evidence. No prompt, answer, error, task command or title reaches completion rows, events, logs or memory. The exact-version receipt is `docs/verification/2026-11-08-kimi-tui-completion-1282.md`.
|
|
362
362
|
|
|
363
|
+
## Pi accepted-worktree dependencies (#1447 T5)
|
|
364
|
+
|
|
365
|
+
The localhost listener leg is a no-go under the two tested Seatbelt rules: neither
|
|
366
|
+
proved a usable listener restricted to loopback peers. Pi's network profile and
|
|
367
|
+
proxy environment remain unchanged. Listener tests are not claimed as Pi-local
|
|
368
|
+
focused checks. The opt-in `hub_check_start` runner can run permitted tests in
|
|
369
|
+
an isolated Linux container; that receipt is Linux evidence, not a macOS Pi
|
|
370
|
+
sandbox proof. The native observations and limits are recorded in
|
|
371
|
+
`docs/verification/2026-11-16-pi-loopback-1447.md`. Full verification stays with
|
|
372
|
+
CI and the remote runner.
|
|
373
|
+
|
|
374
|
+
Dependency preparation completes before the accept/self-claim reply and first
|
|
375
|
+
accepted-worktree use. The earlier assignment turn is metadata-only. Existing
|
|
376
|
+
acceptance admission runs before preparation, and ownership, acceptance identity,
|
|
377
|
+
session authority and privacy are rechecked after the await. Failure leaves the
|
|
378
|
+
task accepted and returns fixed not-prepared guidance in the accept result and
|
|
379
|
+
the next Pi prompt, never installer stdout or stderr.
|
|
380
|
+
|
|
381
|
+
The host snapshots install inputs from the worktree's recorded reviewed base
|
|
382
|
+
commit, not its writable files. Changed task inputs, missing lockfiles, malformed
|
|
383
|
+
manifests, install lifecycle hooks, declared trusted dependencies and installer
|
|
384
|
+
preload/script configuration refuse preparation. Test-only Bun preload is not an
|
|
385
|
+
installer preload. The fixed command is `bun install --frozen-lockfile`, using an
|
|
386
|
+
isolated HOME, explicit shared Bun cache and a bounded deadline. It runs in a
|
|
387
|
+
private host-state snapshot, then publishes root `node_modules` by same-volume
|
|
388
|
+
rename only to an absent target. Existing directories/symlinks, unsupported
|
|
389
|
+
workspace layouts and cross-device publication refuse; no module-tree copy or
|
|
390
|
+
script-skipping fallback is used. Temporary inputs are removed on every outcome.
|
|
391
|
+
Before publication a bounded, non-following walk rejects regular dependency files
|
|
392
|
+
with multiple hardlinks, so a peer cannot write through into the shared cache.
|
|
393
|
+
A hardlink-producing backend remains unprepared; it is never rewritten or copied
|
|
394
|
+
to bypass that refusal.
|
|
395
|
+
|
|
396
|
+
## Pi task-move ordering (#1447 T4)
|
|
397
|
+
|
|
398
|
+
A late important task notice published during Bus condensation joins the next
|
|
399
|
+
host turn before chat. Host turn start is the adapter's busy transition. Pi's
|
|
400
|
+
later asynchronous model preflight can still precede native prompt insertion;
|
|
401
|
+
workflow notices arriving in that window remain queued for the following host
|
|
402
|
+
turn. Closing it requires an explicit prepare/commit or deferred-fold protocol
|
|
403
|
+
with current privacy and durable ACK semantics. Its duration is not measured;
|
|
404
|
+
fake barriers establish only the interleaving. Former-owner done/checkpoint
|
|
405
|
+
refusals remain effective there.
|
|
406
|
+
|
|
407
|
+
## Pi ceiling settlement and continuation evidence (#1447)
|
|
408
|
+
|
|
409
|
+
Pi's per-turn managed tool-step default is 100 (#1447 T3), including in this
|
|
410
|
+
repository's tracked config, init template, omitted-option launcher and unset-env extension fallbacks.
|
|
411
|
+
An existing project's explicit 30 remains an override until the person edits it.
|
|
412
|
+
A configured ceiling still rejects the next
|
|
413
|
+
attempt before its tool effect. Local-worker step defaults are unchanged.
|
|
414
|
+
|
|
415
|
+
The extension's structured tool-step ceiling is evidence only for its current
|
|
416
|
+
native session and turn generation. The adapter retains the first valid signal
|
|
417
|
+
and latches whether any managed tool was unsettled when it arrived. A later
|
|
418
|
+
`agent_settled` with an error completes the delivery with
|
|
419
|
+
`ceiling steps <count>/<limit>` only when neither that latch nor a current tool,
|
|
420
|
+
cancellation, stop/recovery, roster/personal withdrawal, approval stop or shared
|
|
421
|
+
execution-budget stop makes settlement uncertain. The failure callback retains
|
|
422
|
+
the ceiling and reports `settledCeiling: true` for this case. It is a limit,
|
|
423
|
+
not success. The host may then offer its separately bounded continuation; the
|
|
424
|
+
adapter never replays an existing delivery or changes a previously held row.
|
|
425
|
+
Unsafe ceiling and ordinary error deliveries remain `needs_review`.
|
|
426
|
+
|
|
427
|
+
The host grants `pi.max_continuations` extra turns after the first safe ceiling
|
|
428
|
+
stop (default 2, range 0..10, sampled at peer start). The stop after the last
|
|
429
|
+
continuation escalates with task move reason `step_limit`, the same `ceiling`
|
|
430
|
+
class, steps and continuations used. Model/transport failures retain
|
|
431
|
+
`inference_failed` with class `model_error`. Continuation state is scoped to the
|
|
432
|
+
current accepted owner binding and native session and resets on a turn without
|
|
433
|
+
a ceiling stop, task movement or session replacement. Every per-task effect
|
|
434
|
+
rechecks ownership, privacy, stop/recovery and turn identity after awaited work.
|
|
435
|
+
Private or uncertain turns never continue. The new prompt requests a checkpoint
|
|
436
|
+
and inspection of prior effects without replaying uncertain writes. Logs emit
|
|
437
|
+
one failure class per turn; public diagnostics are screened before clipping and
|
|
438
|
+
PII/private turns carry only the class.
|
|
439
|
+
|
|
440
|
+
Observation-only `onTurnAborted` reports explicit stop/recovery, withdrawal or
|
|
441
|
+
cancelled settlement once per active logical turn. These paths do not invoke
|
|
442
|
+
failure handoff. Internal model-error teardown retains its failure class and
|
|
443
|
+
suppresses a second aborted observation. Internal failure teardown and unexpected
|
|
444
|
+
session shutdown may hand a model/transport failure back after going offline,
|
|
445
|
+
while tool admission remains fenced. A later explicit stop revokes that handoff
|
|
446
|
+
synchronously and dominates later failure/shutdown signals. Only an actual nonerror, noncancelled
|
|
447
|
+
settlement calls `onTurnSuccess`, allowing the host to reset continuation state.
|
|
448
|
+
Numbered terminal events for a settled generation cannot be observed again or
|
|
449
|
+
settle a newly delivered prompt before its next native start. Legacy unnumbered
|
|
450
|
+
failure observations also remain once per logical turn.
|
|
451
|
+
These source/fake receipt checks do not establish the person-run live acceptance
|
|
452
|
+
leg in #1447.
|
|
453
|
+
|
|
363
454
|
## Session title slots
|
|
364
455
|
|
|
365
456
|
Only fixed Pi and local definitions opt into `title: "hub"` (#1055). Their
|
|
@@ -29,6 +29,8 @@ tags: [agent-hub, dogfood]
|
|
|
29
29
|
|
|
30
30
|
# Agent Hub Architecture
|
|
31
31
|
|
|
32
|
+
The [roadmap module](roadmap.md) owns additive milestone/link records and computed public progress through Tasks. Its R1 tools and CLI reuse source-issue identity, cached issue metadata, spec freshness and release trains; they add no GitHub writes, model calls or UI and keep private membership count-only.
|
|
33
|
+
|
|
32
34
|
The [design ledger](../specs/2026-09-19-agent-hub-design.md) records history; current operational rules live in the [AGENTS.md area notes](../../AGENTS.md#area-notes), including the [task](../agent-notes/tasks.md), [bus](../agent-notes/bus.md), [adapter](../agent-notes/adapters.md), [daemon](../agent-notes/daemon.md), [model](../agent-notes/models.md), and [local-worker](../agent-notes/local-worker.md) notes.
|
|
33
35
|
|
|
34
36
|
## Runtime and peer boundary
|
|
@@ -45,6 +47,17 @@ Authority is role-scoped: the person retains decisions requiring judgment or con
|
|
|
45
47
|
|
|
46
48
|
Native tools keep their vendor permission and execution boundaries. The local worker applies path and permission checks to its tools, and runs command execution through a host-supported sandbox; the hub does not sandbox vendor-native tools or claim all ACP commands are isolated. This avoids confusing a hub permission mode with execution confinement ([#39](https://github.com/STAIxBWLB/agent-hub/issues/39), [#270](https://github.com/STAIxBWLB/agent-hub/issues/270)).
|
|
47
49
|
|
|
50
|
+
Pi dependency preparation (#1447 T5) leaves its network profile unchanged. The
|
|
51
|
+
tested localhost listener rules are a no-go without a working listener and
|
|
52
|
+
non-loopback denial proof (see `docs/verification/2026-11-16-pi-loopback-1447.md`).
|
|
53
|
+
Dependency preparation is a separate bounded host
|
|
54
|
+
operation after task admission: immutable install inputs
|
|
55
|
+
come from the recorded reviewed Git base, install in protected state outside peer
|
|
56
|
+
roots, and publish by same-volume rename through a verified directory identity.
|
|
57
|
+
Mutable task files grant no host-install authority. Fixed preparation failures
|
|
58
|
+
remain advisory and ownership/session/privacy are rechecked before the accepted
|
|
59
|
+
reply; no new peer tool or task-write authority is introduced.
|
|
60
|
+
|
|
48
61
|
Channel takeover keeps the same separation: optional adapter-owned takeover and
|
|
49
62
|
socket-ownership ports hold transport state, while the daemon supplies person
|
|
50
63
|
admission and current roster/launch/generation fences. A live standby has no peer
|
|
@@ -221,3 +234,7 @@ The host-only review package reference is an observer exclusion, not PII authori
|
|
|
221
234
|
Reviewer admission is a pure consumer of canonical account headroom and Budget pause evidence, with default floor 0.8, unknown policy skip and per-child cap 20 minutes. Explicit `review.unknown_quota = "pass"` admits unknown observations while retaining the known floor; admitted unknowns supply no wait evidence. `review.gate = "off"` disables floor/unknown checks and all quota waiting, while actual Budget/manual pauses and existing role/health/family guards remain binding. The hub does not gain a second native quota transport or resume authority. Tasks persists bounded wait identity/deadline in role history, schedules one owned deadline per current review, and consumes existing Budget signals. Only a fully quota-blocked declared pool with known resets and a numeric gate waits; unknown under the default skip policy or other blockers use existing fallback. Kimi accounting uses the existing event journal and usage counter, with acknowledged pre-spawn intent, post-settlement terminal accounting, and conservative UNKNOWN replay for unmatched/damaged history. It adds no account/private-profile store.
|
|
222
235
|
|
|
223
236
|
An admitted quota observation writes the canonical account pause independently of task reroute. A host opaque attempt hold delays Budget handoff until owned group/watch settlement; task reroute remains generation-fenced. Controlled recovery conditionally requires `reviewer_quota` and includes safe accounting counts, replay completeness and ordered journal digest in the existing integrity snapshot, checked before target usage replay. Explicit `review.unknown_quota` (including skip) or gate off requires the existing `reviewer_quota` capability; legacy empty state without explicit policy adds no capability requirement.
|
|
237
|
+
|
|
238
|
+
## Instructed question answers (#1473)
|
|
239
|
+
|
|
240
|
+
QuestionStore retains the single terminal transition and answer validation; QuestionDesk owns waiting replies and late envelopes. Alongside unchanged person surfaces, the daemon admits one open-set answer from the unique configured conductor only on a per-set cooperative claim of direct person instruction in its own session, following release consent (#1328). The asking peer cannot self-answer; private question/caller state, child ownership, live-test/delegated execution, wrong actor and closed-set state remain refusal boundaries. Hub/task/review/file/peer relays supply no authority, and the claim grants no blanket or cross-project delegation. Surface `conductor`, the actor and `instructed: true` provide visible provenance in existing answer views and peer replies; the instruction quote is retained only in `hub.db` and is omitted from every read view, envelope, log, event and capture. The CLI audit exposes instructed provenance without the quote or answer text.
|
package/docs/design/agent-hub.md
CHANGED
|
@@ -25,12 +25,22 @@ The core loop is to propose and assign work, exchange addressed messages while p
|
|
|
25
25
|
|
|
26
26
|
The hub also owns a local worker and optional model calls for its own inference. It does not replace every native agent with that loop, pool subscription credentials, or make native behavior identical across vendors. Native adapters preserve those differences behind explicit contracts ([#625](https://github.com/STAIxBWLB/agent-hub/issues/625), [#553](https://github.com/STAIxBWLB/agent-hub/issues/553)).
|
|
27
27
|
|
|
28
|
+
Managed Pi step-ceiling stops can continue within a configured allowance before
|
|
29
|
+
escalation, preserving held-delivery uncertainty and distinguishing limits from
|
|
30
|
+
model failures. The receipt and privacy boundaries live in [[adapters]] (#1447
|
|
31
|
+
T1/T2); this adds no sandbox or native-account authority.
|
|
32
|
+
|
|
28
33
|
Bounded local visual attachments let ordinary peers explain public work with a
|
|
29
34
|
diagram, comparison, table or before/after view. The hub stores and screens the
|
|
30
35
|
record while acon renders it; recipients receive a text stub, and the standalone
|
|
31
36
|
dashboard retains a readable source fallback. This adds no renderer, native-agent
|
|
32
37
|
authority or cross-project board to the hub ([#1058](https://github.com/STAIxBWLB/agent-hub/issues/1058)).
|
|
33
38
|
|
|
39
|
+
Board-backed [roadmap milestones](roadmap.md) group issue contracts, specs, tasks
|
|
40
|
+
and delivery trains by outcome. R1 exposes computed public progress through tools
|
|
41
|
+
and the CLI, preserving unknown evidence and count-only private membership
|
|
42
|
+
([#1479](https://github.com/STAIxBWLB/agent-hub/issues/1479)).
|
|
43
|
+
|
|
34
44
|
## Product decisions
|
|
35
45
|
|
|
36
46
|
| Current rule | Reason and deciding issue |
|
package/docs/design/bus.md
CHANGED
|
@@ -66,6 +66,13 @@ The latest pulled input is kept separately from the last pushed delivery. Observ
|
|
|
66
66
|
|
|
67
67
|
Push peers receive bounded batches. Condensation is optional, excludes important, remote, and invocation messages, and keeps `originals` separate from `out` so replies, safe failures, and recovery still refer to what the peer was actually given. On an eligible safe retry, a failed batch falls back to individual envelopes, and a previously failed envelope goes alone so a poison item cannot block its neighbors. These bounds preserve queue progress when summarization or one recipient fails ([#713](https://github.com/STAIxBWLB/agent-hub/issues/713), [#553](https://github.com/STAIxBWLB/agent-hub/issues/553)).
|
|
68
68
|
|
|
69
|
+
An important envelope queued while an ordinary digest is awaiting condensation is
|
|
70
|
+
part of the next take, before the next host turn. When one arrived, the bus
|
|
71
|
+
discards the prepared condensed view before it hands the batch to the adapter
|
|
72
|
+
and reselects the queue; it restores the volatile originals and preface only,
|
|
73
|
+
leaves durable queued rows intact, and records no attempt or receipt for the
|
|
74
|
+
abandoned preparation (#1447 T4).
|
|
75
|
+
|
|
69
76
|
Pull-only peers catch up oldest-first under a byte budget, but the first envelope always goes even when it exceeds that budget so one oversized item cannot starve the queue; push peers use the digest batch limit. Pull records returned envelopes as completed at handout because the tool result is the readback, not a later native receipt. A busy Claude channel can also pull its own messages through `hub_inbox`; that avoids making a long-running turn an unbounded queue lock ([#493](https://github.com/STAIxBWLB/agent-hub/issues/493), [#713](https://github.com/STAIxBWLB/agent-hub/issues/713)).
|
|
70
77
|
|
|
71
78
|
Delivery uncertainty normally holds the original and is never an automatic replay. The narrow exception is a hub-authored presence or workflow notice proven moot by current task evidence; mixed, unknown, or requested-stop rows remain held. This removes stale notices without treating arbitrary peer messages as seen ([#434](https://github.com/STAIxBWLB/agent-hub/issues/434)). Safe pre-acceptance failures may retry within a bounded attempt policy; uncertain results remain `needs_review` until an explicit resolution. A peer may retry only its own eligible row and only once per immutable retry lineage; an invocation uses its own ledger and is not replayed as an ordinary message retry ([#37](https://github.com/STAIxBWLB/agent-hub/issues/37), [#991](https://github.com/STAIxBWLB/agent-hub/issues/991)).
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: cli-output
|
|
3
|
+
type: module
|
|
4
|
+
title: CLI Output Standard v1
|
|
5
|
+
status: draft
|
|
6
|
+
parent: agent-hub-architecture
|
|
7
|
+
references: [agent-hub-architecture]
|
|
8
|
+
covers: [cli-output]
|
|
9
|
+
tags: [agent-hub, cli, contract]
|
|
10
|
+
paths:
|
|
11
|
+
- src/cli/output-standard.ts
|
|
12
|
+
- src/cli/console-state.ts
|
|
13
|
+
- src/cli/output.ts
|
|
14
|
+
- test/cli-output-conformance.test.ts
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
# CLI output standard v1
|
|
18
|
+
|
|
19
|
+
Version 1. This is a contract for the `ahub` family and every CLI under development; a change to it bumps the version. It is committed under the design-spec vocabulary as `type: module` because `ahub specs check` accepts only goal, architecture, module and submodule (issue #1484 asked for `type: contract`; the validator's fixed vocabulary wins, and the `contract` tag marks the intent).
|
|
20
|
+
|
|
21
|
+
## Why
|
|
22
|
+
|
|
23
|
+
`dot` already has an output contract: a `Printer` with a fixed blank-line, indent and stream policy (`internal/cli/printer.go`), a semantic marker alphabet (`internal/ui/markers.go`) and one set of style roles (`internal/ui/prompt.go`). Most other CLIs format output ad hoc. Reading `ahub` 0.39.0 on 2026-11-14:
|
|
24
|
+
|
|
25
|
+
- `ahub status` prints about 85 lines with no section titles. Problems (refused agent versions, failed deliveries, unbound memory) sit between plain facts with the same weight and no marker. Peer detail rows repeat the peer name as a key (` claude form tui`, ` claude flow roles ...`).
|
|
26
|
+
- `ahub doctor` prints `ok` / `fail` / `unknown` as words in a LEVEL column, interleaves fails with oks, and on a piped run one long CHECK cell (a profile path) pushes the FINDING column about 130 characters right. There is no summary line, and it exits `0` with four `fail` rows.
|
|
27
|
+
- `ahub help` fits 80 columns but is one long wall: each command form carries a multi-line description at a 34-column indent.
|
|
28
|
+
- Headings, ids and table headings all share one cyan.
|
|
29
|
+
- `ahub task show <missing id>` prints `No task #N` to stdout and exits `0`.
|
|
30
|
+
|
|
31
|
+
What `ahub` already does right and keeps: `--color=auto|always|never`, `NO_COLOR` and `TERM=dumb` (`resolveColor`), terminal-text sanitizing, width-aware wrapping, `--json` on most read commands.
|
|
32
|
+
|
|
33
|
+
Normative parts of this standard: streams and exit codes, color policy, roles, markers, layout grammar, messages and help. Progress and the per-language notes are guidance.
|
|
34
|
+
|
|
35
|
+
## Principles
|
|
36
|
+
|
|
37
|
+
1. Meaning never rides on color alone. Every state has a glyph and a word; color only reinforces them. Output reads correctly with `NO_COLOR=1`, in grayscale and to a screen reader.
|
|
38
|
+
2. Problems first. Anything that needs action is shown before facts, marked, counted, and paired with the exact next command.
|
|
39
|
+
3. One grammar. Header, section, key/value row, bullet row and table look the same in every command and every CLI.
|
|
40
|
+
4. Calm by default. The default view answers "is it OK, and what do I do next". Detail moves behind `--verbose` or a subcommand.
|
|
41
|
+
5. Humans on the terminal, machines on `--json`. Human output may change between versions; `--json` is the stable interface.
|
|
42
|
+
|
|
43
|
+
## Streams and exit codes
|
|
44
|
+
|
|
45
|
+
- stdout: the result the person asked for, including a report's findings, its Attention section and its summary line, and `--json`.
|
|
46
|
+
- stderr: diagnostics about this invocation (errors, warnings about how the command ran, progress). Library or debug logs (for example Go `slog` INFO lines) never reach the terminal by default; they need `--verbose` or a log-level setting.
|
|
47
|
+
- Exit codes: `0` success; `1` the operation failed, a lookup found nothing, or a check found a failure; `2` usage error (unknown command or flag, bad argument); `75` is reserved for "temporary refusal, retry later" (EX_TEMPFAIL, as `dot remote` uses) and used only where a CLI already has that case.
|
|
48
|
+
- A view command (`status`, `list`, `show`) exits `0` when it could produce its view, even if the view lists problems. A check command (`doctor`, `check`, `lint`) exits `1` when any row is a failure; warnings and unknowns do not change the exit code.
|
|
49
|
+
- `--json` on a report command writes one JSON document to stdout and never contains an ANSI escape. Streaming commands may write JSON lines when documented. Documented bounds (for example "the last 1000 events") are allowed; human-output truncation never applies to `--json`. New timestamp fields use ISO 8601 UTC strings; existing fields keep their format.
|
|
50
|
+
|
|
51
|
+
## Color policy
|
|
52
|
+
|
|
53
|
+
Color is decided per stream (stdout and stderr separately), in this order; the first rule that applies wins:
|
|
54
|
+
|
|
55
|
+
| # | Condition | Color |
|
|
56
|
+
| --- | --- | --- |
|
|
57
|
+
| 1 | `--color=never` / `--color=always` | off / on |
|
|
58
|
+
| 2 | `NO_COLOR` is set and non-empty | off |
|
|
59
|
+
| 3 | `FORCE_COLOR` is set, non-empty and not `0`; or `CLICOLOR_FORCE` is set, non-empty and not `0` | on |
|
|
60
|
+
| 4 | `FORCE_COLOR=0` or `CLICOLOR=0` | off |
|
|
61
|
+
| 5 | the stream is a TTY and `TERM` is not `dumb` | on |
|
|
62
|
+
| 6 | otherwise | off |
|
|
63
|
+
|
|
64
|
+
- Every command that prints accepts `--color=auto|always|never` (`auto` = rules 2 to 6).
|
|
65
|
+
- `--json` output is never colored, whatever the rules say.
|
|
66
|
+
- Normative colors are the 16 ANSI colors in the role table. They follow the terminal's own theme, so they stay readable on light and dark backgrounds. A CLI may ship an optional truecolor theme (dot's Tokyo Night hex values, below) only behind an explicit setting, and only with a light and a dark variant per role that reaches 4.5:1 contrast on its background (3:1 for `hint`), checked by a test.
|
|
67
|
+
- Bold is reserved for the header, section titles and the status roles (`success`, `warning`, `error`). No background colors.
|
|
68
|
+
|
|
69
|
+
## Semantic roles
|
|
70
|
+
|
|
71
|
+
The roles are the API. Code names a role, never a raw color or SGR code.
|
|
72
|
+
|
|
73
|
+
| Role | Use | ANSI (normative) | Bold | dot hex (optional dark theme) |
|
|
74
|
+
| --- | --- | --- | --- | --- |
|
|
75
|
+
| `header` | report title | blue (34) | yes | `#7AA2F7` |
|
|
76
|
+
| `section` | section titles | magenta (35) | yes | `#BB9AF7` |
|
|
77
|
+
| `key` | key/value labels, table headings | blue (34) | no | `#7AA2F7` |
|
|
78
|
+
| `value` | values, emphasized list items | default foreground | no | default foreground |
|
|
79
|
+
| `success` | done, healthy, enabled | green (32) | yes | `#9ECE6A` |
|
|
80
|
+
| `warning` | attention needed, non-fatal | yellow (33) | yes | `#E0AF68` |
|
|
81
|
+
| `error` | failure, refusal, non-zero exit | red (31) | yes | `#F7768E` |
|
|
82
|
+
| `hint` | secondary text, unset, unknown, timestamps | bright black (90) | no | `#565F89` fails 3:1 on dark backgrounds; a theme must lighten it |
|
|
83
|
+
| `accent` | ids, refs, commands to copy | cyan (36) | no | `#7DCFFF` |
|
|
84
|
+
|
|
85
|
+
- `hint` text is never the only place a fact appears that the person needs; bright black is faint on some themes.
|
|
86
|
+
- A CLI may add identity colors for its own entities (ahub's per-peer palette) and underline for links, as long as they never reuse a status role's meaning.
|
|
87
|
+
|
|
88
|
+
## Marker alphabet
|
|
89
|
+
|
|
90
|
+
Glyphs are semantic; each pairs with one role. Code uses named constants, never inline glyph literals. A bullet row always carries the state word or the finding text beside the marker, so meaning survives without color.
|
|
91
|
+
|
|
92
|
+
| Marker | Glyph | ASCII | Role | Meaning |
|
|
93
|
+
| --- | --- | --- | --- | --- |
|
|
94
|
+
| `ok` | `✓` | `ok` | `success` | exists, succeeded, enabled, healthy |
|
|
95
|
+
| `fail` | `✗` | `x` | `error` | hard failure, refused |
|
|
96
|
+
| `warn` | `⚠` | `!` | `warning` | attention needed, non-fatal |
|
|
97
|
+
| `absent` | `-` | `-` | `hint` | missing or disabled, not a failure |
|
|
98
|
+
| `unknown` | `?` | `?` | `hint` | not measured, not reported |
|
|
99
|
+
| `pending` | `~` | `~` | `hint` | queued, not yet applied, diff |
|
|
100
|
+
| `active` | `*` | `*` | `success` | active or default choice |
|
|
101
|
+
| `next` | `→` | `->` | `accent` | the next step to run |
|
|
102
|
+
|
|
103
|
+
- A CLI may add markers for states of its own, each with a role from the table, a glyph not used above and an ASCII form, listed in its own marker constants.
|
|
104
|
+
- ASCII forms are used when the locale is not UTF-8 (`LC_ALL`, then `LC_CTYPE`, then `LANG`) or with `--ascii`.
|
|
105
|
+
- Width: the marker column is always 2 cells wide, padded with spaces (ASCII `ok` and `->` fill it). East Asian Ambiguous characters are measured as 1 cell (`Bun.stringWidth(s, { ambiguousIsNarrow: true })`, `unicode-width` non-CJK), so Korean and CJK terminals keep the same alignment.
|
|
106
|
+
|
|
107
|
+
## Layout grammar
|
|
108
|
+
|
|
109
|
+
- **Header**: one line, ` <tool> <Report>` in `header`, followed on the same line or the next by one line of context in `hint` (version, pid, endpoint, project path). One per report. Never in `--json`.
|
|
110
|
+
- **Section**: one blank line, then `▸ <Name>` (ASCII `> <Name>`) in `section`, optionally followed by a count in `hint`: `▸ Peers (4 of 10 online)`. No blank line after it.
|
|
111
|
+
- **Key/value row**: two-space indent, `Key:` padded to the widest key in that section, two spaces, value. A key wider than 28 cells wraps its value to the next line at a four-space indent. An empty value is `(unset)` in `hint`. Keys are words, never repeated entity names: under a peer heading write `form`, not `claude form`.
|
|
112
|
+
- **Bullet row**: two-space indent, the 2-cell marker, one space, text: ` ⚠ codex-review 0.169.0 refused`. Nested detail uses four spaces; a next step is ` → ahub agents trust codex-review 0.169.0`.
|
|
113
|
+
- **Table**: headings uppercase in `key`, two-space gutter, no borders. One flexible column (the free text) wraps; id, state, count and time columns never wrap. Every non-flexible text column is capped at 32 cells whether or not the output wraps, so one long cell cannot push the others off; a path longer than its cap shortens in the middle (`~/Library/.../home`), other text wraps inside its column. Empty cells are `-` in `hint`; a column that is `-` on every row is dropped.
|
|
114
|
+
- **Summary line** (check commands): the last line of stdout, `✗ 2 failed ⚠ 3 warnings ✓ 18 ok`, zero counts omitted, unknowns counted as `? 2 unknown`.
|
|
115
|
+
- **Blank lines**: exactly one before each section, none after; never two in a row; no trailing blank line.
|
|
116
|
+
- **Width**: on a TTY, wrap to the real terminal width. On a pipe, wrap only when `COLUMNS` is set; column caps still apply. Human output never truncates without `...` and a way to see the full value (`--json`, `--verbose` or a `show` subcommand).
|
|
117
|
+
|
|
118
|
+
## Messages
|
|
119
|
+
|
|
120
|
+
- Error line (stderr): `<tool>: <what failed>: <why>`. When stderr is a TTY it is prefixed with the `fail` marker (`✗ ahub: ...`); piped stderr keeps the plain form, so scripts and agents that match `<tool>: ` keep working.
|
|
121
|
+
- Next step: when the CLI knows the fix, a second line ` → <command or setting>` (ASCII ` -> `), complete and copyable (`cd` prefix and every value filled in), in `accent`. An error raised by a server or daemon that carries no fix prints no `→` line; the CLI never invents one.
|
|
122
|
+
- Warning (stderr): `<tool>: warning: <what>: <why>`, `warn` marker on a TTY, optional `→` line.
|
|
123
|
+
- Success confirmation (stdout): `✓ <what was done>`; omit it when the output already shows the result.
|
|
124
|
+
- Usage error: the message, then `Usage: <tool> <command> <args>` and `Run '<tool> help <command>' for details.`, exit `2`.
|
|
125
|
+
- Plain English sentences, no emoji, no exclamation marks. Relative times in human output (`47d ago`, `in 5d15h`).
|
|
126
|
+
|
|
127
|
+
## Help
|
|
128
|
+
|
|
129
|
+
- `<tool> help`, `-h` and `--help` print to stdout and exit `0`: command groups, each command as ` <name> <one-line summary>` in two aligned columns, within 80 columns.
|
|
130
|
+
- `<tool> help <command>` shows usage, a short description, each flag with one line, and one or two examples. Long explanations live here, not in the overview.
|
|
131
|
+
- `ahub` lays it out as `▸ Usage` (every form), `▸ Description` (the overview summary), `▸ Flags (N)` (one line per flag: the flag with its value shape as the usage writes it, then what it is for), `▸ Examples` (one or two complete commands, only for a command that takes arguments) and `▸ Details`, which is the long text, every form with its whole description, unchanged, so nothing a form or flag says is lost. A section with nothing to show is omitted.
|
|
132
|
+
- A flag's line says what the flag is for, in one short line (at most 46 cells beside its label, so it fits 80 columns; `--json` and `--color` keep the longer text this standard defines). The words sit in `FLAG_DESCRIPTIONS` in `src/cli/help.ts`, next to the usage text, keyed by the flag or by `<command> <flag>` where one command uses a flag for something else (`--all`); a flag a definition outside that file adds falls back to the forms that take it. `test/help.test.ts` fails a flag of any command with no description, a line over the width, or a table entry that names no flag. A flag's meaning that only the long text states stays in `Details`. Every example is checked against the dispatch table and the command's own usage by `test/help.test.ts`, so it cannot name a command, subcommand or flag that does not exist.
|
|
133
|
+
- A native agent's overview summary is the third element of its `cli.usage` entry in its adapter definition, never a table in the help module.
|
|
134
|
+
- Usage lines use `<required>`, `[optional]`, `a|b` and `...`.
|
|
135
|
+
|
|
136
|
+
## Progress (guidance)
|
|
137
|
+
|
|
138
|
+
- Spinners or progress bars only when stderr is a TTY and color is on; never on a pipe, in CI or with `--json`. Without a TTY, print one line when a long step starts and one when it ends, with its duration. No carriage-return redraws in output that may be logged.
|
|
139
|
+
|
|
140
|
+
## Conformance checks (every CLI)
|
|
141
|
+
|
|
142
|
+
1. A golden test of the main report with color off, and one with `--color=always` asserting the roles map to the ANSI codes above.
|
|
143
|
+
2. `NO_COLOR=1` with `--color=auto` emits no ESC byte; `--json` never contains ESC; `FORCE_COLOR=1` on a pipe emits color.
|
|
144
|
+
3. At 80 columns no line exceeds 80 cells and no id or state column wraps.
|
|
145
|
+
4. A failing command exits non-zero with `<tool>: ` on stderr, and a usage error exits `2`.
|
|
146
|
+
5. `LANG=C` prints the ASCII markers.
|
|
147
|
+
|
|
148
|
+
## Per-language notes (guidance)
|
|
149
|
+
|
|
150
|
+
- Go: lipgloss v2 as dot uses it; lipgloss downsamples colors itself, so define roles with ANSI colors and add a theme only per the color policy. Disable its CLICOLOR handling only if it disagrees with the table above.
|
|
151
|
+
- TypeScript / Bun: a small zero-dependency module (role to SGR map, marker table, color resolution, `paint`). `ahub` grows its existing `Tone` / `PALETTE` / `paint` in `src/cli/console-state.ts` instead of adding a dependency.
|
|
152
|
+
- Rust: `anstyle` + `anstream`, and clap's `styles()` set to the same roles for help.
|
|
153
|
+
- Python: `rich` or `click.style`, gated by the same policy.
|
|
154
|
+
|
|
155
|
+
## Implementation in ahub
|
|
156
|
+
|
|
157
|
+
`src/cli/output-standard.ts` is the one module that holds the standard's portable executable form. It imports nothing, so a CLI outside the hub (or a shared package for the Bun family) can reuse it as a file move: `Role` and `ROLE_SGR` (the nine roles), `TONE_SGR` (the console tones that are not an identity palette entry), `MARKERS`, `markerCell`, `SECTION_MARKER`, `cellWidth`, `resolveColor` with `streamEnv` (the precedence table, per stream) and `asciiMarkers` (`--ascii` and the non-UTF-8 locale fallback). `src/cli/console-state.ts` keeps `Tone` and `PALETTE` (mapped onto the roles through `TONE_ROLE`; a tone with no entry names an identity color, never a status), re-exports the style names, lets a `Span` carry a `role` (it wins over its `tone`) and holds the `Report` builder for the layout grammar. `test/cli-output-conformance.test.ts` runs the five conformance checks and fails on a raw SGR literal in `src/cli/` and `src/hub/` outside `src/cli/output-standard.ts`, `src/cli/console.ts` (the full-screen console) and the identity palettes (`src/ui/peer-palette.ts`, `src/adapters/definitions/native-display.ts`).
|
|
158
|
+
|
|
159
|
+
## Adoption
|
|
160
|
+
|
|
161
|
+
This issue holds the canonical v1 text. The first `ahub` PR commits it as `docs/design/cli-output.md` (design spec frontmatter, `type: contract`); later changes amend that file with a version bump. Each other repository gets its own issue that links here and lists its gaps; it is done when the five conformance checks pass. dot's style is the reference for the look, and dot gets its own conformance issue like every other CLI.
|
|
162
|
+
|
|
163
|
+
## Acceptance criteria (this repository)
|
|
164
|
+
|
|
165
|
+
- AC1: `docs/design/cli-output.md` holds this standard. `src/cli/console-state.ts` exposes the nine roles and the marker table; `Tone` stays as the TUI's vocabulary through a mapping onto roles. A test fails on raw SGR literals in `src/cli/` and `src/hub/` human-output code outside `console-state.ts`, with an allowlist for the identity palettes (`src/ui/peer-palette.ts`, `src/adapters/definitions/native-display.ts`) and the full-screen console (`src/cli/console.ts`).
|
|
166
|
+
- AC2: `ahub status` default view: header, then an `Attention` section listing every item that needs action as marker + text + `→` next step, then sections for the hub, peers and tasks, with plain keys in peer detail. The current full detail stays available behind `--verbose`. `--json` unchanged; exit code unchanged (`0`).
|
|
167
|
+
- AC3: `ahub doctor`: marker + check + finding rows, failures then warnings then unknowns then oks within each section, capped CHECK width, a summary line. Behavior change, named in the CHANGELOG: `doctor` exits `1` when any row is `fail` (it exits `0` today). `ahub setup` keeps its own exit behavior (it calls the doctor function, not the process exit). `--json` unchanged.
|
|
168
|
+
- AC4: `ahub help` overview uses one-line summaries; the long text moves to `ahub help <command>`. Every command, subcommand and flag still appears, and the help-vs-`main.ts` check keeps passing.
|
|
169
|
+
- AC5: the shared `fail()` helper in `src/cli/main.ts` prints the error line format (marker only on a TTY, plain `ahub: ` on a pipe) and accepts an optional next step. Behavior changes, named in the CHANGELOG and with their tests updated in the same PR: usage errors exit `2` (they exit `1` today, for example `test/identity-cli.test.ts` and `test/structural-config-cli-process.test.ts`), and `ahub task show <missing id>` prints to stderr and exits `1`. Call sites gain a next step only where the fix is known; daemon refusal text is passed through unchanged.
|
|
170
|
+
- AC6: the five conformance checks run in `bun test`.
|
|
171
|
+
|
|
172
|
+
## Tasks
|
|
173
|
+
|
|
174
|
+
- T1: spec doc, roles, markers, color resolution (the precedence table, per stream, `--ascii`), conformance tests (AC1, AC6). Before moving any line in `src/cli/console-state.ts` or `src/cli/output.ts`, search `scripts/seeds.json`: 13 seeds anchor in `console-state.ts` and 5 in `output.ts`.
|
|
175
|
+
- T2: `ahub doctor` (AC3) and the `fail()` format and exit codes (AC5).
|
|
176
|
+
- T3: `ahub status` (AC2); the `planner-normal-status-wip` seed anchors in the status code this rewrites.
|
|
177
|
+
- T4: `ahub help` (AC4).
|
|
178
|
+
|
|
179
|
+
## Out of scope
|
|
180
|
+
|
|
181
|
+
- The full-screen `ahub console` TUI and the web dashboard (they adopt the roles when touched).
|
|
182
|
+
- Any `--json` schema change.
|
|
183
|
+
|
|
@@ -44,7 +44,7 @@ It names evidence; it does not attest to it or grant access to it.
|
|
|
44
44
|
| Field | Rule |
|
|
45
45
|
| --- | --- |
|
|
46
46
|
| `v` | Exactly the integer 1 |
|
|
47
|
-
| `tool` | Known producer id: `ahub`, `ares`, `amem`, `vmem` |
|
|
47
|
+
| `tool` | Known producer id: `ahub`, `ares`, `amem`, `vmem`, `atex` |
|
|
48
48
|
| `projectKey` | Opaque producer project identity, nonempty, at most 256 UTF-8 bytes |
|
|
49
49
|
| `kind` | Producer-namespaced by `(tool, kind)`, lowercase token matching `[a-z][a-z0-9._-]*`, at most 64 bytes |
|
|
50
50
|
| `id` | Opaque source identity, nonempty, at most 256 UTF-8 bytes |
|
|
@@ -60,6 +60,11 @@ Consumers validate this boundary locally without importing hub internals or a ne
|
|
|
60
60
|
shared runtime dependency. Neutral valid/invalid JSON vectors live in
|
|
61
61
|
`test/fixtures/execution-reference-v1.json`; UTF-8 limits include multibyte cases.
|
|
62
62
|
|
|
63
|
+
An `atex` build reference uses `kind: "build"`, its opaque receipt id and an
|
|
64
|
+
optional output PDF `sha256` under the general address contract. It is declared
|
|
65
|
+
metadata: the hub never calls atex or verifies the build. A writing project's
|
|
66
|
+
configured class check may separately run `atex check --json`.
|
|
67
|
+
|
|
63
68
|
A path-like or URL-like id is still opaque data. Never open, execute, fetch,
|
|
64
69
|
route to another node or interpret credentials from any address field. A resolver
|
|
65
70
|
must separately select a known source owner and its authorized project; no
|