@gate-forge/cli 0.7.1 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (296) hide show
  1. package/README.md +91 -704
  2. package/dist/adapter-audit.d.ts +208 -0
  3. package/dist/adapter-audit.d.ts.map +1 -0
  4. package/dist/adapter-audit.js +579 -0
  5. package/dist/adapter-audit.js.map +1 -0
  6. package/dist/adapter-scaffold.d.ts +91 -0
  7. package/dist/adapter-scaffold.d.ts.map +1 -0
  8. package/dist/adapter-scaffold.js +474 -0
  9. package/dist/adapter-scaffold.js.map +1 -0
  10. package/dist/adopted-baseline.d.ts +10 -0
  11. package/dist/adopted-baseline.d.ts.map +1 -1
  12. package/dist/adopted-baseline.js +18 -1
  13. package/dist/adopted-baseline.js.map +1 -1
  14. package/dist/args.d.ts +15 -0
  15. package/dist/args.d.ts.map +1 -1
  16. package/dist/args.js +61 -2
  17. package/dist/args.js.map +1 -1
  18. package/dist/behavior-setup.d.ts +239 -0
  19. package/dist/behavior-setup.d.ts.map +1 -0
  20. package/dist/behavior-setup.js +751 -0
  21. package/dist/behavior-setup.js.map +1 -0
  22. package/dist/broker.d.ts.map +1 -1
  23. package/dist/broker.js +28 -2
  24. package/dist/broker.js.map +1 -1
  25. package/dist/cache-exclusions.d.ts +45 -0
  26. package/dist/cache-exclusions.d.ts.map +1 -0
  27. package/dist/cache-exclusions.js +205 -0
  28. package/dist/cache-exclusions.js.map +1 -0
  29. package/dist/candidate-tree.d.ts +86 -14
  30. package/dist/candidate-tree.d.ts.map +1 -1
  31. package/dist/candidate-tree.js +236 -62
  32. package/dist/candidate-tree.js.map +1 -1
  33. package/dist/ci-witnessed-template.d.ts +43 -0
  34. package/dist/ci-witnessed-template.d.ts.map +1 -0
  35. package/dist/ci-witnessed-template.js +283 -0
  36. package/dist/ci-witnessed-template.js.map +1 -0
  37. package/dist/cli.d.ts +1 -1
  38. package/dist/cli.d.ts.map +1 -1
  39. package/dist/cli.js +31 -4
  40. package/dist/cli.js.map +1 -1
  41. package/dist/commands/adapters.d.ts +15 -0
  42. package/dist/commands/adapters.d.ts.map +1 -0
  43. package/dist/commands/adapters.js +355 -0
  44. package/dist/commands/adapters.js.map +1 -0
  45. package/dist/commands/adopt.d.ts +7 -0
  46. package/dist/commands/adopt.d.ts.map +1 -1
  47. package/dist/commands/adopt.js +44 -2
  48. package/dist/commands/adopt.js.map +1 -1
  49. package/dist/commands/baseline.d.ts.map +1 -1
  50. package/dist/commands/baseline.js +42 -1
  51. package/dist/commands/baseline.js.map +1 -1
  52. package/dist/commands/blocking.d.ts +105 -2
  53. package/dist/commands/blocking.d.ts.map +1 -1
  54. package/dist/commands/blocking.js +395 -53
  55. package/dist/commands/blocking.js.map +1 -1
  56. package/dist/commands/check.d.ts +36 -0
  57. package/dist/commands/check.d.ts.map +1 -1
  58. package/dist/commands/check.js +1068 -64
  59. package/dist/commands/check.js.map +1 -1
  60. package/dist/commands/classify.d.ts +2 -1
  61. package/dist/commands/classify.d.ts.map +1 -1
  62. package/dist/commands/classify.js +188 -5
  63. package/dist/commands/classify.js.map +1 -1
  64. package/dist/commands/enforce.d.ts +4 -4
  65. package/dist/commands/enforce.d.ts.map +1 -1
  66. package/dist/commands/enforce.js +41 -9
  67. package/dist/commands/enforce.js.map +1 -1
  68. package/dist/commands/enforcement.d.ts +13 -1
  69. package/dist/commands/enforcement.d.ts.map +1 -1
  70. package/dist/commands/enforcement.js +880 -33
  71. package/dist/commands/enforcement.js.map +1 -1
  72. package/dist/commands/explain.d.ts +1 -1
  73. package/dist/commands/explain.d.ts.map +1 -1
  74. package/dist/commands/explain.js +162 -3
  75. package/dist/commands/explain.js.map +1 -1
  76. package/dist/commands/history.d.ts +12 -0
  77. package/dist/commands/history.d.ts.map +1 -0
  78. package/dist/commands/history.js +45 -0
  79. package/dist/commands/history.js.map +1 -0
  80. package/dist/commands/init-presets.d.ts +155 -0
  81. package/dist/commands/init-presets.d.ts.map +1 -0
  82. package/dist/commands/init-presets.js +203 -0
  83. package/dist/commands/init-presets.js.map +1 -0
  84. package/dist/commands/init.d.ts +7 -12
  85. package/dist/commands/init.d.ts.map +1 -1
  86. package/dist/commands/init.js +987 -99
  87. package/dist/commands/init.js.map +1 -1
  88. package/dist/commands/keys.d.ts.map +1 -1
  89. package/dist/commands/keys.js +29 -13
  90. package/dist/commands/keys.js.map +1 -1
  91. package/dist/commands/next.d.ts.map +1 -1
  92. package/dist/commands/next.js +846 -19
  93. package/dist/commands/next.js.map +1 -1
  94. package/dist/commands/pre-commit.d.ts +25 -0
  95. package/dist/commands/pre-commit.d.ts.map +1 -1
  96. package/dist/commands/pre-commit.js +91 -6
  97. package/dist/commands/pre-commit.js.map +1 -1
  98. package/dist/commands/quarantine.d.ts +16 -0
  99. package/dist/commands/quarantine.d.ts.map +1 -0
  100. package/dist/commands/quarantine.js +213 -0
  101. package/dist/commands/quarantine.js.map +1 -0
  102. package/dist/commands/run.d.ts +39 -0
  103. package/dist/commands/run.d.ts.map +1 -0
  104. package/dist/commands/run.js +196 -0
  105. package/dist/commands/run.js.map +1 -0
  106. package/dist/commands/test-gates.d.ts +284 -2
  107. package/dist/commands/test-gates.d.ts.map +1 -1
  108. package/dist/commands/test-gates.js +3620 -187
  109. package/dist/commands/test-gates.js.map +1 -1
  110. package/dist/commands/tests.d.ts +1 -1
  111. package/dist/commands/tests.d.ts.map +1 -1
  112. package/dist/commands/tests.js +264 -29
  113. package/dist/commands/tests.js.map +1 -1
  114. package/dist/docs-exclusions.d.ts.map +1 -1
  115. package/dist/docs-exclusions.js +18 -3
  116. package/dist/docs-exclusions.js.map +1 -1
  117. package/dist/endpoint-compiler.d.ts.map +1 -1
  118. package/dist/endpoint-compiler.js +78 -9
  119. package/dist/endpoint-compiler.js.map +1 -1
  120. package/dist/engine-browser.d.ts +183 -0
  121. package/dist/engine-browser.d.ts.map +1 -0
  122. package/dist/engine-browser.js +381 -0
  123. package/dist/engine-browser.js.map +1 -0
  124. package/dist/engine-identity.d.ts +100 -0
  125. package/dist/engine-identity.d.ts.map +1 -0
  126. package/dist/engine-identity.js +182 -0
  127. package/dist/engine-identity.js.map +1 -0
  128. package/dist/evaluate.d.ts +105 -1
  129. package/dist/evaluate.d.ts.map +1 -1
  130. package/dist/evaluate.js +149 -18
  131. package/dist/evaluate.js.map +1 -1
  132. package/dist/execution.d.ts +253 -9
  133. package/dist/execution.d.ts.map +1 -1
  134. package/dist/execution.js +309 -12
  135. package/dist/execution.js.map +1 -1
  136. package/dist/gateforge-owned.d.ts +78 -0
  137. package/dist/gateforge-owned.d.ts.map +1 -0
  138. package/dist/gateforge-owned.js +254 -0
  139. package/dist/gateforge-owned.js.map +1 -0
  140. package/dist/git-hooks.d.ts +35 -0
  141. package/dist/git-hooks.d.ts.map +1 -1
  142. package/dist/git-hooks.js +140 -1
  143. package/dist/git-hooks.js.map +1 -1
  144. package/dist/git-ignored.d.ts +27 -0
  145. package/dist/git-ignored.d.ts.map +1 -0
  146. package/dist/git-ignored.js +102 -0
  147. package/dist/git-ignored.js.map +1 -0
  148. package/dist/git-objects.d.ts +60 -0
  149. package/dist/git-objects.d.ts.map +1 -0
  150. package/dist/git-objects.js +152 -0
  151. package/dist/git-objects.js.map +1 -0
  152. package/dist/glob.d.ts +33 -14
  153. package/dist/glob.d.ts.map +1 -1
  154. package/dist/glob.js +96 -5
  155. package/dist/glob.js.map +1 -1
  156. package/dist/history.d.ts +52 -0
  157. package/dist/history.d.ts.map +1 -0
  158. package/dist/history.js +116 -0
  159. package/dist/history.js.map +1 -0
  160. package/dist/host-load.d.ts +49 -0
  161. package/dist/host-load.d.ts.map +1 -0
  162. package/dist/host-load.js +78 -0
  163. package/dist/host-load.js.map +1 -0
  164. package/dist/index.d.ts +4 -1
  165. package/dist/index.d.ts.map +1 -1
  166. package/dist/index.js +2 -1
  167. package/dist/index.js.map +1 -1
  168. package/dist/input-snapshot.d.ts +63 -9
  169. package/dist/input-snapshot.d.ts.map +1 -1
  170. package/dist/input-snapshot.js +195 -17
  171. package/dist/input-snapshot.js.map +1 -1
  172. package/dist/io.d.ts +49 -0
  173. package/dist/io.d.ts.map +1 -1
  174. package/dist/io.js +22 -0
  175. package/dist/io.js.map +1 -1
  176. package/dist/mapping.d.ts +84 -1
  177. package/dist/mapping.d.ts.map +1 -1
  178. package/dist/mapping.js +276 -5
  179. package/dist/mapping.js.map +1 -1
  180. package/dist/native-freeze.d.ts +217 -0
  181. package/dist/native-freeze.d.ts.map +1 -0
  182. package/dist/native-freeze.js +332 -0
  183. package/dist/native-freeze.js.map +1 -0
  184. package/dist/pipeline.d.ts +67 -1
  185. package/dist/pipeline.d.ts.map +1 -1
  186. package/dist/pipeline.js +164 -6
  187. package/dist/pipeline.js.map +1 -1
  188. package/dist/planes-inference.d.ts +12 -5
  189. package/dist/planes-inference.d.ts.map +1 -1
  190. package/dist/planes-inference.js +13 -15
  191. package/dist/planes-inference.js.map +1 -1
  192. package/dist/playwright-browsers.d.ts +210 -0
  193. package/dist/playwright-browsers.d.ts.map +1 -0
  194. package/dist/playwright-browsers.js +364 -0
  195. package/dist/playwright-browsers.js.map +1 -0
  196. package/dist/plugins.d.ts +15 -5
  197. package/dist/plugins.d.ts.map +1 -1
  198. package/dist/plugins.js +59 -9
  199. package/dist/plugins.js.map +1 -1
  200. package/dist/progress.d.ts +148 -0
  201. package/dist/progress.d.ts.map +1 -0
  202. package/dist/progress.js +263 -0
  203. package/dist/progress.js.map +1 -0
  204. package/dist/providers.d.ts +26 -1
  205. package/dist/providers.d.ts.map +1 -1
  206. package/dist/providers.js +39 -0
  207. package/dist/providers.js.map +1 -1
  208. package/dist/receipts.d.ts +1 -0
  209. package/dist/receipts.d.ts.map +1 -1
  210. package/dist/receipts.js +35 -7
  211. package/dist/receipts.js.map +1 -1
  212. package/dist/repo-scan.d.ts +15 -1
  213. package/dist/repo-scan.d.ts.map +1 -1
  214. package/dist/repo-scan.js +329 -34
  215. package/dist/repo-scan.js.map +1 -1
  216. package/dist/reseal-chain.d.ts +184 -0
  217. package/dist/reseal-chain.d.ts.map +1 -0
  218. package/dist/reseal-chain.js +735 -0
  219. package/dist/reseal-chain.js.map +1 -0
  220. package/dist/reseal-evidence.d.ts +241 -0
  221. package/dist/reseal-evidence.d.ts.map +1 -0
  222. package/dist/reseal-evidence.js +319 -0
  223. package/dist/reseal-evidence.js.map +1 -0
  224. package/dist/reseal.d.ts +181 -0
  225. package/dist/reseal.d.ts.map +1 -0
  226. package/dist/reseal.js +1620 -0
  227. package/dist/reseal.js.map +1 -0
  228. package/dist/response-field-guidance.d.ts +82 -0
  229. package/dist/response-field-guidance.d.ts.map +1 -0
  230. package/dist/response-field-guidance.js +184 -0
  231. package/dist/response-field-guidance.js.map +1 -0
  232. package/dist/route-plane-proposals.d.ts +100 -0
  233. package/dist/route-plane-proposals.d.ts.map +1 -0
  234. package/dist/route-plane-proposals.js +213 -0
  235. package/dist/route-plane-proposals.js.map +1 -0
  236. package/dist/run-cache.d.ts +260 -0
  237. package/dist/run-cache.d.ts.map +1 -0
  238. package/dist/run-cache.js +771 -0
  239. package/dist/run-cache.js.map +1 -0
  240. package/dist/run-preflight.d.ts +77 -0
  241. package/dist/run-preflight.d.ts.map +1 -0
  242. package/dist/run-preflight.js +774 -0
  243. package/dist/run-preflight.js.map +1 -0
  244. package/dist/run-recipe.d.ts +107 -0
  245. package/dist/run-recipe.d.ts.map +1 -0
  246. package/dist/run-recipe.js +295 -0
  247. package/dist/run-recipe.js.map +1 -0
  248. package/dist/run-reliability.d.ts +126 -0
  249. package/dist/run-reliability.d.ts.map +1 -0
  250. package/dist/run-reliability.js +221 -0
  251. package/dist/run-reliability.js.map +1 -0
  252. package/dist/runtime.d.ts +15 -0
  253. package/dist/runtime.d.ts.map +1 -1
  254. package/dist/runtime.js +11 -1
  255. package/dist/runtime.js.map +1 -1
  256. package/dist/scope.d.ts +20 -0
  257. package/dist/scope.d.ts.map +1 -1
  258. package/dist/scope.js +26 -5
  259. package/dist/scope.js.map +1 -1
  260. package/dist/secret-guard.d.ts +36 -0
  261. package/dist/secret-guard.d.ts.map +1 -0
  262. package/dist/secret-guard.js +63 -0
  263. package/dist/secret-guard.js.map +1 -0
  264. package/dist/singleton-guidance.d.ts +82 -0
  265. package/dist/singleton-guidance.d.ts.map +1 -0
  266. package/dist/singleton-guidance.js +138 -0
  267. package/dist/singleton-guidance.js.map +1 -0
  268. package/dist/staged-candidate.d.ts +17 -0
  269. package/dist/staged-candidate.d.ts.map +1 -1
  270. package/dist/staged-candidate.js +50 -0
  271. package/dist/staged-candidate.js.map +1 -1
  272. package/dist/state-artifacts.d.ts +70 -0
  273. package/dist/state-artifacts.d.ts.map +1 -0
  274. package/dist/state-artifacts.js +215 -0
  275. package/dist/state-artifacts.js.map +1 -0
  276. package/dist/state.d.ts +170 -2
  277. package/dist/state.d.ts.map +1 -1
  278. package/dist/state.js +248 -8
  279. package/dist/state.js.map +1 -1
  280. package/dist/unmatched-routes.d.ts +60 -0
  281. package/dist/unmatched-routes.d.ts.map +1 -0
  282. package/dist/unmatched-routes.js +131 -0
  283. package/dist/unmatched-routes.js.map +1 -0
  284. package/dist/verifier-keys.d.ts +33 -2
  285. package/dist/verifier-keys.d.ts.map +1 -1
  286. package/dist/verifier-keys.js +95 -9
  287. package/dist/verifier-keys.js.map +1 -1
  288. package/guides/CONNECT-YOUR-PROJECT.md +425 -0
  289. package/guides/QUICKSTART.md +306 -26
  290. package/guides/REFERENCE.md +1710 -0
  291. package/guides/RUNNER-NEUTRAL-EVIDENCE.md +199 -0
  292. package/guides/TEST-ENVIRONMENT.md +1044 -6
  293. package/guides/UPGRADE-0.6-to-0.7.md +3 -3
  294. package/guides/UPGRADE-0.7-to-0.8.md +114 -0
  295. package/guides/UPGRADE-0.8-to-0.9.md +104 -0
  296. package/package.json +10 -9
