@gate-forge/cli 0.4.0 → 0.5.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 (88) hide show
  1. package/README.md +37 -11
  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 +73 -123
  6. package/dist/broker.js.map +1 -1
  7. package/dist/candidate-tree.d.ts +36 -0
  8. package/dist/candidate-tree.d.ts.map +1 -0
  9. package/dist/candidate-tree.js +321 -0
  10. package/dist/candidate-tree.js.map +1 -0
  11. package/dist/cli.d.ts +8 -2
  12. package/dist/cli.d.ts.map +1 -1
  13. package/dist/cli.js +17 -3
  14. package/dist/cli.js.map +1 -1
  15. package/dist/commands/adopt.js +2 -2
  16. package/dist/commands/adopt.js.map +1 -1
  17. package/dist/commands/check.d.ts.map +1 -1
  18. package/dist/commands/check.js +10 -3
  19. package/dist/commands/check.js.map +1 -1
  20. package/dist/commands/controller.d.ts +43 -0
  21. package/dist/commands/controller.d.ts.map +1 -0
  22. package/dist/commands/controller.js +110 -0
  23. package/dist/commands/controller.js.map +1 -0
  24. package/dist/commands/enforcement.d.ts.map +1 -1
  25. package/dist/commands/enforcement.js +61 -1
  26. package/dist/commands/enforcement.js.map +1 -1
  27. package/dist/commands/explain.d.ts.map +1 -1
  28. package/dist/commands/explain.js +2 -7
  29. package/dist/commands/explain.js.map +1 -1
  30. package/dist/commands/init.d.ts +6 -2
  31. package/dist/commands/init.d.ts.map +1 -1
  32. package/dist/commands/init.js +426 -62
  33. package/dist/commands/init.js.map +1 -1
  34. package/dist/commands/next.d.ts +15 -0
  35. package/dist/commands/next.d.ts.map +1 -0
  36. package/dist/commands/next.js +337 -0
  37. package/dist/commands/next.js.map +1 -0
  38. package/dist/commands/test-gates.d.ts +18 -0
  39. package/dist/commands/test-gates.d.ts.map +1 -1
  40. package/dist/commands/test-gates.js +157 -5
  41. package/dist/commands/test-gates.js.map +1 -1
  42. package/dist/commands/tests.js +114 -13
  43. package/dist/commands/tests.js.map +1 -1
  44. package/dist/evaluate.d.ts +8 -0
  45. package/dist/evaluate.d.ts.map +1 -1
  46. package/dist/evaluate.js +19 -10
  47. package/dist/evaluate.js.map +1 -1
  48. package/dist/execution.d.ts +20 -0
  49. package/dist/execution.d.ts.map +1 -1
  50. package/dist/execution.js +14 -2
  51. package/dist/execution.js.map +1 -1
  52. package/dist/input-snapshot.d.ts.map +1 -1
  53. package/dist/input-snapshot.js +4 -0
  54. package/dist/input-snapshot.js.map +1 -1
  55. package/dist/io.d.ts +3 -0
  56. package/dist/io.d.ts.map +1 -1
  57. package/dist/io.js.map +1 -1
  58. package/dist/isolation.d.ts +104 -0
  59. package/dist/isolation.d.ts.map +1 -0
  60. package/dist/isolation.js +353 -0
  61. package/dist/isolation.js.map +1 -0
  62. package/dist/mapping.d.ts +29 -9
  63. package/dist/mapping.d.ts.map +1 -1
  64. package/dist/mapping.js +37 -10
  65. package/dist/mapping.js.map +1 -1
  66. package/dist/pipeline.d.ts +14 -4
  67. package/dist/pipeline.d.ts.map +1 -1
  68. package/dist/pipeline.js +64 -7
  69. package/dist/pipeline.js.map +1 -1
  70. package/dist/podman-bootstrap.d.ts +59 -0
  71. package/dist/podman-bootstrap.d.ts.map +1 -0
  72. package/dist/podman-bootstrap.js +123 -0
  73. package/dist/podman-bootstrap.js.map +1 -0
  74. package/dist/receipts.d.ts +8 -0
  75. package/dist/receipts.d.ts.map +1 -1
  76. package/dist/receipts.js +4 -0
  77. package/dist/receipts.js.map +1 -1
  78. package/dist/repo-scan.d.ts +63 -0
  79. package/dist/repo-scan.d.ts.map +1 -0
  80. package/dist/repo-scan.js +272 -0
  81. package/dist/repo-scan.js.map +1 -0
  82. package/dist/scope.d.ts.map +1 -1
  83. package/dist/scope.js +3 -0
  84. package/dist/scope.js.map +1 -1
  85. package/dist/state.d.ts.map +1 -1
  86. package/dist/state.js +2 -7
  87. package/dist/state.js.map +1 -1
  88. package/package.json +9 -9
