@gate-forge/cli 0.6.3 → 0.7.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 (103) hide show
  1. package/README.md +126 -21
  2. package/dist/args.js +1 -1
  3. package/dist/args.js.map +1 -1
  4. package/dist/broker.d.ts.map +1 -1
  5. package/dist/broker.js +19 -10
  6. package/dist/broker.js.map +1 -1
  7. package/dist/candidate-tree.d.ts +2 -1
  8. package/dist/candidate-tree.d.ts.map +1 -1
  9. package/dist/candidate-tree.js +66 -4
  10. package/dist/candidate-tree.js.map +1 -1
  11. package/dist/cli.d.ts +1 -1
  12. package/dist/cli.d.ts.map +1 -1
  13. package/dist/cli.js +5 -0
  14. package/dist/cli.js.map +1 -1
  15. package/dist/commands/blocking.d.ts +7 -4
  16. package/dist/commands/blocking.d.ts.map +1 -1
  17. package/dist/commands/blocking.js +116 -40
  18. package/dist/commands/blocking.js.map +1 -1
  19. package/dist/commands/check.d.ts +10 -0
  20. package/dist/commands/check.d.ts.map +1 -1
  21. package/dist/commands/check.js +146 -33
  22. package/dist/commands/check.js.map +1 -1
  23. package/dist/commands/common.d.ts +4 -2
  24. package/dist/commands/common.d.ts.map +1 -1
  25. package/dist/commands/common.js +4 -2
  26. package/dist/commands/common.js.map +1 -1
  27. package/dist/commands/init.d.ts.map +1 -1
  28. package/dist/commands/init.js +105 -165
  29. package/dist/commands/init.js.map +1 -1
  30. package/dist/commands/keys.d.ts +6 -0
  31. package/dist/commands/keys.d.ts.map +1 -0
  32. package/dist/commands/keys.js +72 -0
  33. package/dist/commands/keys.js.map +1 -0
  34. package/dist/commands/next.d.ts.map +1 -1
  35. package/dist/commands/next.js +23 -21
  36. package/dist/commands/next.js.map +1 -1
  37. package/dist/commands/pre-commit.d.ts.map +1 -1
  38. package/dist/commands/pre-commit.js +21 -8
  39. package/dist/commands/pre-commit.js.map +1 -1
  40. package/dist/commands/test-gates.d.ts +12 -4
  41. package/dist/commands/test-gates.d.ts.map +1 -1
  42. package/dist/commands/test-gates.js +357 -75
  43. package/dist/commands/test-gates.js.map +1 -1
  44. package/dist/commands/tests.d.ts +1 -1
  45. package/dist/commands/tests.d.ts.map +1 -1
  46. package/dist/commands/tests.js +37 -3
  47. package/dist/commands/tests.js.map +1 -1
  48. package/dist/docs-exclusions.d.ts +12 -0
  49. package/dist/docs-exclusions.d.ts.map +1 -0
  50. package/dist/docs-exclusions.js +211 -0
  51. package/dist/docs-exclusions.js.map +1 -0
  52. package/dist/evaluate.d.ts +8 -12
  53. package/dist/evaluate.d.ts.map +1 -1
  54. package/dist/evaluate.js +53 -11
  55. package/dist/evaluate.js.map +1 -1
  56. package/dist/execution.d.ts +7 -3
  57. package/dist/execution.d.ts.map +1 -1
  58. package/dist/execution.js +9 -2
  59. package/dist/execution.js.map +1 -1
  60. package/dist/index.d.ts +1 -1
  61. package/dist/index.d.ts.map +1 -1
  62. package/dist/index.js +1 -1
  63. package/dist/index.js.map +1 -1
  64. package/dist/input-snapshot.d.ts +30 -6
  65. package/dist/input-snapshot.d.ts.map +1 -1
  66. package/dist/input-snapshot.js +58 -21
  67. package/dist/input-snapshot.js.map +1 -1
  68. package/dist/mapping.d.ts +18 -30
  69. package/dist/mapping.d.ts.map +1 -1
  70. package/dist/mapping.js +75 -51
  71. package/dist/mapping.js.map +1 -1
  72. package/dist/package-compatibility.d.ts +27 -0
  73. package/dist/package-compatibility.d.ts.map +1 -0
  74. package/dist/package-compatibility.js +112 -0
  75. package/dist/package-compatibility.js.map +1 -0
  76. package/dist/receipts.d.ts +13 -2
  77. package/dist/receipts.d.ts.map +1 -1
  78. package/dist/receipts.js +58 -4
  79. package/dist/receipts.js.map +1 -1
  80. package/dist/runtime-reuse.d.ts +24 -0
  81. package/dist/runtime-reuse.d.ts.map +1 -0
  82. package/dist/runtime-reuse.js +168 -0
  83. package/dist/runtime-reuse.js.map +1 -0
  84. package/dist/runtime.d.ts +2 -0
  85. package/dist/runtime.d.ts.map +1 -1
  86. package/dist/runtime.js +118 -108
  87. package/dist/runtime.js.map +1 -1
  88. package/dist/staged-candidate.d.ts +4 -0
  89. package/dist/staged-candidate.d.ts.map +1 -1
  90. package/dist/staged-candidate.js +57 -11
  91. package/dist/staged-candidate.js.map +1 -1
  92. package/dist/state.d.ts +3 -0
  93. package/dist/state.d.ts.map +1 -1
  94. package/dist/state.js +4 -0
  95. package/dist/state.js.map +1 -1
  96. package/dist/verifier-keys.d.ts +59 -0
  97. package/dist/verifier-keys.d.ts.map +1 -0
  98. package/dist/verifier-keys.js +339 -0
  99. package/dist/verifier-keys.js.map +1 -0
  100. package/guides/QUICKSTART.md +169 -0
  101. package/guides/TEST-ENVIRONMENT.md +191 -0
  102. package/guides/UPGRADE-0.6-to-0.7.md +65 -0
  103. package/package.json +14 -10
