@gate-forge/cli 0.14.0 → 0.15.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/CHANGELOG.md +220 -0
- package/README.md +13 -1
- package/bin/gateforge.js +3 -1
- package/dist/additional-app-origins.d.ts +38 -0
- package/dist/additional-app-origins.d.ts.map +1 -0
- package/dist/additional-app-origins.js +46 -0
- package/dist/additional-app-origins.js.map +1 -0
- package/dist/args.d.ts.map +1 -1
- package/dist/args.js +1 -0
- package/dist/args.js.map +1 -1
- package/dist/candidate-tree.d.ts +1 -1
- package/dist/candidate-tree.d.ts.map +1 -1
- package/dist/candidate-tree.js +24 -2
- package/dist/candidate-tree.js.map +1 -1
- package/dist/ci-witnessed-template.d.ts.map +1 -1
- package/dist/ci-witnessed-template.js +7 -5
- package/dist/ci-witnessed-template.js.map +1 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/adopt.d.ts.map +1 -1
- package/dist/commands/adopt.js +3 -3
- package/dist/commands/adopt.js.map +1 -1
- package/dist/commands/blocking.d.ts.map +1 -1
- package/dist/commands/blocking.js +1 -0
- package/dist/commands/blocking.js.map +1 -1
- package/dist/commands/check.d.ts.map +1 -1
- package/dist/commands/check.js +12 -7
- package/dist/commands/check.js.map +1 -1
- package/dist/commands/enforcement.d.ts +12 -1
- package/dist/commands/enforcement.d.ts.map +1 -1
- package/dist/commands/enforcement.js +85 -34
- package/dist/commands/enforcement.js.map +1 -1
- package/dist/commands/test-gates.d.ts +83 -0
- package/dist/commands/test-gates.d.ts.map +1 -1
- package/dist/commands/test-gates.js +118 -48
- package/dist/commands/test-gates.js.map +1 -1
- package/dist/evaluate.d.ts +9 -0
- package/dist/evaluate.d.ts.map +1 -1
- package/dist/evaluate.js +34 -5
- package/dist/evaluate.js.map +1 -1
- package/dist/execution.d.ts +0 -25
- package/dist/execution.d.ts.map +1 -1
- package/dist/execution.js +16 -11
- package/dist/execution.js.map +1 -1
- package/dist/git-ignored.d.ts +22 -0
- package/dist/git-ignored.d.ts.map +1 -1
- package/dist/git-ignored.js +49 -0
- package/dist/git-ignored.js.map +1 -1
- package/dist/providers.d.ts +22 -0
- package/dist/providers.d.ts.map +1 -1
- package/dist/providers.js +60 -11
- package/dist/providers.js.map +1 -1
- package/dist/reseal.d.ts.map +1 -1
- package/dist/reseal.js +30 -14
- package/dist/reseal.js.map +1 -1
- package/dist/runtime-reuse.d.ts +8 -0
- package/dist/runtime-reuse.d.ts.map +1 -1
- package/dist/runtime-reuse.js +40 -0
- package/dist/runtime-reuse.js.map +1 -1
- package/guides/QUICKSTART.md +7 -7
- package/guides/REFERENCE.md +45 -1
- package/guides/TEST-ENVIRONMENT.md +15 -8
- package/package.json +11 -11
package/dist/runtime-reuse.js
CHANGED
|
@@ -2,6 +2,44 @@ import { createHash } from 'node:crypto';
|
|
|
2
2
|
import { lstatSync, readFileSync, readdirSync, readlinkSync, realpathSync } from 'node:fs';
|
|
3
3
|
import { isAbsolute, join, resolve } from 'node:path';
|
|
4
4
|
import { isNormalizedRepoRelativePath, sha256Canonical } from '@gate-forge/core';
|
|
5
|
+
import { pathIgnoredByGit } from './git-ignored.js';
|
|
6
|
+
/**
|
|
7
|
+
* Runner/tooling cache directories under an approved reuse root (e.g.
|
|
8
|
+
* `node_modules/.vite`). They are not installed package bytes and may
|
|
9
|
+
* change while a long supervised suite runs in the owner workspace.
|
|
10
|
+
*/
|
|
11
|
+
const RUNTIME_REUSE_EPHEMERAL_DIR_NAMES = {
|
|
12
|
+
'.cache': true,
|
|
13
|
+
'.turbo': true,
|
|
14
|
+
'.vite': true,
|
|
15
|
+
'.vite-temp': true,
|
|
16
|
+
'.vitest': true,
|
|
17
|
+
};
|
|
18
|
+
/** True for runner cache directory names omitted from reuse and candidate-tree digests. */
|
|
19
|
+
export function isRuntimeReuseEphemeralDirName(name) {
|
|
20
|
+
return RUNTIME_REUSE_EPHEMERAL_DIR_NAMES[name] === true;
|
|
21
|
+
}
|
|
22
|
+
/** Runner cache dirs under `node_modules/` (includes `.cache`). */
|
|
23
|
+
const CANDIDATE_TREE_EPHEMERAL_OUTSIDE_NODE_MODULES = {
|
|
24
|
+
'.vite': true,
|
|
25
|
+
'.vite-temp': true,
|
|
26
|
+
'.vitest': true,
|
|
27
|
+
'.turbo': true,
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* True when a directory should be omitted from candidate-tree walks.
|
|
31
|
+
* Runner cache directory names are skipped only when Git ignores that
|
|
32
|
+
* path — tracked or untracked non-ignored bytes must stay bound.
|
|
33
|
+
*/
|
|
34
|
+
export function skipCandidateTreeCacheDirectory(workspace, parentRel, dirName) {
|
|
35
|
+
const underNodeModules = parentRel === 'node_modules' || parentRel.startsWith('node_modules/');
|
|
36
|
+
const ephemeral = (underNodeModules && isRuntimeReuseEphemeralDirName(dirName)) ||
|
|
37
|
+
CANDIDATE_TREE_EPHEMERAL_OUTSIDE_NODE_MODULES[dirName] === true;
|
|
38
|
+
if (!ephemeral)
|
|
39
|
+
return false;
|
|
40
|
+
const rel = parentRel.length > 0 ? `${parentRel}/${dirName}` : dirName;
|
|
41
|
+
return pathIgnoredByGit(workspace, rel);
|
|
42
|
+
}
|
|
5
43
|
/** Error raised when a declared reuse boundary is not the link we approved. */
|
|
6
44
|
export class RuntimeReuseBoundaryError extends Error {
|
|
7
45
|
constructor(message) {
|
|
@@ -103,6 +141,8 @@ function collectEntries(absolute, logicalPath, active, entries) {
|
|
|
103
141
|
throw new RuntimeReuseBoundaryError(`runtime reuse directory '${logicalPath}' is unreadable`);
|
|
104
142
|
}
|
|
105
143
|
for (const child of children) {
|
|
144
|
+
if (RUNTIME_REUSE_EPHEMERAL_DIR_NAMES[child] === true)
|
|
145
|
+
continue;
|
|
106
146
|
collectEntries(join(absolute, child), `${logicalPath}/${child}`, new Set([...active, resolved]), entries);
|
|
107
147
|
}
|
|
108
148
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-reuse.js","sourceRoot":"","sources":["../src/runtime-reuse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC3F,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,4BAA4B,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"runtime-reuse.js","sourceRoot":"","sources":["../src/runtime-reuse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC3F,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,4BAA4B,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAcpD;;;;GAIG;AACH,MAAM,iCAAiC,GAAyB;IAC9D,QAAQ,EAAE,IAAI;IACd,QAAQ,EAAE,IAAI;IACd,OAAO,EAAE,IAAI;IACb,YAAY,EAAE,IAAI;IAClB,SAAS,EAAE,IAAI;CAChB,CAAC;AAEF,2FAA2F;AAC3F,MAAM,UAAU,8BAA8B,CAAC,IAAY;IACzD,OAAO,iCAAiC,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;AAC1D,CAAC;AAED,mEAAmE;AACnE,MAAM,6CAA6C,GAAyB;IAC1E,OAAO,EAAE,IAAI;IACb,YAAY,EAAE,IAAI;IAClB,SAAS,EAAE,IAAI;IACf,QAAQ,EAAE,IAAI;CACf,CA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AI,EAAE,eAAe,EAAE,CAAC,CAAC;YAC9C,SAAS;QACX,CAAC;QACD,IAAI,CAAC,4BAA4B,CAAC,IAAI,CAAC,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;YACpE,MAAM,IAAI,yBAAyB,CAAC,yBAAyB,IAAI,2CAA2C,CAAC,CAAC;QAChH,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;QACtC,cAAc,CAAC,UAAU,EAAE,IAAI,EAAE,IAAI,GAAG,EAAE,EAAE,OAAO,CAAC,CAAC;IACvD,CAAC;IACD,OAAO,eAAe,CAAC,EAAE,MAAM,EAAE,4BAA4B,EAAE,OAAO,EAAE,CAAC,CAAC;AAC5E,CAAC;AAED,6EAA6E;AAC7E,MAAM,UAAU,kBAAkB,CAAC,IAAY,EAAE,MAAoC;IACnF,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC;AAC1F,CAAC"}
|
package/guides/QUICKSTART.md
CHANGED
|
@@ -24,11 +24,11 @@ Example for a React frontend, FastAPI backend, and SQLAlchemy data layer:
|
|
|
24
24
|
|
|
25
25
|
```sh
|
|
26
26
|
npm i -D \
|
|
27
|
-
@gate-forge/cli@0.
|
|
28
|
-
@gate-forge/pack-playwright@0.
|
|
29
|
-
@gate-forge/pack-http@0.
|
|
30
|
-
@gate-forge/pack-fastapi@0.
|
|
31
|
-
@gate-forge/pack-sqlalchemy@0.
|
|
27
|
+
@gate-forge/cli@0.15.0 \
|
|
28
|
+
@gate-forge/pack-playwright@0.15.0 \
|
|
29
|
+
@gate-forge/pack-http@0.15.0 \
|
|
30
|
+
@gate-forge/pack-fastapi@0.15.0 \
|
|
31
|
+
@gate-forge/pack-sqlalchemy@0.15.0
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
Use the project-local `gateforge` binary from your npm script or add `node_modules/.bin` to your shell `PATH`. If the scan recommends other packs, add only the ones your code uses, at the same version. A mismatched Gateforge package contract can stop the CLI with exit code 2 and `GATEFORGE_PACKAGE_INCOMPATIBLE`.
|
|
@@ -49,7 +49,7 @@ This installs every pack of the release; the scan still recommends the ones your
|
|
|
49
49
|
|
|
50
50
|
**You should see:** npm installs the packages without a Gateforge compatibility error.
|
|
51
51
|
|
|
52
|
-
**If not:** align every direct `@gate-forge/*` package to `0.
|
|
52
|
+
**If not:** align every direct `@gate-forge/*` package to `0.15.0`, then install again. Do not work around the compatibility error.
|
|
53
53
|
|
|
54
54
|
## 2. Pick a goal
|
|
55
55
|
|
|
@@ -501,7 +501,7 @@ the registry. To gate a release that is not on the registry yet (a local
|
|
|
501
501
|
regenerate:
|
|
502
502
|
|
|
503
503
|
```sh
|
|
504
|
-
GATEFORGE_CI_ENGINE_SOURCE=vendor/gate-forge-cli-0.
|
|
504
|
+
GATEFORGE_CI_ENGINE_SOURCE=vendor/gate-forge-cli-0.15.0.tgz \
|
|
505
505
|
gateforge enforce --ci github
|
|
506
506
|
```
|
|
507
507
|
|
package/guides/REFERENCE.md
CHANGED
|
@@ -1275,6 +1275,44 @@ repo-root-relative. `changed.provider: auto` (the default) picks
|
|
|
1275
1275
|
instant for deterministic reports; `system` (default) freezes it at run
|
|
1276
1276
|
start.
|
|
1277
1277
|
|
|
1278
|
+
### A second app origin (`additionalAppOrigins`)
|
|
1279
|
+
|
|
1280
|
+
A consumer whose tests drive a SECOND browser app — a platform admin console
|
|
1281
|
+
beside the tenant app — declares it in `.gateforge.yml`:
|
|
1282
|
+
|
|
1283
|
+
```yaml
|
|
1284
|
+
additionalAppOrigins:
|
|
1285
|
+
- E2E_PLATFORM_BASE_URL
|
|
1286
|
+
```
|
|
1287
|
+
|
|
1288
|
+
Each entry is the NAME of an environment variable, never a base URL: the
|
|
1289
|
+
address stays operator-supplied (exactly as `GATEFORGE_APP_BASE_URL` is) and
|
|
1290
|
+
never enters a candidate-controlled file. An entry that is not an
|
|
1291
|
+
environment-variable name is a config error.
|
|
1292
|
+
|
|
1293
|
+
What it changes: the witness opens one observation proxy per declared
|
|
1294
|
+
origin per test session (each attested loopback-only, like the primary
|
|
1295
|
+
target), and the Playwright fixture rewrites requests for each app origin
|
|
1296
|
+
onto that origin's own session proxy. One test driving two apps therefore
|
|
1297
|
+
keeps ONE session, ONE attribution and ONE exchange ledger, instead of the
|
|
1298
|
+
second app's traffic passing unwitnessed while the test still passes.
|
|
1299
|
+
|
|
1300
|
+
What it does NOT change: endpoint→plane matching, the page route table, or
|
|
1301
|
+
what counts as proof. A test-code request on a declared origin is still
|
|
1302
|
+
marked `test-code` and still cannot satisfy a UI claim. An origin nobody
|
|
1303
|
+
declared is still reported as an unrouted origin and still blocks the claim,
|
|
1304
|
+
so declaring one app never silences the diagnostic for another.
|
|
1305
|
+
|
|
1306
|
+
Resolution is fail-closed: a declared name the run environment does not set,
|
|
1307
|
+
or sets to something that is not an absolute `http(s)` base URL, refuses the
|
|
1308
|
+
run with a `UsageError` naming the variable. A silent skip would leave the
|
|
1309
|
+
suite driving an unwitnessed app behind a config that reads correct.
|
|
1310
|
+
|
|
1311
|
+
Because the declaration lives in `.gateforge.yml`, it is inside the
|
|
1312
|
+
owner-approved policy digest like every other declaration there: widening
|
|
1313
|
+
the list moves the approved revision, so a candidate cannot widen its own
|
|
1314
|
+
app origins in the same commit that needs them.
|
|
1315
|
+
|
|
1278
1316
|
### HTTP route source (`http.routeSource`)
|
|
1279
1317
|
|
|
1280
1318
|
`.gateforge.yml` accepts:
|
|
@@ -1348,6 +1386,10 @@ Enforcement-relevant sections:
|
|
|
1348
1386
|
`playwright` (the default when the key is absent), `pytest`, `vitest` or
|
|
1349
1387
|
`cypress`. `check`, `next`, `tests`, `test-gates`, `doctor` and `init`
|
|
1350
1388
|
all follow it. See `guides/RUNNER-NEUTRAL-EVIDENCE.md`.
|
|
1389
|
+
- `witness.enumerationTimeoutSeconds:` — optional wall-clock bound (seconds,
|
|
1390
|
+
1–3600) for vitest `list` children during catalog construction and
|
|
1391
|
+
`test-gates` enumeration. ABSENT = 120s. Raise it for large workspace
|
|
1392
|
+
suites whose enumeration outlasts the default.
|
|
1351
1393
|
- `project.paths.testTooling:` — globs the owner asserts are test/developer
|
|
1352
1394
|
tooling (`scripts/e2e/**`, `tools/dev/**`). A changed file matching one is
|
|
1353
1395
|
attributed `test-tooling:<file>`: scope-expanding exactly like test
|
|
@@ -2560,7 +2602,9 @@ expected context, every witnessed record demotes to claimed-tier
|
|
|
2560
2602
|
`enforcement doctor` fails the `playwright-projects` row — `test-gates`
|
|
2561
2603
|
needs a named project.
|
|
2562
2604
|
- Gateforge reads the FIRST of `playwright.config.{ts,mts,cts,js,mjs,cjs}`
|
|
2563
|
-
at the repository root
|
|
2605
|
+
at the repository root, then up to two directory levels down (breadth-first,
|
|
2606
|
+
alphabetical, hidden/dependency/build/Python directories pruned). Multiple
|
|
2607
|
+
configs are disclosed, but only the first is inventoried. A suffixed config such as
|
|
2564
2608
|
`playwright.config.e2e.js` is not read — rename it to
|
|
2565
2609
|
`playwright.config.js` if it is the suite to prove.
|
|
2566
2610
|
- Run-state hygiene is enforced, not forgiven: a committed run-state
|
|
@@ -160,7 +160,7 @@ Four rules decide what a run does with a declared state:
|
|
|
160
160
|
- **A relative path is relative to the runner's working directory** —
|
|
161
161
|
the directory holding the playwright config the run uses. That is the
|
|
162
162
|
repository root for a root-level config and the project's own
|
|
163
|
-
directory for a config
|
|
163
|
+
directory for a config up to two levels down, which is exactly the directory
|
|
164
164
|
your setup test wrote the file from: the artifact the dependent project
|
|
165
165
|
reads is the artifact the setup project saved, wherever the config
|
|
166
166
|
lives. The file need not exist before the run; the setup project creates
|
|
@@ -924,6 +924,7 @@ the re-sealed receipt names parent 9f2c… but the run state retains no parent r
|
|
|
924
924
|
re-seal hop 1 claims a receipt parent but the run state retains a run-record (fail closed)
|
|
925
925
|
re-seal hop 1's parent receipt does not authenticate with this keyring: … (fail closed)
|
|
926
926
|
re-seal hop 2's parent receipt does not authenticate with this keyring: … (fail closed)
|
|
927
|
+
re-seal hop 1's retained evidence does not recompute: its retained evidence does not match the attestation its document seals (fail closed)
|
|
927
928
|
re-seal hop 1's retained evidence does not recompute: its evidence attestation does not verify with this keyring (fail closed)
|
|
928
929
|
re-sealed receipt claims 561 carried test(s) but its chain holds 560 carried outcome(s)
|
|
929
930
|
the re-sealed receipt carries 6 consecutive re-seals, past the bound of 5 — run the full suite
|
|
@@ -1216,13 +1217,19 @@ Link the pair in one of two ways, both read only when `twinPaths` is set:
|
|
|
1216
1217
|
else next to a bare `X`. Two described raw tests under one label link
|
|
1217
1218
|
nothing: name the pair with `twinOf`.
|
|
1218
1219
|
|
|
1219
|
-
Both tests must send their requests through the witness
|
|
1220
|
-
runs
|
|
1221
|
-
`@gate-forge/pack-playwright`
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1220
|
+
Both tests must send their browser requests through the witness. Witnessed
|
|
1221
|
+
runs automatically instrument consumer `@playwright/test` and `playwright/test`
|
|
1222
|
+
imports; explicit `test` from `@gate-forge/pack-playwright` works too. A linked
|
|
1223
|
+
raw twin gets an observation-only session and issues no obligation evidence,
|
|
1224
|
+
regardless of which supported import it uses. Plain-import twins **are**
|
|
1225
|
+
compared, and their differing paths are reported.
|
|
1226
|
+
|
|
1227
|
+
An uninstrumented test (for example, one importing Playwright's test module
|
|
1228
|
+
by a direct filesystem path rather than a supported package specifier), or
|
|
1229
|
+
a test sending no requests through its session proxy, has no witnessed shapes.
|
|
1230
|
+
The pair is not compared, and the run says so on one line
|
|
1231
|
+
(`test-gates: twin pair not compared: the raw test '…' sent no request through
|
|
1232
|
+
the witness`), never as "the twins agree".
|
|
1226
1233
|
|
|
1227
1234
|
```bash
|
|
1228
1235
|
# A run with the pair linked reports the divergence and keeps its verdict:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gate-forge/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"gateforgeCompatibility": {
|
|
5
5
|
"supervisedFixtureProtocol": "gateforge.supervised-playwright.v1"
|
|
6
6
|
},
|
|
@@ -33,16 +33,16 @@
|
|
|
33
33
|
"test": "vitest run"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@gate-forge/core": "^0.
|
|
37
|
-
"@gate-forge/http-contract": "^0.
|
|
38
|
-
"@gate-forge/pack-fastapi": "^0.
|
|
39
|
-
"@gate-forge/pack-alembic": "^0.
|
|
40
|
-
"@gate-forge/pack-http": "^0.
|
|
41
|
-
"@gate-forge/pack-react-router": "^0.
|
|
42
|
-
"@gate-forge/pack-playwright": "^0.
|
|
43
|
-
"@gate-forge/pack-sqlalchemy": "^0.
|
|
44
|
-
"@gate-forge/pack-task": "^0.
|
|
45
|
-
"@gate-forge/plugin-protocol": "^0.
|
|
36
|
+
"@gate-forge/core": "^0.15.0",
|
|
37
|
+
"@gate-forge/http-contract": "^0.15.0",
|
|
38
|
+
"@gate-forge/pack-fastapi": "^0.15.0",
|
|
39
|
+
"@gate-forge/pack-alembic": "^0.15.0",
|
|
40
|
+
"@gate-forge/pack-http": "^0.15.0",
|
|
41
|
+
"@gate-forge/pack-react-router": "^0.15.0",
|
|
42
|
+
"@gate-forge/pack-playwright": "^0.15.0",
|
|
43
|
+
"@gate-forge/pack-sqlalchemy": "^0.15.0",
|
|
44
|
+
"@gate-forge/pack-task": "^0.15.0",
|
|
45
|
+
"@gate-forge/plugin-protocol": "^0.15.0",
|
|
46
46
|
"picomatch": "^4.0.7",
|
|
47
47
|
"yaml": "^2.8.1"
|
|
48
48
|
},
|