@staix/agent-hub 0.36.0 → 0.38.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +6 -2
  3. package/THIRD_PARTY_NOTICES.md +0 -18
  4. package/docs/agent-notes/README.md +13 -3
  5. package/docs/agent-notes/daemon.md +4 -4
  6. package/docs/agent-notes/local-worker.md +1 -0
  7. package/docs/agent-notes/models.md +2 -1
  8. package/docs/agent-notes/tasks.md +1 -1
  9. package/docs/agent-notes/tests.md +1 -2
  10. package/docs/contracts/companion-cli-v1.json +70 -0
  11. package/docs/design/adapters.md +43 -2
  12. package/docs/design/agent-hub-architecture.md +9 -1
  13. package/docs/design/guidance-probes.md +1167 -0
  14. package/docs/design/model-routes.md +437 -12
  15. package/docs/dogfood.md +12 -13
  16. package/docs/events.md +20 -1
  17. package/docs/memory.md +3 -3
  18. package/docs/operations.md +123 -151
  19. package/docs/profiles.md +1 -1
  20. package/docs/quickstart.md +15 -3
  21. package/docs/research.md +1 -1
  22. package/docs/sdlc.md +5 -3
  23. package/docs/security.md +25 -1
  24. package/docs/specs/2026-09-19-agent-hub-design.md +9 -7
  25. package/docs/specs/2026-10-04-switchyard-source-port-design.md +3 -1
  26. package/docs/verification/2026-11-08-qwen-0269-model-setter-1317.md +25 -11
  27. package/docs/verification/2026-11-09-qwen-0270-model-setter-1317.md +21 -6
  28. package/docs/verification/2026-11-11-0.37.0.md +40 -0
  29. package/docs/verification/2026-11-11-0.38.0.md +41 -0
  30. package/docs/verification/2026-11-11-guidance-probe-t2-1226.md +153 -0
  31. package/docs/verification/2026-11-11-guidance-probe-t3-1226.md +85 -0
  32. package/docs/verification/2026-11-11-guidance-probe-t4-1226.md +65 -0
  33. package/docs/verification/2026-11-11-qwen-setter-suggestions-off.md +167 -0
  34. package/docs/verified.json +25 -25
  35. package/package.json +3 -4
  36. package/plugins/agent-hub/.claude-plugin/plugin.json +1 -1
  37. package/plugins/agent-hub/kimi-hook.js +2403 -1444
  38. package/plugins/agent-hub/server.js +2480 -1509
  39. package/src/adapters/channel-peer.ts +7 -1
  40. package/src/adapters/claude-channel.ts +2 -1
  41. package/src/adapters/compat.ts +1 -1
  42. package/src/adapters/local-probe.ts +233 -0
  43. package/src/adapters/local-worker.ts +232 -21
  44. package/src/cli/console-state.ts +25 -6
  45. package/src/cli/console-versions.ts +99 -0
  46. package/src/cli/console.ts +13 -1
  47. package/src/cli/help.ts +2 -1
  48. package/src/cli/init.ts +3 -1
  49. package/src/cli/install-paths.ts +7 -2
  50. package/src/cli/main.ts +78 -7
  51. package/src/cli/output.ts +8 -4
  52. package/src/cli/runtime-version-warning.ts +2 -2
  53. package/src/cli/sdlc-output.ts +9 -5
  54. package/src/cli/upgrade-runtime.ts +1 -1
  55. package/src/hub/bus.ts +2 -2
  56. package/src/hub/config-apply.ts +4 -2
  57. package/src/hub/config-trust.ts +6 -1
  58. package/src/hub/control-client.ts +5 -2
  59. package/src/hub/daemon.ts +195 -13
  60. package/src/hub/envelope.ts +6 -1
  61. package/src/hub/events.ts +3 -2
  62. package/src/hub/guidance-probe-store.ts +1044 -0
  63. package/src/hub/guidance-probes.ts +692 -0
  64. package/src/hub/inference.ts +18 -5
  65. package/src/hub/manager.ts +24 -1
  66. package/src/hub/operational-authority.ts +14 -1
  67. package/src/hub/peers.ts +5 -0
  68. package/src/hub/person-command.ts +25 -0
  69. package/src/hub/ports.ts +1 -1
  70. package/src/hub/progress.ts +23 -16
  71. package/src/hub/report.ts +2 -0
  72. package/src/hub/research.ts +1 -0
  73. package/src/hub/restart.ts +7 -0
  74. package/src/hub/sdlc-release-authorization.ts +139 -17
  75. package/src/hub/sdlc-release-policy.ts +100 -0
  76. package/src/hub/sdlc-release.ts +59 -7
  77. package/src/hub/supervision.ts +3 -2
  78. package/src/hub/tasks.ts +363 -7
  79. package/src/local/probe-errors.ts +28 -0
  80. package/src/local/probe-sandbox.ts +224 -0
  81. package/src/local/probe-types.ts +110 -0
  82. package/src/local/probe-workspace.ts +426 -0
  83. package/src/local/sandbox.ts +71 -2
  84. package/src/local/tools.ts +135 -9
  85. package/src/models/route/advisor-trigger.ts +88 -0
  86. package/src/models/route/config.ts +21 -17
  87. package/src/models/route/conversation-view.ts +179 -0
  88. package/src/models/route/decision-evidence.ts +1 -1
  89. package/src/models/route/decision.ts +114 -19
  90. package/src/models/route/escalation-control.ts +30 -0
  91. package/src/models/route/hub-prompts.ts +97 -0
  92. package/src/models/route/judge-choice.ts +155 -0
  93. package/src/models/route/judge-replies.ts +102 -0
  94. package/src/models/route/labels.ts +14 -70
  95. package/src/models/route/observation-signals.ts +250 -0
  96. package/src/models/route/plan-execute-choice.ts +27 -0
  97. package/src/models/route/relay-selector.ts +2 -2
  98. package/src/models/route/runtime.ts +115 -52
  99. package/src/models/route/turn-state.ts +77 -0
  100. package/src/omniroute/client.ts +3 -0
  101. package/src/ui/guidance-panel.ts +34 -2
  102. package/src/ui/guidance-view.ts +33 -0
  103. package/src/ui/plugin.ts +80 -23
  104. package/src/version.ts +4 -0
  105. package/templates/AGENTS.block.md +14 -14
  106. package/templates/adec/README.md +32 -0
  107. package/templates/adec/ahub.plan-execute.json +23 -0
  108. package/templates/adec/ahub.stage.json +23 -0
  109. package/templates/profiles/general.json +1 -1
  110. package/templates/profiles/research.json +1 -1
  111. package/templates/profiles/writing.json +1 -1
  112. package/LICENSES/Apache-2.0.txt +0 -204
  113. package/src/models/route/advisor.ts +0 -102
  114. package/src/models/route/escalation.ts +0 -82
  115. package/src/models/route/judge.ts +0 -23
  116. package/src/models/route/normalize.ts +0 -103
  117. package/src/models/route/plan-execute.ts +0 -52
  118. package/src/models/route/prompts.ts +0 -8
  119. package/src/models/route/signals.ts +0 -247
  120. package/src/models/route/state.ts +0 -54
  121. package/src/models/route/text.ts +0 -61