@@ -0,0 +1,339 @@
1
+ /**
2
+ * Trusted verifier-key sources and rotation helpers.
3
+ *
4
+ * Secrets come from the protected environment or an owner-only external
5
+ * key-ring file. Candidate files and run artifacts are never key sources.
6
+ */
7
+ import { closeSync, constants, fstatSync, fsyncSync, lstatSync, openSync, readFileSync, realpathSync, renameSync, unlinkSync, writeFileSync, } from 'node:fs';
8
+ import { createHash, randomBytes, randomUUID } from 'node:crypto';
9
+ import { dirname, isAbsolute, relative, resolve, sep } from 'node:path';
10
+ import { GateReceiptSchema, verifyGateReceipt } from '@gate-forge/core';
11
+ import { UsageError } from './errors.js';
12
+ import { resolveGitDir } from './candidate-tree.js';
13
+ import { resolveStateDir } from './state.js';
14
+ import { VERIFIER_KEY_ENV, VERIFIER_KEY_FILE_ENV } from './commands/common.js';
15
+ const KEY_ID_PATTERN = /^[a-zA-Z0-9][a-zA-Z0-9._-]{0,63}$/;
16
+ /** Returns the stable non-secret identifier used for an environment key. */
17
+ export function environmentVerifierKeyId(key) {
18
+ return `env-${createHash('sha256').update('gateforge.verifier-key-id.v1\0').update(key).digest('hex').slice(0, 24)}`;
19
+ }
20
+ /** Resolves the trusted key source and rejects any source inside candidate artifacts. */
21
+ export function resolveVerifierKeyring(cwd, env, additionalArtifactRoots = []) {
22
+ const environmentKey = env[VERIFIER_KEY_ENV];
23
+ const keyFile = env[VERIFIER_KEY_FILE_ENV];
24
+ if (typeof environmentKey === 'string' && environmentKey.length > 0 && typeof keyFile === 'string' && keyFile.length > 0) {
25
+ throw new UsageError(`set only one verifier-key source: ${VERIFIER_KEY_ENV} or ${VERIFIER_KEY_FILE_ENV}`);
26
+ }
27
+ if (typeof environmentKey === 'string' && environmentKey.length > 0) {
28
+ const active = { keyId: environmentVerifierKeyId(environmentKey), key: environmentKey };
29
+ return { active, keys: [active] };
30
+ }
31
+ if (typeof keyFile !== 'string' || keyFile.length === 0)
32
+ return null;
33
+ const path = resolve(cwd, keyFile);
34
+ assertExternalVerifierKeyPath(cwd, path, env, additionalArtifactRoots);
35
+ const document = readSecureKeyring(path);
36
+ const keys = Object.entries(document.keys).map(([keyId, key]) => ({ keyId, key }));
37
+ const active = keys.find((entry) => entry.keyId === document.activeKeyId);
38
+ if (active === undefined)
39
+ throw new UsageError('verifier key ring has no active key');
40
+ return { active, keys: [active, ...keys.filter((entry) => entry.keyId !== active.keyId)] };
41
+ }
42
+ /** Checks that a key path stays outside candidate, Git, state, and artifact roots. */
43
+ export function assertExternalVerifierKeyPath(cwd, keyPath, env, additionalArtifactRoots = []) {
44
+ if (process.platform === 'win32' || constants.O_NOFOLLOW === undefined) {
45
+ throw new UsageError('verifier key files need POSIX owner and mode checks with no-follow open; use a protected environment or a supported secret provider on this platform');
46
+ }
47
+ const absolutePath = resolve(cwd, keyPath);
48
+ const canonicalPath = canonicalizePath(absolutePath);
49
+ const protectedRoots = [
50
+ cwd,
51
+ resolveGitDir(cwd, env) ?? '',
52
+ resolveStateDir(cwd),
53
+ ...additionalArtifactRoots,
54
+ ].filter((root) => root !== '');
55
+ for (const root of protectedRoots) {
56
+ const canonicalRoot = canonicalizePath(resolve(root));
57
+ if (isWithin(canonicalRoot, canonicalPath)) {
58
+ throw new UsageError(`verifier key file must be outside the candidate repository, Git directory, run state, and uploaded artifact roots: '${absolutePath}'`);
59
+ }
60
+ }
61
+ return absolutePath;
62
+ }
63
+ /** Verifies a receipt with the identified key or any retained key for older receipts. */
64
+ export function verifyGateReceiptWithKeyring(keyring, candidate, expected = {}) {
65
+ const parsed = GateReceiptSchema.safeParse(candidate);
66
+ if (!parsed.success)
67
+ return verifyGateReceipt(keyring.active.key, candidate, expected);
68
+ const receiptKeyId = parsed.data.verifierKeyId;
69
+ if (receiptKeyId !== undefined) {
70
+ const selected = keyring.keys.find((entry) => entry.keyId === receiptKeyId);
71
+ if (selected === undefined) {
72
+ return {
73
+ ok: false,
74
+ rejection: 'key-unknown',
75
+ detail: `KEY_UNKNOWN: verifier key '${receiptKeyId}' is not in the trusted key ring`,
76
+ };
77
+ }
78
+ const result = verifyGateReceipt(selected.key, candidate, expected);
79
+ return result.ok || result.rejection !== 'mac-fail'
80
+ ? result
81
+ : {
82
+ ok: false,
83
+ rejection: 'key-mismatch',
84
+ detail: `KEY_MISMATCH: verifier key '${receiptKeyId}' does not authenticate this receipt`,
85
+ };
86
+ }
87
+ let lastMacFailure = null;
88
+ for (const entry of keyring.keys) {
89
+ const result = verifyGateReceipt(entry.key, candidate, expected);
90
+ if (result.ok)
91
+ return result;
92
+ if (result.rejection === 'mac-fail')
93
+ lastMacFailure = result;
94
+ else
95
+ return result;
96
+ }
97
+ return {
98
+ ok: false,
99
+ rejection: 'key-mismatch',
100
+ detail: `KEY_MISMATCH: no trusted verifier key authenticates this receipt${lastMacFailure === null ? '' : ' (MAC check failed)'}`,
101
+ };
102
+ }
103
+ /** Loads and validates an owner-only regular key-ring file without following links. */
104
+ export function readSecureKeyring(path) {
105
+ const fd = openSecureFile(path);
106
+ let raw;
107
+ try {
108
+ const info = fstatSync(fd);
109
+ assertSecureFileInfo(info, path);
110
+ raw = readFileSync(fd, 'utf8');
111
+ }
112
+ finally {
113
+ closeSync(fd);
114
+ }
115
+ return parseKeyringDocument(raw, path);
116
+ }
117
+ /** Creates an initial owner-only key ring at a new external path. */
118
+ export function createVerifierKeyringFile(path) {
119
+ const keyId = newKeyId();
120
+ const document = {
121
+ schemaVersion: 1,
122
+ activeKeyId: keyId,
123
+ keys: { [keyId]: randomBytes(32).toString('base64url') },
124
+ };
125
+ let fd;
126
+ try {
127
+ fd = openSync(path, constants.O_WRONLY | constants.O_CREAT | constants.O_EXCL | constants.O_NOFOLLOW, 0o600);
128
+ }
129
+ catch (error) {
130
+ throw new UsageError(`key create: cannot create verifier key file '${path}': ${error.message}`);
131
+ }
132
+ try {
133
+ assertSecureFileInfo(fstatSync(fd), path);
134
+ writeFileSync(fd, `${JSON.stringify(document, null, 2)}\n`, 'utf8');
135
+ fsyncSync(fd);
136
+ }
137
+ catch (error) {
138
+ closeSync(fd);
139
+ unlinkSync(path);
140
+ throw error;
141
+ }
142
+ closeSync(fd);
143
+ return { document, keyId };
144
+ }
145
+ /** Rotates the active key and retains every previous key for receipt verification. */
146
+ export function rotateVerifierKeyring(document) {
147
+ const keyId = newKeyId();
148
+ return {
149
+ document: { schemaVersion: 1, activeKeyId: keyId, keys: { ...document.keys, [keyId]: randomBytes(32).toString('base64url') } },
150
+ keyId,
151
+ };
152
+ }
153
+ /** Adds an environment key to a ring so existing receipts stay verifiable after source migration. */
154
+ export function importEnvironmentVerifierKey(document, key) {
155
+ if (key.length === 0)
156
+ throw new UsageError(`key import-env: ${VERIFIER_KEY_ENV} is required`);
157
+ const keyId = environmentVerifierKeyId(key);
158
+ const existing = document.keys[keyId];
159
+ if (existing !== undefined && existing !== key) {
160
+ throw new UsageError(`key import-env: key id collision for '${keyId}'`);
161
+ }
162
+ return {
163
+ document: { schemaVersion: 1, activeKeyId: document.activeKeyId, keys: { ...document.keys, [keyId]: key } },
164
+ keyId,
165
+ };
166
+ }
167
+ /** Removes a retained key after confirming it is not active. */
168
+ export function retireVerifierKey(document, keyId) {
169
+ if (keyId === document.activeKeyId)
170
+ throw new UsageError('cannot retire the active verifier key; rotate first');
171
+ if (document.keys[keyId] === undefined)
172
+ throw new UsageError(`unknown verifier key id '${keyId}'`);
173
+ const keys = { ...document.keys };
174
+ delete keys[keyId];
175
+ return { schemaVersion: 1, activeKeyId: document.activeKeyId, keys };
176
+ }
177
+ /** Atomically replaces an existing secure key ring. */
178
+ export function writeSecureKeyring(path, document) {
179
+ const temporary = `${path}.${randomUUID()}.tmp`;
180
+ const fd = openSync(temporary, constants.O_WRONLY | constants.O_CREAT | constants.O_EXCL | constants.O_NOFOLLOW, 0o600);
181
+ try {
182
+ assertSecureFileInfo(fstatSync(fd), temporary);
183
+ writeFileSync(fd, `${JSON.stringify(document, null, 2)}\n`, 'utf8');
184
+ fsyncSync(fd);
185
+ }
186
+ catch (error) {
187
+ closeSync(fd);
188
+ unlinkSync(temporary);
189
+ throw error;
190
+ }
191
+ closeSync(fd);
192
+ try {
193
+ renameSync(temporary, path);
194
+ }
195
+ catch (error) {
196
+ unlinkSync(temporary);
197
+ throw error;
198
+ }
199
+ }
200
+ /** Converts a secret or existing ring argument to a ring. */
201
+ export function verifierKeyringFrom(source) {
202
+ if (source === null)
203
+ return null;
204
+ if (typeof source !== 'string')
205
+ return source;
206
+ const active = { keyId: environmentVerifierKeyId(source), key: source };
207
+ return { active, keys: [active] };
208
+ }
209
+ /** Opens one regular key file without following a symbolic link.
210
+ *
211
+ * Args:
212
+ * path: absolute external key-file path.
213
+ *
214
+ * Returns:
215
+ * number: an open file descriptor.
216
+ */
217
+ function openSecureFile(path) {
218
+ try {
219
+ const linkInfo = lstatSync(path);
220
+ if (linkInfo.isSymbolicLink())
221
+ throw new UsageError('verifier key file must not be a symbolic link');
222
+ assertSecureFileInfo(linkInfo, path);
223
+ return openSync(path, constants.O_RDONLY | constants.O_NOFOLLOW);
224
+ }
225
+ catch (error) {
226
+ if (error instanceof UsageError)
227
+ throw error;
228
+ throw new UsageError(`cannot open verifier key file '${path}': ${error.message}`);
229
+ }
230
+ }
231
+ /** Requires a current-user-owned file with no group access or other links.
232
+ *
233
+ * Args:
234
+ * info: filesystem metadata for the open file.
235
+ * path: key-file path used in diagnostics.
236
+ */
237
+ function assertSecureFileInfo(info, path) {
238
+ if (!info.isFile())
239
+ throw new UsageError(`verifier key file '${path}' must be a regular file`);
240
+ if ((info.mode & 0o077) !== 0) {
241
+ throw new UsageError(`verifier key file '${path}' must be owner-only (mode 0600 or stricter)`);
242
+ }
243
+ if (info.nlink !== 1)
244
+ throw new UsageError(`verifier key file '${path}' must not have other hard links`);
245
+ const currentUid = typeof process.getuid === 'function' ? process.getuid() : null;
246
+ if (currentUid !== null && info.uid !== currentUid) {
247
+ throw new UsageError(`verifier key file '${path}' must be owned by the current user`);
248
+ }
249
+ }
250
+ /** Parses the versioned key-ring JSON without exposing secret values in errors.
251
+ *
252
+ * Args:
253
+ * raw: key-ring file contents.
254
+ * path: source path used in diagnostics.
255
+ *
256
+ * Returns:
257
+ * VerifierKeyringDocument: validated ids and secret values.
258
+ */
259
+ function parseKeyringDocument(raw, path) {
260
+ let value;
261
+ try {
262
+ value = JSON.parse(raw);
263
+ }
264
+ catch {
265
+ throw new UsageError(`verifier key file '${path}' is not valid JSON`);
266
+ }
267
+ if (typeof value !== 'object' || value === null || Array.isArray(value)) {
268
+ throw new UsageError(`verifier key file '${path}' must contain a key-ring object`);
269
+ }
270
+ const document = value;
271
+ if (document['schemaVersion'] !== 1 ||
272
+ typeof document['activeKeyId'] !== 'string' ||
273
+ !KEY_ID_PATTERN.test(document['activeKeyId']) ||
274
+ typeof document['keys'] !== 'object' ||
275
+ document['keys'] === null ||
276
+ Array.isArray(document['keys'])) {
277
+ throw new UsageError(`verifier key file '${path}' has an invalid key-ring header`);
278
+ }
279
+ const keys = {};
280
+ for (const [keyId, key] of Object.entries(document['keys'])) {
281
+ if (!KEY_ID_PATTERN.test(keyId) || typeof key !== 'string' || key.length === 0) {
282
+ throw new UsageError(`verifier key file '${path}' has an invalid key entry`);
283
+ }
284
+ keys[keyId] = key;
285
+ }
286
+ if (Object.keys(keys).length === 0 || keys[document['activeKeyId']] === undefined) {
287
+ throw new UsageError(`verifier key file '${path}' must include its active key`);
288
+ }
289
+ return { schemaVersion: 1, activeKeyId: document['activeKeyId'], keys };
290
+ }
291
+ /** Resolves existing symlinks and appends any not-yet-existing path suffix.
292
+ *
293
+ * Args:
294
+ * path: absolute or relative filesystem path.
295
+ *
296
+ * Returns:
297
+ * string: canonical absolute path when its existing parent can be read.
298
+ */
299
+ function canonicalizePath(path) {
300
+ if (isAbsolute(path)) {
301
+ let cursor = resolve(path);
302
+ const suffix = [];
303
+ while (true) {
304
+ try {
305
+ return resolve(realpathSync(cursor), ...suffix.reverse());
306
+ }
307
+ catch {
308
+ const parent = dirname(cursor);
309
+ if (parent === cursor)
310
+ return resolve(path);
311
+ suffix.push(cursor.slice(parent.length + (parent.endsWith(sep) ? 0 : 1)));
312
+ cursor = parent;
313
+ }
314
+ }
315
+ }
316
+ return canonicalizePath(resolve(path));
317
+ }
318
+ /** Returns whether one resolved path is the root or one of its descendants.
319
+ *
320
+ * Args:
321
+ * root: canonical protected root.
322
+ * path: canonical candidate path.
323
+ *
324
+ * Returns:
325
+ * boolean: true when `path` is within `root`.
326
+ */
327
+ function isWithin(root, path) {
328
+ const child = relative(root, path);
329
+ return child === '' || (child !== '..' && !child.startsWith(`..${sep}`) && !isAbsolute(child));
330
+ }
331
+ /** Creates an unrelated, non-secret id for one newly generated key.
332
+ *
333
+ * Returns:
334
+ * string: a unique key id.
335
+ */
336
+ function newKeyId() {
337
+ return `key-${randomBytes(12).toString('hex')}`;
338
+ }
339
+ //# sourceMappingURL=verifier-keys.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verifier-keys.js","sourceRoot":"","sources":["../src/verifier-keys.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EACL,SAAS,EACT,SAAS,EACT,SAAS,EACT,SAAS,EACT,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,UAAU,EACV,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Gateforge does not create your app, database, seed data, logins, or test services. Your team or agent provides those first. See [Test environment](TEST-ENVIRONMENT.md).
4
+
5
+ You need Node.js 20 or newer and an existing Playwright suite that can run against a disposable app.
6
+
7
+ ## 1. Install the CLI and the packs you use
8
+
9
+ Install the CLI, Playwright pack, and only the detector packs that fit your app. Keep every direct `@gate-forge/*` package on the same release.
10
+
11
+ Example for a React frontend, FastAPI backend, and SQLAlchemy data layer:
12
+
13
+ ```sh
14
+ npm i -D \
15
+ @gate-forge/cli@0.7.1 \
16
+ @gate-forge/pack-playwright@0.7.1 \
17
+ @gate-forge/pack-http@0.7.1 \
18
+ @gate-forge/pack-fastapi@0.7.1 \
19
+ @gate-forge/pack-sqlalchemy@0.7.1
20
+ ```
21
+
22
+ 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`.
23
+
24
+ **You should see:** npm installs the packages without a Gateforge compatibility error.
25
+
26
+ **If not:** align every direct `@gate-forge/*` package to `0.7.1`, then install again. Do not work around the compatibility error.
27
+
28
+ ## 2. Initialize the repository
29
+
30
+ ```sh
31
+ gateforge init
32
+ ```
33
+
34
+ Gateforge scans the repository and prints recommended packs. By default, it writes:
35
+
36
+ - `.gateforge.yml`
37
+ - `.gateforge/policies.yml`
38
+ - `.gateforge/classification-policy.yml`
39
+ - `.gateforge/baselines/obligations.json`
40
+ - `GATEFORGE.md`
41
+ - `tests/e2e/gateforge/README.md` for the default overlay proof path
42
+
43
+ It also creates `.gateforge/adapters/` and `.gateforge/waivers/`. It preserves existing files. A chosen documentation exclusion adds `.gateforge/docs-exclusions.yml`.
44
+
45
+ **You should see:** a scan summary, recommended packages, and a `skeleton ready` message.
46
+
47
+ **If not:** read the first error. Fix invalid or missing project configuration, install a recommended pack, then run `gateforge init` again. Existing files are not replaced by a normal rerun.
48
+
49
+ ## 3. Find existing tests and suggestions
50
+
51
+ First inventory the test suite:
52
+
53
+ ```sh
54
+ gateforge tests discover
55
+ ```
56
+
57
+ Then ask Gateforge which existing tests may cover the obligations:
58
+
59
+ ```sh
60
+ gateforge tests suggest
61
+ ```
62
+
63
+ Discovery writes a derived catalog under `.gateforge/test-gates/`. Suggestions are for inspection; they do not create declarations or prove a test.
64
+
65
+ **You should see:** discovered test keys and suggestions with obligation IDs and any mapping problems.
66
+
67
+ **If not:** fix Playwright installation, configuration, or test enumeration first. Do not treat an empty or failed inventory as proof that no tests exist. If a test does not fit, the suggestion report explains what is missing.
68
+
69
+ ## 4. Declare which existing tests cover claims
70
+
71
+ Use either a Playwright annotation or the tracked map file. Declarations tell the gate which test is relevant; they are not proof by themselves.
72
+
73
+ An annotation uses the exact obligation ID:
74
+
75
+ ```ts
76
+ test('updates a profile', {
77
+ annotation: { type: 'gateforge', description: '<obligation-id-from-suggest>' },
78
+ }, async ({ page }) => {
79
+ // Existing test body.
80
+ });
81
+ ```
82
+
83
+ Or declare an existing catalog entry with `tests mark`:
84
+
85
+ ```sh
86
+ gateforge tests mark \
87
+ --test '<exact-test-key-from-discover>' \
88
+ --kind browser-e2e \
89
+ --category persistence.update \
90
+ --obligation '<exact-obligation-id-from-suggest>' \
91
+ --reason 'Existing test updates a profile.'
92
+ ```
93
+
94
+ `tests mark` writes `.gateforge/test-map.yml`. Commit that file so `check`, hooks, and CI can read the declaration without listing the suite. Replace the example values with exact values from your catalog and suggestion output. Never mark a test that does not perform the claimed behavior.
95
+
96
+ **You should see:** the sidecar diff, or a current annotation in the test. A repeated identical `tests mark` reports no changes.
97
+
98
+ **If not:** rerun discovery, copy the exact test key and obligation ID, and resolve any mapping contradiction. Do not use a declaration to silence a blocker.
99
+
100
+ ## 5. Prepare a verifier key and the app
101
+
102
+ Keep the key outside the repository and run-state folder:
103
+
104
+ ```sh
105
+ mkdir -p "$HOME/.config/gateforge"
106
+ gateforge key create --file "$HOME/.config/gateforge/keys.json" --confirm
107
+ export GATEFORGE_WITNESS_VERIFIER_KEY_FILE="$HOME/.config/gateforge/keys.json"
108
+ ```
109
+
110
+ The command prints a key ID, not the secret. Set the app URL and any session state the suite needs. The application and test environment must already be running; see [Test environment](TEST-ENVIRONMENT.md).
111
+
112
+ **You should see:** `verifier key ring created` and an active key ID.
113
+
114
+ **If not:** create the parent directory, check file permissions, and keep the key file outside `.gateforge/test-gates/` and the repository.
115
+
116
+ ## 6. Run the supervised tests
117
+
118
+ ```sh
119
+ gateforge test-gates --changed
120
+ ```
121
+
122
+ Gateforge supervises the selected suite and writes an authenticated receipt only after a complete successful run.
123
+
124
+ **You should see:** the selected tests pass and the run seals a receipt.
125
+
126
+ **If not:** use the first typed blocker. Check the changed-file base, mapping, app readiness, seed data, and verifier key. A test declaration or a plain passing test run is not a receipt.
127
+
128
+ ## 7. Check the changed code
129
+
130
+ ```sh
131
+ gateforge check --changed --require-e2e
132
+ ```
133
+
134
+ This checks the changed scope and requires a current receipt for the exact inputs. Do not edit files between the witnessed run and this check; changed bytes make the receipt stale.
135
+
136
+ **You should see:** a clean report for the changed scope.
137
+
138
+ **If not:** ask Gateforge for one next action:
139
+
140
+ ```sh
141
+ gateforge next
142
+ ```
143
+
144
+ Follow its `do:` line, then run the check again. See [Test environment](TEST-ENVIRONMENT.md) if the block is caused by setup or test state.
145
+
146
+ ## 8. Install the blocking hook and CI wiring
147
+
148
+ ```sh
149
+ gateforge init --blocking
150
+ ```
151
+
152
+ This installs and verifies an active pre-commit hook and adds CI wiring. Review the output and generated files:
153
+
154
+ - `.git/hooks/pre-commit` (or the configured Git hooks path)
155
+ - `.gateforge/hooks/gateforge-staged.sh`
156
+ - `.gateforge/ci/gitlab-gateforge.yml`
157
+ - `.gitlab-ci.yml` include
158
+
159
+ The hook and CI gate block changes that lack the required evidence. Configure protected CI secrets and require the generated CI job to pass on the protected branch; a local hook alone is not server enforcement.
160
+
161
+ **You should see:** `installed:`, `updated:`, `verified:`, or a framework-managed hook message, followed by `blocking gate wired`.
162
+
163
+ **If not:** follow the exact `required action` printed for an incomplete installation. Resolve hook-manager conflicts, then rerun `gateforge init --blocking` and verify the active hook.
164
+
165
+ ## Coming next
166
+
167
+ - `gateforge tests sync` will generate test-map entries from annotations.
168
+ - Unprovable contracts will be off by default.
169
+ - Multiple updates on one row will be evaluated per step.