@gate-forge/cli 0.10.0 → 0.10.1
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 +343 -0
- package/README.md +1 -0
- package/dist/commands/check.d.ts.map +1 -1
- package/dist/commands/check.js +14 -14
- package/dist/commands/check.js.map +1 -1
- package/dist/commands/enforcement.d.ts.map +1 -1
- package/dist/commands/enforcement.js +11 -1
- package/dist/commands/enforcement.js.map +1 -1
- package/dist/commands/pre-commit.d.ts.map +1 -1
- package/dist/commands/pre-commit.js +8 -1
- package/dist/commands/pre-commit.js.map +1 -1
- package/dist/commands/tests.js +74 -17
- package/dist/commands/tests.js.map +1 -1
- package/dist/pipeline.d.ts +8 -2
- package/dist/pipeline.d.ts.map +1 -1
- package/dist/pipeline.js +9 -8
- package/dist/pipeline.js.map +1 -1
- package/dist/repo-path.d.ts +3 -0
- package/dist/repo-path.d.ts.map +1 -0
- package/dist/repo-path.js +24 -0
- package/dist/repo-path.js.map +1 -0
- package/dist/staged-candidate.d.ts +36 -1
- package/dist/staged-candidate.d.ts.map +1 -1
- package/dist/staged-candidate.js +47 -0
- package/dist/staged-candidate.js.map +1 -1
- package/guides/QUICKSTART.md +7 -7
- package/guides/REFERENCE.md +28 -2
- package/package.json +12 -10
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.10.
|
|
28
|
-
@gate-forge/pack-playwright@0.10.
|
|
29
|
-
@gate-forge/pack-http@0.10.
|
|
30
|
-
@gate-forge/pack-fastapi@0.10.
|
|
31
|
-
@gate-forge/pack-sqlalchemy@0.10.
|
|
27
|
+
@gate-forge/cli@0.10.1 \
|
|
28
|
+
@gate-forge/pack-playwright@0.10.1 \
|
|
29
|
+
@gate-forge/pack-http@0.10.1 \
|
|
30
|
+
@gate-forge/pack-fastapi@0.10.1 \
|
|
31
|
+
@gate-forge/pack-sqlalchemy@0.10.1
|
|
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.10.
|
|
52
|
+
**If not:** align every direct `@gate-forge/*` package to `0.10.1`, then install again. Do not work around the compatibility error.
|
|
53
53
|
|
|
54
54
|
## 2. Pick a goal
|
|
55
55
|
|
|
@@ -427,7 +427,7 @@ the registry. To gate a release that is not on the registry yet (a local
|
|
|
427
427
|
regenerate:
|
|
428
428
|
|
|
429
429
|
```sh
|
|
430
|
-
GATEFORGE_CI_ENGINE_SOURCE=vendor/gate-forge-cli-0.10.
|
|
430
|
+
GATEFORGE_CI_ENGINE_SOURCE=vendor/gate-forge-cli-0.10.1.tgz \
|
|
431
431
|
gateforge enforce --ci github
|
|
432
432
|
```
|
|
433
433
|
|
package/guides/REFERENCE.md
CHANGED
|
@@ -55,9 +55,9 @@ first commands; the guides cover the walks:
|
|
|
55
55
|
| `gateforge explain <resourceId\|path> [--json]` | Show one resource's detector signals, classification rules, decision fingerprint, typed blocks, and generated obligations. A repo-relative PATH is also a target: when no resource matches it, the command prints what the file is and what governs it (Gateforge policy input, declared gate input, owner-declared documentation folder, known source of a resource, or an unclassified change) with the steps that attribute it — this is the answer an unmapped `CHANGE_UNMAPPED` file needs. An unknown target stays unknown (exit 1). | 0/1/2 |
|
|
56
56
|
| `gateforge tests discover [--json] [--pytest]` | Inventory existing tests into the derived run-state catalog: static analysis reconciled with native Playwright enumeration (`--list`). Unresolved wrappers, parse errors, and inventory gaps are DATA (never an empty catalog — failed native enumeration is exit 2). `--pytest` additionally collects the configured diagnostic suites' node ids (`--collect-only`). Playwright enumeration runs ONE config (a repo-root config wins; otherwise the alphabetically first config one directory deep), and when the repo holds more than one the runner line names every config, the one used, why, and the ones NOT inventoried. `inventoryComplete=false` means a reconciliation gap (an enumerated-vs-static mismatch, an unresolved case, or a not-inventoried extra config), not a partial success. | 0/2 |
|
|
57
57
|
| `gateforge tests suggest [--changed] [--json]` | Resolve mappings for the run's obligations and produce reuse-ordered existing-test candidates with typed causes (`TEST_MAPPING_MISSING` / `TEST_KIND_UNKNOWN` / `TEST_MAPPING_AMBIGUOUS` / `TEST_MAPPING_STALE`). Candidates are RANKED by the evidence their catalog row carries (explicit tag, resource token in title/file, operation word, route segment, unmocked folder, minus mocks) with the matching reason printed as `why:`; the text surface prints the top five and names how many it hid, `--json` carries every candidate with its `rank` and `score`. The reuse verdict `newTestNeeded` has THREE honest values: `no` (the `#1` candidate is an unmocked e2e row more than one signal supports), `yes` (no candidate survived resolution, or every candidate mocks the system under test) and `unverified` (a candidate exists but one signal carries it — confirm the request with `gateforge explain <obligation>` before marking). The next action follows it: MARK the candidate and run it under the witness when the verdict is `no`, write the overlay when it is `yes`. When Playwright reports load errors and enumerates no tests, report one `TEST_INVENTORY_INCOMPLETE` with the error count and first error instead of stale-mapping fan-out; the action is to install the missing dependency and rerun Gateforge. An inspection surface, NOT a gate: exit 0 even with blocking problems. | 0/2 |
|
|
58
|
-
| `gateforge tests mark --test <key> --kind <kind> [--category <c>]... --obligation <id>... --reason "<text>"` | Declare an existing test in `.gateforge/test-map.yml` (see the test-reuse workflow below). Validates against the CURRENT catalog and obligation registry, writes atomically and idempotently, prints the exact diff. Never edits test files, never adds waivers, refuses contradictions. | 0/2 |
|
|
58
|
+
| `gateforge tests mark --test <key> --kind <kind> [--category <c>]... --obligation <id>... --reason "<text>"` | Declare an existing test in `.gateforge/test-map.yml` (see the test-reuse workflow below). `--test` accepts EITHER documented key form: the catalog `logicalKey` (`playwright:chromium:e2e/accounts.spec.ts:Accounts>deletes an account`) or the reconciliation key `<file>#<titlePath joined by '>'` (`e2e/accounts.spec.ts#Accounts>deletes an account`). The sidecar always stores the `logicalKey`. Validates against the CURRENT catalog and obligation registry, writes atomically and idempotently, prints the exact diff. Never edits test files, never adds waivers, refuses contradictions. | 0/2 |
|
|
59
59
|
| `gateforge tests sync [--json]` | AST-only scan of test annotations; updates generated `source: annotation` entries in `.gateforge/test-map.yml` and leaves handwritten entries unchanged. Reports unresolved helpers with source locations; does not run tests. | 0/1/2 |
|
|
60
|
-
| `gateforge tests explain --test <key> [--json]` | Per-test report: requirements, existing-test identity, mapping origin, honest execution status, next action, and the same three-state reuse verdict `New test needed` (`no` / `yes` / `unverified`) `tests suggest` prints — built from the SAME route evidence, so the two surfaces never disagree about one test. | 0/2 (unknown key → 2) |
|
|
60
|
+
| `gateforge tests explain --test <key> [--json]` | Per-test report: requirements, existing-test identity, mapping origin, honest execution status, next action, and the same three-state reuse verdict `New test needed` (`no` / `yes` / `unverified`) `tests suggest` prints — built from the SAME route evidence, so the two surfaces never disagree about one test. `--test` takes the same two key forms as `tests mark` (see above). | 0/2 (unknown or ambiguous key → 2) |
|
|
61
61
|
| `gateforge tests diagnose [--suite <name>] [--json]` | Run the configured pytest diagnostic suites once per suite, isolated (own process, `GATEFORGE_*` stripped, finite timeout). Advisory: exit 0 completed run (≥1 pass, no unexpected failures), 1 test failures, 2 unavailable/incomplete (collection error, timeout, missing interpreter, interruption, zero tests, or only skipped/xfail). Never E2E proof. | 0/1/2 |
|
|
62
62
|
| `gateforge obligations [--json]` | Evaluate policies against the automatically classified graph and dump obligations, blocking entries, and claim assessments. | 0/1/2 |
|
|
63
63
|
| `gateforge check [--changed] [--staged] [--candidate-commit <sha>] [--require-e2e] [--timing] [--no-cache] [--format text\|json\|sarif]` | The full gate: discover → classify → obligations → claims → verdicts → report. `--timing` appends per-step wall-clock timings (detectors, test collection, TS scan, planning, total) — an additive report key in json and one line in text, never an input to any verdict. Detector and pytest-collection results are cached under the excluded run-state dir. Detector keys include plugin config, executable module/script bytes, Python import environment, inputs, interpreter packages, and Gateforge engine version; pytest keys include all Python/config file bytes, collector argv/environment, interpreter identity, and engine version. Unchanged successful pytest collections reuse their node ids; any changed Python byte recollects. Any uncertainty runs fresh. The report carries additive `cache: {hits, misses}` counts. `--no-cache` (or `GATEFORGE_NO_CACHE=1`, or a CI environment) disables cache reads and writes. | 0 clean/waived, 1 unresolved, 2 config/usage error |
|
|
@@ -380,6 +380,32 @@ tests:
|
|
|
380
380
|
reason: Existing journey deletes the selected account.
|
|
381
381
|
```
|
|
382
382
|
|
|
383
|
+
`--test` accepts EITHER of the two key forms the surfaces hand you, and
|
|
384
|
+
both name the same test. The catalog `logicalKey` is what `tests discover`,
|
|
385
|
+
`tests suggest` and `check` print:
|
|
386
|
+
|
|
387
|
+
```bash
|
|
388
|
+
gateforge tests mark --test 'playwright:chromium:e2e/accounts.spec.ts:Accounts>deletes an account' …
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
The reconciliation key `<file>#<titlePath joined by '>'` — the form
|
|
392
|
+
REFERENCE uses for sidecar bindings and the one the runner's own test
|
|
393
|
+
events carry — resolves to the same catalog row, so a key copied out of a
|
|
394
|
+
report works without a lookup step:
|
|
395
|
+
|
|
396
|
+
```bash
|
|
397
|
+
gateforge tests mark --test 'e2e/accounts.spec.ts#Accounts>deletes an account' …
|
|
398
|
+
gateforge tests explain --test 'e2e/accounts.spec.ts#Accounts>deletes an account'
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
The sidecar always stores the `logicalKey` (as above), so a mapping's
|
|
402
|
+
identity never depends on which form was typed. When the same file and
|
|
403
|
+
title run under SEVERAL runner projects, the reconciliation key matches
|
|
404
|
+
more than one catalog row and the error names every matching
|
|
405
|
+
`logicalKey` — only that form tells the projects apart. An unknown key
|
|
406
|
+
names both accepted forms and, when the file part does exist in the
|
|
407
|
+
catalog, lists up to five of that file's real keys.
|
|
408
|
+
|
|
383
409
|
`--kind` is one of `browser-e2e`, `observed-e2e`, `api-e2e`, `unit`, `integration`,
|
|
384
410
|
`component`, `unknown`. A declaration is INTENT, never proof:
|
|
385
411
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gate-forge/cli",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.1",
|
|
4
4
|
"gateforgeCompatibility": {
|
|
5
5
|
"supervisedFixtureProtocol": "gateforge.supervised-playwright.v1"
|
|
6
6
|
},
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
22
|
"files": [
|
|
23
|
+
"CHANGELOG.md",
|
|
23
24
|
"bin",
|
|
24
25
|
"dist",
|
|
25
26
|
"guides"
|
|
@@ -28,18 +29,19 @@
|
|
|
28
29
|
"build": "tsc -p tsconfig.build.json",
|
|
29
30
|
"prebuild": "npm run build -w @gate-forge/core && npm run build -w @gate-forge/plugin-protocol",
|
|
30
31
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
32
|
+
"prepack": "node ../../scripts/copy-changelog.mjs",
|
|
31
33
|
"test": "vitest run"
|
|
32
34
|
},
|
|
33
35
|
"dependencies": {
|
|
34
|
-
"@gate-forge/core": "^0.10.
|
|
35
|
-
"@gate-forge/http-contract": "^0.10.
|
|
36
|
-
"@gate-forge/pack-fastapi": "^0.10.
|
|
37
|
-
"@gate-forge/pack-alembic": "^0.10.
|
|
38
|
-
"@gate-forge/pack-http": "^0.10.
|
|
39
|
-
"@gate-forge/pack-playwright": "^0.10.
|
|
40
|
-
"@gate-forge/pack-sqlalchemy": "^0.10.
|
|
41
|
-
"@gate-forge/pack-task": "^0.10.
|
|
42
|
-
"@gate-forge/plugin-protocol": "^0.10.
|
|
36
|
+
"@gate-forge/core": "^0.10.1",
|
|
37
|
+
"@gate-forge/http-contract": "^0.10.1",
|
|
38
|
+
"@gate-forge/pack-fastapi": "^0.10.1",
|
|
39
|
+
"@gate-forge/pack-alembic": "^0.10.1",
|
|
40
|
+
"@gate-forge/pack-http": "^0.10.1",
|
|
41
|
+
"@gate-forge/pack-playwright": "^0.10.1",
|
|
42
|
+
"@gate-forge/pack-sqlalchemy": "^0.10.1",
|
|
43
|
+
"@gate-forge/pack-task": "^0.10.1",
|
|
44
|
+
"@gate-forge/plugin-protocol": "^0.10.1",
|
|
43
45
|
"picomatch": "^4.0.7",
|
|
44
46
|
"yaml": "^2.8.1"
|
|
45
47
|
},
|