@gate-forge/witness 0.0.0-stage → 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 (123) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +114 -2
  3. package/dist/adapter/contract-suite.d.ts +167 -0
  4. package/dist/adapter/contract-suite.d.ts.map +1 -0
  5. package/dist/adapter/contract-suite.js +348 -0
  6. package/dist/adapter/contract-suite.js.map +1 -0
  7. package/dist/adapter/contract.d.ts +266 -0
  8. package/dist/adapter/contract.d.ts.map +1 -0
  9. package/dist/adapter/contract.js +2 -0
  10. package/dist/adapter/contract.js.map +1 -0
  11. package/dist/adapter/index.d.ts +8 -0
  12. package/dist/adapter/index.d.ts.map +1 -0
  13. package/dist/adapter/index.js +2 -0
  14. package/dist/adapter/index.js.map +1 -0
  15. package/dist/adapter-kit/config.d.ts +163 -0
  16. package/dist/adapter-kit/config.d.ts.map +1 -0
  17. package/dist/adapter-kit/config.js +21 -0
  18. package/dist/adapter-kit/config.js.map +1 -0
  19. package/dist/adapter-kit/define.d.ts +47 -0
  20. package/dist/adapter-kit/define.d.ts.map +1 -0
  21. package/dist/adapter-kit/define.js +336 -0
  22. package/dist/adapter-kit/define.js.map +1 -0
  23. package/dist/adapter-kit/index.d.ts +34 -0
  24. package/dist/adapter-kit/index.d.ts.map +1 -0
  25. package/dist/adapter-kit/index.js +32 -0
  26. package/dist/adapter-kit/index.js.map +1 -0
  27. package/dist/adapter-kit/projection.d.ts +69 -0
  28. package/dist/adapter-kit/projection.d.ts.map +1 -0
  29. package/dist/adapter-kit/projection.js +85 -0
  30. package/dist/adapter-kit/projection.js.map +1 -0
  31. package/dist/adapter-kit/session.d.ts +105 -0
  32. package/dist/adapter-kit/session.d.ts.map +1 -0
  33. package/dist/adapter-kit/session.js +230 -0
  34. package/dist/adapter-kit/session.js.map +1 -0
  35. package/dist/client/witness-client.d.ts +193 -0
  36. package/dist/client/witness-client.d.ts.map +1 -0
  37. package/dist/client/witness-client.js +321 -0
  38. package/dist/client/witness-client.js.map +1 -0
  39. package/dist/constants.d.ts +189 -0
  40. package/dist/constants.d.ts.map +1 -0
  41. package/dist/constants.js +197 -0
  42. package/dist/constants.js.map +1 -0
  43. package/dist/index.d.ts +15 -0
  44. package/dist/index.d.ts.map +1 -0
  45. package/dist/index.js +20 -0
  46. package/dist/index.js.map +1 -0
  47. package/dist/json.d.ts +16 -0
  48. package/dist/json.d.ts.map +1 -0
  49. package/dist/json.js +21 -0
  50. package/dist/json.js.map +1 -0
  51. package/dist/queue/bullmq.d.ts +28 -0
  52. package/dist/queue/bullmq.d.ts.map +1 -0
  53. package/dist/queue/bullmq.js +210 -0
  54. package/dist/queue/bullmq.js.map +1 -0
  55. package/dist/queue/observer.d.ts +130 -0
  56. package/dist/queue/observer.d.ts.map +1 -0
  57. package/dist/queue/observer.js +179 -0
  58. package/dist/queue/observer.js.map +1 -0
  59. package/dist/surface.d.ts +211 -0
  60. package/dist/surface.d.ts.map +1 -0
  61. package/dist/surface.js +268 -0
  62. package/dist/surface.js.map +1 -0
  63. package/dist/witness/adapter-registry.d.ts +92 -0
  64. package/dist/witness/adapter-registry.d.ts.map +1 -0
  65. package/dist/witness/adapter-registry.js +370 -0
  66. package/dist/witness/adapter-registry.js.map +1 -0
  67. package/dist/witness/behavior-request.d.ts +80 -0
  68. package/dist/witness/behavior-request.d.ts.map +1 -0
  69. package/dist/witness/behavior-request.js +335 -0
  70. package/dist/witness/behavior-request.js.map +1 -0
  71. package/dist/witness/behavior.d.ts +52 -0
  72. package/dist/witness/behavior.d.ts.map +1 -0
  73. package/dist/witness/behavior.js +118 -0
  74. package/dist/witness/behavior.js.map +1 -0
  75. package/dist/witness/bin.d.ts +21 -0
  76. package/dist/witness/bin.d.ts.map +1 -0
  77. package/dist/witness/bin.js +254 -0
  78. package/dist/witness/bin.js.map +1 -0
  79. package/dist/witness/browser.d.ts +221 -0
  80. package/dist/witness/browser.d.ts.map +1 -0
  81. package/dist/witness/browser.js +644 -0
  82. package/dist/witness/browser.js.map +1 -0
  83. package/dist/witness/chaos.d.ts +179 -0
  84. package/dist/witness/chaos.d.ts.map +1 -0
  85. package/dist/witness/chaos.js +270 -0
  86. package/dist/witness/chaos.js.map +1 -0
  87. package/dist/witness/classifications.d.ts +42 -0
  88. package/dist/witness/classifications.d.ts.map +1 -0
  89. package/dist/witness/classifications.js +87 -0
  90. package/dist/witness/classifications.js.map +1 -0
  91. package/dist/witness/env-attestation.d.ts +98 -0
  92. package/dist/witness/env-attestation.d.ts.map +1 -0
  93. package/dist/witness/env-attestation.js +202 -0
  94. package/dist/witness/env-attestation.js.map +1 -0
  95. package/dist/witness/fixture-provider.d.ts +89 -0
  96. package/dist/witness/fixture-provider.d.ts.map +1 -0
  97. package/dist/witness/fixture-provider.js +116 -0
  98. package/dist/witness/fixture-provider.js.map +1 -0
  99. package/dist/witness/loopback-pins.d.ts +79 -0
  100. package/dist/witness/loopback-pins.d.ts.map +1 -0
  101. package/dist/witness/loopback-pins.js +244 -0
  102. package/dist/witness/loopback-pins.js.map +1 -0
  103. package/dist/witness/run-options.d.ts +47 -0
  104. package/dist/witness/run-options.d.ts.map +1 -0
  105. package/dist/witness/run-options.js +179 -0
  106. package/dist/witness/run-options.js.map +1 -0
  107. package/dist/witness/server.d.ts +34 -0
  108. package/dist/witness/server.d.ts.map +1 -0
  109. package/dist/witness/server.js +4899 -0
  110. package/dist/witness/server.js.map +1 -0
  111. package/dist/witness/task.d.ts +77 -0
  112. package/dist/witness/task.d.ts.map +1 -0
  113. package/dist/witness/task.js +201 -0
  114. package/dist/witness/task.js.map +1 -0
  115. package/dist/witness/twin-shapes.d.ts +51 -0
  116. package/dist/witness/twin-shapes.d.ts.map +1 -0
  117. package/dist/witness/twin-shapes.js +127 -0
  118. package/dist/witness/twin-shapes.js.map +1 -0
  119. package/dist/witness/types.d.ts +1094 -0
  120. package/dist/witness/types.d.ts.map +1 -0
  121. package/dist/witness/types.js +2 -0
  122. package/dist/witness/types.js.map +1 -0
  123. package/package.json +98 -4
