@gate-forge/cli 0.9.1 → 0.10.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.
Files changed (80) hide show
  1. package/CHANGELOG.md +343 -0
  2. package/README.md +3 -0
  3. package/dist/cache-exclusions.d.ts +20 -13
  4. package/dist/cache-exclusions.d.ts.map +1 -1
  5. package/dist/cache-exclusions.js +47 -33
  6. package/dist/cache-exclusions.js.map +1 -1
  7. package/dist/cli.d.ts +1 -1
  8. package/dist/cli.d.ts.map +1 -1
  9. package/dist/cli.js +11 -0
  10. package/dist/cli.js.map +1 -1
  11. package/dist/commands/check.d.ts.map +1 -1
  12. package/dist/commands/check.js +14 -14
  13. package/dist/commands/check.js.map +1 -1
  14. package/dist/commands/classify.d.ts +1 -0
  15. package/dist/commands/classify.d.ts.map +1 -1
  16. package/dist/commands/classify.js +230 -14
  17. package/dist/commands/classify.js.map +1 -1
  18. package/dist/commands/common.d.ts +6 -1
  19. package/dist/commands/common.d.ts.map +1 -1
  20. package/dist/commands/common.js +8 -1
  21. package/dist/commands/common.js.map +1 -1
  22. package/dist/commands/enforcement.d.ts +9 -1
  23. package/dist/commands/enforcement.d.ts.map +1 -1
  24. package/dist/commands/enforcement.js +306 -38
  25. package/dist/commands/enforcement.js.map +1 -1
  26. package/dist/commands/init.d.ts +20 -0
  27. package/dist/commands/init.d.ts.map +1 -1
  28. package/dist/commands/init.js +88 -56
  29. package/dist/commands/init.js.map +1 -1
  30. package/dist/commands/migrate.d.ts +14 -0
  31. package/dist/commands/migrate.d.ts.map +1 -0
  32. package/dist/commands/migrate.js +177 -0
  33. package/dist/commands/migrate.js.map +1 -0
  34. package/dist/commands/pre-commit.d.ts.map +1 -1
  35. package/dist/commands/pre-commit.js +8 -1
  36. package/dist/commands/pre-commit.js.map +1 -1
  37. package/dist/commands/tests.d.ts.map +1 -1
  38. package/dist/commands/tests.js +120 -40
  39. package/dist/commands/tests.js.map +1 -1
  40. package/dist/docs-exclusions.d.ts +32 -5
  41. package/dist/docs-exclusions.d.ts.map +1 -1
  42. package/dist/docs-exclusions.js +60 -26
  43. package/dist/docs-exclusions.js.map +1 -1
  44. package/dist/evidence-config-text.d.ts +57 -0
  45. package/dist/evidence-config-text.d.ts.map +1 -0
  46. package/dist/evidence-config-text.js +263 -0
  47. package/dist/evidence-config-text.js.map +1 -0
  48. package/dist/execution.d.ts +51 -8
  49. package/dist/execution.d.ts.map +1 -1
  50. package/dist/execution.js +61 -29
  51. package/dist/execution.js.map +1 -1
  52. package/dist/gateforge-owned.d.ts +1 -1
  53. package/dist/gateforge-owned.d.ts.map +1 -1
  54. package/dist/gateforge-owned.js +6 -9
  55. package/dist/gateforge-owned.js.map +1 -1
  56. package/dist/input-snapshot.d.ts.map +1 -1
  57. package/dist/input-snapshot.js +2 -6
  58. package/dist/input-snapshot.js.map +1 -1
  59. package/dist/legacy-exclusion-paths.d.ts +28 -0
  60. package/dist/legacy-exclusion-paths.d.ts.map +1 -0
  61. package/dist/legacy-exclusion-paths.js +48 -0
  62. package/dist/legacy-exclusion-paths.js.map +1 -0
  63. package/dist/pipeline.d.ts +8 -2
  64. package/dist/pipeline.d.ts.map +1 -1
  65. package/dist/pipeline.js +9 -8
  66. package/dist/pipeline.js.map +1 -1
  67. package/dist/repo-path.d.ts +3 -0
  68. package/dist/repo-path.d.ts.map +1 -0
  69. package/dist/repo-path.js +24 -0
  70. package/dist/repo-path.js.map +1 -0
  71. package/dist/staged-candidate.d.ts +36 -1
  72. package/dist/staged-candidate.d.ts.map +1 -1
  73. package/dist/staged-candidate.js +47 -0
  74. package/dist/staged-candidate.js.map +1 -1
  75. package/guides/CONNECT-YOUR-PROJECT.md +50 -1
  76. package/guides/QUICKSTART.md +43 -10
  77. package/guides/REFERENCE.md +206 -30
  78. package/guides/TEST-ENVIRONMENT.md +36 -0
  79. package/guides/UPGRADE-0.9-to-0.10.md +137 -0
  80. package/package.json +12 -10
@@ -14,7 +14,7 @@ You need Node.js 20 or newer and an existing Playwright suite that can run again
14
14
  - Answer the plane questions with `gateforge classify plane <folder> <tenant|master|global> --reason "<why>" --confirm` (run `gateforge init --planes` once first to create the owner-reviewed `.gateforge/planes.json`).
15
15
  - Adopt comes after the plane answers because a plane answer changes a resource's identity, so the debt set `adopt` records would not match the repository if it were captured before the answer.
16
16
  - Declare the dependency directories the staged commit gate may link (`prepare: { reuse: [node_modules] }` in `.gateforge/runtime.yml`): the gate runs on a checkout of the staged files only.
17
- - Pin the owner-approved policy digest LAST, right before the first strict commit: read the full value from `gateforge enforcement doctor` and set it as `GATEFORGE_APPROVED_POLICY_DIGEST`. It changes whenever a policy input changes — `.gateforge.yml`, the policies, the classification policy, `planes.json`, adapters, `runtime.yml`, waivers, hooks — so re-pin after every such edit. Stage every policy file first (`git add`) — the commit gate digests the staged bytes, and `enforcement doctor` warns when they differ from the working tree.
17
+ - Pin the owner-approved policy digest LAST, right before the first strict commit: `git add -A .gateforge .gateforge.yml && gateforge enforcement pin --pin-file ~/.config/<repo>.gateforge.env --confirm`. The flag is `--pin-file`, not `--env-file`: node itself consumes `--env-file <path>` anywhere in argv and would read the file instead of running the command. Without `--confirm` the command only prints the line it would write. The pin file must live OUTSIDE the repository — a file the candidate controls cannot approve its own policy revision — and the command refuses any path inside the repo, plus a policy input that is not fully staged (it names the file). The digest changes whenever a policy input changes — `.gateforge.yml`, the policies, the classification policy, `.gateforge/test-map.yml`, `planes.json`, adapters, `runtime.yml`, waivers, hooks — so re-pin after every such edit. `gateforge enforcement doctor` names the inputs that changed since HEAD (`policy-inputs-vs-HEAD`) and whether the provisioned pin still matches the staged bytes (`approved-digest`).
18
18
 
