@smoothbricks/nx-plugin 0.4.27 → 0.4.29

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 (124) hide show
  1. package/README.md +203 -83
  2. package/dist/bounded-test-policy.d.ts +10 -3
  3. package/dist/bounded-test-policy.d.ts.map +1 -1
  4. package/dist/bounded-test-policy.js +19 -25
  5. package/dist/cargo-closure-input.d.ts +12 -0
  6. package/dist/cargo-closure-input.d.ts.map +1 -1
  7. package/dist/cargo-closure-input.js +29 -7
  8. package/dist/cargo-source-hash.d.ts.map +1 -1
  9. package/dist/cargo-source-hash.js +42 -19
  10. package/dist/ensure-built-receipt.d.ts +34 -6
  11. package/dist/ensure-built-receipt.d.ts.map +1 -1
  12. package/dist/ensure-built-receipt.js +265 -159
  13. package/dist/ensure-built-witness.d.ts +27 -2
  14. package/dist/ensure-built-witness.d.ts.map +1 -1
  15. package/dist/ensure-built-witness.js +2176 -15
  16. package/dist/ensure-built.d.ts +99 -1
  17. package/dist/ensure-built.d.ts.map +1 -1
  18. package/dist/ensure-built.js +34 -53
  19. package/dist/executors/bounded-exec/cpu-pool.d.ts +16 -5
  20. package/dist/executors/bounded-exec/cpu-pool.d.ts.map +1 -1
  21. package/dist/executors/bounded-exec/cpu-pool.js +43 -19
  22. package/dist/executors/bounded-exec/executor.d.ts +11 -2
  23. package/dist/executors/bounded-exec/executor.d.ts.map +1 -1
  24. package/dist/executors/bounded-exec/executor.js +139 -39
  25. package/dist/executors/bounded-exec/ram-temp.d.ts +17 -11
  26. package/dist/executors/bounded-exec/ram-temp.d.ts.map +1 -1
  27. package/dist/executors/bounded-exec/ram-temp.js +27 -13
  28. package/dist/generators/bun-test-tracing/generator.js +2 -2
  29. package/dist/graph-input-contract.d.ts +98 -0
  30. package/dist/graph-input-contract.d.ts.map +1 -0
  31. package/dist/graph-input-contract.js +624 -0
  32. package/dist/index.d.ts +12 -5
  33. package/dist/index.d.ts.map +1 -1
  34. package/dist/index.js +17 -3
  35. package/dist/managed-files/ci-workflow.d.ts.map +1 -1
  36. package/dist/managed-files/ci-workflow.js +5 -2
  37. package/dist/managed-files/publish-workflow.d.ts +11 -1
  38. package/dist/managed-files/publish-workflow.d.ts.map +1 -1
  39. package/dist/producer-receipts.d.ts +19 -0
  40. package/dist/producer-receipts.d.ts.map +1 -0
  41. package/dist/producer-receipts.js +921 -0
  42. package/dist/testing.d.ts +8 -0
  43. package/dist/testing.d.ts.map +1 -1
  44. package/dist/testing.js +58 -0
  45. package/managed/raw/patches/nx@23.2.1.patch +328 -50
  46. package/managed/raw/tooling/direnv/developer-links.ts +147 -21
  47. package/managed/raw/tooling/direnv/devenv.smoo.nix +7 -7
  48. package/managed/raw/tooling/direnv/github-actions-bootstrap.sh +14 -5
  49. package/managed/raw/tooling/direnv/linked-snapshots.ts +206 -40
  50. package/managed/raw/tooling/direnv/repo-path +15 -2
  51. package/managed/raw/tooling/direnv/setup-environment.ts +363 -125
  52. package/managed/templates/github/actions/cache-node-modules/action.yml +9 -0
  53. package/managed/templates/github/actions/setup-devenv/action.yml +63 -7
  54. package/nextest.toml +1 -1
  55. package/package.json +11 -6
  56. package/src/__tests__/fixture-nx-env.ts +7 -0
  57. package/src/__tests__/owned-installation.ts +174 -0
  58. package/src/bin/smoo-nx-bound-failures.test.ts +1 -1
  59. package/src/bounded-test-policy.test.ts +36 -22
  60. package/src/bounded-test-policy.ts +19 -27
  61. package/src/bun-bootstrap.test.ts +1 -1
  62. package/src/cargo-closure-input.test.ts +60 -11
  63. package/src/cargo-closure-input.ts +28 -6
  64. package/src/cargo-resolve-cache.test.ts +140 -25
  65. package/src/cargo-source-hash.test.ts +78 -3
  66. package/src/cargo-source-hash.ts +48 -30
  67. package/src/cross-check-policy.test.ts +2 -2
  68. package/src/ensure-built-receipt.test.ts +111 -16
  69. package/src/ensure-built-receipt.ts +251 -149
  70. package/src/ensure-built-witness.test.ts +197 -13
  71. package/src/ensure-built-witness.ts +187 -15
  72. package/src/ensure-built.test.ts +156 -102
  73. package/src/ensure-built.ts +114 -64
  74. package/src/executors/bounded-exec/cpu-pool.test.ts +116 -32
  75. package/src/executors/bounded-exec/cpu-pool.ts +55 -17
  76. package/src/executors/bounded-exec/cpu-tokens.test.ts +2 -2
  77. package/src/executors/bounded-exec/executor-host.test.ts +51 -41
  78. package/src/executors/bounded-exec/executor.test.ts +155 -35
  79. package/src/executors/bounded-exec/executor.ts +156 -45
  80. package/src/executors/bounded-exec/progress.test.ts +1 -1
  81. package/src/executors/bounded-exec/ram-temp-host.test.ts +46 -17
  82. package/src/executors/bounded-exec/ram-temp.test.ts +65 -3
  83. package/src/executors/bounded-exec/ram-temp.ts +32 -16
  84. package/src/executors/bounded-exec/verdict.test.ts +17 -12
  85. package/src/generators/bounded-test-targets/generator.test.ts +1 -3
  86. package/src/generators/bun-test-tracing/generator.test.ts +2 -2
  87. package/src/generators/bun-test-tracing/generator.ts +2 -2
  88. package/src/graph-input-contract.test.ts +371 -0
  89. package/src/graph-input-contract.ts +605 -0
  90. package/src/index.test.ts +3 -3
  91. package/src/index.ts +24 -3
  92. package/src/linked-snapshots.nx.test.ts +112 -30
  93. package/src/managed-files/ci-workflow.ts +5 -2
  94. package/src/managed-files/publish-workflow.ts +12 -1
  95. package/src/managed-files/repo-path.test.ts +44 -1
  96. package/src/managed-files/setup-devenv-free-disk.test.ts +95 -0
  97. package/src/nextest-code-bound.test.ts +23 -17
  98. package/src/nextest-partitions.test.ts +7 -1
  99. package/src/nx-cache-restore-mtime.test.ts +2 -2
  100. package/src/nx-daemon-claim.test.ts +5 -5
  101. package/src/nx-daemon-idle-cpu.test.ts +0 -1
  102. package/src/nx-daemon-idle-policy.test.ts +56 -0
  103. package/src/nx-daemon-ignore-files.test.ts +2 -2
  104. package/src/nx-daemon-validity.test.ts +31 -9
  105. package/src/nx-dot-input-policy.test.ts +5 -5
  106. package/src/nx-files-archive-racy.test.ts +1 -1
  107. package/src/nx-incomplete-run-summary.test.ts +1 -1
  108. package/src/nx-plugin-load-errors.test.ts +2 -2
  109. package/src/nx-project-graph-errors.test.ts +70 -0
  110. package/src/nx-skipped-task-exit.test.ts +2 -2
  111. package/src/nx-store-resolution.test.ts +7 -25
  112. package/src/nx-task-output-lease.test.ts +3 -3
  113. package/src/nx-use-local.test.ts +7 -5
  114. package/src/producer-receipts.test.ts +164 -0
  115. package/src/producer-receipts.ts +631 -0
  116. package/src/runtime-input.test.ts +1 -1
  117. package/src/serial-group-wiring.test.ts +4 -4
  118. package/src/task-results.test.ts +18 -16
  119. package/src/test-timings.test.ts +2 -2
  120. package/src/testing.test.ts +5 -5
  121. package/src/testing.ts +59 -0
  122. package/src/typecheck-test-policy.test.ts +1 -1
  123. package/src/typescript-resolution.test.ts +76 -0
  124. package/test-timings.json +5 -0