@@ -0,0 +1,321 @@
1
+ /**
2
+ * Raw candidate-tree ingestion (plan 2026-09-19 Phase 3 item 6): the
3
+ * immutable Git tree id of a workspace candidate, built from RAW BYTES
4
+ * without ever running candidate-controlled Git machinery.
5
+ *
6
+ * Why raw: `git add -A` applies clean filters from the candidate's own
7
+ * `.gitattributes`, honors candidate `core.hooksPath`, and follows the
8
+ * ambient `GIT_*` environment — a hostile candidate can execute code or
9
+ * rewrite bytes during authority ingestion. This module instead:
10
+ *
11
+ * - walks the workspace with the process filesystem (never `git add`,
12
+ * `git checkout`, `git diff`, or any hook-running porcelain);
13
+ * - hashes each regular file with `git hash-object -w --stdin` (no
14
+ * `--path`, so no clean/smudge filter can apply) into the AUTHORITY
15
+ * object store selected by an explicit `--git-dir`;
16
+ * - builds the tree with `git mktree -z` from NUL-delimited records;
17
+ * - runs every Git child with a sanitized environment (ambient
18
+ * `GIT_WORK_TREE`/`GIT_INDEX_FILE`/`GIT_DIR`/object-directory/config
19
+ * overrides stripped) plus `--no-replace-objects`;
20
+ * - rejects symlinks, submodules (nested `.git`), fifos/sockets/devices,
21
+ * and anything that is not a regular file — fail closed, never a
22
+ * silent omission.
23
+ *
24
+ * Shared by the broker (authority side) and `test-gates` sealing
25
+ * (controller side binds the tested tree into the v2 receipt).
26
+ */
27
+ import { lstatSync, opendirSync, readFileSync, readlinkSync } from 'node:fs';
28
+ import { spawnSync } from 'node:child_process';
29
+ import { join } from 'node:path';
30
+ import { UsageError } from './errors.js';
31
+ /** 40-char lowercase sha1 hex. */
32
+ const TREE_PATTERN = /^[0-9a-f]{40}$/;
33
+ /**
34
+ * Git environment keys that can redirect object-store writes, index
35
+ * selection, work-tree resolution, or configuration. Stripped from every
36
+ * child spawned here; the caller-supplied explicit `--git-dir` is the
37
+ * only object-store selector.
38
+ */
39
+ const STRIPPED_GIT_ENV = [
40
+ 'GIT_WORK_TREE',
41
+ 'GIT_INDEX_FILE',
42
+ 'GIT_DIR',
43
+ 'GIT_OBJECT_DIRECTORY',
44
+ 'GIT_ALTERNATE_OBJECT_DIRECTORIES',
45
+ 'GIT_CONFIG',
46
+ 'GIT_CONFIG_PARAMETERS',
47
+ 'GIT_CONFIG_COUNT',
48
+ 'GIT_CONFIG_GLOBAL',
49
+ 'GIT_CONFIG_SYSTEM',
50
+ 'GIT_GRAFT_FILE',
51
+ 'GIT_REPLACE_OBJECTS',
52
+ ];
53
+ /**
54
+ * Builds the sanitized child environment for authority Git plumbing:
55
+ * ambient redirectors stripped, everything else inherited.
56
+ */
57
+ export function sanitizedAuthorityEnv(env) {
58
+ const child = { ...env };
59
+ for (const key of STRIPPED_GIT_ENV)
60
+ delete child[key];
61
+ child['GIT_OPTIONAL_LOCKS'] = '0';
62
+ return child;
63
+ }
64
+ /**
65
+ * Resolves the absolute git dir of the repository at `cwd`.
66
+ *
67
+ * Returns:
68
+ * string | null: absolute git dir, or null when `cwd` is not inside a
69
+ * Git work tree (a non-git workspace seals `candidateTreeId: null`).
70
+ */
71
+ export function resolveGitDir(cwd, env) {
72
+ const result = spawnSync('git', ['--no-replace-objects', 'rev-parse', '--absolute-git-dir'], {
73
+ cwd,
74
+ env: sanitizedAuthorityEnv(env),
75
+ encoding: 'utf8',
76
+ });
77
+ if (result.error !== undefined || result.status !== 0)
78
+ return null;
79
+ const dir = (result.stdout ?? '').trim().split('\n')[0] ?? '';
80
+ return dir.length > 0 ? dir : null;
81
+ }
82
+ /**
83
+ * Runs one Git plumbing command against an explicit object store.
84
+ */
85
+ function plumbing(gitDir, env, args, input) {
86
+ const result = spawnSync('git', ['--git-dir', gitDir, '--no-replace-objects', ...args], {
87
+ env: sanitizedAuthorityEnv(env),
88
+ encoding: 'buffer',
89
+ input: input,
90
+ maxBuffer: 256 * 1024 * 1024,
91
+ });
92
+ if (result.error !== undefined) {
93
+ throw new UsageError(`candidate tree ingestion: cannot run git: ${result.error.message}`);
94
+ }
95
+ return {
96
+ status: result.status ?? -1,
97
+ stdout: (result.stdout ?? Buffer.alloc(0)).toString('utf8'),
98
+ stderr: (result.stderr ?? Buffer.alloc(0)).toString('utf8'),
99
+ };
100
+ }
101
+ /**
102
+ * Collects raw tree entries by walking `workspace` (excluding a root
103
+ * `.git` entry and, when given, the run-state output directory — sealed
104
+ * receipts and execution records are run OUTPUTS, never candidate inputs,
105
+ * exactly as the input snapshot treats them). Rejects anything that is
106
+ * not a regular file.
107
+ *
108
+ * Throws:
109
+ * UsageError: on unreadable directories (fail closed — a hole in the
110
+ * walk must never become a silent omission) or unsupported entries.
111
+ */
112
+ function collectEntries(gitDir, env, workspace, excludeDir, symlinks) {
113
+ // Repo-relative posix prefix of the excluded output tree (null = none).
114
+ // Only a directory strictly INSIDE the workspace can be excluded; an
115
+ // outside state dir excludes nothing (prefix never matches).
116
+ let excludePrefix = null;
117
+ if (excludeDir !== null) {
118
+ const rel = excludeDir.split('\\').join('/').replace(/\/+$/, '');
119
+ const root = workspace.split('\\').join('/').replace(/\/+$/, '');
120
+ if (rel === root) {
121
+ throw new UsageError('candidate tree ingestion: the run-state directory is the workspace root (fail closed)');
122
+ }
123
+ if (rel.startsWith(`${root}/`))
124
+ excludePrefix = rel.slice(root.length + 1);
125
+ }
126
+ const excluded = (rel) => excludePrefix !== null && (rel === excludePrefix || rel.startsWith(`${excludePrefix}/`));
127
+ const entries = [];
128
+ const stack = [{ dir: workspace, rel: '' }];
129
+ while (stack.length > 0) {
130
+ const current = stack.pop();
131
+ if (current === undefined)
132
+ break;
133
+ if (excluded(current.rel))
134
+ continue;
135
+ let handle;
136
+ try {
137
+ handle = opendirSync(current.dir);
138
+ }
139
+ catch (error) {
140
+ throw new UsageError(`candidate tree ingestion: cannot read directory '${current.rel || '.'}': ${error.message}`);
141
+ }
142
+ try {
143
+ let dirent;
144
+ while ((dirent = handle.readSync()) !== null) {
145
+ const name = dirent.name;
146
+ if (name === '.' || name === '..')
147
+ continue;
148
+ const rel = current.rel.length > 0 ? `${current.rel}/${name}` : name;
149
+ const absolute = join(current.dir, name);
150
+ if (current.rel === '' && name === '.git')
151
+ continue;
152
+ if (name === '.git') {
153
+ throw new UsageError(`candidate tree ingestion: nested '.git' at '${rel}' — submodule candidates cannot be verified (fail closed)`);
154
+ }
155
+ let stat;
156
+ try {
157
+ stat = lstatSync(absolute);
158
+ }
159
+ catch (error) {
160
+ throw new UsageError(`candidate tree ingestion: cannot inspect '${rel}': ${error.message}`);
161
+ }
162
+ if (stat.isSymbolicLink()) {
163
+ if (symlinks === 'reject') {
164
+ throw new UsageError(`candidate tree ingestion: symlink at '${rel}' — symlink candidates cannot be verified (fail closed)`);
165
+ }
166
+ // Faithful git semantics (like `git add`): a symlink is a
167
+ // 120000 blob whose bytes are the link-target string. Never
168
+ // followed, never resolved — the target string is the identity.
169
+ let target;
170
+ try {
171
+ target = readlinkSync(absolute);
172
+ }
173
+ catch (error) {
174
+ throw new UsageError(`candidate tree ingestion: cannot read symlink '${rel}': ${error.message}`);
175
+ }
176
+ const hashed = plumbing(gitDir, env, ['hash-object', '-w', '--stdin'], Buffer.from(target, 'utf8'));
177
+ if (hashed.status !== 0) {
178
+ throw new UsageError(`candidate tree ingestion: hash-object failed for '${rel}': ${hashed.stderr.trim()}`);
179
+ }
180
+ const linkSha = hashed.stdout.trim();
181
+ if (!TREE_PATTERN.test(linkSha)) {
182
+ throw new UsageError(`candidate tree ingestion: hash-object returned an unusable id for '${rel}'`);
183
+ }
184
+ entries.push({ mode: '120000', sha: linkSha, path: rel });
185
+ continue;
186
+ }
187
+ if (stat.isDirectory()) {
188
+ stack.push({ dir: absolute, rel });
189
+ continue;
190
+ }
191
+ if (!stat.isFile()) {
192
+ throw new UsageError(`candidate tree ingestion: unsupported entry at '${rel}' — only regular files can be verified (fail closed)`);
193
+ }
194
+ let bytes;
195
+ try {
196
+ bytes = readFileSync(absolute);
197
+ }
198
+ catch (error) {
199
+ throw new UsageError(`candidate tree ingestion: cannot read '${rel}': ${error.message}`);
200
+ }
201
+ const hashed = plumbing(gitDir, env, ['hash-object', '-w', '--stdin'], bytes);
202
+ if (hashed.status !== 0) {
203
+ throw new UsageError(`candidate tree ingestion: hash-object failed for '${rel}': ${hashed.stderr.trim()}`);
204
+ }
205
+ const sha = hashed.stdout.trim();
206
+ if (!TREE_PATTERN.test(sha)) {
207
+ throw new UsageError(`candidate tree ingestion: hash-object returned an unusable id for '${rel}'`);
208
+ }
209
+ entries.push({
210
+ mode: (stat.mode & 0o111) !== 0 ? '100755' : '100644',
211
+ sha,
212
+ path: rel,
213
+ });
214
+ }
215
+ }
216
+ finally {
217
+ handle.closeSync();
218
+ }
219
+ }
220
+ entries.sort((a, b) => (a.path < b.path ? -1 : a.path > b.path ? 1 : 0));
221
+ return entries;
222
+ }
223
+ /**
224
+ * Builds one tree object from direct children (blobs + subtrees).
225
+ */
226
+ function buildLevel(gitDir, env, children) {
227
+ const sorted = [...children].sort((a, b) => (a.name < b.name ? -1 : a.name > b.name ? 1 : 0));
228
+ const lines = sorted
229
+ .map((child) => {
230
+ const kind = child.mode === '040000' ? 'tree' : 'blob';
231
+ return `${child.mode} ${kind} ${child.sha}\t${child.name}\0`;
232
+ })
233
+ .join('');
234
+ const built = plumbing(gitDir, env, ['mktree', '-z'], Buffer.from(lines, 'utf8'));
235
+ if (built.status !== 0) {
236
+ throw new UsageError(`candidate tree ingestion: mktree failed: ${built.stderr.trim()}`);
237
+ }
238
+ const treeId = built.stdout.trim();
239
+ if (!TREE_PATTERN.test(treeId)) {
240
+ throw new UsageError('candidate tree ingestion: mktree returned an unusable tree id');
241
+ }
242
+ return treeId;
243
+ }
244
+ /**
245
+ * Computes the immutable tree id of a workspace candidate from raw bytes.
246
+ *
247
+ * Args:
248
+ * gitDir: absolute git dir of the AUTHORITY object store the tree is
249
+ * pinned into (resolved with {@link resolveGitDir}).
250
+ * workspace: absolute workspace path (the candidate bytes).
251
+ * env: process environment (sanitized for every child).
252
+ * excludeDir: absolute run-state output directory excluded from the
253
+ * tree (receipts and execution records are outputs, never inputs;
254
+ * null/omitted excludes nothing).
255
+ * symlinks: 'reject' (authority ingestion — symlink candidates cannot
256
+ * be verified) or 'record' (controller sealing — faithful git semantics:
257
+ * symlinks become 120000 blobs of the target string, never followed).
258
+ *
259
+ * Returns:
260
+ * string: 40-char hex tree id pinned in the authority store.
261
+ *
262
+ * Throws:
263
+ * UsageError: on plumbing failures or unsupported entries (fail closed).
264
+ */
265
+ export function computeCandidateTreeId(gitDir, workspace, env, excludeDir, symlinks = 'reject') {
266
+ const entries = collectEntries(gitDir, env, workspace, excludeDir ?? null, symlinks);
267
+ // Group by parent directory; build deepest-first so every subtree id
268
+ // exists before its parent references it (mimics `git write-tree`).
269
+ const filesByDir = new Map();
270
+ const subdirsByDir = new Map();
271
+ const allDirs = new Set(['']);
272
+ for (const entry of entries) {
273
+ const slash = entry.path.lastIndexOf('/');
274
+ const dir = slash < 0 ? '' : entry.path.slice(0, slash);
275
+ const list = filesByDir.get(dir) ?? [];
276
+ list.push(entry);
277
+ filesByDir.set(dir, list);
278
+ allDirs.add(dir);
279
+ let cursor = dir;
280
+ while (cursor !== '') {
281
+ const parentSlash = cursor.lastIndexOf('/');
282
+ const parent = parentSlash < 0 ? '' : cursor.slice(0, parentSlash);
283
+ const name = parentSlash < 0 ? cursor : cursor.slice(parentSlash + 1);
284
+ const set = subdirsByDir.get(parent) ?? new Set();
285
+ set.add(name);
286
+ subdirsByDir.set(parent, set);
287
+ allDirs.add(parent);
288
+ cursor = parent;
289
+ }
290
+ }
291
+ const treeByDir = new Map();
292
+ const depthOf = (dir) => (dir === '' ? 0 : dir.split('/').length);
293
+ const ordered = [...allDirs].sort((a, b) => depthOf(b) - depthOf(a));
294
+ for (const dir of ordered) {
295
+ const children = [];
296
+ for (const file of filesByDir.get(dir) ?? []) {
297
+ const slash = file.path.lastIndexOf('/');
298
+ const name = slash < 0 ? file.path : file.path.slice(slash + 1);
299
+ children.push({ mode: file.mode, sha: file.sha, name });
300
+ }
301
+ for (const name of subdirsByDir.get(dir) ?? []) {
302
+ const childDir = dir === '' ? name : `${dir}/${name}`;
303
+ const sha = treeByDir.get(childDir);
304
+ if (sha === undefined) {
305
+ throw new UsageError(`candidate tree ingestion: missing subtree for '${childDir}' (fail closed)`);
306
+ }
307
+ children.push({ mode: '040000', sha, name });
308
+ }
309
+ treeByDir.set(dir, buildLevel(gitDir, env, children));
310
+ }
311
+ const treeId = treeByDir.get('') ?? '';
312
+ if (!TREE_PATTERN.test(treeId)) {
313
+ throw new UsageError('candidate tree ingestion: failed to build the root tree (fail closed)');
314
+ }
315
+ const kind = plumbing(gitDir, env, ['cat-file', '-t', treeId]);
316
+ if (kind.status !== 0 || kind.stdout.trim() !== 'tree') {
317
+ throw new UsageError('candidate tree ingestion: pinned object is not a tree (fail closed)');
318
+ }
319
+ return treeId;
320
+ }
321
+ //# sourceMappingURL=candidate-tree.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"candidate-tree.js","sourceRoot":"","sources":["../src/candidate-tree.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,kCAAkC;AAClC,MAAM,YAAY,GAAG,gBAAgB,CAAC;AAEtC;;;;;GAKG;AACH,MAAM,gBAAgB,GAAG;IACvB,eAAe;IACf,gBAAgB;IAChB,SAAS;IACT,sBAAsB;IACtB,kCAAkC;IAClC,YAAY;IACZ,uBAAuB;IACvB,kBAAkB;IAClB,mBAAmB;IACnB,mBAAmB;IACnB,gBAAgB;IAChB,qBAAqB;CACb,CAAC;AAEX;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CAAC,GAAsB;IAC1D,MAAM,KAAK,GAAsB,EAAE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IAAI,IAAI,EAAE,CAAC;YACtD,MAAM,GAAG,GAAG,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;YACpC,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;gBACtB,MAAM,IAAI,UAAU,CAAC,kDAAkD,QAAQ,iBAAiB,CAAC,CAAC;YACpG,CAAC;YACD,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC;QAC/C,CAAC;QACD,SAAS,CAAC,GAAG,CAAC,GAAG,EAAE,UAAU,CAAC,MAAM,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC;IACxD,CAAC;IACD,MAAM,MAAM,GAAG,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC;IACvC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;QAC/B,MAAM,IAAI,UAAU,CAAC,uEAAuE,CAAC,CAAC;IAChG,CAAC;IACD,MAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,UAAU,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;IAC/D,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,MAAM,EAAE,CAAC;QACvD,MAAM,IAAI,UAAU,CAAC,qEAAqE,CAAC,CAAC;IAC9F,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
package/dist/cli.d.ts CHANGED
@@ -1,15 +1,21 @@
1
1
  import type { Io } from './io.js';