19
19
  ## 1. Install the CLI and the packs you use
20
20
 
@@ -24,15 +24,21 @@ Example for a React frontend, FastAPI backend, and SQLAlchemy data layer:
24
24
 
25
25
  ```sh
26
26
  npm i -D \
27
- @gate-forge/cli@0.9.1 \
28
- @gate-forge/pack-playwright@0.9.1 \
29
- @gate-forge/pack-http@0.9.1 \
30
- @gate-forge/pack-fastapi@0.9.1 \
31
- @gate-forge/pack-sqlalchemy@0.9.1
27
+ @gate-forge/cli@0.10.1 \
28
+ @gate-forge/pack-playwright@0.10.1 \
29
+ @gate-forge/pack-http@0.10.1 \
30
+ @gate-forge/pack-fastapi@0.10.1 \
31
+ @gate-forge/pack-sqlalchemy@0.10.1
32
32
  ```
33
33
 
34
34
  Use the project-local `gateforge` binary from your npm script or add `node_modules/.bin` to your shell `PATH`. If the scan recommends other packs, add only the ones your code uses, at the same version. A mismatched Gateforge package contract can stop the CLI with exit code 2 and `GATEFORGE_PACKAGE_INCOMPATIBLE`.
35
35
 
36
+ `gateforge init` prints that same command for you: after it writes the
37
+ config it names — in ONE line — every detector pack it enabled that your
38
+ `package.json` does not already declare, at the CLI's own version. Run
39
+ that line (init never runs npm for you), and commit the install on its own
40
+ before committing the setup files.
41
+
36
42
  **Installing from tarballs** (a release that is not on the registry yet): install every `.tgz` of that release in ONE command. The CLI depends on shared packages and packs that are not in the list above, and npm resolves them from the files only when they are all in the same install; a partial set makes npm look for the rest on the registry and fail with `E404`.
37
43
 
