@gate-forge/pack-playwright 0.7.1 → 0.8.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 (202) hide show
  1. package/README.md +31 -0
  2. package/dist/constants.d.ts +13 -140
  3. package/dist/constants.d.ts.map +1 -1
  4. package/dist/constants.js +13 -148
  5. package/dist/constants.js.map +1 -1
  6. package/dist/cypress/plugin.d.ts +53 -0
  7. package/dist/cypress/plugin.d.ts.map +1 -0
  8. package/dist/cypress/plugin.js +369 -0
  9. package/dist/cypress/plugin.js.map +1 -0
  10. package/dist/cypress/spec-scan.d.ts +39 -0
  11. package/dist/cypress/spec-scan.d.ts.map +1 -0
  12. package/dist/cypress/spec-scan.js +301 -0
  13. package/dist/cypress/spec-scan.js.map +1 -0
  14. package/dist/diagnosis.d.ts +39 -0
  15. package/dist/diagnosis.d.ts.map +1 -0
  16. package/dist/diagnosis.js +63 -0
  17. package/dist/diagnosis.js.map +1 -0
  18. package/dist/discovery/adapter-projection.d.ts +13 -0
  19. package/dist/discovery/adapter-projection.d.ts.map +1 -0
  20. package/dist/discovery/adapter-projection.js +84 -0
  21. package/dist/discovery/adapter-projection.js.map +1 -0
  22. package/dist/discovery/config-locations.d.ts +5 -0
  23. package/dist/discovery/config-locations.d.ts.map +1 -0
  24. package/dist/discovery/config-locations.js +19 -0
  25. package/dist/discovery/config-locations.js.map +1 -0
  26. package/dist/discovery/cypress-runner-adapter.d.ts +112 -0
  27. package/dist/discovery/cypress-runner-adapter.d.ts.map +1 -0
  28. package/dist/discovery/cypress-runner-adapter.js +501 -0
  29. package/dist/discovery/cypress-runner-adapter.js.map +1 -0
  30. package/dist/discovery/discover.d.ts +53 -1
  31. package/dist/discovery/discover.d.ts.map +1 -1
  32. package/dist/discovery/discover.js +100 -3
  33. package/dist/discovery/discover.js.map +1 -1
  34. package/dist/discovery/git-ignore.d.ts +13 -0
  35. package/dist/discovery/git-ignore.d.ts.map +1 -0
  36. package/dist/discovery/git-ignore.js +62 -0
  37. package/dist/discovery/git-ignore.js.map +1 -0
  38. package/dist/discovery/index.d.ts +9 -0
  39. package/dist/discovery/index.d.ts.map +1 -1
  40. package/dist/discovery/index.js +9 -0
  41. package/dist/discovery/index.js.map +1 -1
  42. package/dist/discovery/playwright-runner-adapter.d.ts +108 -0
  43. package/dist/discovery/playwright-runner-adapter.d.ts.map +1 -0
  44. package/dist/discovery/playwright-runner-adapter.js +185 -0
  45. package/dist/discovery/playwright-runner-adapter.js.map +1 -0
  46. package/dist/discovery/prepare-barrier.d.ts +522 -0
  47. package/dist/discovery/prepare-barrier.d.ts.map +1 -0
  48. package/dist/discovery/prepare-barrier.js +739 -0
  49. package/dist/discovery/prepare-barrier.js.map +1 -0
  50. package/dist/discovery/pytest-adapter.d.ts.map +1 -1
  51. package/dist/discovery/pytest-adapter.js +6 -2
  52. package/dist/discovery/pytest-adapter.js.map +1 -1
  53. package/dist/discovery/pytest-runner-adapter.d.ts +124 -0
  54. package/dist/discovery/pytest-runner-adapter.d.ts.map +1 -0
  55. package/dist/discovery/pytest-runner-adapter.js +454 -0
  56. package/dist/discovery/pytest-runner-adapter.js.map +1 -0
  57. package/dist/discovery/reconcile.d.ts +80 -11
  58. package/dist/discovery/reconcile.d.ts.map +1 -1
  59. package/dist/discovery/reconcile.js +395 -78
  60. package/dist/discovery/reconcile.js.map +1 -1
  61. package/dist/discovery/runner-env.d.ts +88 -2
  62. package/dist/discovery/runner-env.d.ts.map +1 -1
  63. package/dist/discovery/runner-env.js +142 -4
  64. package/dist/discovery/runner-env.js.map +1 -1
  65. package/dist/discovery/static-discovery.d.ts +38 -3
  66. package/dist/discovery/static-discovery.d.ts.map +1 -1
  67. package/dist/discovery/static-discovery.js +454 -15
  68. package/dist/discovery/static-discovery.js.map +1 -1
  69. package/dist/discovery/supervised-run.d.ts +199 -10
  70. package/dist/discovery/supervised-run.d.ts.map +1 -1
  71. package/dist/discovery/supervised-run.js +350 -39
  72. package/dist/discovery/supervised-run.js.map +1 -1
  73. package/dist/discovery/trusted-config.d.ts +180 -6
  74. package/dist/discovery/trusted-config.d.ts.map +1 -1
  75. package/dist/discovery/trusted-config.js +279 -10
  76. package/dist/discovery/trusted-config.js.map +1 -1
  77. package/dist/discovery/vitest-runner-adapter.d.ts +172 -0
  78. package/dist/discovery/vitest-runner-adapter.d.ts.map +1 -0
  79. package/dist/discovery/vitest-runner-adapter.js +607 -0
  80. package/dist/discovery/vitest-runner-adapter.js.map +1 -0
  81. package/dist/fixture/consumer-runner.d.ts +4 -0
  82. package/dist/fixture/consumer-runner.d.ts.map +1 -0
  83. package/dist/fixture/consumer-runner.js +38 -0
  84. package/dist/fixture/consumer-runner.js.map +1 -0
  85. package/dist/fixture/evidence.d.ts +27 -0
  86. package/dist/fixture/evidence.d.ts.map +1 -1
  87. package/dist/fixture/evidence.js +12 -0
  88. package/dist/fixture/evidence.js.map +1 -1
  89. package/dist/fixture/fixture.d.ts +2 -1
  90. package/dist/fixture/fixture.d.ts.map +1 -1
  91. package/dist/fixture/fixture.js +1 -17
  92. package/dist/fixture/fixture.js.map +1 -1
  93. package/dist/fixture/witness-client.d.ts +6 -174
  94. package/dist/fixture/witness-client.d.ts.map +1 -1
  95. package/dist/fixture/witness-client.js +6 -267
  96. package/dist/fixture/witness-client.js.map +1 -1
  97. package/dist/index.d.ts +9 -6
  98. package/dist/index.d.ts.map +1 -1
  99. package/dist/index.js +5 -4
  100. package/dist/index.js.map +1 -1
  101. package/dist/json.d.ts +6 -12
  102. package/dist/json.d.ts.map +1 -1
  103. package/dist/json.js +6 -17
  104. package/dist/json.js.map +1 -1
  105. package/dist/reporter/project-graph-reporter.d.ts +92 -0
  106. package/dist/reporter/project-graph-reporter.d.ts.map +1 -0
  107. package/dist/reporter/project-graph-reporter.js +92 -0
  108. package/dist/reporter/project-graph-reporter.js.map +1 -0
  109. package/dist/reporter/reporter.cjs.map +1 -1
  110. package/dist/reporter/reporter.d.ts +93 -4
  111. package/dist/reporter/reporter.d.ts.map +1 -1
  112. package/dist/reporter/reporter.js +174 -18
  113. package/dist/reporter/reporter.js.map +1 -1
  114. package/dist/runner-claims.d.ts +13 -0
  115. package/dist/runner-claims.d.ts.map +1 -0
  116. package/dist/runner-claims.js +46 -0
  117. package/dist/runner-claims.js.map +1 -0
  118. package/dist/runner-resolution.d.ts +3 -0
  119. package/dist/runner-resolution.d.ts.map +1 -0
  120. package/dist/runner-resolution.js +14 -0
  121. package/dist/runner-resolution.js.map +1 -0
  122. package/dist/supervisor/client.d.ts +23 -1
  123. package/dist/supervisor/client.d.ts.map +1 -1
  124. package/dist/supervisor/client.js +49 -0
  125. package/dist/supervisor/client.js.map +1 -1
  126. package/dist/supervisor/drain.d.ts +65 -0
  127. package/dist/supervisor/drain.d.ts.map +1 -1
  128. package/dist/supervisor/drain.js +353 -9
  129. package/dist/supervisor/drain.js.map +1 -1
  130. package/dist/supervisor/index.d.ts +7 -3
  131. package/dist/supervisor/index.d.ts.map +1 -1
  132. package/dist/supervisor/index.js +7 -3
  133. package/dist/supervisor/index.js.map +1 -1
  134. package/dist/supervisor/spool.d.ts +65 -2
  135. package/dist/supervisor/spool.d.ts.map +1 -1
  136. package/dist/supervisor/spool.js +47 -0
  137. package/dist/supervisor/spool.js.map +1 -1
  138. package/dist/surface.d.ts +6 -207
  139. package/dist/surface.d.ts.map +1 -1
  140. package/dist/surface.js +6 -264
  141. package/dist/surface.js.map +1 -1
  142. package/dist/vitest/index.d.ts +23 -0
  143. package/dist/vitest/index.d.ts.map +1 -0
  144. package/dist/vitest/index.js +356 -0
  145. package/dist/vitest/index.js.map +1 -0
  146. package/dist/vitest/reporter.d.ts +83 -0
  147. package/dist/vitest/reporter.d.ts.map +1 -0
  148. package/dist/vitest/reporter.js +211 -0
  149. package/dist/vitest/reporter.js.map +1 -0
  150. package/dist/vitest/worker-slot.d.ts +36 -0
  151. package/dist/vitest/worker-slot.d.ts.map +1 -0
  152. package/dist/vitest/worker-slot.js +51 -0
  153. package/dist/vitest/worker-slot.js.map +1 -0
  154. package/dist/witness/adapter-registry.d.ts +6 -50
  155. package/dist/witness/adapter-registry.d.ts.map +1 -1
  156. package/dist/witness/adapter-registry.js +6 -257
  157. package/dist/witness/adapter-registry.js.map +1 -1
  158. package/dist/witness/behavior-request.d.ts +6 -76
  159. package/dist/witness/behavior-request.d.ts.map +1 -1
  160. package/dist/witness/behavior-request.js +6 -273
  161. package/dist/witness/behavior-request.js.map +1 -1
  162. package/dist/witness/behavior.d.ts +6 -48
  163. package/dist/witness/behavior.d.ts.map +1 -1
  164. package/dist/witness/behavior.js +6 -114
  165. package/dist/witness/behavior.js.map +1 -1
  166. package/dist/witness/bin.d.ts +6 -17
  167. package/dist/witness/bin.d.ts.map +1 -1
  168. package/dist/witness/bin.js +6 -168
  169. package/dist/witness/bin.js.map +1 -1
  170. package/dist/witness/browser.d.ts +14 -206
  171. package/dist/witness/browser.d.ts.map +1 -1
  172. package/dist/witness/browser.js +15 -654
  173. package/dist/witness/browser.js.map +1 -1
  174. package/dist/witness/classifications.d.ts +6 -38
  175. package/dist/witness/classifications.d.ts.map +1 -1
  176. package/dist/witness/classifications.js +6 -83
  177. package/dist/witness/classifications.js.map +1 -1
  178. package/dist/witness/env-attestation.d.ts +6 -94
  179. package/dist/witness/env-attestation.d.ts.map +1 -1
  180. package/dist/witness/env-attestation.js +6 -198
  181. package/dist/witness/env-attestation.js.map +1 -1
  182. package/dist/witness/fixture-provider.d.ts +6 -82
  183. package/dist/witness/fixture-provider.d.ts.map +1 -1
  184. package/dist/witness/fixture-provider.js +6 -105
  185. package/dist/witness/fixture-provider.js.map +1 -1
  186. package/dist/witness/loopback-pins.d.ts +6 -75
  187. package/dist/witness/loopback-pins.d.ts.map +1 -1
  188. package/dist/witness/loopback-pins.js +6 -240
  189. package/dist/witness/loopback-pins.js.map +1 -1
  190. package/dist/witness/server.d.ts +8 -26
  191. package/dist/witness/server.d.ts.map +1 -1
  192. package/dist/witness/server.js +24 -3761
  193. package/dist/witness/server.js.map +1 -1
  194. package/dist/witness/types.d.ts +6 -882
  195. package/dist/witness/types.d.ts.map +1 -1
  196. package/dist/witness/types.js +9 -1
  197. package/dist/witness/types.js.map +1 -1
  198. package/examples/overlay-proof.spec.js +75 -0
  199. package/package.json +8 -2
  200. package/python/__pycache__/gateforge_persistence_intents.cpython-312.pyc +0 -0
  201. package/python/__pycache__/gateforge_persistence_intents.cpython-314.pyc +0 -0
  202. package/python/gateforge_pytest_plugin.py +462 -0
