@gate-forge/pack-playwright 0.1.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/LICENSE +202 -0
- package/bin/gateforge-witness.js +40 -0
- package/dist/attestation/proxy.d.ts +40 -0
- package/dist/attestation/proxy.d.ts.map +1 -0
- package/dist/attestation/proxy.js +78 -0
- package/dist/attestation/proxy.js.map +1 -0
- package/dist/constants.d.ts +130 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +138 -0
- package/dist/constants.js.map +1 -0
- package/dist/discovery/adapters.d.ts +167 -0
- package/dist/discovery/adapters.d.ts.map +1 -0
- package/dist/discovery/adapters.js +276 -0
- package/dist/discovery/adapters.js.map +1 -0
- package/dist/discovery/discover.d.ts +57 -0
- package/dist/discovery/discover.d.ts.map +1 -0
- package/dist/discovery/discover.js +544 -0
- package/dist/discovery/discover.js.map +1 -0
- package/dist/discovery/index.d.ts +15 -0
- package/dist/discovery/index.d.ts.map +1 -0
- package/dist/discovery/index.js +15 -0
- package/dist/discovery/index.js.map +1 -0
- package/dist/discovery/inference.d.ts +63 -0
- package/dist/discovery/inference.d.ts.map +1 -0
- package/dist/discovery/inference.js +173 -0
- package/dist/discovery/inference.js.map +1 -0
- package/dist/discovery/pytest-adapter.d.ts +205 -0
- package/dist/discovery/pytest-adapter.d.ts.map +1 -0
- package/dist/discovery/pytest-adapter.js +548 -0
- package/dist/discovery/pytest-adapter.js.map +1 -0
- package/dist/discovery/reconcile.d.ts +106 -0
- package/dist/discovery/reconcile.d.ts.map +1 -0
- package/dist/discovery/reconcile.js +268 -0
- package/dist/discovery/reconcile.js.map +1 -0
- package/dist/discovery/runner-env.d.ts +80 -0
- package/dist/discovery/runner-env.d.ts.map +1 -0
- package/dist/discovery/runner-env.js +139 -0
- package/dist/discovery/runner-env.js.map +1 -0
- package/dist/discovery/static-discovery.d.ts +121 -0
- package/dist/discovery/static-discovery.d.ts.map +1 -0
- package/dist/discovery/static-discovery.js +1028 -0
- package/dist/discovery/static-discovery.js.map +1 -0
- package/dist/discovery/supervised-run.d.ts +110 -0
- package/dist/discovery/supervised-run.d.ts.map +1 -0
- package/dist/discovery/supervised-run.js +328 -0
- package/dist/discovery/supervised-run.js.map +1 -0
- package/dist/discovery/trusted-config.d.ts +103 -0
- package/dist/discovery/trusted-config.d.ts.map +1 -0
- package/dist/discovery/trusted-config.js +117 -0
- package/dist/discovery/trusted-config.js.map +1 -0
- package/dist/fixture/evidence.d.ts +191 -0
- package/dist/fixture/evidence.d.ts.map +1 -0
- package/dist/fixture/evidence.js +366 -0
- package/dist/fixture/evidence.js.map +1 -0
- package/dist/fixture/fixture.d.ts +37 -0
- package/dist/fixture/fixture.d.ts.map +1 -0
- package/dist/fixture/fixture.js +38 -0
- package/dist/fixture/fixture.js.map +1 -0
- package/dist/fixture/witness-client.d.ts +164 -0
- package/dist/fixture/witness-client.d.ts.map +1 -0
- package/dist/fixture/witness-client.js +253 -0
- package/dist/fixture/witness-client.js.map +1 -0
- package/dist/index.d.ts +64 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +55 -0
- package/dist/index.js.map +1 -0
- package/dist/json.d.ts +16 -0
- package/dist/json.d.ts.map +1 -0
- package/dist/json.js +21 -0
- package/dist/json.js.map +1 -0
- package/dist/reporter/ledger.d.ts +105 -0
- package/dist/reporter/ledger.d.ts.map +1 -0
- package/dist/reporter/ledger.js +197 -0
- package/dist/reporter/ledger.js.map +1 -0
- package/dist/reporter/reporter.cjs +105 -0
- package/dist/reporter/reporter.cjs.map +1 -0
- package/dist/reporter/reporter.d.cts +35 -0
- package/dist/reporter/reporter.d.cts.map +1 -0
- package/dist/reporter/reporter.d.ts +167 -0
- package/dist/reporter/reporter.d.ts.map +1 -0
- package/dist/reporter/reporter.js +673 -0
- package/dist/reporter/reporter.js.map +1 -0
- package/dist/setup.d.ts +49 -0
- package/dist/setup.d.ts.map +1 -0
- package/dist/setup.js +167 -0
- package/dist/setup.js.map +1 -0
- package/dist/supervisor/client.d.ts +73 -0
- package/dist/supervisor/client.d.ts.map +1 -0
- package/dist/supervisor/client.js +164 -0
- package/dist/supervisor/client.js.map +1 -0
- package/dist/supervisor/drain.d.ts +45 -0
- package/dist/supervisor/drain.d.ts.map +1 -0
- package/dist/supervisor/drain.js +235 -0
- package/dist/supervisor/drain.js.map +1 -0
- package/dist/supervisor/index.d.ts +16 -0
- package/dist/supervisor/index.d.ts.map +1 -0
- package/dist/supervisor/index.js +13 -0
- package/dist/supervisor/index.js.map +1 -0
- package/dist/supervisor/spool.d.ts +137 -0
- package/dist/supervisor/spool.d.ts.map +1 -0
- package/dist/supervisor/spool.js +263 -0
- package/dist/supervisor/spool.js.map +1 -0
- package/dist/surface.d.ts +134 -0
- package/dist/surface.d.ts.map +1 -0
- package/dist/surface.js +139 -0
- package/dist/surface.js.map +1 -0
- package/dist/witness/adapter-registry.d.ts +38 -0
- package/dist/witness/adapter-registry.d.ts.map +1 -0
- package/dist/witness/adapter-registry.js +158 -0
- package/dist/witness/adapter-registry.js.map +1 -0
- package/dist/witness/bin.d.ts +21 -0
- package/dist/witness/bin.d.ts.map +1 -0
- package/dist/witness/bin.js +172 -0
- package/dist/witness/bin.js.map +1 -0
- package/dist/witness/browser.d.ts +173 -0
- package/dist/witness/browser.d.ts.map +1 -0
- package/dist/witness/browser.js +580 -0
- package/dist/witness/browser.js.map +1 -0
- package/dist/witness/classifications.d.ts +42 -0
- package/dist/witness/classifications.d.ts.map +1 -0
- package/dist/witness/classifications.js +87 -0
- package/dist/witness/classifications.js.map +1 -0
- package/dist/witness/env-attestation.d.ts +98 -0
- package/dist/witness/env-attestation.d.ts.map +1 -0
- package/dist/witness/env-attestation.js +202 -0
- package/dist/witness/env-attestation.js.map +1 -0
- package/dist/witness/loopback-pins.d.ts +79 -0
- package/dist/witness/loopback-pins.d.ts.map +1 -0
- package/dist/witness/loopback-pins.js +244 -0
- package/dist/witness/loopback-pins.js.map +1 -0
- package/dist/witness/server.d.ts +34 -0
- package/dist/witness/server.d.ts.map +1 -0
- package/dist/witness/server.js +2539 -0
- package/dist/witness/server.js.map +1 -0
- package/dist/witness/types.d.ts +643 -0
- package/dist/witness/types.d.ts.map +1 -0
- package/dist/witness/types.js +2 -0
- package/dist/witness/types.js.map +1 -0
- package/package.json +64 -0
- package/python/gateforge_persistence_intents.py +100 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { type Location } from '@gate-forge/core';
|
|
2
|
+
/** Default cap on files pulled in through import traversal. */
|
|
3
|
+
export declare const DEFAULT_MAX_TRAVERSED_FILES = 200;
|
|
4
|
+
/** Default bound on import-traversal depth (chain length). */
|
|
5
|
+
export declare const DEFAULT_MAX_IMPORT_DEPTH = 16;
|
|
6
|
+
/** Traversal-budget knobs for one scan. */
|
|
7
|
+
export interface ScanBudget {
|
|
8
|
+
/** Max files pulled in through import traversal (default 200). */
|
|
9
|
+
maxTraversedFiles?: number;
|
|
10
|
+
/** Max import-chain depth when resolving an alias (default 16). */
|
|
11
|
+
maxImportDepth?: number;
|
|
12
|
+
}
|
|
13
|
+
/** Options for one static test scan. */
|
|
14
|
+
export interface StaticScanOptions {
|
|
15
|
+
/** Absolute repo root. */
|
|
16
|
+
cwd: string;
|
|
17
|
+
/** Repo-root-relative include globs (the configured test files). */
|
|
18
|
+
include: readonly string[];
|
|
19
|
+
/** Repo-root-relative exclude globs (any match wins). */
|
|
20
|
+
exclude: readonly string[];
|
|
21
|
+
/** Traversal budgets (defaults documented on {@link ScanBudget}). */
|
|
22
|
+
budget?: ScanBudget;
|
|
23
|
+
}
|
|
24
|
+
/** Facts one static test call exposes for kind inference. */
|
|
25
|
+
export interface StaticTestFacts {
|
|
26
|
+
/** Fixture names in the test callback's first parameter. */
|
|
27
|
+
signatureParams: string[];
|
|
28
|
+
/** `page.route(...)` (or any `<x>.route(`) inside the test body. */
|
|
29
|
+
pageRoute: Location | null;
|
|
30
|
+
/** fetch/axios call inside the test body. */
|
|
31
|
+
httpClientCall: Location | null;
|
|
32
|
+
/** fetch/axios call anywhere in the file (app-boundary import hint). */
|
|
33
|
+
fileHttpClientCall: Location | null;
|
|
34
|
+
/** `vi.mock(...)` / `jest.mock(...)` anywhere in the file. */
|
|
35
|
+
fileMockImport: Location | null;
|
|
36
|
+
}
|
|
37
|
+
/** One statically discovered test call. */
|
|
38
|
+
export interface StaticTestEntry {
|
|
39
|
+
/** Repo-root-relative posix file path. */
|
|
40
|
+
file: string;
|
|
41
|
+
/** Describe stack + title. */
|
|
42
|
+
titlePath: string[];
|
|
43
|
+
/** Last segment of {@link titlePath}. */
|
|
44
|
+
title: string;
|
|
45
|
+
/** Test-call location (diagnostics, never identity). */
|
|
46
|
+
location: Location;
|
|
47
|
+
/** `each`/template parameter identity, or null. */
|
|
48
|
+
parameterIdentity: string | null;
|
|
49
|
+
/** Suppression signals recorded at/below this call. */
|
|
50
|
+
signals: Array<{
|
|
51
|
+
kind: 'skip' | 'only' | 'fixme';
|
|
52
|
+
detail: string;
|
|
53
|
+
location: Location;
|
|
54
|
+
}>;
|
|
55
|
+
/** Inference facts from the call + callback body. */
|
|
56
|
+
facts: StaticTestFacts;
|
|
57
|
+
}
|
|
58
|
+
/** One statically detected gap (unresolvable call, budget, dynamic title). */
|
|
59
|
+
export interface StaticUnresolved {
|
|
60
|
+
/** Stable code, e.g. `unresolved-wrapper`. */
|
|
61
|
+
code: string;
|
|
62
|
+
/** Single-cause human explanation. */
|
|
63
|
+
detail: string;
|
|
64
|
+
/** Repo-relative file of the gap (catalog row input). */
|
|
65
|
+
file: string;
|
|
66
|
+
/** Title path when a literal title was readable, else a placeholder. */
|
|
67
|
+
titlePath: string[];
|
|
68
|
+
/** Location of the unresolved call/import. */
|
|
69
|
+
location: Location;
|
|
70
|
+
}
|
|
71
|
+
/** One parser failure with its location. */
|
|
72
|
+
export interface StaticParseError {
|
|
73
|
+
file: string;
|
|
74
|
+
message: string;
|
|
75
|
+
location: Location;
|
|
76
|
+
}
|
|
77
|
+
/** Result of one static scan. */
|
|
78
|
+
export interface StaticScanResult {
|
|
79
|
+
entries: StaticTestEntry[];
|
|
80
|
+
unresolved: StaticUnresolved[];
|
|
81
|
+
parseErrors: StaticParseError[];
|
|
82
|
+
/** Repo-relative files that were parsed (seeded + traversed). */
|
|
83
|
+
scannedFiles: string[];
|
|
84
|
+
/** True when the import-traversal budget cut resolution short. */
|
|
85
|
+
budgetExceeded: boolean;
|
|
86
|
+
}
|
|
87
|
+
/** Placeholder titlePath for unresolved calls with no readable title. */
|
|
88
|
+
export declare const UNRESOLVED_TITLE_PLACEHOLDER = "<unresolved-title>";
|
|
89
|
+
/**
|
|
90
|
+
* The gateforge pack's own module specifier (`packages/pack-playwright`):
|
|
91
|
+
* its exported `test` IS a playwright test function (`base.extend` over
|
|
92
|
+
* `playwright/test` — see `fixture/fixture.ts`, which documents this
|
|
93
|
+
* import as the only sanctioned runner). Binding it lets the static scan
|
|
94
|
+
* follow the documented consumer shape
|
|
95
|
+
* (`import { test as gateforgeTest } from '@gate-forge/pack-playwright'`)
|
|
96
|
+
* instead of emitting unresolvable rows for it. Every OTHER
|
|
97
|
+
* module-external import stays unresolved — fail-closed is unchanged.
|
|
98
|
+
*/
|
|
99
|
+
export declare const GATEFORGE_PACK_SPECIFIER = "@gate-forge/pack-playwright";
|
|
100
|
+
/**
|
|
101
|
+
* Signature parameter names that prove a real browser is in play.
|
|
102
|
+
* `evidence` is this pack's trusted-evidence fixture — it is built on a
|
|
103
|
+
* live `page` (see `fixture/fixture.ts`), so a test declaring it runs a
|
|
104
|
+
* real browser journey.
|
|
105
|
+
*/
|
|
106
|
+
export declare const BROWSER_FIXTURE_PARAMS: Set<string>;
|
|
107
|
+
/**
|
|
108
|
+
* Runs the bounded static scan over the configured globs. Every value is
|
|
109
|
+
* derived from ASTs; the only I/O is reading candidate + import-target
|
|
110
|
+
* files under {@link ScanBudget}.
|
|
111
|
+
*
|
|
112
|
+
* Args:
|
|
113
|
+
* options: cwd, include/exclude globs, and optional budgets.
|
|
114
|
+
*
|
|
115
|
+
* Returns:
|
|
116
|
+
* StaticScanResult: entries, unresolved rows, parse errors, scanned
|
|
117
|
+
* files, and the budget flag. Never throws for scanner-detectable
|
|
118
|
+
* problems — those are rows (fail closed as data, not silence).
|
|
119
|
+
*/
|
|
120
|
+
export declare function scanTestFiles(options: StaticScanOptions): StaticScanResult;
|
|
121
|
+
//# sourceMappingURL=static-discovery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"static-discovery.d.ts","sourceRoot":"","sources":["../../src/discovery/static-discovery.ts"],"names":[],"mappings":"AAkCA,OAAO,EAAe,KAAK,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE9D,+DAA+D;AAC/D,eAAO,MAAM,2BAA2B,MAAM,CAAC;AAE/C,8DAA8D;AAC9D,eAAO,MAAM,wBAAwB,KAAK,CAAC;AAE3C,2CAA2C;AAC3C,MAAM,WAAW,UAAU;IACzB,kEAAkE;IAClE,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,mEAAmE;IACnE,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,wCAAwC;AACxC,MAAM,WAAW,iBAAiB;IAChC,0BAA0B;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,oEAAoE;IACpE,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B,yDAAyD;IACzD,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B,qEAAqE;IACrE,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB;AAED,6DAA6D;AAC7D,MAAM,WAAW,eAAe;IAC9B,4DAA4D;IAC5D,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,oEAAoE;IACpE,SAAS,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC3B,6CAA6C;IAC7C,cAAc,EAAE,QAAQ,GAAG,IAAI,CAAC;IAChC,wEAAwE;IACxE,kBAAkB,EAAE,QAAQ,GAAG,IAAI,CAAC;IACpC,8DA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