@gate-forge/cli 0.11.0 → 0.12.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 +41 -0
- package/README.md +2 -0
- package/dist/args.d.ts.map +1 -1
- package/dist/args.js +1 -0
- package/dist/args.js.map +1 -1
- package/dist/business-rules.d.ts +223 -0
- package/dist/business-rules.d.ts.map +1 -0
- package/dist/business-rules.js +383 -0
- package/dist/business-rules.js.map +1 -0
- package/dist/candidate-tree.d.ts.map +1 -1
- package/dist/candidate-tree.js +7 -0
- package/dist/candidate-tree.js.map +1 -1
- package/dist/commands/check.d.ts.map +1 -1
- package/dist/commands/check.js +96 -18
- package/dist/commands/check.js.map +1 -1
- package/dist/commands/enforcement.d.ts.map +1 -1
- package/dist/commands/enforcement.js +5 -11
- package/dist/commands/enforcement.js.map +1 -1
- package/dist/commands/init.d.ts +3 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +39 -3
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/next.d.ts.map +1 -1
- package/dist/commands/next.js +55 -1
- package/dist/commands/next.js.map +1 -1
- package/dist/commands/pre-commit.d.ts.map +1 -1
- package/dist/commands/pre-commit.js +5 -8
- package/dist/commands/pre-commit.js.map +1 -1
- package/dist/commands/test-gates.d.ts.map +1 -1
- package/dist/commands/test-gates.js +62 -5
- package/dist/commands/test-gates.js.map +1 -1
- package/dist/commands/tests.d.ts +1 -1
- package/dist/commands/tests.d.ts.map +1 -1
- package/dist/commands/tests.js +101 -11
- package/dist/commands/tests.js.map +1 -1
- package/dist/evaluate.d.ts +16 -0
- package/dist/evaluate.d.ts.map +1 -1
- package/dist/evaluate.js +26 -2
- package/dist/evaluate.js.map +1 -1
- package/dist/execution.d.ts.map +1 -1
- package/dist/execution.js +10 -2
- package/dist/execution.js.map +1 -1
- package/dist/input-snapshot.d.ts.map +1 -1
- package/dist/input-snapshot.js +17 -7
- package/dist/input-snapshot.js.map +1 -1
- package/dist/mapping.d.ts +10 -1
- package/dist/mapping.d.ts.map +1 -1
- package/dist/mapping.js +5 -0
- package/dist/mapping.js.map +1 -1
- package/dist/pipeline.d.ts +9 -1
- package/dist/pipeline.d.ts.map +1 -1
- package/dist/pipeline.js +1 -0
- package/dist/pipeline.js.map +1 -1
- package/dist/run-cache.d.ts +2 -0
- package/dist/run-cache.d.ts.map +1 -1
- package/dist/run-cache.js +4 -2
- package/dist/run-cache.js.map +1 -1
- package/dist/staged-candidate.d.ts +1 -36
- package/dist/staged-candidate.d.ts.map +1 -1
- package/dist/staged-candidate.js +0 -47
- package/dist/staged-candidate.js.map +1 -1
- package/guides/QUICKSTART.md +20 -7
- package/guides/REFERENCE.md +62 -0
- package/package.json +10 -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.
|
|
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.12.0 \
|
|
28
|
+
@gate-forge/pack-playwright@0.12.0 \
|
|
29
|
+
@gate-forge/pack-http@0.12.0 \
|
|
30
|
+
@gate-forge/pack-fastapi@0.12.0 \
|
|
31
|
+
@gate-forge/pack-sqlalchemy@0.12.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.12.0`, then install again. Do not work around the compatibility error.
|
|
53
53
|
|
|
54
54
|
## 2. Pick a goal
|
|
55
55
|
|
|
@@ -216,6 +216,19 @@ gateforge tests mark \
|
|
|
216
216
|
|
|
217
217
|
**If not:** rerun discovery, copy the exact test key and obligation ID, and resolve any mapping contradiction. Do not use a declaration to silence a blocker.
|
|
218
218
|
|
|
219
|
+
### Write your rules down
|
|
220
|
+
|
|
221
|
+
Product statements the owner wants proved — "an invoice can only be
|
|
222
|
+
cancelled while it is unpaid" — live in the `rules:` section of
|
|
223
|
+
`.gateforge/classification-policy.yml` (`gateforge init --rules` adds a
|
|
224
|
+
commented example). Each rule names the test type that must prove it
|
|
225
|
+
(`e2e` by default), and each case is mapped like a claim above, with
|
|
226
|
+
`gateforge tests mark --rule <ruleId>/<caseId> …`. A mapping alone is a
|
|
227
|
+
declaration: the case is satisfied only when its mapped test ran in a
|
|
228
|
+
sealed supervised run, passed, and delivered the type's proof. See
|
|
229
|
+
[Business rules](REFERENCE.md#business-rules-the-rules-section) in the
|
|
230
|
+
REFERENCE for the type table and the honest scope of the proof.
|
|
231
|
+
|
|
219
232
|
## 6. Prepare a verifier key and the app
|
|
220
233
|
|
|
221
234
|
Keep the key outside the repository and run-state folder:
|
|
@@ -445,7 +458,7 @@ the registry. To gate a release that is not on the registry yet (a local
|
|
|
445
458
|
regenerate:
|
|
446
459
|
|
|
447
460
|
```sh
|
|
448
|
-
GATEFORGE_CI_ENGINE_SOURCE=vendor/gate-forge-cli-0.
|
|
461
|
+
GATEFORGE_CI_ENGINE_SOURCE=vendor/gate-forge-cli-0.12.0.tgz \
|
|
449
462
|
gateforge enforce --ci github
|
|
450
463
|
```
|
|
451
464
|
|
package/guides/REFERENCE.md
CHANGED
|
@@ -1143,6 +1143,7 @@ pin before strict gates run.
|
|
|
1143
1143
|
| `deleteRules` | how removal manifests, per source glob (a RESOURCE's own answer) | `match` glob + `semantics` (+ `archiveFields`) |
|
|
1144
1144
|
| `planes` | the plane of a source tree or table set (see [below](#endpoint-plane-rules-the-planes-section)) | `rules[]` of `match`/`tables` + `plane` + `reason` |
|
|
1145
1145
|
| `endpoints` | capabilities detector facts cannot see (see [below](#endpoint-capability-rules-the-endpoints-section)) | `rules[]` of selectors + `capability` + `reason` |
|
|
1146
|
+
| `rules` | business rules a named test type must prove (see [below](#business-rules-the-rules-section)) | `rules[]` of id + title + cases + `test` + `enforcement` |
|
|
1146
1147
|
| `coverage` | which detector must examine which files before a proof counts | capability + detector + globs (+ `exhaustive`) |
|
|
1147
1148
|
|
|
1148
1149
|
Since 0.11.0 this document holds ONLY answers. The four scanner settings
|
|
@@ -1156,6 +1157,67 @@ Unknown keys, an unknown value, and two rules answering the same target
|
|
|
1156
1157
|
are refused (exit 2, fail closed) — the document is an input, never a
|
|
1157
1158
|
place to smuggle intent past the schema.
|
|
1158
1159
|
|
|
1160
|
+
## Business rules (the `rules:` section)
|
|
1161
|
+
|
|
1162
|
+
Owner-declared statements about the product — "an invoice can only be
|
|
1163
|
+
cancelled while it is unpaid" — that a test of a NAMED type must prove in
|
|
1164
|
+
a sealed supervised run (0.12.0). The section lives in the answers
|
|
1165
|
+
document, so it is owner-pinned: adding, weakening, deleting a rule, or
|
|
1166
|
+
making it advisory changes the trusted-policy digest and re-approves the
|
|
1167
|
+
pin. A repository without a `rules:` section is byte-identical to a
|
|
1168
|
+
release without the feature.
|
|
1169
|
+
|
|
1170
|
+
```yaml
|
|
1171
|
+
rules:
|
|
1172
|
+
- id: invoice-cancel-only-unpaid
|
|
1173
|
+
title: An invoice can only be cancelled while it is unpaid
|
|
1174
|
+
subject: invoices # optional; must exist in the inventory (unknown -> exit 2)
|
|
1175
|
+
test: e2e # e2e (default) | pytest
|
|
1176
|
+
enforcement: block # block (default) | advisory (+ required advisoryReason)
|
|
1177
|
+
cases:
|
|
1178
|
+
- id: unpaid-can-cancel
|
|
1179
|
+
describe: Cancelling an unpaid invoice succeeds and it shows as cancelled
|
|
1180
|
+
- id: paid-cannot-cancel
|
|
1181
|
+
describe: Cancelling a paid invoice is refused and it stays paid
|
|
1182
|
+
```
|
|
1183
|
+
|
|
1184
|
+
A rule's CASES are its observable consequences (usually a positive and a
|
|
1185
|
+
negative side; a rule without `cases:` has one implicit `default` case).
|
|
1186
|
+
A case is mapped by the claim id `business-rule:<ruleId>/<caseId>` — the
|
|
1187
|
+
same sidecar (`tests mark --rule <ruleId>/<caseId> --test <key> --kind
|
|
1188
|
+
<kind> --reason "…"`) and the same resolver as obligations, so stale,
|
|
1189
|
+
ambiguous, quarantined and inferred-only declarations behave exactly as
|
|
1190
|
+
they do there.
|
|
1191
|
+
|
|
1192
|
+
**A declaration is never proof.** The type table decides what proof each
|
|
1193
|
+
mapped test owes, and every mapped test of a case must deliver it — a red
|
|
1194
|
+
test is never forgiven by a green sibling, a mocked spec never proves an
|
|
1195
|
+
end-to-end rule, and a test the run's graded slice did not select is
|
|
1196
|
+
reported `unproven`, never satisfied and never silently absent.
|
|
1197
|
+
|
|
1198
|
+
| `test:` | Accepted kinds / runner | Required proof per mapped test |
|
|
1199
|
+
| --- | --- | --- |
|
|
1200
|
+
| `e2e` (default) | `browser-e2e`, `observed-e2e` (runner playwright) | Executed in the sealed supervised run, passed, AND witness evidence attributable to that test's own session: an engine `ui.action` anchor (browser-e2e) or a witnessed `http.request` exchange of its session (observed-e2e). The channel is named in the output (`engine` / `observe`). |
|
|
1201
|
+
| `pytest` | `unit`, `integration`, `server-e2e` (runner pytest) | Executed inside the WITNESSED pytest suite of the sealed run and passed (channel `execution`). Not run, or the suite not declared `witnessed`, stays `unproven` — no weaker labelled proof. |
|
|
1202
|
+
|
|
1203
|
+
Case statuses, in the evaluator's own words: `unmapped`
|
|
1204
|
+
(`BUSINESS_RULE_TEST_MISSING`), `wrong-type`
|
|
1205
|
+
(`BUSINESS_RULE_TEST_TYPE_MISMATCH` — a weaker kind never satisfies a
|
|
1206
|
+
stronger type), `failing` (`BUSINESS_RULE_TEST_FAILING`), `unproven`
|
|
1207
|
+
(`BUSINESS_RULE_TEST_UNPROVEN` — no sealed run, test not executed,
|
|
1208
|
+
outside the graded slice, or missing the type's proof), and `satisfied`
|
|
1209
|
+
with the proof channel. Findings are run-wide — never diff-scoped away —
|
|
1210
|
+
and an `enforcement: advisory` rule's findings ride the report's advisory
|
|
1211
|
+
channel every run, out of `blocking` and out of the exit code.
|
|
1212
|
+
|
|
1213
|
+
**Honest scope of the proof.** Gateforge proves the named test exists,
|
|
1214
|
+
ran under supervision, passed, and (e2e) exercised the real app through
|
|
1215
|
+
the witness. It does NOT prove the test asserts the rule's meaning: the
|
|
1216
|
+
mapping's `reason` carries that claim, the owner reviews it, and the
|
|
1217
|
+
output always names which of these was proven. `gateforge next` prints a
|
|
1218
|
+
starter test and the exact mark command per missing case; `init --rules`
|
|
1219
|
+
adds a commented example to the answers document.
|
|
1220
|
+
|
|
1159
1221
|
## Scanner settings (`.gateforge.yml` `scan:`)
|
|
1160
1222
|
|
|
1161
1223
|
The machine-wide settings that decide what a closed-world proof may claim.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gate-forge/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"gateforgeCompatibility": {
|
|
5
5
|
"supervisedFixtureProtocol": "gateforge.supervised-playwright.v1"
|
|
6
6
|
},
|
|
@@ -33,15 +33,15 @@
|
|
|
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-playwright": "^0.
|
|
42
|
-
"@gate-forge/pack-sqlalchemy": "^0.
|
|
43
|
-
"@gate-forge/pack-task": "^0.
|
|
44
|
-
"@gate-forge/plugin-protocol": "^0.
|
|
36
|
+
"@gate-forge/core": "^0.12.0",
|
|
37
|
+
"@gate-forge/http-contract": "^0.12.0",
|
|
38
|
+
"@gate-forge/pack-fastapi": "^0.12.0",
|
|
39
|
+
"@gate-forge/pack-alembic": "^0.12.0",
|
|
40
|
+
"@gate-forge/pack-http": "^0.12.0",
|
|
41
|
+
"@gate-forge/pack-playwright": "^0.12.0",
|
|
42
|
+
"@gate-forge/pack-sqlalchemy": "^0.12.0",
|
|
43
|
+
"@gate-forge/pack-task": "^0.12.0",
|
|
44
|
+
"@gate-forge/plugin-protocol": "^0.12.0",
|
|
45
45
|
"picomatch": "^4.0.7",
|
|
46
46
|
"yaml": "^2.8.1"
|
|
47
47
|
},
|