@@ -1,886 +1,10 @@
1
1
  /**
2
- * Witness-side data shapes (pin #7 wire + adapter contract, pin #8).
3
- */
4
- import type { Server } from 'node:http';
5
- import type { EvidenceRecord, TracedSession, TrustTier } from '@gate-forge/core';
6
- /**
7
- * Supervisor-issued session credential (plan Phase 1, work item 2): the
8
- * trusted supervisor (the Playwright reporter process) opens one session
9
- * per started test and the worker-side fixture RESOLVES it by the exact
10
- * (workerIndex, testId) pair. The session token is issued by the witness,
11
- * never derivable by the suite: submissions without a valid OPEN session
12
- * are rejected fail-closed, so a suite-supplied testId or annotation
13
- * alone cannot mint records for an arbitrary session.
14
- */
15
- export interface SessionCredential {
16
- /** Witness-issued session id (UUID). */
17
- sessionId: string;
18
- /** Per-session secret; required on every submission. */
19
- sessionToken: string;
20
- /** The supervisor-registered testId (records are forced onto it). */
21
- testId: string;
22
- /** The worker the session is bound to. */
23
- workerIndex: number;
24
- /**
25
- * The session's DEDICATED observation-proxy origin (its own loopback
26
- * port), when the run wires an observation proxy: the worker's browser
27
- * uses this origin for the whole test, so every request on it —
28
- * absolute paths included — is attributed to THIS session. Null when
29
- * no observation proxy is active (nothing to attribute).
30
- */
31
- proxyUrl: string | null;
32
- /**
33
- * The supervisor-registered obligation claims for this test (Phase 4
34
- * claim injection): the merged native-annotation + sidecar-mapping
35
- * claims the orchestrating CLI resolved from the tracked mappings and
36
- * the supervisor carried on the session-open path. Declarations only —
37
- * they route evidence onto obligation identities and never satisfy
38
- * anything by themselves; every record is still forced onto the
39
- * supervisor-registered session/test identity and graded from
40
- * witnessed evidence. Empty/absent for runs without mappings.
41
- */
42
- claims?: string[];
43
- }
44
- /**
45
- * `POST /records` body (pin #7, Phase 1 extension): a test-side primitive
46
- * submitting UI-observed evidence. `claimId` is the claimed obligation id —
47
- * the annotation's `<resourceId>:<contract>` — and `testId` binds the record
48
- * to the test that produced the claim. Phase 1: `sessionId` +
49
- * `sessionToken` carry the supervisor-issued session credential; the
50
- * witness rejects submissions without a valid OPEN session and forces the
51
- * record's testId onto the session's supervisor-registered value.
52
- */
53
- export interface RecordsRequest {
54
- claimId: string;
55
- kind: string;
56
- payload: unknown;
57
- testId: string;
58
- sessionId: string;
59
- sessionToken: string;
60
- }
61
- /** `POST /records` response (pin #7, minimal wire contract). */
62
- export interface RecordsResponse {
63
- recordId: string;
64
- trust: TrustTier;
65
- runId: string;
66
- }
67
- /**
68
- * `POST /witness/persistence` body (pin #7): the fixture asks the
69
- * engine-side witness to run the resource's reviewed adapter (GET-only)
70
- * for one entity. The issued record carries the ENGINE OBSERVATION
71
- * (`found`, adapter-normalized `fields`, and a `before` link when a
72
- * pre-observation was consumed) — expectations NEVER come from the
73
- * suite (audit round 5).
74
- *
75
- * `preObservationId` references a witness-issued pre-observation (`POST
76
- * /witness/pre-observation`): an id-set snapshot for create
77
- * postconditions (`before: {entityAbsent}`), or an entity-fields
78
- * snapshot for update postconditions (`before: {found, fields}`).
79
- */
80
- export interface PersistenceRequest {
81
- resourceId: string;
82
- entityId: unknown;
83
- preObservationId?: string;
84
- }
85
- /**
86
- * `POST /witness/pre-observation` body: an engine-side snapshot taken
87
- * BEFORE a claimed action. With `entityId` the witness snapshots that
88
- * entity's observed fields (update postconditions); without it, the
89
- * resource's observed id set (create postconditions). Phase 1: requires
90
- * the supervisor-issued session credential.
91
- */
92
- export interface PreObservationRequest {
93
- resourceId: string;
94
- testId: string;
95
- claimId: string;
96
- entityId?: unknown;
97
- sessionId: string;
98
- sessionToken: string;
99
- }
100
- /** `POST /witness/pre-observation` response. */
101
- export interface PreObservationResponse {
102
- observationId: string;
103
- observed: number;
104
- }
105
- /** `POST /witness/persistence` response (pin #7). */
106
- export interface PersistenceResponse {
107
- recordId: string;
108
- runId: string;
109
- verdictRelevant: {
110
- found: boolean;
111
- fieldsMatch: boolean;
112
- mismatches?: string[];
113
- };
114
- }
115
- /**
116
- * `POST /runs/server-e2e-declarations` body (SUPERVISOR ONLY): the
117
- * obligation ids the trusted mapping layer declared kind `server-e2e`.
118
- * Registration is a PRE-run fact (like the expected set): bound once,
119
- * identical re-registration idempotent, any change or late registration
120
- * refused — the witness never stamps `channel: 'server'` records for
121
- * obligations outside this set, so the suite cannot steer an intent onto
122
- * a browser-kind obligation and a bearer of an intent can never
123
- * self-verify.
124
- */
125
- export interface ServerE2eDeclarationsRequest {
126
- obligations: readonly string[];
127
- }
128
- /** `POST /runs/server-e2e-declarations` response. */
129
- export interface ServerE2eDeclarationsResponse {
130
- bound: true;
131
- count: number;
132
- obligations: string[];
133
- }
134
- /**
135
- * `POST /runs/observe-declarations` body (SUPERVISOR ONLY): the
136
- * obligation ids the trusted mapping layer declared kind `observed-e2e`
137
- * (Observe channel, Phase 2). Registration is a PRE-run fact like the
138
- * server-e2e set: bound once, identical re-registration idempotent, any
139
- * change or late registration refused — the witness never stamps
140
- * `channel: 'observe'` records for obligations outside this set, so a
141
- * suite-driven test can never steer observe evidence onto an
142
- * engine-kind obligation.
143
- */
144
- export interface ObserveDeclarationsRequest {
145
- obligations: readonly string[];
146
- }
147
- /** `POST /runs/observe-declarations` response. */
148
- export interface ObserveDeclarationsResponse {
149
- bound: true;
150
- count: number;
151
- obligations: string[];
152
- }
153
- /**
154
- * `POST /observe/finalize` body (SUPERVISOR ONLY — the drain calls it
155
- * after a passed test, before sealing the session): resolve one
156
- * session's observe-eligible claims against the session's own proxied
157
- * traffic plus independent adapter reads, and stamp witnessed
158
- * `persistence.observed` records for whatever resolves.
159
- *
160
- * The session must still be OPEN (finalize runs before seal; a sealed
161
- * session is refused) so no record is ever injected after the test
162
- * ended. Ambiguity, missing traffic, unparsable bodies, and adapter
163
- * trouble resolve to typed NOTES in the response — never to
164
- * satisfaction, never to a run failure.
165
- */
166
- export interface ObserveFinalizeRequest {
167
- sessionId: string;
168
- }
169
- /** One obligation the finalize resolved into a witnessed record. */
170
- export interface ObserveFinalizedObligation {
171
- /** Obligation id the record was issued under. */
172
- obligationId: string;
173
- /** The issued witnessed record id. */
174
- recordId: string;
175
- /** The CRUD operation the binding proved. */
176
- operation: 'create' | 'read' | 'update' | 'delete';
177
- /** The witness-resolved entity id (scalar or column-keyed object). */
178
- entityId: unknown;
179
- }
180
- /** `POST /observe/finalize` response. */
181
- export interface ObserveFinalizeResponse {
182
- finalized: ObserveFinalizedObligation[];
183
- /** Typed non-satisfaction notes (missing traffic, ambiguity, …). */
184
- notes: string[];
185
- }
186
- /**
187
- * `POST /witness/server-persistence` body (SUPERVISOR ONLY — the drain
188
- * forwards it with the verifier key; the suite can only write intent
189
- * spool lines, never call this): one persistence claim intent, already
190
- * drained from the runner-side intents spool.
191
- *
192
- * - create: `pre` (expect-absent) BEFORE the mutation stores a witness
193
- * pre-observation; `post` (expect-present) probes, consumes it, and
194
- * stamps `before: {entityAbsent}` into the record — the same shape the
195
- * browser path grades.
196
- * - update: `pre` (expect-present) snapshots the entity's fields;
197
- * `post` consumes it into `before: {found, fields}` (the update delta
198
- * grades against the classification's updateableFields in the engine).
199
- * - read: `post` (expect-present) only. delete: `post` (expect-absent
200
- * for hard; expect-present for archive states) only.
201
- *
202
- * `sequence` is strictly increasing per claimId; a replayed or
203
- * out-of-order line resolves to a typed failure (fail closed), so no
204
- * bearer of an intent can re-drive a stale observation.
205
- */
206
- export interface ServerPersistenceIntentRequest {
207
- resourceId: string;
208
- /** Obligation id `<resourceId>:persistence:<op>` the intent serves. */
209
- claimId: string;
210
- operation: 'create' | 'read' | 'update' | 'delete';
211
- phase: 'pre' | 'post';
212
- intent: 'expect-present' | 'expect-absent';
213
- /** The entity key: scalar for single-column PKs, column-keyed object for composite. */
214
- key: unknown;
215
- /** Strictly increasing per claimId (replay → typed failure). */
216
- sequence: number;
217
- /** The claiming test's id (diagnostic attribution; the claim join key). */
218
- testId: string;
219
- }
220
- /** `POST /witness/server-persistence` response for a `pre` intent. */
221
- export interface ServerPreObservationResponse {
222
- resolved: 'pre';
223
- found: boolean;
224
- }
225
- /** `POST /witness/server-persistence` response for a `post` intent. */
226
- export interface ServerPersistenceResponse {
227
- recordId: string;
228
- runId: string;
229
- trust: TrustTier;
230
- channel: 'server';
231
- verdictRelevant: {
232
- found: boolean;
233
- };
234
- }
235
- /** `POST /sessions/open` body (Phase 1; Phase 4 adds claim injection). */
236
- export interface SessionOpenRequest {
237
- /** The test's runner-assigned id (same id the reporter writes to claims.json). */
238
- testId: string;
239
- /** The worker the test runs on (binds worker → session). */
240
- workerIndex: number;
241
- /**
242
- * Supervisor-carried identity of the started test (enforcement-review
243
- * fix 2a/3): repo-relative file + title path + project, as drained from
244
- * the runner's lifecycle spool. When an expected set is registered,
245
- * THIS identity decides membership — a test outside the registered set
246
- * is refused. Optional only for runs without a registered expected set.
247
- */
248
- file?: string;
249
- titlePath?: readonly string[];
250
- project?: string | null;
251
- /**
252
- * Phase 4 claim injection: the mapped obligation claims this test must
253
- * land its evidence on (resolved from the sidecar/native mappings by
254
- * the orchestrating CLI and carried by the supervisor on the
255
- * session-open path). Obligation-id-shaped, deduplicated by the
256
- * witness; empty/absent for annotation-claimed tests, which keep
257
- * working unchanged. Claims remain DECLARATIONS: they never satisfy
258
- * anything by themselves.
259
- */
260
- claims?: readonly string[];
261
- }
262
- /** `POST /sessions/open` response: the session binding (runId, sessionId, testId, worker). */
263
- export interface SessionOpenResponse extends SessionCredential {
264
- /** Witness-monotonic tick at open (the session clock origin). */
265
- openedTick: number;
266
- }
267
- /** `POST /sessions/close` body: the supervisor seals the session with the observed outcome. */
268
- export interface SessionCloseRequest {
269
- sessionId: string;
270
- /** The observed test outcome (e.g. 'passed' | 'failed'); recorded, never graded here. */
271
- outcome?: string;
272
- }
273
- /** `POST /sessions/close` response. */
274
- export interface SessionCloseResponse {
275
- sealed: true;
276
- }
277
- /** `POST /sessions/resolve` body: the worker proves WHICH open session it runs under. */
278
- export interface SessionResolveRequest {
279
- testId: string;
280
- workerIndex: number;
281
- }
282
- /** `POST /sessions/resolve` response (a resolvable credential, proxy prefix included). */
283
- export interface SessionResolveResponse extends SessionCredential {
284
- openedTick: number;
285
- }
286
- /** `POST /sessions/intervals/open` body: the fixture marks a UI-action observation interval. */
287
- export interface IntervalOpenRequest {
288
- sessionId: string;
289
- sessionToken: string;
290
- /** The UI operation the interval covers ('create' | 'read' | 'update' | 'delete'). */
291
- operation: string;
292
- }
293
- /** `POST /sessions/intervals/open` response. */
294
- export interface IntervalOpenResponse {
295
- intervalId: string;
296
- startTick: number;
297
- }
298
- /** `POST /sessions/intervals/close` body. */
299
- export interface IntervalCloseRequest {
300
- sessionId: string;
301
- sessionToken: string;
302
- intervalId: string;
303
- }
304
- /** `POST /sessions/intervals/close` response. */
305
- export interface IntervalCloseResponse {
306
- startTick: number;
307
- endTick: number;
308
- }
309
- /**
310
- * `POST /browser/surface` body (plan Phase 1 item 4): the worker-side
311
- * fixture registers the consumer-declared surface descriptor for one
312
- * open session. The descriptor's selectors are locators only — the
313
- * engine verifies every outcome itself. The driven ORIGIN is never part
314
- * of this body (a present `appBaseUrl` is rejected): the engine drives
315
- * exactly the provisioned attested subject from trusted witness
316
- * configuration. Requires the supervisor-issued session credential on
317
- * an OPEN session; the record's testId is forced onto the session's
318
- * value.
319
- */
320
- export interface BrowserSurfaceRequest {
321
- sessionId: string;
322
- sessionToken: string;
323
- testId: string;
324
- /** The consumer-declared surface descriptor (validated engine-side). */
325
- surface: unknown;
326
- }
327
- /**
328
- * `POST /browser/action` body: perform ONE constrained surface
329
- * operation on the session's engine-owned page and issue
330
- * engine-observed records for it.
331
- */
332
- export interface BrowserActionRequest {
333
- sessionId: string;
334
- sessionToken: string;
335
- testId: string;
336
- /** Obligation ids to issue the engine-observed records under. */
337
- claimIds: string[];
338
- /** The constrained operation to perform. */
339
- operation: 'create' | 'read' | 'update' | 'delete';
340
- /** Entered input (create/update); target entity (read/update/delete). */
341
- fields?: Record<string, string>;
342
- entityId?: string;
343
- }
344
- /** `POST /browser/action` response: the engine's own observation. */
345
- export interface BrowserActionResponse {
346
- /** Entity id OBSERVED from the rendered list (never declared). */
347
- entityId: string;
348
- /** The exact input values the engine typed. */
349
- enteredFields: Record<string, string>;
350
- /** The rendered fields the engine read back. */
351
- renderedFields: Record<string, string>;
352
- /** The app response status the engine captured for the mutation. */
353
- appStatus: number;
354
- /** Engine-side pre-observation id (create/update; consumed by persistence verify). */
355
- preObservationId: string | null;
356
- /** Record ids the engine issued for this action (per claim). */
357
- recordIds: string[];
358
- }
359
- /**
360
- * `POST /browser/visible` body: re-read the rendered result for the
361
- * engine-observed entity on the session's engine page and issue
362
- * engine-observed visible-result records.
363
- */
364
- export interface BrowserVisibleRequest {
365
- sessionId: string;
366
- sessionToken: string;
367
- testId: string;
368
- /** Obligation ids to issue the engine-observed records under. */
369
- claimIds: string[];
370
- /** The engine-observed entity id (must match the action's). */
371
- entityId: string;
372
- /** The original action (decides row vs form readback). */
373
- operation: 'create' | 'read' | 'update' | 'delete';
374
- }
375
- /** `POST /browser/visible` response. */
376
- export interface BrowserVisibleResponse {
377
- entityId: string;
378
- /** The rendered fields the engine read. */
379
- fields: Record<string, string>;
380
- /** Record ids the engine issued (per claim). */
381
- recordIds: string[];
382
- }
383
- /**
384
- * Witness-held session state (plan Phase 1). Created only by
385
- * `POST /sessions/open` (the trusted supervisor, verifier-key
386
- * authenticated — enforcement-review fix 3); sealed by
387
- * `POST /sessions/close` (same authority). Sealed sessions answer no
388
- * submission, no interval, and no resolve call.
389
- */
390
- export interface TestSession {
391
- /** Witness-issued session id (UUID). */
392
- sessionId: string;
393
- /** Per-session secret required on every submission. */
394
- token: string;
395
- /** The supervisor-registered testId (every record is forced onto it). */
396
- testId: string;
397
- /** The worker the session is bound to (one OPEN session per worker). */
398
- workerIndex: number;
399
- /** `open` accepts submissions; `sealed` rejects everything (fail closed). */
400
- status: 'open' | 'sealed';
401
- /** Witness-monotonic tick at open. */
402
- openedTick: number;
403
- /** Witness-monotonic tick at seal (null while open). */
404
- sealedTick: number | null;
405
- /** The outcome the supervisor observed at close (recorded, never graded). */
406
- outcome: string | null;
407
- /**
408
- * UI-action observation intervals keyed by intervalId. End ticks are
409
- * null while the interval is open. Exchanges are consumable as this
410
- * session's evidence only when their tick falls inside one of these
411
- * intervals — setup traffic outside every interval is never credited.
412
- */
413
- intervals: Map<string, {
414
- startTick: number;
415
- endTick: number | null;
416
- operation: string;
417
- }>;
418
- /**
419
- * The session's dedicated observation-proxy origin when the run wires
420
- * an observation proxy; null otherwise.
421
- */
422
- proxyUrl: string | null;
423
- /** The dedicated proxy server (closed when the session seals). */
424
- proxyServer: Server | null;
425
- /**
426
- * Phase 4 claim injection: the mapped obligation claims the supervisor
427
- * registered at open (sorted, deduplicated, obligation-id-shaped;
428
- * empty for annotation-only tests). Echoed in the session view so the
429
- * supervisor writes claims.json from what the witness registered.
430
- */
431
- claims: string[];
432
- /**
433
- * The registered expected-set identity this session was minted for
434
- * (enforcement-review fix 2a/2b); null when the run has no registered
435
- * expected set. Groups the execution trace by expected test.
436
- */
437
- registered: {
438
- testId: string | null;
439
- project: string | null;
440
- file: string;
441
- titlePath: string[];
442
- } | null;
443
- /**
444
- * Witness-side activity bound to this session: a monotonically
445
- * increasing count of everything the witness itself observed under
446
- * the session — ledger records issued with the session credential,
447
- * recorded UI-action intervals, consumed engine-observed exchanges,
448
- * and pre-observations. Diagnostic corroboration only (execution
449
- * authority is the supervisor-observed trusted lifecycle).
450
- */
451
- activity: number;
452
- /**
453
- * Engine-browser surface registration (plan Phase 1 item 4): the
454
- * validated consumer descriptor the engine drives for this session.
455
- * The driven ORIGIN is never stored here — it resolves from trusted
456
- * witness configuration (`targetBaseUrl`) on every call, so a
457
- * suite-named frontend can never become the engine target.
458
- */
459
- engineSurface: {
460
- surface: Record<string, unknown>;
461
- } | null;
462
- }
463
- /**
464
- * One expected test registered by the supervisor BEFORE the run
465
- * (enforcement-review fix 2a). Identity is (project, file, titlePath);
466
- * `testId` is diagnostic (runner-assigned ids are not stable across
467
- * enumeration and execution).
468
- */
469
- export interface ExpectedTestRegistration {
470
- /** The runner-assigned test id, when enumeration bound one. */
471
- testId?: string | null;
472
- /** Runner project, or null when the runner reports none. */
473
- project: string | null;
474
- /** Repo-relative posix file (the identity join key). */
475
- file: string;
476
- /** Full title path (the identity join key). */
477
- titlePath: readonly string[];
478
- }
479
- /** `POST /runs/expected-set` body (SUPERVISOR ONLY). */
480
- export interface ExpectedSetRequest {
481
- /** The expected tests, fixed before the run. */
482
- tests: readonly ExpectedTestRegistration[];
483
- }
484
- /** `POST /runs/expected-set` response. */
485
- export interface ExpectedSetResponse {
486
- /** The set is bound to this run. */
487
- bound: true;
488
- /** Domain-separated digest over the registered set. */
489
- enumerationDigest: string;
490
- /** Number of registered expected tests. */
491
- count: number;
492
- }
493
- /** `GET /runs/execution-trace` response (SUPERVISOR ONLY; fix 2b). */
494
- export interface ExecutionTraceResponse {
495
- /** The digest of the registered expected set (null when none). */
496
- enumerationDigest: string | null;
497
- /** Per expected test, every session the witness recorded. */
498
- tests: Array<{
499
- testId: string | null;
500
- project: string | null;
501
- file: string;
502
- titlePath: string[];
503
- sessions: TracedSession[];
504
- }>;
505
- }
506
- /** Witness runtime configuration (env-derived by the bin, explicit in tests). */
507
- export interface WitnessOptions {
508
- /**
509
- * ADR 0004 D7 (plan §8 / D1): when set, the witness also starts a
510
- * loopback reverse proxy forwarding to this base URL and records
511
- * every forwarded request as an engine observation (the runtime HTTP
512
- * evidence channel). Transport-only: the observation proves the
513
- * witness observed an HTTP exchange; test attribution is
514
- * suite-claimed. Must be loopback.
515
- */
516
- proxyTarget?: string;
517
- /**
518
- * Observation-proxy mount prefix (with `proxyTarget`; e.g. `/api`).
519
- *
520
- * WHY this is an explicit deployment-topology declaration (same
521
- * philosophy as `urlBuilders[].base`): in a real deployment the
522
- * browser reaches the backend THROUGH the frontend — a dev proxy or
523
- * edge serves `/api/ops/...` while the backend route is `/ops/...`.
524
- * Whether such a prefix exists is a property of the deployment the
525
- * engine cannot derive from source, and guessing wrong would silently
526
- * mismatch obligation identities. When set, the observation proxy
527
- * forwards the STRIPPED path to the proxy target AND records the
528
- * STRIPPED path in observation records, so observations match the
529
- * backend-derived obligation identities the suite claims
530
- * (`evidence.http.observe({path: '/ops/x'})`). Requests outside the
531
- * prefix pass through and are recorded unstripped. Absent/null strips
532
- * nothing — forwarding and recording stay byte-identical to an
533
- * unmounted proxy.
534
- */
535
- mountPath?: string | null;
536
- /** Run manifest identity (pin #4). */
537
- runId: string;
538
- /** Per-run token; every call must carry `x-gateforge-run: <token>`. */
539
- token: string;
540
- /**
541
- * Verifier key for the attestation surface (authenticated
542
- * `POST /run-context` binding, `GET /ledger-attestation`, and the
543
- * manifest v2 `attestation` envelope): shared by the orchestrator
544
- * with the witness and the evaluating CLI, NEVER with the tested
545
- * suite. When absent the witness serves no attestation and its
546
- * manifest append stays unauthenticated (downstream evaluation fails
547
- * closed for witnessed records). Environment ONLY (see
548
- * `witness/bin.ts`) — never argv, stdout, state files, or suite env.
549
- */
550
- verifierKey?: string | null;
551
- /** Run-state dir; the witness appends its issued recordIds to manifest.json at shutdown. */
552
- stateDir?: string | null;
553
- /** Directory of reviewed `.mjs` adapters (default `.gateforge/adapters`). */
554
- adaptersDir?: string | null;
555
- /**
556
- * Operator-issued credential the witness presents on its OWN engine-side
557
- * adapter reads (GF-10 mediation; dogfood deployment, 2026-09-05/07).
558
- *
559
- * WHY: adapters perform GET-only reads of the app's own collection
560
- * routes to observe persisted state, and those routes authenticate —
561
- * an unauthenticated loopback read is a 401, so the engine could not
562
- * observe state at all. The credential is issued by the DEPLOYMENT
563
- * OPERATOR to the WITNESS ONLY (env `GATEFORGE_ADAPTER_READ_AUTHORIZATION`
564
- * or `--adapter-read-authorization`), never to the tested suite, and is
565
- * a read-only service principal of the same trust class as the verifier
566
- * key. When unset, adapter reads stay unauthenticated (previous
567
- * behavior) and protected collections simply fail closed with 401/409.
568
- */
569
- adapterReadAuthorization?: string | null;
570
- /** Classifications document path (YAML) for the primaryKey map + adapter aliases. */
571
- classificationsPath?: string | null;
572
- /**
573
- * Attestation subject (the SUT the UI drives). MUST be loopback
574
- * (GF-10); the witness probes its env-fingerprint marker at startup
575
- * when `targetFingerprint` is set (GF-13 minimal v1 attestation).
576
- */
577
- targetBaseUrl?: string | null;
578
- /** Expected `x-gateforge-env-fingerprint` marker at the attestation subject. */
579
- targetFingerprint?: string | null;
580
- /** Default base for adapter reads; a per-adapter `baseUrl` wins. */
581
- adapterBaseUrl?: string | null;
582
- /** Per-witness-call timeout (pin #7 default 5s). */
583
- requestTimeoutMs?: number;
584
- /**
585
- * Completion-barrier deadline for async behavior effects (Phase 5):
586
- * `awaitBarrier` observers get this long to report a real checkpoint.
587
- * Default 30s. A timeout is failure, never success.
588
- */
589
- barrierTimeoutMs?: number;
590
- /** Injected clock for `issuedAt` (ISO-8601); default = system now. */
591
- now?: () => string;
592
- /** Host to bind; default `127.0.0.1` (loopback). */
593
- host?: string;
594
- /**
595
- * Engine-browser launcher override (programmatic use only — never
596
- * env-derived): the executable the engine drives stays engine code
597
- * regardless of which Chromium launches. Tests inject a failing
598
- * launcher to prove the fail-closed path (E16); production leaves it
599
- * unset for the pinned Chromium.
600
- */
601
- engineBrowserLauncher?: import('./browser.js').EngineBrowserLauncher;
602
- /**
603
- * Trusted fixture/actor provider (plan 2026-09-19 §4.5, Phase 4):
604
- * injected by the trusted controller harness (engine-owned bundle),
605
- * never by suite code. Null (default) means strong behavior cases
606
- * block with a missing-provider cause — suite-supplied fixtures are
607
- * never a fallback.
608
- */
609
- fixtureProvider?: import('./fixture-provider.js').FixtureProvider | null;
610
- }
611
- /**
612
- * The normalized adapter module contract (pin #8).
2
+ * Compatibility re-export: `witness/types` now lives in the runner-neutral
3
+ * `@gate-forge/witness` package (plan 2026-09-25 phase 1).
613
4
  *
614
- * `probeServer` (optional; the server-witnessed persistence channel) is
615
- * the adapter's server-side probe: the witness executes it ONLY in the
616
- * witness process (trusted side) against the app's own database/state —
617
- * for backend-only tables (a transactional outbox) that can never
618
- * honestly appear in a UI. Contract:
619
- *
620
- * ```js
621
- * export default {
622
- * ...,
623
- * async probeServer(ctx, subject) {
624
- * const row = await db.query('select * from outbox where id = $1', [subject]);
625
- * return { found: row !== undefined, fields: row ?? null };
626
- * },
627
- * };
628
- * ```
629
- *
630
- * `subject` is the entity key EXACTLY as the persistence intent declared
631
- * it (scalar for single-column primary keys, column-keyed object for
632
- * composite keys); the return MUST be
633
- * `{found: boolean, fields: Record<string, unknown> | null}`. A throw or
634
- * a malformed shape resolves the intent as a typed
635
- * SERVER_PROBE_UNAVAILABLE failure — never to satisfaction (fail
636
- * closed). Adapters without the export simply cannot serve the server
637
- * channel; the browser path is unaffected.
638
- */
639
- export interface EvidenceAdapter {
640
- /** GET-only transport. Returns the raw entity body, or null when absent. */
641
- read: (ctx: AdapterContext, id: unknown) => Promise<unknown> | unknown;
642
- /**
643
- * Optional GET-only listing of the resource's entities (raw bodies).
644
- * Powers engine-side pre-observations for create postconditions; when
645
- * absent the witness refuses pre-observations for the resource.
646
- */
647
- list?: (ctx: AdapterContext) => Promise<unknown[]> | unknown[];
648
- /** Projects the raw body onto {entityId, fields} — stamped from the RESPONSE. */
649
- normalize: (body: unknown) => {
650
- entityId: unknown;
651
- fields: unknown;
652
- };
653
- /** Removal semantics the adapter's resource uses. */
654
- deletion: 'hard' | 'archive';
655
- /** Fingerprint the adapter's target environment must present. */
656
- environmentFingerprint: string;
657
- /** Optional base override for THIS adapter's reads. */
658
- baseUrl?: string;
659
- /**
660
- * Optional SERVER PROBE, executed witness-side only (see the interface
661
- * doc): observes the app database directly and reports the entity's
662
- * presence + observed column state.
663
- */
664
- probeServer?: (ctx: AdapterContext, subject: unknown) => Promise<ServerProbeResult> | ServerProbeResult;
665
- /**
666
- * Optional OBSERVE binding (Observe channel, Phase 2): declares which
667
- * proxied HTTP exchanges count as mutations of this resource when a
668
- * suite-driven browser test runs. Each declared operation names the
669
- * method + backend-facing path template; `{id}` marks the single
670
- * segment carrying the entity id (required on read/update/delete,
671
- * forbidden on create — create ids come from the list-diff). Only
672
- * declared operations are observe-eligible; anything else grades
673
- * typed-missing. Observe additionally requires `list` (before-
674
- * snapshots); an adapter without it can serve no observe obligation.
675
- */
676
- observe?: ObserveBinding;
677
- /**
678
- * Optional TRUSTED scope observation (plan 2026-09-19 §4.4, Phase 4):
679
- * observes an independently controlled state source (read-only
680
- * database credentials, a trusted state sidecar, or equivalent
681
- * owner-provisioned observer outside candidate code) for one approved
682
- * scope key within one fixture namespace. Reading only the
683
- * candidate's own GET handler is insufficient for the protected
684
- * profile. Adapters lacking this method still serve legacy proofs;
685
- * they cannot satisfy strong contracts requiring scoped observation.
686
- */
687
- snapshotScope?: (ctx: AdapterContext, input: SnapshotScopeInput) => Promise<ScopeSnapshot> | ScopeSnapshot;
688
- /**
689
- * Optional completion-barrier observer (plan 2026-09-19 §4.4): waits
690
- * for a real completion/queue checkpoint for an engine-issued
691
- * operation. An observer, not a state maker: it must not sleep-then-
692
- * true, mutate state, or return true on timeout.
693
- */
694
- awaitBarrier?: (ctx: AdapterContext, input: BarrierInput) => Promise<{
695
- complete: boolean;
696
- checkpoint: string;
697
- }> | {
698
- complete: boolean;
699
- checkpoint: string;
700
- };
701
- }
702
- /**
703
- * One observe-eligible mutation shape: the HTTP method (uppercase) and
704
- * the backend-facing path template. `{id}` matches exactly one non-
705
- * empty path segment and binds the entity id for read/update/delete.
706
- */
707
- export interface ObserveMutation {
708
- /** Concrete uppercase HTTP method, e.g. `'POST'`. */
709
- method: string;
710
- /** Backend-facing absolute path, e.g. `'/api/v2/accounts/{id}'`. */
711
- path: string;
712
- }
713
- /** Per-operation observe bindings for one resource adapter. */
714
- export interface ObserveBinding {
715
- create?: ObserveMutation;
716
- read?: ObserveMutation;
717
- update?: ObserveMutation;
718
- delete?: ObserveMutation;
719
- }
720
- /** The shape an adapter `probeServer` must return (validated witness-side). */
721
- export interface ServerProbeResult {
722
- /** Whether the probed entity exists in the engine-observed state. */
723
- found: boolean;
724
- /** The observed column state when found (null when absent). */
725
- fields: Record<string, unknown> | null;
726
- }
727
- /** `POST /runs/behavior-catalog` request (supervisor only, one-time bind). */
728
- export interface BehaviorCatalogRequest {
729
- /** Compiled behavior catalog (validated against the core schema). */
730
- catalog: unknown;
731
- /**
732
- * Allowed case/test assignments: testId → required case ids the
733
- * supervisor permits that test to execute. Every case id must exist
734
- * in the catalog; every id must belong to an obligation the mapping
735
- * already claims (checked by the supervisor before sending).
736
- */
737
- assignments: Record<string, string[]>;
738
- /**
739
- * Complete route inventory for principal attribution (resourceId,
740
- * method, canonicalPath per route, sorted). The grader re-resolves
741
- * every attempt against this exact set — never a claim or payload.
742
- */
743
- routes: unknown;
744
- /**
745
- * Authority profile digest the witness seals into every case record
746
- * (engine bundle binding, provisioned by the trusted controller).
747
- */
748
- authorityProfileDigest: string;
749
- }
750
- /** `POST /runs/behavior-catalog` response. */
751
- export interface BehaviorCatalogResponse {
752
- bound: true;
753
- caseCount: number;
754
- assignmentCount: number;
755
- routeCount: number;
756
- }
757
- /** `POST /behavior/execute` request: exactly these keys, nothing else. */
758
- export interface BehaviorExecuteRequest {
759
- sessionId: string;
760
- sessionToken: string;
761
- caseId: string;
762
- }
763
- /**
764
- * `POST /behavior/execute` response: a REDACTED result reference. Actor
765
- * credential material, fixture subjects, and expectations never appear
766
- * here — the worker may name an allowed case but can never read or
767
- * override actor credentials, expectations, before-state, or origin.
768
- */
769
- export interface BehaviorExecuteResponse {
770
- caseId: string;
771
- executionId: string;
772
- /** Isolated fixture namespace for this execution. */
773
- namespace: string;
774
- /** Authoritative before checkpoint (empty until the principal runs). */
775
- beforeCheckpoint: string | null;
776
- /** Lifecycle state after this call. */
777
- state: string;
778
- }
779
- /** `POST /behavior/principal` request: drive the principal operation. */
780
- export interface BehaviorPrincipalRequest {
781
- sessionId: string;
782
- sessionToken: string;
783
- executionId: string;
784
- }
785
- /**
786
- * `POST /behavior/principal` response: redacted seal reference. The
787
- * witness-owned driver executed, the barrier resolved, after-state was
788
- * observed, and the `behavior.case` record(s) were issued — grading
789
- * happens core-side, never here.
790
- */
791
- export interface BehaviorPrincipalResponse {
792
- caseId: string;
793
- executionId: string;
794
- recordIds: string[];
795
- state: string;
796
- }
797
- /** Witness-side lifecycle state of one required-case execution. */
798
- export type CaseExecutionState = 'fixture-prepared' | 'before-snapshot-complete' | 'principal-executing' | 'principal-captured' | 'barrier-reached' | 'after-snapshot-complete' | 'sealed' | 'failed';
799
- /** One entity inside a trusted scope snapshot. */
800
- export interface SnapshotEntity {
801
- /**
802
- * Entity identity: scalar for single-column keys, complete
803
- * column-keyed object for composite keys (matching core identity
804
- * behavior). Unknown identity blocks the case.
805
- */
806
- entityId: unknown;
807
- /** Projected field map (exactly the declared scope fields). */
808
- fields: Record<string, unknown>;
809
- }
810
- /**
811
- * Strict trusted scope snapshot (plan 2026-09-19 §4.4): data, never a
812
- * verdict. `complete:false`, pagination not exhausted, omitted declared
813
- * fields, unknown identity, inconsistent checkpoints, or size-limit
814
- * truncation blocks the case — the harness never silently samples.
5
+ * The move is physical, not behavioural: this module forwards every
6
+ * export unchanged so `@gate-forge/pack-playwright`'s published import
7
+ * paths — which consumers pin — keep resolving to the same values.
815
8
  */
