@gate-forge/cli 0.9.0 → 0.9.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/README.md +10 -5
- 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/enforcement.d.ts.map +1 -1
- package/dist/commands/enforcement.js +184 -7
- package/dist/commands/enforcement.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +208 -37
- package/dist/commands/init.js.map +1 -1
- 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.js +7 -0
- package/dist/commands/tests.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 +130 -9
- 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/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 +15 -0
- package/guides/QUICKSTART.md +33 -13
- package/guides/REFERENCE.md +50 -4
- package/guides/UPGRADE-0.8-to-0.9.md +9 -1
- package/package.json +10 -10
package/dist/trusted-policy.js
CHANGED
|
@@ -188,7 +188,8 @@ export function assertApprovedPolicy(candidateDigest, input) {
|
|
|
188
188
|
ok: false,
|
|
189
189
|
cause: 'ENFORCEMENT_UNTRUSTED',
|
|
190
190
|
detail: 'no owner-approved policy digest is provisioned, so strict enforcement cannot verify who owns the ' +
|
|
191
|
-
"candidate's policy revision — a weakened candidate could otherwise approve its own weaker checks (fail closed)"
|
|
191
|
+
"candidate's policy revision — a weakened candidate could otherwise approve its own weaker checks (fail closed)" +
|
|
192
|
+
' — read the value with `gateforge enforcement doctor`',
|
|
192
193
|
nextAction: PROVISION_PIN_NEXT_ACTION,
|
|
193
194
|
};
|
|
194
195
|
}
|
|
@@ -197,7 +198,7 @@ export function assertApprovedPolicy(candidateDigest, input) {
|
|
|
197
198
|
return {
|
|
198
199
|
ok: false,
|
|
199
200
|
cause: 'ENFORCEMENT_UNTRUSTED',
|
|
200
|
-
detail: `candidate policy digest does not match the owner-approved revision: ${weakening.reason}`,
|
|
201
|
+
detail: `candidate policy digest does not match the owner-approved revision: ${weakening.reason} (candidate ${candidateDigest}, approved ${input.approved})`,
|
|
201
202
|
nextAction: WEAKENED_POLICY_NEXT_ACTION,
|
|
202
203
|
};
|
|
203
204
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trusted-policy.js","sourceRoot":"","sources":["../src/trusted-policy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,uBA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IACD,IAAI,UAAU,CAAC,MAAM,KAAK,IAAI,EAAE,CAAC;QAC/B,OAAO,CACL,qFAAqF;YACrF,GAAG,0BAA0B,sDAAsD,CACpF,CAAC;IACJ,CAAC;IACD,OAAO,mCAAmC,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,SAAS,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;AACnH,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,SAAS,QAAQ,CAAC,SAAiB,EAAE,IAAY;IAC/C,MAAM,GAAG,GAAG,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IACtC,OAAO,GAAG,KAAK,EAAE,IAAI,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,GAAG,EAAE,CAAC,IAAI,GAAG,KAAK,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;AACzF,CAAC"}
|
|
@@ -10,6 +10,21 @@ ONE next action.
|
|
|
10
10
|
|
|
11
11
|
---
|
|
12
12
|
|
|
13
|
+
## The setup order
|
|
14
|
+
|
|
15
|
+
`gateforge init` → answer the plane questions → `gateforge adopt` (only when the repository already has code) → adapters and runtime → pin the owner-approved policy digest → commit. Each step assumes the previous one ran.
|
|
16
|
+
- Install the CLI and packs, then commit the install (package.json + lockfile) on its own before `gateforge init` — no gate is wired yet. The setup commit must contain only Gateforge's own files (plus the `.gitignore` block init writes) to count as product-behavior-neutral; mixing in dependency or product changes makes it a normal gated change, which under strictE2E re-grades the adopted E2E debt as blocking. Commit product changes (for example a Playwright config rename) separately, after the setup commit.
|
|
17
|
+
|
|
18
|
+
- **Answer the plane questions** with `gateforge classify plane <folder> <tenant|master|global> --reason "<why>" --confirm` (run `gateforge init --planes` once first to create the owner-reviewed `.gateforge/planes.json`). The three planes:
|
|
19
|
+
- **tenant** — the data of one customer or organisation, e.g. a per-customer database or rows scoped by a customer id.
|
|
20
|
+
- **master** — the platform's own administrative data, shared by the operator, e.g. the admin platform's database of customers and plans.
|
|
21
|
+
- **global** — reference data that is the same for everyone, e.g. currencies.
|
|
22
|
+
|
|
23
|
+
An infrastructure route that serves no business data (health, readiness, metrics): Gateforge already classifies health and readiness probes as `global` itself. Do not cover a file that holds such probes with a `tenant` or `master` rule — the two answers contradict (`PLANE_CONTRADICTION`). If no route in the folder serves business data (`gateforge explain <endpoint>` shows `linkedResource: <none>`), answer `global` for it; if business routes share one router file with the probes, move the probes to their own router file. A file that is not part of the product: exclude it with `project.paths.exclude` in `.gateforge.yml`.
|
|
24
|
+
- **`gateforge adopt` comes after the plane answers** because a plane answer changes a resource's identity, so the debt set `adopt` records would not match the repository if it were captured before the answer.
|
|
25
|
+
- **Declare the dependency directories the staged commit gate may link** (`prepare: { reuse: [node_modules] }` in `.gateforge/runtime.yml`): the gate runs on a checkout of the staged files only.
|
|
26
|
+
- **Pin the owner-approved policy digest LAST**, right before the first strict commit: read the full value from `gateforge enforcement doctor` and set it as `GATEFORGE_APPROVED_POLICY_DIGEST`. It changes whenever a policy input changes — `.gateforge.yml`, the policies, the classification policy, `planes.json`, adapters, `runtime.yml`, waivers, hooks — so re-pin after every such edit. Stage every policy file first (`git add`) — the commit gate digests the staged bytes, and `enforcement doctor` warns when they differ from the working tree.
|
|
27
|
+
|
|
13
28
|
## 1. What you need
|
|
14
29
|
|
|
15
30
|
| Your stack | Detector pack (installed by `init`) | Runner | What you write |
|
package/guides/QUICKSTART.md
CHANGED
|
@@ -6,6 +6,16 @@ This guide takes a project from install to a blocking gate. Gateforge does not c
|
|
|
6
6
|
|
|
7
7
|
You need Node.js 20 or newer and an existing Playwright suite that can run against a disposable app.
|
|
8
8
|
|
|
9
|
+
## The setup order
|
|
10
|
+
|
|
11
|
+
`gateforge init` → answer the plane questions → `gateforge adopt` (only when the repository already has code) → adapters and runtime → pin the owner-approved policy digest → commit.
|
|
12
|
+
|
|
13
|
+
- Install the CLI and packs, then commit the install (package.json + lockfile) on its own before `gateforge init` — no gate is wired yet. The setup commit must contain only Gateforge's own files (plus the `.gitignore` block init writes) to count as product-behavior-neutral; mixing in dependency or product changes makes it a normal gated change, which under strictE2E re-grades the adopted E2E debt as blocking. Commit product changes (for example a Playwright config rename) separately, after the setup commit.
|
|
14
|
+
- Answer the plane questions with `gateforge classify plane <folder> <tenant|master|global> --reason "<why>" --confirm` (run `gateforge init --planes` once first to create the owner-reviewed `.gateforge/planes.json`).
|
|
15
|
+
- Adopt comes after the plane answers because a plane answer changes a resource's identity, so the debt set `adopt` records would not match the repository if it were captured before the answer.
|
|
16
|
+
- Declare the dependency directories the staged commit gate may link (`prepare: { reuse: [node_modules] }` in `.gateforge/runtime.yml`): the gate runs on a checkout of the staged files only.
|
|
17
|
+
- Pin the owner-approved policy digest LAST, right before the first strict commit: read the full value from `gateforge enforcement doctor` and set it as `GATEFORGE_APPROVED_POLICY_DIGEST`. It changes whenever a policy input changes — `.gateforge.yml`, the policies, the classification policy, `planes.json`, adapters, `runtime.yml`, waivers, hooks — so re-pin after every such edit. Stage every policy file first (`git add`) — the commit gate digests the staged bytes, and `enforcement doctor` warns when they differ from the working tree.
|
|
18
|
+
|
|
9
19
|
## 1. Install the CLI and the packs you use
|
|
10
20
|
|
|
11
21
|
Install the CLI, Playwright pack, and only the detector packs that fit your app. Keep every direct `@gate-forge/*` package on the same release.
|
|
@@ -14,11 +24,11 @@ Example for a React frontend, FastAPI backend, and SQLAlchemy data layer:
|
|
|
14
24
|
|
|
15
25
|
```sh
|
|
16
26
|
npm i -D \
|
|
17
|
-
@gate-forge/cli@0.9.
|
|
18
|
-
@gate-forge/pack-playwright@0.9.
|
|
19
|
-
@gate-forge/pack-http@0.9.
|
|
20
|
-
@gate-forge/pack-fastapi@0.9.
|
|
21
|
-
@gate-forge/pack-sqlalchemy@0.9.
|
|
27
|
+
@gate-forge/cli@0.9.1 \
|
|
28
|
+
@gate-forge/pack-playwright@0.9.1 \
|
|
29
|
+
@gate-forge/pack-http@0.9.1 \
|
|
30
|
+
@gate-forge/pack-fastapi@0.9.1 \
|
|
31
|
+
@gate-forge/pack-sqlalchemy@0.9.1
|
|
22
32
|
```
|
|
23
33
|
|
|
24
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`.
|
|
@@ -33,7 +43,7 @@ This installs every pack of the release; the scan still recommends the ones your
|
|
|
33
43
|
|
|
34
44
|
**You should see:** npm installs the packages without a Gateforge compatibility error.
|
|
35
45
|
|
|
36
|
-
**If not:** align every direct `@gate-forge/*` package to `0.9.
|
|
46
|
+
**If not:** align every direct `@gate-forge/*` package to `0.9.1`, then install again. Do not work around the compatibility error.
|
|
37
47
|
|
|
38
48
|
## 2. Pick a goal
|
|
39
49
|
|
|
@@ -258,7 +268,15 @@ gateforge next
|
|
|
258
268
|
Follow its `do:` line, then run the check again. See [Test environment](TEST-ENVIRONMENT.md) if the block is caused by setup or test state.
|
|
259
269
|
|
|
260
270
|
The first real `next` on a FastAPI repository asks which data plane owns a
|
|
261
|
-
route's records.
|
|
271
|
+
route's records. The three planes:
|
|
272
|
+
|
|
273
|
+
- **tenant** — the data of one customer or organisation, e.g. a per-customer database or rows scoped by a customer id.
|
|
274
|
+
- **master** — the platform's own administrative data, shared by the operator, e.g. the admin platform's database of customers and plans.
|
|
275
|
+
- **global** — reference data that is the same for everyone, e.g. currencies.
|
|
276
|
+
|
|
277
|
+
An infrastructure route that serves no business data (health, readiness, metrics): Gateforge already classifies health and readiness probes as `global` itself. Do not cover a file that holds such probes with a `tenant` or `master` rule — the two answers contradict (`PLANE_CONTRADICTION`). If no route in the folder serves business data (`gateforge explain <endpoint>` shows `linkedResource: <none>`), answer `global` for it; if business routes share one router file with the probes, move the probes to their own router file. A file that is not part of the product: exclude it with `project.paths.exclude` in `.gateforge.yml`.
|
|
278
|
+
|
|
279
|
+
That is an owner decision, so Gateforge explains the
|
|
262
280
|
question before asking it and prints one runnable command per answer. For
|
|
263
281
|
`DELETE /items/{}` on tenant-scoped records, the answer is `tenant`:
|
|
264
282
|
|
|
@@ -376,7 +394,7 @@ the registry. To gate a release that is not on the registry yet (a local
|
|
|
376
394
|
regenerate:
|
|
377
395
|
|
|
378
396
|
```sh
|
|
379
|
-
GATEFORGE_CI_ENGINE_SOURCE=vendor/gate-forge-cli-0.9.
|
|
397
|
+
GATEFORGE_CI_ENGINE_SOURCE=vendor/gate-forge-cli-0.9.1.tgz \
|
|
380
398
|
gateforge enforce --ci github
|
|
381
399
|
```
|
|
382
400
|
|
|
@@ -387,12 +405,14 @@ GitLab template needs no variable: it installs the repository's own declared
|
|
|
387
405
|
`@gate-forge/cli` dependency.
|
|
388
406
|
|
|
389
407
|
If your repository already had a `.pre-commit-config.yaml`, the wiring
|
|
390
|
-
|
|
408
|
+
inserts the `gateforge-check` entry as the FIRST item of the `repos:`
|
|
409
|
+
list and says so on one line, with the exact way back
|
|
391
410
|
(`undo: git restore -- .pre-commit-config.yaml`). Check that line before
|
|
392
|
-
you commit
|
|
393
|
-
|
|
394
|
-
`
|
|
395
|
-
|
|
411
|
+
you commit — hooks that rewrite files must not run before the gate, or
|
|
412
|
+
they invalidate its receipt; `enforcement doctor` reports such hooks as
|
|
413
|
+
`hook-mutation` and names those files. (A config with no block-style
|
|
414
|
+
`repos:` list — e.g. `repos: []` — is appended as before, with a note
|
|
415
|
+
to move the entry to the top yourself.)
|
|
396
416
|
|
|
397
417
|
**You should see:** `installed:`, `updated:`, `verified:`, or a framework-managed hook message, followed by `blocking gate wired`.
|
|
398
418
|
|
package/guides/REFERENCE.md
CHANGED
|
@@ -212,6 +212,32 @@ security-sensitive: its bytes are hashed into the trusted policy digest and
|
|
|
212
212
|
the authenticated input snapshot, so a candidate that edits its own runtime
|
|
213
213
|
commands cannot approve the edit in the same commit.
|
|
214
214
|
|
|
215
|
+
ONE document, TWO independent key groups that may coexist:
|
|
216
|
+
`schemaVersion`, `prepare`, `health`, `services`, `envAllowlist`,
|
|
217
|
+
and `executionTimeoutSeconds` are read by the staged/supervised
|
|
218
|
+
runtime — `check --staged` and `test-gates` (see
|
|
219
|
+
`packages/cli/src/runtime.ts`), where `check --staged` reads
|
|
220
|
+
`prepare` (its `command`, `reuse`, `timeoutSeconds`, and
|
|
221
|
+
`preflight` sub-keys) — while `env_files`, `reset`, `seed`,
|
|
222
|
+
`services_up`, `healthcheck`, and `services_down` are the
|
|
223
|
+
`gateforge run` recipe (see `packages/cli/src/run-recipe.ts`),
|
|
224
|
+
which also reads `prepare` (its `commands`, `runTimeoutSeconds`,
|
|
225
|
+
and `runRetries` sub-keys). Neither group requires the other: a
|
|
226
|
+
document may carry both, one, or none of the staged keys. Minimal
|
|
227
|
+
combined example:
|
|
228
|
+
|
|
229
|
+
```yaml
|
|
230
|
+
schemaVersion: 1
|
|
231
|
+
prepare:
|
|
232
|
+
command: npm ci --offline # staged runtime (check --staged / test-gates)
|
|
233
|
+
commands: [['npm', 'run', 'build']] # gateforge run recipe step
|
|
234
|
+
envAllowlist: [DATABASE_URL]
|
|
235
|
+
executionTimeoutSeconds: 1800
|
|
236
|
+
env_files: [.gateforge/test.env]
|
|
237
|
+
reset: { commands: [['./scripts/reset-db.sh']] }
|
|
238
|
+
services_up: { commands: [['./scripts/start-stack.sh']] }
|
|
239
|
+
```
|
|
240
|
+
|
|
215
241
|
```yaml
|
|
216
242
|
schemaVersion: 1
|
|
217
243
|
prepare:
|
|
@@ -1383,10 +1409,15 @@ expected context, every witnessed record demotes to claimed-tier
|
|
|
1383
1409
|
- Staged candidates containing symlinks or submodules (and unmerged index
|
|
1384
1410
|
entries) are typed blocks in `check --staged` and `broker commit` —
|
|
1385
1411
|
explicit, never fallbacks; support is not implemented.
|
|
1386
|
-
- A Playwright config with NO named project
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1412
|
+
- A Playwright config with NO named project: `tests discover` prints an
|
|
1413
|
+
error line naming the config and the fix
|
|
1414
|
+
(`projects: [{ name: 'chromium' }]`) and still writes the catalog, and
|
|
1415
|
+
`enforcement doctor` fails the `playwright-projects` row — `test-gates`
|
|
1416
|
+
needs a named project.
|
|
1417
|
+
- Gateforge reads the FIRST of `playwright.config.{ts,mts,cts,js,mjs,cjs}`
|
|
1418
|
+
at the repository root; a suffixed config such as
|
|
1419
|
+
`playwright.config.e2e.js` is not read — rename it to
|
|
1420
|
+
`playwright.config.js` if it is the suite to prove.
|
|
1390
1421
|
- Run-state hygiene is enforced, not forgiven: a committed run-state
|
|
1391
1422
|
directory (it overlaps source inputs) or config include globs that omit
|
|
1392
1423
|
the spec directories produce fail-closed diagnostics — gitignore
|
|
@@ -1658,6 +1689,21 @@ services_down:
|
|
|
1658
1689
|
commands: [['./scripts/stop-stack.sh']]
|
|
1659
1690
|
```
|
|
1660
1691
|
|
|
1692
|
+
The recipe shares `.gateforge/runtime.yml` with the
|
|
1693
|
+
staged/supervised runtime: it is ONE document with TWO
|
|
1694
|
+
independent key groups that may coexist. `env_files`, `reset`,
|
|
1695
|
+
`seed`, `services_up`, `healthcheck`, and `services_down` are
|
|
1696
|
+
read only by `gateforge run` (see
|
|
1697
|
+
`packages/cli/src/run-recipe.ts`, which also reads `prepare`
|
|
1698
|
+
— its `commands`, `runTimeoutSeconds`, and `runRetries`
|
|
1699
|
+
sub-keys), while `schemaVersion`, `prepare`, `health`,
|
|
1700
|
+
`services`, `envAllowlist`, and `executionTimeoutSeconds`
|
|
1701
|
+
belong to the staged/supervised runtime (`check --staged` and
|
|
1702
|
+
`test-gates`; see `packages/cli/src/runtime.ts`, where
|
|
1703
|
+
`check --staged` reads `prepare`'s `command`, `reuse`,
|
|
1704
|
+
`timeoutSeconds`, and `preflight` sub-keys). Both groups may
|
|
1705
|
+
live in the same document; neither enables the other.
|
|
1706
|
+
|
|
1661
1707
|
An unknown key, a malformed step, or an inline value in `env_files` is a
|
|
1662
1708
|
plain error with exit 2 — Gateforge never runs a half-understood recipe. See
|
|
1663
1709
|
the [test environment guide](TEST-ENVIRONMENT.md) for the
|
|
@@ -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.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gate-forge/cli",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.1",
|
|
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.9.
|
|
35
|
-
"@gate-forge/http-contract": "^0.9.
|
|
36
|
-
"@gate-forge/pack-fastapi": "^0.9.
|
|
37
|
-
"@gate-forge/pack-alembic": "^0.9.
|
|
38
|
-
"@gate-forge/pack-http": "^0.9.
|
|
39
|
-
"@gate-forge/pack-playwright": "^0.9.
|
|
40
|
-
"@gate-forge/pack-sqlalchemy": "^0.9.
|
|
41
|
-
"@gate-forge/pack-task": "^0.9.
|
|
42
|
-
"@gate-forge/plugin-protocol": "^0.9.
|
|
34
|
+
"@gate-forge/core": "^0.9.1",
|
|
35
|
+
"@gate-forge/http-contract": "^0.9.1",
|
|
36
|
+
"@gate-forge/pack-fastapi": "^0.9.1",
|
|
37
|
+
"@gate-forge/pack-alembic": "^0.9.1",
|
|
38
|
+
"@gate-forge/pack-http": "^0.9.1",
|
|
39
|
+
"@gate-forge/pack-playwright": "^0.9.1",
|
|
40
|
+
"@gate-forge/pack-sqlalchemy": "^0.9.1",
|
|
41
|
+
"@gate-forge/pack-task": "^0.9.1",
|
|
42
|
+
"@gate-forge/plugin-protocol": "^0.9.1",
|
|
43
43
|
"picomatch": "^4.0.7",
|
|
44
44
|
"yaml": "^2.8.1"
|
|
45
45
|
},
|