@@ -0,0 +1,921 @@
1
+ import { createHash, randomUUID } from 'node:crypto';
2
+ import { existsSync, lstatSync, mkdirSync, readdirSync, readFileSync, realpathSync, renameSync, rmSync, writeFileSync, } from 'node:fs';
3
+ import { createRequire } from 'node:module';
4
+ import { delimiter, dirname, join, resolve } from 'node:path';
5
+ import typia from 'typia';
6
+ import { createWorkspaceNxRequire, parseTargetSelector, providerInputProof, selectorTaskId, } from './ensure-built.js';
7
+ import { captureProducerSource, producerOutputPaths, providerReceipt, receiptNode, } from './ensure-built-receipt.js';
8
+ import { graphInstallationIdentity, movedNodes, nodesUnchanged, workspaceSnapshot, } from './ensure-built-witness.js';
9
+ import { graphInputContractIdentity } from './graph-input-contract.js';
10
+ const runs = new Map();
11
+ function sha(value) {
12
+ return createHash('sha256').update(JSON.stringify(value)).digest('hex');
13
+ }
14
+ function configured(options) {
15
+ return options?.producerReceipts?.targets ?? [];
16
+ }
17
+ /**
18
+ * Where a record of `disposition` lives. A refusal has its own file beside the receipt, so a run that could not prove
19
+ * its products never replaces the receipt an earlier run published: readers validate that receipt on its own evidence.
20
+ */
21
+ function recordPath(root, target, disposition) {
22
+ const load = createWorkspaceNxRequire(root);
23
+ return join(load('nx/src/utils/cache-directory').workspaceDataDirectoryForWorkspace(root), `producer-${disposition === 'published' ? 'receipt' : 'refusal'}-${sha(target)}.json`);
24
+ }
25
+ function publish(root, target, record) {
26
+ try {
27
+ const path = recordPath(root, target, record.disposition);
28
+ mkdirSync(dirname(path), { recursive: true });
29
+ const temporary = `${path}.${randomUUID()}`;
30
+ try {
31
+ writeFileSync(temporary, JSON.stringify(record), { flag: 'wx', mode: 0o600 });
32
+ renameSync(temporary, path);
33
+ }
34
+ finally {
35
+ rmSync(temporary, { force: true });
36
+ }
37
+ // A receipt answers the refusal of any run before it.
38
+ if (record.disposition === 'published')
39
+ rmSync(recordPath(root, target, 'refused'), { force: true });
40
+ return { ok: true, value: true };
41
+ }
42
+ catch (error) {
43
+ if (error instanceof Error)
44
+ return { ok: false, detail: `Cannot publish producer ${record.disposition} record: ${error.message}` };
45
+ throw error;
46
+ }
47
+ }
48
+ function same(left, right) {
49
+ return JSON.stringify(left) === JSON.stringify(right);
50
+ }
51
+ /**
52
+ * Whether a tool node whose ctime alone moved still reads as `tools` recorded it: the same bytes, link text,
53
+ * membership and mode. Bun's global store is shared by every checkout, and linking a package's bin on any of their
54
+ * installs re-chmods the store file to the mode it already has; that moves the ctime of a node these tools witness
55
+ * without changing it, and is no reason to refuse the run.
56
+ */
57
+ function recordedTool(tools) {
58
+ const recorded = new Map(tools.flatMap((tool) => tool.nodes.map((node) => [node.path, node])));
59
+ return (path) => {
60
+ const node = recorded.get(path);
61
+ return node !== undefined && same(receiptNode(path, path, []), node);
62
+ };
63
+ }
64
+ function missing(paths) {
65
+ return paths.every((path) => {
66
+ try {
67
+ lstatSync(path);
68
+ return false;
69
+ }
70
+ catch (error) {
71
+ if (error instanceof Error && 'code' in error && ['ENOENT', 'ENOTDIR'].includes(String(error.code)))
72
+ return true;
73
+ throw error;
74
+ }
75
+ });
76
+ }
77
+ function defaultOverrides(task) {
78
+ return Object.entries(task.overrides).every(([name, value]) => name === '__overrides_unparsed__' && Array.isArray(value) && value.length === 0);
79
+ }
80
+ function targetGraph(root, target, projectGraph) {
81
+ const selector = parseTargetSelector(target);
82
+ if (selector === null)
83
+ throw new Error(`Invalid declared producer target ${target}`);
84
+ return createWorkspaceNxRequire(root)('nx/src/tasks-runner/create-task-graph').createTaskGraph(projectGraph, {}, [selector.project], [selector.target], selector.configuration, {}, false);
85
+ }
86
+ /** Tool resolution is captured in producer scope; readers inspect its recorded filesystem, not their own environment. */
87
+ function toolsFor(root, nxJson, projectGraph, bases) {
88
+ try {
89
+ const load = createWorkspaceNxRequire(root);
90
+ const data = load('nx/src/utils/cache-directory').workspaceDataDirectoryForWorkspace(root);
91
+ const snapshot = workspaceSnapshot(root, new (load('nx/src/native').WorkspaceContext)(root, data), undefined);
92
+ const local = graphInputContractIdentity(root, nxJson, snapshot);
93
+ // A task's npm external inputs (AllExternalDependencies, and the `npm:` nodes of its project's dependency closure)
94
+ // are Nx's lockfile identities, bound by the receipt's hashDetails and the committed tree's bun.lock. They add no
95
+ // installed closure: resolved from the task's project, a transitive or uninstalled-optional node is unresolvable
96
+ // under Bun's isolated linker, and the installed closure of every lockfile package measured 46 MB of evidence and
97
+ // 10 s of census. The tools that compute the graph and hashes are still bound below.
98
+ let needsCargo = false;
99
+ for (const basis of bases) {
100
+ const proof = providerInputProof(root, nxJson, projectGraph, basis.graph, load);
101
+ if (proof.runtimeSource.kind === 'opaque')
102
+ return { ok: false, detail: proof.runtimeSource.detail };
103
+ needsCargo ||= Object.values(proof.inputs).some((input) => input.runtime.length > 0);
104
+ }
105
+ let installationMiss = 'unproved installed module/resolution closure';
106
+ const identity = graphInstallationIdentity(root, nxJson, load('nx/src/utils/package-json').readModulePackageJson, load('nx/src/native').expandOutputs, local ?? { plugins: [], packages: [], identity: '[]' }, (detail) => {
107
+ installationMiss = detail;
108
+ });
109
+ if (identity === null)
110
+ return { ok: false, detail: `Producer installed module/resolution closure is unproved: ${installationMiss}` };
111
+ const installation = (() => {
112
+ const _io0 = input => Array.isArray(input.nodes) && input.nodes.every(elem => "object" === typeof elem && null !== elem && _io1(elem)) && (Array.isArray(input.resolutions) && input.resolutions.every(elem => Array.isArray(elem) && (elem.length === 3 && "string" === typeof elem[0] && "string" === typeof elem[1] && (null === elem[2] || "string" === typeof elem[2])))) && (null === input.localInputs || "string" === typeof input.localInputs);
113
+ const _io1 = input => "string" === typeof input.path && "string" === typeof input.stamp;
114
+ const __is = input => "object" === typeof input && null !== input && _io0(input);
115
+ return input => { input = JSON.parse(input); return __is(input) ? input : null; };
116
+ })()(identity);
117
+ if (installation === null)
118
+ return { ok: false, detail: 'Invalid installed module closure evidence' };
119
+ const observed = [];
120
+ const paths = new Set(installation.nodes.map(({ path }) => path));
121
+ const absent = new Set();
122
+ function namespace(path) {
123
+ let stats;
124
+ try {
125
+ stats = lstatSync(path);
126
+ }
127
+ catch (error) {
128
+ if (error instanceof Error && 'code' in error && ['ENOENT', 'ENOTDIR'].includes(String(error.code))) {
129
+ absent.add(path);
130
+ return;
131
+ }
132
+ throw error;
133
+ }
134
+ paths.add(path);
135
+ if (stats.isSymbolicLink())
136
+ paths.add(realpathSync(path));
137
+ if (stats.isDirectory())
138
+ for (const name of readdirSync(path))
139
+ paths.add(join(path, name));
140
+ }
141
+ const resolutions = [];
142
+ for (const [from, name, target] of installation.resolutions) {
143
+ resolutions.push({ from, name, target });
144
+ for (const directory of createRequire(join(from, 'package.json')).resolve.paths(name) ?? []) {
145
+ namespace(directory);
146
+ const candidate = join(directory, name);
147
+ if (existsSync(candidate))
148
+ namespace(candidate);
149
+ else
150
+ absent.add(candidate);
151
+ }
152
+ }
153
+ const nodes = [...paths].sort().map((path) => receiptNode(path, path, observed));
154
+ const module = {
155
+ kind: 'module',
156
+ name: 'installed-nx-plugin-closure',
157
+ from: root,
158
+ path: root,
159
+ physicalPath: realpathSync(root),
160
+ nodes,
161
+ missing: [...absent].sort(),
162
+ resolutions,
163
+ sha256: sha(nodes),
164
+ };
165
+ const tools = [module];
166
+ for (const name of ['nx-runtime', 'bun', 'sh', 'git', ...(needsCargo ? ['rustc', 'cargo'] : [])]) {
167
+ const candidates = name === 'nx-runtime'
168
+ ? [process.execPath]
169
+ : (process.env.PATH ?? '').split(delimiter).map((directory) => resolve(directory || root, name));
170
+ const skipped = [];
171
+ let path;
172
+ for (const candidate of candidates) {
173
+ if ((existsSync(candidate) && lstatSync(candidate).isFile()) ||
174
+ (existsSync(candidate) && lstatSync(candidate).isSymbolicLink())) {
175
+ path = candidate;
176
+ break;
177
+ }
178
+ skipped.push(candidate);
179
+ }
180
+ if (path === undefined)
181
+ return { ok: false, detail: `Unbound producer executable ${name}` };
182
+ const physicalPath = realpathSync(path);
183
+ const entries = [...new Set([path, physicalPath])].map((entry) => receiptNode(entry, entry, observed));
184
+ tools.push({
185
+ kind: 'executable',
186
+ name,
187
+ from: root,
188
+ path,
189
+ physicalPath,
190
+ nodes: entries,
191
+ missing: skipped,
192
+ resolutions: [],
193
+ sha256: sha(entries),
194
+ });
195
+ }
196
+ const capture = movedNodes(observed, recordedTool(tools));
197
+ if (capture !== null)
198
+ return { ok: false, detail: `Producer tool/module namespace moved during capture: ${capture}` };
199
+ if (!missing(module.missing))
200
+ return { ok: false, detail: 'Producer tool/module namespace moved during capture: a missing candidate appeared' };
201
+ return { ok: true, value: { tools, nodes: observed } };
202
+ }
203
+ catch (error) {
204
+ if (error instanceof Error)
205
+ return { ok: false, detail: `Cannot prove producer tool closure: ${error.message}` };
206
+ throw error;
207
+ }
208
+ }
209
+ function verifyTools(tools) {
210
+ try {
211
+ const observed = [];
212
+ for (const tool of tools) {
213
+ if (realpathSync(tool.path) !== tool.physicalPath || !missing(tool.missing))
214
+ return { ok: false, detail: `Producer tool alias/namespace changed: ${tool.name}` };
215
+ const nodes = tool.nodes.map((node) => receiptNode(node.path, node.path, observed));
216
+ if (!same(nodes, tool.nodes) || sha(nodes) !== tool.sha256)
217
+ return { ok: false, detail: `Producer tool/module bytes changed: ${tool.name}` };
218
+ }
219
+ return nodesUnchanged(observed)
220
+ ? { ok: true, value: observed }
221
+ : { ok: false, detail: 'Producer tool nodes changed during readonly validation' };
222
+ }
223
+ catch (error) {
224
+ if (error instanceof Error)
225
+ return { ok: false, detail: `Cannot validate producer tools: ${error.message}` };
226
+ throw error;
227
+ }
228
+ }
229
+ export function completedProducerTasks(graph, results) {
230
+ const tasks = [];
231
+ for (const planned of Object.values(graph.tasks)) {
232
+ const result = results[planned.id];
233
+ if (result === undefined ||
234
+ result.code !== 0 ||
235
+ !['success', 'local-cache', 'local-cache-kept-existing', 'remote-cache'].includes(result.status))
236
+ return { ok: false, detail: `No actual successful completion for ${planned.id}` };
237
+ if (result.task.hash === undefined ||
238
+ result.task.hashDetails === undefined ||
239
+ !defaultOverrides(result.task) ||
240
+ !same(result.task.outputs, planned.outputs) ||
241
+ !same(result.task.target, planned.target))
242
+ return { ok: false, detail: `Unbound actual hash/default target/outputs for ${planned.id}` };
243
+ tasks.push(result.task);
244
+ }
245
+ return { ok: true, value: tasks };
246
+ }
247
+ export function producerEnvironmentIdentity(inputs) {
248
+ return sha(inputs.map(({ taskId, expanded, hashDetails }) => ({
249
+ taskId,
250
+ runtime: expanded.runtime,
251
+ environment: expanded.environment,
252
+ identity: hashDetails,
253
+ })));
254
+ }
255
+ export async function preTasksExecution(options, context) {
256
+ const targets = configured(options);
257
+ if (targets.length === 0)
258
+ return;
259
+ try {
260
+ const load = createWorkspaceNxRequire(context.workspaceRoot);
261
+ const projectGraph = await load('nx/src/project-graph/project-graph').createProjectGraphAsync();
262
+ const bases = new Map();
263
+ for (const target of targets) {
264
+ const graph = targetGraph(context.workspaceRoot, target, projectGraph);
265
+ const outputs = producerOutputPaths(context.workspaceRoot, Object.values(graph.tasks), load('nx/src/native').expandOutputs);
266
+ const source = captureProducerSource(context.workspaceRoot, outputs);
267
+ if (!source.ok) {
268
+ runs.set(context.id, source);
269
+ return;
270
+ }
271
+ bases.set(target, { graph, source: source.value });
272
+ }
273
+ const tools = toolsFor(context.workspaceRoot, context.nxJsonConfiguration, projectGraph, [...bases.values()]);
274
+ runs.set(context.id, tools.ok
275
+ ? {
276
+ ok: true,
277
+ value: {
278
+ projectGraph,
279
+ nxJson: context.nxJsonConfiguration,
280
+ targets: bases,
281
+ tools: tools.value.tools,
282
+ toolNodes: tools.value.nodes,
283
+ },
284
+ }
285
+ : tools);
286
+ }
287
+ catch (error) {
288
+ if (error instanceof Error)
289
+ runs.set(context.id, { ok: false, detail: error.message });
290
+ else
291
+ throw error;
292
+ }
293
+ }
294
+ export async function postTasksExecution(options, context) {
295
+ const frame = runs.get(context.id);
296
+ runs.delete(context.id);
297
+ for (const target of configured(options)) {
298
+ const selected = parseTargetSelector(target);
299
+ if (selected === null)
300
+ continue;
301
+ const targetBasis = frame?.ok === true ? frame.value.targets.get(target) : undefined;
302
+ const plannedRoot = targetBasis === undefined
303
+ ? undefined
304
+ : Object.values(targetBasis.graph.tasks).find((task) => task.target.project === selected.project && task.target.target === selected.target);
305
+ const rootResult = plannedRoot === undefined
306
+ ? Object.values(context.taskResults).find(({ task }) => task.target.project === selected.project &&
307
+ task.target.target === selected.target &&
308
+ (selected.configuration === undefined || task.target.configuration === selected.configuration))
309
+ : context.taskResults[plannedRoot.id];
310
+ if (rootResult === undefined)
311
+ continue;
312
+ const refuse = (detail) => {
313
+ const saved = publish(context.workspaceRoot, target, { version: 1, disposition: 'refused', target, detail });
314
+ if (!saved.ok)
315
+ process.stderr.write(`producerReceipts: ${target}: ${saved.detail}\n`);
316
+ process.stderr.write(`producerReceipts: ${target}: ${detail}\n`);
317
+ };
318
+ if (frame === undefined || !frame.ok) {
319
+ refuse(frame === undefined ? 'No bound producer pre-execution frame' : frame.detail);
320
+ continue;
321
+ }
322
+ const basis = frame.value.targets.get(target);
323
+ if (basis === undefined) {
324
+ refuse('No declared target pre-execution basis');
325
+ continue;
326
+ }
327
+ const completed = completedProducerTasks(basis.graph, context.taskResults);
328
+ if (!completed.ok) {
329
+ refuse(completed.detail);
330
+ continue;
331
+ }
332
+ const tasks = completed.value;
333
+ let detail;
334
+ const execution = movedNodes(frame.value.toolNodes, recordedTool(frame.value.tools));
335
+ if (execution !== null) {
336
+ refuse(`Producer tool/module nodes changed across actual execution: ${execution}`);
337
+ continue;
338
+ }
339
+ const load = createWorkspaceNxRequire(context.workspaceRoot);
340
+ const graph = { ...basis.graph, tasks: Object.fromEntries(tasks.map((task) => [task.id, task])) };
341
+ const proof = providerInputProof(context.workspaceRoot, context.nxJsonConfiguration, frame.value.projectGraph, graph, load);
342
+ if (proof.runtimeSource.kind === 'opaque') {
343
+ refuse(proof.runtimeSource.detail);
344
+ continue;
345
+ }
346
+ const files = new Map(basis.source.files.map((file) => [file.path, file]));
347
+ const inputs = [];
348
+ for (const task of tasks) {
349
+ const expanded = proof.inputs[task.id];
350
+ const hashDetails = task.hashDetails;
351
+ if (expanded === undefined || hashDetails === undefined || expanded.files.some((path) => !files.has(path))) {
352
+ detail = `Actual FILE/hash evidence is unbound for ${task.id}`;
353
+ break;
354
+ }
355
+ const declared = frame.value.projectGraph.nodes[task.target.project]?.data.targets?.[task.target.target]?.inputs ?? [];
356
+ inputs.push({
357
+ taskId: task.id,
358
+ overrides: task.overrides,
359
+ declared,
360
+ expanded,
361
+ hashDetails,
362
+ files: expanded.files.map((path) => {
363
+ const file = files.get(path);
364
+ if (file === undefined)
365
+ throw new Error(`Lost HEAD-bound input ${path}`);
366
+ return file;
367
+ }),
368
+ });
369
+ }
370
+ if (detail !== undefined) {
371
+ refuse(detail);
372
+ continue;
373
+ }
374
+ const producer = {
375
+ version: 1,
376
+ target,
377
+ argv: [...context.argv],
378
+ trackedTreeClean: true,
379
+ environmentIdentity: producerEnvironmentIdentity(inputs),
380
+ inputs,
381
+ tools: frame.value.tools,
382
+ wallTimeMs: context.endTime - context.startTime,
383
+ };
384
+ if (!Number.isFinite(producer.wallTimeMs) || producer.wallTimeMs < 0) {
385
+ refuse('Invalid actual Nx execution timing');
386
+ continue;
387
+ }
388
+ const result = providerReceipt(context.workspaceRoot, selectorTaskId(selected), tasks, proof, load('nx/src/native').expandOutputs, basis.source, producer);
389
+ if (result.disposition !== 'hit') {
390
+ refuse(result.reason.detail);
391
+ continue;
392
+ }
393
+ const census = movedNodes(frame.value.toolNodes, recordedTool(frame.value.tools));
394
+ if (census !== null) {
395
+ refuse(`Producer tools changed during post-execution product census: ${census}`);
396
+ continue;
397
+ }
398
+ const publication = publish(context.workspaceRoot, target, {
399
+ version: 1,
400
+ disposition: 'published',
401
+ receipt: result.receipt,
402
+ projectGraph: frame.value.projectGraph,
403
+ taskGraph: graph,
404
+ nxJson: frame.value.nxJson,
405
+ });
406
+ if (!publication.ok)
407
+ process.stderr.write(`producerReceipts: ${target}: ${publication.detail}\n`);
408
+ }
409
+ }
410
+ /**
411
+ * Readonly consumers accept actual producer completion evidence, never their own environment/cache rows. A receipt
412
+ * that does not validate is a miss whose detail also carries the refusal of the producer's latest run, when it left one.
413
+ */
414
+ export function readProducerReceipt(root, target) {
415
+ const published = validatedReceipt(root, target);
416
+ if (published.ok)
417
+ return published;
418
+ const refusal = latestRefusal(root, target);
419
+ return refusal === null
420
+ ? published
421
+ : { ok: false, detail: `${published.detail}; the producer's latest run refused: ${refusal}` };
422
+ }
423
+ /** The detail of the refusal a producer run left after the last receipt, or null when none did. */
424
+ function latestRefusal(root, target) {
425
+ try {
426
+ const record = (() => {
427
+ const _io0 = input => 1 === input.version && "refused" === input.disposition && "string" === typeof input.target && "string" === typeof input.detail;
428
+ const __is = input => "object" === typeof input && null !== input && _io0(input);
429
+ return input => { input = JSON.parse(input); return __is(input) ? input : null; };
430
+ })()(readFileSync(recordPath(root, target, 'refused'), 'utf8'));
431
+ return record === null || record.version !== 1 ? 'corrupt producer refusal record' : record.detail;
432
+ }
433
+ catch (error) {
434
+ if (error instanceof Error && 'code' in error && error.code === 'ENOENT')
435
+ return null;
436
+ if (error instanceof Error)
437
+ return `unreadable producer refusal record: ${error.message}`;
438
+ throw error;
439
+ }
440
+ }
441
+ function validatedReceipt(root, target) {
442
+ try {
443
+ const record = (() => {
444
+ const _ip0 = (input, _vctx = {}) => 1 === input["version"];
445
+ const _ip1 = (input, _vctx = {}) => "string" === typeof input["target"];
446
+ const _ip2 = (input, _vctx = {}) => "string" === typeof input["input"];
447
+ const _ip3 = (input, _vctx = {}) => null !== input["projects"] && undefined !== input["projects"] && ("string" === typeof input["projects"] || Array.isArray(input["projects"]) && input["projects"].every(elem => "string" === typeof elem));
448
+ const _ip4 = (input, _vctx = {}) => true === input["dependencies"];
449
+ const _ip5 = (input, _vctx = {}) => "string" === typeof input["fileset"];
450
+ const _ip6 = (input, _vctx = {}) => "string" === typeof input["command"];
451
+ const _ip7 = (input, _vctx = {}) => "object" === typeof input["nodes"] && null !== input["nodes"] && false === Array.isArray(input["nodes"]) && _io18(input["nodes"], _vctx);
452
+ const _ip8 = (input, _vctx = {}) => undefined === input["implicitDeps"] || "object" === typeof input["implicitDeps"] && null !== input["implicitDeps"] && false === Array.isArray(input["implicitDeps"]) && _io18(input["implicitDeps"], _vctx);
453
+ const _ip9 = (input, _vctx = {}) => undefined === input["runtime"] || "object" === typeof input["runtime"] && null !== input["runtime"] && false === Array.isArray(input["runtime"]) && _io18(input["runtime"], _vctx);
454
+ const _ip10 = (input, _vctx = {}) => "string" === typeof input["path"];
455
+ const _ip11 = (input, _vctx = {}) => "number" === typeof input["mode"];
456
+ const _ip12 = (input, _vctx = {}) => "string" === typeof input["sha256"];
457
+ const _ip13 = (input, _vctx = {}) => "string" === typeof input["name"];
458
+ const _ip14 = (input, _vctx = {}) => "string" === typeof input["from"];
459
+ const _ip15 = (input, _vctx = {}) => "string" === typeof input["id"];
460
+ const _ip16 = (input, _vctx = {}) => undefined === input["description"] || "string" === typeof input["description"];
461
+ const _ip17 = (input, _vctx = {}) => undefined === input["executor"] || "string" === typeof input["executor"];
462
+ const _ip18 = (input, _vctx = {}) => undefined === input["command"] || "string" === typeof input["command"];
463
+ const _ip19 = (input, _vctx = {}) => undefined === input["outputs"] || Array.isArray(input["outputs"]) && input["outputs"].every(elem => "string" === typeof elem);
464
+ const _ip20 = (input, _vctx = {}) => undefined === input["dependsOn"] || Array.isArray(input["dependsOn"]) && input["dependsOn"].every(elem => null !== elem && undefined !== elem && ("string" === typeof elem || "object" === typeof elem && null !== elem && _io33(elem, _vctx)));
465
+ const _ip21 = (input, _vctx = {}) => undefined === input["inputs"] || Array.isArray(input["inputs"]) && input["inputs"].every(elem => null !== elem && undefined !== elem && ("string" === typeof elem || "object" === typeof elem && null !== elem && _iu0(elem, _vctx)));
466
+ const _ip22 = (input, _vctx = {}) => true;
467
+ const _ip23 = (input, _vctx = {}) => undefined === input["configurations"] || "object" === typeof input["configurations"] && null !== input["configurations"] && false === Array.isArray(input["configurations"]) && _io34(input["configurations"], _vctx);
468
+ const _ip24 = (input, _vctx = {}) => undefined === input["defaultConfiguration"] || "string" === typeof input["defaultConfiguration"];
469
+ const _ip25 = (input, _vctx = {}) => undefined === input["cache"] || "boolean" === typeof input["cache"];
470
+ const _ip26 = (input, _vctx = {}) => undefined === input["metadata"] || "object" === typeof input["metadata"] && null !== input["metadata"] && false === Array.isArray(input["metadata"]) && _io35(input["metadata"], _vctx);
471
+ const _ip27 = (input, _vctx = {}) => undefined === input["parallelism"] || "boolean" === typeof input["parallelism"];
472
+ const _ip28 = (input, _vctx = {}) => undefined === input["continuous"] || "boolean" === typeof input["continuous"];
473
+ const _ip29 = (input, _vctx = {}) => undefined === input["syncGenerators"] || Array.isArray(input["syncGenerators"]) && input["syncGenerators"].every(elem => "string" === typeof elem);
474
+ const _ip30 = (input, _vctx = {}) => undefined === input["..."] || true === input["..."];
475
+ const _ip31 = (input, _vctx = {}) => null !== input["projects"] && (undefined === input["projects"] || "string" === typeof input["projects"] || Array.isArray(input["projects"]) && input["projects"].every(elem => "string" === typeof elem));
476
+ const _ip32 = (input, _vctx = {}) => undefined === input["technologies"] || Array.isArray(input["technologies"]) && input["technologies"].every(elem => "string" === typeof elem);
477
+ const _ip33 = (input, _vctx = {}) => null !== input["docker"] && (undefined === input["docker"] || true === input["docker"] || "object" === typeof input["docker"] && null !== input["docker"] && false === Array.isArray(input["docker"]) && _io45(input["docker"], _vctx));
478
+ const _ip34 = (input, _vctx = {}) => undefined === input["preVersionCommand"] || "string" === typeof input["preVersionCommand"];
479
+ const _ip36 = (input, _vctx = {}) => "string" === typeof input["packageName"];
480
+ const _ip37 = (input, _vctx = {}) => "string" === typeof input["type"];
481
+ const _ip38 = (input, _vctx = {}) => "string" === typeof input["version"];
482
+ const _ip39 = (input, _vctx = {}) => undefined === input["hash"] || "string" === typeof input["hash"];
483
+ const _ip40 = (input, _vctx = {}) => undefined === input["$schema"] || "string" === typeof input["$schema"];
484
+ const _ip41 = (input, _vctx = {}) => undefined === input["extends"] || "string" === typeof input["extends"];
485
+ const _ip42 = (input, _vctx = {}) => undefined === input["implicitDependencies"] || "object" === typeof input["implicitDependencies"] && null !== input["implicitDependencies"] && false === Array.isArray(input["implicitDependencies"]) && _io67(input["implicitDependencies"], _vctx);
486
+ const _ip43 = (input, _vctx = {}) => undefined === input["namedInputs"] || "object" === typeof input["namedInputs"] && null !== input["namedInputs"] && false === Array.isArray(input["namedInputs"]) && _io69(input["namedInputs"], _vctx);
487
+ const _ip44 = (input, _vctx = {}) => undefined === input["targetDefaults"] || "object" === typeof input["targetDefaults"] && null !== input["targetDefaults"] && false === Array.isArray(input["targetDefaults"]) && _io70(input["targetDefaults"], _vctx);
488
+ const _ip45 = (input, _vctx = {}) => undefined === input["affected"] || "object" === typeof input["affected"] && null !== input["affected"] && false === Array.isArray(input["affected"]) && _io76(input["affected"], _vctx);
489
+ const _ip46 = (input, _vctx = {}) => undefined === input["defaultBase"] || "string" === typeof input["defaultBase"];
490
+ const _ip47 = (input, _vctx = {}) => undefined === input["workspaceLayout"] || "object" === typeof input["workspaceLayout"] && null !== input["workspaceLayout"] && false === Array.isArray(input["workspaceLayout"]) && _io77(input["workspaceLayout"], _vctx);
491
+ const _ip48 = (input, _vctx = {}) => undefined === input["tasksRunnerOptions"] || "object" === typeof input["tasksRunnerOptions"] && null !== input["tasksRunnerOptions"] && false === Array.isArray(input["tasksRunnerOptions"]) && _io78(input["tasksRunnerOptions"], _vctx);
492
+ const _ip49 = (input, _vctx = {}) => undefined === input["generators"] || "object" === typeof input["generators"] && null !== input["generators"] && false === Array.isArray(input["generators"]) && _io80(input["generators"], _vctx);
493
+ const _ip50 = (input, _vctx = {}) => undefined === input["cli"] || "object" === typeof input["cli"] && null !== input["cli"] && false === Array.isArray(input["cli"]) && _io82(input["cli"], _vctx);
494
+ const _ip51 = (input, _vctx = {}) => undefined === input["plugins"] || Array.isArray(input["plugins"]) && input["plugins"].every(elem => null !== elem && undefined !== elem && ("string" === typeof elem || "object" === typeof elem && null !== elem && _io83(elem, _vctx)));
495
+ const _ip52 = (input, _vctx = {}) => undefined === input["pluginsConfig"] || "object" === typeof input["pluginsConfig"] && null !== input["pluginsConfig"] && false === Array.isArray(input["pluginsConfig"]) && _io84(input["pluginsConfig"], _vctx);
496
+ const _ip53 = (input, _vctx = {}) => undefined === input["defaultProject"] || "string" === typeof input["defaultProject"];
497
+ const _ip54 = (input, _vctx = {}) => undefined === input["installation"] || "object" === typeof input["installation"] && null !== input["installation"] && _io85(input["installation"], _vctx);
498
+ const _ip55 = (input, _vctx = {}) => undefined === input["release"] || "object" === typeof input["release"] && null !== input["release"] && false === Array.isArray(input["release"]) && _io86(input["release"], _vctx);
499
+ const _ip56 = (input, _vctx = {}) => undefined === input["nxCloudAccessToken"] || "string" === typeof input["nxCloudAccessToken"];
500
+ const _ip57 = (input, _vctx = {}) => undefined === input["nxCloudId"] || "string" === typeof input["nxCloudId"];
501
+ const _ip58 = (input, _vctx = {}) => undefined === input["nxCloudUrl"] || "string" === typeof input["nxCloudUrl"];
502
+ const _ip59 = (input, _vctx = {}) => undefined === input["nxCloudEncryptionKey"] || "string" === typeof input["nxCloudEncryptionKey"];
503
+ const _ip60 = (input, _vctx = {}) => undefined === input["parallel"] || "number" === typeof input["parallel"];
504
+ const _ip61 = (input, _vctx = {}) => undefined === input["cacheDirectory"] || "string" === typeof input["cacheDirectory"];
505
+ const _ip62 = (input, _vctx = {}) => undefined === input["useDaemonProcess"] || "boolean" === typeof input["useDaemonProcess"];
506
+ const _ip63 = (input, _vctx = {}) => undefined === input["useInferencePlugins"] || "boolean" === typeof input["useInferencePlugins"];
507
+ const _ip64 = (input, _vctx = {}) => undefined === input["neverConnectToCloud"] || "boolean" === typeof input["neverConnectToCloud"];
508
+ const _ip65 = (input, _vctx = {}) => undefined === input["analytics"] || "boolean" === typeof input["analytics"];
509
+ const _ip66 = (input, _vctx = {}) => undefined === input["sync"] || "object" === typeof input["sync"] && null !== input["sync"] && false === Array.isArray(input["sync"]) && _io108(input["sync"], _vctx);
510
+ const _ip67 = (input, _vctx = {}) => undefined === input["migrate"] || "object" === typeof input["migrate"] && null !== input["migrate"] && false === Array.isArray(input["migrate"]) && _io110(input["migrate"], _vctx);
511
+ const _ip68 = (input, _vctx = {}) => undefined === input["maxCacheSize"] || "string" === typeof input["maxCacheSize"];
512
+ const _ip69 = (input, _vctx = {}) => undefined === input["tui"] || "object" === typeof input["tui"] && null !== input["tui"] && false === Array.isArray(input["tui"]) && _io111(input["tui"], _vctx);
513
+ const _ip70 = (input, _vctx = {}) => undefined === input["projectsRelationship"] || "fixed" === input["projectsRelationship"] || "independent" === input["projectsRelationship"];
514
+ const _ip71 = (input, _vctx = {}) => undefined === input["git"] || "object" === typeof input["git"] && null !== input["git"] && false === Array.isArray(input["git"]) && _io101(input["git"], _vctx);
515
+ const _ip72 = (input, _vctx = {}) => null !== input["versionPlans"] && (undefined === input["versionPlans"] || "boolean" === typeof input["versionPlans"] || "object" === typeof input["versionPlans"] && null !== input["versionPlans"] && false === Array.isArray(input["versionPlans"]) && _io99(input["versionPlans"], _vctx));
516
+ const _ip73 = (input, _vctx = {}) => undefined === input["groupPreVersionCommand"] || "string" === typeof input["groupPreVersionCommand"];
517
+ const _ip74 = (input, _vctx = {}) => "string" === typeof input["hostname"];
518
+ const _ip75 = (input, _vctx = {}) => undefined === input["apiBaseUrl"] || "string" === typeof input["apiBaseUrl"];
519
+ const _ip76 = (input, _vctx = {}) => undefined === input["pattern"] || "string" === typeof input["pattern"];
520
+ const _ip77 = (input, _vctx = {}) => null !== input["checkAllBranchesWhen"] && (undefined === input["checkAllBranchesWhen"] || "boolean" === typeof input["checkAllBranchesWhen"] || Array.isArray(input["checkAllBranchesWhen"]) && input["checkAllBranchesWhen"].every(elem => "string" === typeof elem));
521
+ const _ip78 = (input, _vctx = {}) => undefined === input["requireSemver"] || "boolean" === typeof input["requireSemver"];
522
+ const _ip79 = (input, _vctx = {}) => undefined === input["preferDockerVersion"] || "both" === input["preferDockerVersion"] || "boolean" === typeof input["preferDockerVersion"];
523
+ const _ip80 = (input, _vctx = {}) => undefined === input["strictPreid"] || "boolean" === typeof input["strictPreid"];
524
+ const _ip35 = (input, _vctx = {}) => {
525
+ const array = input;
526
+ const tuplePredicators = [
527
+ [
528
+ top => top.length === 1 && "*" === top[0],
529
+ entire => entire.length === 1 && "*" === entire[0]
530
+ ]
531
+ ];
532
+ for (const pred of tuplePredicators)
533
+ if (pred[0](array))
534
+ return pred[1](array);
535
+ const top = input[0];
536
+ if (0 === input.length)
537
+ return true;
538
+ const arrayPredicators = [
539
+ [
540
+ top => "string" === typeof top,
541
+ entire => entire.every(elem => "string" === typeof elem)
542
+ ]
543
+ ];
544
+ const passed = arrayPredicators.filter(pred => pred[0](top));
545
+ if (1 === passed.length)
546
+ return passed[0][1](array);
547
+ else if (1 < passed.length)
548
+ for (const pred of passed)
549
+ if (array.every(value => true === pred[0](value)))
550
+ return pred[1](array);
551
+ return false;
552
+ };
553
+ const _io0 = (input, _vctx = {}) => _ip0(input, _vctx) && "published" === input.disposition && ("object" === typeof input.receipt && null !== input.receipt && _io1(input.receipt, _vctx)) && ("object" === typeof input.projectGraph && null !== input.projectGraph && _io26(input.projectGraph, _vctx)) && ("object" === typeof input.taskGraph && null !== input.taskGraph && _io61(input.taskGraph, _vctx)) && ("object" === typeof input.nxJson && null !== input.nxJson && false === Array.isArray(input.nxJson) && _io66(input.nxJson, _vctx));
554
+ const _io1 = (input, _vctx = {}) => "string" === typeof input.workspaceRoot && "string" === typeof input.head && "string" === typeof input.headTree && ("conservative-provider-source" === input.fileInputProvenance || "exact-file-inputs" === input.fileInputProvenance) && "nx-task-hash-only" === input.runtimeEnvironmentProvenance && ("object" === typeof input.producer && null !== input.producer && _io2(input.producer, _vctx)) && (Array.isArray(input.tasks) && input.tasks.every(elem => "object" === typeof elem && null !== elem && _io25(elem, _vctx)));
555
+ const _io10 = (input, _vctx = {}) => _ip5(input, _vctx) && _ip4(input, _vctx);
556
+ const _io100 = (input, _vctx = {}) => _ip71(input, _vctx) && (null !== input.workspaceChangelog && (undefined === input.workspaceChangelog || "boolean" === typeof input.workspaceChangelog || "object" === typeof input.workspaceChangelog && null !== input.workspaceChangelog && false === Array.isArray(input.workspaceChangelog) && _io92(input.workspaceChangelog, _vctx))) && (null !== input.projectChangelogs && (undefined === input.projectChangelogs || "boolean" === typeof input.projectChangelogs || "object" === typeof input.projectChangelogs && null !== input.projectChangelogs && false === Array.isArray(input.projectChangelogs) && _io92(input.projectChangelogs, _vctx))) && (undefined === input.automaticFromRef || "boolean" === typeof input.automaticFromRef);
557
+ const _io101 = (input, _vctx = {}) => (undefined === input.commit || "boolean" === typeof input.commit) && (undefined === input.commitMessage || "string" === typeof input.commitMessage) && (null !== input.commitArgs && (undefined === input.commitArgs || "string" === typeof input.commitArgs || Array.isArray(input.commitArgs) && input.commitArgs.every(elem => "string" === typeof elem))) && (undefined === input.stageChanges || "boolean" === typeof input.stageChanges) && (undefined === input.tag || "boolean" === typeof input.tag) && (undefined === input.tagMessage || "string" === typeof input.tagMessage) && (null !== input.tagArgs && (undefined === input.tagArgs || "string" === typeof input.tagArgs || Array.isArray(input.tagArgs) && input.tagArgs.every(elem => "string" === typeof elem))) && (undefined === input.push || "boolean" === typeof input.push) && (null !== input.pushArgs && (undefined === input.pushArgs || "string" === typeof input.pushArgs || Array.isArray(input.pushArgs) && input.pushArgs.every(elem => "string" === typeof elem)));
558
+ const _io102 = (input, _vctx = {}) => _io91(input, _vctx) && _ip71(input, _vctx);
559
+ const _io103 = (input, _vctx = {}) => _ip76(input, _vctx) && _ip77(input, _vctx) && _ip78(input, _vctx) && _ip79(input, _vctx) && _ip80(input, _vctx);
560
+ const _io104 = (input, _vctx = {}) => (undefined === input.useCommitScope || "boolean" === typeof input.useCommitScope) && (undefined === input.types || "object" === typeof input.types && null !== input.types && false === Array.isArray(input.types) && _io105(input.types, _vctx));
561
+ const _io105 = (input, _vctx = {}) => Object.keys(input).every(key => {
562
+ const value = input[key];
563
+ if (undefined === value)
564
+ return true;
565
+ return null !== value && undefined !== value && ("boolean" === typeof value || "object" === typeof value && null !== value && false === Array.isArray(value) && _io106(value, _vctx));
566
+ });
567
+ const _io106 = (input, _vctx = {}) => (undefined === input.semverBump || "major" === input.semverBump || "minor" === input.semverBump || "none" === input.semverBump || "patch" === input.semverBump) && (null !== input.changelog && (undefined === input.changelog || "boolean" === typeof input.changelog || "object" === typeof input.changelog && null !== input.changelog && false === Array.isArray(input.changelog) && _io107(input.changelog, _vctx)));
568
+ const _io107 = (input, _vctx = {}) => (undefined === input.title || "string" === typeof input.title) && (undefined === input.hidden || "boolean" === typeof input.hidden);
569
+ const _io108 = (input, _vctx = {}) => (undefined === input.globalGenerators || Array.isArray(input.globalGenerators) && input.globalGenerators.every(elem => "string" === typeof elem)) && (undefined === input.generatorOptions || "object" === typeof input.generatorOptions && null !== input.generatorOptions && false === Array.isArray(input.generatorOptions) && _io109(input.generatorOptions, _vctx)) && (undefined === input.applyChanges || "boolean" === typeof input.applyChanges) && (undefined === input.disabledTaskSyncGenerators || Array.isArray(input.disabledTaskSyncGenerators) && input.disabledTaskSyncGenerators.every(elem => "string" === typeof elem));
570
+ const _io109 = (input, _vctx = {}) => Object.keys(input).every(key => {
571
+ const value = input[key];
572
+ if (undefined === value)
573
+ return true;
574
+ return "object" === typeof value && null !== value && false === Array.isArray(value) && _io38(value, _vctx);
575
+ });
576
+ const _io11 = (input, _vctx = {}) => "string" === typeof input.runtime;
577
+ const _io110 = (input, _vctx = {}) => (undefined === input.createCommits || "boolean" === typeof input.createCommits) && (undefined === input.commitPrefix || "string" === typeof input.commitPrefix) && (undefined === input.include || "all" === input.include || "optional" === input.include || "required" === input.include) && (undefined === input.multiMajorMode || "direct" === input.multiMajorMode || "gradual" === input.multiMajorMode) && (undefined === input.useRegistryResolution || "boolean" === typeof input.useRegistryResolution) && (undefined === input.agentic || "claude-code" === input.agentic || "codex" === input.agentic || "opencode" === input.agentic || "boolean" === typeof input.agentic) && (undefined === input.validate || "boolean" === typeof input.validate);
578
+ const _io111 = (input, _vctx = {}) => (undefined === input.enabled || "boolean" === typeof input.enabled) && (undefined === input.autoExit || "number" === typeof input.autoExit || "boolean" === typeof input.autoExit) && (undefined === input.suppressHints || "boolean" === typeof input.suppressHints);
579
+ const _io12 = (input, _vctx = {}) => Array.isArray(input.externalDependencies) && input.externalDependencies.every(elem => "string" === typeof elem);
580
+ const _io13 = (input, _vctx = {}) => "string" === typeof input.dependentTasksOutputFiles && (undefined === input.transitive || "boolean" === typeof input.transitive);
581
+ const _io14 = (input, _vctx = {}) => "string" === typeof input.env;
582
+ const _io15 = (input, _vctx = {}) => "absolute" === input.workingDirectory || "relative" === input.workingDirectory;
583
+ const _io16 = (input, _vctx = {}) => Array.isArray(input.files) && input.files.every(elem => "string" === typeof elem) && (Array.isArray(input.runtime) && input.runtime.every(elem => "string" === typeof elem)) && (Array.isArray(input.environment) && input.environment.every(elem => "string" === typeof elem)) && (Array.isArray(input.depOutputs) && input.depOutputs.every(elem => "string" === typeof elem)) && (Array.isArray(input.external) && input.external.every(elem => "string" === typeof elem));
584
+ const _io17 = (input, _vctx = {}) => _ip6(input, _vctx) && _ip7(input, _vctx) && _ip8(input, _vctx) && _ip9(input, _vctx);
585
+ const _io18 = (input, _vctx = {}) => Object.keys(input).every(key => {
586
+ const value = input[key];
587
+ if (undefined === value)
588
+ return true;
589
+ return "string" === typeof value;
590
+ });
591
+ const _io19 = (input, _vctx = {}) => _ip10(input, _vctx) && _ip11(input, _vctx) && "string" === typeof input.gitBlob && _ip12(input, _vctx);
592
+ const _io2 = (input, _vctx = {}) => _ip0(input, _vctx) && _ip1(input, _vctx) && (Array.isArray(input.argv) && input.argv.every(elem => "string" === typeof elem)) && true === input.trackedTreeClean && "string" === typeof input.environmentIdentity && (Array.isArray(input.inputs) && input.inputs.every(elem => "object" === typeof elem && null !== elem && _io3(elem, _vctx))) && (Array.isArray(input.tools) && input.tools.every(elem => "object" === typeof elem && null !== elem && _io20(elem, _vctx))) && "string" === typeof input.outputSha256 && "number" === typeof input.wallTimeMs;
593
+ const _io20 = (input, _vctx = {}) => ("executable" === input.kind || "module" === input.kind) && _ip13(input, _vctx) && _ip14(input, _vctx) && _ip10(input, _vctx) && "string" === typeof input.physicalPath && (Array.isArray(input.missing) && input.missing.every(elem => "string" === typeof elem)) && (Array.isArray(input.resolutions) && input.resolutions.every(elem => "object" === typeof elem && null !== elem && _io21(elem, _vctx))) && (Array.isArray(input.nodes) && input.nodes.every(elem => "object" === typeof elem && null !== elem && _iu1(elem, _vctx))) && _ip12(input, _vctx);
594
+ const _io21 = (input, _vctx = {}) => _ip13(input, _vctx) && _ip14(input, _vctx) && (null === input.target || "string" === typeof input.target);
595
+ const _io22 = (input, _vctx = {}) => _ip10(input, _vctx) && "file" === input.type && _ip11(input, _vctx) && _ip12(input, _vctx);
596
+ const _io23 = (input, _vctx = {}) => _ip10(input, _vctx) && "symlink" === input.type && _ip11(input, _vctx) && "string" === typeof input.linkText;
597
+ const _io24 = (input, _vctx = {}) => _ip10(input, _vctx) && "directory" === input.type && _ip11(input, _vctx) && (Array.isArray(input.entries) && input.entries.every(elem => "string" === typeof elem)) && _ip12(input, _vctx);
598
+ const _io25 = (input, _vctx = {}) => _ip15(input, _vctx) && "string" === typeof input.hash && (Array.isArray(input.outputs) && input.outputs.every(elem => "object" === typeof elem && null !== elem && _iu1(elem, _vctx)));
599
+ const _io26 = (input, _vctx = {}) => "object" === typeof input.nodes && null !== input.nodes && false === Array.isArray(input.nodes) && _io27(input.nodes, _vctx) && (undefined === input.externalNodes || "object" === typeof input.externalNodes && null !== input.externalNodes && false === Array.isArray(input.externalNodes) && _io56(input.externalNodes, _vctx)) && ("object" === typeof input.dependencies && null !== input.dependencies && false === Array.isArray(input.dependencies) && _io59(input.dependencies, _vctx)) && (undefined === input.version || "string" === typeof input.version);
600
+ const _io27 = (input, _vctx = {}) => Object.keys(input).every(key => {
601
+ const value = input[key];
602
+ if (undefined === value)
603
+ return true;
604
+ return "object" === typeof value && null !== value && _io28(value, _vctx);
605
+ });
606
+ const _io28 = (input, _vctx = {}) => ("app" === input.type || "e2e" === input.type || "lib" === input.type) && _ip13(input, _vctx) && ("object" === typeof input.data && null !== input.data && _io29(input.data, _vctx));
607
+ const _io29 = (input, _vctx = {}) => _io30(input, _vctx) && _ip16(input, _vctx);
608
+ const _io3 = (input, _vctx = {}) => "string" === typeof input.taskId && ("object" === typeof input.overrides && null !== input.overrides && false === Array.isArray(input.overrides) && _io4(input.overrides, _vctx)) && (Array.isArray(input.declared) && input.declared.every(elem => null !== elem && undefined !== elem && ("string" === typeof elem || "object" === typeof elem && null !== elem && _iu0(elem, _vctx)))) && ("object" === typeof input.expanded && null !== input.expanded && _io16(input.expanded, _vctx)) && ("object" === typeof input.hashDetails && null !== input.hashDetails && _io17(input.hashDetails, _vctx)) && (Array.isArray(input.files) && input.files.every(elem => "object" === typeof elem && null !== elem && _io19(elem, _vctx)));
609
+ const _io30 = (input, _vctx = {}) => (undefined === input.name || "string" === typeof input.name) && (undefined === input.targets || "object" === typeof input.targets && null !== input.targets && false === Array.isArray(input.targets) && _io31(input.targets, _vctx)) && "string" === typeof input.root && (undefined === input.sourceRoot || "string" === typeof input.sourceRoot) && (undefined === input.projectType || "application" === input.projectType || "library" === input.projectType) && (undefined === input.generators || "object" === typeof input.generators && null !== input.generators && false === Array.isArray(input.generators) && _io39(input.generators, _vctx)) && (undefined === input.implicitDependencies || Array.isArray(input.implicitDependencies) && input.implicitDependencies.every(elem => "string" === typeof elem)) && (undefined === input.namedInputs || "object" === typeof input.namedInputs && null !== input.namedInputs && false === Array.isArray(input.namedInputs) && _io41(input.namedInputs, _vctx)) && (undefined === input.tags || Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem)) && (undefined === input.release || "object" === typeof input.release && null !== input.release && false === Array.isArray(input.release) && _io42(input.release, _vctx)) && (undefined === input.metadata || "object" === typeof input.metadata && null !== input.metadata && false === Array.isArray(input.metadata) && _io46(input.metadata, _vctx));
610
+ const _io31 = (input, _vctx = {}) => Object.keys(input).every(key => {
611
+ const value = input[key];
612
+ if (undefined === value)
613
+ return true;
614
+ return "object" === typeof value && null !== value && false === Array.isArray(value) && _io32(value, _vctx);
615
+ });
616
+ const _io32 = (input, _vctx = {}) => _ip17(input, _vctx) && _ip18(input, _vctx) && _ip19(input, _vctx) && _ip20(input, _vctx) && _ip21(input, _vctx) && _ip22(input, _vctx) && _ip23(input, _vctx) && _ip24(input, _vctx) && _ip25(input, _vctx) && _ip26(input, _vctx) && _ip27(input, _vctx) && _ip28(input, _vctx) && _ip29(input, _vctx) && _ip30(input, _vctx);
617
+ const _io33 = (input, _vctx = {}) => _ip31(input, _vctx) && (undefined === input.dependencies || "boolean" === typeof input.dependencies) && _ip1(input, _vctx) && (undefined === input.params || "forward" === input.params || "ignore" === input.params) && (undefined === input.options || "forward" === input.options || "ignore" === input.options);
618
+ const _io34 = (input, _vctx = {}) => Object.keys(input).every(key => {
619
+ const value = input[key];
620
+ if (undefined === value)
621
+ return true;
622
+ return true;
623
+ });
624
+ const _io35 = (input, _vctx = {}) => _ip16(input, _vctx) && _ip32(input, _vctx) && (undefined === input.nonAtomizedTarget || "string" === typeof input.nonAtomizedTarget) && (undefined === input.help || "object" === typeof input.help && null !== input.help && _io36(input.help, _vctx)) && Object.keys(input).every(key => {
625
+ if (["description", "technologies", "nonAtomizedTarget", "help"].some(prop => key === prop))
626
+ return true;
627
+ const value = input[key];
628
+ if (undefined === value)
629
+ return true;
630
+ return true;
631
+ });
632
+ const _io36 = (input, _vctx = {}) => _ip6(input, _vctx) && ("object" === typeof input.example && null !== input.example && false === Array.isArray(input.example) && _io37(input.example, _vctx));
633
+ const _io37 = (input, _vctx = {}) => (undefined === input.options || "object" === typeof input.options && null !== input.options && false === Array.isArray(input.options) && _io38(input.options, _vctx)) && (undefined === input.args || Array.isArray(input.args) && input.args.every(elem => "string" === typeof elem));
634
+ const _io38 = (input, _vctx = {}) => Object.keys(input).every(key => {
635
+ const value = input[key];
636
+ if (undefined === value)
637
+ return true;
638
+ return true;
639
+ });
640
+ const _io39 = (input, _vctx = {}) => Object.keys(input).every(key => {
641
+ const value = input[key];
642
+ if (undefined === value)
643
+ return true;
644
+ return "object" === typeof value && null !== value && false === Array.isArray(value) && _io40(value, _vctx);
645
+ });
646
+ const _io4 = (input, _vctx = {}) => Object.keys(input).every(key => {
647
+ const value = input[key];
648
+ if (undefined === value)
649
+ return true;
650
+ return true;
651
+ });
652
+ const _io40 = (input, _vctx = {}) => Object.keys(input).every(key => {
653
+ const value = input[key];
654
+ if (undefined === value)
655
+ return true;
656
+ return true;
657
+ });
658
+ const _io41 = (input, _vctx = {}) => Object.keys(input).every(key => {
659
+ const value = input[key];
660
+ if (undefined === value)
661
+ return true;
662
+ return Array.isArray(value) && value.every(elem => null !== elem && undefined !== elem && ("string" === typeof elem || "object" === typeof elem && null !== elem && _iu0(elem, _vctx)));
663
+ });
664
+ const _io42 = (input, _vctx = {}) => (undefined === input.version || "object" === typeof input.version && null !== input.version && false === Array.isArray(input.version) && _io43(input.version, _vctx)) && _ip33(input, _vctx);
665
+ const _io43 = (input, _vctx = {}) => (undefined === input.manifestRootsToUpdate || Array.isArray(input.manifestRootsToUpdate) && input.manifestRootsToUpdate.every(elem => null !== elem && undefined !== elem && ("string" === typeof elem || "object" === typeof elem && null !== elem && _io44(elem, _vctx)))) && (undefined === input.currentVersionResolver || "disk" === input.currentVersionResolver || "git-tag" === input.currentVersionResolver || "none" === input.currentVersionResolver || "registry" === input.currentVersionResolver) && (undefined === input.currentVersionResolverMetadata || "object" === typeof input.currentVersionResolverMetadata && null !== input.currentVersionResolverMetadata && false === Array.isArray(input.currentVersionResolverMetadata) && _io38(input.currentVersionResolverMetadata, _vctx)) && (undefined === input.fallbackCurrentVersionResolver || "disk" === input.fallbackCurrentVersionResolver) && (undefined === input.versionPrefix || "" === input.versionPrefix || "=" === input.versionPrefix || "^" === input.versionPrefix || "auto" === input.versionPrefix || "~" === input.versionPrefix) && (undefined === input.versionActions || "string" === typeof input.versionActions) && (undefined === input.versionActionsOptions || "object" === typeof input.versionActionsOptions && null !== input.versionActionsOptions && false === Array.isArray(input.versionActionsOptions) && _io38(input.versionActionsOptions, _vctx)) && (undefined === input.preserveLocalDependencyProtocols || "boolean" === typeof input.preserveLocalDependencyProtocols);
666
+ const _io44 = (input, _vctx = {}) => _ip10(input, _vctx) && "boolean" === typeof input.preserveLocalDependencyProtocols;
667
+ const _io45 = (input, _vctx = {}) => _ip34(input, _vctx) && (null !== input.skipVersionActions && (undefined === input.skipVersionActions || "boolean" === typeof input.skipVersionActions || Array.isArray(input.skipVersionActions) && input.skipVersionActions.every(elem => "string" === typeof elem))) && (undefined === input.versionSchemes || "object" === typeof input.versionSchemes && null !== input.versionSchemes && false === Array.isArray(input.versionSchemes) && _io18(input.versionSchemes, _vctx)) && (undefined === input.repositoryName || "string" === typeof input.repositoryName) && (undefined === input.registryUrl || "string" === typeof input.registryUrl);
668
+ const _io46 = (input, _vctx = {}) => _ip16(input, _vctx) && _ip32(input, _vctx) && (undefined === input.targetGroups || "object" === typeof input.targetGroups && null !== input.targetGroups && false === Array.isArray(input.targetGroups) && _io47(input.targetGroups, _vctx)) && (undefined === input.owners || "object" === typeof input.owners && null !== input.owners && false === Array.isArray(input.owners) && _io48(input.owners, _vctx)) && (undefined === input.js || "object" === typeof input.js && null !== input.js && _io53(input.js, _vctx)) && Object.keys(input).every(key => {
669
+ if (["description", "technologies", "targetGroups", "owners", "js"].some(prop => key === prop))
670
+ return true;
671
+ const value = input[key];
672
+ if (undefined === value)
673
+ return true;
674
+ return true;
675
+ });
676
+ const _io47 = (input, _vctx = {}) => Object.keys(input).every(key => {
677
+ const value = input[key];
678
+ if (undefined === value)
679
+ return true;
680
+ return Array.isArray(value) && value.every(elem => "string" === typeof elem);
681
+ });
682
+ const _io48 = (input, _vctx = {}) => Object.keys(input).every(key => {
683
+ const value = input[key];
684
+ if (undefined === value)
685
+ return true;
686
+ return "object" === typeof value && null !== value && _io49(value, _vctx);
687
+ });
688
+ const _io49 = (input, _vctx = {}) => Array.isArray(input.ownedFiles) && input.ownedFiles.every(elem => "object" === typeof elem && null !== elem && _io50(elem, _vctx));
689
+ const _io5 = (input, _vctx = {}) => "string" === typeof input.json && (undefined === input.fields || Array.isArray(input.fields) && input.fields.every(elem => "string" === typeof elem)) && (undefined === input.excludeFields || Array.isArray(input.excludeFields) && input.excludeFields.every(elem => "string" === typeof elem));
690
+ const _io50 = (input, _vctx = {}) => null !== input.files && undefined !== input.files && (Array.isArray(input.files) && (_ip35(input.files, _vctx) || false)) && (undefined === input.fromConfig || "object" === typeof input.fromConfig && null !== input.fromConfig && _io51(input.fromConfig, _vctx));
691
+ const _io51 = (input, _vctx = {}) => "string" === typeof input.filePath && ("object" === typeof input.location && null !== input.location && _io52(input.location, _vctx));
692
+ const _io52 = (input, _vctx = {}) => "number" === typeof input.startLine && "number" === typeof input.endLine;
693
+ const _io53 = (input, _vctx = {}) => _ip36(input, _vctx) && (undefined === input.packageVersion || "string" === typeof input.packageVersion) && (null !== input.packageExports && (undefined === input.packageExports || "string" === typeof input.packageExports || "object" === typeof input.packageExports && null !== input.packageExports && false === Array.isArray(input.packageExports) && _io54(input.packageExports, _vctx))) && (undefined === input.packageMain || "string" === typeof input.packageMain) && (undefined === input.isInPackageManagerWorkspaces || "boolean" === typeof input.isInPackageManagerWorkspaces);
694
+ const _io54 = (input, _vctx = {}) => Object.keys(input).every(key => {
695
+ const value = input[key];
696
+ if (undefined === value)
697
+ return true;
698
+ return null !== value && undefined !== value && ("string" === typeof value || "object" === typeof value && null !== value && false === Array.isArray(value) && _io55(value, _vctx));
699
+ });
700
+ const _io55 = (input, _vctx = {}) => (undefined === input.types || "string" === typeof input.types) && (undefined === input.require || "string" === typeof input.require) && (undefined === input["import"] || "string" === typeof input["import"]) && (undefined === input.development || "string" === typeof input.development) && (undefined === input["default"] || "string" === typeof input["default"]);
701
+ const _io56 = (input, _vctx = {}) => Object.keys(input).every(key => {
702
+ const value = input[key];
703
+ if (undefined === value)
704
+ return true;
705
+ return "object" === typeof value && null !== value && _io57(value, _vctx);
706
+ });
707
+ const _io57 = (input, _vctx = {}) => _ip37(input, _vctx) && _ip13(input, _vctx) && ("object" === typeof input.data && null !== input.data && _io58(input.data, _vctx));
708
+ const _io58 = (input, _vctx = {}) => _ip38(input, _vctx) && _ip36(input, _vctx) && _ip39(input, _vctx);
709
+ const _io59 = (input, _vctx = {}) => Object.keys(input).every(key => {
710
+ const value = input[key];
711
+ if (undefined === value)
712
+ return true;
713
+ return Array.isArray(value) && value.every(elem => "object" === typeof elem && null !== elem && _io60(elem, _vctx));
714
+ });
715
+ const _io6 = (input, _vctx = {}) => _ip2(input, _vctx) && _ip3(input, _vctx);
716
+ const _io60 = (input, _vctx = {}) => _ip37(input, _vctx) && _ip1(input, _vctx) && "string" === typeof input.source;
717
+ const _io61 = (input, _vctx = {}) => Array.isArray(input.roots) && input.roots.every(elem => "string" === typeof elem) && ("object" === typeof input.tasks && null !== input.tasks && false === Array.isArray(input.tasks) && _io62(input.tasks, _vctx)) && ("object" === typeof input.dependencies && null !== input.dependencies && false === Array.isArray(input.dependencies) && _io47(input.dependencies, _vctx)) && ("object" === typeof input.continuousDependencies && null !== input.continuousDependencies && false === Array.isArray(input.continuousDependencies) && _io47(input.continuousDependencies, _vctx));
718
+ const _io62 = (input, _vctx = {}) => Object.keys(input).every(key => {
719
+ const value = input[key];
720
+ if (undefined === value)
721
+ return true;
722
+ return "object" === typeof value && null !== value && _io63(value, _vctx);
723
+ });
724
+ const _io63 = (input, _vctx = {}) => _ip15(input, _vctx) && ("object" === typeof input.target && null !== input.target && _io64(input.target, _vctx)) && ("object" === typeof input.overrides && null !== input.overrides && false === Array.isArray(input.overrides) && _io38(input.overrides, _vctx)) && (Array.isArray(input.outputs) && input.outputs.every(elem => "string" === typeof elem)) && (undefined === input.projectRoot || "string" === typeof input.projectRoot) && _ip39(input, _vctx) && (undefined === input.hashDetails || "object" === typeof input.hashDetails && null !== input.hashDetails && _io65(input.hashDetails, _vctx)) && (undefined === input.startTime || "number" === typeof input.startTime) && (undefined === input.endTime || "number" === typeof input.endTime) && "boolean" === typeof input.cache && _ip27(input, _vctx) && _ip28(input, _vctx);
725
+ const _io64 = (input, _vctx = {}) => "string" === typeof input.project && _ip1(input, _vctx) && (undefined === input.configuration || "string" === typeof input.configuration);
726
+ const _io65 = (input, _vctx = {}) => _ip6(input, _vctx) && _ip7(input, _vctx) && _ip8(input, _vctx) && _ip9(input, _vctx);
727
+ const _io66 = (input, _vctx = {}) => _ip40(input, _vctx) && _ip41(input, _vctx) && _ip42(input, _vctx) && _ip43(input, _vctx) && _ip44(input, _vctx) && _ip45(input, _vctx) && _ip46(input, _vctx) && _ip47(input, _vctx) && _ip48(input, _vctx) && _ip49(input, _vctx) && _ip50(input, _vctx) && _ip51(input, _vctx) && _ip52(input, _vctx) && _ip53(input, _vctx) && _ip54(input, _vctx) && _ip55(input, _vctx) && _ip56(input, _vctx) && _ip57(input, _vctx) && _ip58(input, _vctx) && _ip59(input, _vctx) && _ip60(input, _vctx) && _ip61(input, _vctx) && _ip62(input, _vctx) && _ip63(input, _vctx) && _ip64(input, _vctx) && _ip65(input, _vctx) && _ip66(input, _vctx) && _ip67(input, _vctx) && _ip68(input, _vctx) && _ip69(input, _vctx);
728
+ const _io67 = (input, _vctx = {}) => Object.keys(input).every(key => {
729
+ const value = input[key];
730
+ if (undefined === value)
731
+ return true;
732
+ return null !== value && undefined !== value && ("*" === value || (Array.isArray(value) && value.every(elem => "string" === typeof elem) || "object" === typeof value && null !== value && false === Array.isArray(value) && _io68(value, _vctx)));
733
+ });
734
+ const _io68 = (input, _vctx = {}) => (_vctx.io68 || (_vctx.io68 = new WeakSet())).has(input) ? true : (_vctx.io68.add(input), (Object.keys(input).every(key => {
735
+ const value = input[key];
736
+ if (undefined === value)
737
+ return true;
738
+ return null !== value && undefined !== value && ("*" === value || (Array.isArray(value) && value.every(elem => "string" === typeof elem) || "object" === typeof value && null !== value && false === Array.isArray(value) && _io68(value, _vctx)));
739
+ })) || (_vctx.io68.delete(input), false));
740
+ const _io69 = (input, _vctx = {}) => Object.keys(input).every(key => {
741
+ const value = input[key];
742
+ if (undefined === value)
743
+ return true;
744
+ return Array.isArray(value) && value.every(elem => null !== elem && undefined !== elem && ("string" === typeof elem || "object" === typeof elem && null !== elem && _iu0(elem, _vctx)));
745
+ });
746
+ const _io7 = (input, _vctx = {}) => _ip2(input, _vctx) && _ip4(input, _vctx);
747
+ const _io70 = (input, _vctx = {}) => Object.keys(input).every(key => {
748
+ const value = input[key];
749
+ if (undefined === value)
750
+ return true;
751
+ return null !== value && undefined !== value && (Array.isArray(value) && value.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && _io71(elem, _vctx)) || "object" === typeof value && null !== value && false === Array.isArray(value) && _io74(value, _vctx));
752
+ });
753
+ const _io71 = (input, _vctx = {}) => _io73(input, _vctx) && (undefined === input.filter || "object" === typeof input.filter && null !== input.filter && false === Array.isArray(input.filter) && _io72(input.filter, _vctx));
754
+ const _io72 = (input, _vctx = {}) => (undefined === input.plugin || "string" === typeof input.plugin) && (undefined === input.projects || Array.isArray(input.projects) && input.projects.every(elem => "string" === typeof elem)) && _ip17(input, _vctx);
755
+ const _io73 = (input, _vctx = {}) => _ip17(input, _vctx) && _ip18(input, _vctx) && _ip19(input, _vctx) && _ip20(input, _vctx) && _ip21(input, _vctx) && _ip22(input, _vctx) && _ip23(input, _vctx) && _ip24(input, _vctx) && _ip25(input, _vctx) && _ip26(input, _vctx) && _ip27(input, _vctx) && _ip28(input, _vctx) && _ip29(input, _vctx) && _ip30(input, _vctx);
756
+ const _io74 = (input, _vctx = {}) => _io75(input, _vctx) && (null !== input.filter && undefined === input.filter);
757
+ const _io75 = (input, _vctx = {}) => _ip17(input, _vctx) && _ip18(input, _vctx) && _ip19(input, _vctx) && _ip20(input, _vctx) && _ip21(input, _vctx) && _ip22(input, _vctx) && _ip23(input, _vctx) && _ip24(input, _vctx) && _ip25(input, _vctx) && _ip26(input, _vctx) && _ip27(input, _vctx) && _ip28(input, _vctx) && _ip29(input, _vctx) && _ip30(input, _vctx);
758
+ const _io76 = (input, _vctx = {}) => _ip46(input, _vctx);
759
+ const _io77 = (input, _vctx = {}) => (undefined === input.libsDir || "string" === typeof input.libsDir) && (undefined === input.appsDir || "string" === typeof input.appsDir);
760
+ const _io78 = (input, _vctx = {}) => Object.keys(input).every(key => {
761
+ const value = input[key];
762
+ if (undefined === value)
763
+ return true;
764
+ return "object" === typeof value && null !== value && false === Array.isArray(value) && _io79(value, _vctx);
765
+ });
766
+ const _io79 = (input, _vctx = {}) => (undefined === input.runner || "string" === typeof input.runner) && _ip22(input, _vctx);
767
+ const _io8 = (input, _vctx = {}) => _ip2(input, _vctx);
768
+ const _io80 = (input, _vctx = {}) => Object.keys(input).every(key => {
769
+ const value = input[key];
770
+ if (undefined === value)
771
+ return true;
772
+ return "object" === typeof value && null !== value && false === Array.isArray(value) && _io81(value, _vctx);
773
+ });
774
+ const _io81 = (input, _vctx = {}) => Object.keys(input).every(key => {
775
+ const value = input[key];
776
+ if (undefined === value)
777
+ return true;
778
+ return true;
779
+ });
780
+ const _io82 = (input, _vctx = {}) => (undefined === input.packageManager || "bun" === input.packageManager || "npm" === input.packageManager || "pnpm" === input.packageManager || "yarn" === input.packageManager) && (undefined === input.defaultProjectName || "string" === typeof input.defaultProjectName);
781
+ const _io83 = (input, _vctx = {}) => "string" === typeof input.plugin && _ip22(input, _vctx) && (undefined === input.include || Array.isArray(input.include) && input.include.every(elem => "string" === typeof elem)) && (undefined === input.exclude || Array.isArray(input.exclude) && input.exclude.every(elem => "string" === typeof elem));
782
+ const _io84 = (input, _vctx = {}) => Object.keys(input).every(key => {
783
+ const value = input[key];
784
+ if (undefined === value)
785
+ return true;
786
+ return "object" === typeof value && null !== value && false === Array.isArray(value) && _io38(value, _vctx);
787
+ });
788
+ const _io85 = (input, _vctx = {}) => _ip38(input, _vctx) && (undefined === input.plugins || "object" === typeof input.plugins && null !== input.plugins && false === Array.isArray(input.plugins) && _io18(input.plugins, _vctx));
789
+ const _io86 = (input, _vctx = {}) => _ip31(input, _vctx) && _ip33(input, _vctx) && (undefined === input.groups || "object" === typeof input.groups && null !== input.groups && false === Array.isArray(input.groups) && _io87(input.groups, _vctx)) && _ip70(input, _vctx) && (undefined === input.changelog || "object" === typeof input.changelog && null !== input.changelog && false === Array.isArray(input.changelog) && _io100(input.changelog, _vctx)) && (undefined === input.version || "object" === typeof input.version && null !== input.version && false === Array.isArray(input.version) && _io102(input.version, _vctx)) && (undefined === input.releaseTag || "object" === typeof input.releaseTag && null !== input.releaseTag && false === Array.isArray(input.releaseTag) && _io103(input.releaseTag, _vctx)) && _ip71(input, _vctx) && (undefined === input.conventionalCommits || "object" === typeof input.conventionalCommits && null !== input.conventionalCommits && false === Array.isArray(input.conventionalCommits) && _io104(input.conventionalCommits, _vctx)) && _ip72(input, _vctx);
790
+ const _io87 = (input, _vctx = {}) => Object.keys(input).every(key => {
791
+ const value = input[key];
792
+ if (undefined === value)
793
+ return true;
794
+ return "object" === typeof value && null !== value && _io88(value, _vctx);
795
+ });
796
+ const _io88 = (input, _vctx = {}) => _ip70(input, _vctx) && _ip3(input, _vctx) && (null !== input.docker && (undefined === input.docker || true === input.docker || "object" === typeof input.docker && null !== input.docker && false === Array.isArray(input.docker) && _io89(input.docker, _vctx))) && (undefined === input.version || "object" === typeof input.version && null !== input.version && false === Array.isArray(input.version) && _io90(input.version, _vctx)) && (null !== input.changelog && (undefined === input.changelog || "boolean" === typeof input.changelog || "object" === typeof input.changelog && null !== input.changelog && false === Array.isArray(input.changelog) && _io92(input.changelog, _vctx))) && (undefined === input.releaseTag || "object" === typeof input.releaseTag && null !== input.releaseTag && false === Array.isArray(input.releaseTag) && _io98(input.releaseTag, _vctx)) && _ip72(input, _vctx);
797
+ const _io89 = (input, _vctx = {}) => _io45(input, _vctx) && _ip73(input, _vctx);
798
+ const _io9 = (input, _vctx = {}) => _ip5(input, _vctx);
799
+ const _io90 = (input, _vctx = {}) => _io91(input, _vctx) && _ip73(input, _vctx);
800
+ const _io91 = (input, _vctx = {}) => _io43(input, _vctx) && ((undefined === input.conventionalCommits || "boolean" === typeof input.conventionalCommits) && _ip34(input, _vctx) && (undefined === input.specifierSource || "conventional-commits" === input.specifierSource || "prompt" === input.specifierSource || "version-plans" === input.specifierSource) && (undefined === input.firstRelease || "boolean" === typeof input.firstRelease) && (undefined === input.deleteVersionPlans || "boolean" === typeof input.deleteVersionPlans) && (undefined === input.updateDependents || "always" === input.updateDependents || "auto" === input.updateDependents || "never" === input.updateDependents) && (undefined === input.logUnchangedProjects || "boolean" === typeof input.logUnchangedProjects) && (null !== input.preserveMatchingDependencyRanges && (undefined === input.preserveMatchingDependencyRanges || "boolean" === typeof input.preserveMatchingDependencyRanges || Array.isArray(input.preserveMatchingDependencyRanges) && input.preserveMatchingDependencyRanges.every(elem => "dependencies" === elem || "devDependencies" === elem || "optionalDependencies" === elem || "peerDependencies" === elem))) && (undefined === input.adjustSemverBumpsForZeroMajorVersion || "boolean" === typeof input.adjustSemverBumpsForZeroMajorVersion) && (undefined === input.applyPreidToDependents || "boolean" === typeof input.applyPreidToDependents));
801
+ const _io92 = (input, _vctx = {}) => null !== input.createRelease && (undefined === input.createRelease || "github" === input.createRelease || "gitlab" === input.createRelease || false === input.createRelease || "object" === typeof input.createRelease && null !== input.createRelease && _iu2(input.createRelease, _vctx)) && (undefined === input.entryWhenNoChanges || false === input.entryWhenNoChanges || "string" === typeof input.entryWhenNoChanges) && (undefined === input.file || false === input.file || "string" === typeof input.file) && (null !== input.renderer && (undefined === input.renderer || "string" === typeof input.renderer || "object" === typeof input.renderer && null !== input.renderer && _io95(input.renderer, _vctx))) && (undefined === input.renderOptions || "object" === typeof input.renderOptions && null !== input.renderOptions && false === Array.isArray(input.renderOptions) && _io97(input.renderOptions, _vctx));
802
+ const _io93 = (input, _vctx = {}) => "github-enterprise-server" === input.provider && _ip74(input, _vctx) && _ip75(input, _vctx);
803
+ const _io94 = (input, _vctx = {}) => "gitlab" === input.provider && _ip74(input, _vctx) && _ip75(input, _vctx);
804
+ const _io95 = (input, _vctx = {}) => "number" === typeof input.length && true && true && _ip13(input, _vctx) && ("object" === typeof input.prototype && null !== input.prototype && false === Array.isArray(input.prototype) && _io96(input.prototype, _vctx));
805
+ const _io96 = (input, _vctx = {}) => true;
806
+ const _io97 = (input, _vctx = {}) => Object.keys(input).every(key => {
807
+ const value = input[key];
808
+ if (undefined === value)
809
+ return true;
810
+ return true;
811
+ });
812
+ const _io98 = (input, _vctx = {}) => _ip76(input, _vctx) && _ip77(input, _vctx) && _ip78(input, _vctx) && _ip79(input, _vctx) && _ip80(input, _vctx);
813
+ const _io99 = (input, _vctx = {}) => undefined === input.ignorePatternsForPlanCheck || Array.isArray(input.ignorePatternsForPlanCheck) && input.ignorePatternsForPlanCheck.every(elem => "string" === typeof elem);
814
+ const _iu0 = (input, _vctx = {}) => (() => {
815
+ if (undefined !== input.json)
816
+ return _io5(input, _vctx);
817
+ else if (undefined !== input.projects)
818
+ return _io6(input, _vctx);
819
+ else if (undefined !== input.runtime)
820
+ return _io11(input, _vctx);
821
+ else if (undefined !== input.externalDependencies)
822
+ return _io12(input, _vctx);
823
+ else if (undefined !== input.dependentTasksOutputFiles)
824
+ return _io13(input, _vctx);
825
+ else if (undefined !== input.env)
826
+ return _io14(input, _vctx);
827
+ else if (undefined !== input.workingDirectory)
828
+ return _io15(input, _vctx);
829
+ else
830
+ return (() => {
831
+ if (_io7(input, _vctx))
832
+ return _io7(input, _vctx);
833
+ if (_io8(input, _vctx))
834
+ return _io8(input, _vctx);
835
+ if (_io9(input, _vctx))
836
+ return _io9(input, _vctx);
837
+ if (_io10(input, _vctx))
838
+ return _io10(input, _vctx);
839
+ return false;
840
+ })();
841
+ })();
842
+ const _iu1 = (input, _vctx = {}) => (() => {
843
+ if ("file" === input.type)
844
+ return _io22(input, _vctx);
845
+ else if ("symlink" === input.type)
846
+ return _io23(input, _vctx);
847
+ else if ("directory" === input.type)
848
+ return _io24(input, _vctx);
849
+ else
850
+ return false;
851
+ })();
852
+ const _iu2 = (input, _vctx = {}) => (() => {
853
+ if ("gitlab" === input.provider)
854
+ return _io94(input, _vctx);
855
+ else if ("github-enterprise-server" === input.provider)
856
+ return _io93(input, _vctx);
857
+ else
858
+ return false;
859
+ })();
860
+ const __is = (input, _vctx = {}) => "object" === typeof input && null !== input && _io0(input, _vctx);
861
+ return input => { input = JSON.parse(input); return __is(input) ? input : null; };
862
+ })()(readFileSync(recordPath(root, target, 'published'), 'utf8'));
863
+ if (record === null || record.version !== 1)
864
+ return { ok: false, detail: 'Missing/corrupt producer completion contract' };
865
+ const receipt = record.receipt;
866
+ if (receipt.workspaceRoot !== realpathSync(root) ||
867
+ receipt.producer.version !== 1 ||
868
+ receipt.producer.target !== target ||
869
+ !receipt.producer.trackedTreeClean)
870
+ return { ok: false, detail: 'Producer receipt target/provider identity differs' };
871
+ if (receipt.producer.environmentIdentity !== producerEnvironmentIdentity(receipt.producer.inputs))
872
+ return { ok: false, detail: 'Corrupt declared producer environment identity' };
873
+ if (receipt.producer.inputs.length !== receipt.tasks.length ||
874
+ new Set(receipt.producer.inputs.map(({ taskId }) => taskId)).size !== receipt.tasks.length)
875
+ return { ok: false, detail: 'Producer input/task membership differs' };
876
+ const expected = targetGraph(root, target, record.projectGraph);
877
+ if (!same(Object.keys(expected.tasks).sort(), Object.keys(record.taskGraph.tasks).sort()) ||
878
+ Object.values(record.taskGraph.tasks).some((task) => !defaultOverrides(task) ||
879
+ !same(task.target, expected.tasks[task.id]?.target) ||
880
+ !same(task.outputs, expected.tasks[task.id]?.outputs)))
881
+ return { ok: false, detail: 'Producer target/default overrides or configuration differ' };
882
+ const source = captureProducerSource(root, receipt.tasks.flatMap(({ outputs }) => outputs.map(({ path }) => path)));
883
+ if (!source.ok)
884
+ return source;
885
+ if (source.value.headTree !== receipt.headTree)
886
+ return { ok: false, detail: 'Current committed tree differs from producer basis tree' };
887
+ const tools = verifyTools(receipt.producer.tools);
888
+ if (!tools.ok)
889
+ return tools;
890
+ const load = createWorkspaceNxRequire(root);
891
+ const proof = providerInputProof(root, record.nxJson, record.projectGraph, record.taskGraph, load);
892
+ const files = new Map(source.value.files.map((file) => [file.path, file]));
893
+ for (const task of receipt.tasks) {
894
+ const input = receipt.producer.inputs.find(({ taskId }) => taskId === task.id);
895
+ if (input === undefined ||
896
+ !same(input.expanded, proof.inputs[task.id]) ||
897
+ !same(input.hashDetails, record.taskGraph.tasks[task.id]?.hashDetails) ||
898
+ !same(input.overrides, record.taskGraph.tasks[task.id]?.overrides) ||
899
+ input.files.some((file) => !same(files.get(file.path), file)))
900
+ return { ok: false, detail: `Declared FILE/input identity differs for ${task.id}` };
901
+ }
902
+ const census = providerReceipt(root, target, Object.values(record.taskGraph.tasks), proof, load('nx/src/native').expandOutputs, source.value, receipt.producer);
903
+ if (census.disposition !== 'hit' ||
904
+ !same(census.receipt.tasks, receipt.tasks) ||
905
+ census.receipt.producer.outputSha256 !== receipt.producer.outputSha256)
906
+ return {
907
+ ok: false,
908
+ detail: census.disposition === 'hit'
909
+ ? 'Public product bytes differ from actual producer receipt'
910
+ : census.reason.detail,
911
+ };
912
+ if (!nodesUnchanged(tools.value))
913
+ return { ok: false, detail: 'Producer tool namespace changed during independent product validation' };
914
+ return { ok: true, value: receipt };
915
+ }
916
+ catch (error) {
917
+ if (error instanceof Error)
918
+ return { ok: false, detail: `Cannot validate producer completion receipt: ${error.message}` };
919
+ throw error;
920
+ }
921
+ }