2
+ import { type ControllerRuntime } from './commands/controller.js';
3
+ /** Optional runtime seams used by the controller lifecycle tests. */
4
+ export interface MainDependencies {
5
+ controller?: ControllerRuntime;
6
+ }
2
7
  /** The top-level usage text (also printed for `--help`). */
3
- export declare const USAGE = "usage: gateforge <command> [options]\n\ncommands:\n init [--languages <comma,list>] [--blocking] create .gateforge.yml + skeleton; --blocking installs AND verifies an\n [--strict-e2e] active pre-commit hook (staged gate) + CI wiring (idempotent)\n enforce wire the blocking pre-commit + CI gate into an initialized repo (idempotent)\n adopt adopt enforcement: seed the baseline from current debt (the one bulk-add) + wire the gate\n discover [--json] run detectors and dump the resource graph\n classify [--json] [--write-snapshot P] inspect effective classifications + typed blocks\n explain <resourceId> [--json] full signal/rule/obligation trace for one resource\n tests discover [--json] [--pytest] inventory existing tests into the run-state catalog\n tests suggest [--changed] [--json] suggest existing tests for uncovered obligations (inspection, never a gate)\n tests mark --test K --kind K [--category C]...\n --obligation ID... --reason \"T\" declare an existing test in .gateforge/test-map.yml (atomic, idempotent)\n tests explain --test K [--json] requirements/mapping/next action for one existing test\n tests diagnose [--suite N] [--json] run the configured pytest diagnostic suites (advisory; exit 0/1/2)\n obligations [--json] evaluate policies and dump obligations\n check [--changed] [--staged] run the full gate and report (F: text|json|sarif). --staged gates the\n [--require-e2e] [--format F] EXACT staged candidate (frozen index checkout, never the worktree);\n --require-e2e blocks without a valid, non-stale gate receipt\n test-gates [--changed] [--suite CMD] supervised E2E run over the obligations (--changed) or the\n [--out DIR] [--format F] legacy suite escape hatch; seals a gate receipt on complete success\n [--witness-url URL]\n broker commit --workspace DIR managed-mode commit broker (MECHANISM, not deployment): verifies a gate\n --message MSG [--receipt P] receipt for the exact workspace bytes, then commits via compare-and-swap\n [--ref REF] ref update. Guaranteed only when the broker runs outside the agent's\n write/process boundary (ADR 0005 D1)\n enforcement doctor [--json] honest enforcement diagnostics: hook activation, runner/observer readiness,\n trusted binary/policy ownership, snapshot mode, standard/managed boundary\n baseline update <fp...> shrink the baseline to a strict subset (invariant 4)\n waive <resourceId:contract> write an expiring, owner-approved waiver for one obligation\n --owner N --approver N (GF-15: all fields mandatory; justification URL required;\n --justification-url U --expires D no --force \u2014 renewal is a hand-edit of the written file)\n --version print the version\n --help show this help\n\nexit codes: 0 clean/waived, 1 unresolved obligations, 2 config/usage error";
8
+ export declare const USAGE = "usage: gateforge <command> [options]\n\ncommands:\n init [--languages <comma,list>] [--plugins <comma,list>] [--accept-recommended] [--no-scan]\n [--proof overlay|observe] [--blocking] [--strict-e2e] [--managed]\n scan the repo, print the recommended install, and write\n .gateforge.yml + skeleton + GATEFORGE.md + overlay README\n (idempotent; --blocking installs AND verifies an active\n pre-commit hook + CI wiring; --managed bootstraps and\n verifies rootless Podman before writing managed config)\n enforce wire the blocking pre-commit + CI gate into an initialized repo (idempotent)\n adopt adopt enforcement: seed the baseline from current debt (the one bulk-add) + wire the gate\n discover [--json] run detectors and dump the resource graph\n classify [--json] [--write-snapshot P] inspect effective classifications + typed blocks\n explain <resourceId> [--json] full signal/rule/obligation trace for one resource\n tests discover [--json] [--pytest] inventory existing tests into the run-state catalog\n tests suggest [--changed] [--json] suggest existing tests for uncovered obligations (inspection, never a gate)\n tests mark --test K --kind K [--category C]...\n --obligation ID... --reason \"T\" declare an existing test in .gateforge/test-map.yml (atomic, idempotent)\n tests explain --test K [--json] requirements/mapping/next action for one existing test\n tests diagnose [--suite N] [--json] run the configured pytest diagnostic suites (advisory; exit 0/1/2)\n obligations [--json] evaluate policies and dump obligations\n check [--changed] [--staged] run the full gate and report (F: text|json|sarif). --staged gates the\n [--require-e2e] [--format F] EXACT staged candidate (frozen index checkout, never the worktree);\n --require-e2e blocks without a valid, non-stale gate receipt\n next [--changed] [--json] print the ONE blocking next action (navigation, not the gate)\n test-gates [--changed] [--suite CMD] supervised E2E run over the obligations (--changed) or the\n [--out DIR] [--format F] legacy suite escape hatch; seals a gate receipt on complete success\n [--witness-url URL]\n broker commit --workspace DIR managed-mode commit broker (MECHANISM, not deployment): verifies a gate\n --message MSG [--receipt P] receipt for the exact workspace bytes, then commits via compare-and-swap\n [--ref REF] ref update. Guaranteed only when the broker runs outside the agent's\n write/process boundary (ADR 0005 D1)\n enforcement doctor [--json] honest enforcement diagnostics: hook activation, runner/observer readiness,\n trusted binary/policy ownership, snapshot mode, standard/managed boundary\n baseline update <fp...> shrink the baseline to a strict subset (invariant 4)\n controller run the managed controller lifecycle\n waive <resourceId:contract> write an expiring, owner-approved waiver for one obligation\n --owner N --approver N (GF-15: all fields mandatory; justification URL required;\n --justification-url U --expires D no --force \u2014 renewal is a hand-edit of the written file)\n --version print the version\n --help show this help\n\nexit codes: 0 clean/waived, 1 unresolved obligations, 2 config/usage error";
4
9
  /**
5
10
  * Runs the gateforge CLI.
6
11
  *
7
12
  * Args:
8
13
  * argv: arguments after `gateforge` (node/script already stripped).
9
14
  * io: process context (defaults to the live process).
15
+ * dependencies: optional lifecycle seams for controller tests.
10
16
  *
11
17
  * Returns:
12
18
  * Promise<number>: the process exit code.
13
19
  */
