@staix/agent-hub 0.35.0 → 0.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (165) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/README.md +25 -4
  3. package/THIRD_PARTY_NOTICES.md +0 -18
  4. package/docs/agent-notes/README.md +71 -1
  5. package/docs/agent-notes/adapters.md +5 -2
  6. package/docs/agent-notes/bus.md +1 -0
  7. package/docs/agent-notes/daemon.md +7 -6
  8. package/docs/agent-notes/local-worker.md +1 -0
  9. package/docs/agent-notes/models.md +5 -3
  10. package/docs/agent-notes/tasks.md +9 -2
  11. package/docs/agent-notes/tests.md +1 -1
  12. package/docs/contracts/companion-cli-v1.json +70 -0
  13. package/docs/design/adapters.md +115 -2
  14. package/docs/design/agent-hub-architecture.md +10 -2
  15. package/docs/design/bus.md +8 -0
  16. package/docs/design/execution-reference.md +171 -11
  17. package/docs/design/guidance-experiments.md +438 -0
  18. package/docs/design/guidance-probes.md +802 -0
  19. package/docs/design/model-routes.md +1053 -0
  20. package/docs/design/supervision.md +121 -0
  21. package/docs/design/task-board.md +111 -0
  22. package/docs/dogfood.md +24 -15
  23. package/docs/events.md +20 -1
  24. package/docs/memory.md +3 -3
  25. package/docs/operations.md +366 -133
  26. package/docs/profiles.md +2 -2
  27. package/docs/quickstart.md +114 -3
  28. package/docs/research.md +5 -3
  29. package/docs/sdlc.md +113 -7
  30. package/docs/security.md +88 -6
  31. package/docs/specs/2026-09-19-agent-hub-design.md +14 -11
  32. package/docs/specs/2026-10-04-switchyard-source-port-design.md +3 -1
  33. package/docs/verification/2026-10-25-qwen-dual-output-t0.md +22 -0
  34. package/docs/verification/2026-11-08-qwen-0269-model-setter-1317.md +25 -11
  35. package/docs/verification/2026-11-09-qwen-0270-acp.md +181 -0
  36. package/docs/verification/2026-11-09-qwen-0270-model-setter-1317.md +61 -0
  37. package/docs/verification/2026-11-10-0.36.0.md +59 -0
  38. package/docs/verification/2026-11-10-claude-implementer-2.1.322.md +59 -0
  39. package/docs/verification/2026-11-10-qwen-0270-dual-output.md +367 -0
  40. package/docs/verification/2026-11-10-qwen-0271-dual-output.md +101 -0
  41. package/docs/verification/2026-11-11-0.37.0.md +40 -0
  42. package/docs/verification/2026-11-11-guidance-probe-t2-1226.md +153 -0
  43. package/docs/verification/2026-11-11-qwen-setter-suggestions-off.md +167 -0
  44. package/docs/verification/claude-shell-wrapper-native.py +1 -1
  45. package/docs/verified.json +27 -27
  46. package/package.json +3 -4
  47. package/plugins/agent-hub/.claude-plugin/plugin.json +1 -1
  48. package/plugins/agent-hub/kimi-hook.js +3570 -1800
  49. package/plugins/agent-hub/server.js +4112 -1913
  50. package/src/adapters/channel-peer.ts +7 -1
  51. package/src/adapters/claude-channel.ts +7 -4
  52. package/src/adapters/compat.ts +10 -10
  53. package/src/adapters/local-probe.ts +174 -0
  54. package/src/adapters/local-worker.ts +233 -22
  55. package/src/adapters/qwen-dual.ts +324 -44
  56. package/src/cli/console-state.ts +25 -6
  57. package/src/cli/console-versions.ts +99 -0
  58. package/src/cli/console.ts +13 -1
  59. package/src/cli/guidance.ts +67 -0
  60. package/src/cli/help.ts +12 -4
  61. package/src/cli/identity.ts +10 -3
  62. package/src/cli/init-prompt.ts +15 -2
  63. package/src/cli/init-required-checks.ts +122 -0
  64. package/src/cli/init-settings.ts +10 -4
  65. package/src/cli/init.ts +39 -3
  66. package/src/cli/install-paths.ts +7 -2
  67. package/src/cli/lineage.ts +78 -0
  68. package/src/cli/main.ts +171 -14
  69. package/src/cli/runtime-version-warning.ts +2 -2
  70. package/src/cli/sdlc-output.ts +9 -5
  71. package/src/cli/setup-research.ts +10 -0
  72. package/src/hub/autonomy-defaults.ts +20 -9
  73. package/src/hub/board.ts +346 -4
  74. package/src/hub/build-entry.ts +11 -0
  75. package/src/hub/bus.ts +12 -0
  76. package/src/hub/ci-watch.ts +4 -4
  77. package/src/hub/config-apply.ts +6 -3
  78. package/src/hub/config-trust.ts +7 -1
  79. package/src/hub/control-client.ts +5 -2
  80. package/src/hub/daemon.ts +508 -26
  81. package/src/hub/delivery-hints.ts +4 -2
  82. package/src/hub/delivery-journal.ts +50 -2
  83. package/src/hub/delivery-public.ts +51 -0
  84. package/src/hub/dogfood-profile.ts +8 -4
  85. package/src/hub/events.ts +3 -2
  86. package/src/hub/execution-lineage-owner.ts +272 -0
  87. package/src/hub/execution-lineage.ts +52 -8
  88. package/src/hub/execution-links.ts +85 -0
  89. package/src/hub/guidance-probe-store.ts +713 -0
  90. package/src/hub/guidance-probes.ts +358 -0
  91. package/src/hub/guidance-variants.ts +398 -0
  92. package/src/hub/handoff.ts +1 -0
  93. package/src/hub/hub-tools.ts +43 -2
  94. package/src/hub/inference.ts +18 -5
  95. package/src/hub/manager.ts +44 -2
  96. package/src/hub/memory-policy.ts +2 -2
  97. package/src/hub/operational-authority.ts +13 -1
  98. package/src/hub/peers.ts +6 -1
  99. package/src/hub/planning.ts +1 -1
  100. package/src/hub/ports.ts +1 -1
  101. package/src/hub/progress.ts +47 -23
  102. package/src/hub/report.ts +2 -0
  103. package/src/hub/research.ts +1 -0
  104. package/src/hub/restart.ts +20 -0
  105. package/src/hub/roles.ts +26 -0
  106. package/src/hub/routing.ts +4 -1
  107. package/src/hub/sdlc-merge.ts +39 -1
  108. package/src/hub/sdlc-release-authorization.ts +139 -17
  109. package/src/hub/sdlc-release-policy.ts +100 -0
  110. package/src/hub/sdlc-release.ts +60 -8
  111. package/src/hub/sdlc.ts +62 -11
  112. package/src/hub/settings.ts +2 -0
  113. package/src/hub/supervision-proposals.ts +405 -0
  114. package/src/hub/supervision-rules.ts +388 -0
  115. package/src/hub/supervision.ts +2 -0
  116. package/src/hub/task-approval.ts +2 -2
  117. package/src/hub/task-repository.ts +5 -0
  118. package/src/hub/tasks.ts +917 -53
  119. package/src/local/probe-errors.ts +28 -0
  120. package/src/local/probe-sandbox.ts +224 -0
  121. package/src/local/probe-types.ts +108 -0
  122. package/src/local/probe-workspace.ts +237 -0
  123. package/src/local/sandbox.ts +71 -2
  124. package/src/local/tools.ts +135 -9
  125. package/src/memory/capture.ts +2 -2
  126. package/src/models/relay.ts +9 -2
  127. package/src/models/route/advisor-trigger.ts +88 -0
  128. package/src/models/route/config.ts +39 -8
  129. package/src/models/route/conversation-view.ts +179 -0
  130. package/src/models/route/decision-evidence.ts +1 -1
  131. package/src/models/route/decision.ts +193 -26
  132. package/src/models/route/escalation-control.ts +30 -0
  133. package/src/models/route/hub-prompts.ts +97 -0
  134. package/src/models/route/judge-choice.ts +155 -0
  135. package/src/models/route/judge-replies.ts +102 -0
  136. package/src/models/route/labels.ts +14 -70
  137. package/src/models/route/observation-signals.ts +250 -0
  138. package/src/models/route/plan-execute-choice.ts +27 -0
  139. package/src/models/route/relay-selector.ts +10 -9
  140. package/src/models/route/runtime.ts +129 -60
  141. package/src/models/route/stage-diagnostics.ts +22 -0
  142. package/src/models/route/stage-evidence.ts +55 -0
  143. package/src/models/route/stage-fallback.ts +58 -0
  144. package/src/models/route/stage-input.ts +155 -0
  145. package/src/models/route/stage.ts +5 -147
  146. package/src/models/route/turn-state.ts +77 -0
  147. package/src/omniroute/client.ts +3 -0
  148. package/src/ui/guidance-panel.ts +156 -0
  149. package/src/ui/guidance-view.ts +43 -0
  150. package/src/ui/lineage-view.ts +34 -0
  151. package/src/ui/plugin.ts +141 -27
  152. package/src/version.ts +4 -0
  153. package/templates/adec/README.md +32 -0
  154. package/templates/adec/ahub.plan-execute.json +23 -0
  155. package/templates/adec/ahub.stage.json +23 -0
  156. package/LICENSES/Apache-2.0.txt +0 -204
  157. package/src/models/route/advisor.ts +0 -102
  158. package/src/models/route/escalation.ts +0 -82
  159. package/src/models/route/judge.ts +0 -23
  160. package/src/models/route/normalize.ts +0 -103
  161. package/src/models/route/plan-execute.ts +0 -52
  162. package/src/models/route/prompts.ts +0 -8
  163. package/src/models/route/signals.ts +0 -247
  164. package/src/models/route/state.ts +0 -54
  165. package/src/models/route/text.ts +0 -61