816
- export interface ScopeSnapshot {
817
- /** Approved snapshot scope key. */
818
- scope: string;
819
- /** Fixture namespace actually observed (must equal the case lease). */
820
- fixtureNamespace: string;
821
- /** False when collection is partial for any reason. */
822
- complete: boolean;
823
- /** Authoritative checkpoint (before/after comparison + barriers). */
824
- checkpoint: string;
825
- /** Entities in canonical order (duplicate identity rejected). */
826
- entities: SnapshotEntity[];
827
- /** True when pagination was exhausted (absent = unknown = incomplete). */
828
- exhausted?: boolean;
829
- /** Total size when the scope enforces a limit (truncation blocks). */
830
- totalSize?: number;
831
- }
832
- /** Input to an adapter `snapshotScope` observation. */
833
- export interface SnapshotScopeInput {
834
- /** Approved snapshot scope key. */
835
- scope: string;
836
- /** Fixture namespace to observe (never the whole database). */
837
- fixtureNamespace: string;
838
- }
839
- /** Input to an adapter `awaitBarrier` observation. */
840
- export interface BarrierInput {
841
- /** Approved snapshot scope key. */
842
- scope: string;
843
- /** Fixture namespace to observe. */
844
- fixtureNamespace: string;
845
- /** Engine-issued operation id awaiting completion. */
846
- operationId: string;
847
- /** Hard deadline in milliseconds (timeout is failure, not success). */
848
- deadlineMs: number;
849
- }
850
- /** The transport handed to `read` (GET-only, engine-mediated). */
851
- export interface AdapterContext {
852
- /** The resolved read base for this adapter. */
853
- baseUrl: string;
854
- /** The resource this adapter serves. */
855
- resourceId: string;
856
- /**
857
- * The ONLY outbound primitive available to adapters: a GET returning
858
- * a minimal response view (status + JSON/text body + headers).
859
- */
860
- get: (path: string) => Promise<{
861
- status: number;
862
- json(): Promise<unknown>;
863
- text(): Promise<string>;
864
- headers: Headers;
865
- }>;
866
- /**
867
- * Headers adapters MUST attach to any direct fetch they perform
868
- * instead of `get` (dogfood, 2026-09-05): carries the operator-issued
869
- * engine read credential (`WitnessOptions.adapterReadAuthorization`)
870
- * so engine-side GET-only state observation can authenticate against
871
- * the app's own collection routes. Never suite-supplied, never
872
- * attached to browser traffic.
873
- */
874
- headers?: Record<string, string>;
875
- }
876
- /** Full witness-issued record (superset of the pinned wire response). */
877
- export type IssuedRecord = EvidenceRecord;
878
- /** Result of spawning/attaching a witness service. */
879
- export interface WitnessHandle {
880
- /** Base URL (loopback, OS-assigned port). */
881
- url: string;
882
- /** Stop the server; appends issued recordIds to the run manifest (pin #4/#7). */
883
- proxyUrl: string | null;
884
- stop: () => Promise<void>;
885
- }
9
+ export * from '@gate-forge/witness/witness/types';
886
10
  //# sourceMappingURL=types.d.ts.map