14
- export declare function main(argv: readonly string[], io?: Io): Promise<number>;
20
+ export declare function main(argv: readonly string[], io?: Io, dependencies?: MainDependencies): Promise<number>;
15
21
  //# sourceMappingURL=cli.d.ts.map
package/dist/cli.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAkBlC,4DAA4D;AAC5D,eAAO,MAAM,KAAK,wtGAqCyD,CAAC;AAE5E;;;;;;;;;GASG;AACH,wBAAsB,IAAI,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,EAAE,GAAE,EAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,CAsDzF"}
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAiBlC,OAAO,EAAqB,KAAK,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAGrF,qEAAqE;AACrE,MAAM,WAAW,gBAAgB;IAC/B,UAAU,CAAC,EAAE,iBAAiB,CAAC;CAChC;AAED,4DAA4D;AAC5D,eAAO,MAAM,KAAK,+zHA4CyD,CAAC;AAE5E;;;;;;;;;;GAUG;AACH,wBAAsB,IAAI,CACxB,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,EAAE,GAAE,EAAgB,EACpB,YAAY,GAAE,gBAAqB,GAClC,OAAO,CAAC,MAAM,CAAC,CA0DjB"}
package/dist/cli.js CHANGED
@@ -17,6 +17,7 @@ import { adoptCommand } from './commands/adopt.js';
17
17
  import { discoverCommand } from './commands/discover.js';
