@staix/agent-hub 0.35.0 → 0.37.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 +43 -0
- package/README.md +25 -4
- package/THIRD_PARTY_NOTICES.md +0 -18
- package/docs/agent-notes/README.md +71 -1
- package/docs/agent-notes/adapters.md +5 -2
- package/docs/agent-notes/bus.md +1 -0
- package/docs/agent-notes/daemon.md +7 -6
- package/docs/agent-notes/local-worker.md +1 -0
- package/docs/agent-notes/models.md +5 -3
- package/docs/agent-notes/tasks.md +9 -2
- package/docs/agent-notes/tests.md +1 -1
- package/docs/contracts/companion-cli-v1.json +70 -0
- package/docs/design/adapters.md +115 -2
- package/docs/design/agent-hub-architecture.md +10 -2
- package/docs/design/bus.md +8 -0
- package/docs/design/execution-reference.md +171 -11
- package/docs/design/guidance-experiments.md +438 -0
- package/docs/design/guidance-probes.md +802 -0
- package/docs/design/model-routes.md +1053 -0
- package/docs/design/supervision.md +121 -0
- package/docs/design/task-board.md +111 -0
- package/docs/dogfood.md +24 -15
- package/docs/events.md +20 -1
- package/docs/memory.md +3 -3
- package/docs/operations.md +366 -133
- package/docs/profiles.md +2 -2
- package/docs/quickstart.md +114 -3
- package/docs/research.md +5 -3
- package/docs/sdlc.md +113 -7
- package/docs/security.md +88 -6
- package/docs/specs/2026-09-19-agent-hub-design.md +14 -11
- package/docs/specs/2026-10-04-switchyard-source-port-design.md +3 -1
- package/docs/verification/2026-10-25-qwen-dual-output-t0.md +22 -0
- package/docs/verification/2026-11-08-qwen-0269-model-setter-1317.md +25 -11
- package/docs/verification/2026-11-09-qwen-0270-acp.md +181 -0
- package/docs/verification/2026-11-09-qwen-0270-model-setter-1317.md +61 -0
- package/docs/verification/2026-11-10-0.36.0.md +59 -0
- package/docs/verification/2026-11-10-claude-implementer-2.1.322.md +59 -0
- package/docs/verification/2026-11-10-qwen-0270-dual-output.md +367 -0
- package/docs/verification/2026-11-10-qwen-0271-dual-output.md +101 -0
- package/docs/verification/2026-11-11-0.37.0.md +40 -0
- package/docs/verification/2026-11-11-guidance-probe-t2-1226.md +153 -0
- package/docs/verification/2026-11-11-qwen-setter-suggestions-off.md +167 -0
- package/docs/verification/claude-shell-wrapper-native.py +1 -1
- package/docs/verified.json +27 -27
- package/package.json +3 -4
- package/plugins/agent-hub/.claude-plugin/plugin.json +1 -1
- package/plugins/agent-hub/kimi-hook.js +3570 -1800
- package/plugins/agent-hub/server.js +4112 -1913
- package/src/adapters/channel-peer.ts +7 -1
- package/src/adapters/claude-channel.ts +7 -4
- package/src/adapters/compat.ts +10 -10
- package/src/adapters/local-probe.ts +174 -0
- package/src/adapters/local-worker.ts +233 -22
- package/src/adapters/qwen-dual.ts +324 -44
- package/src/cli/console-state.ts +25 -6
- package/src/cli/console-versions.ts +99 -0
- package/src/cli/console.ts +13 -1
- package/src/cli/guidance.ts +67 -0
- package/src/cli/help.ts +12 -4
- package/src/cli/identity.ts +10 -3
- package/src/cli/init-prompt.ts +15 -2
- package/src/cli/init-required-checks.ts +122 -0
- package/src/cli/init-settings.ts +10 -4
- package/src/cli/init.ts +39 -3
- package/src/cli/install-paths.ts +7 -2
- package/src/cli/lineage.ts +78 -0
- package/src/cli/main.ts +171 -14
- package/src/cli/runtime-version-warning.ts +2 -2
- package/src/cli/sdlc-output.ts +9 -5
- package/src/cli/setup-research.ts +10 -0
- package/src/hub/autonomy-defaults.ts +20 -9
- package/src/hub/board.ts +346 -4
- package/src/hub/build-entry.ts +11 -0
- package/src/hub/bus.ts +12 -0
- package/src/hub/ci-watch.ts +4 -4
- package/src/hub/config-apply.ts +6 -3
- package/src/hub/config-trust.ts +7 -1
- package/src/hub/control-client.ts +5 -2
- package/src/hub/daemon.ts +508 -26
- package/src/hub/delivery-hints.ts +4 -2
- package/src/hub/delivery-journal.ts +50 -2
- package/src/hub/delivery-public.ts +51 -0
- package/src/hub/dogfood-profile.ts +8 -4
- package/src/hub/events.ts +3 -2
- package/src/hub/execution-lineage-owner.ts +272 -0
- package/src/hub/execution-lineage.ts +52 -8
- package/src/hub/execution-links.ts +85 -0
- package/src/hub/guidance-probe-store.ts +713 -0
- package/src/hub/guidance-probes.ts +358 -0
- package/src/hub/guidance-variants.ts +398 -0
- package/src/hub/handoff.ts +1 -0
- package/src/hub/hub-tools.ts +43 -2
- package/src/hub/inference.ts +18 -5
- package/src/hub/manager.ts +44 -2
- package/src/hub/memory-policy.ts +2 -2
- package/src/hub/operational-authority.ts +13 -1
- package/src/hub/peers.ts +6 -1
- package/src/hub/planning.ts +1 -1
- package/src/hub/ports.ts +1 -1
- package/src/hub/progress.ts +47 -23
- package/src/hub/report.ts +2 -0
- package/src/hub/research.ts +1 -0
- package/src/hub/restart.ts +20 -0
- package/src/hub/roles.ts +26 -0
- package/src/hub/routing.ts +4 -1
- package/src/hub/sdlc-merge.ts +39 -1
- package/src/hub/sdlc-release-authorization.ts +139 -17
- package/src/hub/sdlc-release-policy.ts +100 -0
- package/src/hub/sdlc-release.ts +60 -8
- package/src/hub/sdlc.ts +62 -11
- package/src/hub/settings.ts +2 -0
- package/src/hub/supervision-proposals.ts +405 -0
- package/src/hub/supervision-rules.ts +388 -0
- package/src/hub/supervision.ts +2 -0
- package/src/hub/task-approval.ts +2 -2
- package/src/hub/task-repository.ts +5 -0
- package/src/hub/tasks.ts +917 -53
- package/src/local/probe-errors.ts +28 -0
- package/src/local/probe-sandbox.ts +224 -0
- package/src/local/probe-types.ts +108 -0
- package/src/local/probe-workspace.ts +237 -0
- package/src/local/sandbox.ts +71 -2
- package/src/local/tools.ts +135 -9
- package/src/memory/capture.ts +2 -2
- package/src/models/relay.ts +9 -2
- package/src/models/route/advisor-trigger.ts +88 -0
- package/src/models/route/config.ts +39 -8
- package/src/models/route/conversation-view.ts +179 -0
- package/src/models/route/decision-evidence.ts +1 -1
- package/src/models/route/decision.ts +193 -26
- package/src/models/route/escalation-control.ts +30 -0
- package/src/models/route/hub-prompts.ts +97 -0
- package/src/models/route/judge-choice.ts +155 -0
- package/src/models/route/judge-replies.ts +102 -0
- package/src/models/route/labels.ts +14 -70
- package/src/models/route/observation-signals.ts +250 -0
- package/src/models/route/plan-execute-choice.ts +27 -0
- package/src/models/route/relay-selector.ts +10 -9
- package/src/models/route/runtime.ts +129 -60
- package/src/models/route/stage-diagnostics.ts +22 -0
- package/src/models/route/stage-evidence.ts +55 -0
- package/src/models/route/stage-fallback.ts +58 -0
- package/src/models/route/stage-input.ts +155 -0
- package/src/models/route/stage.ts +5 -147
- package/src/models/route/turn-state.ts +77 -0
- package/src/omniroute/client.ts +3 -0
- package/src/ui/guidance-panel.ts +156 -0
- package/src/ui/guidance-view.ts +43 -0
- package/src/ui/lineage-view.ts +34 -0
- package/src/ui/plugin.ts +141 -27
- package/src/version.ts +4 -0
- package/templates/adec/README.md +32 -0
- package/templates/adec/ahub.plan-execute.json +23 -0
- package/templates/adec/ahub.stage.json +23 -0
- package/LICENSES/Apache-2.0.txt +0 -204
- package/src/models/route/advisor.ts +0 -102
- package/src/models/route/escalation.ts +0 -82
- package/src/models/route/judge.ts +0 -23
- package/src/models/route/normalize.ts +0 -103
- package/src/models/route/plan-execute.ts +0 -52
- package/src/models/route/prompts.ts +0 -8
- package/src/models/route/signals.ts +0 -247
- package/src/models/route/state.ts +0 -54
- package/src/models/route/text.ts +0 -61
|
@@ -4,6 +4,8 @@ Scope: the task flow, assignment, the state machine and the hub's MCP tools. Rea
|
|
|
4
4
|
|
|
5
5
|
- Scope every task-place comparison through `TaskRepositories` (`src/hub/task-repository.ts`, #476): explicit `refs.repo`, else a common outside-absolute-ref repository or parent, else this project. Preserve relative display spelling within that key and gate overlap, contradiction, replay and held evidence by equal keys. Warm/cache repository identity at task mutation and startup; never repeat Git reads for unchanged overlap inputs. Set `refs.repo` for work in another repository; repo-only accept metadata never grants execution or file access.
|
|
6
6
|
- Tool callers are models: MCP `inputSchema` is not enforced on the way in. Normalize at the boundary (`cleanRefs`) before anything reaches the board, and never throw after a board write: a publish or notify that follows a `review()` or `done()` board write goes through the one `releaseNotice` guard, which turns a failed publish into a console notice, drops a failed notify and never retries (#231, #243). An assignment's delivery once its board write is saved (#276, #297): the move is fact, the failed publish is not retried in place (the journal's own recovery covers a storage error, and a retry may duplicate a publish that actually left), and a person looks for a queued or needs_review delivery with `ahub queue list --peer <owner>` (then `ahub queue show <id>`, or the accepted entry in `ahub task show <id>` if the journal is down) before re-sending with `ahub task assign <id> <owner>`. The distinction is made once, in `assignOwner`: a failure after the write prints the one console notice from `undeliveredNotice` right there, once, and throws `AssignmentUndeliveredError` carrying the saved task; callers (`review()`'s repeated rejection, `escalate` and its callers, the ready offer, both relays, the idle sweep, rescreen) decide control flow by the type and print nothing more, and `propose`, `assignTo` and `decline` additionally let the error reach the caller in its turn, which is a person or peer that can act. Two exceptions get no notice, by construction: a row superseded meanwhile, meaning a later history entry that moves or settles the task (another assignment, an unassign, the owner's accept, done, approval, close), while entries that do neither (the hub's quiet bookkeeping: answers, reviewer changes, idle sweeps, check results) leave the assignment undelivered and the notice stands, so the original error goes to the caller as before only on supersession; and a claim's own accepted write and "claimed by" line stay outside the delivery rule (a claim is its own hand-over; its overlap and routing announcements to earlier owners are deliveries and share the wrapper, so a failure there does read as one). A failure before the write stays a plain `Error` (#254), a failed write leaves the ready offer unconsumed (#231), and the notices before the write (waits, no-owner, the reserved-owner line) go through `releaseNotice` too, so those pre-write notices cannot fail their caller.
|
|
7
|
+
- For execution-lineage reads (`src/hub/execution-lineage*.ts`), validate caller limits and producer-kind id grammar before source-owner lookups and the source-corruption catch. Return caller errors as invalid/unsupported, reserve corrupt for source failures, and keep unauthorized responses neutral.
|
|
8
|
+
- Derive attempt/output lineage support from current host policy before raw event paging. With PII paths, deny entries, routing PII patterns or unknown policy, return unavailable independently of stored row contents or counts; retain independently public task/head/deliverable slices. Recover event projections only through a privacy-aware page source, never a derived privacy index, backfill or unbounded scan.
|
|
7
9
|
- Post-await assignment publication is fenced by current role authority: supersession returns the current task without a saved-delivery notice; reviewer-only changes refresh current metadata and do not suppress a valid owner delivery. A replacement notice goes only to a role that actually received the request, not to an unread-only queue.
|
|
8
10
|
- Console or conductor task row assignment/unassignment carries the exact role, task id and `flowRevision` (history length), checks it before effects and passes it to `Board.update`; a changed revision requires reload. Authorized person or conductor owner removal clears owner/reservation and suppresses automatic offers until a later authorized explicit assignment/reservation; retain the host-only `conductorManual` history marker, never infer historical authority from current roles, and require `conductor_recovery` on a recovery target while marked tasks remain open; refuse owner removal under review or after approval, and preserve the required PII person reviewer.
|
|
9
11
|
- Role withdrawal matches the task id, role kind and owner-request header. Owner acceptance evidence must be that peer's accepted entry after the latest ownership event, never another owner's state or an earlier assignment span. Withdraw unread requests without inventing delivery evidence. Find them with `bus.pendingEnvelopes(peer)`, which includes recovery-deferred notices, never the snapshot's queues (#478). Preserve the original former-owner stop notice after a superseding escalation, while suppressing stale success/decision tails.
|
|
@@ -23,6 +25,9 @@ Scope: the task flow, assignment, the state machine and the hub's MCP tools. Rea
|
|
|
23
25
|
- Opt-in auto pull (#785 P1c, `tasks.auto_pull`, `Tasks.queueAutoPulls`, `autoPull`, `topReservedReady`): `writePlannerNotices` collects the peers whose WIP this write lowered and, only when `TasksDeps.autoPull()` is true (read at each release, so a reload applies to the next one), queues one `autoPull(peer)` per peer on a promise chain, so two releases never pick the same card and each job re-reads the board. It takes the top backlog card explicitly reserved for that peer (`topReservedReady(peer, undefined, true)`, the rule the notice's `reserved ready #id` line also uses; never an unreserved card, never PII, which `topReservedReady` skips for a pull), finds the card's own planner of record (`taskPlanner(card)[0]`, which must be rostered) and calls `pullPlanned(HUB, input, { onBehalfOf: planner })`. `onBehalfOf` is accepted only with `by === HUB`; the planner's authority is what `planningAuthority` checks, the actor in history and the planning telemetry stays `hub`, and the planner binding records the planner it acted for. Every other check is `pullPlanned`'s own, unchanged, and a refusal is one console notice with the public title (never detail). A held or recovering hub, a storage error or the setting off pulls nothing, and that is checked twice: at entry and again by `pullPlanned`'s `opts.guard` (`autoPullAdmitted`) wherever authority is rechecked, which includes right before the assignment or board write after the awaited PII screen and `planReviewGap`, so turning the setting off or starting recovery or shutdown mid-admission writes nothing and reports nothing. `autoPullsPending()` counts queued and running pulls and `recoveryReady` waits for it (also named in the recovery view's blockers), as it does for `checksPending`. The key is in `ALL_MACHINE_LOCAL` (`config-trust.ts`) so a committed config is ignored for it, and it is not in `CONDUCTOR_SETTING_KEYS`: an agent never turns it on. Never add a timer or sweep that pulls: the only trigger is the write that freed the slot.
|
|
24
26
|
- Planned start (#1092): `plannedStartPending` (`src/hub/task-sweep.ts`) is the only test that a card's `plannedStart` is still ahead. Every automatic path skips such a card: dependent readiness, `backlog_ready` notices, the reserved-ready pick, auto pull and its `guard`, a hub-actor (`by === HUB`) offer, pull or assign of an ownerless backlog or proposed card, and the idle sweep. The planner digest shows it as `scheduled`. A new automatic path asks it too.
|
|
25
27
|
- Per-head CI watcher (#785 P1b, `src/hub/ci-watch.ts`, `Tasks.watchCi`, `ciCompleted`, `reofferHeldReview`): when a `done` leaves a review whose admission was not ready at the task's exact full-commit head (or a review is held as premature in `sendReview`), `CiWatchers` starts at most one watcher per task and head, with chained unref'd `setTimeout`s and no interval. Each poll is one `gh pr view` through the `sdlc.gh` port (`pollCi`); it ends on a passed result for the required checks, on `CI_WATCH_DEADLINE_MS`, on `stopCiWatchers` (daemon `stopOnce`), or silently when `ciWatchCurrent` fails (the task left `in_review`, its head or PR changed, the lifecycle is off, it turned private). `complete`, `review` (both verdict writes) and `cancel` cancel it. Each (head, outcome) is told once (`settled`), and only `passed` settles a head for good (#540): after `failed` or `incomplete` the watcher keeps reading for a rerun of that head (the first pending read after each newly told result is a new run attempt and renews the deadline once; later pending or unreadable reads and an unchanged failed result never renew it, so the watcher always ends; a deadline after a told result ends silently), and a later `hub_task_done` at that head starts one again. A newer head replaces the watcher. The result is one ids-only `ci_completed:` task envelope at `status` weight to the owner and the reviewer (`fyi` is never delivered to a peer, so it would not reach them), a console notice for `user`, and for a deadline a console notice only. A passed or incomplete result re-offers a review held as premature once (`heldReviews`, keyed by task, head, reviewer and review revision) after a fresh `reviewRequestAdmission` says ready; a failed one re-offers nothing. No task text goes in the notice, no PII task is watched, and nothing is restored after a hub restart (the next `hub_task_done` starts one). Never add a second periodic gh read outside this watcher.
|
|
28
|
+
- Required checks (#1344): resolve the names only through `requiredChecksFor` / `requiredCheckNames` (`src/hub/sdlc-merge.ts`, `src/hub/sdlc.ts`); the built-in `check (...)` and `seeded guards` set applies only to this repository, and an empty set elsewhere is a `required checks unknown` blocker, never a pass.
|
|
29
|
+
- Build-entry guidance (#1354, `buildEntryDiagnostic` in `src/hub/build-entry.ts`) is pure display data: routing and `route explain` may show it but never read GitHub or change eligibility because of it.
|
|
30
|
+
- Merge adoption (#1348, `ahub sdlc adopt-merge`, `Tasks.adoptMerge`): only the person or the one configured conductor adopts an already merged PR; it writes `approved` with the `merged outside the hub` event and creates no reviewer verdict, review metric, reviewed-head receipt, guarded-merge result or GitHub mutation, and a private task or turn refuses before any GitHub read. Contract: `docs/design/task-board.md` "Merged PR adoption".
|
|
26
31
|
|
|
27
32
|
- Handoff idempotency (#1203 T1): the target writes a handed-off task only through `Board.proposeHandoff` (the proposal and `task_handoff_origin` row, key and request digest in one `atomic` transaction); `handoffIn` asks `replay()` before the duplicate check and again after the PII screen's await, so a retry of a key whose first attempt is still screening files nothing twice. Never `propose` then `setHandoffOrigin` for a handoff, and never compare a key to anything but this origin project's own rows.
|
|
28
33
|
- Completed-change notices (#713, one per recipient per done, accepted work only, superseding by `completedFor`): rule in `bus.md`.
|
|
@@ -37,6 +42,8 @@ Scope: the task flow, assignment, the state machine and the hub's MCP tools. Rea
|
|
|
37
42
|
- `review()` reads `escalateAfter()` (`tasks.escalate_after`, 1-10, default `ESCALATE_AFTER` = 3) at each `changes_requested` verdict, so a reload applies from the next verdict; never capture it at construction or compare against a literal (#488).
|
|
38
43
|
- A guard in `tasks.ts` or `conductor.ts` passes `preEffect` (throws `PreEffectToolRefusal`, `src/hub/tool-refusal.ts`) only before the operation's first board or hold write; a throw after a write, a readback failure or a wrapped error stays a plain `Error` (#254). The Pi side of the rule is in `adapters.md`.
|
|
39
44
|
- Supervision reasons use structured enums, never history notes, check output or approval titles. Round signatures survive restart; later summaries count only newly joined tasks.
|
|
45
|
+
- Supervision rules and proposals (#1362, #1368, #1374: `src/hub/supervision-rules.ts`, `src/hub/supervision-proposals.ts`): the reading stage has no effect path, `supervision-proposals.ts` reaches the board and bus only through ports, and a proposal runs its existing action only on an explicit `accept` by a present role with that action's own authority (`escalate`: conductor or person), never automatically and never retried; `Tasks.supervisionNotice` refuses a private task. Read `docs/design/supervision.md` before changing these paths.
|
|
46
|
+
- Guidance variants (#1363, #1367, #1376: `src/hub/guidance-variants.ts`, `Tasks.guidanceVariant*`): lifecycle writes go only through `Tasks.guidanceVariantCreate` and `guidanceVariantWithdraw`; the `guidance_experiments` and `guidance_variants` tables are private local state, never copied into `Task`, refs, history, public views, bus notices or memory, and the guidance tools stay out of capture (`GUIDANCE_TOOL_NAMES`). Read `docs/design/guidance-experiments.md` before changing these paths.
|
|
40
47
|
|
|
41
48
|
- Pass off-roster ids as data into `assign()` so its trace and every owner/reviewer choice share the membership filter. Refuse a manual off-roster assignment before a board write, including a reservation. Use `reassignForRoster` through the existing assignment delivery path on removal, including in-review ownership while keeping its review state; keep the old owner or reviewer when no eligible replacement exists and emit the guarded public-title notice. Preserve budget-relay behavior when sharing that implementation.
|
|
42
49
|
|
|
@@ -63,7 +70,7 @@ Scope: the task flow, assignment, the state machine and the hub's MCP tools. Rea
|
|
|
63
70
|
- Admit a declared extra (a person-started `ahub claude --as` instance and a headless Claude implementer included, #742, #747) as owner of any class whose owner role is implementer (`ownerRoleOfClass`) only with the current implementer role and `ownerIsolation[id] === true`, the daemon's proof that the live adapter generation started in `executionRoots[id]` outside the canonical cwd. Never derive it from the declaration's `worktree`, its roles or a reload. Only the status path passes a display `ownerIsolation` projection (`stalled(projection)`); every admission and effect caller uses fresh `TasksDeps.ownerIsolation`.
|
|
64
71
|
|
|
65
72
|
- Lifecycle identity (#694): the hub links `sdlc.repo`/`issue` only through `Tasks.linkIssue` (the one issue `planIssueIdentity` resolves) at propose and accept (`linkOnWrite`, #723: a local parse, never a read, never a refusal, advise and enforce only), plan review, done and the groom backfill (`backfillIssueLinks`: first in `groomingDigest`, 32 links and 1 s per call, before the slow metadata reads), and stages a done's PR through `Tasks.identityLink`/`withLink` (the link carries the repository and the commit or branch it was read for, and is dropped when the done's effective repository or head changed during the read; the issue is re-resolved at apply time; `reviewRequestAdmission` compares the board copy through the same `stage` projection) (`openPrFor`: the one open PR whose head is the done's full commit, or with no commit its branch; a full 100-row page or a malformed row is unknown). Persist a done's link only in the admitted done update or `done (checking)`, never before a gate that can still throw `PreEffectToolRefusal` (#254); reapply it after every re-read in `complete()`. Write a first link with `linkedReceipt`, never `sdlcReceipt` (its relink rule would drop red-first and local-gate records); never relink an existing or foreign identity, never parse agent text for a PR, skip PII tasks before any read, and run the groom backfill after its authority checks with its own bound.
|
|
66
|
-
-
|
|
73
|
+
- Manual spec acceptance (#481 S1) is written only by `Tasks.acceptSpec` for the person; never accept it from a tool or a receipt. Only `Tasks.readSpecAcceptance` may stage host proof of existing person consent from an older cancelled task whose whole local `supersededBy` reference names the destination, for the same canonical repository/issue and unchanged host-read `lastEditedAt`; require bounded complete source metadata, current public source/destination/context and authority, preserve the original acceptance time, and copy no plan/review/artifact evidence (#1328 T4). Spec gates are read-only; `Tasks.commitSpecCarry` publishes consent and HUB provenance atomically with an admitted outer write through `Board.updateWithSpecAcceptance`, using the opaque proof and host Symbol capability. Refused admission publishes neither consent nor provenance. The daemon uses `Tasks.acceptReviewed` to bind spec and plan readbacks to one task snapshot before `Tasks.accept`; retain its synchronous missing-spec and plan-admission refusals. Apply WIP and plan admission before `done` implicitly accepts proposed work and before cohort writes. Never read or store an issue body: identity and edit times only.
|
|
67
74
|
- Test integrity (#481 S4, `src/hub/test-integrity.ts`): in enforce only the person relinks an established `sdlc.repo` or `issue`. A supplied `redFirst` that fails `publicMetadataText` on a public task is refused pre-effect, and `publicView` drops one that fails it later. Integrity is read only for a non-PII task with current PR evidence; otherwise it is unknown with a blocker, never a pass. Enforce adds `test integrity:` blockers to review admission and the merge queue. All gh reads of one lifecycle gate or status share one 20 s deadline; never give each read its own.
|
|
68
75
|
|
|
69
76
|
- Preserve planner-reviewed cost keys when an accept replaces only file-list intent; explicit enforce scope drift needs a new planner receipt. New enforce plan-review receipts require typed review/CI scopes; keep legacy missing scope unspecified until its planning revision invalidates it. Run premature-review admission before done/cohort writes, recheck state and actor authority after every await, and keep admission separate from the review brief. In advise, discard readback evidence after quiet-only history appends and continue with unknown readiness, without another external read; re-derive a changed reviewer from the current task before sending review, refuse other drift and keep enforce strict. Recheck final completion fences after delayed admission, and tell the owner through the private-aware task notice to call done again when delayed completion is refused only if the task remains in_progress with the owner that started the check. Scope is cost metadata, never a permission or reviewer bypass.
|
|
@@ -86,7 +93,7 @@ Scope: the task flow, assignment, the state machine and the hub's MCP tools. Rea
|
|
|
86
93
|
- `review.same_family = "never"` (#820) is read only inside `assign()` through `reviewPool.sameFamily`, which `Tasks.health()` and `reviewPoolOptions` pass from `d.review.same_family` (absent for the default `"fallback"`, so default routing stays byte-identical). It removes every same-family reviewer: the selector's last-resort loop (`selectReviewerPool` `sameFamily`), the legacy `automatic` fallback, a named same-family reviewer (refused with code `family`, `same family as <owner>; review.same_family is never`) and the planner escape unless the planner holds the reviewer role and is of another family. Nobody left means `reviewer = "user"` with `reviewBlocked`, never `sameFamilyFallback`, and that holds for any automatic exhaustion (all offline, no candidate, no declared instance), never `reviewer: none, done will approve directly`; the person fallback is keyed on the setting, not on an eligible same-family candidate. Keep it out of call sites: `Tasks` never tests the family itself.
|
|
87
94
|
- `Tasks.retryReviewer` is host-only (the daemon's reviewer `onUnavailable`), never a tool or CLI path. It acts only while the failed peer is still the reviewer of an `in_review`, non-PII task, with the same review head, the request's `reviewRequestRevision` and a current child generation; `valid()` rechecks all of it after every await and right before the write, which also passes the flow revision. A manually named reviewer's `no_verdict` and a no-verdict with no declared pool go only to the person; other manually named failures keep explicit person control. Confirm fallback only after accepted reviewer publication or a person offer and a fresh binding/generation check; failed publication or notification never confirms settlement. Each failed peer is tried once per head and round (`reviewerFailure` history). `reviewRequestRevision` counts only role events (`done`, `reviewer changed`, `reviewer unavailable`, ownership), so bookkeeping never fences a request; keep `refs.reviewRevision` and `refs.commit` on the review envelope.
|
|
88
95
|
- Release trains (#481 S11): change trains only through `Tasks.newRelease`, `configureRelease`, `assignRelease` and `cutRelease` (planner or person), and refuse every `hub_release_*` in a PII turn. `assignRelease` writes only `release` and refuses a frozen, shipped or dropped release on either side; private or pinned scope is person-only. One active or frozen train at a time. A cut freezes only through `Board.freezeRelease` after a fresh `releaseWindow` (host lease from `readReleaseHostAdmission`, quota, `current()`, at most 5 s old); unknown evidence defers, and the window is closed in `finally`. A cut never publishes, tags or upgrades, and upgrade and recovery never consult `releaseWindow`. Keep two of `RELEASE_TRAIN_HISTORY_LIMIT` slots for cut and ship; a configuration no-op appends nothing. An S9 plan receipt survives only contiguous planning revisions that changed exactly `["release"]`.
|
|
89
|
-
- Release authorization (#481 S6, `src/hub/sdlc-release-authorization.ts`): the console user or the one configured conductor through `sdlc authorize-release` creates one under the same admission as `sdlc merge` (tools role, matching configured conductor, no `toolsOwner`, private turn or caller PII context). Keep the actual asker in receipt `by` and the audit, and the cooperative explicit-person-instruction rule in AGENTS.md Releasing.
|
|
96
|
+
- Release authorization (#481 S6, `src/hub/sdlc-release-authorization.ts`): the console user or the one configured conductor through `sdlc authorize-release` creates one under the same admission as `sdlc merge` (tools role, matching configured conductor, no `toolsOwner`, private turn or caller PII context). Keep the actual asker in receipt `by` and the audit, and the cooperative explicit-person-instruction rule in AGENTS.md Releasing. Read policy only from `.agenthub/config.json` committed at the candidate commit; ignore `.agenthub/config.local.json` release keys with a notice and keep release policy outside runtime `HubConfig` and settings reload. Defaults are `release.version: package.json` and `release.docs: checker`; `release.version` may be `release-notes` with a safe `release.notesPath` template or `none`, and `release.docs: none` is recorded as an explicit exemption without a freshness digest. Bind consent to the current HEAD, the configured source's exact version, the origin identity and docs policy; recheck source, policy, HEAD and origin after any await and on every guard. The read-only release report may select only the most recent receipt matching exact HEAD, repo, origin and committed policy; revalidate the notes blob for that receipt version, never infer a tag-only version or use a stale receipt, and leave version undetermined without an eligible authorization. `docs:none` reports the exemption without a docs read. It lives in daemon memory only: a restart revokes it and the event is audit, never restored. `release-guard` and `release-guard-hook` are refused in a private turn; a tag push needs a matching receipt, and npm publish also a clean tracked worktree and committed package version that independently identifies the configured target. Never accept authorization from a tool, a task receipt or a file.
|
|
90
97
|
- `Board.update`'s untouched-return exception is the only way owned or accepted work returns to backlog: keep every condition (exact event, owner and reviewer null, state, `expectedFlowRevision`, non-empty note, no work evidence) and reach it only through `Tasks.returnUntouchedToBacklog` (#481 S9). Optional return `fields` accepts only `reserved`, follows the existing reservation authority and target-admission rules before and after screening, and saves the reservation with Board-derived planning history and revision in the same state write before capacity notices or auto-pull; omitted fields retain the plan (#1154).
|
|
91
98
|
- The main-checkout note (`mainCheckoutWarning`, `src/hub/main-checkout.ts`, #572) is advisory text in the `hub_task_done` result, the review request and status, never a refusal. A branch name or other metadata the hub reads from outside the board reaches task text only after `Tasks.publicMetadataText` (PII patterns, secret shapes, private paths) and a plain ref-name check; otherwise use the generic sentence that carries none of it.
|
|
92
99
|
|
|
@@ -20,7 +20,7 @@ Scope: tests, fakes and the test gate. Read before adding or changing a test or
|
|
|
20
20
|
- A fixture that needs a port takes it from a free-port probe, never a fixed number, which collides with whatever holds it on a shared runner (#548). The probe binds `127.0.0.1`, matching the loopback server that takes the port (#232).
|
|
21
21
|
- `ahub upgrade` without `--to` asks the registry (`npm view`) and hands a target newer than the CLI to `bun x` (#272): a test that reaches either puts a fake `npm` first on `PATH` and a recording stand-in for `process.execPath`, as `test/upgrade-cli.test.ts` does. The interactive screens are tested through a scripted `ScreenIO`; a CLI test that needs them marks `process.stdin` and `process.stdout` as terminals in a wrapper script.
|
|
22
22
|
- Cross-process fixtures wait for the consuming client to process its handshake (the channel connected diagnostic), not merely the daemon's attached/idle state. Deadline-routing fixtures hold and release responses at the fallback decision; do not place a fixed sleep between deadline fractions and assume scheduler headroom (#287). Receipt-order fixtures use the normal watchdog for ordinary I/O, trigger expiry after observed native acceptance, and await a consumed transport barrier before asserting on late results.
|
|
23
|
-
- Companion tests
|
|
23
|
+
- Companion tests moved with the companions to STAIxBWLB/ahub-orca, ahub-herdr and ahub-claude (#1387); read their `AGENTS.md` there. What stays here is `test/companion-contract.test.ts`, which holds ahub to `docs/contracts/companion-cli-v1.json`: a daemon fixture with positive and absent optional fields, the `shellQuote` vectors, the needs and `pausedNote` producer cases and the guard that ahub names no companion.
|
|
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.
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
{
|
|
2
|
+
"contract": "companion-cli",
|
|
3
|
+
"version": 1,
|
|
4
|
+
"since": "0.37.0",
|
|
5
|
+
"about": "The only things the companion repositories (STAIxBWLB/ahub-orca, ahub-herdr, ahub-claude) may assume about ahub. Removing or renaming a listed path, changing a listed closed set, an argv form, the exit code or the stderr prefix needs companion-cli-v2.json beside this file and a hub_task_handoff to each companion repository. Adding a field needs neither. test/companion-contract.test.ts holds ahub to it.",
|
|
6
|
+
"types": {
|
|
7
|
+
"semver": "string matching MAJOR.MINOR.PATCH with an optional -pre or +build suffix",
|
|
8
|
+
"string": "non-empty string",
|
|
9
|
+
"absolute-path": "string starting with /",
|
|
10
|
+
"count": "non-negative safe integer",
|
|
11
|
+
"count-map": "object whose keys are in values and whose values are counts",
|
|
12
|
+
"enum": "string in values",
|
|
13
|
+
"true": "the boolean true",
|
|
14
|
+
"false": "the boolean false",
|
|
15
|
+
"prefixed": "string equal to one of values or starting with one of prefixes",
|
|
16
|
+
"object": "plain object"
|
|
17
|
+
},
|
|
18
|
+
"commands": [
|
|
19
|
+
{ "argv": ["status", "--json"], "reads": "status" },
|
|
20
|
+
{ "argv": ["--project", "<id|root>", "status", "--json"], "reads": "status" },
|
|
21
|
+
{ "argv": ["projects", "--json"], "reads": "projects" },
|
|
22
|
+
{ "argv": ["ui"] },
|
|
23
|
+
{ "argv": ["--project", "<id|root>", "ui"] },
|
|
24
|
+
{ "argv": ["console"] },
|
|
25
|
+
{ "argv": ["--project", "<id|root>", "console"] },
|
|
26
|
+
{ "bin": "acon", "argv": ["ui"] }
|
|
27
|
+
],
|
|
28
|
+
"noHub": { "exitCode": 1, "stderrPrefix": "ahub: no hub running for " },
|
|
29
|
+
"status": {
|
|
30
|
+
"version": { "type": "semver", "presence": "always" },
|
|
31
|
+
"projectId": { "type": "string", "presence": "always" },
|
|
32
|
+
"cwd": { "type": "absolute-path", "presence": "always" },
|
|
33
|
+
"tasks": { "type": "count-map", "presence": "always", "values": ["backlog", "proposed", "in_progress", "in_review", "approved", "changes_requested", "cancelled"] },
|
|
34
|
+
"peers": { "type": "object", "presence": "always" },
|
|
35
|
+
"peers.<id>.state": { "type": "enum", "presence": "always", "values": ["idle", "busy", "paused", "offline"] },
|
|
36
|
+
"peers.<id>.queued": { "type": "count", "presence": "always" },
|
|
37
|
+
"peers.<id>.attached": { "type": "false", "presence": "when the peer has no adapter attached; absent otherwise" },
|
|
38
|
+
"peers.<id>.needsReview": { "type": "count", "presence": "when nonzero; absent when zero" },
|
|
39
|
+
"peers.<id>.pullOnly": { "type": "true", "presence": "when the peer reads messages only through hub_inbox; absent otherwise" },
|
|
40
|
+
"peers.<id>.paused": { "type": "prefixed", "presence": "when paused; absent otherwise", "values": ["manual"], "prefixes": ["budget: "] },
|
|
41
|
+
"needs": { "type": "object", "presence": "always" },
|
|
42
|
+
"needs.act": { "type": "count", "presence": "always" },
|
|
43
|
+
"needs.watch": { "type": "count", "presence": "always" },
|
|
44
|
+
"needs.state": { "type": "string", "presence": "always" },
|
|
45
|
+
"needs.first": { "type": "object", "presence": "when any item needs the person; absent otherwise" },
|
|
46
|
+
"needs.first.kind": { "type": "string", "presence": "with needs.first; \"approval\" is a pending permission request" },
|
|
47
|
+
"needs.first.level": { "type": "enum", "presence": "with needs.first", "values": ["act", "watch"] },
|
|
48
|
+
"needs.first.until": { "type": "count", "presence": "when the item expires (milliseconds since the epoch)" },
|
|
49
|
+
"needs.first.peer": { "type": "string", "presence": "when the item belongs to a peer" }
|
|
50
|
+
},
|
|
51
|
+
"projects": {
|
|
52
|
+
"[]": { "type": "object", "presence": "one per registered project" },
|
|
53
|
+
"[].id": { "type": "string", "presence": "always" },
|
|
54
|
+
"[].root": { "type": "absolute-path", "presence": "always" },
|
|
55
|
+
"[].state": { "type": "string", "presence": "always; readers recognise running and stopped, any other value reads as unknown" }
|
|
56
|
+
},
|
|
57
|
+
"shellQuote": [
|
|
58
|
+
{ "in": "it's $(x)", "out": "'it'\\''s $(x)'" },
|
|
59
|
+
{ "in": "", "out": "''" },
|
|
60
|
+
{ "in": "a b", "out": "'a b'" },
|
|
61
|
+
{ "in": "'", "out": "''\\'''" },
|
|
62
|
+
{ "in": "''", "out": "''\\'''\\'''" },
|
|
63
|
+
{ "in": "$(x)", "out": "'$(x)'" },
|
|
64
|
+
{ "in": "`x`", "out": "'`x`'" },
|
|
65
|
+
{ "in": "a\nb", "out": "'a\nb'" },
|
|
66
|
+
{ "in": "é", "out": "'é'" },
|
|
67
|
+
{ "in": "\\", "out": "'\\'" },
|
|
68
|
+
{ "in": "a;b&c|d", "out": "'a;b&c|d'" }
|
|
69
|
+
]
|
|
70
|
+
}
|
package/docs/design/adapters.md
CHANGED
|
@@ -49,6 +49,76 @@ Optional ports have explicit meaning: absent keeps the generic path, while prese
|
|
|
49
49
|
|
|
50
50
|
Adapters translate different interaction surfaces without changing the peer's task identity. Claude's plugin channel connects through MCP and the hub control service; Codex is proxied through app-server; ACP peers share an ACP transport; Pi uses its extension bridge. Kimi defaults to a pull-only TUI, with headless ACP as a separate selected form under the same peer id. The TUI does not inherit headless push, session, or recovery behavior. Keeping forms distinct lets the hub preserve the native user interaction model while enforcing one role and delivery policy ([#316](https://github.com/STAIxBWLB/agent-hub/issues/316), [#625](https://github.com/STAIxBWLB/agent-hub/issues/625)).
|
|
51
51
|
|
|
52
|
+
## Qwen deny input fence (#888)
|
|
53
|
+
|
|
54
|
+
A successfully appended `allowed: false` has a known delivery disposition, but
|
|
55
|
+
no native completion ACK. The delivery remains `completed` without an answer;
|
|
56
|
+
the adapter stays non-ready with a host-persisted `denyPending: true` latch in
|
|
57
|
+
its existing state file. Persistence must succeed before the append. No BasePeer
|
|
58
|
+
settlement policy or other adapter's readiness behavior changes.
|
|
59
|
+
|
|
60
|
+
The denied turn's assistant/Stop, orphan Stop, result, approval response and
|
|
61
|
+
elapsed silence cannot release the latch. Release requires either a newly
|
|
62
|
+
observed same-session personal USER followed by that personal turn's normal
|
|
63
|
+
`end_turn` assistant and `message_stop`, with uninterrupted generation and verified
|
|
64
|
+
owner identity, or a verified fresh launch generation with native session/version
|
|
65
|
+
and a new verified owner. The event-file byte watermark uses raw newline offsets
|
|
66
|
+
to exclude pre-deny frames. A recovery USER must begin wholly at or after the
|
|
67
|
+
deny/adoption EOF boundary; finishing an older partial line never qualifies.
|
|
68
|
+
Malformed, invalid UTF8, oversized or unsupported
|
|
69
|
+
evidence invalidates unfinished proof; control/tool frames cannot preserve a
|
|
70
|
+
candidate final assistant for a later orphan Stop. A failed persisted clear
|
|
71
|
+
restores the latch and goes offline before advisory callbacks, with a storage
|
|
72
|
+
and permissions cause that remains until a successful clear, even if a logger
|
|
73
|
+
or notice throws.
|
|
74
|
+
For a fenced fresh launch, a host process-table baseline must positively show
|
|
75
|
+
no existing process naming the exact input path before any rotation, truncation
|
|
76
|
+
or launch preparation. An unknown table or unverified existing root leaves
|
|
77
|
+
those files unchanged and produces no launcher; a missing saved owner is never
|
|
78
|
+
evidence of absence. Ordinary trusted-owner adoption retains its prior behavior.
|
|
79
|
+
The fenced path also requires a positively verified empty event file before
|
|
80
|
+
input truncation or launch preparation. Failed event rotation or empty-file
|
|
81
|
+
verification leaves input unchanged and produces no launcher; old session_start
|
|
82
|
+
bytes cannot bind a later owner as fresh generation proof.
|
|
83
|
+
Detach, changed file/session/owner and adoption invalidate an unfinished personal
|
|
84
|
+
proof; restored buffered frames cannot supply a new personal USER. Same-generation
|
|
85
|
+
readability and replayed session_start never supply fresh launch proof.
|
|
86
|
+
Every fenced reattachment moves the watermark to restored EOF, including when
|
|
87
|
+
the inode is unchanged. A buffered partial USER completed after reattachment is
|
|
88
|
+
also excluded. Use a plain, tool-free clearing prompt and wait for its final
|
|
89
|
+
Stop: tool/control activity can invalidate the pending final-assistant candidate;
|
|
90
|
+
recovery through a tool-assisted turn is not promised.
|
|
91
|
+
Fenced personal and fresh-generation recovery only mark a RAM completion
|
|
92
|
+
candidate; neither the parser nor the owner monitor reopens input. Release waits
|
|
93
|
+
until the whole observed read frontier has been processed, no partial/discarded frame
|
|
94
|
+
remains, fresh FD EOF equals the consumed offset, the named file still matches
|
|
95
|
+
that FD, and owner/session/generation remain current. A later USER/tool/control
|
|
96
|
+
or lost frame invalidates or replaces the candidate before release. This proves
|
|
97
|
+
only the observed frontier: a future personal input after the final observation
|
|
98
|
+
would require an explicit serialized native idle ACK for an atomic guarantee,
|
|
99
|
+
which this protocol does not provide.
|
|
100
|
+
Fresh candidates bind the actual new launch generation, verified empty source,
|
|
101
|
+
first accepted session header and new owner. A replayed header cannot reset
|
|
102
|
+
activity or manufacture fresh idle proof after a later USER/tool/control frame.
|
|
103
|
+
|
|
104
|
+
`QWEN_DENY_QUIESCENCE_MS` is a 30 s operational wait. Expiry reports offline,
|
|
105
|
+
keeps the latch and queued messages unsubmitted, and directs the person to their
|
|
106
|
+
terminal or `ahub qwen --mode tui`. Passive recovery remains possible after expiry.
|
|
107
|
+
General adoption of an unknown running turn outside this latch retains its prior
|
|
108
|
+
ceiling. These source/fake controls do not qualify a new native completion signal.
|
|
109
|
+
|
|
110
|
+
Every append writes one complete UTF8 Buffer once and checks its byte count.
|
|
111
|
+
A short count or writer exception retains the delivery as `needs_review` and
|
|
112
|
+
goes offline without retrying a remainder. Errors after the writer call,
|
|
113
|
+
including close failure after a full byte count, retain the same uncertainty.
|
|
114
|
+
A non-newline input tail, checked
|
|
115
|
+
before append and attachment/readback, likewise fences input. Personal completion
|
|
116
|
+
cannot reopen this file: a verified fresh generation must start with fresh input.
|
|
117
|
+
The live ambiguous-write latch is RAM-only; after a crash the actual tail is the
|
|
118
|
+
guard. A torn prefix that happens to end with newline remains undetected. The
|
|
119
|
+
upgrade path if that failure is observed is a durable per-write intent record,
|
|
120
|
+
not a synthetic native ACK or an automatic remainder write.
|
|
121
|
+
|
|
52
122
|
## Channel attachment evidence (#1171)
|
|
53
123
|
|
|
54
124
|
The Claude plugin's inherited launcher marker is insufficient to enable push. In the inspected Claude Code 2.1.318 client path, MCP initialization advertises no usable channel opt-in; the plugin's server capability is not client evidence. The fallback checks the direct parent's bounded process row for the existing launcher's exact leading development-channel flag and supported target. Unknown, malformed, truncated or changed-parent evidence, print/background forms and repeated flags keep the plugin tools-only, with messages waiting for `hub_inbox`. The check does not walk ancestors or treat the marker as an authorization token.
|
|
@@ -91,10 +161,24 @@ takeover or permission evidence. It carries no environment, argv, cwd, credentia
|
|
|
91
161
|
or text, adds no event, log or memory payload, and is withheld from `status.json` and every
|
|
92
162
|
non-console reader. The field is additive and optional; no control protocol version changes.
|
|
93
163
|
|
|
164
|
+
Status `peerVersions` says, per peer, which agent-hub code that peer has loaded (#1385). It sits
|
|
165
|
+
beside `peers`, as `roleInfo` does, so the legacy peer row keeps its shape (#295). The optional
|
|
166
|
+
`hubClient` port belongs to an adapter whose agent-hub code runs in another process (the Claude
|
|
167
|
+
channel's `WsPeer`); an adapter without it runs inside the daemon and reports
|
|
168
|
+
`ahub: { runs: "daemon", version }`. With the port, the entry reports `runs: "client"` and the version
|
|
169
|
+
the attached socket's hello sent as `clientVersion`, `unreported` for a hello without one, and no
|
|
170
|
+
`ahub` field while nothing is attached. `ahubTools` lists the sorted distinct versions the peer's
|
|
171
|
+
open `tools` connections reported. The daemon keeps a reported version only when it is a plain
|
|
172
|
+
semver of at most 64 characters (`displayVersion`, `src/version.ts`); anything else is unreported.
|
|
173
|
+
The fields are display only, never compatibility, admission or protocol evidence, and are
|
|
174
|
+
additive: an older daemon ignores `clientVersion`, and an older console ignores both fields.
|
|
175
|
+
|
|
94
176
|
## Accepted channel delivery settlement (#1172)
|
|
95
177
|
|
|
96
178
|
Only an attached push channel opts into explicit disposition of its own accepted delivery. An `accepted` receipt acknowledges that the notification was accepted by the channel transport; it is not a native handling or task-completion signal. The host reads `bus.accepted_settle_ms` from accepted configuration on its existing maintenance sweep, defaulting to ten minutes. A row that remains unconfirmed becomes `needs_review` with no replay. `hub_inbox` returns bounded id/revision metadata for the channel's accepted and held rows, including when an accepted push prevents the pull itself. The plugin renders that metadata and avoids both an empty-inbox claim and polling advice while there is an actionable row. Important, task and review timeouts produce one durable status-kind, status-priority conductor message containing ids only when the existing `conductor.feed` policy is on; `feed: off` remains an opt-out. Pull-only sessions do not gain the explicit accepted-disposition port.
|
|
97
179
|
|
|
180
|
+
The channel's `hub_inbox` also renders the authenticated caller's bounded public held-body view (#1328 AC6), labelled read-only and uncertain. It occupies a separate MCP text content block, preserving the first block for queued/local messages, notices and existing held hints. It does not confirm, retry or resolve the earlier attempt. Malformed or unavailable additive held data produces a fixed warning while preserving normal pulled text, local failed-push messages and queue counts. A foreign peer argument grants no access; other-peer inspection remains with the person or configured conductor through queue diagnostics. Current privacy and owned task/session fences are checked by the daemon before exposure.
|
|
181
|
+
|
|
98
182
|
## Permissions, execution, and process ownership
|
|
99
183
|
|
|
100
184
|
Permission modes control whether native actions prompt; they do not widen a sandbox or path grant. The local worker's file tools use path guards, and its command tools run through the host's OS sandbox. Vendor-native tools use their vendor/runtime permission and isolation boundaries; the hub does not claim to confine every ACP or TUI tool. This distinction prevents an approval-mode setting from being mistaken for filesystem or network confinement ([#242](https://github.com/STAIxBWLB/agent-hub/issues/242), [#39](https://github.com/STAIxBWLB/agent-hub/issues/39), [#270](https://github.com/STAIxBWLB/agent-hub/issues/270)).
|
|
@@ -113,10 +197,35 @@ retains ownership and the profile for an explicit stop retry ([#1284](https://gi
|
|
|
113
197
|
|
|
114
198
|
Permission decisions are bound to the authenticated caller and current session. A hub CLI call inside an agent session acts as that peer, not as the person; role and task checks still apply at each tool boundary. Permission modes are person-controlled, and a conductor role does not grant them. This avoids turning a received message into user consent ([#193](https://github.com/STAIxBWLB/agent-hub/issues/193), [#242](https://github.com/STAIxBWLB/agent-hub/issues/242)).
|
|
115
199
|
|
|
200
|
+
## Confined guidance probe lifecycle (#1226 T2)
|
|
201
|
+
|
|
202
|
+
The host-only `LocalPeer.runProbe` / `stopProbe` path reuses the local model/tool
|
|
203
|
+
loop on a fresh private peer that never joins Bus or ordinary recovery. Ordinary
|
|
204
|
+
`deliver` retains its existing behavior. Probe purpose suppresses ordinary
|
|
205
|
+
capture, history, messaging, titles, route/usage/progress observers and learning;
|
|
206
|
+
private correlated admissions and usage records remain separate. Stop closes
|
|
207
|
+
new admissions and joins the actual run and owned cleanup before claiming
|
|
208
|
+
quiescence. Unknown work retains its handle and hold.
|
|
209
|
+
|
|
210
|
+
The [guidance probe contract](guidance-probes.md#t2-confined-adapter-contract)
|
|
211
|
+
owns the complete-request binding, role input matrix, fixed model, resource
|
|
212
|
+
reservations, path guards and verified deny-only sandbox. Its v1 tool capability
|
|
213
|
+
is read/write/edit only. No arbitrary subprocess, hub, memory, package or network
|
|
214
|
+
tool is available. The adapter factory is not wired into the daemon; source and
|
|
215
|
+
fake-model checks and the model-free macOS boundary canary are separate from a
|
|
216
|
+
real model/worker trial, which has not been authorized.
|
|
217
|
+
|
|
116
218
|
## Model, account, and memory boundaries
|
|
117
219
|
|
|
118
220
|
Subscription-based native CLIs keep their own account authentication; those credentials are not pooled through the hub. Hub-owned inference, including internal summaries and local-worker model calls, uses the in-process model route and OmniRoute provider boundary. Prompt text may inform configured routing, but it cannot grant credential access or replace host routing policy. The optional local-worker adec consumer (#554) releases only bounded host-screened evidence, after campus/privacy and observer admission; native account, TUI, reviewer and task-assignment authority are unchanged. Shadow preserves the gateway model/effort and conversation; enforcement is refused at configuration load and no pair is applied. An explicit live model override bypasses the decision service. Current board/turn privacy and observer authority fence the optional request across waits and its proposal before telemetry; an authority change refuses the stale turn, and the refusal is not converted into a fixed-model fallback. There is no new gateway or native turn/spawn effort path. This separates native subscription identity from hub service credentials ([#553](https://github.com/STAIxBWLB/agent-hub/issues/553)).
|
|
119
221
|
|
|
222
|
+
R2 uses that same separation for `plan_execute` phase and `advisor`/`escalation`
|
|
223
|
+
judge model/effort suggestions. The hub retains phase transitions, judge
|
|
224
|
+
triggers and verdicts, escalation confirmation and actual fallback execution;
|
|
225
|
+
the service has no authority over native account identity, peer assignment or
|
|
226
|
+
provider calls. A `decisionTarget: "judge"` event is bounded metadata, not a
|
|
227
|
+
served-model or usage record.
|
|
228
|
+
|
|
120
229
|
The PII screen is distinct from ordinary optional inference. It may use an on-device model; a gateway screen requires positive on-campus admission and `onCampusOnly`. If no allowed path returns a closed `clear` or PII verdict before the deadline, the result is unknown and handled as private. This keeps network and model uncertainty from becoming a disclosure ([#198](https://github.com/STAIxBWLB/agent-hub/issues/198)).
|
|
121
230
|
|
|
122
231
|
Runtime memory capture and recall use the in-process `@staix/agent-mem` package, screened and invoked by host integration. claude-mem is off by default and import-only; there is no worker HTTP or model-summary path in the runtime. This avoids a parallel capture route with different privacy checks ([#752](https://github.com/STAIxBWLB/agent-hub/issues/752), [agent-mem#13](https://github.com/STAIxBWLB/agent-mem/issues/13)).
|
|
@@ -169,8 +278,12 @@ its existing native-identity admission, independently of Kimi reviewer isolation
|
|
|
169
278
|
compatibility. Only Kimi Code CLI 2.5.2 headless is currently enabled, through
|
|
170
279
|
`session/set_config_option` with `configId: model` and the
|
|
171
280
|
[model-free setter receipt](../verification/2026-11-08-kimi-252-model-setter-1317.md).
|
|
172
|
-
Qwen remains unavailable
|
|
173
|
-
|
|
281
|
+
Qwen remains unavailable pending a separate setter admission. Its historical
|
|
282
|
+
A/B/B evidence did not retain the third request's purpose. The
|
|
283
|
+
[suggestions-off receipt](../verification/2026-11-11-qwen-setter-suggestions-off.md)
|
|
284
|
+
records ordinary A/B/A on exact 0.26.9 and 0.27.0 under isolated normal settings;
|
|
285
|
+
this adds candidate evidence, without enabling a production setter or qualifying
|
|
286
|
+
real accounts, default-on suggestions, TUI or Linux. Jcode headless A/B/A passed, but its shared-TUI turn fence
|
|
174
287
|
across failover remains unqualified; its production setter stays unavailable. A native TUI or external adapter cannot acquire a setter from an
|
|
175
288
|
advertisement or a registry label.
|
|
176
289
|
|
|
@@ -130,7 +130,15 @@ recovery transaction and bus recovery hold are clear.
|
|
|
130
130
|
## Models and memory
|
|
131
131
|
|
|
132
132
|
|
|
133
|
-
Peer selection, hub-owned model routing, and provider access are distinct layers. Task routing chooses a peer; the in-process route selects a model for hub-owned inference; OmniRoute owns provider keys, provider fallback, and usage. Native CLIs retain their own account and provider configuration; subscription OAuth credentials are not pooled through the gateway.
|
|
133
|
+
Peer selection, hub-owned model routing, and provider access are distinct layers. Task routing chooses a peer; the in-process route selects a model for hub-owned inference; OmniRoute owns provider keys, provider fallback, and usage. Native CLIs retain their own account and provider configuration; subscription OAuth credentials are not pooled through the gateway. Routing runs in process through the hub-owned route implementation. An opt-in `decision` route may consult the loopback agent-decide policy service; execution and provider access remain in the hub and OmniRoute, with the existing heuristic as the consumer fallback. This keeps worker-provider credentials and provider failover in one gateway; the optional policy consult does not proxy the worker's inference traffic ([#553](https://github.com/STAIxBWLB/agent-hub/issues/553)).
|
|
134
|
+
|
|
135
|
+
For the later host-route question slice, the same loopback service can suggest
|
|
136
|
+
an alias/effort for an existing `plan_execute` phase or `advisor`/`escalation`
|
|
137
|
+
judge call. The phase, host trigger, verdict parsing, escalation latch and
|
|
138
|
+
executor fallback remain owned by the hub; shadow records the proposal without
|
|
139
|
+
applying it. The judge observation is separately marked in route metadata and
|
|
140
|
+
does not create a served-model or usage claim. The ADEc policy examples are
|
|
141
|
+
placeholders, not deployed configuration or evidence of model quality.
|
|
134
142
|
|
|
135
143
|
Person-owned live model overrides (#1317) are runtime state in `hub.db`, not
|
|
136
144
|
configuration edits. The host owns person admission, desired-versus-applied
|
|
@@ -184,4 +192,4 @@ The architecture does not claim that a fixture proves a real provider account, n
|
|
|
184
192
|
|
|
185
193
|
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.
|
|
186
194
|
|
|
187
|
-
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. 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.
|
|
195
|
+
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.
|
package/docs/design/bus.md
CHANGED
|
@@ -9,6 +9,8 @@ paths:
|
|
|
9
9
|
- src/hub/envelope.ts
|
|
10
10
|
- src/hub/limits.ts
|
|
11
11
|
- src/hub/delivery-journal.ts
|
|
12
|
+
- src/hub/delivery-public.ts
|
|
13
|
+
- src/hub/memory-policy.ts
|
|
12
14
|
- src/hub/delivery-superseded.ts
|
|
13
15
|
- src/hub/deferred-hub.ts
|
|
14
16
|
- src/cli/reset.ts
|
|
@@ -78,6 +80,12 @@ metadata-only aggregate does not hydrate delivery payloads ([#1178](https://gith
|
|
|
78
80
|
|
|
79
81
|
A peer may settle its own local `needs_review` row as completed or discard while busy, with the observed revision and a public-safe reason; this records a delivery decision and never changes task state or redelivers the original. Another peer or a remote-room actor remains refused. Active `dispatching` rows remain refused; an `accepted` row is settleable only by its explicit push channel owner as described below. Invocation-bearing rows also remain person-settled because a transport action cannot assert the outcome of an invoked operation. `hub_inbox` may pass a `needs_review` hold to return newer queued messages and bounded id/revision metadata naming the held row, while leaving the uncertain originals held. Pause, recovery, lifecycle, storage, and active-delivery fences still apply. This lets the current recipient make progress without treating uncertain work as delivered ([#1079](https://github.com/STAIxBWLB/agent-hub/issues/1079), [#445](https://github.com/STAIxBWLB/agent-hub/issues/445), [#991](https://github.com/STAIxBWLB/agent-hub/issues/991)).
|
|
80
82
|
|
|
83
|
+
`hub_inbox` also offers a read-only view of the authenticated recipient's own held originals (#1328 AC6). It reads `needs_review` rows, plus `accepted` rows only for the current explicit-settlement channel. This is inspection of an uncertain earlier attempt, never a new handout, retry, ACK, resolution or task-offer read. Repeated views leave delivery state, revision, attempt, resolution audit and bus queues unchanged. Normal queued pulls and local failed-push fallback retain their existing semantics; a failed held component cannot discard an already committed normal pull.
|
|
84
|
+
|
|
85
|
+
The held view selects at most 32 recipient rows with a 33rd-row sentinel and bounds raw UTF-8 JSON in SQL before hydrating originals, using the host's `bus.pull_budget_bytes`; callers cannot choose a recipient, state set or budget. Oversized, truncated and unavailable content is named explicitly. Bodies reuse the public queue body projection: current private or missing tasks and private envelopes are stubs, metadata screening withholds unsafe text, and rendered bodies are sanitized. The owned implementer additionally needs its current launch, execution root, generation and task; review-only item restrictions remain in force. No failure/room/resolution metadata or condensed `out` is added to this body view.
|
|
86
|
+
|
|
87
|
+
An observer-excluded held view latches observer exclusion in RAM without a durable handout receipt. As a conservative ceiling, readable observer-excluded held inputs (trusted review packages and host-stamped peer chat/status responses) exclude capture/progress across restart until explicit disposition, even if unread; queued/deferred review rows do not acquire this new ceiling. An overflowing or unreadable row/byte window also remains unknown and excluded: a previously viewed row can move outside that window. Unknown storage excludes observers, and incomplete or corrupt legacy provenance withholds held bodies without refreshing or repairing metadata. This can later narrow with host-verified read provenance, never by inventing transport acceptance.
|
|
88
|
+
|
|
81
89
|
An explicit push channel may settle or discard its own `accepted` row with the observed revision and a public-safe reason. `accepted` means the channel transport accepted the notification, not that the session handled it. If neither a native completion nor an explicit disposition arrives within the configured `bus.accepted_settle_ms` window, the host moves the row to `needs_review` with a fixed timeout cause and never replays it. The channel's `hub_inbox` metadata includes its own accepted and held rows, with ids and revisions, even while an active accepted delivery blocks pulling. An important, task, or review timeout adds one ids-only status notice when a conductor is configured and its existing `conductor.feed` policy is on; `feed: off` remains an explicit opt-out. Timed-out rows stay held until a person or the explicit channel session records a disposition; task state does not settle them ([#1172](https://github.com/STAIxBWLB/agent-hub/issues/1172)).
|
|
82
90
|
|
|
83
91
|
An `answer` envelope (#1053) is a person's late answer to a question a peer asked with `hub_ask`. The hub builds it: `kind: "answer"`, `from: user`, addressed to the asking peer only, with the deterministic id `answer-<set>` (a republish after a crash is dropped by the bus's own dedupe) and `refs.question`. Code keys on `kind`, never on the sender, and an `answer` never supersedes the question it answers. Its body is the person's text, so the log line, the console tail and the dashboard feed show a fixed stub; only the recipient reads it. A question expiry is a hub `status` notice, never an answer.
|