@@ -0,0 +1,189 @@
1
+ /**
2
+ * Shared constants of the Playwright evidence pack (pin #7, plan §5.3).
3
+ *
4
+ * These names are the wire contract between the fixture (test process),
5
+ * the reporter (runner process), and the witness service (engine
6
+ * process). They are also the documented env surface of `gateforge
7
+ * test-gates` (packages/cli/README.md "test-gates protocol") — the CLI
8
+ * already exports GATEFORGE_RUN_ID / GATEFORGE_RUN_TOKEN /
9
+ * GATEFORGE_STATE_DIR / GATEFORGE_OBLIGATIONS / GATEFORGE_WITNESS_URL;
10
+ * the pack augments the target/attestation/adapter surface below.
11
+ */
12
+ /** Claim annotation type: `{type: 'gateforge', description: '<obligation id>'}`. */
13
+ export declare const CLAIM_ANNOTATION_TYPE = "gateforge";
14
+ /** Per-run auth header on every witness call (pin #7). */
15
+ export declare const RUN_HEADER = "x-gateforge-run";
16
+ /**
17
+ * Verifier auth header on the witness attestation surface
18
+ * (`GET /ledger-attestation` and the manifest MAC). Carries the
19
+ * verifier key — a secret the orchestrator shares with the witness and
20
+ * the evaluating CLI but NEVER with the tested suite (the suite's run
21
+ * token authorizes evidence submission; it must not authorize
22
+ * attestation, or a hostile suite could certify its own fabrications).
23
+ */
24
+ export declare const VERIFIER_HEADER = "x-gateforge-verifier";
25
+ /** Marker header the SUT (or its attestation proxy) must present. */
26
+ export declare const ENV_FINGERPRINT_HEADER = "x-gateforge-env-fingerprint";
27
+ /** Marker header the SUT (or its attestation proxy) may present. */
28
+ export declare const ATTESTATION_SCOPE_HEADER = "x-gateforge-attestation-scope";
29
+ /** Evidence kinds the witness /records endpoint accepts (plan §5.3). */
30
+ export declare const UI_ACTION_KIND = "ui.action";
31
+ export declare const UI_VISIBLE_RESULT_KIND = "ui.visible-result";
32
+ export declare const PERSISTENCE_KIND = "persistence.entity";
33
+ /**
34
+ * Observe-channel persistence kind (Phase 2): issued ONLY by the
35
+ * witness's observe finalize (engine-side proxy capture + adapter
36
+ * read) — never suite-submittable (`/records` rejects it like every
37
+ * persistence kind) and never engine-driven.
38
+ */
39
+ export declare const OBSERVED_KIND = "persistence.observed";
40
+ export declare const KNOWN_RECORD_KINDS: readonly string[];
41
+ /** Persistence kinds are ONLY issued by the witness (engine-side adapter reads). */
42
+ export declare const KNOWN_PERSISTENCE_KINDS: readonly string[];
43
+ /** Env the CLI test-gates suite already receives (documented contract). */
44
+ export declare const ENV_RUN_ID = "GATEFORGE_RUN_ID";
45
+ export declare const ENV_RUN_TOKEN = "GATEFORGE_RUN_TOKEN";
46
+ export declare const ENV_STATE_DIR = "GATEFORGE_STATE_DIR";
47
+ export declare const ENV_OBLIGATIONS = "GATEFORGE_OBLIGATIONS";
48
+ export declare const ENV_WITNESS_URL = "GATEFORGE_WITNESS_URL";
49
+ /** Pack-extended env surface (documented in this package's README). */
50
+ export declare const ENV_APP_BASE_URL = "GATEFORGE_APP_BASE_URL";
51
+ export declare const ENV_TARGET_BASE_URL = "GATEFORGE_TARGET_BASE_URL";
52
+ export declare const ENV_TARGET_FINGERPRINT = "GATEFORGE_TARGET_FINGERPRINT";
53
+ export declare const ENV_ADAPTERS_DIR = "GATEFORGE_ADAPTERS_DIR";
54
+ export declare const ENV_CLASSIFICATIONS = "GATEFORGE_CLASSIFICATIONS";
55
+ export declare const ENV_ADAPTER_BASE_URL = "GATEFORGE_ADAPTER_BASE_URL";
56
+ /**
57
+ * Timing-chaos surface (E63): the SEEDED release plan the observation
58
+ * proxy applies to proxied app responses. Set by
59
+ * `gateforge test-gates --chaos <seed>` on the SPAWNED witness only —
60
+ * absent means the byte-identical no-chaos path. The seed is the switch;
61
+ * the other two only tune its bounds.
62
+ */
63
+ export declare const ENV_CHAOS_SEED = "GATEFORGE_CHAOS_SEED";
64
+ /** Upper bound of every applied chaos delay, in whole milliseconds. */
65
+ export declare const ENV_CHAOS_MAX_DELAY_MS = "GATEFORGE_CHAOS_MAX_DELAY_MS";
66
+ /** Whether a later response may be released before an earlier one. */
67
+ export declare const ENV_CHAOS_REORDER = "GATEFORGE_CHAOS_REORDER";
68
+ /**
69
+ * Twin path coverage (E64): the observation-only shape recording a run
70
+ * turns on with `enforcement.twinPaths`. Set by the orchestrating CLI
71
+ * on the SPAWNED witness only; absent means no proxy wiring, no
72
+ * recorded shape and a byte-identical run.
73
+ */
74
+ export declare const ENV_TWIN_SHAPES = "GATEFORGE_TWIN_SHAPES";
75
+ /**
76
+ * Owner-declared query keys whose VALUES a recorded twin shape may
77
+ * carry (`enforcement.twinQueryKeys`). Absent or empty = keys only, so
78
+ * a non-allowlisted value can never reach a report or the state
79
+ * directory.
80
+ */
81
+ export declare const ENV_TWIN_QUERY_KEYS = "GATEFORGE_TWIN_QUERY_KEYS";
82
+ /**
83
+ * Absolute path to the engine-written route inventory the shapes
84
+ * resolve against (so a shape names a route template, never a concrete
85
+ * id). Absent = the identifier-blind fallback, never a raw path.
86
+ */
87
+ export declare const ENV_TWIN_INVENTORY = "GATEFORGE_TWIN_INVENTORY";
88
+ /** Observation proxy target (loopback base URL the proxy forwards to). */
89
+ export declare const ENV_PROXY_TARGET = "GATEFORGE_PROXY_TARGET";
90
+ /**
91
+ * Observation-proxy mount prefix (e.g. `/api`): the browser-facing path
92
+ * prefix a frontend dev proxy adds before backend routes. The proxy
93
+ * strips it before forwarding and before recording observations, so
94
+ * records match backend-derived obligation identities.
95
+ */
96
+ export declare const ENV_MOUNT_PATH = "GATEFORGE_MOUNT_PATH";
97
+ /**
98
+ * Verifier key for the witness attestation surface. Environment ONLY —
99
+ * never argv (a process's cmdline is world-readable via /proc), and
100
+ * never exported to the tested suite. Same variable the orchestrating
101
+ * CLI reads (`gateforge test-gates`).
102
+ */
103
+ export declare const ENV_WITNESS_VERIFIER_KEY = "GATEFORGE_WITNESS_VERIFIER_KEY";
104
+ /**
105
+ * Operator-provided trusted fixture/actor provider (plan 2026-09-25
106
+ * Phase 2): an absolute path to a `fixture-provider.mjs` module (or the
107
+ * directory holding it) whose default export implements the
108
+ * `FixtureProvider` interface. It is the ONLY source of case fixtures
109
+ * and actor credentials, so it is read engine-side here and never
110
+ * travels to the suite. Absent (the default) strong behavior cases
111
+ * block with a typed cause instead of falling back to suite-supplied
112
+ * fixtures.
113
+ */
114
+ export declare const ENV_FIXTURE_PROVIDER = "GATEFORGE_FIXTURE_PROVIDER";
115
+ /** Opt-in reporter exit-code semantics (standalone runs only). */
116
+ export declare const ENV_REPORTER_FAIL_RUN = "GATEFORGE_REPORTER_FAIL_RUN";
117
+ /**
118
+ * Absolute path of the runner-outcomes document the gateforge reporter
119
+ * writes for trusted runner supervision (plan Phase 4 item 4, ADR 0005
120
+ * D2): per-instance outcomes, attempts, expected failures, and the
121
+ * run-level fixture/teardown outcome. Set by the supervised adapter
122
+ * (`test-gates --changed`); when absent the reporter writes nothing —
123
+ * supervision then fails closed on the missing outcomes file.
124
+ */
125
+ export declare const ENV_OUTCOMES_FILE = "GATEFORGE_OUTCOMES_FILE";
126
+ /**
127
+ * Run-state file (written by the orchestrating CLI) carrying the mapped
128
+ * obligation claims for sidecar/native-mapped tests, keyed by
129
+ * `<file>#<titlePath.join('>')>` (the reconciliation key). The reporter
130
+ * carries these claims on the session-open path (Phase 4 claim
131
+ * injection) so their evidence lands on the right claims; native
132
+ * annotations keep working unchanged.
133
+ */
134
+ export declare const CLAIM_INJECTIONS_FILE = "claim-injections.json";
135
+ /** Run-state file carrying the sealed supervision execution result. */
136
+ export declare const EXECUTION_RESULT_FILE = "execution-result.json";
137
+ /**
138
+ * Run-state spool directory (enforcement-review fix 3): the runner-side
139
+ * reporter writes test lifecycle events (testBegin/testEnd with outcome)
140
+ * as NUL-safe JSON lines under `<stateDir>/spool/<runId>/`; the trusted
141
+ * CLI drains them and performs the witness supervisor calls (session
142
+ * open/close) with credentials that exist ONLY in the CLI process. The
143
+ * runner child holds no supervisor rights.
144
+ */
145
+ export declare const SPOOL_DIR_NAME = "spool";
146
+ /** The spool's event file (JSON lines; consumed by the CLI drain loop). */
147
+ export declare const SPOOL_EVENTS_FILE = "events.jsonl";
148
+ /**
149
+ * The spool's persistence-claim-intent file (JSON lines; same NUL-safe
150
+ * line protocol as `events.jsonl`): the supervised (UNTRUSTED) test
151
+ * process reports claim INTENTS here — {entity, operation, phase, intent,
152
+ * key, claimId, testId, sequence}. The suite can only write intents; it
153
+ * can NEVER stamp evidence. The trusted CLI's spool drain forwards each
154
+ * intent to the witness over the verifier-key supervisor surface, where
155
+ * the resource's adapter SERVER PROBE runs (witness-side) and — only
156
+ * then — a witnessed `persistence.entity` record stamped
157
+ * `channel: 'server'` may be issued.
158
+ */
159
+ export declare const SPOOL_INTENTS_FILE = "persistence-intents.jsonl";
160
+ /**
161
+ * Payload discriminant the witness stamps on server-probed persistence
162
+ * records (core's verdict engine keys the server-witnessed channel off
163
+ * this + {@link SERVER_E2E_TEST_KIND}).
164
+ */
165
+ export declare const SERVER_CHANNEL = "server";
166
+ /** The mapping kind that unlocks the server-witnessed channel. */
167
+ export declare const SERVER_E2E_TEST_KIND = "server-e2e";
168
+ /**
169
+ * Payload discriminant the witness stamps on observe-finalized
170
+ * persistence records (Observe channel, Phase 2: core's verdict engine
171
+ * keys the observe branch off this channel on `persistence.observed`
172
+ * records).
173
+ */
174
+ export declare const OBSERVE_CHANNEL = "observe";
175
+ /** The mapping kind that unlocks the Observe channel. */
176
+ export declare const OBSERVED_E2E_TEST_KIND = "observed-e2e";
177
+ /** Run-state file carrying the authenticated gate receipt. */
178
+ export declare const GATE_RECEIPT_FILE = "receipt.json";
179
+ /** Run-state diagnostics report (plan §3.5; never witness evidence). */
180
+ export declare const DIAGNOSTICS_REPORT_FILE = "diagnostics.json";
181
+ /** Witness file inside the state dir carrying the spawned URL. */
182
+ export declare const WITNESS_URL_FILE = "witness-url.json";
183
+ /** Default per-witness-call timeout (pin #7: 5s). */
184
+ export declare const DEFAULT_REQUEST_TIMEOUT_MS = 5000;
185
+ /** The loopback hostname the witness, proxy, and fixture servers bind. */
186
+ export declare const LOOPBACK_HOSTNAME = "127.0.0.1";
187
+ /** Loopback-equivalent hostnames the witness accepts as attestation subjects. */
188
+ export declare const LOOPBACK_HOSTS: Record<string, true>;
189
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,oFAAoF;AACpF,eAAO,MAAM,qBAAqB,cAAc,CAAC;AAEjD,0DAA0D;AAC1D,eAAO,MAAM,UAAU,oBAAoB,CAAC;AAE5C;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,yBAAyB,CAAC;AAEtD,qEAAqE;AACrE,eAAO,MAAM,sBAAsB,gCAAgC,CAAC;AAEpE,oEAAoE;AACpE,eAAO,MAAM,wBAAwB,kCAAkC,CAAC;AAExE,wEAAwE;AACxE,eAAO,MAAM,cAAc,cAAc,CAAC;AAC1C,eAAO,MAAM,sBAAsB,sBAAsB,CAAC;AAC1D,eAAO,MAAM,gBAAgB,uBAAuB,CAAC;AACrD;;;;;GAKG;AACH,eAAO,MAAM,aAAa,yBAAyB,CAAC;AACpD,eAAO,MAAM,kBAAkB,EAAE,SAAS,MAAM,EAG/C,CAAC;AACF,oFAAoF;AACpF,eAAO,MAAM,uBAAuB,EAAE,SAAS,MAAM,EAAsC,CAAC;AAE5F,2EAA2E;AAC3E,eAAO,MAAM,UAAU,qBAAqB,CAAC;AAC7C,eAAO,MAAM,aAAa,wBAAwB,CAAC;AACnD,eAAO,MAAM,aAAa,wBAAwB,CAAC;AACnD,eAAO,MAAM,eAAe,0BAA0B,CAAC;AACvD,eAAO,MAAM,eAAe,0BAA0B,CAAC;AAEvD,uEAAuE;AACvE,eAAO,MAAM,gBAAgB,2BAA2B,CAAC;AACzD,eAAO,MAAM,mBAAmB,8BAA8B,CAAC;AAC/D,eAAO,MAAM,sBAAsB,iCAAiC,CAAC;AACrE,eAAO,MAAM,gBAAgB,2BAA2B,CAAC;AACzD,eAAO,MAAM,mBAAmB,8BAA8B,C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AC;AAErD,8DAA8D;AAC9D,eAAO,MAAM,iBAAiB,iBAAiB,CAAC;AAEhD,wEAAwE;AACxE,eAAO,MAAM,uBAAuB,qBAAqB,CAAC;AAE1D,kEAAkE;AAClE,eAAO,MAAM,gBAAgB,qBAAqB,CAAC;AAEnD,qDAAqD;AACrD,eAAO,MAAM,0BAA0B,OAAO,CAAC;AAE/C,0EAA0E;AAC1E,eAAO,MAAM,iBAAiB,cAAc,CAAC;AAE7C,iFAAiF;AACjF,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAK/C,CAAC"}
@@ -0,0 +1,197 @@
1
+ /**
2
+ * Shared constants of the Playwright evidence pack (pin #7, plan §5.3).
3
+ *
4
+ * These names are the wire contract between the fixture (test process),
5
+ * the reporter (runner process), and the witness service (engine
6
+ * process). They are also the documented env surface of `gateforge
7
+ * test-gates` (packages/cli/README.md "test-gates protocol") — the CLI
8
+ * already exports GATEFORGE_RUN_ID / GATEFORGE_RUN_TOKEN /
9
+ * GATEFORGE_STATE_DIR / GATEFORGE_OBLIGATIONS / GATEFORGE_WITNESS_URL;
10
+ * the pack augments the target/attestation/adapter surface below.
11
+ */
12
+ /** Claim annotation type: `{type: 'gateforge', description: '<obligation id>'}`. */
13
+ export const CLAIM_ANNOTATION_TYPE = 'gateforge';
14
+ /** Per-run auth header on every witness call (pin #7). */
15
+ export const RUN_HEADER = 'x-gateforge-run';
16
+ /**
17
+ * Verifier auth header on the witness attestation surface
18
+ * (`GET /ledger-attestation` and the manifest MAC). Carries the
19
+ * verifier key — a secret the orchestrator shares with the witness and
20
+ * the evaluating CLI but NEVER with the tested suite (the suite's run
21
+ * token authorizes evidence submission; it must not authorize
22
+ * attestation, or a hostile suite could certify its own fabrications).
23
+ */
24
+ export const VERIFIER_HEADER = 'x-gateforge-verifier';
25
+ /** Marker header the SUT (or its attestation proxy) must present. */
26
+ export const ENV_FINGERPRINT_HEADER = 'x-gateforge-env-fingerprint';
27
+ /** Marker header the SUT (or its attestation proxy) may present. */
28
+ export const ATTESTATION_SCOPE_HEADER = 'x-gateforge-attestation-scope';
29
+ /** Evidence kinds the witness /records endpoint accepts (plan §5.3). */
30
+ export const UI_ACTION_KIND = 'ui.action';
31
+ export const UI_VISIBLE_RESULT_KIND = 'ui.visible-result';
32
+ export const PERSISTENCE_KIND = 'persistence.entity';
33
+ /**
34
+ * Observe-channel persistence kind (Phase 2): issued ONLY by the
35
+ * witness's observe finalize (engine-side proxy capture + adapter
36
+ * read) — never suite-submittable (`/records` rejects it like every
37
+ * persistence kind) and never engine-driven.
38
+ */
39
+ export const OBSERVED_KIND = 'persistence.observed';
40
+ export const KNOWN_RECORD_KINDS = [
41
+ UI_ACTION_KIND,
42
+ UI_VISIBLE_RESULT_KIND,
43
+ ];
44
+ /** Persistence kinds are ONLY issued by the witness (engine-side adapter reads). */
45
+ export const KNOWN_PERSISTENCE_KINDS = [PERSISTENCE_KIND, OBSERVED_KIND];
46
+ /** Env the CLI test-gates suite already receives (documented contract). */
47
+ export const ENV_RUN_ID = 'GATEFORGE_RUN_ID';
48
+ export const ENV_RUN_TOKEN = 'GATEFORGE_RUN_TOKEN';
49
+ export const ENV_STATE_DIR = 'GATEFORGE_STATE_DIR';
50
+ export const ENV_OBLIGATIONS = 'GATEFORGE_OBLIGATIONS';
51
+ export const ENV_WITNESS_URL = 'GATEFORGE_WITNESS_URL';
52
+ /** Pack-extended env surface (documented in this package's README). */
53
+ export const ENV_APP_BASE_URL = 'GATEFORGE_APP_BASE_URL';
54
+ export const ENV_TARGET_BASE_URL = 'GATEFORGE_TARGET_BASE_URL';
55
+ export const ENV_TARGET_FINGERPRINT = 'GATEFORGE_TARGET_FINGERPRINT';
56
+ export const ENV_ADAPTERS_DIR = 'GATEFORGE_ADAPTERS_DIR';
57
+ export const ENV_CLASSIFICATIONS = 'GATEFORGE_CLASSIFICATIONS';
58
+ export const ENV_ADAPTER_BASE_URL = 'GATEFORGE_ADAPTER_BASE_URL';
59
+ /**
60
+ * Timing-chaos surface (E63): the SEEDED release plan the observation
61
+ * proxy applies to proxied app responses. Set by
62
+ * `gateforge test-gates --chaos <seed>` on the SPAWNED witness only —
63
+ * absent means the byte-identical no-chaos path. The seed is the switch;
64
+ * the other two only tune its bounds.
65
+ */
66
+ export const ENV_CHAOS_SEED = 'GATEFORGE_CHAOS_SEED';
67
+ /** Upper bound of every applied chaos delay, in whole milliseconds. */
68
+ export const ENV_CHAOS_MAX_DELAY_MS = 'GATEFORGE_CHAOS_MAX_DELAY_MS';
69
+ /** Whether a later response may be released before an earlier one. */
70
+ export const ENV_CHAOS_REORDER = 'GATEFORGE_CHAOS_REORDER';
71
+ /**
72
+ * Twin path coverage (E64): the observation-only shape recording a run
73
+ * turns on with `enforcement.twinPaths`. Set by the orchestrating CLI
74
+ * on the SPAWNED witness only; absent means no proxy wiring, no
75
+ * recorded shape and a byte-identical run.
76
+ */
77
+ export const ENV_TWIN_SHAPES = 'GATEFORGE_TWIN_SHAPES';
78
+ /**
79
+ * Owner-declared query keys whose VALUES a recorded twin shape may
80
+ * carry (`enforcement.twinQueryKeys`). Absent or empty = keys only, so
81
+ * a non-allowlisted value can never reach a report or the state
82
+ * directory.
83
+ */
84
+ export const ENV_TWIN_QUERY_KEYS = 'GATEFORGE_TWIN_QUERY_KEYS';
85
+ /**
86
+ * Absolute path to the engine-written route inventory the shapes
87
+ * resolve against (so a shape names a route template, never a concrete
88
+ * id). Absent = the identifier-blind fallback, never a raw path.
89
+ */
90
+ export const ENV_TWIN_INVENTORY = 'GATEFORGE_TWIN_INVENTORY';
91
+ /** Observation proxy target (loopback base URL the proxy forwards to). */
92
+ export const ENV_PROXY_TARGET = 'GATEFORGE_PROXY_TARGET';
93
+ /**
94
+ * Observation-proxy mount prefix (e.g. `/api`): the browser-facing path
95
+ * prefix a frontend dev proxy adds before backend routes. The proxy
96
+ * strips it before forwarding and before recording observations, so
97
+ * records match backend-derived obligation identities.
98
+ */
99
+ export const ENV_MOUNT_PATH = 'GATEFORGE_MOUNT_PATH';
100
+ /**
101
+ * Verifier key for the witness attestation surface. Environment ONLY —
102
+ * never argv (a process's cmdline is world-readable via /proc), and
103
+ * never exported to the tested suite. Same variable the orchestrating
104
+ * CLI reads (`gateforge test-gates`).
105
+ */
106
+ export const ENV_WITNESS_VERIFIER_KEY = 'GATEFORGE_WITNESS_VERIFIER_KEY';
107
+ /**
108
+ * Operator-provided trusted fixture/actor provider (plan 2026-09-25
109
+ * Phase 2): an absolute path to a `fixture-provider.mjs` module (or the
110
+ * directory holding it) whose default export implements the
111
+ * `FixtureProvider` interface. It is the ONLY source of case fixtures
112
+ * and actor credentials, so it is read engine-side here and never
113
+ * travels to the suite. Absent (the default) strong behavior cases
114
+ * block with a typed cause instead of falling back to suite-supplied
115
+ * fixtures.
116
+ */
117
+ export const ENV_FIXTURE_PROVIDER = 'GATEFORGE_FIXTURE_PROVIDER';
118
+ /** Opt-in reporter exit-code semantics (standalone runs only). */
119
+ export const ENV_REPORTER_FAIL_RUN = 'GATEFORGE_REPORTER_FAIL_RUN';
120
+ /**
121
+ * Absolute path of the runner-outcomes document the gateforge reporter
122
+ * writes for trusted runner supervision (plan Phase 4 item 4, ADR 0005
123
+ * D2): per-instance outcomes, attempts, expected failures, and the
124
+ * run-level fixture/teardown outcome. Set by the supervised adapter
125
+ * (`test-gates --changed`); when absent the reporter writes nothing —
126
+ * supervision then fails closed on the missing outcomes file.
127
+ */
128
+ export const ENV_OUTCOMES_FILE = 'GATEFORGE_OUTCOMES_FILE';
129
+ /**
130
+ * Run-state file (written by the orchestrating CLI) carrying the mapped
131
+ * obligation claims for sidecar/native-mapped tests, keyed by
132
+ * `<file>#<titlePath.join('>')>` (the reconciliation key). The reporter
133
+ * carries these claims on the session-open path (Phase 4 claim
134
+ * injection) so their evidence lands on the right claims; native
135
+ * annotations keep working unchanged.
136
+ */
137
+ export const CLAIM_INJECTIONS_FILE = 'claim-injections.json';
138
+ /** Run-state file carrying the sealed supervision execution result. */
139
+ export const EXECUTION_RESULT_FILE = 'execution-result.json';
140
+ /**
141
+ * Run-state spool directory (enforcement-review fix 3): the runner-side
142
+ * reporter writes test lifecycle events (testBegin/testEnd with outcome)
143
+ * as NUL-safe JSON lines under `<stateDir>/spool/<runId>/`; the trusted
144
+ * CLI drains them and performs the witness supervisor calls (session
145
+ * open/close) with credentials that exist ONLY in the CLI process. The
146
+ * runner child holds no supervisor rights.
147
+ */
148
+ export const SPOOL_DIR_NAME = 'spool';
149
+ /** The spool's event file (JSON lines; consumed by the CLI drain loop). */
150
+ export const SPOOL_EVENTS_FILE = 'events.jsonl';
151
+ /**
152
+ * The spool's persistence-claim-intent file (JSON lines; same NUL-safe
153
+ * line protocol as `events.jsonl`): the supervised (UNTRUSTED) test
154
+ * process reports claim INTENTS here — {entity, operation, phase, intent,
155
+ * key, claimId, testId, sequence}. The suite can only write intents; it
156
+ * can NEVER stamp evidence. The trusted CLI's spool drain forwards each
157
+ * intent to the witness over the verifier-key supervisor surface, where
158
+ * the resource's adapter SERVER PROBE runs (witness-side) and — only
159
+ * then — a witnessed `persistence.entity` record stamped
160
+ * `channel: 'server'` may be issued.
161
+ */
162
+ export const SPOOL_INTENTS_FILE = 'persistence-intents.jsonl';
163
+ /**
164
+ * Payload discriminant the witness stamps on server-probed persistence
165
+ * records (core's verdict engine keys the server-witnessed channel off
166
+ * this + {@link SERVER_E2E_TEST_KIND}).
167
+ */
168
+ export const SERVER_CHANNEL = 'server';
169
+ /** The mapping kind that unlocks the server-witnessed channel. */
170
+ export const SERVER_E2E_TEST_KIND = 'server-e2e';
171
+ /**
172
+ * Payload discriminant the witness stamps on observe-finalized
173
+ * persistence records (Observe channel, Phase 2: core's verdict engine
174
+ * keys the observe branch off this channel on `persistence.observed`
175
+ * records).
176
+ */
177
+ export const OBSERVE_CHANNEL = 'observe';
178
+ /** The mapping kind that unlocks the Observe channel. */
179
+ export const OBSERVED_E2E_TEST_KIND = 'observed-e2e';
180
+ /** Run-state file carrying the authenticated gate receipt. */
181
+ export const GATE_RECEIPT_FILE = 'receipt.json';
182
+ /** Run-state diagnostics report (plan §3.5; never witness evidence). */
183
+ export const DIAGNOSTICS_REPORT_FILE = 'diagnostics.json';
184
+ /** Witness file inside the state dir carrying the spawned URL. */
185
+ export const WITNESS_URL_FILE = 'witness-url.json';
186
+ /** Default per-witness-call timeout (pin #7: 5s). */
187
+ export const DEFAULT_REQUEST_TIMEOUT_MS = 5000;
188
+ /** The loopback hostname the witness, proxy, and fixture servers bind. */
189
+ export const LOOPBACK_HOSTNAME = '127.0.0.1';
190
+ /** Loopback-equivalent hostnames the witness accepts as attestation subjects. */
191
+ export const LOOPBACK_HOSTS = {
192
+ localhost: true,
193
+ '[::1]': true,
194
+ '::1': true,
195
+ '127.0.0.1': true,
196
+ };
197
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,oFAAoF;AACpF,MAAM,CAAC,MAAM,qBAAqB,GAAG,WAAW,CAAC;AAEjD,0DAA0D;AAC1D,MAAM,CAAC,MAAM,UAAU,GAAG,iBAAiB,CAAC;AAE5C;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,sBAAsB,CAAC;AAEtD,qEAAqE;AACrE,MAAM,CAAC,MAAM,sBAAsB,GAAG,6BAA6B,CAAC;AAEpE,oEAAoE;AACpE,MAAM,CAAC,MAAM,wBAAwB,GAAG,+BAA+B,CAAC;AAExE,wEAAwE;AACxE,MAAM,CAAC,MAAM,cAAc,GAAG,WAAW,CAAC;AAC1C,MAAM,CAAC,MAAM,sBAAsB,GAAG,mBAAmB,CAAC;AAC1D,MAAM,CAAC,MAAM,gBAAgB,GAAG,oBAAoB,CAAC;AACrD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,sBAAsB,CAAC;AACpD,MAAM,CAAC,MAAM,kBAAkB,GAAsB;IACnD,cAA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AC,MAAM,iBAAiB,GAAG,WAAW,CAAC;AAE7C,iFAAiF;AACjF,MAAM,CAAC,MAAM,cAAc,GAAyB;IAClD,SAAS,EAAE,IAAI;IACf,OAAO,EAAE,IAAI;IACb,KAAK,EAAE,IAAI;IACX,WAAW,EAAE,IAAI;CAClB,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * `@gate-forge/witness` — the runner-neutral gateforge witness.
3
+ *
4
+ * Phase 0 of plan 2026-09-25 lands the runner-adapter contract and its
5
+ * conformance suite here, so the contract lives with the witness it
6
+ * serves rather than inside a package named after one runner. Later
7
+ * phases move the witness service itself (`witness/`), the per-test
8
+ * session client, and the non-Playwright runner adapters into this
9
+ * package; `@gate-forge/pack-playwright` re-exports them so existing
10
+ * imports keep working.
11
+ */
12
+ export * from './adapter/index.js';
13
+ export * from './witness/chaos.js';
14
+ export * from './witness/twin-shapes.js';
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,cAAc,oBAAoB,CAAC;AAInC,cAAc,oBAAoB,CAAC;AAGnC,cAAc,0BAA0B,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,20 @@
1
+ /**
2
+ * `@gate-forge/witness` — the runner-neutral gateforge witness.
3
+ *
4
+ * Phase 0 of plan 2026-09-25 lands the runner-adapter contract and its
5
+ * conformance suite here, so the contract lives with the witness it
6
+ * serves rather than inside a package named after one runner. Later
7
+ * phases move the witness service itself (`witness/`), the per-test
8
+ * session client, and the non-Playwright runner adapters into this
9
+ * package; `@gate-forge/pack-playwright` re-exports them so existing
10
+ * imports keep working.
11
+ */
12
+ export * from './adapter/index.js';
13
+ // The seeded timing-chaos plan (E63). Exported so a run's schedule can
14
+ // be recomputed from (seed, session, route key, k) without replaying
15
+ // the whole suite - that is what makes a finding reproducible.
16
+ export * from './witness/chaos.js';
17
+ // The observation-only twin shape plan (E64). Exported so a caller can
18
+ // compute a run's own shapes from the same vocabulary the proxy records.
19
+ export * from './witness/twin-shapes.js';
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,cAAc,oBAAoB,CAAC;AACnC,uEAAuE;AACvE,qEAAqE;AACrE,+DAA+D;AAC/D,cAAc,oBAAoB,CAAC;AACnC,uEAAuE;AACvE,yEAAyE;AACzE,cAAc,0BAA0B,CAAC"}
package/dist/json.d.ts ADDED
@@ -0,0 +1,16 @@
1
+ /**
2
+ * GF-canonical-JSON serialization for witness/reporter payloads.
3
+ *
4
+ * All hashes, state artifacts, and comparisons in the pack must go
5
+ * through the pin-#1 canonical form. The frozen core `canonicalJson`
6
+ * requires a compile-time `JsonValue`; wire payloads and adapter
7
+ * responses arrive as `unknown`, so this module re-checks with the core
8
+ * `isJsonValue` guard and renders the canonical form (or throws — a
9
+ * non-JSON payload is a contract violation, never a silent truncation).
10
+ */
11
+ import { isJsonValue } from '@gate-forge/core';
12
+ /** Throws unless the value is JSON-representable, then canonicalizes it. */
13
+ export declare function canonicalOf(value: unknown): string;
14
+ /** JSON-representable check for wire payloads before hashing. */
15
+ export { isJsonValue };
16
+ //# sourceMappingURL=json.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../src/json.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAiB,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE9D,4EAA4E;AAC5E,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAKlD;AAED,iEAAiE;AACjE,OAAO,EAAE,WAAW,EAAE,CAAC"}
package/dist/json.js ADDED
@@ -0,0 +1,21 @@
1
+ /**
2
+ * GF-canonical-JSON serialization for witness/reporter payloads.
3
+ *
4
+ * All hashes, state artifacts, and comparisons in the pack must go
5
+ * through the pin-#1 canonical form. The frozen core `canonicalJson`
6
+ * requires a compile-time `JsonValue`; wire payloads and adapter
7
+ * responses arrive as `unknown`, so this module re-checks with the core
8
+ * `isJsonValue` guard and renders the canonical form (or throws — a
9
+ * non-JSON payload is a contract violation, never a silent truncation).
10
+ */
11
+ import { canonicalJson, isJsonValue } from '@gate-forge/core';
12
+ /** Throws unless the value is JSON-representable, then canonicalizes it. */
13
+ export function canonicalOf(value) {
14
+ if (!isJsonValue(value)) {
15
+ throw new TypeError('value is not GF-canonical-JSON-representable');
16
+ }
17
+ return canonicalJson(value);
18
+ }
19
+ /** JSON-representable check for wire payloads before hashing. */
20
+ export { isJsonValue };
21
+ //# sourceMappingURL=json.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json.js","sourceRoot":"","sources":["../src/json.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE9D,4EAA4E;AAC5E,MAAM,UAAU,WAAW,CAAC,KAAc;IACxC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;QACxB,MAAM,IAAI,SAAS,CAAC,8CAA8C,CAAC,CAAC;IACtE,CAAC;IACD,OAAO,aAAa,CAAC,KAAK,CAAC,CAAC;AAC9B,CAAC;AAED,iEAAiE;AACjE,OAAO,EAAE,WAAW,EAAE,CAAC"}
@@ -0,0 +1,28 @@
1
+ import { type QueueObserverConfig } from '@gate-forge/core';
2
+ import { type QueueChannel } from './observer.js';
3
+ /** The queue job payload key carrying the engine's delivery identity. */
4
+ export declare const DELIVERY_ID_KEY = "gateforgeDeliveryId";
5
+ /** The queue job payload key carrying the engine's idempotency key. */
6
+ export declare const IDEMPOTENCY_KEY_KEY = "gateforgeIdempotencyKey";
7
+ /** The BullMQ job name every engine-produced delivery carries. */
8
+ export declare const BULLMQ_DELIVERY_JOB_NAME = "gateforge-delivery";
9
+ /** The BullMQ connection material (host/port, or a Redis URL). */
10
+ export type BullmqConnection = {
11
+ host: string;
12
+ port: number;
13
+ } | {
14
+ url: string;
15
+ };
16
+ /**
17
+ * Opens the BullMQ channel over one connection. One `Queue` handle per
18
+ * declared queue; every handle is closed exactly once.
19
+ *
20
+ * Args:
21
+ * config: the validated engine-owned configuration.
22
+ * connection: host/port or URL connection material.
23
+ *
24
+ * Returns:
25
+ * QueueChannel: the opened observer + deliverer.
26
+ */
27
+ export declare function createBullmqChannel(config: QueueObserverConfig, connection: BullmqConnection): QueueChannel;
28
+ //# sourceMappingURL=bullmq.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bullmq.d.ts","sourceRoot":"","sources":["../../src/queue/bullmq.ts"],"names":[],"mappings":"AAeA,OAAO,EAOL,KAAK,mBAAmB,EACzB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAGL,KAAK,YAAY,EAKlB,MAAM,eAAe,CAAC;AAevB,yEAAyE;AACzE,eAAO,MAAM,eAAe,wBAAwB,CAAC;AAErD,uEAAuE;AACvE,eAAO,MAAM,mBAAmB,4BAA4B,CAAC;AAmB7D,kEAAkE;AAClE,eAAO,MAAM,wBAAwB,uBAAuB,CAAC;AAE7D,kEAAkE;AAClE,MAAM,MAAM,gBAAgB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAwDhF;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,mBAAmB,EAAE,UAAU,EAAE,gBAAgB,GAAG,YAAY,CA2G3G"}