18
18
  import { obligationsCommand } from './commands/obligations.js';
19
19
  import { checkCommand } from './commands/check.js';
20
+ import { nextCommand } from './commands/next.js';
20
21
  import { testGatesCommand } from './commands/test-gates.js';
21
22
  import { baselineCommand } from './commands/baseline.js';
22
23
  import { waiveCommand } from './commands/waive.js';
@@ -24,14 +25,20 @@ import { classifyCommand } from './commands/classify.js';
24
25
  import { explainCommand } from './commands/explain.js';
25
26
  import { testsCommand } from './commands/tests.js';
26
27
  import { enforcementCommand } from './commands/enforcement.js';
28
+ import { controllerCommand } from './commands/controller.js';
27
29
  import { brokerCommand } from './broker.js';
28
30
  /** The top-level usage text (also printed for `--help`). */
29
31
  export const USAGE = `\
30
32
  usage: gateforge <command> [options]
31
33
 
32
34
  commands:
33
- init [--languages <comma,list>] [--blocking] create .gateforge.yml + skeleton; --blocking installs AND verifies an
34
- [--strict-e2e] active pre-commit hook (staged gate) + CI wiring (idempotent)
35
+ init [--languages <comma,list>] [--plugins <comma,list>] [--accept-recommended] [--no-scan]
36
+ [--proof overlay|observe] [--blocking] [--strict-e2e] [--managed]
37
+ scan the repo, print the recommended install, and write
38
+ .gateforge.yml + skeleton + GATEFORGE.md + overlay README
39
+ (idempotent; --blocking installs AND verifies an active
40
+ pre-commit hook + CI wiring; --managed bootstraps and
41
+ verifies rootless Podman before writing managed config)
35
42
  enforce wire the blocking pre-commit + CI gate into an initialized repo (idempotent)
36
43
  adopt adopt enforcement: seed the baseline from current debt (the one bulk-add) + wire the gate
37
44
  discover [--json] run detectors and dump the resource graph
@@ -47,6 +54,7 @@ commands:
47
54
  check [--changed] [--staged] run the full gate and report (F: text|json|sarif). --staged gates the
48
55
  [--require-e2e] [--format F] EXACT staged candidate (frozen index checkout, never the worktree);
49
56
  --require-e2e blocks without a valid, non-stale gate receipt
57
+ next [--changed] [--json] print the ONE blocking next action (navigation, not the gate)
50
58
  test-gates [--changed] [--suite CMD] supervised E2E run over the obligations (--changed) or the
51
59
  [--out DIR] [--format F] legacy suite escape hatch; seals a gate receipt on complete success
52
60
  [--witness-url URL]
@@ -57,6 +65,7 @@ commands:
57
65
  enforcement doctor [--json] honest enforcement diagnostics: hook activation, runner/observer readiness,
58
66
  trusted binary/policy ownership, snapshot mode, standard/managed boundary
59
67
  baseline update <fp...> shrink the baseline to a strict subset (invariant 4)
68
+ controller run the managed controller lifecycle
60
69
  waive <resourceId:contract> write an expiring, owner-approved waiver for one obligation
61
70
  --owner N --approver N (GF-15: all fields mandatory; justification URL required;
62
71
  --justification-url U --expires D no --force — renewal is a hand-edit of the written file)
@@ -70,11 +79,12 @@ exit codes: 0 clean/waived, 1 unresolved obligations, 2 config/usage error`;
70
79
  * Args:
71
80
  * argv: arguments after `gateforge` (node/script already stripped).
72
81
  * io: process context (defaults to the live process).
82
+ * dependencies: optional lifecycle seams for controller tests.
73
83
  *
74
84
  * Returns:
75
85
  * Promise<number>: the process exit code.
76
86
  */
77
- export async function main(argv, io = processIo()) {
87
+ export async function main(argv, io = processIo(), dependencies = {}) {
78
88
  const first = argv[0];
79
89
  if (first === undefined || first === '--help' || first === '-h' || first === 'help') {
80
90
  writeLine(io.stdout, USAGE);
@@ -110,12 +120,16 @@ export async function main(argv, io = processIo()) {
110
120
  return runWithExitCodes(io, () => obligationsCommand(io, rest));
111
121
  case 'check':
112
122
  return runWithExitCodes(io, () => checkCommand(io, rest));
123
+ case 'next':
124
+ return runWithExitCodes(io, () => nextCommand(io, rest));
113
125
  case 'test-gates':
114
126
  return runWithExitCodes(io, () => testGatesCommand(io, rest));
115
127
  case 'enforcement':
116
128
  return runWithExitCodes(io, () => enforcementCommand(io, rest));
117
129
  case 'broker':
118
130
  return runWithExitCodes(io, () => brokerCommand(io, rest));
131
+ case 'controller':
132
+ return runWithExitCodes(io, () => controllerCommand(io, rest, dependencies.controller));
119
133
  case 'baseline':
120
134
  return runWithExitCodes(io, () => Promise.resolve(baselineCommand(io, rest)));
121
135
  case 'waive':
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE3D,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA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,CAAC,CAAC;QAChF,KAAK,OAAO;YACV,OAAO,gBAAgB,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC;QAC5D;YACE,OAAO,gBAAgB,CAAC,EAAE,EAAE,KAAK,IAAI,EAAE;gBACrC,sEAAsE;gBACtE,SAAS,CAAC,IAAI,CAAC,CAAC;gBAChB,MAAM,IAAI,UAAU,CAAC,oBAAoB,OAAO,GAAG,CAAC,CAAC;YACvD,CAAC,CAAC,CAAC;IACP,CAAC;AACH,CAAC"}
@@ -91,8 +91,8 @@ export async function adoptCommand(io, argv) {
91
91
  ? ` + ${adoptedClassifications} classification-blocked resource(s) in the receipt`
92
92
  : ' (receipt predates the classification layer: not adopted for it)') +
93
93
  '; a second bulk-add is refused (GF-07/08). Shrink as debt resolves: `gateforge baseline update`. ' +
94
- 'New (never-adopted) work is never baselined — prove it with witnessed test evidence ' +
95
- '(docs/guides/new-table-playbook.md) or waive it (`gateforge waive`).');
94
+ 'New (never-adopted) work is never baselined — prove it with an overlay test in ' +
95
+ 'tests/e2e/gateforge/ or waive it (`gateforge waive`).');
96
96
  return 0;
97
97
  }
98
98
  // Step 1: the compile + static gate, all-files — adoption captures
@@ -1 +1 @@
1
- {"version":3,"file":"adopt.js","sourceRoot":"","sources":["../../src/commands/adopt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EACL,wBAAwB,EACxB,aAAa,EACb,0BAA0B,EAC1B,wBAAwB,EACxB,iBAAiB,EACjB,6BAA6B,EAC7B,kBAAkB,EAClB,YAAY,EACZ,mBAAmB,EACnB,aAAa,GACd,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAAE,SAAS,EAAE,MA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AAoB,CAAC,EAAE,EAAE,wBAAwB,EAAE,CAAC,CAAC;IAErD,sEAAsE;IACtE,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,wBAAwB,IAAI,CAAC,IAAI,qBAAqB,MAAM,EAAE,CAAC,CAAC;IACrF,IAAI,IAAI,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC;QAClB,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,yBAAyB,CAAC,CAAC;QAChD,KAAK,MAAM,IAAI,IAAI,SAAS,CAAC,IAAI,CAAC;YAAE,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACjE,CAAC;IACD,SAAS,CACP,EAAE,CAAC,MAAM,EACT,iCAAiC,qBAAqB,CAAC,IAAI,+CAA+C;QACxG,oGAAoG;QACpG,kEAAkE,CACrE,CAAC;IACF,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,oBAAoB,UAAU,KAAK,QAAQ,CAAC,GAAG,GAAG,CAAC,CAAC;IACzE,SAAS,CACP,EAAE,CAAC,MAAM,EACT,gHAAgH;QAC9G,2CAA2C,CAC9C,CAAC;IACF,OAAO,CAAC,CAAC;AACX,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../src/commands/check.ts"],"names":[],"mappings":"AAiCA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AA4CnC,eAAO,MAAM,WAAW,QAK2F,CAAC;AA4BpH;;;;;;;;;;;GAWG;AACH,wBAAsB,YAAY,CAAC,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAsBnF"}
1
+ {"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../src/commands/check.ts"],"names":[],"mappings":"AAmCA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AA6CnC,eAAO,MAAM,WAAW,QAK2F,CAAC;AA4BpH;;;;;;;;;;;GAWG;AACH,wBAAsB,YAAY,CAAC,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAsBnF"}
@@ -18,7 +18,7 @@
18
18
  * `test-gates` suite contract writes.