@@ -0,0 +1,1167 @@
1
+ ---
2
+ id: guidance-probes
3
+ type: module
4
+ title: Fake-Only Guidance Probe Admission
5
+ status: draft
6
+ parent: agent-hub-architecture
7
+ depends-on: [guidance-experiments, task-board]
8
+ references: [adapters, execution-reference]
9
+ implements: []
10
+ covers: [guidance-probes]
11
+ tags: [agent-hub, dogfood]
12
+ paths:
13
+ - src/hub/guidance-probes.ts
14
+ - src/hub/guidance-probe-store.ts
15
+ - src/hub/tasks.ts
16
+ - src/hub/operational-authority.ts
17
+ - src/hub/daemon.ts
18
+ - src/hub/control-client.ts
19
+ - src/hub/restart.ts
20
+ - src/cli/main.ts
21
+ - src/cli/help.ts
22
+ - test/guidance-probes.test.ts
23
+ - test/guidance-probes-control.test.ts
24
+ - test/guidance-probes-recovery.test.ts
25
+ - test/fakes/guidance-probe-provider.ts
26
+ - src/adapters/local-worker.ts
27
+ - src/local/probe-types.ts
28
+ - src/adapters/local-probe.ts
29
+ - src/local/probe-workspace.ts
30
+ - src/local/probe-sandbox.ts
31
+ - src/local/tools.ts
32
+ - src/local/sandbox.ts
33
+ - src/omniroute/client.ts
34
+ - test/guidance-probe-local-worker.test.ts
35
+ - test/guidance-probe-input-matrix.test.ts
36
+ - test/guidance-probe-sandbox.test.ts
37
+ - test/omniroute.test.ts
38
+ - src/hub/manager.ts
39
+ - src/ui/plugin.ts
40
+ - src/ui/guidance-panel.ts
41
+ - src/ui/guidance-view.ts
42
+ - test/guidance-probe-status.test.ts
43
+ - test/guidance-probe-console.test.ts
44
+ - test/guidance-probe-cli.test.ts
45
+ - test/guidance-probe-gate.test.ts
46
+ - test/helpers/guidance-probe-tasks.ts
47
+ ---
48
+
49
+ # Fake-only guidance probe admission
50
+
51
+ This draft defines the #1226 T1 manifest, private ledger and host admission boundary. It is a contract proposal for review before implementation. T1 can exercise the boundary with constructor-injected fixture ports. Production has no probe runner and refuses execution before reserving an active lane or session slot. Registration is an inert private declaration, not permission to execute.
52
+
53
+ No #1226 task authorizes a real worker, model or live experiment. A later confined worker implementation, receipts, cleanup and any live admission require their own accepted contract. A fake launch result proves fixture behavior only. It cannot attest native confinement, served model identity, usage, quiescence, cleanup or improvement.
54
+
55
+ This feature does not activate guidance, edit roles, complete tasks, record review outcomes, train or select models, route ordinary work, or feed memory, capture, progress or learning. The host stamps `guidance_probe` purpose; it does not impersonate a PII task or reviewer to obtain exclusions. Existing LocalPeer, adapters, sandbox and ExecutionBudget behavior remains unchanged.
56
+
57
+ ## Manifest and units
58
+
59
+ `GuidanceProbeManifestV1` is a closed, inert JSON record. All containers have own enumerable data properties only; unknown keys, accessors and unsupported values refuse. Parse errors disclose a fixed reason and next step, never task bodies or raw manifest content. The parser does not read files, resolve references, call models or grant authority.
60
+
61
+ The proposed manifest fields are:
62
+
63
+ - `v: 1`.
64
+ - `projectKey` and `experimentId`: nonempty opaque identifiers, at most 256 UTF-8 bytes and 256 UTF-16 code units, using the existing execution-reference identifier grammar. They are private identities, not paths or instructions.
65
+ - `task`: exact task id, creation epoch and recorded flow revision. Integers are nonnegative safe integers; task ids and epochs retain the owning Task contract.
66
+ - `role`: role id, layer and frozen baseline SHA-256. Its current catalog identity must independently match at admission.
67
+ - `inputs`: exact SHA-256 commitments and UTF-8 byte lengths for retained private task input, fixed baseline context, explicit data/role policy and system policy snapshots. `codeTree` is a native Git tree OID with its object format: 40 lowercase hexadecimal characters for SHA-1 or 64 for SHA-256. It is not silently recast as a SHA-256 content digest. A commitment is not proof that content was safely materialized.
68
+ - `runtime`: exact runtime, toolset and model-configuration hashes. There are no commands, executable paths, URLs, runner selectors, credentials or config overlays.
69
+ - `model`: `requested` and `expectedServed`, each exactly `qwen27b/qwen3.8-27b`. No slash splitting, normalization, fallback or alias resolution is permitted. An absent or different observed served value makes the observation incomparable.
70
+ - `guidance`: the frozen catalog baseline identity and exact guidance SHA-256. Candidate worker slots bind separately admitted existing G1 content ids at start, after their preregistered proposal or compose stage; initial candidate hashes are not required before those authoring stages.
71
+ - `improverContextHash`, optional: a frozen experience SHA-256 commitment available only to explicitly declared proposer/composer inputs, paired with `improverContextBytes`. It is not a worker input channel.
72
+ - `slots`: an ordered closed plan of at most nine attempts: required baseline and candidate1 worker attempts, at most four total `worker` attempts and at most five total editor attempts, with role caps of two `proposal`, one `compose`, one `select` and one `reflect`. Editors are optional, including a zero-editor baseline/preexisting-candidate comparison. Each slot has an opaque unique id, role and arm/stage binding; array position is its ordinal. `retryOf`, when present, names an earlier compatible slot. Each slot is one attempt, including a failed attempt, and every retry also counts against its role cap.
73
+ - `limits`: aggregate model calls, tool calls and elapsed milliseconds; optional aggregate token limit; and `inputBytes`, `scratchBytes`, `outputBytes` storage reservations. Values are nonnegative safe integers. The three storage reservations sum to at most 1,073,741,824 bytes (1 GiB), checked without unsafe addition. There is no new experiment-count cap or arbitrary maximum on the other declared budgets.
74
+ - `taskOrderSeed`, optional: ordering metadata only. It is never represented as a model sampling seed.
75
+
76
+ All SHA-256 values are exactly 64 lowercase hexadecimal characters, with an explicit length check. The canonical manifest limit is 32,768 UTF-8 bytes, a new V1 format contract. This is a serialization bound, not a model or spending budget. Raw snapshots are private, retained separately and charged against the declared input reservation; they are not public manifest/status fields.
77
+
78
+ ## Closed V1 schema
79
+
80
+ The following interfaces list every accepted key. Type aliases describe runtime validation, not TypeScript-only assurances. Every string is valid Unicode without forbidden controls; opaque identifiers use the existing execution-reference grammar. Optional properties must be absent or valid, never present with `undefined`. Arrays are dense, own data-property arrays. Parsers check serialized/raw byte ceilings before walking nested elements.
81
+
82
+ Opaque identifiers are not task/context text grammar. Text snapshots may contain code and LF/CR/TAB, which are preserved byte-for-byte without trimming or newline normalization. Malformed Unicode and other control characters refuse; G1 editable-prose restrictions do not apply to these snapshots.
83
+
84
+ ```ts
85
+ type ProbeSha256 = string; // Exactly 64 lowercase hex characters.
86
+ type ProbeId = string; // Nonempty, <=256 UTF-8 bytes and UTF-16 units.
87
+ type ProbeInteger = number; // Nonnegative safe integer, no coercion.
88
+ type ProbeTree =
89
+ | { objectFormat: "sha1"; oid: string } // Exactly 40 lowercase hex.
90
+ | { objectFormat: "sha256"; oid: string }; // Exactly 64 lowercase hex.
91
+ interface ProbeSnapshotRef { sha256: ProbeSha256; bytes: ProbeInteger }
92
+ interface ProbeRoleIdentity {
93
+ id: ProbeId;
94
+ layer: "shipped" | "project";
95
+ baselineSha256: ProbeSha256;
96
+ }
97
+ type ProbeArm = "baseline" | "candidate1" | "candidate2" | "successor";
98
+ type ProbeStage = "baseline" | "proposal1" | "candidate1" | "proposal2"
99
+ | "candidate2" | "compose" | "successor" | "select" | "reflect";
100
+ type ProbeSlot = {
101
+ id: ProbeId;
102
+ stage: ProbeStage;
103
+ role: "worker" | "proposal" | "compose" | "select" | "reflect";
104
+ arm: ProbeArm | "none";
105
+ retryOf?: ProbeId;
106
+ };
107
+ interface GuidanceProbeManifestV1 {
108
+ v: 1;
109
+ projectKey: ProbeId;
110
+ experimentId: ProbeId;
111
+ task: { id: number; created: ProbeInteger; flowRevision: ProbeInteger };
112
+ role: ProbeRoleIdentity;
113
+ inputs: {
114
+ task: ProbeSnapshotRef;
115
+ baselineContext: ProbeSnapshotRef;
116
+ dataPolicy: ProbeSnapshotRef;
117
+ systemPolicy: ProbeSnapshotRef;
118
+ codeTree: ProbeTree;
119
+ };
120
+ runtime: {
121
+ runtimeSha256: ProbeSha256;
122
+ toolsetSha256: ProbeSha256;
123
+ modelConfigSha256: ProbeSha256;
124
+ };
125
+ model: {
126
+ requested: "qwen27b/qwen3.8-27b";
127
+ expectedServed: "qwen27b/qwen3.8-27b";
128
+ };
129
+ guidance: { baselineSha256: ProbeSha256 };
130
+ improverContextHash?: ProbeSha256;
131
+ improverContextBytes?: ProbeInteger;
132
+ slots: readonly ProbeSlot[];
133
+ limits: {
134
+ modelCalls: ProbeInteger;
135
+ toolCalls: ProbeInteger;
136
+ elapsedMs: ProbeInteger;
137
+ tokens?: ProbeInteger;
138
+ inputBytes: ProbeInteger;
139
+ scratchBytes: ProbeInteger;
140
+ outputBytes: ProbeInteger;
141
+ };
142
+ taskOrderSeed?: ProbeInteger;
143
+ }
144
+ ```
145
+
146
+ Task id is a positive safe integer; `created` and `flowRevision` follow the existing Task epoch/revision contract. Baseline uses the current catalog role id/layer/baseline hash, not a fabricated no-change G1 variant. The catalog baseline hash and `guidance.baselineSha256` are separate commitments: catalog identity versus exact rendered baseline guidance. The latter is computed from the retained current baseline, not inferred from an id. Candidate/successor bindings require an existing G1 variant id, candidate SHA-256, current task epoch/flow and the same current catalog baseline.
147
+
148
+ Registration carries a closed private envelope with exactly `{ manifest, snapshots }`. `snapshots` has exactly `task`, `baselineContext`, `dataPolicy`, `systemPolicy`, and optional `improverContext`. Its presence exactly matches both optional manifest keys `improverContextHash` and `improverContextBytes`; either all three are present and agree or all are absent. Text snapshots are exact UTF-8 strings; the data policy is canonical JSON with the closed shape below. Each snapshot has a 32,768-byte per-row ceiling, a new V1 bound separate from the manifest format bound. All retained snapshot bytes must fit the combined `limits.inputBytes` reservation, including retained baseline guidance, late-bound candidate guidance and any retained prepared frames; duplicate stored copies are charged for their actual retained bytes. G1 role snapshots retain their stricter existing 8 KiB ceiling. Oversize or insufficient combined reservation refuses before writes, never trims. No omitted/unavailable policy snapshot is accepted merely because its hash is present. None of these private snapshots appear in public status.
149
+
150
+ The derived registration serialization ceiling is `manifestBytes + policyBytes + 4 * 2 * snapshotBytes + envelopeScaffoldBytes`. The four text snapshots can each expand by at most two for JSON escaping because only LF/CR/TAB, quotes and backslashes require escaping among their admitted characters; malformed Unicode and other controls refuse. `envelopeScaffoldBytes` is computed from the exact closed empty envelope, not guessed from a caller budget. This ceiling applies to the combined envelope, not separately admitted 32 KiB components. The host baseline binding has its own bounded record; session-row JSON is bounded by four record ceilings (host binding, child binding, last effect and fixed session metadata). Each component is validated within its own ceiling before composing that session row. SQL applies the appropriate per-column/per-session cap before parsing, never an accidental 32 KiB cap to the whole registration or session. Recovery hashes bounded components incrementally rather than canonicalizing an entire experiment into a single 32 KiB buffer.
151
+
152
+ ```ts
153
+ interface ProbeDataPolicyV1 {
154
+ v: 1;
155
+ allowedWrites: readonly { root: "scratch" | "output"; relative: ProbeId }[];
156
+ admittedData: readonly { id: ProbeId; sha256: ProbeSha256; bytes: ProbeInteger }[];
157
+ roles: {
158
+ worker: { dataIds: readonly ProbeId[]; guidanceOnlyExperience: true };
159
+ proposal: { dataIds: readonly ProbeId[]; improverContext: boolean };
160
+ compose: { dataIds: readonly ProbeId[]; improverContext: boolean };
161
+ select: { dataIds: readonly ProbeId[]; anonymizedDeliverables: true };
162
+ reflect: { dataIds: readonly ProbeId[]; closedRoundOnly: true };
163
+ };
164
+ }
165
+ interface ProbePrivateSnapshots {
166
+ task: string;
167
+ baselineContext: string;
168
+ dataPolicy: ProbeDataPolicyV1;
169
+ systemPolicy: string;
170
+ improverContext?: string;
171
+ }
172
+ interface ProbeRegistrationV1 {
173
+ manifest: GuidanceProbeManifestV1;
174
+ snapshots: ProbePrivateSnapshots;
175
+ }
176
+ ```
177
+
178
+ The policy snapshot explicitly declares writes, admitted data and each role's data membership. Ids are unique; every role data id names an admitted entry. Relative write names are lexical declarations, not resolved paths: absolute paths, parent traversal, empty components and NUL/control characters refuse. The snapshot's byte ceiling bounds list cardinality; no separate historical experiment cap is added. Parsing and hashing do not resolve addresses, inspect Git objects or claim confinement. Later materialization must independently enforce these declarations.
179
+
180
+ `guidanceProbeManifestKey` hashes the canonical parsed manifest with a versioned domain separator. Canonicalization has fixed property order, preserves slot order and exact admitted string bytes, and omits absent optional fields. The content id excludes time, mutable status, actor/session authority and any tested flag. Registration additionally binds the actual host actor privately. A matching hash never substitutes for current host admission.
181
+
182
+ Actual `workerEffectiveInputHash`, observed non-guidance input hash, served model and usage are observations. They cannot overwrite frozen manifest commitments or be manufactured from requested values. The worker hash covers only exact worker-visible input-frame bytes; host reservation tokens, experiment/arm/slot ids and accounting callbacks are not model-visible bytes. Frozen editor `improverContextHash` is separate and cannot be substituted for the worker input hash. Fake observations remain explicitly fixture observations.
183
+
184
+ ## Input separation and comparability
185
+
186
+ The ledger declares which inputs a role may receive. It does not claim to enforce OS or native worker confinement in T1.
187
+
188
+ | Role | Permitted declared input | Excluded input |
189
+ | --- | --- | --- |
190
+ | Worker | Current bound task, fixed baseline context, one admitted guidance slot | Direct experience, other arm outputs, selector/evaluator material, operator/control receipts |
191
+ | Proposer/composer | Task, bounded permitted source references and closed probe artifacts; separately declared frozen improver context | Hidden rubric, future corpus, live homes, Git object stores, other undeclared sources |
192
+ | Selector | Anonymized deliverables and declared permitted task sources | Arm identity, hidden evaluator/rubric and control receipts |
193
+ | Reflector | Closed-round evidence | Future rounds and undeclared experience |
194
+
195
+ A retrieval-only control, if declared, renders through the same guidance slot; it cannot add a worker side channel. Baseline and candidate fake input frames compare exact non-guidance bytes. A declared frame, path or worktree name is not proof of materialization or confinement. The later worker contract must establish those facts independently.
196
+
197
+ Unknown, missing or mismatched fixed inputs, model identity, runtime/toolset/config, usage coverage or role-input coverage cannot be presented as a comparable result. Unknown usage and cost are not zero. No sampling or monetary claim is inferred from request metadata. A token-limited effect cannot proceed when the required token accounting is unavailable.
198
+
199
+ ## Authority and currentness
200
+
201
+ All writes and effects enter through Tasks. CLI and daemon only parse, authenticate and delegate; they never open a writable ledger. The declaration cannot name an actor, session or authority override. Minimal T1 register/start/show/cancel access is limited to the person or the one currently configured authorized conductor, using the existing operational-authority admission path. A console delegation, ordinary peer or live-test session cannot borrow USER authority.
202
+
203
+ Tasks' private bridge reuses its current request/private/review/recovery fences, requires the unique configured conductor to remain rostered and inside an admitted operational context, and uses the current public Task/repository scope before source reads. New snapshot text passes existing pure nameable/secret checks. G1 is rendered first, then the exact sanitized rendered guidance actually handed off passes raw nameable/secret checks plus first-party lexical path-candidate/private-policy checks; its private raw role-file provenance is not screened as worker input. Unlike an opaque address field, actual prose such as "merge/release" is not private solely because it contains a slash under an unrelated deny rule. A candidate matching private lexical policy or its literal prefix refuses. This is a lexical screen, not alias discovery or confinement proof. Raw candidate SHA remains separate metadata. No new model, file/address resolver or generation path is added. Historical metadata show does not return raw snapshots. Narrowing cancellation does not rescreen stored prose or require a still-applicable G1, while retaining its specified current caller/Task-epoch/privacy fences.
204
+
205
+ Tasks captures and revalidates project identity, actual actor/roster/conductor currentness, peer identity, session generation/native session, current task epoch/flow and privacy/review-only context across every await and immediately before each write or fake effect. A private turn or private/PII task refuses before content leaves its existing private boundary. Unknown or missing current proof refuses with a next step.
206
+
207
+ Private session generation is an exact bounded identifier string or nonnegative safe integer, matching the existing Peer contract without coercion/hash/default zero. The daemon mints a per-connection UUID for each authenticated console or tools connection, never a control token or daemon-wide person epoch. For console requests, that UUID is both `sessionGeneration` and `requestConnectionId`. A conductor captures its actual Peer generation/native session and the original live socket fence, plus the separate connection UUID comparator. Tasks captures a host-only `guidanceProbes.session(by)` context with generation/nativeSession/requestConnectionId/current callback at admission; that callback closes over the original request/socket authority, rather than consulting a later request's ambient context. A new connection for either caller cannot replay a prior connection's start CAS, even when the conductor's native session is unchanged. The IDs are durably stored only as private replay comparators; they never restore or attest live authority.
208
+
209
+ The host-only `TasksDeps.guidanceProbes` dependency contains Store, optional fakePorts/editor-frame preparer, session context reader and optional timer.set/clear seam. There is no corresponding config/wire runner, session or timer selector. `guidanceProbesPending()` counts owned in-process admissions/launch/stop/drain work, not persisted held lanes; zero does not prove unknown durable work quiescent. `stopGuidanceProbes()` aborts and requests stop only for captured owned reservation/generation, then awaits actual launch and stop settlements. Its named operational 5,000 ms bound rejects with cause/next step on a noncooperative fixture, retains unsettled handles and durable hold, and never claims zero/drained, refunds/releases or closes Store/Board beneath callbacks. A later explicit drain can finish once those actual promises settle. Daemon awaits it before its finally-bearing cleanup/stopped-notification path; a rejected drain is retryable explicitly while new admissions remain fenced.
210
+
211
+ Only active owned fake work has one watchdog: named operational interval 250 ms, scheduled with `setTimeout(min(interval, remainingMs))`. It rechecks the captured currentness/clock; nonpositive remaining time aborts/stops without rescheduling, and cancel/finish clears the handle. Small chunks avoid the JavaScript long-timeout overflow without a new manifest duration cap. Timer handles are wrapped with an explicit absence sentinel so valid zero/null handles clear correctly. A stale callback checks active-map identity before any Store write/effect. Tests inject the host-only scheduler/clock, never a global clock, and explicitly release/drain noncooperative fixture promises in cleanup.
212
+
213
+ New registration and session start require an already accepted task in `in_progress` or `changes_requested`. There is no implicit assignment/acceptance, no generic MOVES change, and no bypass of existing Task, role, SDLC or operational guards. Historical show is separate from fresh applicability.
214
+
215
+ Admission requires the current catalog role/baseline to match the frozen commitment and the selected existing G1 to remain current and unwithdrawn. Historical availability is not applicability. Probe admission cannot create another owner's G1, substitute USER or the owner as the caller, or obtain applicability by trusting a manifest field. An internal host-only predicate may inspect the existing private G1 binding under the probe's actual authorized actor; it grants no G1 write authority.
216
+
217
+ Registration is checked for current admission before deduplication. A stale duplicate does not turn an old declaration into a current permit. A duplicate with the exact current immutable identity returns the existing closed receipt, without a new lane, slot or launch grant. A conflicting declaration refuses. Cancellation intent and historical terminal records never resurrect.
218
+
219
+ Each reserved session retains its original start selector: requested experiment CAS revision, selected slot, child variant (or null), actual actor and captured session identity. After full fresh actor/Task/G1/privacy/review/operational admission, exact replay of that selector returns the retained experiment receipt with `already: true`, without another grant, bind, launch or counter/revision change. It remains recognizable while reserved/running, after later effects/settlement and after reopening the store. Diagnostic queued time is excluded. Changed actor/session authority or selected variant refuses rather than rebinding. Stored identity is a replay comparator, never current authority or an attestation.
220
+
221
+ Tasks may use the host-private bounded `startSelector(key, requestedRevision)` read to select the original slot/child for fresh source-owner G1 revalidation. It must not use today's next planned slot for a historical replay, and must perform current caller/Task outer admission before this lookup. Withdrawn/changed original G1 or a now-closed Task can therefore refuse a replay even though the historical selector exists. No new wire operation, public raw snapshot or history scan is introduced.
222
+
223
+ Cancellation relaxes only frozen flow equality and current G1 applicability to narrow already-owned existing work. It retains current person/configured-conductor authority, session, project, Task epoch, privacy/review-only and operational guards. It persists intent, never launches or releases. Cleanup of an already-owned fake handle after a fence is lost is a separate host duty, not a new caller privilege.
224
+
225
+ The private `cancelRequested` boolean records admitted intent independently of receipt state, strictly stored as SQLite integer 0 or 1. Once true it survives holds, unknown settlements, stop and reopen; it is digest-covered and never reset/refunded. New grants refuse it, while an exact historical replay can only return an already/held receipt. Cancellation of an already terminal experiment is a no-op and must not turn a false flag true or claim new intent. The closed public status may expose the boolean to explain a held cancellation; write receipts do not echo actor/body/snapshots. Earlier unreleased private prototype fixture databases with incompatible fields fail closed and must be recreated explicitly by their fixture owner, not silently migrated/erased; no public database marker is bumped.
226
+
227
+ Known input/authority refusals before the first Board/store write may be PreEffectToolRefusal. Storage, hydration, readback and unknown wrapped errors remain plain fixed safe errors, including rollback failures. After a reservation, an unknown outcome is never described as safely retryable.
228
+
229
+ ## Private storage and atomic admission
230
+
231
+ `GuidanceProbeStore` opens the same hub.db through `openHubDatabase`, retaining its schema preflight and named busy timeout. It creates additive private tables only; it does not bump the database marker or spread fields into Task/public Board records.
232
+
233
+ - `guidance_probe_manifests`: immutable canonical declaration, binding, private actor, lifecycle revision and fixed aggregate counters/unknown flags, keyed by project and manifest id, with `UNIQUE(projectKey, probeExperimentId)` binding that private experiment id to exactly one root manifest forever.
234
+ - `guidance_probe_lanes`: one row per project, pointing to the retained experiment/session owner and generation.
235
+ - `guidance_probe_sessions`: at most nine preregistered slot rows per experiment, with session CAS revision, state, fixed counters and one current/last effect descriptor.
236
+
237
+ `BEGIN IMMEDIATE` atomically checks the project lane, experiment/session revisions and legal transition, then reserves the slot and aggregate resource counters before `fakeLaunch`. Failed and retried attempts consume their declared slot and resource reservations. There are no refunds, per-arm resets or implicit retries. No more than one session runs at a time, including editing/reflection sessions. An exact duplicate returns the persisted state and never authorizes a second effect.
238
+
239
+ A changed manifest hash under the same project/probe experiment id refuses rather than creating fresh four/five-attempt or call budgets. A separately preregistered experiment id can declare a separate repetition; there is no global experiment-count cap. Probe experiment identity is independent from a selected G1's experiment id. Selection still requires the same Task epoch/current flow and current catalog baseline.
240
+
241
+ The elapsed ceiling is wall time since the first session reservation/admission, including editor attempts, failures, gaps and downtime. Its persisted high-water never decreases or resets per arm. Clock regression or uncertain elapsed coverage holds admission. This is an admission ceiling, not measured model time or monetary cost.
242
+
243
+ The Store owns a trusted constructor-injected clock (Date.now by default, fixture clock only in tests). It samples inside each critical section after the write-lock and synchronous currentness callback, immediately before granting. A queued input timestamp is diagnostic only. The persisted/granted effect descriptor contains the actual admission sample, and usage/settlement must correlate that returned descriptor. A model-only session does not require tool quota; a tool is charged/refused only when requested by runEffect. Zero remaining model/session/time/input capacity cannot bootstrap another session.
244
+
245
+ Immediately before fake launch or invocation of a freshly granted effect, the host checks abort and calls Store `checkInvocation(reservation, revalidate)` for a fresh locked clock/currentness/deadline check, then checks abort again without an intervening await. Known exhausted time cannot launch work, and an already-consumed grant is not refunded. Phase2 runtime also owns the remaining experiment deadline, abort propagation and stop of in-flight work; Phase1 does not claim real worker timers, quiescence or hard native time enforcement merely because the next call is gated.
246
+
247
+ Each session retains only its current/last effect: generation, monotonic sequence, unit, amount, descriptor hash, pending/settled/unknown state and usage-applied identity. Exact replay returns state without an effect grant. Older, future or conflicting descriptors refuse. An unresolved or uncertain effect blocks the next sequence and holds its reservation. Late, unknown or unattributed usage sets a sticky unknown flag; it cannot silently reduce totals or become zero. Storage admission covers inputs, scratch and output together.
248
+
249
+ `admitEffect` runs its actual-actor/Task/G1/session/privacy revalidation callback inside its own `BEGIN IMMEDIATE`, after acquiring the write-lock, not merely before waiting for it. A model-call admission atomically reserves its declared token amount too when a token ceiling applies; lack of the required amount refuses before the effect. An already granted attempt can be settled/accounted after authority is lost as narrow host bookkeeping, but no further effect is admitted without the full fresh fence.
250
+
251
+ Queries are exact-key indexed reads. Session hydration selects at most ten rows (nine plus a corruption sentinel), with SQL raw JSON byte checks before parsing. There is no public historical scan, caller-selected budget or state-scope override. No historical experiment-count cap is introduced.
252
+
253
+ Recovery integrity streams ordered experiment keys, then exact-key session rows with the same ten-row sentinel and bounded per-row memory; orphan/duplicate/malformed state is not silently ignored. Missing legacy tables represent no probe state. Present but unreadable/incomplete state refuses recovery rather than manufacturing a clean ledger.
254
+
255
+ The manifest/session/lane/orphan passes share one SQLite read transaction and therefore one coherent snapshot. Every lane read uses the same typed, byte-bounded SQL projection, including validity bits that distinguish a legitimate NULL slot from an oversized/invalid field projected to NULL. Project, manifest and non-null slot identifiers must parse, resolve to their retained records and agree with state; corrupt references never masquerade as a free lane.
256
+
257
+ `ponytail:` recovery integrity is O(historical experiments + sessions), with sessions bounded by nine per experiment, not constant-time. If measured recovery time warrants an upgrade, add keyset paging and a separately reviewed verification budget; do not silently truncate this scan or invent a new refusal budget in T1.
258
+
259
+ ## Lifecycle and fake effect boundary
260
+
261
+ The lifecycle distinguishes an inert declaration, reserved/active fixture work, cancellation/closing intent, closed fixture observation and unknown-held state. The final enum and allowed transitions are closed in the parser/store. A closed fixture observation is not a native success receipt.
262
+
263
+ Production permits inert registration under the current privileged gates. Start checks runner absence before any active lane/session/resource reservation or late-binding write. Fake ports are injected only through host test constructors, never selected by wire data, CLI options, project config, imports or a model id. The port types are defined here independently, without importing the protected routing ports or routing implementation.
264
+
265
+ An admitted fake session receives a host-created reservation token and bounded fixture input. Before invocation Tasks checks the reservation CAS and all current fences again. Completion is accepted only for that generation/session/effect identity. Pending work participates in the daemon's existing stop/recovery drain. Cancellation first persists narrowing intent and aborts owned pending work, then requests fixture stop; missing stop proof retains the lane. Restart, uncertain launch, cancellation or stop never auto-respawns, releases a lane or erases counters.
266
+
267
+ The fake launch additionally receives host-created callbacks bound to exactly that reservation and the actual caller's captured/current authority. They are separate function arguments, never part of worker input or wire data. The Tasks-private `runEffect` wrapper checks the sequence/descriptor, calls atomic store admission with the synchronous fresh fence, consumes a fresh grant once, and only then invokes the supplied fake effect. An existing replay returns persisted state without invoking it. The provider receives no Store, actor override or reusable raw grant. Correlated numeric usage and settlement flow back through this wrapper's private bookkeeping; a posthoc `usage: "known_fixture"` label cannot establish coverage.
268
+
269
+ Before replacing the last descriptor, every granted model attempt must have a matching numeric usage observation or the experiment becomes sticky unknown. Unknown/missing usage, conflicting observations and unattributed/late observations never clear that flag or become zero. A fake effect throwing or losing authority does not undo its reservation. The wrapper records the owned attempt's known result/unknown coverage before returning or rethrowing a safe error, without admitting another effect.
270
+
271
+ Both a proposal-produced candidate and a composed successor bind an already existing, separately current admitted G1 to their next preregistered worker slot. `start(id, revision, variantId?)` takes a variant id only for that next unbound non-baseline worker slot. Tasks reads and validates the existing private G1, then the store atomically binds its immutable child commitment and reserves the session in the same transaction. No separate bind operation or caller-selected slot exists. A bound slot rejects a conflicting variant; its exact duplicate never grants another launch. No child can alter task/tree/fixed input/model/config/toolset/runtime/limits or append a slot. G1 creation remains the owner/person's separate authority; model text never selects or admits its own record.
272
+
273
+ The fixed graph orders baseline worker, optional proposal1, candidate1 worker, optional proposal2, optional candidate2 worker, optional compose, optional successor worker, optional select, then optional reflect. An included proposal/compose stage requires its corresponding candidate/successor worker; a preexisting candidate2/successor need not invent an editor stage. Stage role/arm pairs and their order are fixed. A known-failure retry may occupy only an additional preregistered compatible slot immediately following the failed attempt, consuming the same role cap and aggregate budget. No successful attempt can be repeated for statistical sampling, and an ambiguous attempt cannot be replaced/retried. `start` advances only one explicit eligible slot; it is not an autonomous orchestrator. Controlled authoring requires a closed, comparable in-lane editor session with a matching RAW G1 candidate-file artifact hash, never a supplied flag or rationale. External or ordinary G1 authoring remains admissible if otherwise current, but uncontrolled with unknown cost, never fully measured or zero cost.
274
+
275
+ Fixture completion follows each failed-known attempt's bounded, preregistered adjacent retry chain until its terminal known success, including multiple consecutive failures within the same four/five limits. Every failed outcome and consumed counter remains recorded. After known success only its own adjacent preregistered retries become distinct terminal `not_needed` records, with no generation, launch, resource or budget charge. The read view derives a separate not-needed count; these are never failures. This does not start the next stage: a new explicit start selects the next planned non-retry stage.
276
+
277
+ An exhausted known-failure chain with no remaining compatible retry ends the experiment as `failed_fixture` and releases its lane without launching later stages. Unstarted later stages remain planned records, not fabricated failures or successful work; that terminal experiment cannot start them. When every required stage is covered by known success (possibly after failures/retries) and any unused retries are not-needed, the experiment ends `closed_fixture` and releases its lane. Missing/unresolved or unknown launch/startup/cancel outcomes never skip, retry or release; sticky holds remain held. These rules add no automatic retry, refund, native success proof or hold-reset authority.
278
+
279
+ G1 `candidateSha256` hashes its raw role-file bytes; `guidanceSha256` separately hashes the exact sanitized rendered guidance handed to a worker. The child commitment retains both. Editor artifact provenance compares the raw candidate hash; worker frame/handoff validation compares the rendered guidance hash. They are not interchangeable, and a matching raw hash does not prove rendered bytes.
280
+
281
+ ## Source-owner APIs
282
+
283
+ Types and pure parsing live in `src/hub/guidance-probes.ts`; private SQL lives in `src/hub/guidance-probe-store.ts`. These signatures are the review boundary, not an additional public dispatch surface:
284
+
285
+ ```ts
286
+ parseGuidanceProbeManifest(value: unknown): GuidanceProbeManifestV1 | undefined;
287
+ parseGuidanceProbeRegistration(value: unknown): ProbeRegistrationV1 | undefined;
288
+ guidanceProbeManifestKey(manifest: GuidanceProbeManifestV1): string;
289
+ parseGuidanceProbeCommand(args: readonly string[]): GuidanceProbeCommand | undefined;
290
+
291
+ interface GuidanceProbeStore {
292
+ register(input: ProbeRegistrationV1, binding: ProbeHostBinding,
293
+ revalidate: () => ProbeHostBinding): ProbeReceipt;
294
+ read(key: ProbeKey): ProbeStoredState | undefined;
295
+ startSelector(key: ProbeKey, requestedRevision: ProbeInteger): ProbeStartSelector | undefined;
296
+ reserveSession(input: ProbeSessionAdmission,
297
+ revalidate: () => ProbeAdmissionRecheck): ProbeReservationResult;
298
+ exposeLaunch(reservation: ProbeReservation,
299
+ revalidate: () => ProbeAdmissionRecheck): ProbeReceipt;
300
+ checkInvocation(reservation: ProbeReservation, revalidate: () => ProbeAdmissionRecheck): ProbeReceipt;
301
+ admitEffect(input: ProbeEffectAdmission,
302
+ revalidate: () => ProbeAdmissionRecheck): ProbeEffectAdmissionResult;
303
+ settleEffect(input: ProbeEffectSettlement): ProbeReceipt;
304
+ settleSession(input: ProbeSessionSettlement): ProbeReceipt;
305
+ settlePreLaunchFailure(reservation: ProbeReservation, now: ProbeInteger): ProbeReceipt;
306
+ settleObservedSession(input: ProbeSessionSettlement, usage: "known_fixture" | "unknown"): ProbeReceipt;
307
+ latchHold(reservation: ProbeReservation, reason: "elapsed" | "observation" | "usage"): ProbeReceipt;
308
+ recordUsage(input: ProbeUsageObservation): ProbeReceipt;
309
+ cancelIntent(input: ProbeCancellation,
310
+ revalidate: () => ProbeHostBinding): ProbeReceipt;
311
+ integrity(): ProbeIntegrity;
312
+ }
313
+
314
+ type ProbeState = "declared" | "active" | "closing" | "closed_fixture" | "failed_fixture" | "unknown_held";
315
+ type ProbeSessionState = "planned" | "reserved" | "running" | "failed_known"
316
+ | "closed_fixture" | "not_needed" | "unknown_held";
317
+ type ProbeBudgetUnit = "model_calls" | "tool_calls" | "tokens"
318
+ | "input_bytes" | "scratch_bytes" | "output_bytes";
319
+ interface ProbeKey { projectKey: ProbeId; id: ProbeSha256 }
320
+ interface ProbeHostBinding {
321
+ projectKey: ProbeId;
322
+ actor: PeerId;
323
+ task: { id: number; created: ProbeInteger; flowRevision: ProbeInteger };
324
+ role: ProbeRoleIdentity;
325
+ baselineGuidance: string; // Private existing rendered catalog baseline, <=8 KiB.
326
+ sessionGeneration: ProbeInteger | ProbeId;
327
+ nativeSession: ProbeId | null;
328
+ requestConnectionId: ProbeId;
329
+ }
330
+ interface ProbeChildBinding {
331
+ variantId: ProbeSha256;
332
+ candidateSha256: ProbeSha256;
333
+ guidanceSha256: ProbeSha256;
334
+ task: { id: number; created: ProbeInteger; flowRevision: ProbeInteger };
335
+ role: ProbeRoleIdentity;
336
+ guidance: string; // Private exact existing G1 rendering, existing bound applies.
337
+ authoring: "admitted_fixture" | "uncontrolled";
338
+ sourceSessionId: ProbeId | null;
339
+ }
340
+ interface ProbeSessionAdmission {
341
+ key: ProbeKey;
342
+ expectedRevision: ProbeInteger;
343
+ host: ProbeHostBinding;
344
+ child?: ProbeChildBinding;
345
+ preparedFrame?: ProbePreparedFrame; // Host-only metadata for the exact frame later passed to the fake port.
346
+ now: ProbeInteger; // Queued diagnostic only; Store samples its trusted clock after locking.
347
+ }
348
+ interface ProbePreparedFrame { slotId: ProbeId; sha256: ProbeSha256; bytes: ProbeInteger }
349
+ interface ProbePreparedWorkerFrame { inputFrame: string; nonGuidanceInputSha256: ProbeSha256 }
350
+ type ProbeWorkerFramePreparer = (state: ProbeStoredState, slot: ProbeSlot,
351
+ guidance: string) => ProbePreparedWorkerFrame | Promise<ProbePreparedWorkerFrame>;
352
+ interface ProbeResourceCharges { inputBytes?: ProbeInteger; scratchBytes?: ProbeInteger; outputBytes?: ProbeInteger }
353
+ interface ProbeAdmissionRecheck {
354
+ host: ProbeHostBinding;
355
+ child?: ProbeChildBinding;
356
+ }
357
+ interface ProbeReservation {
358
+ key: ProbeKey;
359
+ slotId: ProbeId;
360
+ generation: ProbeInteger;
361
+ revision: ProbeInteger;
362
+ }
363
+ interface ProbeStartSelector {
364
+ requestedRevision: ProbeInteger;
365
+ slotId: ProbeId;
366
+ variantId: ProbeSha256 | null;
367
+ inputFrameSha256: ProbeSha256 | null;
368
+ inputFrameBytes: ProbeInteger;
369
+ actor: PeerId;
370
+ sessionGeneration: ProbeInteger | ProbeId;
371
+ nativeSession: ProbeId | null;
372
+ requestConnectionId: ProbeId;
373
+ }
374
+ type ProbeReservationResult =
375
+ | { kind: "granted"; reservation: ProbeReservation }
376
+ | { kind: "existing"; receipt: ProbeReceipt };
377
+ interface ProbeEffectAdmission {
378
+ reservation: ProbeReservation;
379
+ sequence: ProbeInteger;
380
+ unit: ProbeBudgetUnit;
381
+ amount: ProbeInteger;
382
+ reservedTokens?: ProbeInteger;
383
+ charges?: ProbeResourceCharges;
384
+ descriptorSha256: ProbeSha256;
385
+ now: ProbeInteger;
386
+ }
387
+ type ProbeEffectAdmissionResult =
388
+ | { kind: "granted"; admission: ProbeEffectAdmission }
389
+ | { kind: "existing"; state: "pending" | "settled" | "unknown" };
390
+ interface ProbeEffectSettlement {
391
+ admission: ProbeEffectAdmission;
392
+ outcome: "settled" | "unknown";
393
+ }
394
+ interface ProbeSessionSettlement {
395
+ reservation: ProbeReservation;
396
+ outcome: "closed_fixture" | "failed_known" | "unknown";
397
+ candidateArtifactSha256: ProbeSha256 | null;
398
+ now: ProbeInteger;
399
+ }
400
+ interface ProbeSessionCoverage {
401
+ inputFrameSha256: ProbeSha256 | null;
402
+ inputFrameBytes: ProbeInteger;
403
+ launchExposed: boolean;
404
+ preLaunchFailure: boolean;
405
+ modelCalls: ProbeInteger;
406
+ modelUsageKnown: ProbeInteger;
407
+ toolCalls: ProbeInteger;
408
+ toolUsageKnown: ProbeInteger;
409
+ usageUnknown: boolean;
410
+ coverageVerified: boolean;
411
+ }
412
+ interface ProbeUsageObservation {
413
+ admission: ProbeEffectAdmission;
414
+ observed: ProbeInteger | null; // Model tokens or tool invocation count; null is unknown.
415
+ observationSha256: ProbeSha256;
416
+ }
417
+ interface ProbeCancellation {
418
+ key: ProbeKey;
419
+ expectedRevision: ProbeInteger;
420
+ host: ProbeHostBinding;
421
+ }
422
+ interface ProbeCounters {
423
+ workerAttempts: ProbeInteger;
424
+ editorAttempts: ProbeInteger;
425
+ modelCalls: ProbeInteger;
426
+ toolCalls: ProbeInteger;
427
+ tokensReserved: ProbeInteger;
428
+ tokensObservedKnown: ProbeInteger;
429
+ inputBytes: ProbeInteger;
430
+ scratchBytes: ProbeInteger;
431
+ outputBytes: ProbeInteger;
432
+ elapsedHighWaterMs: ProbeInteger;
433
+ usageUnknown: boolean;
434
+ }
435
+ interface ProbeReceipt {
436
+ id: ProbeSha256;
437
+ revision: ProbeInteger;
438
+ state: ProbeState;
439
+ already: boolean;
440
+ }
441
+ interface ProbeStoredState {
442
+ registration: ProbeRegistrationV1;
443
+ binding: ProbeHostBinding;
444
+ receipt: ProbeReceipt;
445
+ counters: ProbeCounters;
446
+ firstReservedAt: ProbeInteger | null;
447
+ admissionHold: "none" | "elapsed" | "observation" | "usage";
448
+ cancelRequested: boolean;
449
+ notNeeded: ProbeInteger; // Derived from session records, never an attempt/budget counter.
450
+ sessions: readonly {
451
+ slotId: ProbeId;
452
+ generation: ProbeInteger;
453
+ revision: ProbeInteger;
454
+ state: ProbeSessionState;
455
+ candidateArtifactSha256: ProbeSha256 | null;
456
+ child?: ProbeChildBinding;
457
+ start?: ProbeStartSelector;
458
+ coverage: ProbeSessionCoverage;
459
+ }[]; // <=9; effect descriptor columns are hydrated separately by exact key.
460
+ }
461
+ interface ProbeIntegrity {
462
+ experiments: ProbeInteger;
463
+ sessions: ProbeInteger;
464
+ digest: ProbeSha256;
465
+ }
466
+ interface ProbeFakeLaunch {
467
+ reservation: ProbeReservation;
468
+ slot: ProbeSlot;
469
+ manifest: GuidanceProbeManifestV1;
470
+ inputFrame: string; // Only this role's prepared bounded input, never all snapshots.
471
+ inputSha256: ProbeSha256;
472
+ nonGuidanceInputSha256: ProbeSha256;
473
+ purpose: "guidance_probe";
474
+ }
475
+ interface ProbeFakeObservation {
476
+ reservation: ProbeReservation;
477
+ outcome: "closed_fixture" | "failed_known" | "unknown";
478
+ servedModel: string | null;
479
+ inputFrameHash: ProbeSha256 | null;
480
+ workerEffectiveInputHash: ProbeSha256 | null;
481
+ nonGuidanceInputSha256: ProbeSha256 | null;
482
+ candidateArtifactSha256: ProbeSha256 | null;
483
+ usage: "known_fixture" | "unknown"; // A status claim only; host effect accounting must independently cover every model/tool effect.
484
+ }
485
+ interface ProbeFakeStop { reservation: ProbeReservation }
486
+ interface ProbeFakeStopObservation {
487
+ reservation: ProbeReservation;
488
+ stopped: "known_fixture" | "unknown";
489
+ }
490
+ interface ProbePublicReceipt extends ProbeReceipt {
491
+ experimentId: string | "withheld";
492
+ taskId: number;
493
+ evidence: "declaration" | "fixture" | "unknown";
494
+ }
495
+ interface ProbePublicStatus extends ProbePublicReceipt {
496
+ counters: ProbeCounters;
497
+ cancelRequested: boolean;
498
+ notNeeded: ProbeInteger;
499
+ comparable: boolean;
500
+ authoring: "admitted_fixture" | "uncontrolled" | "unknown";
501
+ }
502
+ type GuidanceProbeCommand =
503
+ | { op: "register"; file: string; json: boolean }
504
+ | { op: "start"; id: ProbeSha256; revision: ProbeInteger; variantId?: ProbeSha256; json: boolean }
505
+ | { op: "show"; id: ProbeSha256; json: boolean }
506
+ | { op: "cancel"; id: ProbeSha256; revision: ProbeInteger; json: boolean };
507
+
508
+ interface ProbeFakeEffectRequest {
509
+ sequence: ProbeInteger;
510
+ unit: "model_calls" | "tool_calls" | "resources";
511
+ descriptorSha256: ProbeSha256;
512
+ reservedTokens?: ProbeInteger;
513
+ charges?: ProbeResourceCharges;
514
+ }
515
+ interface ProbeFakeEffectValue<T> {
516
+ value: T;
517
+ usage: ProbeInteger | null; // Model tokens or tool invocation count for the captured unit.
518
+ observationSha256: ProbeSha256;
519
+ }
520
+ type ProbeFakeEffectResult<T> =
521
+ | { kind: "executed"; value: T }
522
+ | { kind: "existing"; state: "pending" | "settled" | "unknown" };
523
+ interface ProbeFakeEffects {
524
+ current(): void;
525
+ runEffect<T>(request: ProbeFakeEffectRequest,
526
+ effect: (signal: AbortSignal) => Promise<ProbeFakeEffectValue<T>>): Promise<ProbeFakeEffectResult<T>>;
527
+ }
528
+ interface GuidanceProbeFakePorts {
529
+ launch(input: ProbeFakeLaunch, effects: ProbeFakeEffects,
530
+ signal: AbortSignal): Promise<ProbeFakeObservation>;
531
+ stop(input: ProbeFakeStop, signal: AbortSignal): Promise<ProbeFakeStopObservation>;
532
+ }
533
+
534
+ // Tasks is the only policy/effect owner; arguments do not carry authority.
535
+ Tasks.guidanceProbeRegister(by: PeerId, value: unknown): Promise<ProbePublicReceipt>;
536
+ Tasks.guidanceProbeStart(by: PeerId, id: string, revision: number, variantId?: string): Promise<ProbePublicReceipt>;
537
+ Tasks.guidanceProbeShow(by: PeerId, id: string): Promise<ProbePublicStatus>;
538
+ Tasks.guidanceProbeCancel(by: PeerId, id: string, revision: number): Promise<ProbePublicReceipt>;
539
+ ```
540
+
541
+ `ProbeHostBinding` is host-created, never parsed from the declaration or control payload. Store inputs include exact project/manifest/session/generation, expected revisions and bounded descriptor identities as appropriate. Store methods own their transactions; no caller may perform half of a reservation externally. Public receipts expose fixed closed metadata only, never raw manifests, task/guidance text, input/configuration bodies or private addresses. Experiment identifiers use the existing pure guidance field screen with field-only withholding where applicable. All rendered dynamic strings use the existing sanitizer.
542
+
543
+ `ProbeFakeEffects` is a host capability captured by Tasks for one reservation, not a parsed record. It cannot select an actor, reservation, slot or currentness override. Each model/tool invocation charges exactly one attempt; optional reserved tokens and bounded resource reservations are admitted in that same transaction. A resources-only setup operation charges no synthetic model/tool call and uses known host zero usage. Reservations are not measured consumption and are never refunded. Tasks-private settlement/usage callbacks correlate the captured reservation and the host-computed descriptor/observation identities, and are not exposed as independent provider authority. The provider's effect function is fixture code only, invoked at most once for a fresh grant. Its returned value is local to the fake caller, not an unchecked public receipt.
544
+
545
+ Attempt counts are charged by admission, independently of reported usage. Numeric model usage means observed tokens for that attempt; numeric tool usage means the correlated invocation count. Missing model token coverage stays unknown even without a token limit. Observed usage exceeding an admitted reservation is retained as an overrun/unknown-held condition, not a refund or permission for another effect. The host recomputes the observation identity over the captured descriptor and numeric/null result; a mismatching supplied identity is conflicting evidence.
546
+
547
+ The fixture effect value's observation hash binds its visible request and numeric/null usage. The host verifies that visible hash, then computes the ledger correlation hash over its captured admission and observed usage. The provider need not know hidden host clock/authority metadata. Replay identity excludes the new bookkeeping timestamp while retaining reservation, sequence, unit, amount, optional token reservation and descriptor identity.
548
+
549
+ `tokensReserved` is the consumed upper-bound reservation, never refunded or double-charged by settlement. `tokensObservedKnown` sums only numeric attributed fixture observations once; it is not a replacement for reservations or a claim of complete coverage. Sticky unknown coverage and the current pending effect remain separate from both numbers. With a token limit, a missing trusted upper bound refuses before the effect. Without a token limit, a missing upper bound does not imply hard token enforcement. Fixture providers may supply known fixture upper bounds; the confined T2 adapter requires that trusted bound before a limited call; this fake ledger alone cannot prove a provider bound.
550
+
551
+ The fake port never receives the entire private snapshots bundle. A worker frame cannot directly contain improver context, other arm outputs or selector material; its only variable arm field is the admitted guidance slot. Preparation/frame equality tests establish fixture separation only, not semantic absence of hidden information or native confinement. Session settlement changes only the private ledger and cannot create a Task review/completion event. Registration receipts have `evidence: "declaration"`; they cannot become `"fixture"` merely because a runner exists or start was requested. Only actual closed fake-port observations have fixture strength, still with no native or model attestation.
552
+
553
+ The host builds each exact frame once and passes only its slot id, SHA-256 and UTF-8 byte count into the fresh Store reservation. `reserveSession` verifies that descriptor against the selected slot and charges it against the remaining aggregate `inputBytes` budget inside the same `BEGIN IMMEDIATE`, before granting a lane or session. The exact start selector retains that frame descriptor; replay must match it and returns before charging again. A low-level synthetic Store reservation may omit the descriptor for ledger-only tests, but cannot yield public fixture evidence or comparability without a host-verified frame and coverage.
554
+
555
+ The Store persists per-session frame, launch-exposure and effect-coverage metadata. Immediately before invoking `ports.launch`, the trusted host atomically rechecks current binding, cancellation and the elapsed deadline, then persists `launchExposed`; no provider field attests to whether launch occurred. Before that marker only, the host may settle a known failed startup with zero model/tool effects and no hold, leaving only its already-preregistered retry eligible. Once launch was exposed, a fake `failed_known` or `closed_fixture` label is accepted only with at least one admitted model effect and complete correlated numeric usage for every admitted model/tool effect. Missing model effects, missing/unknown usage and pending effects stay unknown-held, including when the fake labels them `known_fixture` or `failed_known`. `comparable` and public fixture evidence require the persisted host-verified frame/coverage; a closed label alone is never evidence.
556
+
557
+ Each fake `runEffect` promise is owned by the host before invoking its callback,
558
+ even if the fake port does not await it. Port settlement closes admission for
559
+ further effect calls; `start` joins its registered effect callbacks before it can
560
+ settle. A resolved port promise does not prove callback or process quiescence. An
561
+ unknown returned receipt enters the existing owned abort/stop path, and uncertain
562
+ stop evidence retains the runtime handle. A noncooperative callback therefore
563
+ keeps `guidanceProbesPending` nonzero and the database open; the existing five-second
564
+ stop bound rejects until those owned callbacks and matching stop evidence settle.
565
+ This joins owned promises and never attests physical cancellation.
566
+
567
+
568
+ Phase1's host-only `GuidanceProbeFixtureHost` composes Store reservations and fake ports for fixtures; its constructor is not a config/wire factory. `start(admission, signal)` derives worker bytes from the retained frozen task/baseline/system policy and selected rendered guidance, with no caller-supplied frame/hash. `guidanceProbeWorkerFrame(task, baselineContext, systemPolicy, guidance)` includes all four mandatory worker-visible fields, with no reservation/arm ids; its non-guidance hash derives from the first three. Editor frames come only from a host constructor callback, not wire data. Tasks integration later owns complete role-specific editor preparation; Phase1 does not claim that builder or native materialization.
569
+
570
+ Every role observation must report the exact full served model and a generic `inputFrameHash` matching its actual visible frame. Worker observations additionally require `workerEffectiveInputHash` and the derived non-guidance hash; editor observations must not label an editor hash as a worker hash. A wrong/unknown model or frame cannot yield controlled authoring or a comparable fixture outcome. `admissionHold` is sticky once elapsed/observation/usage proof is lost: late close/accounting cannot clear it or free the lane, even if the clock later recovers. Any future disposition requires a separately specified T3 proof; T1 grants no hold-reset API.
571
+
572
+ A visible observation-hash mismatch unconditionally latches conflict/unknown before bookkeeping. Provider hashes are never passed through as ledger correlation identities, even if they happen to equal the host correlation hash; ledger identities are always host-computed.
573
+
574
+ The proposed control operations are `guidance_probe_register`, `guidance_probe_start`, `guidance_probe_show` and `guidance_probe_cancel`, each always replying to rid, including errors. CLI forms are `ahub guidance probe register --file JSON`, `start --id HASH --revision R [--variant G1_CONTENT_ID]`, `show --id HASH` and `cancel --id HASH --revision R`, with optional JSON output. R is the probe CAS revision, not the frozen Task flow revision. There are no MCP probe tools, console mutations or new daemon authority flags. Unknown operation responses give upgrade/restart guidance. An uncertain write response directs an explicit keyed show, never an automatic replay.
575
+
576
+ The additive conditional recovery feature declares private probe state only when present. Control-client/restart snapshots carry its integrity binding through all existing recovery verification sites; absent legacy state is unchanged. Reads never invoke models, resolve opaque addresses or launch effects.
577
+
578
+ ## Source-owner G1 handoff and final review boundary
579
+
580
+ The accepted task states, narrowing cancellation fences, wall elapsed accounting, role caps, late candidate/successor binding and manifest format bound above are root design decisions within T1. They are not native execution proof or a broader conductor admission.
581
+
582
+ The Tasks-only synchronous helper is `guidanceProbeVariantBinding(by: PeerId, task: Task, variantId: string): ProbeChildBinding`: actual probe-authorized actor admission, current flow/catalog/baseline/withdrawal validation and exact guidance bytes/hash from the existing source-owner validated record read. It uses `Board.guidanceVariantLocation` (task/project/epoch/content-id index, LIMIT 2 ambiguity refusal), then `Board.guidanceVariants` for that exact experiment (existing SQL byte bounds, record parser and 17-row corruption sentinel). It never calls `guidanceVariantRead` as USER or owner and returns only to the private fake-session path, never CLI/control output. It grants no general raw G1 read permission. ProbeStore does not query or parse G1 tables independently.
583
+
584
+ Under ProbeStore's `BEGIN IMMEDIATE` write-lock, a host-only synchronous revalidation callback rereads the current Task and selected G1 through the existing uncached, nontransactional Board reads above, checks all actual-actor/session/privacy/catalog fences and compares the captured binding/hash/revision. It returns before child INSERT/session/counter changes. The callback cannot await, write or return a Promise. The write-lock prevents another connection from committing Task changes or G1 withdrawal between this fresh read and reservation. The owner Board connection must not retain an older read transaction; existing synchronous getters issue fresh SELECTs rather than a cached snapshot. No new Board method/file is needed for these current APIs. Source tests must use two connections: withdrawal before lock causes refusal/zero reservation; an attempted withdrawal under the lock is busy and cannot turn a stale binding into a granted launch. This is a lock/record-read contract, not an assumption that any independently cached read is atomic.
585
+
586
+ Source inspection confirms G1 creation writes only private guidance tables and Board's global status revision, not Task history/flow. `Tasks.guidanceVariantCreate` records the existing task history length in the variant; `Board.recordGuidanceVariant` inserts the immutable records and does not append a Task event. Consequently creating an admitted candidate during a probe does not itself invalidate the frozen Task flow. An actual intervening Task flow/epoch/catalog change still refuses later start. These are source findings, not executed proof.
587
+
588
+ ## Proof boundary and planned fixtures
589
+
590
+ Fake-only tests must prove closed parsing and exact model literals; zero writes on known refusals; production no-runner refusal before reservations; current authority/privacy/task/G1 fences across awaits; one project lane and serialized CAS under concurrent admission; exact duplicate no-effect behavior; four/five aggregate ceilings including failures; reservation before fake launch; unknown-held restart/cancel behavior; immutable successor binding; no ordinary observer/progress/completion effects; bounded SQL hydration and recovery integrity. Cross-await callback fixtures must prove shared model/tool/token/input-frame budgets including the frame bytes, refusal before fake invocation on exhausted capacity, no second effect or double frame charge on replay, new-call refusal after G1 withdrawal or actor/session loss, and pre-reservation exhausted budgets without a launch. Separate controls prove correlated bookkeeping after fence loss, missing/conflicting/late numeric usage remaining sticky unknown before descriptor replacement, zero model calls or unknown post-launch usage not becoming `comparable`, a host-attested known pre-launch failure retaining only its preregistered retry, a fully covered controlled fixture, and that a `known_fixture` label alone never certifies coverage. Direct low-level Store fixtures retain their lifecycle/counter assertions while lacking checked frame/coverage proof and therefore cannot yield comparable public evidence.
591
+
592
+ Control fixtures use scratch daemon/database and host-injected fake ports only. They must exercise older/unknown rid replies and privileged direct-call refusal. Recovery fixtures must prove present-state integrity, missing legacy compatibility, tamper/unknown refusal, retained counters/lane and no auto-respawn. No real hub, account, model, worker or native process is part of this proof. Measurements, if later recorded, identify source/fake evidence separately from unimplemented native guarantees.
593
+
594
+ ### Refusal certainty and operator recovery
595
+
596
+ Deterministic `PreEffectToolRefusal` and non-storage `GuidanceProbeError` failures
597
+ that occur before reservation or without a committed write retain their bounded
598
+ cause and next step. Registration tracks whether it committed a new declaration;
599
+ the host reports a fresh reservation to its controller before later preparation
600
+ or launch work. Storage, unknown and post-reservation failures remain unconfirmed.
601
+ The control transport preserves known refusal messages and always echoes `rid`; it
602
+ uses a fixed unconfirmed fallback for unknown errors. CLI recovery names
603
+ `ahub guidance probe show --id <id>` only for an operation that already has an id;
604
+ a refused registration has no lookup suffix. Retained baseline guidance counts
605
+ toward `limits.inputBytes` as well as private snapshots.
606
+
607
+ The T2 probe-specific request omits delivery-id equality: ordinary new hub
608
+ delivery alone does not invalidate an admitted run. Current socket/session,
609
+ conductor/roster, task/G1 and privacy/review checks remain. Generic G1 requests
610
+ retain their existing delivery fence. The tests independently prove ordinary
611
+ delivery continuity and refusal on changed authority or privacy.
612
+
613
+ Probe recovery deliberately checks any restored snapshot against the private
614
+ probe digest when records exist, including an older snapshot without an integrity
615
+ section. Missing proof refuses restoration; absence of records keeps the older
616
+ snapshot compatible. The check is stronger than legacy sibling guards because
617
+ restoring an unbound probe ledger could lose its shared budget or uncertain lane.
618
+
619
+
620
+ ## T2 confined adapter contract
621
+
622
+ This section defines the approved T2 boundary on merged T1. It does not enable a runner,
623
+ claim native confinement, or authorize a real model/worker trial. The existing T1
624
+ constructor-only fake runner remains the production default until the receipt and
625
+ live-admission slices are separately ready. T2 tests use fake model ports and
626
+ model-free OS-boundary canaries only.
627
+
628
+ ### Same loop, separate host lifecycle
629
+
630
+ A host-created probe capability drives a fresh private `LocalPeer` through its
631
+ existing `run` / `call` / tool loop. The kind-specific factory lives in
632
+ `src/adapters/local-probe.ts`; generic file/sandbox helpers stay in `src/local/`. The factory constructs explicit options; it
633
+ never spreads ordinary peer options or accepts a purpose from a model envelope,
634
+ manifest, configuration or wire field. The private peer is never added to Bus,
635
+ ordinary recovery or a live session. A constructor-only `workspaceOwned`
636
+ notification hands the minted branded workspace to its private resource owner
637
+ after materialization; it is not an ordinary observer, wire field or authority
638
+ grant. Cleanup still requires captured physical ownership and known stop. Ordinary `deliver` does not enter this path.
639
+
640
+ The host-only entry points are `LocalPeer.runProbe(session, signal)` and
641
+ `LocalPeer.stopProbe()`. The former retains/returns the actual common-run promise;
642
+ acceptance is not completion. Stop closes effect admission, aborts, and joins the
643
+ run and every owned operation before claiming quiescence. Unsettled work retains
644
+ its handle and unknown hold under T1's existing bounded drain. There is no retry,
645
+ redelivery, ordinary final answer, task completion or model fallback.
646
+
647
+ Host purpose excludes capture init/observe/summarize/end, ordinary history,
648
+ input observers, session title/Record instructions, bus messages, onTool,
649
+ onRoute, onUsage, research/progress, learning and ordinary limit/failure logs on
650
+ every exit path. Probe accounting uses private correlated ports, never optional
651
+ observer callbacks. PII/review identities are not repurposed as probe authority.
652
+ The compiled mandatory local-worker policy remains present and is hashed from
653
+ the actual trusted template; declaration `systemPolicy` cannot replace it.
654
+
655
+ ### Prepared request and accounting
656
+
657
+ `ProbePreparedLocalInput` binds the exact initial request passed to the model
658
+ client: model, messages, tool schemas and generation options. A stable logical
659
+ cwd `/workspace` is model-visible; tool resolution uses the actual private root.
660
+ Physical paths, session/reservation ids, timestamps, Record/title context and
661
+ ordinary history never enter that request. Guidance occupies exactly one
662
+ host-assembled slot. The non-guidance digest is computed by assembling the same
663
+ request with only that slot empty, not by string replacement or dropping fields.
664
+ The initial permitted-file listing and content descriptors are bound into the
665
+ fixed request context, without opaque host data ids. Tests compare the complete
666
+ actual request bytes, including the fixed transport `stream: false` field.
667
+
668
+ The existing T1 JSON task/context/guidance frame is not full LocalPeer input.
669
+ The source-owner host preparation API has been extended with an optional worker-frame
670
+ preparer, preserving the T1 default. It builds the actual request before the
671
+ atomic initial frame reservation; execution must reuse that request and refuse
672
+ any initial drift before a model effect. For a later worker arm, reconstruct the baseline request
673
+ with the current resolved descriptors and frozen baseline guidance and require
674
+ its hash to match the retained successful baseline input-frame hash. A new
675
+ factory instance or changed destination/order cannot bypass that comparison.
676
+ Later tool/model messages may naturally
677
+ differ across arms; they are not silently excluded from accounting.
678
+
679
+ `ProbeFakeEffectRequest` additions carry exact subsequent request input
680
+ bytes and reserved scratch/output bytes. The owner Store charges call/token and
681
+ resource reservations atomically before granting the effect, with the same
682
+ sequence/hash replay fence. `ProbeFakeEffects.current()` supplies the fresh captured Store/actor/G1 fence
683
+ for post-approval checks; it reconstructs no authority from recorded metadata.
684
+ The initial prepared request is charged exactly once;
685
+ all later model requests are charged before HTTP. A resources-only host effect
686
+ charges setup storage without inventing a model/tool call; its known host usage
687
+ is zero and its sequence/descriptor/replay fence is the same. A write reserves
688
+ a conservative complete-file byte bound before I/O. Write payloads have an exact
689
+ UTF-8 length; edit planning uses guarded file-size metadata plus replacement
690
+ bytes, bounded by the fixed file ceiling, without reading contents before call
691
+ admission. After approval the actual target/result must fit the paid bound or
692
+ refuse; no nested effect replaces the pending tool descriptor. Transient read
693
+ text is private input charged in the next complete model request, not an output
694
+ artifact. Final answer/artifact bytes are reserved before collector release or
695
+ file persistence, after recording the model call's actual usage. These byte
696
+ counters are reservations, not measured consumption. Failed attempts consume reservations;
697
+ there are no refunds, per-arm resets, private SQL duplicates or usage inferred
698
+ from absent records. Shared storage remains under T1's 1 GiB experiment ceiling.
699
+
700
+ A token-limited call refuses unless a trusted frozen model configuration supplies
701
+ a conservative upper bound for the whole call, including input and output. An
702
+ output cap or past usage is not that bound. Before every limited model effect,
703
+ the exact serialized request's UTF-8 byte length plus `maxOutputTokens` must fit
704
+ the frozen `tokenUpperBound`; otherwise refuse as a known pre-effect failure.
705
+ This conservative bytes-bound-tokens check assumes the pinned served model's
706
+ byte-level BPE; a tokenizer-measured whole-call bound is the upgrade path.
707
+ Private local results distinguish this refusal from an interrupted run and are
708
+ incomplete. Earlier explicitly covered usage remains covered; a refusal before
709
+ any model call does not fabricate a usage observation or comparability.
710
+ Explicit valid provider total usage
711
+ is observed; missing/conflicting usage stays unknown. Money and sampling control
712
+ remain unknown without their separately required evidence.
713
+
714
+ The served model must equal `qwen27b/qwen3.8-27b` without normalization. Current
715
+ `ChatResult.servedModel` trims its source, so it cannot alone prove this. The
716
+ narrow transport metadata `servedModelExact?: true` is present only when the raw
717
+ JSON model string already equals the validated returned label. Absent/false proof
718
+ is unknown; a different string is incomparable. No raw label, credential, header
719
+ or authority is added to route events. This additive optional provenance seam changes neither ordinary label trimming
720
+ nor route-event fields.
721
+
722
+ ### Host-resolved files and role matrix
723
+
724
+ T1 data ids are opaque, not paths or source addresses. A trusted host resolver
725
+ supplies `ProbeMaterializedFile {dataId, relative, sha256, bytes}` plus the frozen
726
+ source-tree binding. Check membership, hash and byte length against the admitted
727
+ policy and role before writing. Source-code descriptors must be verified against
728
+ the exact declared Git tree by the existing hardened host Git boundary. Model
729
+ text cannot supply a resolver, source path, role, destination or extra data id.
730
+
731
+ Materialization creates new regular files from admitted bytes, never Git
732
+ worktrees/clones/object stores, archive extraction, links, whole homes,
733
+ node_modules or evaluator trees. Reject symlink/gitlink entries, duplicate or
734
+ case/folding-colliding destinations, traversal, empty components, hidden Git/hub
735
+ names, unknown ids and unmatched hashes/sizes. Fixed availability ceilings are
736
+ 1 MiB per file and 64 MiB per workspace, further narrowed by the manifest and
737
+ remaining aggregate storage budget. These are explicit T2 ceilings, not proof
738
+ that an arbitrary repository fits. Relative names use the existing bounded
739
+ execution-id text ceiling; opaque data ids are never interpreted as filenames.
740
+
741
+ Each role has a fresh private parent and HOME. A tool can write only declared
742
+ scratch/output descendants; no writable common ancestor, parent entry or sibling
743
+ is exposed by its profile. Immutable inputs and source policy remain read-only.
744
+ No hostile same-user isolation is claimed. Existing guardPath checks, lexical and
745
+ canonical deny policy, normal write permission and post-approval checks remain.
746
+ Approved write roots are mapped from the admitted workspace spelling onto its
747
+ canonical root, so a host temporary-directory alias does not change admission.
748
+ The model sees the admitted logical scratch/output names. Probe tool refusals
749
+ use typed cause classes and a logical next step, never physical paths or ids;
750
+ workspace/file ceilings are known refusals, and withdrawn authority forbids
751
+ further tool calls.
752
+
753
+ - Worker: current task, fixed baseline context and source ids; admitted guidance
754
+ is the only experience channel. No other-arm output or control receipt.
755
+ - Proposal/compose: their declared task/source ids and bounded closed artifacts;
756
+ frozen improver context only when their policy flag admits it.
757
+ - Select: declared task sources and host-anonymized deliverables. No arm names,
758
+ evaluator or control receipts; anonymization is a checked host source boundary,
759
+ not a claim inferred from an `anonymizedDeliverables` boolean alone.
760
+ - Reflect: only the closed round's admitted evidence; no future round or corpus.
761
+
762
+ All roles exclude evaluator/rubric, future tasks, operator files, live homes,
763
+ Git objects, credentials and undeclared sources. Unknown source/classification
764
+ proof refuses, rather than treating a declaration as a measured source read.
765
+
766
+ ### Closed tool capability and real boundary proof
767
+
768
+ The v1 capability contains only existing host file tools `read`, `write`
769
+ and `edit`, with the role/write guard before dispatch. No arbitrary bash/git,
770
+ package/native commands, hub send/task/memory, network/web/document or session
771
+ mutation tool is advertised or dispatchable, including invented calls. This
772
+ narrowing is part of v1: network-off alone cannot prohibit
773
+ arbitrary approved shell code from installing packages offline. Adding any subprocess capability requires a later issue with its own pinned
774
+ command grammar and cleanup proof.
775
+
776
+ Reuse the existing sandboxedExec boundary with a deny-only probe refinement and
777
+ closed private environment. Its writable own-temp suffix must be inside the
778
+ owned workspace and resource cap, never a broad temp exception. Broad ordinary
779
+ home toolchain/cache, /opt and /Library reads are not probe data permissions.
780
+ Only verified required system/runtime reads and exact owned role roots remain.
781
+ Deny network including loopback and credential/agent/proxy environment. Unsupported
782
+ OS/profile enforcement refuses; binary presence alone is not an admission proof.
783
+
784
+ Before exposing the private LocalPeer, an actual model-free canary under the
785
+ exact lane profile must prove permitted reads/writes, then deny evaluator,
786
+ future-task, other-arm, control-receipt, Git-object, synthetic-home, parent and
787
+ sibling reads/writes/rename/link attempts. Prove environment exclusion and
788
+ network denial against an owned loopback listener with an outside-profile
789
+ positive control. All five roles use the same tested boundary with their own
790
+ input matrix. Fake availability/profile text is not native proof. Linux may
791
+ prove fail-closed unavailability and pure parsing/materialization; it cannot
792
+ stand in for a successful macOS Seatbelt leg.
793
+
794
+ ### Probe-specific conductor currentness
795
+
796
+ For probe register/start/show/cancel and running effects, ordinary new hub
797
+ delivery alone must not invalidate a captured request or latch an observation
798
+ hold. Keep the actual request/socket capability, original connection UUID, peer
799
+ identity, generation/native session, current conductor role/roster, task epoch/
800
+ flow, G1 applicability and fresh privacy/review checks. Unknown proof refuses.
801
+ Generic G1 request operations retain their existing delivery fence; only the
802
+ probe-owned helper omits delivery-id equality. While an asynchronous initial
803
+ frame is still being prepared, an exact same-session duplicate returns only the
804
+ truthful current receipt (`already: true`, possibly still declaration evidence),
805
+ without reserving a slot or charging a frame. The original captured actor,
806
+ generation, native session and connection UUID must still match; another
807
+ connection cannot borrow the pending start. After reservation, the existing
808
+ Store replay path applies. No replay call may create an unframed reservation.
809
+ Tests add an ordinary delivered
810
+ message during a running fake effect and prove continuity, then independently
811
+ change authority/privacy and prove the next effect is refused.
812
+
813
+
814
+ ## T3 receipts, reconcile and cleanup contract
815
+
816
+ This section is a contract proposal for review before implementation, on merged T2
817
+ (`fa53e8b1`). It does not enable a runner, claim native confinement or authorize a real
818
+ model or worker trial. The constructor-only host adapter stays unwired. T3 adds evidence
819
+ and cleanup around sessions the existing lifecycle already runs; it changes no admission,
820
+ budget, fence or authority rule.
821
+
822
+ ### What a receipt is
823
+
824
+ A receipt is the host's immutable observation of one finished session, written once after
825
+ the process tree is known quiescent and the output is collected. It is not a provider
826
+ claim: every field is computed by the host from what it admitted, measured or read back.
827
+
828
+ `ProbeReceiptV1` is closed, inert JSON, canonical and bounded like the manifest. It binds
829
+ exact experiment and slot ids, the reservation generation and revision, and:
830
+
831
+ - `requestedModel` and `servedModel`: exact literals. `servedModel` is `null` when the
832
+ host could not observe it. No normalization, alias or slash splitting.
833
+ - `inputFrameSha256` and, for a worker, `workerEffectiveInputSha256` and
834
+ `nonGuidanceInputSha256`; `guidanceSha256` for the admitted slot.
835
+ - `runtimeSha256`, `toolsetSha256`, `modelConfigSha256`, read from the host's own
836
+ fingerprints at seal time (`localProbeFingerprints`), never copied from the declaration.
837
+ They are `null` when the host could not read them (a crash reconcile never saw them),
838
+ which is unverified coverage. A fingerprint that differs from the declared one is
839
+ recorded as it is and makes the pair incomparable (`input_drift`).
840
+ - `startedAt`, `endedAt` and `elapsedMs` from the Store's trusted clock.
841
+ - `state`: one of `succeeded`, `failed`, `cancelled`, `timed_out`, `unavailable`,
842
+ `unknown`. `succeeded` requires every condition under "Sealing" below.
843
+ - `usage`: per-session model calls and tool calls with their known counts, and the
844
+ tokens this session alone observed, or `null`. A gap stays `null`; a sum is never
845
+ filled in, and the experiment's running token total is never copied into a receipt.
846
+ - `limits`: the closed list of observation limits that applied (for example
847
+ `usage_unknown`, `served_model_unobserved`, `teardown_unverified`, `output_truncated`,
848
+ `storage_over_cap`).
849
+ - `output`: a `ProbeOutputManifestV1`, below.
850
+ - `digest`: SHA-256 of the canonical record without this field.
851
+
852
+ `ProbeOutputManifestV1` lists at most 64 entries of `{ relative, sha256, bytes }`, with
853
+ each file at most 1 MiB and the total at most the slot's declared `outputBytes`. Paths are
854
+ workspace-relative under the declared output root, regular files with link count 1 only,
855
+ at most 256 UTF-8 bytes (`PROBE_OUTPUT_LIMITS.nameBytes`) and free of control and format
856
+ characters (`probeOutputName`, the one check for a manifest entry, an exclusion and a
857
+ retained record). A name that fails it is never hashed: it is an exclusion
858
+ (`invalid_name`) recorded under a digest label, never raw.
859
+ Anything else (symlink, hardlink, device, a path outside the declared writes, a file over
860
+ the cap, a tree nested deeper than 8 directory levels, a walk past the entry cap) is not
861
+ hashed: it is recorded as a closed `excluded` reason (`over_file_cap` for a file past 1 MiB,
862
+ `over_total_cap` when the slot's total bound would be crossed, `over_depth` for the nesting
863
+ limit, `over_walk_cap` for the entry cap) and the receipt cannot be `succeeded`. The walk
864
+ limits never skip silently: scratch nested past the depth limit, or holding more entries
865
+ than the cap, is reported as unmeasured, which counts as over the scratch cap.
866
+
867
+ Both walks (output, then scratch, each with its own budget of `PROBE_WALK_ENTRIES` = 4096
868
+ directory entries) run synchronously on the daemon's event loop, so the number of entries
869
+ they visit is bounded as well as the bytes: a confined child that leaves a million empty
870
+ files is far under every byte cap and would otherwise stall the control socket and every
871
+ peer. Reaching the entry cap is treated like the depth cap. Output: whatever the unfinished
872
+ walk had read is discarded, nothing is hashed or retained, and the whole output root is
873
+ excluded as `over_walk_cap`. Scratch: unmeasured, hence `storage_over_cap`.
874
+
875
+ The byte bound of a receipt, `PROBE_OUTPUT_LIMITS.receiptBytes`, is **derived** from the
876
+ largest valid receipt, never chosen: 64 entries and 64 exclusions of the longest allowed
877
+ names (each name byte can cost two in JSON) plus every other field at its own maximum. A
878
+ session that meets every success condition and writes 64 files with the longest names
879
+ therefore still seals as a success. `sealReceipt` writes only a receipt that its own
880
+ hydration would accept (it parses what it is about to store), so a record the reader would
881
+ refuse is a refused seal, never permanent storage corruption.
882
+
883
+ ### Sealing
884
+
885
+ The adapter's `close` path already stops the peer and confinement and joins owned work.
886
+ Output is collected only AFTER `stopProbe` and the confinement stop have both returned,
887
+ that is after they reported known quiescence, because until then a child may still be
888
+ writing and the bytes are not evidence. When the stop failed or is uncertain nothing is
889
+ read at all. Collection and the receipt follow, before the host releases the workspace it
890
+ owns:
891
+
892
+ 1. Collect the output manifest by opening each declared output file `O_NONBLOCK|O_NOFOLLOW`
893
+ and requiring it to still be a regular file through the opened descriptor (a file
894
+ swapped for a FIFO, device or symlink after its `lstat` is excluded and cannot block
895
+ the daemon), hashing the bytes read from that descriptor, and re-checking the identity
896
+ after the read. A file that changed while read is excluded, not hashed twice.
897
+ Retention copies those same bytes. It never re-reads a workspace path, so a swap after
898
+ collection can neither hang it nor change what is kept.
899
+ 2. Build the receipt from the session's own settled facts, the immutable manifest and the
900
+ host's measurement only, then compute its digest. Mutable experiment state (the
901
+ running token total, the current hold, a later cancel, another session) is never read:
902
+ a session records why it settled (`closeCause`) when it settles.
903
+ 3. Write it in one `BEGIN IMMEDIATE` transaction together with the session settlement
904
+ (`settleAndSeal`), so a receipt and its session state are never separately visible. If
905
+ the seal fails the settlement rolls back with it; the host then settles the session as
906
+ `unknown` with a conservative receipt, and a session still open after a crash is
907
+ recorded as unknown by the explicit reconcile below. A settled session therefore never
908
+ exists without its receipt.
909
+
910
+ The state is decided in this order, so what the host cannot vouch for always wins:
911
+ unverified teardown or a crash is `unknown`; then the settled cause (`cancelled`,
912
+ `timed_out`); then `unavailable`, which means the session could not start and is never
913
+ used once a model or tool call ran (a confinement error after a call is `failed` or
914
+ `unknown`); then `failed`; then `succeeded`.
915
+
916
+ A receipt is `succeeded` only if all of these hold: the session settled `closed_fixture`
917
+ with verified coverage; `servedModel` equals `requestedModel`; teardown is known
918
+ quiescent; no output entry was excluded; no hold is latched; and the elapsed ceiling was
919
+ not hit. A timeout, an abort, a token or step ceiling, an uncertain stop and a hold each
920
+ map to a non-success state. **A timeout is never `succeeded`**, whatever partial output
921
+ exists. There is no path that upgrades a receipt after it is written.
922
+
923
+ Immutability: a second `sealReceipt` for the same reservation with identical content
924
+ returns the stored receipt (`already: true`); different content refuses and latches the
925
+ observation hold. There is no update and no delete. A prune never removes a receipt or an
926
+ output manifest (see "Cleanup"): receipts are the outcome denominator's record and live as
927
+ long as the experiment row does.
928
+
929
+ ### Tamper, torn writes and crash
930
+
931
+ Receipts live in the same `hub.db`, so a torn receipt is a rolled-back transaction, not a
932
+ half file. The Store hydrates a receipt only if its digest recomputes, its experiment, slot,
933
+ generation and revision match the session row, and its `state` is consistent with the
934
+ session state. Any mismatch is `storage` corruption: the experiment becomes unknown-held,
935
+ shows no success and is never silently repaired.
936
+
937
+ Output files are re-verified against their manifest only through the same captured
938
+ identities, while the workspace is still owned. After the workspace is released the
939
+ manifest is the record; the bytes are not claimed to still exist unless retained
940
+ (next section).
941
+
942
+ Crash after admission: a session found `reserved` or `running` with no receipt is
943
+ reconciled to `unknown_held` with receipt state `unknown` and limit `teardown_unverified`,
944
+ whether or not a cancel request or an elapsed hold was already latched: a crash is never
945
+ recorded as `cancelled` or `timed_out`, because the host did not witness a stop.
946
+ Reconcile never launches, retries or restarts a session, and never turns an in-flight
947
+ session into a failure or a success. It only records that the host cannot vouch for it.
948
+ The lane stays held until a person or conductor cancels it through the existing
949
+ `cancelIntent`.
950
+
951
+ Reconcile runs **only** through an explicit host call, `GuidanceProbeStore.reconcile()`,
952
+ made by the daemon in two places: at start, after the recovery integrity comparison, and
953
+ at the release of a held recovery (a held target must keep carried rows byte-identical so
954
+ its comparison holds). Opening the Store, `read`, `integrity`, `previewPrune` and every
955
+ other read never write: a Store opened read-only (`new GuidanceProbeStore(file, now, true)`,
956
+ a connection that cannot write) changes no row, and `reconcile` through it fails. `reconcile` is
957
+ idempotent: a second call finds no unreconciled session and writes nothing. A reconciled
958
+ `unknown` receipt counts in the outcome denominator as `unknown`, never as `failed`.
959
+ One bad experiment never hides the others: `reconcile` visits every experiment key, hands
960
+ each failure and its key to an optional `onFailure` callback (the daemon logs the experiment
961
+ id prefix and the error class, never content) and carries on; it returns
962
+ `{ reconciled, failed }`. With no callback the first failure is thrown only after every key
963
+ was tried, so a caller can never mistake a partial pass for a full one. The recovery
964
+ integrity pass reads receipts through the same session cross-check as `receipts()`
965
+ (generation, revision and a state that session could have produced), so an edited pair is
966
+ caught at restart, not only on a later read.
967
+
968
+ ### Comparability and the outcome denominator (AC4)
969
+
970
+ `classifyProbeComparability` is a pure function over the experiment's receipts and
971
+ returns `{ comparable, reasons }`, with a closed reason list: `served_model_mismatch`,
972
+ `served_model_unobserved`, `input_drift` (a worker's non-guidance hash differs from the
973
+ baseline's, or a fingerprint differs), `usage_unknown`, `incomplete_coverage`,
974
+ `teardown_unverified`, `authoring_uncontrolled`, `missing_receipt`.
975
+
976
+ - A pair is incomparable if either side has a reason. One reason is enough; reasons are
977
+ listed, not ranked.
978
+ - The public `comparable` flag becomes this function's result. It replaces the current
979
+ inline expression in `Tasks.guidanceProbeProjection` and may only get stricter: every
980
+ case the current expression calls incomparable stays incomparable.
981
+ - The outcome denominator is every preregistered attempt slot that was reserved:
982
+ `succeeded`, `failed`, `cancelled`, `timed_out`, `unavailable` and `unknown` all count.
983
+ Slots never started stay `planned` or `not_needed` and are reported separately as such;
984
+ they are neither successes nor failures. A failed, cancelled or unavailable arm is
985
+ never dropped from the denominator, and the status shows the per-state counts.
986
+ - Usage gaps stay `null`. No cost or money figure is derived: this task adds no price
987
+ table, so total money remains unknown.
988
+
989
+ ### Cleanup and the 1 GiB cap (AC6)
990
+
991
+ The experiment's declared `inputBytes + scratchBytes + outputBytes` is already capped at
992
+ 1 GiB at admission. T3 adds no second source of truth: retained storage is accounted from
993
+ the receipts' output manifests plus the retained workspace bytes the host recorded.
994
+
995
+ The cap also holds at runtime, not only in the declaration. At seal time the host measures
996
+ what the session actually left behind in scratch and output. If either exceeds the bound
997
+ declared for it, the receipt is a non-success with limit `storage_over_cap` (or
998
+ `output_truncated` when output files were excluded for size), and retention is never
999
+ silently larger than declared: bytes past the bound are not retained, hashed or counted
1000
+ as the session's output.
1001
+
1002
+ Cleanup touches only resources the host created and still owns, verified at the moment
1003
+ of removal by captured physical identity (device, inode, directory/file kind, link count)
1004
+ exactly as `materializeProbeWorkspace` already does for its failure cleanup. Inode numbers
1005
+ are recycled (Linux reuses one straight after an unlink), so a retained file's identity also
1006
+ carries its change time in nanoseconds (`ctimeNs`): a replacement made later has a later
1007
+ change time even with the same inode. A directory has no stable change time, so it is
1008
+ identified by device and inode only. A path whose
1009
+ identity differs, a replaced root, a bystander file or a symlink swap is left alone and
1010
+ reported as `retained: <reason>`; cleanup never recurses into or deletes a name it did not
1011
+ create. It never follows a link and never touches another session's resources.
1012
+
1013
+ `previewPrune(key, fs)` is read-only and returns the exact list of what a prune would
1014
+ remove (relative names and byte counts, no content) and what it would keep and why.
1015
+ `prune(key, planDigest, fs)` takes that preview's digest and refuses if the owned set has
1016
+ changed since, so a prune only ever does what the person saw. Neither takes a time: expiry
1017
+ is decided on the Store's own trusted clock, so a caller cannot pull a retention date
1018
+ forward.
1019
+
1020
+ Retention is `PROBE_RETENTION_DAYS = 14`, a named constant. It is not a setting, a
1021
+ manifest field or a config key. At seal time each retained output gets an explicit
1022
+ `expiresAt` (seal time plus that constant), stored with the receipt and shown by
1023
+ `previewPrune`. **Nothing is deleted automatically:** there is no timer and no background
1024
+ sweep. Removal happens only through `previewPrune` followed by `prune(planDigest)`,
1025
+ called by the host or the person. An output is prunable only after its `expiresAt`, and
1026
+ only when no session of its experiment is in flight and the experiment is finished:
1027
+ terminal (`closed_fixture`, `failed_fixture`), or stopped by the person's or conductor's
1028
+ existing `cancelIntent`. An experiment that is held (`unknown_held`, for example after a
1029
+ crash reconcile or a latched hold) stays unprunable until that cancel has released it, so
1030
+ its retained output cannot be removed while the person has not yet seen the hold, and it
1031
+ can still expire afterwards. `usageUnknown` alone never blocks a prune: it describes the
1032
+ measurements, not whether work is running. A receipt is never deleted in any case.
1033
+
1034
+ A prune removes retained output and workspace bytes only. It never deletes a receipt or an
1035
+ output manifest. A session still `reserved` or `running` blocks the prune of its
1036
+ experiment even when the experiment is otherwise finished (a cancel that has not yet
1037
+ reached every session): the in-flight guard is its own check, tested apart from the
1038
+ state rule.
1039
+
1040
+ Locks: receipts and prune plans use the Store's SQLite transaction, so no file lock and
1041
+ no stale-holder recovery are introduced. If implementation finds a file-level lock is
1042
+ unavoidable it must follow `SourceRegistry.locked` (publish whole by `link(2)`, never
1043
+ unlink on another's behalf, fail closed on a stale holder, name the file) and ship a
1044
+ two-recoverer test (#329).
1045
+
1046
+ ### Scope boundary
1047
+
1048
+ T3 adds: the receipt and output manifest types and pure parsing in `guidance-probes.ts`;
1049
+ one additive private table in the Store (`guidance_probe_receipts`) with receipt
1050
+ hydration, tamper checks and reconcile folded into the existing integrity and recovery
1051
+ passes; `sealReceipt`, `settleAndSeal`, `receipts`, `outcome`, `reconcile`, `previewPrune` and `prune`; output collection and
1052
+ owned cleanup in the adapter and workspace modules; the comparability function; and fake
1053
+ fixtures for the mismatch, tamper, crash and teardown cases. It does not add a CLI verb,
1054
+ a wire operation, a daemon runner, a config key, a real model call or a live trial (T4).
1055
+ Public `show` is unchanged: it keeps only the stricter `comparable` flag. The per-state
1056
+ denominator counts and the comparability reasons are private status, read by the host
1057
+ through the Store; T4 (below) adds the producer receipt reader and decides what leaves it.
1058
+
1059
+ ### How the adapter and host seal
1060
+
1061
+ The adapter cannot reach the Store. After the stop reported quiescence it collects and
1062
+ retains the declared output and reports what it measured on the observation
1063
+ (`ProbeFakeObservation.measured`, every `ProbeMeasuredSession` field except `startedAt`,
1064
+ including the host's own runtime fingerprints). The fixture host samples `startedAt` on the
1065
+ trusted clock where it exposes the launch and calls `settleAndSeal`; the adapter never
1066
+ supplies the start instant. An observation that carries no measurement, or that did not
1067
+ match, is sealed with a conservative one (teardown not verified, nothing observed), so a
1068
+ session is never a success the host could not witness. Collection never throws: a failure
1069
+ becomes an `output_truncated` limit, which can only keep a receipt from being a success.
1070
+ Retention needs a host-owned `retentionRoot` outside every workspace; without one the
1071
+ output is hashed and nothing is kept. Past the declared scratch or output cap, or with
1072
+ scratch nested past the walk limit, nothing is retained and the receipt carries
1073
+ `storage_over_cap`. Hydration checks every receipt against its session row: generation,
1074
+ revision and a state that session could have produced.
1075
+
1076
+ **Retained output always has an owner.** Retention happens in the adapter, before the host
1077
+ seals, so the adapter may have copied output the host then declines to seal with that
1078
+ record: an observation that did not match its reservation (a fallback model is the AC4
1079
+ case), a seal that failed and was replaced by the conservative one, a settlement that lost
1080
+ its clock and sealed nothing. A directory with no row can never be previewed or pruned. So
1081
+ the ports carry one optional call, `discardRetained(record)`, and the host makes it for
1082
+ every measurement it did not seal together with its own `retained` record (on the match
1083
+ path after the settle, and on the failure path before the conservative settle). The port
1084
+ removes only a record that is exactly one it created (it keeps its own bounded ledger of
1085
+ canonical records, so a forged or altered record reaches no delete), and it removes by the
1086
+ identity captured at creation. It never throws into the host. The receipt of such a
1087
+ session carries no retained record, and no directory of it remains.
1088
+
1089
+ Public `show` computes `comparable` as the older expression AND the sealed-receipt verdict,
1090
+ so the flag only ever gets stricter. A store that cannot be read yields `false`.
1091
+
1092
+ ### Rulings applied
1093
+
1094
+ The reviewer ruled on the three open choices of the first draft: no automatic expiry and
1095
+ no new setting (a named constant and an explicit `expiresAt`); reconcile only through an
1096
+ explicit host call at daemon start; the denominator counts and reasons stay private. They
1097
+ are folded into the sections above. Three amendments are also applied: prune never deletes
1098
+ receipts or manifests, the 1 GiB cap holds at runtime, and a reconciled `unknown` receipt
1099
+ counts as `unknown`.
1100
+
1101
+ ## T4 producer status and receipt export
1102
+
1103
+ T4 (#1226) adds the producer-facing read of what T3 sealed, and the focused check that runs the whole fake lifecycle end to end. It adds no way to start work.
1104
+ It does not enable a runner, claim native confinement, call a model or launch a worker, and the constructor-only adapter stays unwired (a test reads the daemon,
1105
+ the CLI, the plugin, the manager and every other adapter and fails if one names it). **AC7's authorized real local-worker trial is not part of this change and
1106
+ stays open**: nothing here shows actual isolation or effective guidance delivery to a model, and nothing may be read as showing either.
1107
+
1108
+ ### What a producer or a receipt consumer reads
1109
+
1110
+ One read, `Tasks.guidanceProbeReceipts(by, id)`, answered over the control op `guidance_probe_receipts`, the CLI `ahub guidance probe receipts --id HASH [--json]`
1111
+ and the guidance panel's `probe` read. It carries the same person-or-current-conductor, session, task-state and privacy fences as `show`, and it is read-only:
1112
+ it launches, reserves, writes and prunes nothing, and a read-only Store serves its inputs. The reply is a `ProbeReceiptExport`:
1113
+
1114
+ - `status`: the public status `show` returns, with `comparable` already combined with the sealed verdict.
1115
+ - `comparable` and `reasons`: the stricter of the older public expression and the sealed-receipt verdict, and the sealed reasons (`served_model_mismatch`,
1116
+ `served_model_unobserved`, `input_drift`, `usage_unknown`, `incomplete_coverage`, `teardown_unverified`, `authoring_uncontrolled`, `missing_receipt`). A comparable
1117
+ export never lists a reason and never outranks a status that refused.
1118
+ - `counts`: the full outcome denominator. Every reserved slot is in it, failed, cancelled, timed out and unavailable ones included; a reserved slot with no
1119
+ receipt is `unknown`; slots that never started are `planned` or `not_needed`, apart from success and failure.
1120
+ - `slots`: one row per declared slot, with its stage, role, arm and the session's own state, the verbatim sealed receipt (or none), the receipt's digest, a
1121
+ `withheld` flag and the retention state of its output (`none`, `retained` or `pruned`).
1122
+
1123
+ Unknown stays unknown: a usage gap is `usage_unknown` and prints as `unknown`, never zero; an unobserved served model is `unobserved`; a slot with no receipt says
1124
+ so. Evidence is at most `fixture`, and every rendering says that no live model or worker trial, sampling control, provider behaviour or model quality is claimed.
1125
+
1126
+ ### Bounds, privacy and tamper
1127
+
1128
+ - **Closed, inert, bounded.** `parseGuidanceProbeReceiptExport` accepts exactly these fields, at most nine slots, and at most `PROBE_EXPORT_BYTES`, derived from the
1129
+ largest valid receipt, never chosen. It re-verifies every embedded receipt with `parseProbeReceipt`, so a receipt that was edited, moved to another slot or given
1130
+ another digest never parses. The counts must add up to the slot list, and a slot's digest must be its receipt's.
1131
+ - **Tamper refuses the whole read.** The Store hydrates receipts with its own session cross-check; a bad row fails the read with the storage error rather than
1132
+ being skipped or shown. `Tasks` then parses what it is about to send with the same parser, so a result the consumer would refuse is a storage fault, never a
1133
+ partial answer. The manager, the panel provider and the CLI parse again on receipt, and a reply that names another probe than the one asked for is refused.
1134
+ - **A model-written name is screened, not trusted.** An output path or served-model name in a receipt passes the same public-field screen as any other public field
1135
+ (`guidanceFieldAllowed`: nameable, not secret-like, not under a denied path). A receipt with a name that fails it is replaced by its digest and flagged
1136
+ `withheld`; the slot and the denominator still count it, so withholding never hides an arm. Every rendered string is stripped of control and format characters,
1137
+ and the experiment label is advisory untrusted text.
1138
+ - **A location is a state, never a path.** The export says a slot's output is retained or pruned and never names where. `GuidanceProbeStore.retentionStates` is the
1139
+ only accessor and returns states.
1140
+
1141
+ ### Surfaces
1142
+
1143
+ - **Control and authority.** `guidance_probe_receipts` is a conductor operation labelled `guidance probe receipts`, answered with the request `rid` like every
1144
+ probe op, and advertised as the feature `guidance_probe_receipts` beside `guidance_probes`. A client facing a hub without it says to upgrade and restart and sends
1145
+ nothing. The CLI refuses a malformed id or any option other than `--id` and `--json` before a request, and a delegated live-test run is refused as for the other
1146
+ probe commands.
1147
+ - **Producer panel.** The existing Guidance panel gains a probe read, not a new panel: `DASHBOARD_VIEWS` and the manifest's actions are unchanged. The provider
1148
+ forwards exactly one field, the 64-hex probe id, through a producer-only read port on `projectConsole` (`guidanceProbe`) that pins the instance, checks the feature
1149
+ and writes nothing. The panel shows the provider's own lines for exactly the probe it asked about as literal text; a reply that is malformed, for another probe, or
1150
+ late (the project or id changed, the panel was hidden or destroyed) shows nothing of itself.
1151
+ - **One text.** The panel and the CLI print the same lines, `guidanceProbeStatusLines`.
1152
+
1153
+ ### The focused check gate (AC7, fake-provider leg)
1154
+
1155
+ `test/guidance-probe-gate.test.ts` is the end-to-end pass over the real `Tasks` + `GuidanceProbeStore` + `Bus` with the fake provider: register, run the baseline and a
1156
+ candidate, seal, and read the export, asserting at once that the two arms share every non-guidance input byte (AC1), that attempts and calls are counted once per
1157
+ slot (AC3), that the denominator is complete and the pair is incomparable for the stated reason (AC4), that every receipt is host-sealed and bound to its slot
1158
+ (AC4, AC6), that no message, PII screen or lineage read happened and the task's public bytes are unchanged (AC5), that a crash in the middle is recorded unknown and
1159
+ never launched again (AC3, AC6), and that reading changes no row. It runs under `scripts/check.sh --changed` because it imports the files above. What it does not
1160
+ run is stated in the test and here: a real model call, a real worker, OS isolation, effective guidance delivery, sampling control.
1161
+
1162
+ ### Scope boundary
1163
+
1164
+ T4 (this part) adds: `ProbeReceiptExport`, `parseGuidanceProbeReceiptExport`, `PROBE_EXPORT_BYTES`; `GuidanceProbeStore.retentionStates`; `Tasks.guidanceProbeReceipts`;
1165
+ the control op, feature, authority label, CLI subcommand and help line; the manager read port, the plugin's `probe` read and the panel section; the shared text; and
1166
+ the tests above. It does not add a runner, a config key, a write, a prune verb or a model call. The authorized live trial, and with it AC7's real-isolation and
1167
+ real-delivery evidence, is a separate decision and stays open.