@gate-forge/cli 0.12.0 → 0.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +226 -0
- package/README.md +10 -1
- package/dist/adopted-baseline.d.ts.map +1 -1
- package/dist/adopted-baseline.js +13 -0
- package/dist/adopted-baseline.js.map +1 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +5 -2
- package/dist/cli.js.map +1 -1
- package/dist/commands/adopt.d.ts +5 -3
- package/dist/commands/adopt.d.ts.map +1 -1
- package/dist/commands/adopt.js +338 -5
- package/dist/commands/adopt.js.map +1 -1
- package/dist/commands/baseline.d.ts.map +1 -1
- package/dist/commands/baseline.js +60 -24
- package/dist/commands/baseline.js.map +1 -1
- package/dist/commands/explain.d.ts.map +1 -1
- package/dist/commands/explain.js +67 -2
- package/dist/commands/explain.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +57 -1
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/next.d.ts.map +1 -1
- package/dist/commands/next.js +41 -4
- package/dist/commands/next.js.map +1 -1
- package/dist/commands/test-gates.d.ts.map +1 -1
- package/dist/commands/test-gates.js +195 -8
- package/dist/commands/test-gates.js.map +1 -1
- package/dist/detector-trust.d.ts.map +1 -1
- package/dist/detector-trust.js +2 -0
- package/dist/detector-trust.js.map +1 -1
- package/dist/execution.d.ts +6 -5
- package/dist/execution.d.ts.map +1 -1
- package/dist/execution.js +16 -0
- package/dist/execution.js.map +1 -1
- package/dist/page-obligations.d.ts +21 -0
- package/dist/page-obligations.d.ts.map +1 -0
- package/dist/page-obligations.js +123 -0
- package/dist/page-obligations.js.map +1 -0
- package/dist/pipeline.d.ts.map +1 -1
- package/dist/pipeline.js +9 -0
- package/dist/pipeline.js.map +1 -1
- package/dist/route-plane-proposals.d.ts.map +1 -1
- package/dist/route-plane-proposals.js +1 -0
- package/dist/route-plane-proposals.js.map +1 -1
- package/guides/CONNECT-YOUR-PROJECT.md +41 -0
- package/guides/QUICKSTART.md +33 -7
- package/guides/REFERENCE.md +206 -3
- package/package.json +11 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,231 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.13.1
|
|
4
|
+
|
|
5
|
+
- **Frontend detector: a trailing query-string hole is read as a query, not a
|
|
6
|
+
path segment.** Calls written like
|
|
7
|
+
`` `.../meters${qs ? `?code=${code}` : ''}` `` (also the `&&`, `|| ''`, and
|
|
8
|
+
const-bound forms, including function-local `const`) used to render their
|
|
9
|
+
unresolved hole as a positional slot glued to the last path segment
|
|
10
|
+
(`meters${}`), so the call failed to join its backend route and was reported
|
|
11
|
+
unwired. When the template's last hole provably evaluates only to query or
|
|
12
|
+
fragment text (empty, `?…`, or `#…`), it now renders as a bare `?` and
|
|
13
|
+
normalization strips the query, so the call joins its route. Anything not
|
|
14
|
+
provably a query suffix — a hole mid-path, a trailing path value, a branch
|
|
15
|
+
starting with `/` — is unchanged.
|
|
16
|
+
|
|
17
|
+
- **The post-suite page sweep can now run past five minutes.** The
|
|
18
|
+
supervisor's call to the witness used Node's global fetch, whose fixed
|
|
19
|
+
300-second internal header/body timeout aborted every sweep budgeted for
|
|
20
|
+
longer than that, reporting `fetch failed` no matter what deadline the
|
|
21
|
+
sweep itself had computed. The supervisor client now performs its HTTP
|
|
22
|
+
calls directly with `node:http`/`node:https`, so the computed budget (base
|
|
23
|
+
timeout plus the per-page allowance) is the only deadline. Error types,
|
|
24
|
+
messages, and fail-closed behavior are unchanged; a budget shorter than a
|
|
25
|
+
slow answer still aborts with the same typed error.
|
|
26
|
+
|
|
27
|
+
- **A storage-only init script no longer refuses page proof.** A spec or
|
|
28
|
+
helper calling `page.addInitScript(() => localStorage.setItem('lang',
|
|
29
|
+
'en'))` (also the block form, `sessionStorage`, `removeItem`/`clear`,
|
|
30
|
+
optional `window.` receiver, and the `context.addInitScript` form) was
|
|
31
|
+
reported as a page-observation tamper risk and refused page-level proof.
|
|
32
|
+
Such a script only sets storage keys the witness's independent observer
|
|
33
|
+
can see, so it is no longer a tamper; the scan continues past it, and a
|
|
34
|
+
real tamper later in the same file (a route interception, `window.fetch`
|
|
35
|
+
reassignment, a template or non-literal value, extra arguments, or a
|
|
36
|
+
string/path script) is still reported at its own line.
|
|
37
|
+
|
|
38
|
+
- **A page may keep a live connection open (`pages.liveChannels`).** A page
|
|
39
|
+
whose app holds a long poll, a WebSocket, or a server-sent-events stream
|
|
40
|
+
open forever used to burn the whole visit settle budget and refuse the
|
|
41
|
+
page with `PAGE_API_UNSETTLED`. Declaring the stream's path prefix under
|
|
42
|
+
the new controller-held `pages.liveChannels` configuration (same rule in
|
|
43
|
+
both proof channels) makes such a request a live channel: it never counts
|
|
44
|
+
as app data evidence, never holds the settle wait, and never refuses the
|
|
45
|
+
page by itself; the visit payload lists what stayed open (`liveChannels`,
|
|
46
|
+
count + paths). WebSocket upgrades on the app host and `text/event-stream`
|
|
47
|
+
responses are live channels by protocol, with no declaration needed. An
|
|
48
|
+
undeclared open request still refuses the page exactly as before.
|
|
49
|
+
|
|
50
|
+
- **A rejected audience session stops that audience's page sweep.** When an
|
|
51
|
+
audience with a session lands on one of its declared login routes on the
|
|
52
|
+
first visited page (the usual rotating-refresh-token case: the suite's run
|
|
53
|
+
consumed the session the file carried), that page is graded as today and
|
|
54
|
+
every remaining page of the same audience is refused without visiting it,
|
|
55
|
+
with the new `PAGE_AUDIENCE_SESSION_INVALID` reason. The records still
|
|
56
|
+
issue, the sweep payload says each page was not visited and why, and one
|
|
57
|
+
log line asks for a session file the suite does not consume. Session-less
|
|
58
|
+
audiences are unaffected.
|
|
59
|
+
|
|
60
|
+
- **The page sweep reports progress per page.** Each visited page emits one
|
|
61
|
+
line as its visit finishes — `page 3/12 tenant /orders -> proven (1234
|
|
62
|
+
ms)` — so a killed sweep keeps the lines it already earned instead of
|
|
63
|
+
staying silent for minutes. `--progress off` asks for none.
|
|
64
|
+
|
|
65
|
+
## 0.13.0
|
|
66
|
+
|
|
67
|
+
- **Pages-family adoption for already-adopted repositories (0.13.0).**
|
|
68
|
+
`gateforge adopt --family pages` revises an ALREADY-adopted repository —
|
|
69
|
+
the one owner-approved exception to the one-bulk-add invariant, scoped to
|
|
70
|
+
a named family. Preview by default (nothing written); `--confirm` performs
|
|
71
|
+
ONE atomic write to the existing `.gateforge/baselines/adoption.json`: a
|
|
72
|
+
dated, commit-referenced `families.pages` marker recording EVERY page
|
|
73
|
+
obligation discovered at that moment (proven pages included), with only
|
|
74
|
+
the then-missing/unproven page fingerprints marked `forgiven`. Receipt
|
|
75
|
+
writes are validated and then atomic (same-directory temporary file +
|
|
76
|
+
rename): a failed or interrupted write leaves the previous receipt
|
|
77
|
+
intact, never a truncated one. The
|
|
78
|
+
baseline document is never touched — the evaluator forgives the family's
|
|
79
|
+
`forgiven` set from the receipt alone, so no crash window can expose
|
|
80
|
+
unrecorded forgiveness (a union baseline would have been forgiven by the
|
|
81
|
+
OLD receipt before the new record existed). The marker is permanent: a
|
|
82
|
+
repeat records nothing, a page route discovered after the migration is
|
|
83
|
+
new work to prove, and an already-proven page that breaks later blocks.
|
|
84
|
+
The same guard reads the existing receipt backwards: page obligation ids
|
|
85
|
+
the ORIGINAL adoption already indexed (an earlier snapshot's plain
|
|
86
|
+
`adopt` that already knew pages) are recorded in the marker but never
|
|
87
|
+
re-adopted — proven stays proven, resolved stays resolved — while a
|
|
88
|
+
receipt that predates page indexing keeps the genuine first rollout
|
|
89
|
+
valid.
|
|
90
|
+
Family debt shrinks via `gateforge baseline update --family-pages
|
|
91
|
+
<fingerprint>...` (`--family-pages=` keeps none) while the marker is
|
|
92
|
+
retained. Only the `ui.page` contracts `page:loads`/`page:data-ok` can
|
|
93
|
+
enter the family; the migration refuses (exit 2, nothing written) on an
|
|
94
|
+
unadopted repository, with no page routes, or while any page's audience
|
|
95
|
+
or data plane is unresolved — declare each audience in `pages.audiences`
|
|
96
|
+
with an explicit `plane:` (`employee`→`tenant`, `admin`→`master`,
|
|
97
|
+
`public`→`global`; an audience name is a role, not a plane), which
|
|
98
|
+
`gateforge init` now asks for. The adoption receipt is now part of the
|
|
99
|
+
trusted-policy digest (present-only): a confirmed migration changes the
|
|
100
|
+
digest, and strict gates stay untrusted until the owner repins outside
|
|
101
|
+
the candidate. A plain `adopt` on a repo with `pages:` configured records
|
|
102
|
+
the family marker in the receipt it already writes with an EMPTY
|
|
103
|
+
`forgiven` set — the page debt itself rides the baseline bulk-add under
|
|
104
|
+
the ordinary shrink contract, so there is exactly one forgiveness store;
|
|
105
|
+
the family is then already adopted.
|
|
106
|
+
|
|
107
|
+
- **React Router page inventory and page obligations (0.13.0).** The
|
|
108
|
+
`@gate-forge/pack-react-router` pack reads JSX and object route trees,
|
|
109
|
+
resolves nested paths, reports unreadable paths, and supports an explicit
|
|
110
|
+
`.gateforge/pages.yml` inventory when `pages.router: manual` is selected.
|
|
111
|
+
`.gateforge.yml` `pages:` owner declarations bind audiences and error
|
|
112
|
+
markers; each plane-resolved `ui.page` contributes `page:loads` and
|
|
113
|
+
`page:data-ok` obligations. In witnessed Playwright runs, the fixture gives
|
|
114
|
+
the witness an independent Chromium debugging endpoint; the witness records
|
|
115
|
+
settled, route-matched visits, login bounces, uncaught errors, configured
|
|
116
|
+
error markers, and app-origin API statuses. Local fulfilment or an
|
|
117
|
+
unobserved proxy exchange refuses proof. A clean observation from a passing
|
|
118
|
+
test or the post-suite referee sweep satisfies the same page obligation; a
|
|
119
|
+
page already proved by a test is never swept. Static browser-tampering risks
|
|
120
|
+
are refused with source locations. `gateforge adopt` records pre-existing
|
|
121
|
+
page debt without blocking the adoption.
|
|
122
|
+
|
|
123
|
+
- **Post-suite page sweep and diagnostics (0.13.0).** `test-gates` asks the
|
|
124
|
+
witness to visit only page obligations without clean channel-B proof,
|
|
125
|
+
using seeded `pages.params` values or a unique matching engine-observed
|
|
126
|
+
create ID, with `PAGE_PARAM_UNBOUND` instead of guessing. `pages.sweep: false`
|
|
127
|
+
leaves gaps unproven. Page observations carry their `observed` or `swept`
|
|
128
|
+
channel; reports, `explain`, and `next` show page status and the cheapest
|
|
129
|
+
route, seed, or refusal fix.
|
|
130
|
+
|
|
131
|
+
- **Router `basename` and `pages.basePath` prefixes; unplaceable relative routes refused (0.13.0).**
|
|
132
|
+
The React Router reader prefixes page paths with a string-literal
|
|
133
|
+
`basename` read from the code — on `<BrowserRouter>`/`<HashRouter>`/`<MemoryRouter>`
|
|
134
|
+
or in the `createBrowserRouter`/`createHashRouter` options — so a page under
|
|
135
|
+
`basename="/app"` is discovered, visited, and route-matched at `/app/...`,
|
|
136
|
+
never at the bare route. A computed basename is never guessed: the pages
|
|
137
|
+
under it become `PAGE_ROUTE_UNRESOLVED` naming the `file:line`, and two
|
|
138
|
+
different basenames in one project raise an `AMBIGUOUS_BASENAME` finding.
|
|
139
|
+
A prefix that lives OUTSIDE the code (reverse proxy, sub-path host) is the
|
|
140
|
+
new optional `pages.basePath` key: it prefixes EVERY discovered page path
|
|
141
|
+
after the router `basename`, must start with `/` with no trailing slash,
|
|
142
|
+
and an invalid value is a config validation error naming the rule. A
|
|
143
|
+
relative route (`path="departments"`) with no parent route in its file and
|
|
144
|
+
no router root in the file is no longer silently joined onto `/departments`:
|
|
145
|
+
the page is not emitted and `PAGE_ROUTE_UNRESOLVED` says to make it
|
|
146
|
+
absolute or wrap it under its parent route.
|
|
147
|
+
|
|
148
|
+
- **Plain Playwright test compatibility.** The Playwright fixture now reuses
|
|
149
|
+
the runner's initialized core API if a raw test imports it while the public
|
|
150
|
+
CommonJS entry is still loading; raw tests keep running without requiring
|
|
151
|
+
Gateforge fixtures or producing page records.
|
|
152
|
+
|
|
153
|
+
- **Page promises report honest causes and honor waivers.** A missing
|
|
154
|
+
`page:loads`/`page:data-ok` was mislabeled `VERIFIER_UNSUPPORTED`
|
|
155
|
+
("drop the pack") although the page proof channel exists; it now maps
|
|
156
|
+
to `EVIDENCE_NOT_COLLECTED` with the actionable fix (a witnessed page
|
|
157
|
+
visit through a browser test, or the engine's post-suite sweep), while
|
|
158
|
+
an unknown `page:*` contract stays unsupported. Page obligations also
|
|
159
|
+
honor owner waivers on the same lane as every other obligation — same
|
|
160
|
+
exact scope, expiry, and stale-owner rules (an exemption recorded by
|
|
161
|
+
the owner, never proof; revoke it and the page grades on its evidence
|
|
162
|
+
again).
|
|
163
|
+
|
|
164
|
+
- **Bound page sweep RPCs by the number of engine visits, rather than the ordinary single-call deadline.**
|
|
165
|
+
|
|
166
|
+
- **Page API data is graded only after the response body completes.** A
|
|
167
|
+
page's API request now counts as settled only when the response BODY
|
|
168
|
+
finished (Playwright `requestfinished`), not at the response headers; a
|
|
169
|
+
failed or unfinished body refuses both page promises with
|
|
170
|
+
`PAGE_API_UNSETTLED`. Both proof channels — the browser tests' observed
|
|
171
|
+
channel and the referee's swept channel — wait for in-flight app data
|
|
172
|
+
requests (fetch/XHR by resource type, plus `/api/` paths) and a quiet
|
|
173
|
+
window after the last activity before grading, bounded by the shared
|
|
174
|
+
engine budget. Before, a 500 arriving 1.2 s after the headers, or a 200
|
|
175
|
+
whose body died mid-flight, was graded clean. A request the app itself
|
|
176
|
+
cancels (`net::ERR_ABORTED`) counts as settled only when the same method
|
|
177
|
+
and URL completed in the same visit; any other failure, or an unretried
|
|
178
|
+
cancel, refuses the page. Both proof channels now read completion from
|
|
179
|
+
the browser's own network events, so a response body the app never reads
|
|
180
|
+
still counts once every declared byte (Content-Length) arrived; an
|
|
181
|
+
unread body without a declared length stays unsettled. The observed
|
|
182
|
+
channel keeps Playwright as its request ledger and adds the browser's
|
|
183
|
+
network events only as a completion signal, correlated per method and
|
|
184
|
+
URL — a request the network events did not observe is never upgraded.
|
|
185
|
+
A failed page-observation flush no longer fails the app's own passing
|
|
186
|
+
test: the fixture logs one line and moves on (page proof stays missing,
|
|
187
|
+
never fabricated), and the flush call's timeout now derives from the
|
|
188
|
+
shared engine budget instead of the ordinary 5 s call deadline.
|
|
189
|
+
|
|
190
|
+
- **The latest page observation per test decides.** Per test, only a
|
|
191
|
+
page's latest observation (`observationSequence`) counts: an early
|
|
192
|
+
clean visit cannot hide a later refusal by the same test, while another
|
|
193
|
+
passing test's latest clean visit still proves the page. A missing or
|
|
194
|
+
malformed sequence never proves, and equal-sequence contradictions fail
|
|
195
|
+
closed with `PAGE_OBSERVATION_CONFLICT`. The post-suite sweep chooses
|
|
196
|
+
its gap visits with the same rule.
|
|
197
|
+
|
|
198
|
+
- **Page observation metadata is controller-held.** The route table,
|
|
199
|
+
login routes, error markers, trusted app origins, and static tamper
|
|
200
|
+
risks are registered by the CLI with the witness on the
|
|
201
|
+
verifier-authenticated expected-set registration;
|
|
202
|
+
`/sessions/page-observer` carries only the session credentials and the
|
|
203
|
+
debugging port, and a run without registered context issues no page
|
|
204
|
+
proof. A matched page whose final URL origin is not a trusted app
|
|
205
|
+
origin is refused with `PAGE_APP_ORIGIN_MISMATCH`. The suite receives
|
|
206
|
+
only an enablement flag (`GATEFORGE_PAGE_OBSERVATION_ENABLED`): it can
|
|
207
|
+
disable observation, never enable false proof. Before, a test could
|
|
208
|
+
hand the witness its own route table or point it at another server and
|
|
209
|
+
get witnessed proof.
|
|
210
|
+
|
|
211
|
+
- **A 401 on pages of an audience without a login counts as the expected
|
|
212
|
+
not-logged-in answer.** On a page whose `pages.audiences` declaration has
|
|
213
|
+
no `session:` (no login configured — e.g. a public `global` audience),
|
|
214
|
+
an app data call answering exactly 401 no longer refuses `page:data-ok`;
|
|
215
|
+
403 and every other error status still refuse there, and on audiences
|
|
216
|
+
WITH a login a 401 still refuses. The anonymity bit is controller-held —
|
|
217
|
+
derived from the audience declaration and registered with the witness on
|
|
218
|
+
the same verifier-authenticated path as the route table, never supplied
|
|
219
|
+
by the suite — so the observed and swept channels (and core grading,
|
|
220
|
+
which trusts the witness verdict) apply the same rule.
|
|
221
|
+
|
|
222
|
+
- **`gateforge next` resolves the witness verifier key ring like `check`.**
|
|
223
|
+
The key file and keyring locations now feed `next`'s durable-attestation
|
|
224
|
+
verification, not only the `GATEFORGE_WITNESS_VERIFIER_KEY` variable.
|
|
225
|
+
Before, with a verifier key file configured, `next` reported that
|
|
226
|
+
durable attestation cannot verify without a witness verifier key while
|
|
227
|
+
`check` passed.
|
|
228
|
+
|
|
3
229
|
## 0.12.0
|
|
4
230
|
|
|
5
231
|
### Added
|
package/README.md
CHANGED
|
@@ -4,6 +4,8 @@ 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.1:** The frontend detector now reads a trailing template-literal hole that provably renders only query or fragment text as a bare query marker instead of gluing it to the last path segment, so calls like `.../meters${qs}` join their backend route instead of reporting unwired (anything not provably a query suffix is unchanged). The supervisor's post-suite page sweep performs its witness HTTP calls with `node:http`/`node:https` directly, so the computed budget is the only deadline and a sweep budgeted longer than five minutes no longer aborts with `fetch failed` (error types, messages, and fail-closed behavior unchanged). A storage-only `addInitScript` (`localStorage`/`sessionStorage` set, `removeItem`/`clear`, optional `window.` receiver, and the `context.addInitScript` form) is no longer a page-observation tamper; the scan continues past it, and a real tamper later in the same file is still reported at its own line.
|
|
8
|
+
**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
9
|
**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
10
|
**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
11
|
**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 +155,14 @@ the blocking wiring. The full adopt contract, and the baseline
|
|
|
153
155
|
commands that shrink the recorded set: [Reference](guides/REFERENCE.md).
|
|
154
156
|
Under `strictE2E`, an adopted E2E obligation still blocks
|
|
155
157
|
as soon as a change touches it — adoption forgives today's
|
|
156
|
-
debt, never new work.
|
|
158
|
+
debt, never new work. A repository that adopted before the 0.13
|
|
159
|
+
pages rollout revises its adoption with `gateforge adopt --family
|
|
160
|
+
pages --confirm` (preview by default): one atomic receipt write
|
|
161
|
+
records a permanent `pages` family marker — every page obligation
|
|
162
|
+
discovered, proven pages included — forgiving only the then-missing
|
|
163
|
+
page debt; the marker survives every shrink, repeats add nothing,
|
|
164
|
+
and the digest change requires the owner's external repin for
|
|
165
|
+
strict gates ([Reference — the pages family](guides/REFERENCE.md#the-pages-family-adopting-page-debt-into-an-already-adopted-repo)).
|
|
157
166
|
|
|
158
167
|
## Development
|
|
159
168
|
|
|
@@ -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,
|
|
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"}
|
package/dist/adopted-baseline.js
CHANGED
|
@@ -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]) => fingerprints.has(fingerprint)));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adopted-baseline.js","sourceRoot":"","sources":["../src/adopted-baseline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAC9F,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,sBAAsB,CACpC,GAAW,EACX,aAAqB;IAUrB,MAAM,YAAY,GAAG,eAAe,CAAC,GAAG,EAAE,aAAa,CAAC,CAAC;IACzD,MAAM,QAAQ,GAAG,kBAAkB,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,wBAAwB,CAAC,CAAC,CAAC;IAC3F,IAAI,QAAQ,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IACnC,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC,YAAY,CAAC,CAAC;IACtE,MAAM,0BAA0B,GAC9B,QAAQ,CAAC,0BAA0B,KAAK,SAAS;QAC/C,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AO;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
|
|
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,
|
|
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
|
|
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"],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E,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC;QAC7D,KAAK,KAAK;YACR,OAAO,gBAAgB,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;QAC5E,KAAK,UAAU;YACb,OAAO,gBAAgB,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,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"}
|
package/dist/commands/adopt.d.ts
CHANGED
|
@@ -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 (
|
|
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":"
|
|
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"}
|