@gate-forge/cli 0.12.0 → 0.13.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.
Files changed (49) hide show
  1. package/CHANGELOG.md +164 -0
  2. package/README.md +9 -1
  3. package/dist/adopted-baseline.d.ts.map +1 -1
  4. package/dist/adopted-baseline.js +13 -0
  5. package/dist/adopted-baseline.js.map +1 -1
  6. package/dist/cli.d.ts +1 -1
  7. package/dist/cli.d.ts.map +1 -1
  8. package/dist/cli.js +5 -2
  9. package/dist/cli.js.map +1 -1
  10. package/dist/commands/adopt.d.ts +5 -3
  11. package/dist/commands/adopt.d.ts.map +1 -1
  12. package/dist/commands/adopt.js +338 -5
  13. package/dist/commands/adopt.js.map +1 -1
  14. package/dist/commands/baseline.d.ts.map +1 -1
  15. package/dist/commands/baseline.js +60 -24
  16. package/dist/commands/baseline.js.map +1 -1
  17. package/dist/commands/explain.d.ts.map +1 -1
  18. package/dist/commands/explain.js +67 -2
  19. package/dist/commands/explain.js.map +1 -1
  20. package/dist/commands/init.d.ts.map +1 -1
  21. package/dist/commands/init.js +57 -1
  22. package/dist/commands/init.js.map +1 -1
  23. package/dist/commands/next.d.ts.map +1 -1
  24. package/dist/commands/next.js +41 -4
  25. package/dist/commands/next.js.map +1 -1
  26. package/dist/commands/test-gates.d.ts.map +1 -1
  27. package/dist/commands/test-gates.js +184 -8
  28. package/dist/commands/test-gates.js.map +1 -1
  29. package/dist/detector-trust.d.ts.map +1 -1
  30. package/dist/detector-trust.js +2 -0
  31. package/dist/detector-trust.js.map +1 -1
  32. package/dist/execution.d.ts +6 -5
  33. package/dist/execution.d.ts.map +1 -1
  34. package/dist/execution.js +16 -0
  35. package/dist/execution.js.map +1 -1
  36. package/dist/page-obligations.d.ts +21 -0
  37. package/dist/page-obligations.d.ts.map +1 -0
  38. package/dist/page-obligations.js +123 -0
  39. package/dist/page-obligations.js.map +1 -0
  40. package/dist/pipeline.d.ts.map +1 -1
  41. package/dist/pipeline.js +9 -0
  42. package/dist/pipeline.js.map +1 -1
  43. package/dist/route-plane-proposals.d.ts.map +1 -1
  44. package/dist/route-plane-proposals.js +1 -0
  45. package/dist/route-plane-proposals.js.map +1 -1
  46. package/guides/CONNECT-YOUR-PROJECT.md +38 -0
  47. package/guides/QUICKSTART.md +33 -7
  48. package/guides/REFERENCE.md +182 -3
  49. package/package.json +11 -10