38
44
  ```sh
@@ -43,7 +49,7 @@ This installs every pack of the release; the scan still recommends the ones your
43
49
 
44
50
  **You should see:** npm installs the packages without a Gateforge compatibility error.
45
51
 
46
- **If not:** align every direct `@gate-forge/*` package to `0.9.1`, then install again. Do not work around the compatibility error.
52
+ **If not:** align every direct `@gate-forge/*` package to `0.10.1`, then install again. Do not work around the compatibility error.
47
53
 
48
54
  ## 2. Pick a goal
49
55
 
@@ -102,8 +108,8 @@ It writes:
102
108
  It also creates `.gateforge/adapters/` and `.gateforge/waivers/`, and adds
103
109
  `.gateforge/test-gates/` (Gateforge's own run state: catalog, caches,
104
110
  receipts, history) to `.gitignore` so `git add -A` never stages it. It
105
- preserves existing files. A chosen documentation exclusion adds
106
- `.gateforge/docs-exclusions.yml`.
111
+ preserves existing files. A chosen documentation exclusion is added to
112
+ `.gateforge.yml` under `evidence.exclude.docs`.
107
113
 
108
114
  **You should see:** a scan summary, recommended packages, the goal summary
109
115
  with its `undo:` lines, and a `skeleton ready` message.
@@ -300,6 +306,33 @@ Then run `gateforge next` again: the same block must not reappear. A route
300
306
  that is genuinely internal is the other answer, and it stays owner-only (an
301
307
  `internalRules` entry in `.gateforge/classification-policy.yml`).
302
308
 
309
+ The second owner question is what removal MEANS. Delete semantics are
310
+ proven, never guessed: a model that declares nothing keeps its resource
311
+ `unclassified` and blocks with `DELETE_SEMANTICS_UNRESOLVED` (nothing on
312
+ it accrues, and `gateforge explain <resource>` names it). You answer with
313
+ `hard` (the row is removed) or `archive` (the row stays, with your own
314
+ archived state):
315
+
316
+ ```sh
317
+ gateforge classify delete 'backend/models' hard \
318
+ --reason 'Rows in this model tree are removed permanently.' --confirm
319
+ ```
320
+
321
+ Like `classify plane` it previews without `--confirm`, and it takes one
322
+ file, one FOLDER (written as `match: 'backend/models/**'`), or one glob —
323
+ one reviewed rule per model tree, not per model. `archive` refuses to run
324
+ without the archived field values the run grades removal against:
325
+
326
+ ```sh
327
+ gateforge classify delete 'backend/models/invoice' archive \
328
+ --archive-field status=archived --archive-field archived_by=system \
329
+ --reason 'Invoices are archived, never removed.' --confirm
330
+ ```
331
+
332
+ Your declaration is an evidence contract, not an override: if a detector
333
+ reads the model and disagrees with your rule, the run blocks and names
334
+ both instead of picking one. Then run `gateforge next` again.
335
+
303
336
  To verify a specific commit tree (for example, the tip of a pushed ref)
304
337
  instead of the current worktree or index:
305
338
 
@@ -394,7 +427,7 @@ the registry. To gate a release that is not on the registry yet (a local
394
427
  regenerate:
395
428
 
396
429
  ```sh
397
- GATEFORGE_CI_ENGINE_SOURCE=vendor/gate-forge-cli-0.9.1.tgz \
430
+ GATEFORGE_CI_ENGINE_SOURCE=vendor/gate-forge-cli-0.10.1.tgz \
398
431
  gateforge enforce --ci github
399
432
  ```
400
433
 
@@ -9,7 +9,8 @@ first commands; the guides cover the walks:
9
9
  [Quickstart](QUICKSTART.md), [Connect your project](CONNECT-YOUR-PROJECT.md),
10
10
  [Test environment](TEST-ENVIRONMENT.md),
11
11
  [Runners other than Playwright](RUNNER-NEUTRAL-EVIDENCE.md),
12
- [Upgrade from 0.8 to 0.9](UPGRADE-0.8-to-0.9.md).
12
+ [Upgrade from 0.8 to 0.9](UPGRADE-0.8-to-0.9.md),
13
+ [Upgrade from 0.9 to 0.10](UPGRADE-0.9-to-0.10.md).
13
14
 
14
15
  ## Contents
15
16
 
@@ -21,6 +22,7 @@ first commands; the guides cover the walks:
21
22
  - [Enforcement](#enforcement)
22
23
  - [Contract capabilities](#contract-capabilities)
23
24
  - [Configuration](#configuration)
25
+ - [Classification policy (`.gateforge/classification-policy.yml`)](#classification-policy-gateforgeclassification-policyyml)
24
26
  - [Plugin invocation](#plugin-invocation)
25
27
  - [Endpoint plane rules (`.gateforge/planes.json`)](#endpoint-plane-rules-gateforgeplanesjson)
26
28
  - [Endpoint capability rules (`.gateforge/endpoints.json`)](#endpoint-capability-rules-gateforgeendpointsjson)
@@ -42,18 +44,20 @@ first commands; the guides cover the walks:
42
44
  | Command | Purpose | Exit codes |
43
45
  | --- | --- | --- |
44
46
  | `gateforge init [--preset light\|normal\|strict] [--explain-presets] [--languages <comma,list>] [--plugins <comma,list>] [--accept-recommended] [--no-scan] [--proof overlay\|observe] [--blocking] [--no-blocking] [--pre-commit] [--no-pre-commit] [--ci] [--no-ci] [--planes] [--no-planes] [--strict-e2e] [--docs-exclude <folder,...>] [--docs-exclude-file <path>] [--confirm-doc-exclusions]` | Scan the repo (heuristics, no network), print the recommended install (plugins, persistence policy, transport-only HTTP policy for consumed endpoints, overlay proof), and write the standard Gateforge scaffold. Idempotent — never overwrites existing files unless `--confirm-doc-exclusions` approves an exclusion update. It also appends Gateforge's own engine state (`.gateforge/test-gates/`) to `.gitignore`, and on a repository that already has code it names `gateforge adopt` as the way through the debt the first commit will meet. `pack-task` is opt-in only (`--plugins`); `--proof observe` skips the overlay scaffold and prints the observe wiring checklist instead. Default language: `python`. `--preset` applies one goal in one step (`light` -> `mode: warn`, no hooks; `normal` -> `mode: changed` + pre-commit hook + CI job; `strict` -> `mode: strict` + staged gate + pre-push receipt check + CI job) and prints what it wrote plus `undo:` lines for created and in-place-changed files; `--explain-presets` prints that mapping and writes nothing. In a terminal init asks the same question instead; with no terminal and no `--preset` it writes `light` only and says so on one line with the `--preset` flag that changes it. The negative forms (`--no-blocking`, `--no-pre-commit`, `--no-ci`, `--no-planes`) answer the matching question without a prompt. A preset never writes a waiver, an adopted baseline or a plane rule, and an existing `.gateforge.yml` is never rewritten. `--strict-e2e` writes the `enforcement` block and refuses unavailable required proof channels. | 0/1/2 |
47
+ | `gateforge migrate [--confirm]` | Move owner declarations out of their own files and into `.gateforge.yml`. Today that is the evidence exclusions: `.gateforge/docs-exclusions.yml` and `.gateforge/cache-exclusions.yml` become `evidence.exclude.docs` and `evidence.exclude.cache`. Preview by default — it prints the exact `.gateforge.yml` diff and the files it would delete, writes nothing, exits 0; `--confirm` writes the block as TEXT (your YAML is never re-serialized), deletes the old files, and ends with `policy inputs changed: re-pin the approved digest (gateforge enforcement doctor)`. It validates the old files with the loader rules, refuses an `evidence:`/`exclude:`/`docs` form it cannot extend safely by name, and is idempotent (`nothing to migrate`, exit 0). Every other command refuses a repository that still carries an old file, naming this one. | 0/2 |
45
48
 
46
49
 
47
50
 
48
51
  | `gateforge next [--changed] [--json]` | Print the ONE blocking next action (`next`/`cause`/`why`/`do`; `--json` adds `remainingBlocking` and route-specific `guidance` when relevant). For an endpoint with no plane, ask which boundary owns its data and show the owner-reviewed choices; internality remains owner-only. Navigation, not the gate: never requires an E2E receipt. Exit 0 clean, 1 next action, 2 config/usage. | 0/1/2 |
49
52
  | `gateforge discover [--json]` | Run every configured detector over the expanded `project.paths` and dump the resource graph (default: human listing; `--json`: GF-canonical JSON). | 0 |
50
53
  | `gateforge classify [--json] [--write-snapshot <path>]` | Recompute effective classifications from detector signals and print decisions, traces, and typed blocks. `classify plane` previews or explicitly appends an owner-reviewed endpoint plane rule to the existing `.gateforge/planes.json`; snapshots are derived review artifacts and never pipeline input. | 0/1/2 |
54
+ | `gateforge classify delete <file\|folder\|glob> <hard\|archive> [--archive-field <key=value>]... --reason <text> [--confirm]` | Preview (default) or explicitly append one owner delete-semantics rule to `.gateforge/classification-policy.yml`: how removal manifests for every model whose source file matches the pattern. `archive` requires at least one `--archive-field` (the owner-owned archived state the run grades removal against); `hard` refuses the flag. The preview writes nothing, prints the exact diff, and quotes the policy-pin consequence; `--confirm` appends the rule at TEXT level — the key at the end of the document when absent, a new `- match:` item at the end of the block when present — so every byte the owner wrote survives (comments, key order, flow sequences), and the resulting document is validated against the pinned schema. A `deleteRules` the command cannot extend safely (flow style, or a value that is not a list of rules) is refused by name. An existing rule for the same source is reported, never shadowed. Declaring is an evidence contract, not an override: contradicting detector evidence still blocks. | 0/2 |
51
55
  | `gateforge explain <resourceId\|path> [--json]` | Show one resource's detector signals, classification rules, decision fingerprint, typed blocks, and generated obligations. A repo-relative PATH is also a target: when no resource matches it, the command prints what the file is and what governs it (Gateforge policy input, declared gate input, owner-declared documentation folder, known source of a resource, or an unclassified change) with the steps that attribute it — this is the answer an unmapped `CHANGE_UNMAPPED` file needs. An unknown target stays unknown (exit 1). | 0/1/2 |
52
56
  | `gateforge tests discover [--json] [--pytest]` | Inventory existing tests into the derived run-state catalog: static analysis reconciled with native Playwright enumeration (`--list`). Unresolved wrappers, parse errors, and inventory gaps are DATA (never an empty catalog — failed native enumeration is exit 2). `--pytest` additionally collects the configured diagnostic suites' node ids (`--collect-only`). Playwright enumeration runs ONE config (a repo-root config wins; otherwise the alphabetically first config one directory deep), and when the repo holds more than one the runner line names every config, the one used, why, and the ones NOT inventoried. `inventoryComplete=false` means a reconciliation gap (an enumerated-vs-static mismatch, an unresolved case, or a not-inventoried extra config), not a partial success. | 0/2 |
53
- | `gateforge tests suggest [--changed] [--json]` | Resolve mappings for the run's obligations and produce reuse-ordered existing-test candidates with typed causes (`TEST_MAPPING_MISSING` / `TEST_KIND_UNKNOWN` / `TEST_MAPPING_AMBIGUOUS` / `TEST_MAPPING_STALE`). Candidates are RANKED by the evidence their catalog row carries (explicit tag, resource token in title/file, operation word, route segment, unmocked folder, minus mocks) with the matching reason printed as `why:`; the text surface prints the top five and names how many it hid, `--json` carries every candidate with its `rank` and `score`. With a candidate present the next action is to MARK it `observed-e2e` and run it under the witness — the overlay instruction belongs to `newTestNeeded: true`. When Playwright reports load errors and enumerates no tests, report one `TEST_INVENTORY_INCOMPLETE` with the error count and first error instead of stale-mapping fan-out; the action is to install the missing dependency and rerun Gateforge. An inspection surface, NOT a gate: exit 0 even with blocking problems. | 0/2 |
54
- | `gateforge tests mark --test <key> --kind <kind> [--category <c>]... --obligation <id>... --reason "<text>"` | Declare an existing test in `.gateforge/test-map.yml` (see the test-reuse workflow below). Validates against the CURRENT catalog and obligation registry, writes atomically and idempotently, prints the exact diff. Never edits test files, never adds waivers, refuses contradictions. | 0/2 |
57
+ | `gateforge tests suggest [--changed] [--json]` | Resolve mappings for the run's obligations and produce reuse-ordered existing-test candidates with typed causes (`TEST_MAPPING_MISSING` / `TEST_KIND_UNKNOWN` / `TEST_MAPPING_AMBIGUOUS` / `TEST_MAPPING_STALE`). Candidates are RANKED by the evidence their catalog row carries (explicit tag, resource token in title/file, operation word, route segment, unmocked folder, minus mocks) with the matching reason printed as `why:`; the text surface prints the top five and names how many it hid, `--json` carries every candidate with its `rank` and `score`. The reuse verdict `newTestNeeded` has THREE honest values: `no` (the `#1` candidate is an unmocked e2e row more than one signal supports), `yes` (no candidate survived resolution, or every candidate mocks the system under test) and `unverified` (a candidate exists but one signal carries it — confirm the request with `gateforge explain <obligation>` before marking). The next action follows it: MARK the candidate and run it under the witness when the verdict is `no`, write the overlay when it is `yes`. When Playwright reports load errors and enumerates no tests, report one `TEST_INVENTORY_INCOMPLETE` with the error count and first error instead of stale-mapping fan-out; the action is to install the missing dependency and rerun Gateforge. An inspection surface, NOT a gate: exit 0 even with blocking problems. | 0/2 |
58
+ | `gateforge tests mark --test <key> --kind <kind> [--category <c>]... --obligation <id>... --reason "<text>"` | Declare an existing test in `.gateforge/test-map.yml` (see the test-reuse workflow below). `--test` accepts EITHER documented key form: the catalog `logicalKey` (`playwright:chromium:e2e/accounts.spec.ts:Accounts>deletes an account`) or the reconciliation key `<file>#<titlePath joined by '>'` (`e2e/accounts.spec.ts#Accounts>deletes an account`). The sidecar always stores the `logicalKey`. Validates against the CURRENT catalog and obligation registry, writes atomically and idempotently, prints the exact diff. Never edits test files, never adds waivers, refuses contradictions. | 0/2 |
55
59
  | `gateforge tests sync [--json]` | AST-only scan of test annotations; updates generated `source: annotation` entries in `.gateforge/test-map.yml` and leaves handwritten entries unchanged. Reports unresolved helpers with source locations; does not run tests. | 0/1/2 |
56
- | `gateforge tests explain --test <key> [--json]` | Per-test report: requirements, existing-test identity, mapping origin, honest execution status, next action, `New test needed`. | 0/2 (unknown key → 2) |
60
+ | `gateforge tests explain --test <key> [--json]` | Per-test report: requirements, existing-test identity, mapping origin, honest execution status, next action, and the same three-state reuse verdict `New test needed` (`no` / `yes` / `unverified`) `tests suggest` prints — built from the SAME route evidence, so the two surfaces never disagree about one test. `--test` takes the same two key forms as `tests mark` (see above). | 0/2 (unknown or ambiguous key → 2) |
57
61
  | `gateforge tests diagnose [--suite <name>] [--json]` | Run the configured pytest diagnostic suites once per suite, isolated (own process, `GATEFORGE_*` stripped, finite timeout). Advisory: exit 0 completed run (≥1 pass, no unexpected failures), 1 test failures, 2 unavailable/incomplete (collection error, timeout, missing interpreter, interruption, zero tests, or only skipped/xfail). Never E2E proof. | 0/1/2 |
58
62
  | `gateforge obligations [--json]` | Evaluate policies against the automatically classified graph and dump obligations, blocking entries, and claim assessments. | 0/1/2 |
59
63
  | `gateforge check [--changed] [--staged] [--candidate-commit <sha>] [--require-e2e] [--timing] [--no-cache] [--format text\|json\|sarif]` | The full gate: discover → classify → obligations → claims → verdicts → report. `--timing` appends per-step wall-clock timings (detectors, test collection, TS scan, planning, total) — an additive report key in json and one line in text, never an input to any verdict. Detector and pytest-collection results are cached under the excluded run-state dir. Detector keys include plugin config, executable module/script bytes, Python import environment, inputs, interpreter packages, and Gateforge engine version; pytest keys include all Python/config file bytes, collector argv/environment, interpreter identity, and engine version. Unchanged successful pytest collections reuse their node ids; any changed Python byte recollects. Any uncertainty runs fresh. The report carries additive `cache: {hits, misses}` counts. `--no-cache` (or `GATEFORGE_NO_CACHE=1`, or a CI environment) disables cache reads and writes. | 0 clean/waived, 1 unresolved, 2 config/usage error |
@@ -65,6 +69,7 @@ first commands; the guides cover the walks:
65
69
  | `gateforge key create|import-env|rotate|retire [--file <path>] --confirm` | Owner-only key ceremony. With no `--file` the ring is `${XDG_CONFIG_HOME:-$HOME/.config}/gateforge/verifier-keyring.json` — the parent directory is created, mode `0600` — and every later command reads that same path, so no `GATEFORGE_WITNESS_VERIFIER_KEY_FILE` export is needed; pass `--file <path>` AND export that variable only when the ring lives elsewhere. Creates, imports, rotates, or retires keys without printing secrets. | 0/2 |
66
70
  | `gateforge pre-commit --scope staged\|full` | The witnessed commit gate: freezes the Git index, materializes it into a scratch checkout, prepares the candidate's staged runtime (`.gateforge/runtime.yml` — below), runs the supervised witness gate INSIDE that checkout (`staged`: only tests mapped to obligations affected by the staged paths, `EVIDENCE_SCOPE_INCOMPLETE` blocks an unmapped affected obligation; `full`: the complete relevant mapped suite), validates the fresh receipt against the same checkout, rechecks the original index/HEAD/MERGE_HEAD, and copies only Gateforge audit artifacts (run state incl. runtime logs) back. Runtime preparation/readiness failures are typed (`RUNTIME_PREPARATION_FAILED` / `RUNTIME_READINESS_FAILED`); child process groups are cleaned up on every exit path. Install via `gateforge init --blocking --witnessed staged\|full`. | 0/1/2 |
67
71
  | `gateforge enforcement doctor [--json]` | Reports verified enforcement `level` (0–3), hook activation, wired CI templates, and read-only GitHub/GitLab branch-protection results; missing credentials or uncertain responses remain `not verified`. A local hook never counts as server protection. Its `engine:` line reports the install provenance npm's own metadata proves: a tarball/directory install (read from `node_modules/.package-lock.json`, or the manifest's `_resolved`) is named as such instead of claiming the registry, and an install with no readable metadata is reported as unproven rather than as an all-clear. The receipt's `engine.source` is receipt-bound and keeps its meaning. Diagnostic only: exit 0 whenever it runs. | 0/2 |
72
+ | `gateforge enforcement pin --pin-file <path> [--confirm]` | Writes the owner-approved policy digest of the STAGED candidate into an env file OUTSIDE the repository. The flag is `--pin-file`, NOT `--env-file`: Node itself consumes `--env-file <path>` (and `--env-file-if-exists <path>`) anywhere in argv — it reads the file and exits 9 on a missing one, so the CLI would never run. The digest is the one the commit gate computes: the index is frozen and materialized exactly as `check --staged` does, and the entries are hashed by the same function. It refuses when a policy input is not fully staged, naming the files. Preview by default — the line it would write, nothing written. `--confirm` replaces exactly the `GATEFORGE_APPROVED_POLICY_DIGEST=<hex>` line, drops a duplicate assignment, leaves every other line untouched, never prints another line of the file, and writes the file mode `0600`. A path inside the repository is refused: the pin must live outside the candidate, because a candidate-controlled file cannot approve policy. A symlink or a non-regular file is refused too (fail closed). | 0/2 |
68
73
  | `gateforge enforce [--ci github\|gitlab]` | Add blocking wiring to an initialized repository. The provider defaults to GitLab unless GitHub is the only detected CI provider; the explicit flag selects GitHub Actions or GitLab CI. Appending to an EXISTING `.pre-commit-config.yaml` is announced as an action on one line, naming the file as the repository's own and printing the exact way back (`git restore -- .pre-commit-config.yaml` for a tracked file; for an untracked one, which has nothing to restore, the line says to delete the appended entry). The generated GitHub workflow installs `@gate-forge/cli@<version>` from the registry unless `GATEFORGE_CI_ENGINE_SOURCE` is set when the generator runs: it then installs that one npm specifier (a `.tgz` path, a directory, or any specifier) through the step environment, for a release that is not on the registry. Unset the variable and rerun for the registry install. | 0/2 |
69
74
  | `gateforge adopt` | Adopt an EXISTING repository: run it once, after `init`, on a project that already has code and therefore already has findings. Records today's blocking findings (pin-#2 obligation fingerprints, blocking entries, and the classification-blocked resource identities) into `.gateforge/baselines/obligations.json`, sanctioned by a dated, count-annotated receipt `.gateforge/baselines/adoption.json` — without that receipt a baseline forgives nothing — then applies the blocking wiring through the same idempotent path as `init --blocking`. It is the ONE sanctioned bulk-add and only once per repository: a second `adopt` is a no-op success. The recorded set is shrink-only (`gateforge baseline update` shrinks it) and never forgives new work. With `enforcement.strictE2E: true`, a baselined E2E obligation is not proof and blocks with `ENFORCEMENT_UNTRUSTED` again as soon as a change touches it. `adopt --help` prints this contract. | 0/2 |
70
75
  | `gateforge baseline update <fp...>` | Shrink the baseline to a strict subset (invariant 4). | 0/2 |
@@ -375,6 +380,32 @@ tests:
375
380
  reason: Existing journey deletes the selected account.
376
381
  ```
377
382
 
383
+ `--test` accepts EITHER of the two key forms the surfaces hand you, and
384
+ both name the same test. The catalog `logicalKey` is what `tests discover`,
385
+ `tests suggest` and `check` print:
386
+
387
+ ```bash
388
+ gateforge tests mark --test 'playwright:chromium:e2e/accounts.spec.ts:Accounts>deletes an account' …
389
+ ```
390
+
391
+ The reconciliation key `<file>#<titlePath joined by '>'` — the form
392
+ REFERENCE uses for sidecar bindings and the one the runner's own test
393
+ events carry — resolves to the same catalog row, so a key copied out of a
394
+ report works without a lookup step:
395
+
396
+ ```bash
397
+ gateforge tests mark --test 'e2e/accounts.spec.ts#Accounts>deletes an account' …
398
+ gateforge tests explain --test 'e2e/accounts.spec.ts#Accounts>deletes an account'
399
+ ```
400
+
401
+ The sidecar always stores the `logicalKey` (as above), so a mapping's
402
+ identity never depends on which form was typed. When the same file and
403
+ title run under SEVERAL runner projects, the reconciliation key matches
404
+ more than one catalog row and the error names every matching
405
+ `logicalKey` — only that form tells the projects apart. An unknown key
406
+ names both accepted forms and, when the file part does exist in the
407
+ catalog, lists up to five of that file's real keys.
408
+
378
409
  `--kind` is one of `browser-e2e`, `observed-e2e`, `api-e2e`, `unit`, `integration`,
379
410
  `component`, `unknown`. A declaration is INTENT, never proof:
380
411
 
@@ -394,10 +425,18 @@ tests:
394
425
  witnessed evidence for this change grades `EVIDENCE_NOT_COLLECTED` —
395
426
  blocking.
396
427
 
397
- `tests suggest` emits `newTestNeeded: true` only when no suitable existing
398
- candidate survives resolution. An unsupported proof channel produces a
399
- capability task (`VERIFIER_UNSUPPORTED`), never a request to generate more
400
- tests.
428
+ `tests suggest` emits a THREE-STATE reuse verdict, never a boolean:
429
+ `no` when the `#1` candidate is an unmocked e2e row that more than ONE
430
+ signal supports (an explicit tag naming this resource, or a resource-token
431
+ match together with a file that names the route); `yes` when no candidate
432
+ survived resolution or every candidate mocks the system under test; and
433
+ `unverified` when a candidate exists but ONE signal carries it — a name in
434
+ common is not proof the test drives that request, so the next action is
435
+ the check (`new test needed: unverified — check that a candidate really
436
+ sends <METHOD> <route> before marking (gateforge explain <obligation>)`),
437
+ never a ready-made `tests mark` command. An unsupported proof channel
438
+ produces a capability task (`VERIFIER_UNSUPPORTED`), never a request to
439
+ generate more tests.
401
440
 
402
441
  ### Ranked candidates
403
442
 
@@ -405,6 +444,26 @@ Candidates are RANKED by the evidence the catalog row itself carries, not
405
444
  listed alphabetically: an explicit `@crud(...)` tag, a resource token in the
406
445
  title path or the file, the obligation's operation word, a route segment from
407
446
  the run's route inventory, a `real/` (unmocked) folder, minus a mock signal.
447
+ Tokens are matched WHOLE-WORD (title path words; file path segments split on
448
+ `/ . _ -`), never inside a longer word, and a generated resource id
449
+ contributes only its NAME: the plane (`tenant`), the transport (`http`), the
450
+ method (`get`), route furniture (`api`, `v1`), the `param` marker that stands
451
+ in for a `{route_param}`, and the trailing id hash identify no resource, so
452
+ `@crud(tenant.accounts:create)` is never evidence for
453
+ `tenant.http-get-api-v1-notifications-…`. A tag is a DECLARATION: only its
454
+ resource part (the text before `:` in `@crud(tenant.accounts:read)`, minus the
455
+ plane) counts as a resource name, and the tag text itself is stripped before
456
+ the title is read as prose — the `:read` in that tag never matches a `…/read`
457
+ route segment.
458
+ For an `http:*` obligation that operation must also FIT the route's method —
459
+ `GET`/`HEAD` read, `POST` create, `PUT`/`PATCH` update, `DELETE` delete. A tag
460
+ declaring `create` says the test creates the resource, which is no evidence
461
+ that it reads `GET /api/v2/accounts`, so it scores nothing there; with no
462
+ other evidence the row is not a candidate and the verdict is `unverified`,
463
+ never a `no` that would send the owner to mark a create test as the proof of
464
+ a read. A non-transport obligation has no route method to fit, so its tags
465
+ stay judged on the resource alone.
466
+
408
467
  Every weight is additive and printed as a `why:` line, so the order explains
409
468
  itself — the score is never a bare number. Ties break on the logical key, so
410
469
  the list is deterministic. The text surface prints the top five and says how
@@ -431,12 +490,14 @@ that line.
431
490
 
432
491
  ### One instruction, not two
433
492
 
434
- When a candidate exists, the suggestion's next action is to MARK that
435
- existing test `observed-e2e` and run it under the witness
436
- (`gateforge tests mark --test <key> --kind observed-e2e --obligation <id>
437
- --reason "…"` then `gateforge test-gates --changed`). The overlay
438
- instruction — write `tests/e2e/gateforge/<resource>.<op>.spec.js` — belongs
439
- to `newTestNeeded: true`, i.e. no existing test fits. A suggestion block
493
+ When a candidate exists and its verdict is `no`, the suggestion's next
494
+ action is to MARK that existing test `observed-e2e` and run it under the
495
+ witness (`gateforge tests mark --test <key> --kind observed-e2e
496
+ --obligation <id> --reason "…"` then `gateforge test-gates --changed`).
497
+ The overlay instruction — write
498
+ `tests/e2e/gateforge/<resource>.<op>.spec.js` — belongs to
499
+ `newTestNeeded: yes`, i.e. no existing test fits; an `unverified` verdict
500
+ asks you to confirm the candidate's request first. A suggestion block
440
501
  never tells you to write a new overlay test and, in the same breath, to
441
502
  reuse the test it just listed.
442
503
 
@@ -629,12 +690,17 @@ and `--require-e2e` blocks — it never downgrades to a weaker pass.
629
690
  Gateforge hashes all inputs and all candidate files. On a terminal, the first
630
691
  `gateforge init` asks for documentation-only folders to exclude. Automation can
631
692
  use `gateforge init --docs-exclude docs,handbook`; a non-interactive run with no
632
- option keeps the default. Gateforge writes the approved declaration to
633
- `.gateforge/docs-exclusions.yml` and prints the candidate trusted-policy digest
634
- to approve through the protected `GATEFORGE_APPROVED_POLICY_DIGEST` setting.
635
- Gate checks refuse to use the exclusions until that external pin matches. A
636
- later change to the exclusion declaration changes the digest; use
637
- `--confirm-doc-exclusions` when `init` changes an existing approval.
693
+ option keeps the default. Gateforge writes the approved declaration into
694
+ `.gateforge.yml`, under `evidence.exclude.docs`, and prints the candidate
695
+ trusted-policy digest to approve through the protected
696
+ `GATEFORGE_APPROVED_POLICY_DIGEST` setting. Gate checks refuse to use the
697
+ exclusions until that external pin matches. A later change to the declaration
698
+ changes the digest; use `--confirm-doc-exclusions` when `init` changes an
699
+ existing approval. The declaration is inserted as text, so the rest of your
700
+ `.gateforge.yml` (comments, key order, quoting) is preserved byte for byte.
701
+ Before 0.10 this list lived in its own `.gateforge/docs-exclusions.yml`; a
702
+ repository that still carries that file is refused by name until
703
+ `gateforge migrate --confirm` moves it.
638
704
 
639
705
  The project states these folders do not affect the product or its tests.
640
706
  Gateforge does not prove this. If application or test code reads an excluded
@@ -658,16 +724,36 @@ reduced guarantee still apply.
658
724
  default, Python bytecode remains part of candidate and input identity. To
659
725
  exclude only exact generated cache files, run
660
726
  `gateforge init --cache-exclude src/__pycache__/module.cpython-313.pyc`.
661
- The command writes `.gateforge/cache-exclusions.yml` and prints the trusted
662
- policy digest to approve outside the repository. A matching protected
727
+ The command writes the list into `.gateforge.yml` under
728
+ `evidence.exclude.cache` and prints the trusted policy digest to approve
729
+ outside the repository. A matching protected
663
730
  `GATEFORGE_APPROVED_POLICY_DIGEST` pin is REQUIRED before a gate uses the
664
- list; changing an existing list requires `--confirm-cache-exclusions`.
731
+ list; changing an existing list requires `--confirm-cache-exclusions`. Before
732
+ 0.10 this list lived in `.gateforge/cache-exclusions.yml`, and
733
+ `gateforge migrate --confirm` moves it.
665
734
  Only exact `.pyc` or `.pyo` files directly under `__pycache__` are allowed;
666
735
  globs, symlinks, configured inputs, and other file types fail closed. Reports
667
736
  show the exact files, pin status, and reduced trust guarantee. This is an
668
737
  owner assertion, not proof that the excluded bytecode cannot affect runtime
669
738
  behavior.
670
739
 
740
+ **Re-pinning the approved policy digest.** The pin is one aggregate hash, so a
741
+ mismatch alone never said WHICH input moved. Two things answer that now.
742
+ `gateforge enforcement doctor` reports `policy-inputs-vs-HEAD` — the
743
+ trusted-digest inputs whose STAGED bytes differ from HEAD, named one by one
744
+ (`policy inputs changed since HEAD: .gateforge.yml, .gateforge/runtime.yml`); a
745
+ whitespace-only edit counts, because it moves the digest — and `approved-digest`,
746
+ which compares the provisioned pin with the STAGED digest: `matches staged`,
747
+ `does NOT match staged (changed inputs: …)`, or `absent`. Both rows read the one
748
+ entry list the digest is computed from, so they cannot disagree.
749
+ `gateforge enforcement pin --pin-file <path> [--confirm]` then writes that value
750
+ for you. The policy inputs it covers are `.gateforge.yml`, the policies and
751
+ classification-policy documents, `.gateforge/test-map.yml`, the behavior and
752
+ runtime documents, the adapters, waivers and quarantine directories, and every
753
+ local in-process plugin module. Stage every policy file first: the pin digests
754
+ the STAGED bytes, and a working tree that differs from the index is refused by
755
+ name instead of pinning a revision the gate never digests.
756
+
671
757
  **Managed mode** (config `enforcement.mode: managed`) — the literal
672
758
  no-bypass guarantee requires putting the authoritative Git metadata, commit
673
759
  service, gate executable, policy authority, and signing material OUTSIDE the
@@ -742,7 +828,7 @@ else):
742
828
  | Namespace | Status |
743
829
  | --- | --- |
744
830
  | `persistence:create\|read\|update\|delete` | AVAILABLE — engine-observed same-entity persistence reads with the exact-value echo requirement (`EVIDENCE_VALUE_MISMATCH` on a mismatched echo, even when the status was 2xx) |
745
- | `http:request-observed`, `http:response-status-ok` | AVAILABLE — transport semantics only: a witness-observed exchange plus a provenance-verified claimed `ui.action` anchor from the declaring test |
831
+ | `http:request-observed`, `http:response-status-ok` | AVAILABLE — engine browser, or the Observe channel for tests mapped `observed-e2e` (an exchange the witness proxied in the test's own session; test attribution is suite-claimed). The engine path grades FIRST and its verdict is final: a `satisfied` grade keeps its own record ids, and an `invalid` one (a witnessed exchange of a different endpoint, a non-2xx response) is an engine-found error no second channel may mask. The Observe channel is consulted only when the engine path found nothing |
746
832
  | `http:frontend-request-observed` | UNAVAILABLE — no independent browser/test attribution channel; explicit selection remains blocking `missing` with `VERIFIER_UNSUPPORTED` |
747
833
  | `crud:*` (UI-semantic) | FAIL-CLOSED — the tested suite owns the browser; use `persistence:*` |
748
834
  | `http:effect-verified`, `http:read-result-verified` | AVAILABLE (behavior-case channel) — graded across the approved required cases with witness-issued `behavior.case` records; needs a compiled `behaviorPolicy` requirement set |
@@ -844,6 +930,77 @@ Enforcement-relevant sections:
844
930
  `cypress`. `check`, `next`, `tests`, `test-gates`, `doctor` and `init`
845
931
  all follow it. See `guides/RUNNER-NEUTRAL-EVIDENCE.md`.
846
932
 
933
+ ## Classification policy (`.gateforge/classification-policy.yml`)
934
+
935
+ The repository-wide deterministic classification inputs. `gateforge init`
936
+ scaffolds the file; every key is an OWNER answer, and the file
937
+ participates in the trusted-policy digest, so changing it re-approves any
938
+ approved policy pin before strict gates run.
939
+
940
+ | Key | What it decides | Shape |
941
+ | --- | --- | --- |
942
+ | `scanRoots` | the files a closed-world proof must cover | repo-root-relative globs |
943
+ | `trustedInternalEntryPoints` | which entry-point categories certify internality | category + patterns + detector |
944
+ | `internalRules` | organization rules for internal resources | `resourceName` / `resourceKind` patterns |
945
+ | `lifecycleRules` | operations that structurally do not exist, for one EXACT resource | exact `<plane>.<resource>` + `disable` |
946
+ | `deleteRules` | how removal manifests, per source glob | `match` glob + `semantics` (+ `archiveFields`) |
947
+ | `coverage` | which detector must examine which files before a proof counts | capability + detector + globs (+ `exhaustive`) |
948
+ | `declarations` | the declaration syntax detectors may emit | source strings |
949
+ | `volatileFields` | bookkeeping columns that never satisfy an update | column names |
950
+
951
+ Unknown keys, an unknown value, and two rules answering the same target
952
+ are refused (exit 2, fail closed) — the document is an input, never a
953
+ place to smuggle intent past the schema.
954
+
955
+ ### Owner-declared delete semantics (`deleteRules`)
956
+
957
+ Delete semantics are proven, never guessed. A detector that reads the
958
+ model's own declaration can prove `hard` or `archive`; when nothing
959
+ proves them, the resource stays `unclassified` and blocks with
960
+ `DELETE_SEMANTICS_UNRESOLVED` (no obligations accrue, and `gateforge
961
+ explain <resource>` names the resource and its source file). `lifecycleRules`
962
+ can DISABLE delete for one exact resource; declaring semantics is the
963
+ other half of the answer, and it needs a pattern because one declaration
964
+ usually covers a whole model tree.
965
+
966
+ ```yaml
967
+ deleteRules:
968
+ - match: 'backend/models/session/**'
969
+ semantics: hard
970
+ reason: 'Sessions are removed the moment the tenant logs out.'
971
+ - match: 'backend/models/invoice/**'
972
+ semantics: archive
973
+ archiveFields:
974
+ status: archived
975
+ reason: 'Invoices are retained for the audit window.'
976
+ ```
977
+
978
+ - `match` is a repo-root-relative glob over the SOURCE FILE of the
979
+ resources it declares for — the same glob engine `.gateforge/planes.json`
980
+ uses. It must stay inside the repository.
981
+ - `semantics` is `hard` or `archive`. `archive` REQUIRES non-empty
982
+ `archiveFields`: the owner-owned archived state (e.g.
983
+ `{status: archived}`) the engine grades removal against. `hard` must not
984
+ carry the key — a permanent removal has no archived state.
985
+ - `reason` is required and is shown with the rule in traces.
986
+
987
+ Write it with the command, which previews without `--confirm` and writes
988
+ with it (folder answers become `match: '<folder>/**'`):
989
+
990
+ ```sh
991
+ gateforge classify delete backend/models/invoice archive \
992
+ --archive-field status=archived \
993
+ --reason 'Invoices are retained for the audit window.' --confirm
994
+ ```
995
+
996
+ Declaring semantics is an evidence CONTRACT, not an override: the rule
997
+ contributes the same delete-semantics / archive-state evidence a detector
998
+ would. Detector evidence that disagrees therefore still blocks — the
999
+ conflicting-semantics detail names the owner declaration — and nothing is
1000
+ ever silently overridden. A resolved decision names the rule it used
1001
+ (`DELETE_SEMANTICS_OWNER_RULE(<match>)` in the trace), and a resource
1002
+ outside every `match` is exactly as it was.
1003
+
847
1004
  ## Plugin invocation
848
1005
 
849
1006
  Every configured plugin runs over the same expanded include path list
@@ -1479,13 +1636,32 @@ artifacts automatically creates auditable testing responsibilities.
1479
1636
 
1480
1637
  Blocked agents run `gateforge next` (or `gateforge next --json`): exactly
1481
1638
  one blocking next action (`next`/`cause`/`why`/`do`), never a dump. Do the
1482
- single `do:` line and stop. New proof tests go in `tests/e2e/gateforge/`
1639
+ single `do:` line and stop. New proof goes in `tests/e2e/gateforge/`
1483
1640
  (overlay, engine-driven fixture — wizard creates via surface v2 steps);
1484
- existing suite-driven browser tests prove persistence via the Observe
1485
- channel once mapped `--kind observed-e2e`. Never rewrite existing
1486
- `tests/e2e/**` journeys, never `tests mark` as proof, never edit policies
1487
- or waivers to self-approve. `GATEFORGE.md` (written by `gateforge init`)
1488
- carries the full loop contract.
1641
+ existing suite-driven browser tests prove persistence and transport via the
1642
+ Observe channel once mapped `--kind observed-e2e` — but ONLY when the test's
1643
+ `page` comes from Gateforge's own test object, because that fixture is what
1644
+ routes the test's app traffic through the supervisor's session observation
1645
+ proxy. A test that takes `page` from plain `@playwright/test` reaches the app
1646
+ directly, the witness observes nothing, and the claims finalize missing while
1647
+ the test passes. When the suite has one shared fixture file, rebase it on
1648
+ Gateforge's fixture and change nothing else in the suite:
1649
+
1650
+ ```js
1651
+ // CommonJS suite (Node >= 20.19 / >= 22.12 for require)
1652
+ const { test: baseTest, expect } = require('@gate-forge/pack-playwright/fixture');
1653
+ ```
1654
+
1655
+ ```ts
1656
+ // ESM suite
1657
+ import { test as baseTest, expect } from '@gate-forge/pack-playwright/fixture';
1658
+ ```
1659
+
1660
+ Rebasing the shared base is not rewriting a journey: the journeys' own steps,
1661
+ assertions and fixtures stay as they are, and only the `test` object they
1662
+ extend changes. Never rewrite existing `tests/e2e/**` journeys, never
1663
+ `tests mark` as proof, never edit policies or waivers to self-approve.
1664
+ `GATEFORGE.md` (written by `gateforge init`) carries the full loop contract.
1489
1665
 
1490
1666
  ## Fix a failing test without a full run
1491
1667
 
@@ -37,6 +37,42 @@ Export those values before `gateforge run` or `test-gates`. Only listed names re
37
37
 
38
38
  Engine `GATEFORGE_*` names and process-loader controls (`NODE_OPTIONS`, `NODE_PATH`, `LD_*`, `DYLD_*`, `PYTHONPATH`, `PYTHONHOME`, `BASH_ENV`, `ENV`) are refused even if listed. No list means no additional variables are forwarded. Supervised test-gates refuses these names with usage error 2 before its harness setup, plugin pipeline, or native test enumeration.
39
39
 
40
+ ## Point the suite at the origin Gateforge routes
41
+
42
+ **Rule:** Make the origin your suite loads the SAME origin
43
+ `GATEFORGE_APP_BASE_URL` names, and make sure the suite's own base-URL
44
+ variable actually reaches the test process — one of these two, never
45
+ neither:
46
+
47
+ - the suite's base URL variable is listed in `runtime.yml`
48
+ `envAllowlist` (`E2E_BASE_URL`, `TEST_API_URL`, … — whatever your
49
+ helpers read), or
50
+ - the suite reads no variable of its own and uses
51
+ `GATEFORGE_APP_BASE_URL` directly.
52
+
53
+ **Why:** A witnessed run only rewrites requests to `GATEFORGE_APP_BASE_URL`
54
+ onto the supervisor's session observation proxy. When the tests load some
55
+ other origin — `http://localhost:13001` while Gateforge was pointed at
56
+ `http://localhost:13101` — nothing is routed, the witness observes nothing,
57
+ and every `observed-e2e` transport claim finalizes as missing while the test
58
+ itself passes. A missing variable fails the same way, only more quietly: the
59
+ suite falls back to its own default and Gateforge never learns about it.
60
+
61
+ The zero-traffic note names the origin the page really requested when it can:
62
+
63
+ ```
64
+ observe 'tenant.accounts:http:request-observed': no HTTP exchange passed
65
+ through this session's observation proxy before finalize …; this test's page
66
+ requested 'http://localhost:13001', which the fixture did not route: it
67
+ rewrites only GATEFORGE_APP_BASE_URL ('http://localhost:13101') onto this
68
+ session's proxy — set GATEFORGE_APP_BASE_URL to the origin your suite uses, or
69
+ add your suite's base-URL variable to envAllowlist in runtime.yml so it
70
+ reaches the test process
71
+ ```
72
+
73
+ That sentence is a diagnostic: it names the cause, it decides nothing. A
74
+ claim that stays missing stays missing.
75
+
40
76
  ## Create login state against the app
41
77
 
42
78
  **Rule:** Mint the Playwright login state by connecting directly to the app, not through the witness proxy. Reuse one session file instead of repeatedly logging in. Set `GATEFORGE_SESSION_STATE` to that file for the supervised run.