@@ -24,11 +24,11 @@
24
24
  3. Keep the verifier key in a protected environment variable or an external key ring. For example, create a current-user-owned key ring outside the repository and state directory:
25
25
 
26
26
  ```sh
27
- mkdir -p "$HOME/.config/gateforge"
28
- gateforge key create --file "$HOME/.config/gateforge/keys.json" --confirm
29
- export GATEFORGE_WITNESS_VERIFIER_KEY_FILE="$HOME/.config/gateforge/keys.json"
27
+ gateforge key create --confirm
30
28
  ```
31
29
 
30
+ With no `--file` the CLI creates the ring at `"${XDG_CONFIG_HOME:-$HOME/.config}/gateforge/verifier-keyring.json"` (owner-only, mode `0600`) and reads that path on every later command; keep `--file <path>` plus a `GATEFORGE_WITNESS_VERIFIER_KEY_FILE` export only when the ring really lives elsewhere.
31
+
32
32
  4. Run the suite under Gateforge after upgrading:
33
33
 
34
34
  ```sh
@@ -0,0 +1,114 @@
1
+ # Upgrade from 0.7 to 0.8
2
+
3
+ 0.8.0 needs no configuration change. Every new option is off until you write it (the one exception, CI progress lines on stderr, is listed below), and a repository with no new keys gates with the same rules. The one step every repository must take is a new witnessed run: a receipt sealed by 0.7.x is not accepted by 0.8.0.
4
+
5
+ ## Upgrade steps
6
+
7
+ 1. Set every direct `@gate-forge/*` dependency to `0.8.0` and update any wrapper script, CI image, or install command that pins an older CLI version:
8
+
9
+ ```sh
10
+ npm i -D \
11
+ @gate-forge/cli@0.8.0 \
12
+ @gate-forge/pack-playwright@0.8.0 \
13
+ @gate-forge/pack-http@0.8.0 \
14
+ @gate-forge/pack-fastapi@0.8.0 \
15
+ @gate-forge/pack-sqlalchemy@0.8.0
16
+ ```
17
+
18
+ Keep the packs you already use; the list above is an example. The CLI now also installs two new packages as its own dependencies: `@gate-forge/witness` and `@gate-forge/pack-alembic`. Installing from tarballs instead of the registry: install every `.tgz` of the release in one command (`npm i -D ./gate-forge-*.tgz`).
19
+
20
+ **If your `package.json` pins Gateforge anywhere else**, change those entries by hand first: every `@gate-forge/*` version in an `overrides` (npm) or `resolutions` (yarn) block, and every alias such as `"@gateforge/pack-playwright": "npm:@gate-forge/pack-playwright@0.7.0"`, must say `0.8.0`. Then run `npm install`. With an override still at `0.7.0`, the `npm i -D` command above stops with `EOVERRIDE` and changes nothing. Example:
21
+
22
+ ```json
23
+ "devDependencies": {
24
+ "@gate-forge/cli": "0.8.0",
25
+ "@gateforge/pack-playwright": "npm:@gate-forge/pack-playwright@0.8.0"
26
+ },
27
+ "overrides": {
28
+ "@gate-forge/core": "0.8.0",
29
+ "@gate-forge/pack-playwright": "0.8.0"
30
+ }
31
+ ```
32
+
33
+ You do not need to add the two new packages to `overrides`; the CLI brings them at `0.8.0`.
34
+
35
+ 2. Check the setup:
36
+
37
+ ```sh
38
+ gateforge enforcement doctor
39
+ ```
40
+
41
+ The doctor has a new `run` section (verifier key, the owner-approved policy pin, the runner and its browser builds, interpreter paths, target reachability, host load). It still exits 0; each FAIL line names its fix. `gateforge enforcement doctor --strict-preflight` exits 1 at the first failing precondition.
42
+
43
+ 3. Seal a new run with 0.8.0:
44
+
45
+ ```sh
46
+ gateforge test-gates --changed
47
+ ```
48
+
49
+ A receipt sealed by 0.7.x is refused by `check --require-e2e` with `EVIDENCE_STALE`: the new engine derives the gate inputs again, so the old run is not this run. This is expected and fail-closed; nothing else needs to change. The owner-approved policy digest does not change with the upgrade, so a protected `GATEFORGE_APPROVED_POLICY_DIGEST` stays valid.
50
+
51
+ 4. Check the same candidate bytes:
52
+
53
+ ```sh
54
+ gateforge check --changed --require-e2e
55
+ ```
56
+
57
+ ## What changes for an existing repository
58
+
59
+ - **CI progress on stderr:** under `CI=true`, `test-gates` now prints a secret-screened progress stream on stderr (start line, one line per finished test, an alive line each quiet minute). Set `run.progress: off` in `.gateforge.yml` to disable that stream. Passing local runs are unchanged; when a local run fails with the stream off, its text report now names up to three failed tests with their first error line and tells you how to stream any remaining failures.
60
+ - **Merge-request CI without a base commit:** `--scope changed` and `check --changed` in a merge-request pipeline that provides no base commit now refuse in seconds with exit 2 and the fix, instead of silently using the local staged diff. Pipelines that are not merge requests, a present base commit, an explicit provider and every local run are unchanged.
61
+ - **Selection reports:** the in-runner reporter of a changed- or named-scope run prints `GATEFORGE GATE: SELECTION (…; repository verdict not graded here)` instead of a repository verdict it did not grade. Debt the run did not observe is named on its own line, never as `new blocking`.
62
+ - **Browser readiness:** the doctor and the run preflight check the browser builds your own `@playwright/test` pins. Missing builds name `npx playwright install <browser>` and the directory to run it in. On Linux, installed Chromium-family executables are also probed with `--version`; a launch failure names its first stderr line and `npx playwright install-deps <browser>` (requires root or sudo). On a fresh Linux container, install both in one step with `npx playwright install --with-deps chromium`.
63
+ - **Engine-owned browser readiness:** the doctor and the run preflight also carry a new `engine-browser` line, separate from `runner`. `runner` reports the browser YOUR tests launch; `engine-browser` reports the one the ENGINE drives for every `evidence.ui.action` / `visible.confirm` / `persistence.verify` receipt and every `engine-browser` behavior case — the Chromium `@gate-forge/pack-playwright` pins, which is usually a different release from yours. A FAIL names that release's pinned builds and the exact command to install them: the engine's own `cli.js` by absolute path (not `npx playwright install`, which resolves YOUR release and installs the revision your cache already holds), with `PLAYWRIGHT_SKIP_BROWSER_GC=1` so the install cannot delete your own builds from a shared cache. The line demands a browser only from a repository that opens one — a Playwright runner, or a behavior policy declaring an `engine-browser` case; a pytest or API-only repository reads `engine browser not required`. No config key is added and no existing check id or wording changes.
64
+ - **Reports** gain additive fields only (`strictness`, `quarantine`, `run`, `engine` provenance in text reports). Existing JSON keys, cause codes and exit codes are unchanged.
65
+ - **Queue observation** needs `bullmq` and `ioredis` only when you configure `queueObserver`; they are optional peers of `@gate-forge/witness`.
66
+ - **Declared test-service environment:** names your runtime document already lists in `envAllowlist` now reach the supervised tests and the wired test enumeration; no other variable does, and the values come only from your environment. Engine `GATEFORGE_*` names and process-loader controls (`NODE_OPTIONS`, `NODE_PATH`, `LD_*`, `DYLD_*`, `PYTHONPATH`, `PYTHONHOME`, `BASH_ENV`, `ENV`) are refused even when listed, naming the entry. The document is part of the trusted policy digest, so adding a name is an owner approval. No list forwards nothing new, and you do not need to add the key: see `TEST-ENVIRONMENT.md`, "Declare test-service environment variables".
67
+ - **A Playwright project that declares `use.storageState` now gets that session.** A supervised run uses a synthesized config, never yours, so until now a `setup` project's saved state was silently omitted and every authenticated journey ran logged out. The declared path is handed to that project alone and must stay inside the repository: containment is checked on the real filesystem from the nearest existing ancestor, so a file your setup test creates during the run is fine, while a path that escapes directly or through a symlink, a dangling link, a URL and an empty value stop the run and name the project, the value and the fix. A relative path resolves against the runner's working directory — the directory of the config the run uses, which is the repository root for a root-level config and the project's own directory for a nested one, so a nested `setup` project saves the file where its dependent project reads it; containment stays the whole repository either way. The setup project keeps no state of its own; the files and test identities a run reports stay repository-relative whatever the config's directory is; an operator-set `GATEFORGE_SESSION_STATE` still outranks every project declaration, a relative value still means the repository root, and the declarations it outranks are not read. If you already set that variable, nothing changes for you: see `TEST-ENVIRONMENT.md`, "Or let a setup project save its own state".
68
+ - **A Playwright run whose planned projects are named now freezes ONE prepared candidate between preparation and bodies.** In 0.7.x a `setup` project's saved session existed only in the working tree, so the candidate was frozen before native setup, and a run then correctly refused to seal when genuine setup changed the counted session-state bytes, even if every test passed. Declared native dependencies already ordered each setup ahead of its own dependent body; what was missing was anywhere to admit genuine generated output, and a guarantee that no INDEPENDENT body starts before ALL preparation. Preparation stages now run first, each genuinely executed with its own outcome retained as a witnessed prerequisite, the candidate is taken once, and every body executes against it once the freeze releases. Between the pre-run baseline and the prepared candidate, only an untracked, non-input, non-excluded, physically contained regular file that a project declares as its `storageState` may differ — additions and modifications only, never a removal, a symlink or any other change to a candidate file — while source, trusted policy and the input digest stay frozen; the engine's own run artifacts live in the excluded run-state directory and are not candidate files. The release that opens the barrier is signed with a key that exists only in the CLI process's memory. Nothing to configure and nothing new to declare: unnamed or empty projects take no part, a non-Playwright runner never enters the path, an operator-set whole-run session state bypasses it exactly as before, the same freeze applies whether your root `package.json` is CommonJS, declares `"type": "module"`, or your specs live in a nested module directory, and a project's environment still receives its own dependency chain's assignments. It is a checked boundary inside the run, not a sandbox: ordinary local files stay writable by your own user. See `TEST-ENVIRONMENT.md`, "One prepared candidate for the whole native run".
69
+ - **Reads from a rendered list:** a `read` may name its entities in the response rows instead of the path, with the new `collection: { rowsKey?, idKey }` shape in the new-options table below. The shape is declared, never inferred, and it is opt-in: without it a read binds `{id}` from the path exactly as in 0.7.x. See `CONNECT-YOUR-PROJECT.md`.
70
+ - **Declared volatile fields are honored:** an adapter that already declared `volatileFields` had the list accepted and then dropped before the run, so a field the server rewrites failed the exact-value echo as `EVIDENCE_VALUE_MISMATCH`. The declaration now survives admission, so those keys are skipped by the echo and named in the report. An undeclared key still blocks, a malformed list is refused at load, and an adapter that declares nothing is unchanged.
71
+
72
+ ## New options (all off by default)
73
+
74
+ | Option | Where | Default |
75
+ |---|---|---|
76
+ | `mode: strict \| changed \| warn` | `.gateforge.yml` | absent = `strict` (0.7 behavior) |
77
+ | `gateforge quarantine <testKey> …` | owner command | no quarantine |
78
+ | `enforcement.reseal: true`, `enforcement.resealRuntimeFiles` | `.gateforge.yml` | off: a test-only change runs the changed scope as before |
79
+ | `enforcement.twinPaths: advisory \| block`, `enforcement.twinQueryKeys` | `.gateforge.yml` | off |
80
+ | `http.endpoint.requireObservation` | `.gateforge/policies.yml` | off |
81
+ | `run.progress` / `--progress stderr\|file:<path>\|off` | `.gateforge.yml` / flag | `auto`: stderr under `CI=true`, off locally |
82
+ | `tenancy.scopeColumns` | `.gateforge.yml` | none |
83
+ | `queueObserver` | `.gateforge.yml` | none; `task:*` cases stay fail-closed |
84
+ | `.gateforge/runtime.yml` recipe for `gateforge run` | file | none; `gateforge run` works without it |
85
+ | `test-gates --test <selector> --result-only`, `--chaos <seed>` | flags | not used |
86
+ | `enforce --ci gitlab\|github --witnessed` | command | static CI job only |
87
+ | `collection: { rowsKey?, idKey }` on an adapter `read` | evidence adapter | absent: a read binds `{id}` from the path |
88
+
89
+ ## Existing keys that changed meaning
90
+
91
+ No repository has to write any of them. A key you have not declared behaves
92
+ exactly as in 0.7.x; a key you already declared gets the effect below.
93
+
94
+ | Key | Where | Absent (unchanged) |
95
+ |---|---|---|
96
+ | `envAllowlist` | `.gateforge/runtime.yml` | no extra variable reaches tests or enumeration |
97
+ | `volatileFields` | evidence adapter | no key is exempt from the exact-value echo |
98
+
99
+ ## If something breaks
100
+
101
+ | If you see | Do this |
102
+ |---|---|
103
+ | `EVIDENCE_STALE` after upgrading | Run `gateforge test-gates --changed`, then check again. |
104
+ | `GATEFORGE_PACKAGE_INCOMPATIBLE` | Align every direct Gateforge package to `0.8.0`, update wrapper pins, then run `npm install`. |
105
+ | `npm error code EOVERRIDE` (`Override for @gate-forge/… conflicts with direct dependency`) | Set every `@gate-forge/*` entry in `overrides`/`resolutions` and every `npm:@gate-forge/…` alias to `0.8.0` by hand, then run `npm install` (step 1). |
106
+ | `E404` for `@gate-forge/witness` or `@gate-forge/pack-alembic` during a tarball install | Install every tarball of the release in one command. |
107
+ | A doctor `runner` FAIL naming browser builds | Run the printed `npx playwright install …` in the printed directory. |
108
+ | A doctor `runner` FAIL saying an installed browser cannot start | Run the printed `npx playwright install-deps …` command with root or sudo available, then run the doctor again. |
109
+ | A doctor `engine-browser` FAIL naming the engine's pinned builds | Run the printed command verbatim. Do not substitute `npx playwright install` — it installs YOUR Playwright release, not the engine's, and leaves the engine browser just as broken. Keep `PLAYWRIGHT_SKIP_BROWSER_GC=1` in the command so your own cached builds are not garbage-collected. |
110
+ | A run stops naming a project, its `storageState` value and the fix | The declared path must stay inside the repository; the file itself need not exist yet, your setup test may create it during the run. A relative value resolves from the directory of the config the run uses — the repository root, or your project's own directory when the config is nested — while the repository stays the boundary. Fix the path, not the timing — never point it outside the repository or inline the cookies. |
111
+ | Exit 2 on `--scope changed` in a merge-request pipeline | Provide the base commit (for example a deeper clone) or configure the change provider explicitly, as the message says. |
112
+ | `runtime envAllowlist cannot grant '…' to test code` | Remove that entry. Engine `GATEFORGE_*` names and process-loader controls are never forwarded to test code, listed or not; the run refuses before any test starts. |
113
+ | `observe.read.collection requires method 'GET'`, or `must not be declared on a path carrying '{id}'` | The collection shape belongs on a `read` + `GET` whose path carries no `{id}`. A by-id read keeps its own shape; move the declaration to the read that actually renders the list. |
114
+ | `EVIDENCE_VALUE_MISMATCH` on a field the server rewrites on its own | Declare that field in the adapter's `volatileFields`. The declaration is now honored end to end; it is never inferred from the response. |
@@ -0,0 +1,104 @@
1
+ # Upgrade from 0.8 to 0.9
2
+
3
+ 0.9.0 needs no configuration change and adds no option that is on by default. What it changes is what the engine SEES on an existing repository, so the honest first step after upgrading is a fresh `discover` — your counts and your obligations can move in BOTH directions, and that is the point of the release rather than a regression.
4
+
5
+ ## Upgrade steps
6
+
7
+ 1. Set every direct `@gate-forge/*` dependency to `0.9.0` and update any wrapper script, CI image, or install command that pins an older CLI version:
8
+
9
+ ```sh
10
+ npm i -D \
11
+ @gate-forge/cli@0.9.0 \
12
+ @gate-forge/pack-playwright@0.9.0 \
13
+ @gate-forge/pack-http@0.9.0 \
14
+ @gate-forge/pack-fastapi@0.9.0 \
15
+ @gate-forge/pack-sqlalchemy@0.9.0
16
+ ```
17
+
18
+ Keep the packs you already use; the list above is an example. Installing from tarballs instead of the registry: install every `.tgz` of the release in one command (`npm i -D ./gate-forge-*.tgz`).
19
+
20
+ **If your `package.json` pins Gateforge anywhere else**, change those entries by hand first: every `@gate-forge/*` version in an `overrides` (npm) or `resolutions` (yarn) block, and every alias such as `"@gateforge/pack-playwright": "npm:@gate-forge/pack-playwright@0.8.0"`, must say `0.9.0`. Then run `npm install`. With an override still at `0.8.0`, the `npm i -D` command above stops with `EOVERRIDE` and changes nothing.
21
+
22
+ 2. Add Gateforge's own engine state to `.gitignore` (one-time, if an earlier `init` predates this release):
23
+
24
+ ```sh
25
+ echo '.gateforge/test-gates/' >> .gitignore
26
+ ```
27
+
28
+ `init` now does this itself, appended to your existing file with your lines preserved. Without it the first `git add -A` stages the run catalog and the plugin cache the engine regenerates on every run, and the gate then blocks on its own files.
29
+
30
+ 3. Re-run discovery and read the new picture:
31
+
32
+ ```sh
33
+ gateforge discover
34
+ ```
35
+
36
+ 4. Re-approve the policy digest if any Gateforge-owned setup file changed:
37
+
38
+ ```sh
39
+ gateforge enforcement doctor # names the current pin and the value to set
40
+ ```
41
+
42
+ Setup files are policy inputs since 0.9.0 (see below). They are inside the approved policy digest exactly as before, so if your repository pins `GATEFORGE_APPROVED_POLICY_DIGEST`, re-approve it once after upgrading. A mismatching pin still blocks — nothing was weakened.
43
+
44
+ 5. Check the same candidate bytes:
45
+
46
+ ```sh
47
+ gateforge check --changed
48
+ ```
49
+
50
+ Seal one new witnessed run before trusting `check --require-e2e`. A receipt records the engine that sealed it, and 0.9.0 is a different engine from 0.8.x, so a receipt sealed by 0.8.x is refused with `EVIDENCE_STALE` — the same fail-closed rule as every previous upgrade:
51
+
52
+ ```sh
53
+ gateforge test-gates --changed
54
+ ```
55
+
56
+ The owner-approved policy digest does not change with the upgrade, so a protected `GATEFORGE_APPROVED_POLICY_DIGEST` stays valid (re-approve it only if you changed a Gateforge-owned setup file — step 4).
57
+
58
+ 6. If your repository declares documentation folders whose exclusion was refused for holding data files, re-declare it (this release accepts `.json`, `.yaml`, `.yml`, `.csv`, `.html` inside an excluded folder):
59
+
60
+ ```sh
61
+ gateforge init --docs-exclude docs --confirm-doc-exclusions
62
+ ```
63
+
64
+ ## What can appear or disappear, and why
65
+
66
+ - **Untracked-and-gitignored files leave the scan.** Generated output in a working copy — a Playwright report bundle, a local cache — was walked like committed code, so every call inside it became detector evidence (in the session that motivated this release: 414 `FRONTEND_CALL_TARGET_UNRESOLVED` entries that a clean clone of the same commit never produced). After upgrading, the scan skips exactly what Git reports as untracked AND ignored. If your counts DROP, this is why: a dirty working copy and a clean clone now describe the same repository. A TRACKED file matching an ignore pattern is still scanned, a nested `.gitignore` counts, the operator's global excludes file does not (results must not depend on the machine), and outside a Git work tree nothing is skipped.
67
+ - **The receipt identity did not move with the scan.** The input snapshot still hashes a deliberate SUPERSET of what the scan reads, so a gitignored configured input still moves the receipt digest — the conservative direction, and the one `check --out` relies on when it refuses an output path that would hide a declared input. The skip rule only removes bytes from the SCAN, never from the identity, so a digest difference between two runs is never the skip rule hiding something.
68
+ - **Test-directory models leave the resource graph.** A table declared in a pytest module to build rows (next to the application's real model) used to enter as a second business resource; the real table then collided with its own fixture and stayed plane-unresolved. Those files are still parsed and still appear in `scannedPaths`, so coverage evidence is unchanged, but they contribute no resource, unresolved entry, signal or duplicate finding. If your blocking count drops here, the duplicate fixture resources are what disappeared.
69
+ - **Fewer `PLANE_UNRESOLVED` endpoints, more route-folder questions.** `init --planes` now proposes one question per ROUTE FOLDER as well as per model folder, so the endpoint plane questions that used to require hand-editing `.gateforge/planes.json` are asked once per folder. A linked model's plane may appear as a HINT and is never applied — an `accounts` route can serve master data — and `gateforge classify plane` now accepts a folder or glob, so you can also answer it in one command.
70
+ - **`singletonPerTenant` disappears from tables that were never singletons.** The tag is minted only when a declared UNIQUE constraint or UNIQUE INDEX is written over tenancy-scope columns and nothing else. A table tagged in 0.8.x only because its constraint CONTAINED a tenant column (a domain `tenant_id`, say) loses the tag, and its `RESOURCE_SINGLETON_PER_TENANT` advisory goes with it. If your repository's scope column is not one of the recognized defaults, declare `tenancy.scopeColumns` so a genuine singleton is still recognized.
71
+ - **Routes appear, or change path.** A constant or annotated FastAPI prefix is now folded (`router: APIRouter = APIRouter(prefix="/api/v1")` used to be ignored), so routes behind it appear at their real path instead of the router's own prefix. A prefix that is genuinely computed (an f-string, an attribute, a call) now blocks with `FASTAPI_PREFIX_UNRESOLVED` instead of publishing a prefix-less path no app serves.
72
+ - **New blocking codes for factory-built routers.** `FASTAPI_ROUTER_UNMOUNTED` names a router no scanned app mounts (its routes keep their standalone emission and the entry names the router, its file and every declared route). `HTTP_METHOD_DYNAMIC` replaces a fabricated `GET` when a `fetch` method cannot be resolved from its options object. Both can only ADD blocking findings, and both are the honest answer where 0.8.x either guessed or stayed silent.
73
+ - **`api.<verb>()` stops minting routes in client and test files.** A call like `api.get('/orders')` counted as a server route wherever it appeared, including in an axios module, a Playwright request context and test call sites. It counts only in a file that imports a server framework (express/fastify/hono), so routes that were phantom entries disappear.
74
+ - **Endpoint locations are the server route.** An endpoint reported at a frontend call site that merely mentions the path is now reported at the route that serves it.
75
+ - **An unmatched by-id route is now named instead of staying silent — and it does not block unless you say so.** `ENDPOINT_RESOURCE_CANDIDATE_UNMATCHED` is a new entry. A route that reads ONE entity, whose path-derived resource name matches no discovered business resource (`GET /api/v1/reports/logs/{}` while the tables are `report_logs`, `access_logs`), used to produce NO finding at all — which read as "this route does not exist". It now names the endpoint, the derived name and up to three discovered resources whose last `_`-segment could be the same thing. Those names are CANDIDATES and are never linked: a link still requires an exact name plus a schema or handler-name corroboration. **After upgrading, these are ADVISORIES**: `check` and `next` print a banner at the top with the count, the first three examples and the exact key, and nothing blocks on them — a repository that never chose must not start failing commits over a finding it did not ask for. To gate on them, set `endpoints:\n unmatchedRoutes: block` in `.gateforge.yml` (or run `gateforge init --unmatched-routes block` on a new setup); `unmatchedRoutes: warn` keeps the banner and states that you chose it.
76
+ - **Gateforge's own setup files are policy inputs.** The config, policy, classification, behavior and runtime documents, the exclusion declarations, the mapping sidecar, the adapter/waiver/baseline/quarantine records, the generated gate wiring and your CI/pre-commit config *while they still carry Gateforge's managed block* are never an unmapped `CHANGE_UNMAPPED` change, and a change set containing only those files cannot change product behavior. Your `init` → `adopt` → first commit therefore passes without `--no-verify`, and a setup commit no longer drags every adopted E2E obligation into a strict re-grade — provided the owner has pinned the policy revision that governs those files. **Removing** the gate job from your CI config, or the entry from `.pre-commit-config.yaml`, is not a policy input and goes back to blocking, exactly as before.
77
+ - **Adopted debt survives a setup commit under `strictE2E`.** The adopted baseline is a recorded, shrink-only statement of pre-existing debt, not a risk acceptance, so it is not re-graded as blocking while the change set is provably product-behavior-neutral. With no policy pin in force, reporting is unchanged and adopted debt is re-graded as blocking.
78
+ - **Suggestions are ranked and capped.** `tests suggest` used to list candidates alphabetically; the obvious test could sit at #159 of 311. Candidates are now scored by the evidence their own catalog row carries and every weight is printed as a `why:` line, so a changed ranking is the ranking being honest — not a lost candidate. The text surface prints the top five; `gateforge tests suggest --json` carries every candidate.
79
+ - **`tests suggest --json` reports FEWER overlaps — a deliberate JSON contract narrowing.** `candidates[].overlaps` used to list every obligation that merely had the test among its candidates (237,936 entries on the repository that motivated this release). It now lists only the obligations that DECLARE the test, which is what an overlap means. **If you consume `candidates[].overlaps`, re-check it against 0.9.0**: the field is narrower, not merely re-ordered.
80
+ - **`check` shows declared mappings.** An obligation whose test ids are declared but whose records were not consulted now reports `mapped to: <test> (not yet witnessed)`, and in the TEXT report its next action names the command that collects the evidence instead of the generic "write a test" advice. `--format json` keeps the cause's own generic next action and carries `declaredTests` and `mappingState` instead.
81
+ - **Test rows are attributed to the runner that owns them.** The static scan found test-shaped calls anywhere in the repository and catalogued them as the configured runner's tests. Each runner's own file selection is now read as data (Playwright project `testDir`/`testMatch`/`testIgnore`, Vitest `test.include`/`test.exclude`/`test.globals`), so rows can MOVE between runners or disappear. Ownership is never invented: a file no runner's selection claims keeps the configured runner and stays a blocking row.
82
+ - **A collection read no longer stops proving at 16 KB.** A `persistence:read` whose observe binding declares `collection` used to parse the first 16,384 bytes of the response the proxy forwarded, so a list that outgrew that cap named no complete row: the claim stayed `EVIDENCE_NOT_COLLECTED`, no receipt sealed, and the failure grew every run as the app's own data grew (in the session that motivated this release, a users list at 18,526 bytes / 107 rows). Such a read is now parsed from its own bounded copy — up to 1 MiB and up to 10,000 rows — so an ordinary growing list proves again. Nothing else moved: the 16 KB tap that feeds the response digest and create attribution is byte-identical, the record payload is unchanged (no body byte ever rode in it), and every existing record and receipt re-verifies. A body or page past the new bounds is still refused, not partially read, and the note names the bound and the size.
83
+
84
+ ## Owner decisions this release asks for
85
+
86
+ - **One plane answer per route folder.** `init` asks; nothing is inferred. Answer for the ROUTES, not for the models they happen to link to. `gateforge classify plane <folder> <plane> --reason "<why>" --confirm` does the same thing outside a terminal.
87
+ - **Documentation folders are an owner assertion.** Accepting `.json`/`.yaml`/`.yml`/`.csv`/`.html` inside an excluded folder still cannot prove that such a file cannot affect application or test behavior; manifests, lockfiles, `*.config.*` files, CI configs and every source or executable format stay refused, and MDX/WASM/SVG fail closed. Declare a folder only when you mean it.
88
+ - **The policy pin is what makes a setup commit pass.** If you pin `GATEFORGE_APPROVED_POLICY_DIGEST`, re-approve it once after upgrading so your own setup files are the ones your pin describes.
89
+
90
+ ## If something breaks
91
+
92
+ | If you see | Do this |
93
+ |---|---|
94
+ | `GATEFORGE_PACKAGE_INCOMPATIBLE` | Align every direct Gateforge package to `0.9.0`, update wrapper pins, then run `npm install`. |
95
+ | `EVIDENCE_STALE` after upgrading | Run `gateforge test-gates --changed`, then check again. A receipt names the engine that sealed it, and 0.9.0 is a new engine. |
96
+ | `npm error code EOVERRIDE` (`Override for @gate-forge/… conflicts with direct dependency`) | Set every `@gate-forge/*` entry in `overrides`/`resolutions` and every `npm:@gate-forge/…` alias to `0.9.0` by hand, then run `npm install` (step 1). |
97
+ | Blocking count dropped a lot right after upgrading | That is the gitignore and test-directory rules working. Compare against a CLEAN CLONE of the same commit before investigating: the two now agree. |
98
+ | `FASTAPI_PREFIX_UNRESOLVED` | Make the prefix a literal at the mount site. An f-string, an attribute or a call cannot be proven statically, and Gateforge will not guess a path. |
99
+ | `FASTAPI_ROUTER_UNMOUNTED` | Mount the router (`app.include_router(...)`) or delete it. Nothing in the scanned set serves those routes today. |
100
+ | `HTTP_METHOD_DYNAMIC` | The method comes from a wrapped request-options object Gateforge cannot resolve statically. Resolve the constant in the file or accept the finding; the previous `GET` default was never evidence. |
101
+ | `ENDPOINT_RESOURCE_CANDIDATE_UNMATCHED` | The route exists; Gateforge could not tie it to a business resource by name, and it says so instead of staying silent. The listed names are candidates, never links: give the route a response or handler name that carries the resource (or declare the mapping) if one of them is right. With no `endpoints.unmatchedRoutes` key it is an advisory; add `block` to that key to make it gate commits. |
102
+ | `CHANGE_UNMAPPED` on a file you believe is yours | Run `gateforge explain <path>`: it prints what the file is and what governs it (Gateforge policy input, declared gate input, owner-declared documentation folder, known source of a resource, or an unclassified change) and the steps that attribute it. |
103
+ | `ENFORCEMENT_UNTRUSTED` on a setup-only commit | Pin (re-approve) the policy digest so the change set is provably product-behavior-neutral. Never reach for `--no-verify`. |
104
+ | A `persistence:read` noted "above the 1048576-byte witness collection-read bound" or "above the 10000-row witness collection-read bound" | The list route serves more than the engine will read in one response. Declare paging on the adapter and prefer a by-id observe read for the claim; a bigger bound would only postpone this. |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gate-forge/cli",
3
- "version": "0.7.1",
3
+ "version": "0.9.0",
4
4
  "gateforgeCompatibility": {
5
5
  "supervisedFixtureProtocol": "gateforge.supervised-playwright.v1"
6
6
  },
@@ -31,14 +31,15 @@
31
31
  "test": "vitest run"
32
32
  },
33
33
  "dependencies": {
34
- "@gate-forge/core": "^0.7.1",
35
- "@gate-forge/http-contract": "^0.7.1",
36
- "@gate-forge/pack-fastapi": "^0.7.1",
37
- "@gate-forge/pack-http": "^0.7.1",
38
- "@gate-forge/pack-playwright": "^0.7.1",
39
- "@gate-forge/pack-sqlalchemy": "^0.7.1",
40
- "@gate-forge/pack-task": "^0.7.1",
41
- "@gate-forge/plugin-protocol": "^0.7.1",
34
+ "@gate-forge/core": "^0.9.0",
35
+ "@gate-forge/http-contract": "^0.9.0",
36
+ "@gate-forge/pack-fastapi": "^0.9.0",
37
+ "@gate-forge/pack-alembic": "^0.9.0",
38
+ "@gate-forge/pack-http": "^0.9.0",
39
+ "@gate-forge/pack-playwright": "^0.9.0",
40
+ "@gate-forge/pack-sqlalchemy": "^0.9.0",
41
+ "@gate-forge/pack-task": "^0.9.0",
42
+ "@gate-forge/plugin-protocol": "^0.9.0",
42
43
  "picomatch": "^4.0.7",
43
44
  "yaml": "^2.8.1"
44
45
  },