@@ -0,0 +1,802 @@
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
+ ---
39
+
40
+ # Fake-only guidance probe admission
41
+
42
+ 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.
43
+
44
+ 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.
45
+
46
+ 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.
47
+
48
+ ## Manifest and units
49
+
50
+ `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.
51
+
52
+ The proposed manifest fields are:
53
+
54
+ - `v: 1`.
55
+ - `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.
56
+ - `task`: exact task id, creation epoch and recorded flow revision. Integers are nonnegative safe integers; task ids and epochs retain the owning Task contract.
57
+ - `role`: role id, layer and frozen baseline SHA-256. Its current catalog identity must independently match at admission.
58
+ - `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.
59
+ - `runtime`: exact runtime, toolset and model-configuration hashes. There are no commands, executable paths, URLs, runner selectors, credentials or config overlays.
60
+ - `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.
61
+ - `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.
62
+ - `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.
63
+ - `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.
64
+ - `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.
65
+ - `taskOrderSeed`, optional: ordering metadata only. It is never represented as a model sampling seed.
66
+
67
+ 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.
68
+
69
+ ## Closed V1 schema
70
+
71
+ 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.
72
+
73
+ 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.
74
+
75
+ ```ts
76
+ type ProbeSha256 = string; // Exactly 64 lowercase hex characters.
77
+ type ProbeId = string; // Nonempty, <=256 UTF-8 bytes and UTF-16 units.
78
+ type ProbeInteger = number; // Nonnegative safe integer, no coercion.
79
+ type ProbeTree =
80
+ | { objectFormat: "sha1"; oid: string } // Exactly 40 lowercase hex.
81
+ | { objectFormat: "sha256"; oid: string }; // Exactly 64 lowercase hex.
82
+ interface ProbeSnapshotRef { sha256: ProbeSha256; bytes: ProbeInteger }
83
+ interface ProbeRoleIdentity {
84
+ id: ProbeId;
85
+ layer: "shipped" | "project";
86
+ baselineSha256: ProbeSha256;
87
+ }
88
+ type ProbeArm = "baseline" | "candidate1" | "candidate2" | "successor";
89
+ type ProbeStage = "baseline" | "proposal1" | "candidate1" | "proposal2"
90
+ | "candidate2" | "compose" | "successor" | "select" | "reflect";
91
+ type ProbeSlot = {
92
+ id: ProbeId;
93
+ stage: ProbeStage;
94
+ role: "worker" | "proposal" | "compose" | "select" | "reflect";
95
+ arm: ProbeArm | "none";
96
+ retryOf?: ProbeId;
97
+ };
98
+ interface GuidanceProbeManifestV1 {
99
+ v: 1;
100
+ projectKey: ProbeId;
101
+ experimentId: ProbeId;
102
+ task: { id: number; created: ProbeInteger; flowRevision: ProbeInteger };
103
+ role: ProbeRoleIdentity;
104
+ inputs: {
105
+ task: ProbeSnapshotRef;
106
+ baselineContext: ProbeSnapshotRef;
107
+ dataPolicy: ProbeSnapshotRef;
108
+ systemPolicy: ProbeSnapshotRef;
109
+ codeTree: ProbeTree;
110
+ };
111
+ runtime: {
112
+ runtimeSha256: ProbeSha256;
113
+ toolsetSha256: ProbeSha256;
114
+ modelConfigSha256: ProbeSha256;
115
+ };
116
+ model: {
117
+ requested: "qwen27b/qwen3.8-27b";
118
+ expectedServed: "qwen27b/qwen3.8-27b";
119
+ };
120
+ guidance: { baselineSha256: ProbeSha256 };
121
+ improverContextHash?: ProbeSha256;
122
+ improverContextBytes?: ProbeInteger;
123
+ slots: readonly ProbeSlot[];
124
+ limits: {
125
+ modelCalls: ProbeInteger;
126
+ toolCalls: ProbeInteger;
127
+ elapsedMs: ProbeInteger;
128
+ tokens?: ProbeInteger;
129
+ inputBytes: ProbeInteger;
130
+ scratchBytes: ProbeInteger;
131
+ outputBytes: ProbeInteger;
132
+ };
133
+ taskOrderSeed?: ProbeInteger;
134
+ }
135
+ ```
136
+
137
+ 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.
138
+
139
+ 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.
140
+
141
+ 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.
142
+
143
+ ```ts
144
+ interface ProbeDataPolicyV1 {
145
+ v: 1;
146
+ allowedWrites: readonly { root: "scratch" | "output"; relative: ProbeId }[];
147
+ admittedData: readonly { id: ProbeId; sha256: ProbeSha256; bytes: ProbeInteger }[];
148
+ roles: {
149
+ worker: { dataIds: readonly ProbeId[]; guidanceOnlyExperience: true };
150
+ proposal: { dataIds: readonly ProbeId[]; improverContext: boolean };
151
+ compose: { dataIds: readonly ProbeId[]; improverContext: boolean };
152
+ select: { dataIds: readonly ProbeId[]; anonymizedDeliverables: true };
153
+ reflect: { dataIds: readonly ProbeId[]; closedRoundOnly: true };
154
+ };
155
+ }
156
+ interface ProbePrivateSnapshots {
157
+ task: string;
158
+ baselineContext: string;
159
+ dataPolicy: ProbeDataPolicyV1;
160
+ systemPolicy: string;
161
+ improverContext?: string;
162
+ }
163
+ interface ProbeRegistrationV1 {
164
+ manifest: GuidanceProbeManifestV1;
165
+ snapshots: ProbePrivateSnapshots;
166
+ }
167
+ ```
168
+
169
+ 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.
170
+
171
+ `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.
172
+
173
+ 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.
174
+
175
+ ## Input separation and comparability
176
+
177
+ The ledger declares which inputs a role may receive. It does not claim to enforce OS or native worker confinement in T1.
178
+
179
+ | Role | Permitted declared input | Excluded input |
180
+ | --- | --- | --- |
181
+ | Worker | Current bound task, fixed baseline context, one admitted guidance slot | Direct experience, other arm outputs, selector/evaluator material, operator/control receipts |
182
+ | 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 |
183
+ | Selector | Anonymized deliverables and declared permitted task sources | Arm identity, hidden evaluator/rubric and control receipts |
184
+ | Reflector | Closed-round evidence | Future rounds and undeclared experience |
185
+
186
+ 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.
187
+
188
+ 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.
189
+
190
+ ## Authority and currentness
191
+
192
+ 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.
193
+
194
+ 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.
195
+
196
+ 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.
197
+
198
+ 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.
199
+
200
+ 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.
201
+
202
+ 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.
203
+
204
+ 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.
205
+
206
+ 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.
207
+
208
+ 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.
209
+
210
+ 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.
211
+
212
+ 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.
213
+
214
+ 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.
215
+
216
+ 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.
217
+
218
+ 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.
219
+
220
+ ## Private storage and atomic admission
221
+
222
+ `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.
223
+
224
+ - `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.
225
+ - `guidance_probe_lanes`: one row per project, pointing to the retained experiment/session owner and generation.
226
+ - `guidance_probe_sessions`: at most nine preregistered slot rows per experiment, with session CAS revision, state, fixed counters and one current/last effect descriptor.
227
+
228
+ `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.
229
+
230
+ 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.
231
+
232
+ 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.
233
+
234
+ 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.
235
+
236
+ 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.
237
+
238
+ 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.
239
+
240
+ `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.
241
+
242
+ 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.
243
+
244
+ 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.
245
+
246
+ 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.
247
+
248
+ `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.
249
+
250
+ ## Lifecycle and fake effect boundary
251
+
252
+ 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.
253
+
254
+ 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.
255
+
256
+ 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.
257
+
258
+ 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.
259
+
260
+ 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.
261
+
262
+ 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.
263
+
264
+ 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.
265
+
266
+ 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.
267
+
268
+ 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.
269
+
270
+ 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.
271
+
272
+ ## Source-owner APIs
273
+
274
+ 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:
275
+
276
+ ```ts
277
+ parseGuidanceProbeManifest(value: unknown): GuidanceProbeManifestV1 | undefined;
278
+ parseGuidanceProbeRegistration(value: unknown): ProbeRegistrationV1 | undefined;
279
+ guidanceProbeManifestKey(manifest: GuidanceProbeManifestV1): string;
280
+ parseGuidanceProbeCommand(args: readonly string[]): GuidanceProbeCommand | undefined;
281
+
282
+ interface GuidanceProbeStore {
283
+ register(input: ProbeRegistrationV1, binding: ProbeHostBinding,
284
+ revalidate: () => ProbeHostBinding): ProbeReceipt;
285
+ read(key: ProbeKey): ProbeStoredState | undefined;
286
+ startSelector(key: ProbeKey, requestedRevision: ProbeInteger): ProbeStartSelector | undefined;
287
+ reserveSession(input: ProbeSessionAdmission,
288
+ revalidate: () => ProbeAdmissionRecheck): ProbeReservationResult;
289
+ exposeLaunch(reservation: ProbeReservation,
290
+ revalidate: () => ProbeAdmissionRecheck): ProbeReceipt;
291
+ checkInvocation(reservation: ProbeReservation, revalidate: () => ProbeAdmissionRecheck): ProbeReceipt;
292
+ admitEffect(input: ProbeEffectAdmission,
293
+ revalidate: () => ProbeAdmissionRecheck): ProbeEffectAdmissionResult;
294
+ settleEffect(input: ProbeEffectSettlement): ProbeReceipt;
295
+ settleSession(input: ProbeSessionSettlement): ProbeReceipt;
296
+ settlePreLaunchFailure(reservation: ProbeReservation, now: ProbeInteger): ProbeReceipt;
297
+ settleObservedSession(input: ProbeSessionSettlement, usage: "known_fixture" | "unknown"): ProbeReceipt;
298
+ latchHold(reservation: ProbeReservation, reason: "elapsed" | "observation" | "usage"): ProbeReceipt;
299
+ recordUsage(input: ProbeUsageObservation): ProbeReceipt;
300
+ cancelIntent(input: ProbeCancellation,
301
+ revalidate: () => ProbeHostBinding): ProbeReceipt;
302
+ integrity(): ProbeIntegrity;
303
+ }
304
+
305
+ type ProbeState = "declared" | "active" | "closing" | "closed_fixture" | "failed_fixture" | "unknown_held";
306
+ type ProbeSessionState = "planned" | "reserved" | "running" | "failed_known"
307
+ | "closed_fixture" | "not_needed" | "unknown_held";
308
+ type ProbeBudgetUnit = "model_calls" | "tool_calls" | "tokens"
309
+ | "input_bytes" | "scratch_bytes" | "output_bytes";
310
+ interface ProbeKey { projectKey: ProbeId; id: ProbeSha256 }
311
+ interface ProbeHostBinding {
312
+ projectKey: ProbeId;
313
+ actor: PeerId;
314
+ task: { id: number; created: ProbeInteger; flowRevision: ProbeInteger };
315
+ role: ProbeRoleIdentity;
316
+ baselineGuidance: string; // Private existing rendered catalog baseline, <=8 KiB.
317
+ sessionGeneration: ProbeInteger | ProbeId;
318
+ nativeSession: ProbeId | null;
319
+ requestConnectionId: ProbeId;
320
+ }
321
+ interface ProbeChildBinding {
322
+ variantId: ProbeSha256;
323
+ candidateSha256: ProbeSha256;
324
+ guidanceSha256: ProbeSha256;
325
+ task: { id: number; created: ProbeInteger; flowRevision: ProbeInteger };
326
+ role: ProbeRoleIdentity;
327
+ guidance: string; // Private exact existing G1 rendering, existing bound applies.
328
+ authoring: "admitted_fixture" | "uncontrolled";
329
+ sourceSessionId: ProbeId | null;
330
+ }
331
+ interface ProbeSessionAdmission {
332
+ key: ProbeKey;
333
+ expectedRevision: ProbeInteger;
334
+ host: ProbeHostBinding;
335
+ child?: ProbeChildBinding;
336
+ preparedFrame?: ProbePreparedFrame; // Host-only metadata for the exact frame later passed to the fake port.
337
+ now: ProbeInteger; // Queued diagnostic only; Store samples its trusted clock after locking.
338
+ }
339
+ interface ProbePreparedFrame { slotId: ProbeId; sha256: ProbeSha256; bytes: ProbeInteger }
340
+ interface ProbePreparedWorkerFrame { inputFrame: string; nonGuidanceInputSha256: ProbeSha256 }
341
+ type ProbeWorkerFramePreparer = (state: ProbeStoredState, slot: ProbeSlot,
342
+ guidance: string) => ProbePreparedWorkerFrame | Promise<ProbePreparedWorkerFrame>;
343
+ interface ProbeResourceCharges { inputBytes?: ProbeInteger; scratchBytes?: ProbeInteger; outputBytes?: ProbeInteger }
344
+ interface ProbeAdmissionRecheck {
345
+ host: ProbeHostBinding;
346
+ child?: ProbeChildBinding;
347
+ }
348
+ interface ProbeReservation {
349
+ key: ProbeKey;
350
+ slotId: ProbeId;
351
+ generation: ProbeInteger;
352
+ revision: ProbeInteger;
353
+ }
354
+ interface ProbeStartSelector {
355
+ requestedRevision: ProbeInteger;
356
+ slotId: ProbeId;
357
+ variantId: ProbeSha256 | null;
358
+ inputFrameSha256: ProbeSha256 | null;
359
+ inputFrameBytes: ProbeInteger;
360
+ actor: PeerId;
361
+ sessionGeneration: ProbeInteger | ProbeId;
362
+ nativeSession: ProbeId | null;
363
+ requestConnectionId: ProbeId;
364
+ }
365
+ type ProbeReservationResult =
366
+ | { kind: "granted"; reservation: ProbeReservation }
367
+ | { kind: "existing"; receipt: ProbeReceipt };
368
+ interface ProbeEffectAdmission {
369
+ reservation: ProbeReservation;
370
+ sequence: ProbeInteger;
371
+ unit: ProbeBudgetUnit;
372
+ amount: ProbeInteger;
373
+ reservedTokens?: ProbeInteger;
374
+ charges?: ProbeResourceCharges;
375
+ descriptorSha256: ProbeSha256;
376
+ now: ProbeInteger;
377
+ }
378
+ type ProbeEffectAdmissionResult =
379
+ | { kind: "granted"; admission: ProbeEffectAdmission }
380
+ | { kind: "existing"; state: "pending" | "settled" | "unknown" };
381
+ interface ProbeEffectSettlement {
382
+ admission: ProbeEffectAdmission;
383
+ outcome: "settled" | "unknown";
384
+ }
385
+ interface ProbeSessionSettlement {
386
+ reservation: ProbeReservation;
387
+ outcome: "closed_fixture" | "failed_known" | "unknown";
388
+ candidateArtifactSha256: ProbeSha256 | null;
389
+ now: ProbeInteger;
390
+ }
391
+ interface ProbeSessionCoverage {
392
+ inputFrameSha256: ProbeSha256 | null;
393
+ inputFrameBytes: ProbeInteger;
394
+ launchExposed: boolean;
395
+ preLaunchFailure: boolean;
396
+ modelCalls: ProbeInteger;
397
+ modelUsageKnown: ProbeInteger;
398
+ toolCalls: ProbeInteger;
399
+ toolUsageKnown: ProbeInteger;
400
+ usageUnknown: boolean;
401
+ coverageVerified: boolean;
402
+ }
403
+ interface ProbeUsageObservation {
404
+ admission: ProbeEffectAdmission;
405
+ observed: ProbeInteger | null; // Model tokens or tool invocation count; null is unknown.
406
+ observationSha256: ProbeSha256;
407
+ }
408
+ interface ProbeCancellation {
409
+ key: ProbeKey;
410
+ expectedRevision: ProbeInteger;
411
+ host: ProbeHostBinding;
412
+ }
413
+ interface ProbeCounters {
414
+ workerAttempts: ProbeInteger;
415
+ editorAttempts: ProbeInteger;
416
+ modelCalls: ProbeInteger;
417
+ toolCalls: ProbeInteger;
418
+ tokensReserved: ProbeInteger;
419
+ tokensObservedKnown: ProbeInteger;
420
+ inputBytes: ProbeInteger;
421
+ scratchBytes: ProbeInteger;
422
+ outputBytes: ProbeInteger;
423
+ elapsedHighWaterMs: ProbeInteger;
424
+ usageUnknown: boolean;
425
+ }
426
+ interface ProbeReceipt {
427
+ id: ProbeSha256;
428
+ revision: ProbeInteger;
429
+ state: ProbeState;
430
+ already: boolean;
431
+ }
432
+ interface ProbeStoredState {
433
+ registration: ProbeRegistrationV1;
434
+ binding: ProbeHostBinding;
435
+ receipt: ProbeReceipt;
436
+ counters: ProbeCounters;
437
+ firstReservedAt: ProbeInteger | null;
438
+ admissionHold: "none" | "elapsed" | "observation" | "usage";
439
+ cancelRequested: boolean;
440
+ notNeeded: ProbeInteger; // Derived from session records, never an attempt/budget counter.
441
+ sessions: readonly {
442
+ slotId: ProbeId;
443
+ generation: ProbeInteger;
444
+ revision: ProbeInteger;
445
+ state: ProbeSessionState;
446
+ candidateArtifactSha256: ProbeSha256 | null;
447
+ child?: ProbeChildBinding;
448
+ start?: ProbeStartSelector;
449
+ coverage: ProbeSessionCoverage;
450
+ }[]; // <=9; effect descriptor columns are hydrated separately by exact key.
451
+ }
452
+ interface ProbeIntegrity {
453
+ experiments: ProbeInteger;
454
+ sessions: ProbeInteger;
455
+ digest: ProbeSha256;
456
+ }
457
+ interface ProbeFakeLaunch {
458
+ reservation: ProbeReservation;
459
+ slot: ProbeSlot;
460
+ manifest: GuidanceProbeManifestV1;
461
+ inputFrame: string; // Only this role's prepared bounded input, never all snapshots.
462
+ inputSha256: ProbeSha256;
463
+ nonGuidanceInputSha256: ProbeSha256;
464
+ purpose: "guidance_probe";
465
+ }
466
+ interface ProbeFakeObservation {
467
+ reservation: ProbeReservation;
468
+ outcome: "closed_fixture" | "failed_known" | "unknown";
469
+ servedModel: string | null;
470
+ inputFrameHash: ProbeSha256 | null;
471
+ workerEffectiveInputHash: ProbeSha256 | null;
472
+ nonGuidanceInputSha256: ProbeSha256 | null;
473
+ candidateArtifactSha256: ProbeSha256 | null;
474
+ usage: "known_fixture" | "unknown"; // A status claim only; host effect accounting must independently cover every model/tool effect.
475
+ }
476
+ interface ProbeFakeStop { reservation: ProbeReservation }
477
+ interface ProbeFakeStopObservation {
478
+ reservation: ProbeReservation;
479
+ stopped: "known_fixture" | "unknown";
480
+ }
481
+ interface ProbePublicReceipt extends ProbeReceipt {
482
+ experimentId: string | "withheld";
483
+ taskId: number;
484
+ evidence: "declaration" | "fixture" | "unknown";
485
+ }
486
+ interface ProbePublicStatus extends ProbePublicReceipt {
487
+ counters: ProbeCounters;
488
+ cancelRequested: boolean;
489
+ notNeeded: ProbeInteger;
490
+ comparable: boolean;
491
+ authoring: "admitted_fixture" | "uncontrolled" | "unknown";
492
+ }
493
+ type GuidanceProbeCommand =
494
+ | { op: "register"; file: string; json: boolean }
495
+ | { op: "start"; id: ProbeSha256; revision: ProbeInteger; variantId?: ProbeSha256; json: boolean }
496
+ | { op: "show"; id: ProbeSha256; json: boolean }
497
+ | { op: "cancel"; id: ProbeSha256; revision: ProbeInteger; json: boolean };
498
+
499
+ interface ProbeFakeEffectRequest {
500
+ sequence: ProbeInteger;
501
+ unit: "model_calls" | "tool_calls" | "resources";
502
+ descriptorSha256: ProbeSha256;
503
+ reservedTokens?: ProbeInteger;
504
+ charges?: ProbeResourceCharges;
505
+ }
506
+ interface ProbeFakeEffectValue<T> {
507
+ value: T;
508
+ usage: ProbeInteger | null; // Model tokens or tool invocation count for the captured unit.
509
+ observationSha256: ProbeSha256;
510
+ }
511
+ type ProbeFakeEffectResult<T> =
512
+ | { kind: "executed"; value: T }
513
+ | { kind: "existing"; state: "pending" | "settled" | "unknown" };
514
+ interface ProbeFakeEffects {
515
+ current(): void;
516
+ runEffect<T>(request: ProbeFakeEffectRequest,
517
+ effect: (signal: AbortSignal) => Promise<ProbeFakeEffectValue<T>>): Promise<ProbeFakeEffectResult<T>>;
518
+ }
519
+ interface GuidanceProbeFakePorts {
520
+ launch(input: ProbeFakeLaunch, effects: ProbeFakeEffects,
521
+ signal: AbortSignal): Promise<ProbeFakeObservation>;
522
+ stop(input: ProbeFakeStop, signal: AbortSignal): Promise<ProbeFakeStopObservation>;
523
+ }
524
+
525
+ // Tasks is the only policy/effect owner; arguments do not carry authority.
526
+ Tasks.guidanceProbeRegister(by: PeerId, value: unknown): Promise<ProbePublicReceipt>;
527
+ Tasks.guidanceProbeStart(by: PeerId, id: string, revision: number, variantId?: string): Promise<ProbePublicReceipt>;
528
+ Tasks.guidanceProbeShow(by: PeerId, id: string): Promise<ProbePublicStatus>;
529
+ Tasks.guidanceProbeCancel(by: PeerId, id: string, revision: number): Promise<ProbePublicReceipt>;
530
+ ```
531
+
532
+ `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.
533
+
534
+ `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.
535
+
536
+ 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.
537
+
538
+ 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.
539
+
540
+ `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.
541
+
542
+ 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.
543
+
544
+ 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.
545
+
546
+ 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.
547
+
548
+ Each fake `runEffect` promise is owned by the host before invoking its callback,
549
+ even if the fake port does not await it. Port settlement closes admission for
550
+ further effect calls; `start` joins its registered effect callbacks before it can
551
+ settle. A resolved port promise does not prove callback or process quiescence. An
552
+ unknown returned receipt enters the existing owned abort/stop path, and uncertain
553
+ stop evidence retains the runtime handle. A noncooperative callback therefore
554
+ keeps `guidanceProbesPending` nonzero and the database open; the existing five-second
555
+ stop bound rejects until those owned callbacks and matching stop evidence settle.
556
+ This joins owned promises and never attests physical cancellation.
557
+
558
+
559
+ 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.
560
+
561
+ 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.
562
+
563
+ 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.
564
+
565
+ 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.
566
+
567
+ 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.
568
+
569
+ ## Source-owner G1 handoff and final review boundary
570
+
571
+ 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.
572
+
573
+ 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.
574
+
575
+ 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.
576
+
577
+ 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.
578
+
579
+ ## Proof boundary and planned fixtures
580
+
581
+ 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.
582
+
583
+ 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.
584
+
585
+ ### Refusal certainty and operator recovery
586
+
587
+ Deterministic `PreEffectToolRefusal` and non-storage `GuidanceProbeError` failures
588
+ that occur before reservation or without a committed write retain their bounded
589
+ cause and next step. Registration tracks whether it committed a new declaration;
590
+ the host reports a fresh reservation to its controller before later preparation
591
+ or launch work. Storage, unknown and post-reservation failures remain unconfirmed.
592
+ The control transport preserves known refusal messages and always echoes `rid`; it
593
+ uses a fixed unconfirmed fallback for unknown errors. CLI recovery names
594
+ `ahub guidance probe show --id <id>` only for an operation that already has an id;
595
+ a refused registration has no lookup suffix. Retained baseline guidance counts
596
+ toward `limits.inputBytes` as well as private snapshots.
597
+
598
+ The T2 probe-specific request omits delivery-id equality: ordinary new hub
599
+ delivery alone does not invalidate an admitted run. Current socket/session,
600
+ conductor/roster, task/G1 and privacy/review checks remain. Generic G1 requests
601
+ retain their existing delivery fence. The tests independently prove ordinary
602
+ delivery continuity and refusal on changed authority or privacy.
603
+
604
+ Probe recovery deliberately checks any restored snapshot against the private
605
+ probe digest when records exist, including an older snapshot without an integrity
606
+ section. Missing proof refuses restoration; absence of records keeps the older
607
+ snapshot compatible. The check is stronger than legacy sibling guards because
608
+ restoring an unbound probe ledger could lose its shared budget or uncertain lane.
609
+
610
+
611
+ ## T2 confined adapter contract
612
+
613
+ This section defines the approved T2 boundary on merged T1. It does not enable a runner,
614
+ claim native confinement, or authorize a real model/worker trial. The existing T1
615
+ constructor-only fake runner remains the production default until the receipt and
616
+ live-admission slices are separately ready. T2 tests use fake model ports and
617
+ model-free OS-boundary canaries only.
618
+
619
+ ### Same loop, separate host lifecycle
620
+
621
+ A host-created probe capability drives a fresh private `LocalPeer` through its
622
+ existing `run` / `call` / tool loop. The kind-specific factory lives in
623
+ `src/adapters/local-probe.ts`; generic file/sandbox helpers stay in `src/local/`. The factory constructs explicit options; it
624
+ never spreads ordinary peer options or accepts a purpose from a model envelope,
625
+ manifest, configuration or wire field. The private peer is never added to Bus,
626
+ ordinary recovery or a live session. A constructor-only `workspaceOwned`
627
+ notification hands the minted branded workspace to its private resource owner
628
+ after materialization; it is not an ordinary observer, wire field or authority
629
+ grant. Cleanup still requires captured physical ownership and known stop. Ordinary `deliver` does not enter this path.
630
+
631
+ The host-only entry points are `LocalPeer.runProbe(session, signal)` and
632
+ `LocalPeer.stopProbe()`. The former retains/returns the actual common-run promise;
633
+ acceptance is not completion. Stop closes effect admission, aborts, and joins the
634
+ run and every owned operation before claiming quiescence. Unsettled work retains
635
+ its handle and unknown hold under T1's existing bounded drain. There is no retry,
636
+ redelivery, ordinary final answer, task completion or model fallback.
637
+
638
+ Host purpose excludes capture init/observe/summarize/end, ordinary history,
639
+ input observers, session title/Record instructions, bus messages, onTool,
640
+ onRoute, onUsage, research/progress, learning and ordinary limit/failure logs on
641
+ every exit path. Probe accounting uses private correlated ports, never optional
642
+ observer callbacks. PII/review identities are not repurposed as probe authority.
643
+ The compiled mandatory local-worker policy remains present and is hashed from
644
+ the actual trusted template; declaration `systemPolicy` cannot replace it.
645
+
646
+ ### Prepared request and accounting
647
+
648
+ `ProbePreparedLocalInput` binds the exact initial request passed to the model
649
+ client: model, messages, tool schemas and generation options. A stable logical
650
+ cwd `/workspace` is model-visible; tool resolution uses the actual private root.
651
+ Physical paths, session/reservation ids, timestamps, Record/title context and
652
+ ordinary history never enter that request. Guidance occupies exactly one
653
+ host-assembled slot. The non-guidance digest is computed by assembling the same
654
+ request with only that slot empty, not by string replacement or dropping fields.
655
+ The initial permitted-file listing and content descriptors are bound into the
656
+ fixed request context, without opaque host data ids. Tests compare the complete
657
+ actual request bytes, including the fixed transport `stream: false` field.
658
+
659
+ The existing T1 JSON task/context/guidance frame is not full LocalPeer input.
660
+ The source-owner host preparation API has been extended with an optional worker-frame
661
+ preparer, preserving the T1 default. It builds the actual request before the
662
+ atomic initial frame reservation; execution must reuse that request and refuse
663
+ any initial drift before a model effect. For a later worker arm, reconstruct the baseline request
664
+ with the current resolved descriptors and frozen baseline guidance and require
665
+ its hash to match the retained successful baseline input-frame hash. A new
666
+ factory instance or changed destination/order cannot bypass that comparison.
667
+ Later tool/model messages may naturally
668
+ differ across arms; they are not silently excluded from accounting.
669
+
670
+ `ProbeFakeEffectRequest` additions carry exact subsequent request input
671
+ bytes and reserved scratch/output bytes. The owner Store charges call/token and
672
+ resource reservations atomically before granting the effect, with the same
673
+ sequence/hash replay fence. `ProbeFakeEffects.current()` supplies the fresh captured Store/actor/G1 fence
674
+ for post-approval checks; it reconstructs no authority from recorded metadata.
675
+ The initial prepared request is charged exactly once;
676
+ all later model requests are charged before HTTP. A resources-only host effect
677
+ charges setup storage without inventing a model/tool call; its known host usage
678
+ is zero and its sequence/descriptor/replay fence is the same. A write reserves
679
+ a conservative complete-file byte bound before I/O. Write payloads have an exact
680
+ UTF-8 length; edit planning uses guarded file-size metadata plus replacement
681
+ bytes, bounded by the fixed file ceiling, without reading contents before call
682
+ admission. After approval the actual target/result must fit the paid bound or
683
+ refuse; no nested effect replaces the pending tool descriptor. Transient read
684
+ text is private input charged in the next complete model request, not an output
685
+ artifact. Final answer/artifact bytes are reserved before collector release or
686
+ file persistence, after recording the model call's actual usage. These byte
687
+ counters are reservations, not measured consumption. Failed attempts consume reservations;
688
+ there are no refunds, per-arm resets, private SQL duplicates or usage inferred
689
+ from absent records. Shared storage remains under T1's 1 GiB experiment ceiling.
690
+
691
+ A token-limited call refuses unless a trusted frozen model configuration supplies
692
+ a conservative upper bound for the whole call, including input and output. An
693
+ output cap or past usage is not that bound. Before every limited model effect,
694
+ the exact serialized request's UTF-8 byte length plus `maxOutputTokens` must fit
695
+ the frozen `tokenUpperBound`; otherwise refuse as a known pre-effect failure.
696
+ This conservative bytes-bound-tokens check assumes the pinned served model's
697
+ byte-level BPE; a tokenizer-measured whole-call bound is the upgrade path.
698
+ Private local results distinguish this refusal from an interrupted run and are
699
+ incomplete. Earlier explicitly covered usage remains covered; a refusal before
700
+ any model call does not fabricate a usage observation or comparability.
701
+ Explicit valid provider total usage
702
+ is observed; missing/conflicting usage stays unknown. Money and sampling control
703
+ remain unknown without their separately required evidence.
704
+
705
+ The served model must equal `qwen27b/qwen3.8-27b` without normalization. Current
706
+ `ChatResult.servedModel` trims its source, so it cannot alone prove this. The
707
+ narrow transport metadata `servedModelExact?: true` is present only when the raw
708
+ JSON model string already equals the validated returned label. Absent/false proof
709
+ is unknown; a different string is incomparable. No raw label, credential, header
710
+ or authority is added to route events. This additive optional provenance seam changes neither ordinary label trimming
711
+ nor route-event fields.
712
+
713
+ ### Host-resolved files and role matrix
714
+
715
+ T1 data ids are opaque, not paths or source addresses. A trusted host resolver
716
+ supplies `ProbeMaterializedFile {dataId, relative, sha256, bytes}` plus the frozen
717
+ source-tree binding. Check membership, hash and byte length against the admitted
718
+ policy and role before writing. Source-code descriptors must be verified against
719
+ the exact declared Git tree by the existing hardened host Git boundary. Model
720
+ text cannot supply a resolver, source path, role, destination or extra data id.
721
+
722
+ Materialization creates new regular files from admitted bytes, never Git
723
+ worktrees/clones/object stores, archive extraction, links, whole homes,
724
+ node_modules or evaluator trees. Reject symlink/gitlink entries, duplicate or
725
+ case/folding-colliding destinations, traversal, empty components, hidden Git/hub
726
+ names, unknown ids and unmatched hashes/sizes. Fixed availability ceilings are
727
+ 1 MiB per file and 64 MiB per workspace, further narrowed by the manifest and
728
+ remaining aggregate storage budget. These are explicit T2 ceilings, not proof
729
+ that an arbitrary repository fits. Relative names use the existing bounded
730
+ execution-id text ceiling; opaque data ids are never interpreted as filenames.
731
+
732
+ Each role has a fresh private parent and HOME. A tool can write only declared
733
+ scratch/output descendants; no writable common ancestor, parent entry or sibling
734
+ is exposed by its profile. Immutable inputs and source policy remain read-only.
735
+ No hostile same-user isolation is claimed. Existing guardPath checks, lexical and
736
+ canonical deny policy, normal write permission and post-approval checks remain.
737
+ Approved write roots are mapped from the admitted workspace spelling onto its
738
+ canonical root, so a host temporary-directory alias does not change admission.
739
+ The model sees the admitted logical scratch/output names. Probe tool refusals
740
+ use typed cause classes and a logical next step, never physical paths or ids;
741
+ workspace/file ceilings are known refusals, and withdrawn authority forbids
742
+ further tool calls.
743
+
744
+ - Worker: current task, fixed baseline context and source ids; admitted guidance
745
+ is the only experience channel. No other-arm output or control receipt.
746
+ - Proposal/compose: their declared task/source ids and bounded closed artifacts;
747
+ frozen improver context only when their policy flag admits it.
748
+ - Select: declared task sources and host-anonymized deliverables. No arm names,
749
+ evaluator or control receipts; anonymization is a checked host source boundary,
750
+ not a claim inferred from an `anonymizedDeliverables` boolean alone.
751
+ - Reflect: only the closed round's admitted evidence; no future round or corpus.
752
+
753
+ All roles exclude evaluator/rubric, future tasks, operator files, live homes,
754
+ Git objects, credentials and undeclared sources. Unknown source/classification
755
+ proof refuses, rather than treating a declaration as a measured source read.
756
+
757
+ ### Closed tool capability and real boundary proof
758
+
759
+ The v1 capability contains only existing host file tools `read`, `write`
760
+ and `edit`, with the role/write guard before dispatch. No arbitrary bash/git,
761
+ package/native commands, hub send/task/memory, network/web/document or session
762
+ mutation tool is advertised or dispatchable, including invented calls. This
763
+ narrowing is part of v1: network-off alone cannot prohibit
764
+ arbitrary approved shell code from installing packages offline. Adding any subprocess capability requires a later issue with its own pinned
765
+ command grammar and cleanup proof.
766
+
767
+ Reuse the existing sandboxedExec boundary with a deny-only probe refinement and
768
+ closed private environment. Its writable own-temp suffix must be inside the
769
+ owned workspace and resource cap, never a broad temp exception. Broad ordinary
770
+ home toolchain/cache, /opt and /Library reads are not probe data permissions.
771
+ Only verified required system/runtime reads and exact owned role roots remain.
772
+ Deny network including loopback and credential/agent/proxy environment. Unsupported
773
+ OS/profile enforcement refuses; binary presence alone is not an admission proof.
774
+
775
+ Before exposing the private LocalPeer, an actual model-free canary under the
776
+ exact lane profile must prove permitted reads/writes, then deny evaluator,
777
+ future-task, other-arm, control-receipt, Git-object, synthetic-home, parent and
778
+ sibling reads/writes/rename/link attempts. Prove environment exclusion and
779
+ network denial against an owned loopback listener with an outside-profile
780
+ positive control. All five roles use the same tested boundary with their own
781
+ input matrix. Fake availability/profile text is not native proof. Linux may
782
+ prove fail-closed unavailability and pure parsing/materialization; it cannot
783
+ stand in for a successful macOS Seatbelt leg.
784
+
785
+ ### Probe-specific conductor currentness
786
+
787
+ For probe register/start/show/cancel and running effects, ordinary new hub
788
+ delivery alone must not invalidate a captured request or latch an observation
789
+ hold. Keep the actual request/socket capability, original connection UUID, peer
790
+ identity, generation/native session, current conductor role/roster, task epoch/
791
+ flow, G1 applicability and fresh privacy/review checks. Unknown proof refuses.
792
+ Generic G1 request operations retain their existing delivery fence; only the
793
+ probe-owned helper omits delivery-id equality. While an asynchronous initial
794
+ frame is still being prepared, an exact same-session duplicate returns only the
795
+ truthful current receipt (`already: true`, possibly still declaration evidence),
796
+ without reserving a slot or charging a frame. The original captured actor,
797
+ generation, native session and connection UUID must still match; another
798
+ connection cannot borrow the pending start. After reservation, the existing
799
+ Store replay path applies. No replay call may create an unframed reservation.
800
+ Tests add an ordinary delivered
801
+ message during a running fake effect and prove continuity, then independently
802
+ change authority/privacy and prove the next effect is refused.