@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.
- package/README.md +31 -0
- package/dist/constants.d.ts +13 -140
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +13 -148
- package/dist/constants.js.map +1 -1
- package/dist/cypress/plugin.d.ts +53 -0
- package/dist/cypress/plugin.d.ts.map +1 -0
- package/dist/cypress/plugin.js +369 -0
- package/dist/cypress/plugin.js.map +1 -0
- package/dist/cypress/spec-scan.d.ts +39 -0
- package/dist/cypress/spec-scan.d.ts.map +1 -0
- package/dist/cypress/spec-scan.js +301 -0
- package/dist/cypress/spec-scan.js.map +1 -0
- package/dist/diagnosis.d.ts +39 -0
- package/dist/diagnosis.d.ts.map +1 -0
- package/dist/diagnosis.js +63 -0
- package/dist/diagnosis.js.map +1 -0
- package/dist/discovery/adapter-projection.d.ts +13 -0
- package/dist/discovery/adapter-projection.d.ts.map +1 -0
- package/dist/discovery/adapter-projection.js +84 -0
- package/dist/discovery/adapter-projection.js.map +1 -0
- package/dist/discovery/config-locations.d.ts +5 -0
- package/dist/discovery/config-locations.d.ts.map +1 -0
- package/dist/discovery/config-locations.js +19 -0
- package/dist/discovery/config-locations.js.map +1 -0
- package/dist/discovery/cypress-runner-adapter.d.ts +112 -0
- package/dist/discovery/cypress-runner-adapter.d.ts.map +1 -0
- package/dist/discovery/cypress-runner-adapter.js +501 -0
- package/dist/discovery/cypress-runner-adapter.js.map +1 -0
- package/dist/discovery/discover.d.ts +53 -1
- package/dist/discovery/discover.d.ts.map +1 -1
- package/dist/discovery/discover.js +100 -3
- package/dist/discovery/discover.js.map +1 -1
- package/dist/discovery/git-ignore.d.ts +13 -0
- package/dist/discovery/git-ignore.d.ts.map +1 -0
- package/dist/discovery/git-ignore.js +62 -0
- package/dist/discovery/git-ignore.js.map +1 -0
- package/dist/discovery/index.d.ts +9 -0
- package/dist/discovery/index.d.ts.map +1 -1
- package/dist/discovery/index.js +9 -0
- package/dist/discovery/index.js.map +1 -1
- package/dist/discovery/playwright-runner-adapter.d.ts +108 -0
- package/dist/discovery/playwright-runner-adapter.d.ts.map +1 -0
- package/dist/discovery/playwright-runner-adapter.js +185 -0
- package/dist/discovery/playwright-runner-adapter.js.map +1 -0
- package/dist/discovery/prepare-barrier.d.ts +522 -0
- package/dist/discovery/prepare-barrier.d.ts.map +1 -0
- package/dist/discovery/prepare-barrier.js +739 -0
- package/dist/discovery/prepare-barrier.js.map +1 -0
- package/dist/discovery/pytest-adapter.d.ts.map +1 -1
- package/dist/discovery/pytest-adapter.js +6 -2
- package/dist/discovery/pytest-adapter.js.map +1 -1
- package/dist/discovery/pytest-runner-adapter.d.ts +124 -0
- package/dist/discovery/pytest-runner-adapter.d.ts.map +1 -0
- package/dist/discovery/pytest-runner-adapter.js +454 -0
- package/dist/discovery/pytest-runner-adapter.js.map +1 -0
- package/dist/discovery/reconcile.d.ts +80 -11
- package/dist/discovery/reconcile.d.ts.map +1 -1
- package/dist/discovery/reconcile.js +395 -78
- package/dist/discovery/reconcile.js.map +1 -1
- package/dist/discovery/runner-env.d.ts +88 -2
- package/dist/discovery/runner-env.d.ts.map +1 -1
- package/dist/discovery/runner-env.js +142 -4
- package/dist/discovery/runner-env.js.map +1 -1
- package/dist/discovery/static-discovery.d.ts +38 -3
- package/dist/discovery/static-discovery.d.ts.map +1 -1
- package/dist/discovery/static-discovery.js +454 -15
- package/dist/discovery/static-discovery.js.map +1 -1
- package/dist/discovery/supervised-run.d.ts +199 -10
- package/dist/discovery/supervised-run.d.ts.map +1 -1
- package/dist/discovery/supervised-run.js +350 -39
- package/dist/discovery/supervised-run.js.map +1 -1
- package/dist/discovery/trusted-config.d.ts +180 -6
- package/dist/discovery/trusted-config.d.ts.map +1 -1
- package/dist/discovery/trusted-config.js +279 -10
- package/dist/discovery/trusted-config.js.map +1 -1
- package/dist/discovery/vitest-runner-adapter.d.ts +172 -0
- package/dist/discovery/vitest-runner-adapter.d.ts.map +1 -0
- package/dist/discovery/vitest-runner-adapter.js +607 -0
- package/dist/discovery/vitest-runner-adapter.js.map +1 -0
- package/dist/fixture/consumer-runner.d.ts +4 -0
- package/dist/fixture/consumer-runner.d.ts.map +1 -0
- package/dist/fixture/consumer-runner.js +38 -0
- package/dist/fixture/consumer-runner.js.map +1 -0
- package/dist/fixture/evidence.d.ts +27 -0
- package/dist/fixture/evidence.d.ts.map +1 -1
- package/dist/fixture/evidence.js +12 -0
- package/dist/fixture/evidence.js.map +1 -1
- package/dist/fixture/fixture.d.ts +2 -1
- package/dist/fixture/fixture.d.ts.map +1 -1
- package/dist/fixture/fixture.js +1 -17
- package/dist/fixture/fixture.js.map +1 -1
- package/dist/fixture/witness-client.d.ts +6 -174
- package/dist/fixture/witness-client.d.ts.map +1 -1
- package/dist/fixture/witness-client.js +6 -267
- package/dist/fixture/witness-client.js.map +1 -1
- package/dist/index.d.ts +9 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -4
- package/dist/index.js.map +1 -1
- package/dist/json.d.ts +6 -12
- package/dist/json.d.ts.map +1 -1
- package/dist/json.js +6 -17
- package/dist/json.js.map +1 -1
- package/dist/reporter/project-graph-reporter.d.ts +92 -0
- package/dist/reporter/project-graph-reporter.d.ts.map +1 -0
- package/dist/reporter/project-graph-reporter.js +92 -0
- package/dist/reporter/project-graph-reporter.js.map +1 -0
- package/dist/reporter/reporter.cjs.map +1 -1
- package/dist/reporter/reporter.d.ts +93 -4
- package/dist/reporter/reporter.d.ts.map +1 -1
- package/dist/reporter/reporter.js +174 -18
- package/dist/reporter/reporter.js.map +1 -1
- package/dist/runner-claims.d.ts +13 -0
- package/dist/runner-claims.d.ts.map +1 -0
- package/dist/runner-claims.js +46 -0
- package/dist/runner-claims.js.map +1 -0
- package/dist/runner-resolution.d.ts +3 -0
- package/dist/runner-resolution.d.ts.map +1 -0
- package/dist/runner-resolution.js +14 -0
- package/dist/runner-resolution.js.map +1 -0
- package/dist/supervisor/client.d.ts +23 -1
- package/dist/supervisor/client.d.ts.map +1 -1
- package/dist/supervisor/client.js +49 -0
- package/dist/supervisor/client.js.map +1 -1
- package/dist/supervisor/drain.d.ts +65 -0
- package/dist/supervisor/drain.d.ts.map +1 -1
- package/dist/supervisor/drain.js +353 -9
- package/dist/supervisor/drain.js.map +1 -1
- package/dist/supervisor/index.d.ts +7 -3
- package/dist/supervisor/index.d.ts.map +1 -1
- package/dist/supervisor/index.js +7 -3
- package/dist/supervisor/index.js.map +1 -1
- package/dist/supervisor/spool.d.ts +65 -2
- package/dist/supervisor/spool.d.ts.map +1 -1
- package/dist/supervisor/spool.js +47 -0
- package/dist/supervisor/spool.js.map +1 -1
- package/dist/surface.d.ts +6 -207
- package/dist/surface.d.ts.map +1 -1
- package/dist/surface.js +6 -264
- package/dist/surface.js.map +1 -1
- package/dist/vitest/index.d.ts +23 -0
- package/dist/vitest/index.d.ts.map +1 -0
- package/dist/vitest/index.js +356 -0
- package/dist/vitest/index.js.map +1 -0
- package/dist/vitest/reporter.d.ts +83 -0
- package/dist/vitest/reporter.d.ts.map +1 -0
- package/dist/vitest/reporter.js +211 -0
- package/dist/vitest/reporter.js.map +1 -0
- package/dist/vitest/worker-slot.d.ts +36 -0
- package/dist/vitest/worker-slot.d.ts.map +1 -0
- package/dist/vitest/worker-slot.js +51 -0
- package/dist/vitest/worker-slot.js.map +1 -0
- package/dist/witness/adapter-registry.d.ts +6 -50
- package/dist/witness/adapter-registry.d.ts.map +1 -1
- package/dist/witness/adapter-registry.js +6 -257
- package/dist/witness/adapter-registry.js.map +1 -1
- package/dist/witness/behavior-request.d.ts +6 -76
- package/dist/witness/behavior-request.d.ts.map +1 -1
- package/dist/witness/behavior-request.js +6 -273
- package/dist/witness/behavior-request.js.map +1 -1
- package/dist/witness/behavior.d.ts +6 -48
- package/dist/witness/behavior.d.ts.map +1 -1
- package/dist/witness/behavior.js +6 -114
- package/dist/witness/behavior.js.map +1 -1
- package/dist/witness/bin.d.ts +6 -17
- package/dist/witness/bin.d.ts.map +1 -1
- package/dist/witness/bin.js +6 -168
- package/dist/witness/bin.js.map +1 -1
- package/dist/witness/browser.d.ts +14 -206
- package/dist/witness/browser.d.ts.map +1 -1
- package/dist/witness/browser.js +15 -654
- package/dist/witness/browser.js.map +1 -1
- package/dist/witness/classifications.d.ts +6 -38
- package/dist/witness/classifications.d.ts.map +1 -1
- package/dist/witness/classifications.js +6 -83
- package/dist/witness/classifications.js.map +1 -1
- package/dist/witness/env-attestation.d.ts +6 -94
- package/dist/witness/env-attestation.d.ts.map +1 -1
- package/dist/witness/env-attestation.js +6 -198
- package/dist/witness/env-attestation.js.map +1 -1
- package/dist/witness/fixture-provider.d.ts +6 -82
- package/dist/witness/fixture-provider.d.ts.map +1 -1
- package/dist/witness/fixture-provider.js +6 -105
- package/dist/witness/fixture-provider.js.map +1 -1
- package/dist/witness/loopback-pins.d.ts +6 -75
- package/dist/witness/loopback-pins.d.ts.map +1 -1
- package/dist/witness/loopback-pins.js +6 -240
- package/dist/witness/loopback-pins.js.map +1 -1
- package/dist/witness/server.d.ts +8 -26
- package/dist/witness/server.d.ts.map +1 -1
- package/dist/witness/server.js +24 -3761
- package/dist/witness/server.js.map +1 -1
- package/dist/witness/types.d.ts +6 -882
- package/dist/witness/types.d.ts.map +1 -1
- package/dist/witness/types.js +9 -1
- package/dist/witness/types.js.map +1 -1
- package/examples/overlay-proof.spec.js +75 -0
- package/package.json +8 -2
- package/python/__pycache__/gateforge_persistence_intents.cpython-312.pyc +0 -0
- package/python/__pycache__/gateforge_persistence_intents.cpython-314.pyc +0 -0
- package/python/gateforge_pytest_plugin.py +462 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reporter.js","sourceRoot":"","sources":["../../src/vitest/reporter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAA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|
+
* session per worker slot", and Vitest runs FILES in parallel while
|
|
5
|
+
* running the tests inside a file one at a time.
|
|
6
|
+
*
|
|
7
|
+
* The pack's reporter (vitest's MAIN process) and the in-test helper
|
|
8
|
+
* (the worker that runs the test) must therefore agree on the slot of
|
|
9
|
+
* a test, because both spool lifecycle events for it and the helper
|
|
10
|
+
* resolves its session by `(workerIndex, testId)`. Vitest exposes no
|
|
11
|
+
* worker identity to a reporter, so the slot is DERIVED from the
|
|
12
|
+
* identity both sides already compute — the repo-relative posix test
|
|
13
|
+
* file — with the same pure function in both processes.
|
|
14
|
+
*
|
|
15
|
+
* Deriving it (rather than sharing a runtime counter) is what makes
|
|
16
|
+
* the reporter's late main-process events land on the SAME slot the
|
|
17
|
+
* worker already opened: no ordering assumption, no extra channel, and
|
|
18
|
+
* a project running files in parallel never claims one slot twice.
|
|
19
|
+
* The digest is 53-bit, so it stays an exact integer in JSON. Two
|
|
20
|
+
* different files colliding is vanishingly unlikely, and a collision
|
|
21
|
+
* can only make the witness refuse the second session open (fail
|
|
22
|
+
* closed) — it can never credit one test with another test's evidence.
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* The worker slot both sides assign to one test file.
|
|
26
|
+
*
|
|
27
|
+
* Args:
|
|
28
|
+
* file: the repo-relative posix test file (the same string the
|
|
29
|
+
* reconciliation identity is keyed by).
|
|
30
|
+
*
|
|
31
|
+
* Returns:
|
|
32
|
+
* number: a positive integer worker slot (never 0: slot 0 stays free
|
|
33
|
+
* for runners that really do run everything in one worker).
|
|
34
|
+
*/
|
|
35
|
+
export declare function vitestWorkerSlot(file: string): number;
|
|
36
|
+
//# sourceMappingURL=worker-slot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worker-slot.d.ts","sourceRoot":"","sources":["../../src/vitest/worker-slot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAKH;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAarD"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The deterministic worker slot of one Vitest test FILE (plan
|
|
3
|
+
* 2026-09-25 follow-up): the supervisor's session model is "one open
|
|
4
|
+
* session per worker slot", and Vitest runs FILES in parallel while
|
|
5
|
+
* running the tests inside a file one at a time.
|
|
6
|
+
*
|
|
7
|
+
* The pack's reporter (vitest's MAIN process) and the in-test helper
|
|
8
|
+
* (the worker that runs the test) must therefore agree on the slot of
|
|
9
|
+
* a test, because both spool lifecycle events for it and the helper
|
|
10
|
+
* resolves its session by `(workerIndex, testId)`. Vitest exposes no
|
|
11
|
+
* worker identity to a reporter, so the slot is DERIVED from the
|
|
12
|
+
* identity both sides already compute — the repo-relative posix test
|
|
13
|
+
* file — with the same pure function in both processes.
|
|
14
|
+
*
|
|
15
|
+
* Deriving it (rather than sharing a runtime counter) is what makes
|
|
16
|
+
* the reporter's late main-process events land on the SAME slot the
|
|
17
|
+
* worker already opened: no ordering assumption, no extra channel, and
|
|
18
|
+
* a project running files in parallel never claims one slot twice.
|
|
19
|
+
* The digest is 53-bit, so it stays an exact integer in JSON. Two
|
|
20
|
+
* different files colliding is vanishingly unlikely, and a collision
|
|
21
|
+
* can only make the witness refuse the second session open (fail
|
|
22
|
+
* closed) — it can never credit one test with another test's evidence.
|
|
23
|
+
*/
|
|
24
|
+
/** The 21 high bits kept (2²¹ × 2³² = 2⁵³: the JSON-safe range). */
|
|
25
|
+
const HIGH_MASK = 0x1f_ffff;
|
|
26
|
+
/**
|
|
27
|
+
* The worker slot both sides assign to one test file.
|
|
28
|
+
*
|
|
29
|
+
* Args:
|
|
30
|
+
* file: the repo-relative posix test file (the same string the
|
|
31
|
+
* reconciliation identity is keyed by).
|
|
32
|
+
*
|
|
33
|
+
* Returns:
|
|
34
|
+
* number: a positive integer worker slot (never 0: slot 0 stays free
|
|
35
|
+
* for runners that really do run everything in one worker).
|
|
36
|
+
*/
|
|
37
|
+
export function vitestWorkerSlot(file) {
|
|
38
|
+
// FNV-1a over UTF-16 code units. The high lane keeps 21 bits, so the
|
|
39
|
+
// result is an exact integer below 2^53 (never a float, never a
|
|
40
|
+
// negative one: the witness refuses a negative workerIndex).
|
|
41
|
+
let low = 0x811c9dc5;
|
|
42
|
+
let high = 0x01000193;
|
|
43
|
+
for (let index = 0; index < file.length; index += 1) {
|
|
44
|
+
const code = file.charCodeAt(index);
|
|
45
|
+
low = Math.imul(low ^ code, 0x01000193) >>> 0;
|
|
46
|
+
high = Math.imul(high ^ (code + index), 0x85ebca6b) >>> 0;
|
|
47
|
+
}
|
|
48
|
+
const slot = (high & HIGH_MASK) * 2 ** 32 + low;
|
|
49
|
+
return slot === 0 ? 1 : slot;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=worker-slot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worker-slot.js","sourceRoot":"","sources":["../../src/vitest/worker-slot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,oEAAoE;AACpE,MAAM,SAAS,GAAG,SAAS,CAAC;AAE5B;;;;;;;;;;GAUG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,qEAAqE;IACrE,gEAAgE;IAChE,6DAA6D;IAC7D,IAAI,GAAG,GAAG,UAAU,CAAC;IACrB,IAAI,IAAI,GAAG,UAAU,CAAC;IACtB,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC,MAAM,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QACpD,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QACpC,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC;QAC9C,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,IAAI,GAAG,KAAK,CAAC,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC;IAC5D,CAAC;IACD,MAAM,IAAI,GAAG,CAAC,IAAI,GAAG,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,GAAG,CAAC;IAChD,OAAO,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAC/B,CAAC"}
|
|
@@ -1,54 +1,10 @@
|
|
|
1
|
-
import type { AdapterContext, EvidenceAdapter } from './types.js';
|
|
2
1
|
/**
|
|
3
|
-
*
|
|
2
|
+
* Compatibility re-export: `witness/adapter-registry` now lives in the runner-neutral
|
|
3
|
+
* `@gate-forge/witness` package (plan 2026-09-25 phase 1).
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* Returns:
|
|
9
|
-
* Map<string, EvidenceAdapter>: keyed by the file basename sans `.mjs`.
|
|
10
|
-
*
|
|
11
|
-
* Throws:
|
|
12
|
-
* AdapterRegistryError: fail-closed load problems — unreadable dir,
|
|
13
|
-
* unimportable module, or a module missing any contract member.
|
|
14
|
-
*/
|
|
15
|
-
export declare function loadAdapters(dir: string): Promise<Map<string, EvidenceAdapter>>;
|
|
16
|
-
/**
|
|
17
|
-
* Validates one adapter module against the pin-#8 contract.
|
|
18
|
-
*
|
|
19
|
-
* Args:
|
|
20
|
-
* module: the default export of the adapter file.
|
|
21
|
-
* name: adapter name, used in diagnostics.
|
|
22
|
-
*
|
|
23
|
-
* Returns:
|
|
24
|
-
* EvidenceAdapter: the validated adapter.
|
|
25
|
-
*
|
|
26
|
-
* Throws:
|
|
27
|
-
* AdapterRegistryError: when any required member is missing or shaped
|
|
28
|
-
* wrong. Optional `baseUrl` (a string) overrides the witness's
|
|
29
|
-
* configured adapter base for this adapter.
|
|
30
|
-
*/
|
|
31
|
-
export declare function validateAdapter(module: unknown, name: string): EvidenceAdapter;
|
|
32
|
-
/** Fail-closed adapter-loading error (witness startup aborts). */
|
|
33
|
-
export declare class AdapterRegistryError extends Error {
|
|
34
|
-
constructor(message: string);
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Validates one adapter's optional `observe` binding (Observe channel,
|
|
38
|
-
* Phase 2): a plain object with per-operation `{method, path}`
|
|
39
|
-
* entries. Method must be a concrete uppercase verb; path must be an
|
|
40
|
-
* absolute backend-facing path whose only template segment is `{id}` —
|
|
41
|
-
* required on read/update/delete (the entity-id carrier), forbidden on
|
|
42
|
-
* create (create ids come from the adapter list-diff, never from a
|
|
43
|
-
* path guess).
|
|
44
|
-
*
|
|
45
|
-
* Args:
|
|
46
|
-
* value: the adapter's `observe` export.
|
|
47
|
-
*
|
|
48
|
-
* Returns:
|
|
49
|
-
* string | null: the contract-violation description, or null when valid.
|
|
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.
|
|
50
8
|
*/
|
|
51
|
-
export
|
|
52
|
-
/** The transport the witness hands to adapter `read` calls (GET-only). */
|
|
53
|
-
export declare function makeAdapterContext(baseUrl: string, resourceId: string, get: AdapterContext['get'], headers?: Record<string, string>): AdapterContext;
|
|
9
|
+
export * from '@gate-forge/witness/witness/adapter-registry';
|
|
54
10
|
//# sourceMappingURL=adapter-registry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter-registry.d.ts","sourceRoot":"","sources":["../../src/witness/adapter-registry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"adapter-registry.d.ts","sourceRoot":"","sources":["../../src/witness/adapter-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,cAAc,8CAA8C,CAAC"}
|
|
@@ -1,261 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Compatibility re-export: `witness/adapter-registry` now lives in the runner-neutral
|
|
3
|
+
* `@gate-forge/witness` package (plan 2026-09-25 phase 1).
|
|
3
4
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* ```js
|
|
9
|
-
* export default {
|
|
10
|
-
* read: async (ctx, id) => body | null, // GET-only; ctx.get(path) is the transport
|
|
11
|
-
* normalize: (body) => ({ entityId, fields }), // stamped from the RESPONSE, never caller args
|
|
12
|
-
* deletion: 'hard' | 'archive',
|
|
13
|
-
* environmentFingerprint: '…', // must match the target's marker header
|
|
14
|
-
* baseUrl: 'http://…', // optional override of the witness adapter base
|
|
15
|
-
* list: async (ctx) => bodies, // optional: powers create pre-observations + Observe snapshots
|
|
16
|
-
* observe: { // optional: Observe-channel mutation bindings (Phase 2)
|
|
17
|
-
* create: { method: 'POST', path: '/api/v2/accounts' },
|
|
18
|
-
* update: { method: 'PATCH', path: '/api/v2/accounts/{id}' },
|
|
19
|
-
* },
|
|
20
|
-
* probeServer: async (ctx, subject) => ({ found, fields }), // optional: the
|
|
21
|
-
* // SERVER-WITNESSED persistence channel probe — executed
|
|
22
|
-
* // ONLY in this trusted witness process
|
|
23
|
-
* };
|
|
24
|
-
* ```
|
|
25
|
-
*
|
|
26
|
-
* The registry loads fail-closed: a missing/invalid module, a missing
|
|
27
|
-
* `read`/`normalize`/`deletion`/`environmentFingerprint`, an unknown
|
|
28
|
-
* deletion value, or a duplicate name aborts witness startup with an
|
|
29
|
-
* actionable diagnostic naming the file. The registry is frozen after
|
|
30
|
-
* load — there is no registration path a test could reach (invariant 6,
|
|
31
|
-
* GF-11 "registration path does not exist").
|
|
32
|
-
*/
|
|
33
|
-
import { readdirSync } from 'node:fs';
|
|
34
|
-
import { join } from 'node:path';
|
|
35
|
-
import { pathToFileURL } from 'node:url';
|
|
36
|
-
/**
|
|
37
|
-
* Loads every `.mjs` adapter in `dir` into a frozen registry.
|
|
38
|
-
*
|
|
39
|
-
* Args:
|
|
40
|
-
* dir: the configured adapters directory (absolute).
|
|
41
|
-
*
|
|
42
|
-
* Returns:
|
|
43
|
-
* Map<string, EvidenceAdapter>: keyed by the file basename sans `.mjs`.
|
|
44
|
-
*
|
|
45
|
-
* Throws:
|
|
46
|
-
* AdapterRegistryError: fail-closed load problems — unreadable dir,
|
|
47
|
-
* unimportable module, or a module missing any contract member.
|
|
48
|
-
*/
|
|
49
|
-
export async function loadAdapters(dir) {
|
|
50
|
-
const registry = new Map();
|
|
51
|
-
let entries;
|
|
52
|
-
try {
|
|
53
|
-
entries = readdirSync(dir);
|
|
54
|
-
}
|
|
55
|
-
catch (error) {
|
|
56
|
-
if (error.code === 'ENOENT') {
|
|
57
|
-
// No adapters directory at all: the registry stays empty; the
|
|
58
|
-
// witness then answers 400 for every persistence request (a run
|
|
59
|
-
// with persistence obligations and no adapters is misconfigured).
|
|
60
|
-
return registry;
|
|
61
|
-
}
|
|
62
|
-
throw new AdapterRegistryError(`cannot read adapters directory '${dir}': ${error.message}`);
|
|
63
|
-
}
|
|
64
|
-
for (const entry of entries.sort()) {
|
|
65
|
-
if (!entry.endsWith('.mjs'))
|
|
66
|
-
continue;
|
|
67
|
-
const name = entry.slice(0, -'.mjs'.length);
|
|
68
|
-
if (registry.has(name)) {
|
|
69
|
-
throw new AdapterRegistryError(`duplicate adapter '${name}' (multiple '${entry}' files is a config error)`);
|
|
70
|
-
}
|
|
71
|
-
const module = await importAdapter(dir, entry, name);
|
|
72
|
-
const adapter = validateAdapter(module, name);
|
|
73
|
-
registry.set(name, adapter);
|
|
74
|
-
}
|
|
75
|
-
return Object.freeze(registry);
|
|
76
|
-
}
|
|
77
|
-
/** Imports one adapter module; import errors carry an actionable message. */
|
|
78
|
-
async function importAdapter(dir, entry, name) {
|
|
79
|
-
try {
|
|
80
|
-
const loaded = (await import(pathToFileURL(join(dir, entry)).href));
|
|
81
|
-
return loaded.default;
|
|
82
|
-
}
|
|
83
|
-
catch (error) {
|
|
84
|
-
throw new AdapterRegistryError(`adapter '${name}' (${join(dir, entry)}) could not be imported: ` +
|
|
85
|
-
`${error instanceof Error ? error.message : String(error)}`);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Validates one adapter module against the pin-#8 contract.
|
|
90
|
-
*
|
|
91
|
-
* Args:
|
|
92
|
-
* module: the default export of the adapter file.
|
|
93
|
-
* name: adapter name, used in diagnostics.
|
|
94
|
-
*
|
|
95
|
-
* Returns:
|
|
96
|
-
* EvidenceAdapter: the validated adapter.
|
|
97
|
-
*
|
|
98
|
-
* Throws:
|
|
99
|
-
* AdapterRegistryError: when any required member is missing or shaped
|
|
100
|
-
* wrong. Optional `baseUrl` (a string) overrides the witness's
|
|
101
|
-
* configured adapter base for this adapter.
|
|
102
|
-
*/
|
|
103
|
-
export function validateAdapter(module, name) {
|
|
104
|
-
if (typeof module !== 'object' || module === null) {
|
|
105
|
-
throw new AdapterRegistryError(`adapter '${name}' must default-export an object {read, normalize, deletion, environmentFingerprint}`);
|
|
106
|
-
}
|
|
107
|
-
const adapter = module;
|
|
108
|
-
const problems = [];
|
|
109
|
-
if (typeof adapter['read'] !== 'function')
|
|
110
|
-
problems.push('read must be an async function (ctx, id)');
|
|
111
|
-
if (typeof adapter['normalize'] !== 'function')
|
|
112
|
-
problems.push('normalize must be a function (body) => {entityId, fields}');
|
|
113
|
-
if (adapter['deletion'] !== 'hard' && adapter['deletion'] !== 'archive') {
|
|
114
|
-
problems.push("deletion must be 'hard' or 'archive'");
|
|
115
|
-
}
|
|
116
|
-
if (typeof adapter['environmentFingerprint'] !== 'string') {
|
|
117
|
-
problems.push('environmentFingerprint must be a string');
|
|
118
|
-
}
|
|
119
|
-
if (adapter['baseUrl'] !== undefined &&
|
|
120
|
-
(typeof adapter['baseUrl'] !== 'string' || adapter['baseUrl'].length === 0)) {
|
|
121
|
-
problems.push('baseUrl must be a non-empty string when present');
|
|
122
|
-
}
|
|
123
|
-
if (adapter['list'] !== undefined && typeof adapter['list'] !== 'function') {
|
|
124
|
-
problems.push('list must be a function (ctx) => entity[] when present');
|
|
125
|
-
}
|
|
126
|
-
// Server probe (server-witnessed persistence channel): OPTIONAL — an
|
|
127
|
-
// adapter without it simply cannot serve the channel and every server
|
|
128
|
-
// intent for the resource resolves to a typed
|
|
129
|
-
// SERVER_PROBE_UNAVAILABLE failure. A PRESENT but malformed export is
|
|
130
|
-
// a contract violation caught here at load, fail-closed, not at
|
|
131
|
-
// intent time.
|
|
132
|
-
if (adapter['probeServer'] !== undefined && typeof adapter['probeServer'] !== 'function') {
|
|
133
|
-
problems.push('probeServer must be an async function (ctx, subject) => {found, fields} when present');
|
|
134
|
-
}
|
|
135
|
-
// Observe binding (Observe channel, Phase 2): OPTIONAL — an adapter
|
|
136
|
-
// without it serves no observe obligation. Present-but-malformed is a
|
|
137
|
-
// load-time contract violation (fail closed), validated by
|
|
138
|
-
// validateObserveBinding below.
|
|
139
|
-
if (adapter['observe'] !== undefined) {
|
|
140
|
-
const observeProblem = validateObserveBinding(adapter['observe']);
|
|
141
|
-
if (observeProblem !== null)
|
|
142
|
-
problems.push(observeProblem);
|
|
143
|
-
}
|
|
144
|
-
// Trusted scope/barrier observation (plan 2026-09-19 §4.4, Phase 4):
|
|
145
|
-
// OPTIONAL — adapters lacking these methods still serve legacy proofs
|
|
146
|
-
// but cannot satisfy strong contracts requiring scoped observation.
|
|
147
|
-
// Present-but-not-a-function is a load-time violation (fail closed).
|
|
148
|
-
if (adapter['snapshotScope'] !== undefined && typeof adapter['snapshotScope'] !== 'function') {
|
|
149
|
-
problems.push('snapshotScope must be an async function (ctx, {scope, fixtureNamespace}) => ScopeSnapshot when present');
|
|
150
|
-
}
|
|
151
|
-
if (adapter['awaitBarrier'] !== undefined && typeof adapter['awaitBarrier'] !== 'function') {
|
|
152
|
-
problems.push('awaitBarrier must be an async function (ctx, {scope, fixtureNamespace, operationId, deadlineMs}) when present');
|
|
153
|
-
}
|
|
154
|
-
if (problems.length > 0) {
|
|
155
|
-
throw new AdapterRegistryError(`adapter '${name}' violates the adapter contract: ${problems.join('; ')}`);
|
|
156
|
-
}
|
|
157
|
-
return {
|
|
158
|
-
read: adapter['read'],
|
|
159
|
-
normalize: adapter['normalize'],
|
|
160
|
-
deletion: adapter['deletion'],
|
|
161
|
-
environmentFingerprint: adapter['environmentFingerprint'],
|
|
162
|
-
baseUrl: adapter['baseUrl'],
|
|
163
|
-
...(adapter['list'] !== undefined
|
|
164
|
-
? { list: adapter['list'] }
|
|
165
|
-
: {}),
|
|
166
|
-
...(adapter['probeServer'] !== undefined
|
|
167
|
-
? { probeServer: adapter['probeServer'] }
|
|
168
|
-
: {}),
|
|
169
|
-
...(adapter['observe'] !== undefined
|
|
170
|
-
? { observe: adapter['observe'] }
|
|
171
|
-
: {}),
|
|
172
|
-
...(adapter['snapshotScope'] !== undefined
|
|
173
|
-
? { snapshotScope: adapter['snapshotScope'] }
|
|
174
|
-
: {}),
|
|
175
|
-
...(adapter['awaitBarrier'] !== undefined
|
|
176
|
-
? { awaitBarrier: adapter['awaitBarrier'] }
|
|
177
|
-
: {}),
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
/** Fail-closed adapter-loading error (witness startup aborts). */
|
|
181
|
-
export class AdapterRegistryError extends Error {
|
|
182
|
-
constructor(message) {
|
|
183
|
-
super(message);
|
|
184
|
-
this.name = 'AdapterRegistryError';
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
/** Concrete HTTP methods an observe binding may name (uppercase). */
|
|
188
|
-
const OBSERVE_METHODS = new Set([
|
|
189
|
-
'GET',
|
|
190
|
-
'HEAD',
|
|
191
|
-
'POST',
|
|
192
|
-
'PUT',
|
|
193
|
-
'PATCH',
|
|
194
|
-
'DELETE',
|
|
195
|
-
'OPTIONS',
|
|
196
|
-
]);
|
|
197
|
-
/** Observe-eligible operations (the CRUD verbs the grader knows). */
|
|
198
|
-
const OBSERVE_OPERATIONS = ['create', 'read', 'update', 'delete'];
|
|
199
|
-
/**
|
|
200
|
-
* Validates one adapter's optional `observe` binding (Observe channel,
|
|
201
|
-
* Phase 2): a plain object with per-operation `{method, path}`
|
|
202
|
-
* entries. Method must be a concrete uppercase verb; path must be an
|
|
203
|
-
* absolute backend-facing path whose only template segment is `{id}` —
|
|
204
|
-
* required on read/update/delete (the entity-id carrier), forbidden on
|
|
205
|
-
* create (create ids come from the adapter list-diff, never from a
|
|
206
|
-
* path guess).
|
|
207
|
-
*
|
|
208
|
-
* Args:
|
|
209
|
-
* value: the adapter's `observe` export.
|
|
210
|
-
*
|
|
211
|
-
* Returns:
|
|
212
|
-
* string | null: the contract-violation description, or null when valid.
|
|
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.
|
|
213
8
|
*/
|
|
214
|
-
export
|
|
215
|
-
if (typeof value !== 'object' || value === null || Array.isArray(value)) {
|
|
216
|
-
return 'observe must be an object {create?/read?/update?/delete?: {method, path}} when present';
|
|
217
|
-
}
|
|
218
|
-
const binding = value;
|
|
219
|
-
for (const key of Object.keys(binding)) {
|
|
220
|
-
if (!OBSERVE_OPERATIONS.includes(key)) {
|
|
221
|
-
return `observe carries unknown operation '${key}' (allowed: ${OBSERVE_OPERATIONS.join(', ')})`;
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
for (const operation of OBSERVE_OPERATIONS) {
|
|
225
|
-
const entry = binding[operation];
|
|
226
|
-
if (entry === undefined)
|
|
227
|
-
continue;
|
|
228
|
-
if (typeof entry !== 'object' || entry === null || Array.isArray(entry)) {
|
|
229
|
-
return `observe.${operation} must be {method, path}`;
|
|
230
|
-
}
|
|
231
|
-
const { method, path } = entry;
|
|
232
|
-
if (typeof method !== 'string' || !OBSERVE_METHODS.has(method)) {
|
|
233
|
-
return (`observe.${operation}.method must be a concrete uppercase HTTP verb ` +
|
|
234
|
-
`(${[...OBSERVE_METHODS].sort().join(', ')})`);
|
|
235
|
-
}
|
|
236
|
-
if (typeof path !== 'string' || !path.startsWith('/')) {
|
|
237
|
-
return `observe.${operation}.path must be an absolute backend-facing path starting with '/'`;
|
|
238
|
-
}
|
|
239
|
-
if (path.includes('//') || /[\s?#]/.test(path)) {
|
|
240
|
-
return `observe.${operation}.path must be a plain path template (no duplicate slashes, query, fragment, or whitespace)`;
|
|
241
|
-
}
|
|
242
|
-
const segments = path.split('/').filter((segment) => segment.length > 0);
|
|
243
|
-
const idSegments = segments.filter((segment) => segment === '{id}').length;
|
|
244
|
-
const braced = segments.filter((segment) => segment.startsWith('{') || segment.endsWith('}'));
|
|
245
|
-
if (braced.length !== idSegments) {
|
|
246
|
-
return `observe.${operation}.path may template only the '{id}' segment (got '${path}')`;
|
|
247
|
-
}
|
|
248
|
-
if (operation === 'create' && idSegments > 0) {
|
|
249
|
-
return `observe.create.path must not template '{id}' (create ids come from the adapter list-diff, got '${path}')`;
|
|
250
|
-
}
|
|
251
|
-
if (operation !== 'create' && idSegments !== 1) {
|
|
252
|
-
return `observe.${operation}.path must carry exactly one '{id}' segment binding the entity id (got '${path}')`;
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
return null;
|
|
256
|
-
}
|
|
257
|
-
/** The transport the witness hands to adapter `read` calls (GET-only). */
|
|
258
|
-
export function makeAdapterContext(baseUrl, resourceId, get, headers) {
|
|
259
|
-
return Object.freeze({ baseUrl, resourceId, get, ...(headers ? { headers } : {}) });
|
|
260
|
-
}
|
|
9
|
+
export * from '@gate-forge/witness/witness/adapter-registry';
|
|
261
10
|
//# sourceMappingURL=adapter-registry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter-registry.js","sourceRoot":"","sources":["../../src/witness/adapter-registry.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"adapter-registry.js","sourceRoot":"","sources":["../../src/witness/adapter-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,cAAc,8CAA8C,CAAC"}
|
|
@@ -1,80 +1,10 @@
|
|
|
1
|
-
import type { CredentialMaterial, FixtureLease } from './fixture-provider.js';
|
|
2
|
-
/** Proof-input bound (request and response bodies alike). */
|
|
3
|
-
export declare const BEHAVIOR_BODY_LIMIT_BYTES: number;
|
|
4
|
-
/** Typed driver failure (always a blocking diagnostic, never proof). */
|
|
5
|
-
export declare class BehaviorDriverError extends Error {
|
|
6
|
-
constructor(message: string);
|
|
7
|
-
}
|
|
8
|
-
/** Approved request action shape (subset used by the Phase 5 driver). */
|
|
9
|
-
export interface BehaviorRequestAction {
|
|
10
|
-
kind: 'request';
|
|
11
|
-
method: string;
|
|
12
|
-
pathTemplate: string;
|
|
13
|
-
path: Record<string, {
|
|
14
|
-
from: string;
|
|
15
|
-
value?: unknown;
|
|
16
|
-
key?: string;
|
|
17
|
-
}>;
|
|
18
|
-
query: Record<string, {
|
|
19
|
-
from: string;
|
|
20
|
-
value?: unknown;
|
|
21
|
-
key?: string;
|
|
22
|
-
}>;
|
|
23
|
-
body: {
|
|
24
|
-
encoding: string;
|
|
25
|
-
fields?: Record<string, {
|
|
26
|
-
from: string;
|
|
27
|
-
value?: unknown;
|
|
28
|
-
key?: string;
|
|
29
|
-
}>;
|
|
30
|
-
fixture?: string;
|
|
31
|
-
};
|
|
32
|
-
credentialVariant: 'valid' | 'missing' | 'corrupted';
|
|
33
|
-
signatureProfile?: string;
|
|
34
|
-
}
|
|
35
|
-
/** What the driver observed (headers excluded — they carry secrets). */
|
|
36
|
-
export interface DrivenRequest {
|
|
37
|
-
engineRequestId: string;
|
|
38
|
-
method: string;
|
|
39
|
-
path: string;
|
|
40
|
-
query: Record<string, unknown>;
|
|
41
|
-
/** Submitted body as observed (parsed JSON or form map). */
|
|
42
|
-
body: unknown;
|
|
43
|
-
status: number | null;
|
|
44
|
-
/** Response body as observed (parsed JSON or text). */
|
|
45
|
-
responseBody: unknown;
|
|
46
|
-
requestDigest: string;
|
|
47
|
-
responseDigest: string | null;
|
|
48
|
-
}
|
|
49
|
-
export interface DriveBehaviorRequestInput {
|
|
50
|
-
/** Approved request action from the bound catalog. */
|
|
51
|
-
action: BehaviorRequestAction;
|
|
52
|
-
/** Trusted lease (subjects + actors resolve here). */
|
|
53
|
-
lease: FixtureLease;
|
|
54
|
-
/** Actor profile key from the case definition. */
|
|
55
|
-
actorProfile: string;
|
|
56
|
-
/** Approved subject origin (the app under test; loopback only). */
|
|
57
|
-
origin: string;
|
|
58
|
-
/** Resolve engine-side credential material (never suite-visible). */
|
|
59
|
-
resolveCredential: (credentialRef: string) => Promise<CredentialMaterial | null> | CredentialMaterial | null;
|
|
60
|
-
/** Fetch timeout in milliseconds. */
|
|
61
|
-
timeoutMs: number;
|
|
62
|
-
}
|
|
63
1
|
/**
|
|
64
|
-
*
|
|
2
|
+
* Compatibility re-export: `witness/behavior-request` now lives in the runner-neutral
|
|
3
|
+
* `@gate-forge/witness` package (plan 2026-09-25 phase 1).
|
|
65
4
|
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
* Returns:
|
|
71
|
-
* DrivenRequest: method/path/query/body/status/response plus
|
|
72
|
-
* identity digests (headers never leave the driver).
|
|
73
|
-
*
|
|
74
|
-
* Throws:
|
|
75
|
-
* BehaviorDriverError: unsupported encoding, unresolvable value,
|
|
76
|
-
* non-loopback origin, timeout, over-limit body, or transport
|
|
77
|
-
* failure — always a blocking diagnostic, never proof.
|
|
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.
|
|
78
8
|
*/
|
|
79
|
-
export
|
|
9
|
+
export * from '@gate-forge/witness/witness/behavior-request';
|
|
80
10
|
//# sourceMappingURL=behavior-request.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"behavior-request.d.ts","sourceRoot":"","sources":["../../src/witness/behavior-request.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"behavior-request.d.ts","sourceRoot":"","sources":["../../src/witness/behavior-request.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,cAAc,8CAA8C,CAAC"}
|