@staix/agent-hub 0.38.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 +84 -0
- package/README.md +28 -12
- package/docs/adding-an-ai-tool.md +7 -5
- package/docs/agent-notes/README.md +23 -0
- package/docs/agent-notes/adapters.md +9 -5
- package/docs/agent-notes/benchmarks.md +2 -0
- package/docs/agent-notes/budget.md +9 -0
- package/docs/agent-notes/bus.md +1 -0
- package/docs/agent-notes/daemon.md +21 -9
- package/docs/agent-notes/local-worker.md +4 -2
- package/docs/agent-notes/security-review.md +56 -0
- package/docs/agent-notes/tasks.md +22 -6
- package/docs/agent-notes/tests.md +10 -9
- package/docs/contracts/companion-cli-v1.json +4 -0
- package/docs/design/adapters.md +142 -0
- package/docs/design/agent-hub-architecture.md +46 -1
- 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 +185 -5
- package/docs/dogfood.md +30 -9
- package/docs/events.md +7 -7
- package/docs/memory.md +5 -5
- package/docs/operations.md +315 -54
- package/docs/profiles.md +101 -8
- package/docs/quickstart.md +47 -6
- package/docs/research.md +6 -3
- package/docs/roles.md +52 -0
- package/docs/sdlc.md +190 -2
- package/docs/security.md +90 -15
- package/docs/text-projection.md +1 -0
- package/docs/verification/2026-11-13-claude-implementer-2.1.323.md +59 -0
- package/docs/verification/2026-11-13-codex-01672-reviewer-isolation.md +69 -0
- package/docs/verification/2026-11-14-0.39.0.md +51 -0
- 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 +48 -25
- package/package.json +4 -4
- package/plugins/agent-hub/.claude-plugin/plugin.json +1 -1
- package/plugins/agent-hub/kimi-hook.js +2266 -530
- package/plugins/agent-hub/kimi-review-policy-worker.js +16 -11
- package/plugins/agent-hub/server.js +2423 -645
- package/src/adapters/acp-model-policy.ts +1 -1
- package/src/adapters/acp-session-model.ts +35 -0
- package/src/adapters/acp.ts +14 -0
- package/src/adapters/agy/definition.ts +2 -2
- package/src/adapters/agy/hooks.ts +7 -0
- package/src/adapters/claude-channel.ts +1 -1
- package/src/adapters/claude-implementer.ts +8 -0
- package/src/adapters/claude-print-child.ts +26 -2
- package/src/adapters/claude-print.ts +4 -0
- package/src/adapters/codex-appserver.ts +90 -16
- package/src/adapters/codex-review-isolation.ts +63 -17
- package/src/adapters/compat.ts +10 -10
- package/src/adapters/conformance/fakes/acp-server.ts +11 -2
- package/src/adapters/conformance/fakes/app-server.ts +5 -1
- package/src/adapters/conformance/fakes/pi-rpc.ts +1 -1
- package/src/adapters/definitions/builtin-metadata.ts +12 -12
- package/src/adapters/definitions/native-cli-jcode-mcp.ts +18 -3
- package/src/adapters/definitions/native-config-defaults.ts +1 -1
- package/src/adapters/definitions/native-config-policy.ts +1 -1
- package/src/adapters/definitions/native-quota.ts +122 -0
- package/src/adapters/definitions/native-recovery.ts +3 -0
- package/src/adapters/definitions/qwen.ts +2 -2
- package/src/adapters/kimi-review.ts +23 -0
- package/src/adapters/kimi-wire-usage.ts +39 -16
- package/src/adapters/local-worker.ts +9 -4
- package/src/adapters/pi-state-model.ts +12 -0
- package/src/adapters/pi.ts +76 -11
- package/src/adapters/print-result-model.ts +24 -0
- package/src/adapters/registry-types.ts +12 -2
- package/src/adapters/registry.ts +19 -2
- package/src/adapters/reviewer-print.ts +132 -16
- package/src/adapters/role-eligibility.ts +99 -0
- package/src/adapters/same-directory.ts +16 -0
- package/src/cli/agy-mcp.ts +18 -7
- package/src/cli/answer-args.ts +11 -3
- package/src/cli/console-question.ts +1 -1
- package/src/cli/console-state.ts +98 -11
- package/src/cli/console.ts +6 -2
- package/src/cli/error-format.ts +19 -0
- package/src/cli/free-text.ts +20 -0
- package/src/cli/handoff-args.ts +1 -1
- package/src/cli/help.ts +350 -30
- package/src/cli/identity-audit.ts +8 -7
- package/src/cli/identity.ts +27 -4
- package/src/cli/init-prompt.ts +31 -2
- package/src/cli/init-roles.ts +156 -0
- package/src/cli/init-settings.ts +24 -2
- package/src/cli/init.ts +232 -17
- package/src/cli/main.js +2 -2
- package/src/cli/main.ts +250 -69
- package/src/cli/model.ts +1 -1
- package/src/cli/output-standard.ts +56 -0
- package/src/cli/output.ts +199 -9
- package/src/cli/preview.ts +1 -1
- package/src/cli/recovery-launch.ts +114 -0
- package/src/cli/recovery-package.ts +14 -7
- package/src/cli/recovery-version-preflight.ts +104 -0
- package/src/cli/roadmap.ts +215 -0
- package/src/cli/role-doctor.ts +39 -0
- package/src/cli/sdlc-output.ts +66 -1
- package/src/cli/smoke-pty-bridge.ts +7 -24
- package/src/cli/study-output.ts +54 -0
- package/src/cli/study.ts +14 -1
- package/src/cli/task-output.ts +3 -1
- package/src/cli/terminal-recovery.ts +14 -0
- package/src/cli/upgrade-presentation-flags.ts +2 -2
- package/src/cli/upgrade-presentation.ts +4 -0
- package/src/cli/upgrade-restore-state.ts +12 -3
- package/src/cli/upgrade-runtime.ts +40 -2
- package/src/cli/upgrade.ts +8 -4
- package/src/hub/advisor-survey.ts +139 -0
- package/src/hub/audit-source.ts +66 -0
- package/src/hub/board.ts +677 -15
- package/src/hub/budget.ts +54 -4
- 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/conductor.ts +14 -8
- package/src/hub/config-apply.ts +2 -1
- package/src/hub/config-edit-host.ts +77 -5
- package/src/hub/considered-findings.ts +47 -0
- package/src/hub/control-client.ts +1 -1
- package/src/hub/daemon.ts +585 -98
- package/src/hub/deliverable-files.ts +17 -1
- package/src/hub/dogfood-profile.ts +3 -2
- package/src/hub/events.ts +25 -4
- package/src/hub/execution-reference.ts +1 -1
- package/src/hub/folder-trigger.ts +11 -4
- package/src/hub/github-import.ts +81 -0
- package/src/hub/hub-tools.ts +117 -20
- package/src/hub/install-policy.ts +23 -0
- package/src/hub/kimi-usage.ts +34 -2
- package/src/hub/lifecycle-schema.ts +3 -3
- package/src/hub/memory-profile.ts +9 -1
- package/src/hub/memory-sync-state.ts +1 -0
- package/src/hub/model-overrides.ts +2 -1
- package/src/hub/no-writes.ts +5 -0
- package/src/hub/operational-authority.ts +8 -1
- package/src/hub/operational-view.ts +6 -2
- package/src/hub/peers.ts +2 -0
- package/src/hub/pi-failure.ts +7 -0
- package/src/hub/plan-conformance.ts +20 -2
- package/src/hub/question-desk.ts +26 -7
- package/src/hub/questions.ts +33 -5
- package/src/hub/quota-account.ts +34 -0
- package/src/hub/recovery-policy.ts +18 -4
- package/src/hub/research-evidence.ts +51 -3
- package/src/hub/research.ts +77 -13
- package/src/hub/restart.ts +21 -0
- package/src/hub/review-budget.ts +88 -0
- package/src/hub/review-findings.ts +93 -12
- package/src/hub/reviewer-pool-config.ts +6 -2
- package/src/hub/reviewer-pool.ts +39 -6
- 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/routing.ts +7 -3
- package/src/hub/sdlc-merge.ts +6 -5
- package/src/hub/sdlc-queue.ts +17 -7
- package/src/hub/sdlc-release.ts +1 -1
- package/src/hub/sdlc.ts +47 -8
- package/src/hub/security-audit.ts +178 -0
- package/src/hub/security-pass.ts +115 -0
- package/src/hub/settings.ts +11 -5
- package/src/hub/source-read.ts +80 -2
- package/src/hub/sources.ts +57 -9
- package/src/hub/specs-task.ts +7 -0
- package/src/hub/startup-event-seeds.ts +5 -3
- package/src/hub/startup-timing.ts +1 -0
- package/src/hub/synthesis-readiness.ts +279 -0
- package/src/hub/task-sweep.ts +29 -2
- package/src/hub/task-worktree.ts +37 -0
- package/src/hub/tasks.ts +1464 -76
- package/src/hub/text-projection.ts +11 -1
- package/src/memory/capture.ts +2 -1
- 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 +56 -13
- package/src/ui/office-model.ts +11 -3
- package/src/ui/office-space.ts +50 -30
- package/src/ui/plugin-questions.ts +5 -0
- package/src/ui/plugin.ts +27 -12
- package/templates/config.json +1 -1
|
@@ -5,6 +5,7 @@ title: Agent Hub Architecture
|
|
|
5
5
|
status: draft
|
|
6
6
|
parent: agent-hub
|
|
7
7
|
paths:
|
|
8
|
+
- src/hub/startup-event-seeds.ts
|
|
8
9
|
- src/hub/daemon.ts
|
|
9
10
|
- src/hub/peers.ts
|
|
10
11
|
- src/hub/envelope.ts
|
|
@@ -28,6 +29,8 @@ tags: [agent-hub, dogfood]
|
|
|
28
29
|
|
|
29
30
|
# Agent Hub Architecture
|
|
30
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
|
+
|
|
31
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.
|
|
32
35
|
|
|
33
36
|
## Runtime and peer boundary
|
|
@@ -44,6 +47,17 @@ Authority is role-scoped: the person retains decisions requiring judgment or con
|
|
|
44
47
|
|
|
45
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)).
|
|
46
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
|
+
|
|
47
61
|
Channel takeover keeps the same separation: optional adapter-owned takeover and
|
|
48
62
|
socket-ownership ports hold transport state, while the daemon supplies person
|
|
49
63
|
admission and current roster/launch/generation fences. A live standby has no peer
|
|
@@ -52,6 +66,16 @@ id and cannot release observer provenance or establish execution isolation. A
|
|
|
52
66
|
person takeover detaches ownership without terminating the process, and normal
|
|
53
67
|
delivery uncertainty remains independent ([#1174](https://github.com/STAIxBWLB/agent-hub/issues/1174)).
|
|
54
68
|
|
|
69
|
+
The cooperative instruction boundary also permits the unique conductor to stage
|
|
70
|
+
only off/advise and required check names through `ahub sdlc configure` after
|
|
71
|
+
initialization. The host rechecks its authenticated session, role, privacy and
|
|
72
|
+
recovery context, requires durable instruction intent before the existing
|
|
73
|
+
validated write and backup, and records the actual actor with value hashes.
|
|
74
|
+
The file takes effect at the next start. Initialization, generic settings editing,
|
|
75
|
+
enforce and protected lifecycle settings remain person-only; no release consent
|
|
76
|
+
follows from the configuration claim. See [the narrow SDLC configuration
|
|
77
|
+
contract](../sdlc.md#instructed-conductor-configuration-1432).
|
|
78
|
+
|
|
55
79
|
## Console presentation surfaces
|
|
56
80
|
|
|
57
81
|
The floating pet belongs to acon Mini (#1012). The compatibility command
|
|
@@ -89,6 +113,13 @@ establish entailment or synthesis readiness. The research-only record tool
|
|
|
89
113
|
returns an ids-only receipt and excludes its arguments/results from capture.
|
|
90
114
|
Its T1 authorization, revision and recovery boundaries are defined in
|
|
91
115
|
[the task-board contract](task-board.md#claim-evidence-records-931-t1).
|
|
116
|
+
Explicit synthesis checks bind the complete evidence inventory and registered
|
|
117
|
+
deliverable hashes through that boundary, rechecking privacy and immutable
|
|
118
|
+
provenance after asynchronous reads. Their separate readiness statuses certify
|
|
119
|
+
structural provenance only; #901 retains person judgment. Append-only relation
|
|
120
|
+
history prevents withdrawal/reclassification from silently erasing a contradiction;
|
|
121
|
+
its current manifest still needs the person's explicit disposition. See
|
|
122
|
+
[explicit synthesis readiness](task-board.md#explicit-synthesis-readiness-931-t3).
|
|
92
123
|
|
|
93
124
|
## Bounded visual attachments (#1058)
|
|
94
125
|
|
|
@@ -108,7 +139,7 @@ summary 4000, each pro/con 2000, table cell 4000, key 128, path 4096 and asset
|
|
|
108
139
|
reference 256. These are hub limits, not a claim that acon imposes each limit;
|
|
109
140
|
validation refuses rather than truncates. acon counts Mermaid UTF-16 code units
|
|
110
141
|
and leaves captions unbounded, while the hub counts UTF-8 bytes. All 42 published
|
|
111
|
-
acon 0.
|
|
142
|
+
acon 0.2.0 visual cases are consumed directly; six named valid-acon cases are
|
|
112
143
|
rejected only by these stricter source/caption/asset-ID ceilings. Historical
|
|
113
144
|
hub-owned cases remain extra coverage, not a substitute for the shared fixture.
|
|
114
145
|
|
|
@@ -186,6 +217,10 @@ Privacy decisions are made at hub boundaries, not delegated to model routing. A
|
|
|
186
217
|
|
|
187
218
|
Recovery is a coordinated daemon operation over separately persisted board, delivery, and native-session evidence. A restart or upgrade can continue only with compatible feature evidence from the verified target and host-held proofs that still match the project and actor. Adapters report native evidence; they do not certify their own recovery authority. This avoids treating a stale status file or an unverified receipt as proof that a native process is safe to resume ([#37](https://github.com/STAIxBWLB/agent-hub/issues/37), [#625](https://github.com/STAIxBWLB/agent-hub/issues/625), [#900](https://github.com/STAIxBWLB/agent-hub/issues/900)).
|
|
188
219
|
|
|
220
|
+
Advisor surveys use that same Tasks authority and recovery boundary. An explicit person or current conductor request creates one read-only planner task and its private pinned-ref survey record in one transaction before any task delivery. Findings remain declarations until the current planner explicitly vets them; resulting cards enter the backlog for planning or read-only investigation. Prior rejections remain append-only and apply only within their repository, semantic identity and unchanged affected paths. An unavailable complete diff retains unknown suppression, while explicit reasoned reconsideration appends history. Public briefs and readback withhold security details and private source facts. The `advisor_surveys` recovery feature is required once surveys, candidates or considered records exist; the conditional `advisorSurveys` proof contains validated counts and a digest, and empty legacy stores retain their existing snapshot shape and database floor. Bounds and role rules are in the [task-board contract](task-board.md#advisor-survey-and-rejection-ledger-1403-t7).
|
|
221
|
+
|
|
222
|
+
Target-version preflight and bounded private launch-failure observations follow the [adapter restoration contract](adapters.md#restoration-launch-diagnostics-1426). Failure diagnostics do not replace the existing native ownership, readiness or permission proofs.
|
|
223
|
+
|
|
189
224
|
The architecture does not claim that a fixture proves a real provider account, native session, campus network, or operating-system sandbox. Those are distinct runtime evidence and remain separate from source-level and automated checks ([#625](https://github.com/STAIxBWLB/agent-hub/issues/625), [#754](https://github.com/STAIxBWLB/agent-hub/issues/754)).
|
|
190
225
|
|
|
191
226
|
## Person review packages (#1056)
|
|
@@ -193,3 +228,13 @@ The architecture does not claim that a fixture proves a real provider account, n
|
|
|
193
228
|
The task-board module owns anchored findings and person-authored comment lifecycles. Transport carries one explicit review package only after `Tasks` admits the selected draft set; drafting and editing do not start peer turns. acon supplies the shared review kit and a server-verified person identity, while the standalone dashboard reads counts and bounded placements only. Neither surface writes the Board directly.
|
|
194
229
|
|
|
195
230
|
The host-only review package reference is an observer exclusion, not PII authority. Durable open comment/finding scope protects memory notes naming that task after restart or intervening input. Capture, progress and session-title exclusion follows the current review input, not unrelated board history. The read-only own held inbox view (#1328 AC6) creates no durable handout receipt. Its narrow conservative ceiling also excludes retained readable observer-excluded held inputs (trusted review packages and host-stamped peer chat/status responses) across restart until explicit disposition, even if unread; an overflowing or unreadable recipient row/byte window stays unknown and excluded because a previously viewed review can move outside the window. Ordinary queued/deferred review rows do not acquire this ceiling, and verified ordinary replacement retains its existing turn rules. ID-only current-input holds survive daemon restart. An intact, readable, complete store with no matching held record admits a new session as clean. Unreadable or corrupt storage and unconfirmed coverage for the current identity remain excluded. A validated release receipt confirms that identity without declaring other legacy identities clean. For an identified pull-only session, a positive held row remains sticky across restart until confirmed native identity changes. Its own incomplete marker excludes until verified ordinary replacement or a confirmed new session clears that marker; legacy coverage alone does not create a sticky hold. Missing native identity permits handout under an in-RAM unknown-held scope. A never-identified peer can release it with verified ordinary replacement in that daemon run; earlier positive or incomplete SID rows instead keep unidentified observer state held until a real SID is confirmed. First confirmation persists any current RAM quote under that SID before clearing the peer marker, without discarding other SID rows. It does not invent a native identity or weaken write-failure refusal. Legacy coverage completes from settled journal evidence, after which NULL clean receipts can be pruned; corrupt state remains excluded and is named in status with a repair next step. The hold grants no authority; the task-bound recipient summary and check output remain distinct from observer projections. Explicit publication recovery uses the saved immutable envelope and retained journal evidence, never automatic effect replay. Its intended recipient may read a public package, but memory capture, operational views, delivery logging and incoming-message labels exclude its body. Local-worker capture latches exclusion before any tool in a batch that submits an anchored verdict, including a refused verdict, and applies it to subsequent capture, final summaries and retained history. A delayed response cannot become capturable when another turn starts. Recovery advertises the conditional `review_comments` feature when retained comment/package records require it. It also requires `review_observer_input_state` when held or unknown session-input provenance could otherwise be lost. See [the task-board contract](task-board.md#anchored-review-packages-1056) for bounds, immutable snapshot placement and lifecycle authority.
|
|
231
|
+
|
|
232
|
+
## Reviewer quota coordination (#1446)
|
|
233
|
+
|
|
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.
|
|
235
|
+
|
|
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
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: roadmap
|
|
3
|
+
type: module
|
|
4
|
+
title: Roadmap Milestones
|
|
5
|
+
status: active
|
|
6
|
+
parent: agent-hub-architecture
|
|
7
|
+
depends-on: [task-board]
|
|
8
|
+
paths:
|
|
9
|
+
- src/hub/roadmap.ts
|
|
10
|
+
- src/hub/roadmap-view.ts
|
|
11
|
+
- src/hub/roadmap-unplaced.ts
|
|
12
|
+
- src/hub/roadmap-triage.ts
|
|
13
|
+
- src/hub/github-import.ts
|
|
14
|
+
- src/hub/specs-task.ts
|
|
15
|
+
- src/hub/board.ts
|
|
16
|
+
- src/hub/tasks.ts
|
|
17
|
+
- src/hub/hub-tools.ts
|
|
18
|
+
- src/hub/daemon.ts
|
|
19
|
+
- src/hub/restart.ts
|
|
20
|
+
- src/cli/roadmap.ts
|
|
21
|
+
- src/cli/main.ts
|
|
22
|
+
- src/cli/help.ts
|
|
23
|
+
- src/cli/identity.ts
|
|
24
|
+
- test/roadmap.test.ts
|
|
25
|
+
- test/roadmap-board.test.ts
|
|
26
|
+
- test/roadmap-daemon.test.ts
|
|
27
|
+
- test/roadmap-cli.test.ts
|
|
28
|
+
- test/roadmap-recovery.test.ts
|
|
29
|
+
- test/roadmap-unplaced.test.ts
|
|
30
|
+
- test/roadmap-triage-tasks.test.ts
|
|
31
|
+
- test/roadmap-r3-cli.test.ts
|
|
32
|
+
- test/roadmap-r3-daemon.test.ts
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
# Roadmap milestones
|
|
36
|
+
|
|
37
|
+
R1 implements [#1479](https://github.com/STAIxBWLB/agent-hub/issues/1479) of the
|
|
38
|
+
[#1478 roadmap](https://github.com/STAIxBWLB/agent-hub/issues/1478). The board is
|
|
39
|
+
the source of truth. R1 adds no GitHub writes, roadmap model calls, export,
|
|
40
|
+
automatic task assignment, dashboard or console UI. R3 ([#1481](https://github.com/STAIxBWLB/agent-hub/issues/1481),
|
|
41
|
+
"Bottom-up placement" below) adds the first roadmap model call and read-only GitHub
|
|
42
|
+
reads, and still adds no GitHub write.
|
|
43
|
+
|
|
44
|
+
R1 adds no generation, triage or decomposition call; those belong to R2 and R3.
|
|
45
|
+
The existing mandatory privacy screen on planner-written text stays exactly as
|
|
46
|
+
`Tasks.newRelease` applies it, including on milestone title and outcome. It fails
|
|
47
|
+
closed where newRelease does and is never bypassed.
|
|
48
|
+
|
|
49
|
+
## Storage and writes
|
|
50
|
+
|
|
51
|
+
The additive `milestones` table keeps id, title, outcome, state, horizon,
|
|
52
|
+
`milestone_order`, optional target date and parent, revision, history and
|
|
53
|
+
creation/update times. `milestone_links` records milestone, kind, ref, actor and
|
|
54
|
+
time, unique on milestone/kind/ref. No existing task or release column changes.
|
|
55
|
+
|
|
56
|
+
States are proposed, planned, active, done and dropped; horizons are now, next
|
|
57
|
+
and later. A new row defaults to proposed/later/order 0. Target dates are actual
|
|
58
|
+
YYYY-MM-DD calendar dates. A parent must exist at the top level; self-links,
|
|
59
|
+
cycles, grandchildren and moving an existing parent under another parent refuse
|
|
60
|
+
atomically. Parent links organize milestones; they do not silently copy child
|
|
61
|
+
membership into the parent's roll-up.
|
|
62
|
+
|
|
63
|
+
Every external write goes through Tasks. The configured planners, the unique
|
|
64
|
+
configured conductor and the person may create, edit, link, unlink and order.
|
|
65
|
+
Only the person records done or dropped, including through create/edit fields.
|
|
66
|
+
Settled milestones are final. Private turns, held review input, recovery,
|
|
67
|
+
shutdown, storage failure and changed caller authority refuse writes before any
|
|
68
|
+
effect. Text screening is followed by current role, privacy and revision checks.
|
|
69
|
+
|
|
70
|
+
Edits require the revision returned by show. Every write uses a transactional
|
|
71
|
+
revision compare-and-set. Link changes and their history/revision update commit
|
|
72
|
+
together. An identical link/unlink replay changes nothing. History contains at
|
|
73
|
+
most 256 metadata events: actor, time, event, field names and link kind, never
|
|
74
|
+
task text or the linked task id. Ordinary mutations reserve the last event slot
|
|
75
|
+
for the person's done/dropped settlement, so reaching the ordinary-write ceiling
|
|
76
|
+
cannot strand an active milestone. Duplicate link/unlink replays consume no slot.
|
|
77
|
+
|
|
78
|
+
## Membership and computed progress
|
|
79
|
+
|
|
80
|
+
An explicit task link takes precedence over issue inheritance across the whole
|
|
81
|
+
roadmap. Without an explicit placement, a task belongs to each milestone linked
|
|
82
|
+
to its canonical source issue. Readbacks identify explicit placement or
|
|
83
|
+
`source-issue` placement with the qualified issue ref (the person renderer says
|
|
84
|
+
"inherited from #N"). GitHub-import identity is the existing `Task.external`;
|
|
85
|
+
otherwise Tasks reuses its canonical plan-issue identity, including `sdlc`.
|
|
86
|
+
No parallel `refs.source` field is introduced.
|
|
87
|
+
|
|
88
|
+
Progress is computed at read time, never persisted or inferred from prose:
|
|
89
|
+
|
|
90
|
+
- Tasks: approved and total public members, plus a separate withheld count.
|
|
91
|
+
- Issues: closed and total linked public issues; state comes only from matching
|
|
92
|
+
persisted plan-review issue metadata, with its cache time. The newest matching
|
|
93
|
+
receipt wins; missing evidence or conflicting equally recent receipts are
|
|
94
|
+
unknown. A task's approval does not prove its issue closed. Reads do not call
|
|
95
|
+
GitHub.
|
|
96
|
+
- Specs: fresh, stale, unverified or unknown from the existing spec graph. An
|
|
97
|
+
unavailable, erroneous or truncated graph supplies no complete proof. Missing,
|
|
98
|
+
ambiguous and nonancestor entries stay unknown; nonancestor provenance is
|
|
99
|
+
retained. The internal host report is used without the public hub_specs
|
|
100
|
+
presentation cap.
|
|
101
|
+
- Releases: shipped and total linked delivery trains, unknown for a missing row.
|
|
102
|
+
Milestones do not alter release train scope or state rules.
|
|
103
|
+
|
|
104
|
+
Private tasks appear only in the withheld count, even for the person's roadmap
|
|
105
|
+
view. Task ids, titles, direct links and provenance are omitted. Current metadata
|
|
106
|
+
screens apply to links and inherited provenance as well as titles. A ref that
|
|
107
|
+
becomes private cannot remain in a task's placement. Staged backlog text stays
|
|
108
|
+
hidden from non-planner agents. Reads refuse private and held review contexts.
|
|
109
|
+
No roadmap writer emits task text to logs, events, notices or memory.
|
|
110
|
+
|
|
111
|
+
## Tools and CLI
|
|
112
|
+
|
|
113
|
+
The three tools are `hub_roadmap_list`, `hub_roadmap_show {id}` and
|
|
114
|
+
`hub_roadmap_edit {op, ...}`. The edit operations are new, edit, link, unlink,
|
|
115
|
+
order and state; fields and operands are closed per operation. A schema grants
|
|
116
|
+
no authority: Tasks and the daemon enforce current caller and read-only limits.
|
|
117
|
+
Every control rid gets a response, including unknown roadmap operations.
|
|
118
|
+
|
|
119
|
+
`ahub roadmap` defaults to list. `list` and `show <id>` support `--json`; default
|
|
120
|
+
output is for a person. Mutations are:
|
|
121
|
+
|
|
122
|
+
- `new --title <text> --outcome <text>` with optional horizon/order/target/parent.
|
|
123
|
+
- `edit <id> --revision <n>` with those optional fields; target/parent `none`
|
|
124
|
+
clears the field.
|
|
125
|
+
- `link|unlink <id> <spec|issue|task|release> <ref>`.
|
|
126
|
+
- `order <id> <n>` and `state <id> <state>`.
|
|
127
|
+
|
|
128
|
+
Issue refs are qualified owner/repo#N, task/train refs are positive ids, and spec
|
|
129
|
+
refs are spec ids. Parsing refuses unknown flags and extra operands before a
|
|
130
|
+
connection. Normal agent shells keep peer identity; terminal states stay
|
|
131
|
+
person-only, and live-test delegation cannot write milestone content.
|
|
132
|
+
|
|
133
|
+
## Recovery
|
|
134
|
+
|
|
135
|
+
Rows are preserved in the same hub database through restart. Retained milestone
|
|
136
|
+
state requires the roadmap capability on a controlled recovery target and adds
|
|
137
|
+
its ordered row/link digest to integrity. Empty databases retain the existing
|
|
138
|
+
format floor and integrity shape; the additive tables do not advance the database
|
|
139
|
+
format marker.
|
|
140
|
+
|
|
141
|
+
## Bottom-up placement (R3)
|
|
142
|
+
|
|
143
|
+
R3 starts from the work that exists (open GitHub issues, open board tasks, `active` and `draft` specs) and places it on the
|
|
144
|
+
roadmap. It adds three reads and writes through R1's own writers only.
|
|
145
|
+
|
|
146
|
+
**Unplaced work.** `ahub roadmap unplaced [--repo owner/name] [--json]` and `hub_roadmap_unplaced {repo?}` list what no live
|
|
147
|
+
milestone places, each row with its reason (`UNPLACED_REASONS`). A link into a `dropped` milestone does not place; a link into a
|
|
148
|
+
`done` one does. A task is placed by an explicit link or by its source issue through R1's inheritance, so linking an issue drops
|
|
149
|
+
the issue and every task that inherits from it. An issue whose imported task is open is reported once, as that task. Private tasks
|
|
150
|
+
are a count (`privateTasks`), never a row, and an issue behind one is not a row either. The result is a lower bound and says so:
|
|
151
|
+
`partial: true` when the GitHub read stopped early or a list passed its cap of 100 (`more` counts the rest), and `unavailable`
|
|
152
|
+
names a source that could not be read (`issues`, `specs`), so an empty list is never read as "all placed".
|
|
153
|
+
|
|
154
|
+
**GitHub reads.** `readGitHubIssuePages` and `readGitHubMilestonePages` (`src/hub/github-import.ts`) page `gh api repos/<r>/issues|milestones?state=open&per_page=100&page=N`
|
|
155
|
+
up to 10 pages under one 20 s deadline that also covers repository resolution. They are fixed argv GETs through `SdlcGh`; there is
|
|
156
|
+
no write verb, method flag or body. The first page failing is an error; a later page failing, the deadline, or a full last page
|
|
157
|
+
under the page limit is `partial: true` with what was read. Pull requests are left out and every row's URL must equal its
|
|
158
|
+
canonical identity. `readGitHubImport` (the one-page Backlog intake) is unchanged.
|
|
159
|
+
|
|
160
|
+
**Triage.** `ahub roadmap triage [--repo] [--list]` and `hub_roadmap_triage {repo?, list?}` (configured planner or unique
|
|
161
|
+
conductor, never during a PII or private turn) ask the hub's model, in one call for at most 25 unplaced items, where each belongs.
|
|
162
|
+
The model sees only text that passed `publicMetadataText`, and everything it reads is labelled data. `parseTriage`
|
|
163
|
+
(`src/hub/roadmap-triage.ts`) keeps an answer only when it names an item and a milestone it was shown (or a bounded new
|
|
164
|
+
milestone), gives exactly one of them, and quotes words (4 to 200 characters) that occur in the item text and in the milestone
|
|
165
|
+
title or outcome. Each kept answer is screened again before it is stored as a pending row of `milestone_suggestions`, attributed to
|
|
166
|
+
`hub` as a model's answer; nothing else reads that table, so a suggestion never enters `ahub ask` evidence or memory. A repeat triage
|
|
167
|
+
skips an item that already has a pending suggestion. `list: true` reads the pending public suggestions with no model call, for any
|
|
168
|
+
agent. No model, a dead one or an answer with nothing supportable reports `unavailable` or `dropped`, never a silent empty result.
|
|
169
|
+
|
|
170
|
+
`hub_roadmap_edit {op: accept|reject, suggestion}` (`ahub roadmap accept|reject <id>`) settle one suggestion. Accept applies
|
|
171
|
+
exactly its one link through `Board.linkMilestone` under the R1 revision compare-and-set, creating the suggested `proposed`
|
|
172
|
+
milestone first for "new milestone" and remembering it (`created_milestone`), so a retry after a failed link never makes a
|
|
173
|
+
second. A suggestion settles once: a repeat reject replays, and any other change of a settled suggestion (a second accept, an
|
|
174
|
+
accept after a reject) refuses naming its state. A suggestion whose text is no
|
|
175
|
+
longer public refuses accept and can be rejected. Nothing is linked without an accept.
|
|
176
|
+
|
|
177
|
+
**Roll-up and ready to close.** `milestoneList` and `milestoneShow` add `tree` (the milestone and its children, a task, issue,
|
|
178
|
+
spec or release linked twice counted once; `rollup` stays R1's own figure) and `readyToClose {ready, reasons}`. Ready needs
|
|
179
|
+
something linked, every task approved or cancelled, every issue closed, every release shipped or dropped, no withheld private
|
|
180
|
+
task, and every child `done` or `dropped`; spec freshness is not a condition. It is advice for the person: `done` and `dropped`
|
|
181
|
+
stay person-only and nothing sets a state from it.
|
|
182
|
+
|
|
183
|
+
**GitHub milestone import.** `ahub roadmap import-github [--repo] [--apply] [--json]` is the person's alone (console op
|
|
184
|
+
`roadmap_import_github`, not in `CONDUCTOR_TASK_OPS`; refused for agent shells and live-test). Without `--apply` it lists what it
|
|
185
|
+
would create and link. With it, each open GitHub milestone becomes one `proposed` milestone (outcome is its description, target its
|
|
186
|
+
due day) in one transaction with its `milestone_imports` mark, and its open issues are linked; a repeat finds the mark and each
|
|
187
|
+
link and changes nothing, a milestone that has since settled is not relinked, and text that fails the public screen is counted
|
|
188
|
+
in `withheld`. Nothing is written to GitHub.
|
|
189
|
+
|
|
190
|
+
`milestone_suggestions` and `milestone_imports` are additive tables outside the roadmap integrity digest: a lost suggestion is
|
|
191
|
+
triaged again and an import mark only prevents a duplicate, so neither changes the recovery format.
|