19
19
  */
20
20
  import { cpSync, existsSync, mkdirSync } from 'node:fs';
21
- import { CAUSE_NEXT_ACTIONS, renderRun, runExitCode, } from '@gate-forge/core';
21
+ import { CAUSE_NEXT_ACTIONS, engineBundleDigestOf, executionBoundaryDigestOf, renderRun, runExitCode, } from '@gate-forge/core';
22
22
  import { discoverTestCatalog, findPlaywrightConfig } from '@gate-forge/pack-playwright';
23
23
  import { parseArgs, stringFlag } from '../args.js';
24
24
  import { resolveAdoptedBaseline } from '../adopted-baseline.js';
@@ -35,6 +35,7 @@ import { computeEvaluationScope, detectStagedWorkingTreeMismatches, } from '../s
35
35
  import { freezeStagedCandidate, materializeStagedCandidate, recheckStagedCandidate, releaseStagedCandidate, StagedCandidateBlockError, } from '../staged-candidate.js';
36
36
  import { httpRoutesView, resolveStateDir } from '../state.js';
37
37
  import { assertReceiptApprovedPolicy, evaluateApprovedPolicy, resolveApprovedPolicyDigest, } from '../trusted-policy.js';
38
+ import { isolationProfileForEnvironment } from '../isolation.js';
38
39
  import { loadConfigAt, parseRunFormat, rejectUnknownFlags, VERIFIER_KEY_ENV, VERSION } from './common.js';
