@gate-forge/cli 0.9.0 → 0.10.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 +12 -5
- package/dist/cache-exclusions.d.ts +20 -13
- package/dist/cache-exclusions.d.ts.map +1 -1
- package/dist/cache-exclusions.js +47 -33
- package/dist/cache-exclusions.js.map +1 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +11 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/adopt.d.ts +3 -2
- package/dist/commands/adopt.d.ts.map +1 -1
- package/dist/commands/adopt.js +38 -5
- package/dist/commands/adopt.js.map +1 -1
- package/dist/commands/blocking.d.ts +20 -1
- package/dist/commands/blocking.d.ts.map +1 -1
- package/dist/commands/blocking.js +105 -10
- package/dist/commands/blocking.js.map +1 -1
- package/dist/commands/check.d.ts +34 -0
- package/dist/commands/check.d.ts.map +1 -1
- package/dist/commands/check.js +93 -7
- package/dist/commands/check.js.map +1 -1
- package/dist/commands/classify.d.ts +1 -0
- package/dist/commands/classify.d.ts.map +1 -1
- package/dist/commands/classify.js +230 -14
- package/dist/commands/classify.js.map +1 -1
- package/dist/commands/common.d.ts +6 -1
- package/dist/commands/common.d.ts.map +1 -1
- package/dist/commands/common.js +8 -1
- package/dist/commands/common.js.map +1 -1
- package/dist/commands/enforcement.d.ts +9 -1
- package/dist/commands/enforcement.d.ts.map +1 -1
- package/dist/commands/enforcement.js +448 -13
- package/dist/commands/enforcement.js.map +1 -1
- package/dist/commands/init.d.ts +20 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +296 -93
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/migrate.d.ts +14 -0
- package/dist/commands/migrate.d.ts.map +1 -0
- package/dist/commands/migrate.js +177 -0
- package/dist/commands/migrate.js.map +1 -0
- package/dist/commands/next.d.ts.map +1 -1
- package/dist/commands/next.js +7 -2
- package/dist/commands/next.js.map +1 -1
- package/dist/commands/pre-commit.d.ts.map +1 -1
- package/dist/commands/pre-commit.js +62 -19
- package/dist/commands/pre-commit.js.map +1 -1
- package/dist/commands/tests.d.ts.map +1 -1
- package/dist/commands/tests.js +54 -24
- package/dist/commands/tests.js.map +1 -1
- package/dist/docs-exclusions.d.ts +32 -5
- package/dist/docs-exclusions.d.ts.map +1 -1
- package/dist/docs-exclusions.js +60 -26
- package/dist/docs-exclusions.js.map +1 -1
- package/dist/evidence-config-text.d.ts +57 -0
- package/dist/evidence-config-text.d.ts.map +1 -0
- package/dist/evidence-config-text.js +263 -0
- package/dist/evidence-config-text.js.map +1 -0
- package/dist/execution.d.ts +51 -8
- package/dist/execution.d.ts.map +1 -1
- package/dist/execution.js +61 -29
- package/dist/execution.js.map +1 -1
- package/dist/gateforge-owned.d.ts +30 -5
- package/dist/gateforge-owned.d.ts.map +1 -1
- package/dist/gateforge-owned.js +136 -18
- package/dist/gateforge-owned.js.map +1 -1
- package/dist/git-hooks.d.ts.map +1 -1
- package/dist/git-hooks.js +15 -0
- package/dist/git-hooks.js.map +1 -1
- package/dist/input-snapshot.d.ts.map +1 -1
- package/dist/input-snapshot.js +2 -6
- package/dist/input-snapshot.js.map +1 -1
- package/dist/legacy-exclusion-paths.d.ts +28 -0
- package/dist/legacy-exclusion-paths.d.ts.map +1 -0
- package/dist/legacy-exclusion-paths.js +48 -0
- package/dist/legacy-exclusion-paths.js.map +1 -0
- package/dist/providers.d.ts +54 -0
- package/dist/providers.d.ts.map +1 -1
- package/dist/providers.js +101 -0
- package/dist/providers.js.map +1 -1
- package/dist/staged-candidate.d.ts.map +1 -1
- package/dist/staged-candidate.js +2 -1
- package/dist/staged-candidate.js.map +1 -1
- package/dist/trusted-policy.d.ts.map +1 -1
- package/dist/trusted-policy.js +3 -2
- package/dist/trusted-policy.js.map +1 -1
- package/guides/CONNECT-YOUR-PROJECT.md +64 -0
- package/guides/QUICKSTART.md +68 -15
- package/guides/REFERENCE.md +229 -33
- package/guides/TEST-ENVIRONMENT.md +36 -0
- package/guides/UPGRADE-0.8-to-0.9.md +9 -1
- package/guides/UPGRADE-0.9-to-0.10.md +137 -0
- package/package.json +10 -10
|
@@ -37,6 +37,42 @@ Export those values before `gateforge run` or `test-gates`. Only listed names re
|
|
|
37
37
|
|
|
38
38
|
Engine `GATEFORGE_*` names and process-loader controls (`NODE_OPTIONS`, `NODE_PATH`, `LD_*`, `DYLD_*`, `PYTHONPATH`, `PYTHONHOME`, `BASH_ENV`, `ENV`) are refused even if listed. No list means no additional variables are forwarded. Supervised test-gates refuses these names with usage error 2 before its harness setup, plugin pipeline, or native test enumeration.
|
|
39
39
|
|
|
40
|
+
## Point the suite at the origin Gateforge routes
|
|
41
|
+
|
|
42
|
+
**Rule:** Make the origin your suite loads the SAME origin
|
|
43
|
+
`GATEFORGE_APP_BASE_URL` names, and make sure the suite's own base-URL
|
|
44
|
+
variable actually reaches the test process — one of these two, never
|
|
45
|
+
neither:
|
|
46
|
+
|
|
47
|
+
- the suite's base URL variable is listed in `runtime.yml`
|
|
48
|
+
`envAllowlist` (`E2E_BASE_URL`, `TEST_API_URL`, … — whatever your
|
|
49
|
+
helpers read), or
|
|
50
|
+
- the suite reads no variable of its own and uses
|
|
51
|
+
`GATEFORGE_APP_BASE_URL` directly.
|
|
52
|
+
|
|
53
|
+
**Why:** A witnessed run only rewrites requests to `GATEFORGE_APP_BASE_URL`
|
|
54
|
+
onto the supervisor's session observation proxy. When the tests load some
|
|
55
|
+
other origin — `http://localhost:13001` while Gateforge was pointed at
|
|
56
|
+
`http://localhost:13101` — nothing is routed, the witness observes nothing,
|
|
57
|
+
and every `observed-e2e` transport claim finalizes as missing while the test
|
|
58
|
+
itself passes. A missing variable fails the same way, only more quietly: the
|
|
59
|
+
suite falls back to its own default and Gateforge never learns about it.
|
|
60
|
+
|
|
61
|
+
The zero-traffic note names the origin the page really requested when it can:
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
observe 'tenant.accounts:http:request-observed': no HTTP exchange passed
|
|
65
|
+
through this session's observation proxy before finalize …; this test's page
|
|
66
|
+
requested 'http://localhost:13001', which the fixture did not route: it
|
|
67
|
+
rewrites only GATEFORGE_APP_BASE_URL ('http://localhost:13101') onto this
|
|
68
|
+
session's proxy — set GATEFORGE_APP_BASE_URL to the origin your suite uses, or
|
|
69
|
+
add your suite's base-URL variable to envAllowlist in runtime.yml so it
|
|
70
|
+
reaches the test process
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
That sentence is a diagnostic: it names the cause, it decides nothing. A
|
|
74
|
+
claim that stays missing stays missing.
|
|
75
|
+
|
|
40
76
|
## Create login state against the app
|
|
41
77
|
|
|
42
78
|
**Rule:** Mint the Playwright login state by connecting directly to the app, not through the witness proxy. Reuse one session file instead of repeatedly logging in. Set `GATEFORGE_SESSION_STATE` to that file for the supervised run.
|
|
@@ -101,4 +101,12 @@
|
|
|
101
101
|
| `ENDPOINT_RESOURCE_CANDIDATE_UNMATCHED` | The route exists; Gateforge could not tie it to a business resource by name, and it says so instead of staying silent. The listed names are candidates, never links: give the route a response or handler name that carries the resource (or declare the mapping) if one of them is right. With no `endpoints.unmatchedRoutes` key it is an advisory; add `block` to that key to make it gate commits. |
|
|
102
102
|
| `CHANGE_UNMAPPED` on a file you believe is yours | Run `gateforge explain <path>`: it 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) and the steps that attribute it. |
|
|
103
103
|
| `ENFORCEMENT_UNTRUSTED` on a setup-only commit | Pin (re-approve) the policy digest so the change set is provably product-behavior-neutral. Never reach for `--no-verify`. |
|
|
104
|
-
| A `persistence:read` noted "above the 1048576-byte witness collection-read bound" or "above the 10000-row witness collection-read bound" | The list route serves more than the engine will read in one response. Declare paging on the adapter and prefer a by-id observe read for the claim; a bigger bound would only postpone this. |
|
|
104
|
+
| A `persistence:read` noted "above the 1048576-byte witness collection-read bound" or "above the 10000-row witness collection-read bound" | The list route serves more than the engine will read in one response. Declare paging on the adapter and prefer a by-id observe read for the claim; a bigger bound would only postpone this. |
|
|
105
|
+
|
|
106
|
+
## 0.9.1: what a 0.9.0 user notices
|
|
107
|
+
|
|
108
|
+
Three behavior changes, all refusals that replace a silent or misleading outcome:
|
|
109
|
+
|
|
110
|
+
- `gateforge init` exits 2 on a preset/flag contradiction (the preset used to be silently dropped) and on a requested setting that differs from an existing `.gateforge.yml` value — `init` never rewrites an existing config, so set the key yourself.
|
|
111
|
+
- `gateforge adopt` exits 2 while any blocking entry is plane-unresolved, naming the folders and the exact `gateforge classify plane <folder> <tenant|master|global> --confirm` answer: a plane answer changes resource identity, so debt adopted before the answer would not match the repository after it.
|
|
112
|
+
- `gateforge enforcement doctor` prints the full 64-hex trusted policy digest instead of a 12-hex prefix, and when the approved digest is absent or mismatched it adds an `owner: pin this revision with GATEFORGE_APPROVED_POLICY_DIGEST=...` action line.
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
# Upgrade from 0.9 to 0.10
|
|
2
|
+
|
|
3
|
+
0.10.0 has one configuration change: the two evidence-exclusion declarations
|
|
4
|
+
`.gateforge/docs-exclusions.yml` and `.gateforge/cache-exclusions.yml` are gone,
|
|
5
|
+
and their lists now live in `.gateforge.yml` under `evidence.exclude.docs` and
|
|
6
|
+
`evidence.exclude.cache`. One owner file instead of three, and no other
|
|
7
|
+
behavior moves.
|
|
8
|
+
|
|
9
|
+
**Nothing is read twice.** While either old file is present, every command
|
|
10
|
+
refuses with a message naming the file and `gateforge migrate`. Reading past it
|
|
11
|
+
would silently drop your exclusions, and a silently dropped exclusion changes
|
|
12
|
+
what evidence identity means — so the cutover is loud.
|
|
13
|
+
|
|
14
|
+
## Upgrade steps
|
|
15
|
+
|
|
16
|
+
1. Set every direct `@gate-forge/*` dependency to `0.10.0` (and every
|
|
17
|
+
`overrides`/`resolutions` entry and `npm:@gate-forge/…` alias), then
|
|
18
|
+
`npm install`.
|
|
19
|
+
|
|
20
|
+
2. Migrate the declarations, if you have any:
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
gateforge migrate
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
This is a preview: it prints the exact diff of `.gateforge.yml` and the
|
|
27
|
+
files it would delete, writes nothing, and exits 0. Read it. Then write it:
|
|
28
|
+
|
|
29
|
+
```sh
|
|
30
|
+
gateforge migrate --confirm
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
The command validates both old files with the same rules the loaders used,
|
|
34
|
+
splices one `evidence.exclude` block into your `.gateforge.yml` **as text**
|
|
35
|
+
(your comments, key order and quoting stay byte for byte), deletes the old
|
|
36
|
+
files, and prints the re-pin reminder. It is idempotent: a repository with
|
|
37
|
+
nothing to migrate prints `nothing to migrate` and exits 0, so re-running
|
|
38
|
+
after a partial adoption is free.
|
|
39
|
+
|
|
40
|
+
A repository that declares no exclusions needs no migration at all — leave
|
|
41
|
+
`.gateforge.yml` alone.
|
|
42
|
+
|
|
43
|
+
If your `.gateforge.yml` already declares `evidence:` in a form the command
|
|
44
|
+
cannot extend safely (an inline `evidence: {...}`, a `docs:` list written in
|
|
45
|
+
flow style), it refuses by name and changes nothing. Add the block by hand:
|
|
46
|
+
|
|
47
|
+
```yaml
|
|
48
|
+
evidence:
|
|
49
|
+
exclude:
|
|
50
|
+
docs:
|
|
51
|
+
- docs
|
|
52
|
+
cache:
|
|
53
|
+
- backend/__pycache__/account.cpython-312.pyc
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
...or delete your hand-written `evidence:` block and re-run `migrate
|
|
57
|
+
--confirm`, which will write it for you.
|
|
58
|
+
|
|
59
|
+
3. Re-approve the policy digest. Migration changed `.gateforge.yml`, which is
|
|
60
|
+
a trusted policy input:
|
|
61
|
+
|
|
62
|
+
```sh
|
|
63
|
+
git add -A .gateforge .gateforge.yml
|
|
64
|
+
gateforge enforcement pin --pin-file ~/.config/<repo>.gateforge.env --confirm
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
The command digests the STAGED bytes — the ones the commit gate digests —
|
|
68
|
+
and writes exactly the `GATEFORGE_APPROVED_POLICY_DIGEST=<hex>` line into
|
|
69
|
+
that env file, mode `0600`, leaving every other line alone. Without
|
|
70
|
+
`--confirm` it only prints the line. The env file must stay OUTSIDE the
|
|
71
|
+
repository, exactly like the protected variable it replaces; a path inside
|
|
72
|
+
the repository is refused, and so is a policy input that is not fully
|
|
73
|
+
staged (it names the file). Export the file for your shell or CI as before —
|
|
74
|
+
`GATEFORGE_TRUSTED_CONFIG`, a protected CI variable, or the file itself.
|
|
75
|
+
**Without a matching pin, a repository that uses exclusions still refuses to
|
|
76
|
+
use them** — the guarantee did not weaken.
|
|
77
|
+
|
|
78
|
+
To see WHAT moved instead of reading a digest: `gateforge enforcement doctor`
|
|
79
|
+
lists the inputs whose staged bytes differ from HEAD (`policy-inputs-vs-HEAD`)
|
|
80
|
+
and whether your provisioned pin still matches them (`approved-digest`).
|
|
81
|
+
|
|
82
|
+
4. Commit the setup change on its own:
|
|
83
|
+
|
|
84
|
+
```sh
|
|
85
|
+
git add .gateforge .gateforge.yml && git commit -m "chore: evidence exclusions in .gateforge.yml"
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
5. Check the same bytes you did before:
|
|
89
|
+
|
|
90
|
+
```sh
|
|
91
|
+
gateforge check --changed
|
|
92
|
+
gateforge test-gates --changed # seal one receipt under the new engine
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## What can appear or disappear, and why
|
|
96
|
+
|
|
97
|
+
- **The exclusion lists themselves do not change.** `loadDocsExclusions` and
|
|
98
|
+
`loadCacheExclusions` return exactly the lists you had before the migration.
|
|
99
|
+
Every refusal is unchanged too: an excluded folder still may not contain a
|
|
100
|
+
configured input, source, manifest, lockfile, `*.config.*` file, CI config or
|
|
101
|
+
symlink, and still may only hold the documented, data and static-raster
|
|
102
|
+
formats; a bytecode exclusion still must be an exact `.pyc`/`.pyo` directly
|
|
103
|
+
under `__pycache__`.
|
|
104
|
+
- **The policy digest changes once.** The declarations are no longer separate
|
|
105
|
+
digest entries; their bytes are inside `.gateforge.yml`, which the digest
|
|
106
|
+
already hashed. The bytes your approval pins are the same bytes, so nothing
|
|
107
|
+
is newly unprotected — the value just has to be re-approved once because the
|
|
108
|
+
file that carries it changed.
|
|
109
|
+
- **The input snapshot changes once, in the same way.** The two files are no
|
|
110
|
+
longer extra explicit inputs, for the same reason.
|
|
111
|
+
- **`init` writes into `.gateforge.yml`.** `--docs-exclude` / `--cache-exclude`
|
|
112
|
+
(and the `--confirm-…` flags) now splice into your config instead of writing
|
|
113
|
+
a separate document, so a second `init` on the same repository is still a
|
|
114
|
+
no-op and an owner-confirmed change still prints `updated:`.
|
|
115
|
+
|
|
116
|
+
## Owner decisions this release asks for
|
|
117
|
+
|
|
118
|
+
- **One file to review.** When you review a policy change, the exclusions are
|
|
119
|
+
now in the file you were reading anyway. `evidence.exclude` is deliberately
|
|
120
|
+
not named after `project.paths.exclude`: that key is scan scope (what the
|
|
121
|
+
detector reads), this one is evidence identity (what the gate stops
|
|
122
|
+
binding). Both are yours; they mean different things.
|
|
123
|
+
- **The declaration is still an assertion, not proof.** Nothing here proves
|
|
124
|
+
that an excluded file cannot affect application or test behavior. Reports
|
|
125
|
+
keep printing the exact folders/files, the pin status, and the reduced
|
|
126
|
+
guarantee.
|
|
127
|
+
|
|
128
|
+
## If something breaks
|
|
129
|
+
|
|
130
|
+
| If you see | Do this |
|
|
131
|
+
|---|---|
|
|
132
|
+
| `found .gateforge/docs-exclusions.yml: since 0.10 evidence exclusions live in .gateforge.yml under evidence.exclude — run \`gateforge migrate\`` | You have not migrated yet. Run `gateforge migrate`, read the preview, then `gateforge migrate --confirm`. |
|
|
133
|
+
| `found .gateforge/cache-exclusions.yml: …` | Same, for the bytecode list. |
|
|
134
|
+
| `.gateforge.yml declares docs inline as \`docs: […]\` — this command only writes docs as a list` | Your config writes that list in flow style. Reformat it as a block list (`docs:` then ` - path`), or edit the block by hand. |
|
|
135
|
+
| `.gateforge.yml declares evidence inline; this command only appends to an \`evidence:\` block` | Same for an inline `evidence:` or `exclude:` mapping. Make them block mappings, or add the block by hand. |
|
|
136
|
+
| `ENFORCEMENT_UNTRUSTED` / `approvalStatus: mismatch` after migrating | Expected once: `.gateforge.yml` is a policy input. Re-approve the digest (step 3). |
|
|
137
|
+
| `invalid gateforge config … Unrecognized key: "evidence"` | The CLI is older than the `.gateforge.yml` you migrated. Upgrade every `@gate-forge/*` package to `0.10.0` together. |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gate-forge/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"gateforgeCompatibility": {
|
|
5
5
|
"supervisedFixtureProtocol": "gateforge.supervised-playwright.v1"
|
|
6
6
|
},
|
|
@@ -31,15 +31,15 @@
|
|
|
31
31
|
"test": "vitest run"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@gate-forge/core": "^0.
|
|
35
|
-
"@gate-forge/http-contract": "^0.
|
|
36
|
-
"@gate-forge/pack-fastapi": "^0.
|
|
37
|
-
"@gate-forge/pack-alembic": "^0.
|
|
38
|
-
"@gate-forge/pack-http": "^0.
|
|
39
|
-
"@gate-forge/pack-playwright": "^0.
|
|
40
|
-
"@gate-forge/pack-sqlalchemy": "^0.
|
|
41
|
-
"@gate-forge/pack-task": "^0.
|
|
42
|
-
"@gate-forge/plugin-protocol": "^0.
|
|
34
|
+
"@gate-forge/core": "^0.10.0",
|
|
35
|
+
"@gate-forge/http-contract": "^0.10.0",
|
|
36
|
+
"@gate-forge/pack-fastapi": "^0.10.0",
|
|
37
|
+
"@gate-forge/pack-alembic": "^0.10.0",
|
|
38
|
+
"@gate-forge/pack-http": "^0.10.0",
|
|
39
|
+
"@gate-forge/pack-playwright": "^0.10.0",
|
|
40
|
+
"@gate-forge/pack-sqlalchemy": "^0.10.0",
|
|
41
|
+
"@gate-forge/pack-task": "^0.10.0",
|
|
42
|
+
"@gate-forge/plugin-protocol": "^0.10.0",
|
|
43
43
|
"picomatch": "^4.0.7",
|
|
44
44
|
"yaml": "^2.8.1"
|
|
45
45
|
},
|