package/CHANGELOG.md CHANGED
@@ -1,5 +1,169 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.13.0
4
+
5
+ - **Pages-family adoption for already-adopted repositories (0.13.0).**
6
+ `gateforge adopt --family pages` revises an ALREADY-adopted repository —
7
+ the one owner-approved exception to the one-bulk-add invariant, scoped to
8
+ a named family. Preview by default (nothing written); `--confirm` performs
9
+ ONE atomic write to the existing `.gateforge/baselines/adoption.json`: a
10
+ dated, commit-referenced `families.pages` marker recording EVERY page
11
+ obligation discovered at that moment (proven pages included), with only
12
+ the then-missing/unproven page fingerprints marked `forgiven`. Receipt
13
+ writes are validated and then atomic (same-directory temporary file +
14
+ rename): a failed or interrupted write leaves the previous receipt
15
+ intact, never a truncated one. The
16
+ baseline document is never touched — the evaluator forgives the family's
17
+ `forgiven` set from the receipt alone, so no crash window can expose
18
+ unrecorded forgiveness (a union baseline would have been forgiven by the
19
+ OLD receipt before the new record existed). The marker is permanent: a
20
+ repeat records nothing, a page route discovered after the migration is
21
+ new work to prove, and an already-proven page that breaks later blocks.
22
+ The same guard reads the existing receipt backwards: page obligation ids
23
+ the ORIGINAL adoption already indexed (an earlier snapshot's plain
24
+ `adopt` that already knew pages) are recorded in the marker but never
25
+ re-adopted — proven stays proven, resolved stays resolved — while a
26
+ receipt that predates page indexing keeps the genuine first rollout
27
+ valid.
28
+ Family debt shrinks via `gateforge baseline update --family-pages
29
+ <fingerprint>...` (`--family-pages=` keeps none) while the marker is
30
+ retained. Only the `ui.page` contracts `page:loads`/`page:data-ok` can
31
+ enter the family; the migration refuses (exit 2, nothing written) on an
32
+ unadopted repository, with no page routes, or while any page's audience
33
+ or data plane is unresolved — declare each audience in `pages.audiences`
34
+ with an explicit `plane:` (`employee`→`tenant`, `admin`→`master`,
35
+ `public`→`global`; an audience name is a role, not a plane), which
36
+ `gateforge init` now asks for. The adoption receipt is now part of the
37
+ trusted-policy digest (present-only): a confirmed migration changes the
38
+ digest, and strict gates stay untrusted until the owner repins outside
39
+ the candidate. A plain `adopt` on a repo with `pages:` configured records
40
+ the family marker in the receipt it already writes with an EMPTY
41
+ `forgiven` set — the page debt itself rides the baseline bulk-add under
42
+ the ordinary shrink contract, so there is exactly one forgiveness store;
43
+ the family is then already adopted.
44
+
45
+ - **React Router page inventory and page obligations (0.13.0).** The
46
+ `@gate-forge/pack-react-router` pack reads JSX and object route trees,
47
+ resolves nested paths, reports unreadable paths, and supports an explicit
48
+ `.gateforge/pages.yml` inventory when `pages.router: manual` is selected.
49
+ `.gateforge.yml` `pages:` owner declarations bind audiences and error
50
+ markers; each plane-resolved `ui.page` contributes `page:loads` and
51
+ `page:data-ok` obligations. In witnessed Playwright runs, the fixture gives
52
+ the witness an independent Chromium debugging endpoint; the witness records
53
+ settled, route-matched visits, login bounces, uncaught errors, configured
54
+ error markers, and app-origin API statuses. Local fulfilment or an
55
+ unobserved proxy exchange refuses proof. A clean observation from a passing
56
+ test or the post-suite referee sweep satisfies the same page obligation; a
57
+ page already proved by a test is never swept. Static browser-tampering risks
58
+ are refused with source locations. `gateforge adopt` records pre-existing
59
+ page debt without blocking the adoption.
60
+
61
+ - **Post-suite page sweep and diagnostics (0.13.0).** `test-gates` asks the
62
+ witness to visit only page obligations without clean channel-B proof,
63
+ using seeded `pages.params` values or a unique matching engine-observed
64
+ create ID, with `PAGE_PARAM_UNBOUND` instead of guessing. `pages.sweep: false`
65
+ leaves gaps unproven. Page observations carry their `observed` or `swept`
66
+ channel; reports, `explain`, and `next` show page status and the cheapest
67
+ route, seed, or refusal fix.
68
+
69
+ - **Router `basename` and `pages.basePath` prefixes; unplaceable relative routes refused (0.13.0).**
70
+ The React Router reader prefixes page paths with a string-literal
71
+ `basename` read from the code — on `<BrowserRouter>`/`<HashRouter>`/`<MemoryRouter>`
72
+ or in the `createBrowserRouter`/`createHashRouter` options — so a page under
73
+ `basename="/app"` is discovered, visited, and route-matched at `/app/...`,
74
+ never at the bare route. A computed basename is never guessed: the pages
75
+ under it become `PAGE_ROUTE_UNRESOLVED` naming the `file:line`, and two
76
+ different basenames in one project raise an `AMBIGUOUS_BASENAME` finding.
77
+ A prefix that lives OUTSIDE the code (reverse proxy, sub-path host) is the
78
+ new optional `pages.basePath` key: it prefixes EVERY discovered page path
79
+ after the router `basename`, must start with `/` with no trailing slash,
80
+ and an invalid value is a config validation error naming the rule. A
81
+ relative route (`path="departments"`) with no parent route in its file and
82
+ no router root in the file is no longer silently joined onto `/departments`:
83
+ the page is not emitted and `PAGE_ROUTE_UNRESOLVED` says to make it
84
+ absolute or wrap it under its parent route.
85
+
86
+ - **Plain Playwright test compatibility.** The Playwright fixture now reuses
87
+ the runner's initialized core API if a raw test imports it while the public
88
+ CommonJS entry is still loading; raw tests keep running without requiring
89
+ Gateforge fixtures or producing page records.
90
+
91
+ - **Page promises report honest causes and honor waivers.** A missing
92
+ `page:loads`/`page:data-ok` was mislabeled `VERIFIER_UNSUPPORTED`
93
+ ("drop the pack") although the page proof channel exists; it now maps
94
+ to `EVIDENCE_NOT_COLLECTED` with the actionable fix (a witnessed page
95
+ visit through a browser test, or the engine's post-suite sweep), while
96
+ an unknown `page:*` contract stays unsupported. Page obligations also
97
+ honor owner waivers on the same lane as every other obligation — same
98
+ exact scope, expiry, and stale-owner rules (an exemption recorded by
99
+ the owner, never proof; revoke it and the page grades on its evidence
100
+ again).
101
+
102
+ - **Bound page sweep RPCs by the number of engine visits, rather than the ordinary single-call deadline.**
103
+
104
+ - **Page API data is graded only after the response body completes.** A
105
+ page's API request now counts as settled only when the response BODY
106
+ finished (Playwright `requestfinished`), not at the response headers; a
107
+ failed or unfinished body refuses both page promises with
108
+ `PAGE_API_UNSETTLED`. Both proof channels — the browser tests' observed
109
+ channel and the referee's swept channel — wait for in-flight app data
110
+ requests (fetch/XHR by resource type, plus `/api/` paths) and a quiet
111
+ window after the last activity before grading, bounded by the shared
112
+ engine budget. Before, a 500 arriving 1.2 s after the headers, or a 200
113
+ whose body died mid-flight, was graded clean. A request the app itself
114
+ cancels (`net::ERR_ABORTED`) counts as settled only when the same method
115
+ and URL completed in the same visit; any other failure, or an unretried
116
+ cancel, refuses the page. Both proof channels now read completion from
117
+ the browser's own network events, so a response body the app never reads
118
+ still counts once every declared byte (Content-Length) arrived; an
119
+ unread body without a declared length stays unsettled. The observed
120
+ channel keeps Playwright as its request ledger and adds the browser's
121
+ network events only as a completion signal, correlated per method and
122
+ URL — a request the network events did not observe is never upgraded.
123
+ A failed page-observation flush no longer fails the app's own passing
124
+ test: the fixture logs one line and moves on (page proof stays missing,
125
+ never fabricated), and the flush call's timeout now derives from the
126
+ shared engine budget instead of the ordinary 5 s call deadline.
127
+
128
+ - **The latest page observation per test decides.** Per test, only a
129
+ page's latest observation (`observationSequence`) counts: an early
130
+ clean visit cannot hide a later refusal by the same test, while another
131
+ passing test's latest clean visit still proves the page. A missing or
132
+ malformed sequence never proves, and equal-sequence contradictions fail
133
+ closed with `PAGE_OBSERVATION_CONFLICT`. The post-suite sweep chooses
134
+ its gap visits with the same rule.
135
+
136
+ - **Page observation metadata is controller-held.** The route table,
137
+ login routes, error markers, trusted app origins, and static tamper
138
+ risks are registered by the CLI with the witness on the
139
+ verifier-authenticated expected-set registration;
140
+ `/sessions/page-observer` carries only the session credentials and the
141
+ debugging port, and a run without registered context issues no page
142
+ proof. A matched page whose final URL origin is not a trusted app
143
+ origin is refused with `PAGE_APP_ORIGIN_MISMATCH`. The suite receives
144
+ only an enablement flag (`GATEFORGE_PAGE_OBSERVATION_ENABLED`): it can
145
+ disable observation, never enable false proof. Before, a test could
146
+ hand the witness its own route table or point it at another server and
147
+ get witnessed proof.
148
+
149
+ - **A 401 on pages of an audience without a login counts as the expected
150
+ not-logged-in answer.** On a page whose `pages.audiences` declaration has
151
+ no `session:` (no login configured — e.g. a public `global` audience),
152
+ an app data call answering exactly 401 no longer refuses `page:data-ok`;
153
+ 403 and every other error status still refuse there, and on audiences
154
+ WITH a login a 401 still refuses. The anonymity bit is controller-held —
155
+ derived from the audience declaration and registered with the witness on
156
+ the same verifier-authenticated path as the route table, never supplied
157
+ by the suite — so the observed and swept channels (and core grading,
158
+ which trusts the witness verdict) apply the same rule.
159
+
160
+ - **`gateforge next` resolves the witness verifier key ring like `check`.**
161
+ The key file and keyring locations now feed `next`'s durable-attestation
162
+ verification, not only the `GATEFORGE_WITNESS_VERIFIER_KEY` variable.
163
+ Before, with a verifier key file configured, `next` reported that
164
+ durable attestation cannot verify without a witness verifier key while
165
+ `check` passed.
166
+
3
167
  ## 0.12.0
4
168
 
5
169
  ### Added
package/README.md CHANGED
@@ -4,6 +4,7 @@ The gateforge command-line interface: initialize a project, discover
4
4
  resources and classification signals, inspect automatic decisions, reuse a
5
5
  repository's existing tests, evaluate obligations, run the supervised E2E
6
6
  gate, enforce the exact staged candidate, and maintain baselines.
7
+ **0.13.0:** React Router pages become first-class proof targets. `@gate-forge/pack-react-router` reads JSX and object route trees into `ui.page` resources, and each plane-resolved page carries two promises — `page:loads` and `page:data-ok` — graded from settled, route-matched witnessed visits (a page's API call counts only when its response BODY completed; a `net::ERR_ABORTED` cancel settles only when the same method and URL completed in the same visit). The engine's post-suite referee sweep visits the pages no test proved, with seeded `pages.params`; a failed page-observation flush never fails the app's own passing test. Page paths honor a code-read router `basename` plus the optional `pages.basePath`, and a relative route with no parent to place it under is refused (`PAGE_ROUTE_UNRESOLVED`) instead of silently joined. `gateforge adopt --family pages` records pre-existing page debt for already-adopted repositories (preview by default, one atomic receipt write, permanent marker, shrink via `baseline update --family-pages`); a 401 on a page whose audience has no login counts as the expected not-logged-in answer; page promises report honest causes and honor owner waivers; and `gateforge init` now asks for `pages.audiences` plane declarations.
7
8
  **0.12.0:** owner-declared business rules, test-type agnostic. The owner writes the product's rules down in the `rules:` section of `.gateforge/classification-policy.yml` (`gateforge init --rules` adds a commented example; a repository without the section is byte-identical to a release without the feature). Each rule names the test type that must prove it — `e2e` (default) or `pytest` — and splits into CASES mapped by the claim id `business-rule:<ruleId>/<caseId>` through the ONE mapping resolver (`tests mark --rule <ruleId>/<caseId> …`). A declaration is never proof: the case is graded by a pure evaluator over the sealed run's own facts, every mapped test of a case must deliver the proof (a green sibling never forgives a red one), a mocked spec never proves an end-to-end rule, a test outside the run's graded slice is reported `unproven`, and rule findings are run-wide, never diff-scoped away. `enforcement: advisory` (requires `advisoryReason`) rides the report's advisory channel every run, out of `blocking` and out of the exit code. `check` blocks (or advises) per case, `check --require-e2e` and `test-gates` grade from the sealed receipt's authorized records, the json report carries an additive `businessRules` section, and `gateforge next` prints a starter test plus the exact `tests mark --rule` line per missing case. Fixed: an empty optional config directory is digested exactly like an absent one, so the pin an owner minted over their adoption commit is the digest every gate computes and a fresh adoption can push again.
8
9
  **0.11.1:** Gateforge's own `check` cache is excluded from candidate trees, so a concurrent check cannot alter a run using a non-default `test-gates --out` directory. No other ignored or run-state files are excluded.
9
10
  **0.11.0:** one owner answer per fact. The four owner-answer FILES become SECTIONS of the two documents that already exist: `.gateforge/planes.json` and `.gateforge/endpoints.json` are now the `planes:` and `endpoints:` sections of `.gateforge/classification-policy.yml`, `.gateforge/http-clients.json` and `.gateforge/fastapi.json` are `.gateforge.yml` `scan.httpClients` and `scan.fastapi`, and the four scanner settings moved out of the answers document into a REQUIRED `scan:` block. There is no dual read — a repository still carrying one of the old files is refused BY NAME, with the command that moves it and its new home. `gateforge migrate` previews by default and applies with `--confirm`, one step per moved document, splicing at TEXT level so every comment survives, and validating every old value with the reader that will read it after the move. The hard-vs-archive answer keeps BOTH channels because they answer different questions: a declared `crud-delete`/`crud-archive` in the `endpoints:` section needs no linked model at all — a DELETE route that links no resource (a link-row teardown, a draft discard) cannot be expressed in `deleteRules`, whose globs name a resource's source file — while `deleteRules` answer for every route of one resource in a single line, and a DELETE with neither stays `ENDPOINT_SEMANTICS_UNRESOLVED` rather than being resolved by a word in a handler name. A diff-scoped report's `[NEW_DEBT]` entry no longer blocks a commit while saying there is nothing to prove — with no newly-unproven obligations it now names the cause it is actually reporting (a sealed receipt whose evidence-context `inputDigest` the change invalidated, typically) and the re-seal command. Upgrading: upgrade first, re-seal, commit both together.
@@ -153,7 +154,14 @@ the blocking wiring. The full adopt contract, and the baseline
153
154
  commands that shrink the recorded set: [Reference](guides/REFERENCE.md).
154
155
  Under `strictE2E`, an adopted E2E obligation still blocks
155
156
  as soon as a change touches it — adoption forgives today's
156
- debt, never new work.
157
+ debt, never new work. A repository that adopted before the 0.13
158
+ pages rollout revises its adoption with `gateforge adopt --family
159
+ pages --confirm` (preview by default): one atomic receipt write
160
+ records a permanent `pages` family marker — every page obligation
161
+ discovered, proven pages included — forgiving only the then-missing
162
+ page debt; the marker survives every shrink, repeats add nothing,
163
+ and the digest change requires the owner's external repin for
164
+ strict gates ([Reference — the pages family](guides/REFERENCE.md#the-pages-family-adopting-page-debt-into-an-already-adopted-repo)).
157
165
 
158
166
  ## Development
159
167
 
@@ -1 +1 @@
1
- {"version":3,"file":"adopted-baseline.d.ts","sourceRoot":"","sources":["../src/adopted-baseline.ts"],"names":[],"mappings":"AAkBA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,MAAM,EACX,aAAa,EAAE,MAAM,GAEnB;IACE,YAAY,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAClC,qBAAqB,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC5C,SAAS,EAAE,MAAM,CAAC;IAClB,0BAA0B,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzD,qBAAqB,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC;CAChE,GACD,IAAI,CA+BP"}
1
+ {"version":3,"file":"adopted-baseline.d.ts","sourceRoot":"","sources":["../src/adopted-baseline.ts"],"names":[],"mappings":"AAkBA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,MAAM,EACX,aAAa,EAAE,MAAM,GAEnB;IACE,YAAY,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAClC,qBAAqB,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC5C,SAAS,EAAE,MAAM,CAAC;IAClB,0BAA0B,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzD,qBAAqB,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC;CAChE,GACD,IAAI,CA2CP"}
@@ -42,7 +42,20 @@ export function resolveAdoptedBaseline(cwd, baselinesPath) {
42
42
  const adoption = loadAdoptionRecord(join(dirname(baselinePath), ADOPTION_RECORD_FILENAME));
43
43
  if (adoption === null)
44
44
  return null;
45
+ // Adopted families (0.13 pages rollout): a family's `forgiven`
46
+ // fingerprints are sanctioned by the RECEIPT alone — the migration that
47
+ // records them never touches the baseline document — so they fold into
48
+ // the forgiveness set HERE, gated on the same receipt whose existence
49
+ // sanctions the document. The fold cannot widen anything: `forgiven` is
50
+ // the shrink-only subset recorded at family adoption, every entry was a
51
+ // then-current page fingerprint, and the marker is permanent (a repeat
52
+ // migration adds nothing). A receipt without the family field predates
53
+ // families and forgives nothing family-shaped (fail closed).
45
54
  const fingerprints = new Set(loadBaseline(baselinePath).fingerprints);
55
+ for (const family of Object.values(adoption.families ?? {})) {
56
+ for (const fingerprint of family.forgiven)
57
+ fingerprints.add(fingerprint);
58
+ }
46
59
  const obligationFingerprintsById = adoption.obligationFingerprintsById === undefined
47
60
  ? undefined
48
61
  : new Map(Object.entries(adoption.obligationFingerprintsById).filter(([, fingerprint]) => fingerpr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AAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,IAAI,EAAE,CAAC,EAAE,CAAC;QAC5D,KAAK,MAAM,WAAW,IAAI,MAAM,CAAC,QAAQ;YAAE,YAAY,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAC3E,CAAC;IACD,MAAM,0BAA0B,GAC9B,QAAQ,CAAC,0BAA0B,KAAK,SAAS;QAC/C,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,IAAI,GAAG,CACL,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,0BAA0B,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,EAAE,EAAE,CAC7E,YAAY,CAAC,GAAG,CAAC,WAAW,CAAC,CAC9B,CACF,CAAC;IACR,MAAM,qBAAqB,GACzB,QAAQ,CAAC,qBAAqB,KAAK,SAAS,IAAI,0BAA0B,KAAK,SAAS;QACtF,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,IAAI,GAAG,CACL,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAC7D,0BAA0B,CAAC,GAAG,CAAC,EAAE,CAAC,CACnC,CACF,CAAC;IACR,OAAO;QACL,YAAY;QACZ,qBAAqB,EACnB,QAAQ,CAAC,qBAAqB,KAAK,SAAS;YAC1C,CAAC,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,qBAAqB,CAAC;YACzC,CAAC,CAAC,SAAS;QACf,SAAS,EAAE,QAAQ,CAAC,SAAS;QAC7B,0BAA0B;QAC1B,qBAAqB;KACtB,CAAC;AACJ,CAAC"}
package/dist/cli.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { Io } from './io.js';
2
2
  /** The top-level usage text (also printed for `--help`). */
3
- export declare const USAGE = "usage: gateforge <command> [options]\n\ncommands:\n init [--languages <comma,list>] [--plugins <comma,list>] [--accept-recommended] [--no-scan]\n [--proof overlay|observe] [--blocking] [--strict-e2e] [--witnessed staged|full]\n scan the repo, print the recommended install, and write\n .gateforge.yml + skeleton + GATEFORGE.md + overlay README\n (idempotent; --blocking installs AND verifies an active\n pre-commit hook + CI wiring)\n enforce [--ci github|gitlab] [--witnessed] wire the blocking pre-commit + CI gate into an initialized repo (idempotent);\n --witnessed also writes the witnessed 'gateforge run' job template\n adopt adopt enforcement: seed the baseline from current debt (the one bulk-add) + wire the gate\n discover [--json] run detectors and dump the resource graph\n classify [--json] [--write-snapshot P] inspect effective classifications + typed blocks\n classify plane <src> <plane> --reason T [--confirm]\n declare the data plane for a file, folder, or glob (preview without --confirm)\n classify delete <src> <hard|archive> [--archive-field k=v]... --reason T [--confirm]\n declare how removal manifests for a file, folder, or glob\n explain <resourceId> [--json] full signal/rule/obligation trace for one resource\n tests discover [--json] [--pytest] inventory existing tests into the run-state catalog\n tests suggest [--changed] [--json] suggest existing tests for uncovered obligations (inspection, never a gate)\n tests mark --test K --kind K [--category C]...\n --obligation ID... --reason \"T\" declare an existing test in .gateforge/test-map.yml (atomic, idempotent)\n tests explain --test K [--json] requirements/mapping/next action for one existing test\n tests diagnose [--suite N] [--json] run the configured pytest diagnostic suites (advisory; exit 0/1/2)\n adapters scaffold [--dry-run] write a starting-point evidence adapter per business resource\n [--dry-run] that has none (never overwrites; every guess is marked)\n adapters check [--json] load and validate every adapter; report the resources with none\n [--probe --base-url URL] with the app running: one read-only GET per adapter\n [--probe-id ID]\n obligations [--json] evaluate policies and dump obligations\n history [--test TEXT] [--failed] [--since ISO] query retained supervised run history\n check [--changed] [--staged] [--candidate-commit SHA] run the gate against all files, the exact frozen\n index, or the selected immutable commit tree; --changed narrows the selected candidate's diff;\n [--require-e2e] [--format F] require a valid receipt and select text|json|sarif output\n next [--changed] [--json] print the ONE blocking next action (navigation, not the gate)\n test-gates [--changed] [--suite CMD] supervised E2E run over the obligations (--changed) or the\n [--out DIR] [--format F] legacy suite escape hatch; seals a gate receipt on complete success\n [--witness-url URL]\n pre-commit --scope staged|full freeze the Git index, run the witnessed gate against those exact\n bytes, validate the new receipt, and recheck the index before success\n broker commit --workspace DIR commit broker (MECHANISM, not deployment): verifies a gate\n --message MSG [--receipt P] receipt for the exact workspace bytes, then commits via compare-and-swap\n [--ref REF] ref update. Guaranteed only when the broker runs outside the agent's\n write/process boundary (ADR 0005 D1)\n key create|import-env|rotate|retire owner-only verifier-key ceremony; stores keys outside the repo\n --file PATH --confirm key IDs are safe to log; key material is never printed\n enforcement doctor [--json] honest enforcement diagnostics: hook activation, runner/observer readiness,\n trusted binary/policy ownership, snapshot mode, standard/managed boundary\n enforcement pin --pin-file PATH [--confirm] write the STAGED revision's approved policy digest into an env file\n OUTSIDE the repo (mode 0600); preview by default (NOT --env-file: node owns it)\n baseline update <fp...> shrink the baseline to a strict subset (invariant 4)\n baseline diff <before> <after> compare adopted obligations by ID without printing fingerprints\n waive <resourceId:contract> write an expiring, owner-approved waiver for one obligation\n --owner N --approver N (GF-15: all fields mandatory; justification URL required;\n --justification-url U --expires D no --force \u2014 renewal is a hand-edit of the written file)\n quarantine <testKey> write an expiring, owner-approved flaky-test quarantine\n --owner N --approver N (never proof, never blocking; at most 14 days; no --force;\n --reason \"T\" --expires D an expired quarantine BLOCKS until renewed or deleted)\n run [--] [test-gates flags] the whole local proof in order: doctor preflight (strict), the optional\n .gateforge/runtime.yml recipe (reset/seed/up/health), the supervised\n test-gates, check --require-e2e, and the recipe's teardown \u2014 one line\n per step, exit code = the first failing step's own code\n migrate [--confirm] move owner declarations into .gateforge.yml (evidence.exclude.docs|cache);\n preview by default, idempotent, re-pin reminder on write\n --version print the version\n --help show this help\n\nexit codes: 0 clean/waived, 1 unresolved obligations, 2 config/usage error";
3
+ export declare const USAGE = "usage: gateforge <command> [options]\n\ncommands:\n init [--languages <comma,list>] [--plugins <comma,list>] [--accept-recommended] [--no-scan]\n [--proof overlay|observe] [--blocking] [--strict-e2e] [--witnessed staged|full]\n scan the repo, print the recommended install, and write\n .gateforge.yml + skeleton + GATEFORGE.md + overlay README\n (idempotent; --blocking installs AND verifies an active\n pre-commit hook + CI wiring)\n enforce [--ci github|gitlab] [--witnessed] wire the blocking pre-commit + CI gate into an initialized repo (idempotent);\n --witnessed also writes the witnessed 'gateforge run' job template\n adopt [--family pages [--confirm]] adopt enforcement: seed the baseline from current debt (the one bulk-add) + wire the gate;\n --family pages previews the pages-family migration of an ALREADY-adopted repo,\n --confirm records it (one atomic receipt write)\n discover [--json] run detectors and dump the resource graph\n classify [--json] [--write-snapshot P] inspect effective classifications + typed blocks\n classify plane <src> <plane> --reason T [--confirm]\n declare the data plane for a file, folder, or glob (preview without --confirm)\n classify delete <src> <hard|archive> [--archive-field k=v]... --reason T [--confirm]\n declare how removal manifests for a file, folder, or glob\n explain <resourceId> [--json] full signal/rule/obligation trace for one resource\n tests discover [--json] [--pytest] inventory existing tests into the run-state catalog\n tests suggest [--changed] [--json] suggest existing tests for uncovered obligations (inspection, never a gate)\n tests mark --test K --kind K [--category C]...\n --obligation ID... --reason \"T\" declare an existing test in .gateforge/test-map.yml (atomic, idempotent)\n tests explain --test K [--json] requirements/mapping/next action for one existing test\n tests diagnose [--suite N] [--json] run the configured pytest diagnostic suites (advisory; exit 0/1/2)\n adapters scaffold [--dry-run] write a starting-point evidence adapter per business resource\n [--dry-run] that has none (never overwrites; every guess is marked)\n adapters check [--json] load and validate every adapter; report the resources with none\n [--probe --base-url URL] with the app running: one read-only GET per adapter\n [--probe-id ID]\n obligations [--json] evaluate policies and dump obligations\n history [--test TEXT] [--failed] [--since ISO] query retained supervised run history\n check [--changed] [--staged] [--candidate-commit SHA] run the gate against all files, the exact frozen\n index, or the selected immutable commit tree; --changed narrows the selected candidate's diff;\n [--require-e2e] [--format F] require a valid receipt and select text|json|sarif output\n next [--changed] [--json] print the ONE blocking next action (navigation, not the gate)\n test-gates [--changed] [--suite CMD] supervised E2E run over the obligations (--changed) or the\n [--out DIR] [--format F] legacy suite escape hatch; seals a gate receipt on complete success\n [--witness-url URL]\n pre-commit --scope staged|full freeze the Git index, run the witnessed gate against those exact\n bytes, validate the new receipt, and recheck the index before success\n broker commit --workspace DIR commit broker (MECHANISM, not deployment): verifies a gate\n --message MSG [--receipt P] receipt for the exact workspace bytes, then commits via compare-and-swap\n [--ref REF] ref update. Guaranteed only when the broker runs outside the agent's\n write/process boundary (ADR 0005 D1)\n key create|import-env|rotate|retire owner-only verifier-key ceremony; stores keys outside the repo\n --file PATH --confirm key IDs are safe to log; key material is never printed\n enforcement doctor [--json] honest enforcement diagnostics: hook activation, runner/observer readiness,\n trusted binary/policy ownership, snapshot mode, standard/managed boundary\n enforcement pin --pin-file PATH [--confirm] write the STAGED revision's approved policy digest into an env file\n OUTSIDE the repo (mode 0600); preview by default (NOT --env-file: node owns it)\n baseline update <fp...> shrink the baseline to a strict subset (invariant 4);\n [--classification-blocked <id>]... / [--family-pages <fp>]... shrink the receipt's adopted layers\n baseline diff <before> <after> compare adopted obligations by ID without printing fingerprints\n waive <resourceId:contract> write an expiring, owner-approved waiver for one obligation\n --owner N --approver N (GF-15: all fields mandatory; justification URL required;\n --justification-url U --expires D no --force \u2014 renewal is a hand-edit of the written file)\n quarantine <testKey> write an expiring, owner-approved flaky-test quarantine\n --owner N --approver N (never proof, never blocking; at most 14 days; no --force;\n --reason \"T\" --expires D an expired quarantine BLOCKS until renewed or deleted)\n run [--] [test-gates flags] the whole local proof in order: doctor preflight (strict), the optional\n .gateforge/runtime.yml recipe (reset/seed/up/health), the supervised\n test-gates, check --require-e2e, and the recipe's teardown \u2014 one line\n per step, exit code = the first failing step's own code\n migrate [--confirm] move owner declarations into .gateforge.yml (evidence.exclude.docs|cache);\n preview by default, idempotent, re-pin reminder on write\n --version print the version\n --help show this help\n\nexit codes: 0 clean/waived, 1 unresolved obligations, 2 config/usage error";
4
4
  /**
5
5
  * Runs the gateforge CLI.
6
6
  *
package/dist/cli.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AA0BlC,4DAA4D;AAC5D,eAAO,MAAM,KAAK,wvMAqEyD,CAAC;AAE5E;;;;;;;;;GASG;AACH,wBAAsB,IAAI,CACxB,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,EAAE,GAAE,EAAgB,GACnB,OAAO,CAAC,MAAM,CAAC,CAsEjB"}
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AA0BlC,4DAA4D;AAC5D,eAAO,MAAM,KAAK,2lNAwEyD,CAAC;AAE5E;;;;;;;;;GASG;AACH,wBAAsB,IAAI,CACxB,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,EAAE,GAAE,EAAgB,GACnB,OAAO,CAAC,MAAM,CAAC,CAsEjB"}
package/dist/cli.js CHANGED
@@ -46,7 +46,9 @@ commands:
46
46
  pre-commit hook + CI wiring)
47
47
  enforce [--ci github|gitlab] [--witnessed] wire the blocking pre-commit + CI gate into an initialized repo (idempotent);
48
48
  --witnessed also writes the witnessed 'gateforge run' job template
49
- adopt adopt enforcement: seed the baseline from current debt (the one bulk-add) + wire the gate
49
+ adopt [--family pages [--confirm]] adopt enforcement: seed the baseline from current debt (the one bulk-add) + wire the gate;
50
+ --family pages previews the pages-family migration of an ALREADY-adopted repo,
51
+ --confirm records it (one atomic receipt write)
50
52
  discover [--json] run detectors and dump the resource graph
51
53
  classify [--json] [--write-snapshot P] inspect effective classifications + typed blocks
52
54
  classify plane <src> <plane> --reason T [--confirm]
@@ -86,7 +88,8 @@ commands:
86
88
  trusted binary/policy ownership, snapshot mode, standard/managed boundary
87
89
  enforcement pin --pin-file PATH [--confirm] write the STAGED revision's approved policy digest into an env file
88
90
  OUTSIDE the repo (mode 0600); preview by default (NOT --env-file: node owns it)
89
- baseline update <fp...> shrink the baseline to a strict subset (invariant 4)
91
+ baseline update <fp...> shrink the baseline to a strict subset (invariant 4);
92
+ [--classification-blocked <id>]... / [--family-pages <fp>]... shrink the receipt's adopted layers
90
93
  baseline diff <before> <after> compare adopted obligations by ID without printing fingerprints
91
94
  waive <resourceId:contract> write an expiring, owner-approved waiver for one obligation
92
95
  --owner N --approver N (GF-15: all fields mandatory; justification URL required;
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE3D,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OA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AC,CAAC,CAAC;QAChF,KAAK,OAAO;YACV,OAAO,gBAAgB,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC;QAC5D,KAAK,SAAS;YACZ,OAAO,gBAAgB,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;QAC/E,KAAK,YAAY;YACf,OAAO,gBAAgB,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,iBAAiB,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC;QACjE;YACE,OAAO,gBAAgB,CAAC,EAAE,EAAE,KAAK,IAAI,EAAE;gBACrC,sEAAsE;gBACtE,SAAS,CAAC,IAAI,CAAC,CAAC;gBAChB,MAAM,IAAI,UAAU,CAAC,oBAAoB,OAAO,GAAG,CAAC,CAAC;YACvD,CAAC,CAAC,CAAC;IACP,CAAC;AACH,CAAC"}
@@ -1,18 +1,20 @@
1
1
  import type { Io } from '../io.js';
2
- export declare const ADOPT_USAGE = "usage: gateforge adopt";
2
+ export declare const ADOPT_USAGE = "usage: gateforge adopt [--family pages [--confirm]]";
3
3
  /**
4
4
  * What `gateforge adopt --help` prints. The command used to print only
5
5
  * its usage line, so its whole contract — what it forgives, for how
6
6
  * long, and the one case where an adopted obligation still blocks —
7
7
  * existed only in the source file.
8
8
  */
9
- export declare const ADOPT_HELP = "usage: gateforge adopt\n\nAdopts an EXISTING repository: run it once, after `gateforge init`, on a\nproject that already has code and therefore already has findings.\n\n what it records \u2014 the currently-blocking findings: unsatisfied\n obligation fingerprints (pin #2) plus every blocking entry, and, as a\n second layer, the classification-blocked resource identities. They go\n into .gateforge/baselines/obligations.json, sanctioned by a dated,\n count-annotated receipt (.gateforge/baselines/adoption.json). Without\n that receipt a baseline forgives nothing.\n\n shrink-only \u2014 the recorded set never grows on its own. It is the one\n sanctioned bulk-add this engine performs, and only once per repository:\n a second `adopt` is a no-op success. Resolve debt and shrink it with\n `gateforge baseline update`; new (never-adopted) work is never\n baselined and keeps blocking (`check` exits 1).\n\n strictE2E \u2014 with `enforcement.strictE2E: true` a baselined E2E\n obligation is NOT proof. It blocks with ENFORCEMENT_UNTRUSTED again\n as soon as a change touches what it proves. A change set that carries\n no product behaviour at all \u2014 tests, the mapping sidecar, runner\n configuration \u2014 keeps the adopted debt forgiven under the default\n `enforcement.adoptedDebt: lenient`; declare `strict` to re-grade it\n on every commit after this one.\n\n wiring \u2014 after recording, it applies the blocking wiring (pre-commit\n hook block + CI template) through the same idempotent path as\n `gateforge init --blocking`.\n\n plane-ordered \u2014 adoption refuses (exit 2, nothing written) while\n any blocking entry is plane-unresolved: a plane answer changes\n the resource's identity, so debt adopted before the answer\n would not match after it. Answer the planes first\n (`gateforge classify plane <folder> <tenant|master|global> --confirm`).\n\nExit codes: 0 adopted (or an idempotent no-op), 2 config/usage or a plane-unresolved resource (R1-9).";
9
+ export declare const ADOPT_HELP = "usage: gateforge adopt [--family pages [--confirm]]\n\nAdopts an EXISTING repository: run it once, after `gateforge init`, on a\nproject that already has code and therefore already has findings.\n\n what it records \u2014 the currently-blocking findings: unsatisfied\n obligation fingerprints (pin #2) plus every blocking entry, and, as a\n second layer, the classification-blocked resource identities. They go\n into .gateforge/baselines/obligations.json, sanctioned by a dated,\n count-annotated receipt (.gateforge/baselines/adoption.json). Without\n that receipt a baseline forgives nothing.\n\n shrink-only \u2014 the recorded set never grows on its own. It is the one\n sanctioned bulk-add this engine performs, and only once per repository:\n a second `adopt` is a no-op success. Resolve debt and shrink it with\n `gateforge baseline update`; new (never-adopted) work is never\n baselined and keeps blocking (`check` exits 1).\n\n strictE2E \u2014 with `enforcement.strictE2E: true` a baselined E2E\n obligation is NOT proof. It blocks with ENFORCEMENT_UNTRUSTED again\n as soon as a change touches what it proves. A change set that carries\n no product behaviour at all \u2014 tests, the mapping sidecar, runner\n configuration \u2014 keeps the adopted debt forgiven under the default\n `enforcement.adoptedDebt: lenient`; declare `strict` to re-grade it\n on every commit after this one.\n\n wiring \u2014 after recording, it applies the blocking wiring (pre-commit\n hook block + CI template) through the same idempotent path as\n `gateforge init --blocking`.\n\n plane-ordered \u2014 adoption refuses (exit 2, nothing written) while\n any blocking entry is plane-unresolved: a plane answer changes\n the resource's identity, so debt adopted before the answer\n would not match after it. Answer the planes first\n (`gateforge classify plane <folder> <tenant|master|global> --confirm`).\n\n families \u2014 `gateforge adopt --family pages` revises an ALREADY-adopted\n repository (an unadopted one is told to run plain `adopt` first; the\n family path never seeds a receipt). Preview by default \u2014 it prints what\n WOULD be recorded and writes nothing. `--confirm` performs ONE atomic\n write to .gateforge/baselines/adoption.json: a dated, commit-referenced\n `families.pages` marker recording EVERY page obligation discovered at\n that moment (proven pages included), with only the then-missing/unproven\n page fingerprints marked forgiven. The baseline document is never\n touched, so a crash cannot expose unrecorded forgiveness; the evaluator\n forgives the family's `forgiven` set from the receipt alone. The marker\n is permanent: a repeat records nothing (new pages are new work to\n prove), and the family debt shrinks through `gateforge baseline update\n --family-pages <fingerprint>...` (`--family-pages=` keeps none) while\n the marker is retained. Page routes with an unresolved audience or data\n plane refuse the migration (exit 2, nothing written) \u2014 declare each\n audience in .gateforge.yml pages.audiences with an explicit plane\n (`plane: tenant|master|global`; an audience name is a role, not a\n plane). Because the receipt is part of the approved policy revision,\n a confirmed migration changes the trusted-policy digest: strict gates\n stay untrusted until the owner repins the revision OUTSIDE the\n candidate (`gateforge enforcement pin`, the approved-digest env var,\n or the trusted config). A plain `adopt` on a repo with `pages:`\n configured records the family marker in the receipt it already writes,\n so the family is then already adopted.\n\nExit codes: 0 adopted (or an idempotent no-op), 2 config/usage or a plane-unresolved resource (R1-9).";
10
10
  /**
11
11
  * Runs the adopt subcommand.
12
12
  *
13
13
  * Args:
14
14
  * io: process context.
15
- * argv: flags after the subcommand (none supported beyond --help).
15
+ * argv: flags after the subcommand: bare (the one bulk-add),
16
+ * `--family pages` (family migration preview), or `--family pages
17
+ * --confirm` (the migration itself). `--help` prints the contract.
16
18
  *
17
19
  * Returns:
18
20
  * number: exit code — 0 adopted (or idempotent no-op), 2 config/usage
@@ -1 +1 @@
1
- {"version":3,"file":"adopt.d.ts","sourceRoot":"","sources":["../../src/commands/adopt.ts"],"names":[],"mappings":"AA0DA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAYnC,eAAO,MAAM,WAAW,2BAA2B,CAAC;AAEpD;;;;;GAKG;AACH,eAAO,MAAM,UAAU,k9DAoC+E,CAAC;AAWvG;;;;;;;;;;;GAWG;AACH,wBAAsB,YAAY,CAAC,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAkLnF"}
1
+ {"version":3,"file":"adopt.d.ts","sourceRoot":"","sources":["../../src/commands/adopt.ts"],"names":[],"mappings":"AA8EA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAanC,eAAO,MAAM,WAAW,wDAAwD,CAAC;AAEjF;;;;;GAKG;AACH,eAAO,MAAM,UAAU,uqHA6D+E,CAAC;AAWvG;;;;;;;;;;;;;GAaG;AACH,wBAAsB,YAAY,CAAC,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CA6BnF"}