39
40
  import { renderEndpointInventory } from '../endpoint-report.js';
40
41
  export const CHECK_USAGE = 'usage: gateforge check [--changed] [--staged] [--require-e2e] [--format text|json|sarif]\n' +
@@ -333,7 +334,7 @@ async function runCheckGate(io, options) {
333
334
  }
334
335
  }
335
336
  const knownSourceFiles = [
336
- ...new Set(pipeline.graph.resources.flatMap((resource) => resource.id === null ? [] : sourcesByResourceId(pipeline.graph).get(resource.id) ?? [])),
337
+ ...new Set(pipeline.graph.resources.flatMap((resource) => resource.id === null ? [] : sourcesByResourceId(pipeline.graph, pipeline.behaviorCatalog).get(resource.id) ?? [])),
337
338
  ];
338
339
  scopeDecision = computeEvaluationScope({
339
340
  config,
@@ -411,6 +412,7 @@ async function runCheckGate(io, options) {
411
412
  config,
412
413
  stateDir,
413
414
  obligations: pipeline.policy.obligations,
415
+ behaviorCatalog: pipeline.behaviorCatalog,
414
416
  });
415
417
  mappingClaims = gradingClaimsFor(mapped.resolution, mapped.nativeClaims);
416
418
  mappingBlockers = mappingBlocking(mapped.resolution.problems);
@@ -420,6 +422,10 @@ async function runCheckGate(io, options) {
420
422
  cwd: io.cwd,
421
423
  config,
422
424
  graph: pipeline.graph,
425
+ behaviorCatalog: pipeline.behaviorCatalog,
426
+ behaviorAuthorityProfileDigest: pipeline.behaviorCatalog === null
427
+ ? null
428
+ : engineBundleDigestOf(VERSION, trustedPolicyDigestForConfig(io.cwd, config)),
423
429
  obligations: pipeline.policy.obligations,
424
430
  blocking: [...pipeline.policy.blocking, ...mismatchBlocking, ...mappingBlockers],
425
431
  stateDir,
@@ -470,7 +476,7 @@ async function runCheckGate(io, options) {
470
476
  // pin-#2 fingerprint, the exact identity a changed-scope receipt seals.
471
477
  const coverageChangedFiles = diffScoped && scopeDecision.mode === 'changed' ? scopeDecision.changedFiles : null;
472
478
  const requiredCoverage = () => {
473
- const sources = sourcesByResourceId(pipeline.graph);
479
+ const sources = sourcesByResourceId(pipeline.graph, pipeline.behaviorCatalog);
474
480
  return pipeline.policy.obligations
475
481
  .filter((obligation) => {
476
482
  if (coverageChangedFiles === null)
@@ -529,6 +535,7 @@ async function runCheckGate(io, options) {
529
535
  // staleness contract (E13).
530
536
  selectionDigest: undefined,
531
537
  catalogDigest: undefined,
538
+ executionBoundaryDigest: executionBoundaryDigestOf(isolationProfileForEnvironment(io.env)),
532
539
  });
533
540
  if (load.status === 'ok') {
534
541
  // A provisioned pin binds the receipt too: a receipt sealed