@smoothbricks/nx-plugin 0.4.28 → 0.4.30

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 (158) hide show
  1. package/README.md +277 -89
  2. package/dist/bin/smoo-nx-test-clocks.d.ts +3 -0
  3. package/dist/bin/smoo-nx-test-clocks.d.ts.map +1 -0
  4. package/dist/bin/smoo-nx-test-clocks.js +28 -0
  5. package/dist/bounded-test-policy.d.ts +8 -8
  6. package/dist/bounded-test-policy.d.ts.map +1 -1
  7. package/dist/bounded-test-policy.js +18 -30
  8. package/dist/cargo-closure-input.d.ts +23 -0
  9. package/dist/cargo-closure-input.d.ts.map +1 -1
  10. package/dist/cargo-closure-input.js +41 -9
  11. package/dist/cargo-source-hash.d.ts.map +1 -1
  12. package/dist/cargo-source-hash.js +42 -19
  13. package/dist/ensure-built-receipt.d.ts +40 -6
  14. package/dist/ensure-built-receipt.d.ts.map +1 -1
  15. package/dist/ensure-built-receipt.js +297 -159
  16. package/dist/ensure-built-witness.d.ts +65 -4
  17. package/dist/ensure-built-witness.d.ts.map +1 -1
  18. package/dist/ensure-built-witness.js +2237 -23
  19. package/dist/ensure-built.d.ts +99 -1
  20. package/dist/ensure-built.d.ts.map +1 -1
  21. package/dist/ensure-built.js +45 -56
  22. package/dist/executors/bounded-exec/cpu-pool.d.ts +22 -7
  23. package/dist/executors/bounded-exec/cpu-pool.d.ts.map +1 -1
  24. package/dist/executors/bounded-exec/cpu-pool.js +51 -22
  25. package/dist/executors/bounded-exec/executor.d.ts +12 -3
  26. package/dist/executors/bounded-exec/executor.d.ts.map +1 -1
  27. package/dist/executors/bounded-exec/executor.js +174 -51
  28. package/dist/executors/bounded-exec/no-space.d.ts +8 -0
  29. package/dist/executors/bounded-exec/no-space.d.ts.map +1 -0
  30. package/dist/executors/bounded-exec/no-space.js +31 -0
  31. package/dist/executors/bounded-exec/ram-temp.d.ts +20 -11
  32. package/dist/executors/bounded-exec/ram-temp.d.ts.map +1 -1
  33. package/dist/executors/bounded-exec/ram-temp.js +42 -17
  34. package/dist/executors/bounded-exec/verdict.d.ts +34 -4
  35. package/dist/executors/bounded-exec/verdict.d.ts.map +1 -1
  36. package/dist/executors/bounded-exec/verdict.js +54 -3
  37. package/dist/generators/bun-test-tracing/generator.js +2 -2
  38. package/dist/graph-input-contract.d.ts +102 -0
  39. package/dist/graph-input-contract.d.ts.map +1 -0
  40. package/dist/graph-input-contract.js +637 -0
  41. package/dist/index.d.ts +12 -5
  42. package/dist/index.d.ts.map +1 -1
  43. package/dist/index.js +17 -3
  44. package/dist/managed-files/ci-workflow.d.ts.map +1 -1
  45. package/dist/managed-files/ci-workflow.js +5 -2
  46. package/dist/managed-files/publish-workflow.d.ts +11 -1
  47. package/dist/managed-files/publish-workflow.d.ts.map +1 -1
  48. package/dist/owned-installation.d.ts +14 -0
  49. package/dist/owned-installation.d.ts.map +1 -0
  50. package/dist/owned-installation.js +324 -0
  51. package/dist/producer-receipts.d.ts +19 -0
  52. package/dist/producer-receipts.d.ts.map +1 -0
  53. package/dist/producer-receipts.js +926 -0
  54. package/dist/test-backstop.d.ts +9 -0
  55. package/dist/test-backstop.d.ts.map +1 -0
  56. package/dist/test-backstop.js +10 -0
  57. package/dist/test-clock-policy.d.ts +30 -0
  58. package/dist/test-clock-policy.d.ts.map +1 -0
  59. package/dist/test-clock-policy.js +686 -0
  60. package/dist/testing.d.ts +8 -0
  61. package/dist/testing.d.ts.map +1 -1
  62. package/dist/testing.js +66 -1
  63. package/managed/raw/patches/nx@23.2.1.patch +328 -50
  64. package/managed/raw/tooling/direnv/developer-links.ts +148 -29
  65. package/managed/raw/tooling/direnv/devenv.smoo.nix +7 -7
  66. package/managed/raw/tooling/direnv/github-actions-bootstrap.sh +14 -5
  67. package/managed/raw/tooling/direnv/linked-snapshots.ts +206 -40
  68. package/managed/raw/tooling/direnv/repo-path +15 -2
  69. package/managed/raw/tooling/direnv/setup-environment.ts +179 -115
  70. package/managed/templates/github/actions/cache-node-modules/action.yml +9 -0
  71. package/managed/templates/github/actions/setup-devenv/action.yml +63 -7
  72. package/nextest.toml +1 -1
  73. package/package.json +25 -9
  74. package/src/__tests__/cargo-closure-fixture.ts +113 -0
  75. package/src/__tests__/counted-cargo.ts +8 -25
  76. package/src/__tests__/directory-change.ts +27 -0
  77. package/src/__tests__/fixture-nx-env.ts +7 -0
  78. package/src/__tests__/owned-installation.ts +14 -0
  79. package/src/__tests__/past-tick.ts +12 -0
  80. package/src/bin/smoo-nx-bound-failures.test.ts +1 -1
  81. package/src/bin/smoo-nx-test-clocks.ts +29 -0
  82. package/src/bounded-test-policy.test.ts +36 -22
  83. package/src/bounded-test-policy.ts +18 -32
  84. package/src/bun-bootstrap.test.ts +1 -1
  85. package/src/cargo-closure-input.property.test.ts +50 -0
  86. package/src/cargo-closure-input.test.ts +73 -121
  87. package/src/cargo-closure-input.ts +47 -8
  88. package/src/cargo-closure-key.test.ts +239 -0
  89. package/src/cargo-resolve-cache.test.ts +168 -31
  90. package/src/cargo-source-hash.test.ts +78 -3
  91. package/src/cargo-source-hash.ts +48 -30
  92. package/src/cross-check-policy.test.ts +2 -2
  93. package/src/ensure-built-receipt.test.ts +111 -16
  94. package/src/ensure-built-receipt.ts +294 -149
  95. package/src/ensure-built-witness.test.ts +306 -13
  96. package/src/ensure-built-witness.ts +255 -24
  97. package/src/ensure-built.test.ts +228 -102
  98. package/src/ensure-built.ts +127 -66
  99. package/src/executors/bounded-exec/cpu-pool.test.ts +134 -32
  100. package/src/executors/bounded-exec/cpu-pool.ts +64 -20
  101. package/src/executors/bounded-exec/cpu-tokens.test.ts +2 -2
  102. package/src/executors/bounded-exec/disk-lease.test.ts +47 -13
  103. package/src/executors/bounded-exec/executor-host.test.ts +74 -52
  104. package/src/executors/bounded-exec/executor.test.ts +343 -97
  105. package/src/executors/bounded-exec/executor.ts +192 -56
  106. package/src/executors/bounded-exec/hang-diagnostics.test.ts +14 -8
  107. package/src/executors/bounded-exec/no-space.ts +40 -0
  108. package/src/executors/bounded-exec/progress.test.ts +1 -1
  109. package/src/executors/bounded-exec/ram-temp-host.test.ts +51 -21
  110. package/src/executors/bounded-exec/ram-temp.test.ts +92 -16
  111. package/src/executors/bounded-exec/ram-temp.ts +49 -20
  112. package/src/executors/bounded-exec/verdict.test.ts +127 -22
  113. package/src/executors/bounded-exec/verdict.ts +78 -3
  114. package/src/generators/bounded-test-targets/generator.test.ts +1 -3
  115. package/src/generators/bun-test-tracing/generator.test.ts +2 -2
  116. package/src/generators/bun-test-tracing/generator.ts +2 -2
  117. package/src/graph-input-contract.test.ts +379 -0
  118. package/src/graph-input-contract.ts +627 -0
  119. package/src/index.test.ts +3 -3
  120. package/src/index.ts +24 -3
  121. package/src/linked-snapshots.nx.test.ts +112 -30
  122. package/src/managed-files/ci-workflow.ts +5 -2
  123. package/src/managed-files/publish-workflow.ts +12 -1
  124. package/src/managed-files/repo-path.test.ts +44 -1
  125. package/src/managed-files/setup-devenv-free-disk.test.ts +95 -0
  126. package/src/nextest-code-bound.test.ts +23 -17
  127. package/src/nextest-extraction.test.ts +114 -4
  128. package/src/nextest-partitions.test.ts +7 -1
  129. package/src/nx-cache-restore-mtime.test.ts +2 -2
  130. package/src/nx-daemon-claim.test.ts +10 -8
  131. package/src/nx-daemon-idle-cpu.test.ts +0 -1
  132. package/src/nx-daemon-idle-policy.test.ts +61 -1
  133. package/src/nx-daemon-ignore-files.test.ts +2 -2
  134. package/src/nx-daemon-validity.test.ts +36 -22
  135. package/src/nx-dot-input-policy.test.ts +5 -5
  136. package/src/nx-files-archive-racy.test.ts +1 -1
  137. package/src/nx-incomplete-run-summary.test.ts +1 -1
  138. package/src/nx-plugin-load-errors.test.ts +2 -2
  139. package/src/nx-project-graph-errors.test.ts +70 -0
  140. package/src/nx-skipped-task-exit.test.ts +2 -2
  141. package/src/nx-store-resolution.test.ts +7 -25
  142. package/src/nx-task-output-lease.test.ts +3 -3
  143. package/src/nx-use-local.test.ts +7 -5
  144. package/src/owned-installation.ts +174 -0
  145. package/src/producer-receipts.test.ts +164 -0
  146. package/src/producer-receipts.ts +636 -0
  147. package/src/runtime-input.test.ts +1 -1
  148. package/src/serial-group-wiring.test.ts +4 -4
  149. package/src/task-results.test.ts +18 -16
  150. package/src/test-backstop.ts +11 -0
  151. package/src/test-clock-policy.test.ts +338 -0
  152. package/src/test-clock-policy.ts +708 -0
  153. package/src/test-timings.test.ts +2 -2
  154. package/src/testing.test.ts +5 -5
  155. package/src/testing.ts +67 -1
  156. package/src/typecheck-test-policy.test.ts +1 -1
  157. package/src/typescript-resolution.test.ts +76 -0
  158. package/test-timings.json +8 -0
@@ -1,6 +1,50 @@
1
1
  import type { BigIntStats } from 'node:fs';
2
- import type { Task } from 'nx/src/config/task-graph';
2
+ import type * as NxConfiguration from 'nx/src/config/nx-json';
3
+ import type { NxJsonConfiguration } from 'nx/src/config/nx-json';
4
+ import type { ProjectGraph, ProjectGraphProjectNode } from 'nx/src/config/project-graph';
5
+ import type { Task, TaskGraph } from 'nx/src/config/task-graph';
6
+ import type * as NxDaemonClient from 'nx/src/daemon/client/client';
7
+ import type * as NxHashTask from 'nx/src/hasher/hash-task';
8
+ import type * as NxTaskHasher from 'nx/src/hasher/task-hasher';
3
9
  import type * as NxNative from 'nx/src/native';
10
+ import type * as NxTransformObjects from 'nx/src/native/transform-objects';
11
+ import type * as NxExecutionHooks from 'nx/src/project-graph/plugins/tasks-execution-hooks';
12
+ import type * as NxProjectGraphRuntime from 'nx/src/project-graph/project-graph';
13
+ import type * as NxProjectRootMappings from 'nx/src/project-graph/utils/find-project-for-path';
14
+ import type * as NxCache from 'nx/src/tasks-runner/cache';
15
+ import type * as NxCreateTaskGraph from 'nx/src/tasks-runner/create-task-graph';
16
+ import type * as NxRunCommand from 'nx/src/tasks-runner/run-command';
17
+ import type * as NxTaskEnv from 'nx/src/tasks-runner/task-env';
18
+ import type * as NxTasksRunnerUtils from 'nx/src/tasks-runner/utils';
19
+ import type * as NxCacheDirectory from 'nx/src/utils/cache-directory';
20
+ import type * as NxCommandLineUtils from 'nx/src/utils/command-line-utils';
21
+ import type * as NxPackageJson from 'nx/src/utils/package-json';
22
+ import type * as NxPerfLogging from 'nx/src/utils/perf-logging';
23
+ import type * as NxWorkspaceRoot from 'nx/src/utils/workspace-root';
24
+ import { type ProviderInputProof } from './ensure-built-receipt.js';
25
+ interface NxRuntimeModules {
26
+ readonly 'nx/src/config/nx-json': typeof NxConfiguration;
27
+ readonly 'nx/src/daemon/client/client': typeof NxDaemonClient;
28
+ readonly 'nx/src/hasher/hash-task': typeof NxHashTask;
29
+ readonly 'nx/src/hasher/task-hasher': typeof NxTaskHasher;
30
+ readonly 'nx/src/native': typeof NxNative;
31
+ readonly 'nx/src/native/transform-objects': typeof NxTransformObjects;
32
+ readonly 'nx/src/project-graph/utils/find-project-for-path': typeof NxProjectRootMappings;
33
+ readonly 'nx/src/project-graph/project-graph': typeof NxProjectGraphRuntime;
34
+ readonly 'nx/src/utils/package-json': typeof NxPackageJson;
35
+ readonly 'nx/src/project-graph/plugins/tasks-execution-hooks': typeof NxExecutionHooks;
36
+ readonly 'nx/src/tasks-runner/cache': typeof NxCache;
37
+ readonly 'nx/src/tasks-runner/create-task-graph': typeof NxCreateTaskGraph;
38
+ readonly 'nx/src/tasks-runner/run-command': typeof NxRunCommand;
39
+ readonly 'nx/src/tasks-runner/task-env': typeof NxTaskEnv;
40
+ readonly 'nx/src/tasks-runner/utils': typeof NxTasksRunnerUtils;
41
+ readonly 'nx/src/utils/cache-directory': typeof NxCacheDirectory;
42
+ readonly 'nx/src/utils/command-line-utils': typeof NxCommandLineUtils;
43
+ readonly 'nx/src/utils/perf-logging': typeof NxPerfLogging;
44
+ readonly 'nx/src/utils/workspace-root': typeof NxWorkspaceRoot;
45
+ }
46
+ type WorkspaceNxRequire = <Specifier extends keyof NxRuntimeModules>(specifier: Specifier) => NxRuntimeModules[Specifier];
47
+ export declare function createWorkspaceNxRequire(workspaceRoot: string): WorkspaceNxRequire;
4
48
  /**
5
49
  * A `project:target` or `project:target:configuration` selector.
6
50
  *
@@ -115,6 +159,52 @@ export type EnsureBuiltOutputReceipt = {
115
159
  readonly entries: readonly string[];
116
160
  readonly sha256: string;
117
161
  };
162
+ export type EnsureBuiltProducerExpandedInputs = {
163
+ readonly [Key in keyof NxNative.HashInputs]: readonly NxNative.HashInputs[Key][number][];
164
+ };
165
+ export interface EnsureBuiltProducerFileInput {
166
+ readonly path: string;
167
+ readonly mode: number;
168
+ readonly gitBlob: string;
169
+ readonly sha256: string;
170
+ }
171
+ export interface EnsureBuiltProducerTaskInputs {
172
+ readonly taskId: string;
173
+ readonly overrides: Readonly<Task['overrides']>;
174
+ readonly declared: readonly NonNullable<NonNullable<ProjectGraphProjectNode['data']['targets']>[string]['inputs']>[number][];
175
+ readonly expanded: EnsureBuiltProducerExpandedInputs;
176
+ readonly hashDetails: Readonly<NxNative.TaskHashDetails>;
177
+ readonly files: readonly EnsureBuiltProducerFileInput[];
178
+ }
179
+ export interface EnsureBuiltProducerTool {
180
+ readonly kind: 'module' | 'executable';
181
+ readonly name: string;
182
+ readonly from: string;
183
+ readonly path: string;
184
+ readonly physicalPath: string;
185
+ readonly missing: readonly string[];
186
+ readonly resolutions: readonly {
187
+ readonly name: string;
188
+ readonly from: string;
189
+ readonly target: string | null;
190
+ }[];
191
+ /** Absolute node paths bind the physical closure, including package-owned build-volume aliases. */
192
+ readonly nodes: readonly EnsureBuiltOutputReceipt[];
193
+ readonly sha256: string;
194
+ }
195
+ export interface EnsureBuiltProducerReceipt {
196
+ readonly version: 1;
197
+ readonly target: string;
198
+ readonly argv: readonly string[];
199
+ readonly trackedTreeClean: true;
200
+ /** Declared runtime/environment identity from actual Nx completion hashes, never a consumer environment hash. */
201
+ readonly environmentIdentity: string;
202
+ readonly inputs: readonly EnsureBuiltProducerTaskInputs[];
203
+ readonly tools: readonly EnsureBuiltProducerTool[];
204
+ /** SHA-256 of the independently censused task/public-output records, never terminal output. */
205
+ readonly outputSha256: string;
206
+ readonly wallTimeMs: number;
207
+ }
118
208
  /** Git provenance covers file inputs only; runtime/env identity remains Nx's current task hash. */
119
209
  export interface EnsureBuiltReceipt {
120
210
  readonly workspaceRoot: string;
@@ -122,6 +212,7 @@ export interface EnsureBuiltReceipt {
122
212
  readonly headTree: string;
123
213
  readonly fileInputProvenance: 'exact-file-inputs' | 'conservative-provider-source';
124
214
  readonly runtimeEnvironmentProvenance: 'nx-task-hash-only';
215
+ readonly producer: EnsureBuiltProducerReceipt;
125
216
  readonly tasks: readonly {
126
217
  readonly id: string;
127
218
  readonly hash: string;
@@ -263,6 +354,12 @@ export declare function withoutOuterTaskCacheBypass(env: Readonly<NodeJS.Process
263
354
  * decides whether these current inputs have matching artifacts.
264
355
  */
265
356
  export declare function missBeforeProbe(env: Readonly<NodeJS.ProcessEnv>, taskId: string): MissReason | null;
357
+ /** Nx's native plan is the FILE selection oracle, not a second glob planner.
358
+ * Config identities skipped by the inspector are included explicitly. A
359
+ * runtime identity is bounded only by the owning toolchain recipe + a declared
360
+ * pin; opaque commands and unavailable native proof categorically refuse.
361
+ */
362
+ export declare function providerInputProof(workspaceRoot: string, nxJson: NxJsonConfiguration, projectGraph: ProjectGraph, taskGraph: TaskGraph, requireNx: WorkspaceNxRequire): ProviderInputProof;
266
363
  /** The id Nx gives the task `selector` names, and the one a miss runs. */
267
364
  export declare function selectorTaskId(selector: TargetSelector): string;
268
365
  /** How the files on disk differ from the daemon's file table, by workspace-relative path. */
@@ -339,4 +436,5 @@ export interface ChildExit {
339
436
  * would have exited with.
340
437
  */
341
438
  export declare function cliExitOutcome(reason: MissReason, exit: ChildExit, signalToCode: (signal: NodeJS.Signals | null) => number): EnsureBuiltResult;
439
+ export {};
342
440
  //# sourceMappingURL=ensure-built.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ensure-built.d.ts","sourceRoot":"","sources":["../src/ensure-built.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAA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AAgB,cAAc,CAC5B,MAAM,EAAE,UAAU,EAClB,IAAI,EAAE,SAAS,EACf,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,OAAO,GAAG,IAAI,KAAK,MAAM,GACtD,iBAAiB,CAQnB"}
@@ -4,10 +4,12 @@ import { closeSync, existsSync, lstatSync, openSync, readdirSync, readlinkSync,
4
4
  import { createRequire } from 'node:module';
5
5
  import { dirname, isAbsolute, join, resolve } from 'node:path';
6
6
  import { inspect } from 'node:util';
7
- import { boundedReceiptRuntimes, providerReceipt } from './ensure-built-receipt.js';
8
- import { graphInstallationIdentity, nodeStamp, nodesUnchanged, readArtifactWitness, readGraphWitness, reusableGraph, snapshotsEqual, workspaceSnapshot, writeWitness, } from './ensure-built-witness.js';
7
+ import { boundedReceiptRuntimes } from './ensure-built-receipt.js';
8
+ import { censusStart, graphInstallationIdentity, movedNodes, nodeStamp, nodesUnchanged, readArtifactWitness, readGraphWitness, recordedStamp, reusableGraph, snapshotsEqual, workspaceSnapshot, writeWitness, } from './ensure-built-witness.js';
9
+ import { graphInputContractIdentity } from './graph-input-contract.js';
9
10
  import { managedAssetsRoot } from './managed-assets.js';
10
- function createWorkspaceNxRequire(workspaceRoot) {
11
+ import { readProducerReceipt } from './producer-receipts.js';
12
+ export function createWorkspaceNxRequire(workspaceRoot) {
11
13
  const requireFromWorkspace = createRequire(join(workspaceRoot, 'package.json'));
12
14
  return function requireNx(specifier) {
13
15
  return requireFromWorkspace(specifier);
@@ -378,7 +380,7 @@ export function missBeforeProbe(env, taskId) {
378
380
  }
379
381
  return null;
380
382
  }
381
- async function prepareWorkspaceProbe(workspaceRoot, selector) {
383
+ async function prepareWorkspaceProbe(workspaceRoot, selector, forceGraphRpc = false) {
382
384
  const taskId = selectorTaskId(selector);
383
385
  // This explicit fallback path loads no Nx. The build operation may run the
384
386
  // checkout-local CLI; the read-only operation can only report the miss.
@@ -403,7 +405,7 @@ async function prepareWorkspaceProbe(workspaceRoot, selector) {
403
405
  const loadDotEnvFiles = process.env.NX_LOAD_DOT_ENV_FILES !== 'false';
404
406
  setEnvVarsBasedOnArgs(nxArgs, loadDotEnvFiles);
405
407
  performance.mark('ensureBuilt:graph:start');
406
- const projectGraph = await currentProjectGraph(workspaceRoot, nxJson, requireNx);
408
+ const projectGraph = await currentProjectGraph(workspaceRoot, nxJson, requireNx, forceGraphRpc);
407
409
  nxJson = readNxJson();
408
410
  requireProject(projectGraph, selector.project);
409
411
  const taskGraph = createTaskGraph(projectGraph, {}, [selector.project], [selector.target], selector.configuration, overrides, false);
@@ -450,55 +452,30 @@ async function buildPreparedTarget(workspaceRoot, selector, prepared) {
450
452
  return reason === null ? HIT : runViaCli(workspaceRoot, selector, reason);
451
453
  }
452
454
  async function probeBuiltInWorkspace(workspaceRoot, selector) {
453
- const prepared = await prepareWorkspaceProbe(workspaceRoot, selector);
454
- if (prepared.kind === 'no-daemon')
455
- return { disposition: 'miss', reason: prepared.reason };
456
- const probeSource = captureProbeSource(workspaceRoot, prepared.requireNx);
457
- return withTaskHooks(workspaceRoot, selector, prepared, async (root, selected, current) => {
458
- const { nxJson, nxArgs, projectGraph, taskGraph, tasks, requireNx } = current;
459
- const taskId = selectorTaskId(selected);
460
- performance.mark('ensureBuilt:probe:start');
461
- const reason = missBeforeProbe(process.env, taskId) ??
462
- (await probe(root, nxJson, nxArgs, projectGraph, taskGraph, tasks, requireNx, true));
463
- performance.measure('ensureBuilt:probe', 'ensureBuilt:probe:start');
464
- if (reason !== null)
465
- return { disposition: 'miss', reason };
466
- let result = providerReceipt(root, taskId, tasks, providerInputProof(root, nxJson, projectGraph, taskGraph, requireNx), requireNx('nx/src/native').expandOutputs);
467
- if (result.disposition === 'hit') {
468
- const after = captureProbeSource(root, requireNx);
469
- if (!snapshotsEqual(probeSource, after) || !nodesUnchanged(probeSource.nodes)) {
470
- result = {
471
- disposition: 'failed',
472
- reason: {
473
- kind: 'provider-proof',
474
- taskId,
475
- workspaceRoot: root,
476
- detail: 'Provider source nodes or membership moved across Nx hashing/receipt capture',
477
- },
478
- exitCode: 1,
479
- signal: null,
480
- };
481
- }
482
- }
483
- if (result.disposition === 'failed') {
484
- process.stderr.write(`probeBuilt: ${result.reason.workspaceRoot}: ${result.reason.detail}\n`);
485
- }
486
- return result;
487
- });
488
- }
489
- function captureProbeSource(workspaceRoot, requireNx) {
490
- const { WorkspaceContext } = requireNx('nx/src/native');
491
- const { workspaceDataDirectoryForWorkspace } = requireNx('nx/src/utils/cache-directory');
492
- const data = workspaceDataDirectoryForWorkspace(workspaceRoot);
493
- const previous = readGraphWitness(join(data, 'ensure-built-graph.json'));
494
- return workspaceSnapshot(workspaceRoot, new WorkspaceContext(workspaceRoot, data), previous?.snapshot);
455
+ const taskId = selectorTaskId(selector);
456
+ const receipt = readProducerReceipt(workspaceRoot, taskId);
457
+ if (receipt.ok)
458
+ return { disposition: 'hit', receipt: receipt.value };
459
+ // A failed publication proof asks Nx for the authoritative generation, but
460
+ // never hashes against the consumer environment or starts a provider runner.
461
+ const prepared = await prepareWorkspaceProbe(workspaceRoot, selector, true);
462
+ const detail = prepared.kind === 'no-daemon'
463
+ ? `${receipt.detail}; authoritative graph unavailable: ${describeMiss(prepared.reason)}`
464
+ : receipt.detail;
465
+ process.stderr.write(`probeBuilt: ${workspaceRoot}: ${taskId}: ${detail}\n`);
466
+ return {
467
+ disposition: 'failed',
468
+ reason: { kind: 'provider-proof', taskId, workspaceRoot, detail },
469
+ exitCode: 1,
470
+ signal: null,
471
+ };
495
472
  }
496
473
  /** Nx's native plan is the FILE selection oracle, not a second glob planner.
497
474
  * Config identities skipped by the inspector are included explicitly. A
498
475
  * runtime identity is bounded only by the owning toolchain recipe + a declared
499
476
  * pin; opaque commands and unavailable native proof categorically refuse.
500
477
  */
501
- function providerInputProof(workspaceRoot, nxJson, projectGraph, taskGraph, requireNx) {
478
+ export function providerInputProof(workspaceRoot, nxJson, projectGraph, taskGraph, requireNx) {
502
479
  const { WorkspaceContext, HashPlanInspector, HashPlanner, transferProjectGraph } = requireNx('nx/src/native');
503
480
  const { transformProjectGraphForRust } = requireNx('nx/src/native/transform-objects');
504
481
  const { createProjectRootMappings } = requireNx('nx/src/project-graph/utils/find-project-for-path');
@@ -536,6 +513,7 @@ function providerInputProof(workspaceRoot, nxJson, projectGraph, taskGraph, requ
536
513
  includeProject(dependency.target);
537
514
  }
538
515
  let conservative = false;
516
+ let hasRuntime = false;
539
517
  const projectConfigs = Object.fromEntries(Object.entries(projectGraph.nodes).map(([name, node]) => [name, node.data]));
540
518
  const { getCustomHasher } = requireNx('nx/src/tasks-runner/utils');
541
519
  for (const task of Object.values(taskGraph.tasks)) {
@@ -550,6 +528,7 @@ function providerInputProof(workspaceRoot, nxJson, projectGraph, taskGraph, requ
550
528
  }
551
529
  for (const file of input.files)
552
530
  files.add(file);
531
+ hasRuntime ||= input.runtime.length > 0;
553
532
  if (input.runtime.length > 0 || input.environment.length > 0)
554
533
  conservative = true;
555
534
  const node = projectGraph.nodes[task.target.project];
@@ -586,7 +565,9 @@ function providerInputProof(workspaceRoot, nxJson, projectGraph, taskGraph, requ
586
565
  if (existsSync(join(workspaceRoot, path)))
587
566
  files.add(path);
588
567
  }
589
- const installation = graphInstallationIdentity(workspaceRoot, nxJson, requireNx('nx/src/utils/package-json').readModulePackageJson);
568
+ const installation = hasRuntime
569
+ ? graphInstallationIdentity(workspaceRoot, nxJson, requireNx('nx/src/utils/package-json').readModulePackageJson, requireNx('nx/src/native').expandOutputs, graphInputContractIdentity(workspaceRoot, nxJson, workspaceSnapshot(workspaceRoot, new (requireNx('nx/src/native').WorkspaceContext)(workspaceRoot, requireNx('nx/src/utils/cache-directory').workspaceDataDirectoryForWorkspace(workspaceRoot)), undefined)))
570
+ : null;
590
571
  const runtimeSource = boundedReceiptRuntimes(inputs, [...directories], [...files], installation !== null);
591
572
  return {
592
573
  kind: conservative ? 'conservative-provider-source' : 'exact-file-inputs',
@@ -630,9 +611,9 @@ function bindWorkspaceRoot(workspaceRoot, requireNx) {
630
611
  * only when the filesystem and plugin installation stay identical across the
631
612
  * awaited authoritative generation. No disk-cache age or existence is proof.
632
613
  */
633
- async function currentProjectGraph(workspaceRoot, nxJson, requireNx) {
614
+ async function currentProjectGraph(workspaceRoot, nxJson, requireNx, forceGraphRpc) {
634
615
  const { daemonClient } = requireNx('nx/src/daemon/client/client');
635
- const { WorkspaceContext } = requireNx('nx/src/native');
616
+ const { WorkspaceContext, expandOutputs } = requireNx('nx/src/native');
636
617
  const { workspaceDataDirectoryForWorkspace } = requireNx('nx/src/utils/cache-directory');
637
618
  const packageResolution = requireNx('nx/src/utils/package-json');
638
619
  const data = workspaceDataDirectoryForWorkspace(workspaceRoot);
@@ -651,16 +632,18 @@ async function currentProjectGraph(workspaceRoot, nxJson, requireNx) {
651
632
  await daemonClient.updateWorkspaceContext(created, updated, deleted);
652
633
  }
653
634
  performance.measure('ensureBuilt:inputs', 'ensureBuilt:inputs:start');
654
- const installation = graphInstallationIdentity(workspaceRoot, nxJson, packageResolution.readModulePackageJson);
635
+ const installation = graphInstallationIdentity(workspaceRoot, nxJson, packageResolution.readModulePackageJson, expandOutputs, graphInputContractIdentity(workspaceRoot, nxJson, before));
655
636
  const cached = nodesUnchanged(before.nodes)
656
637
  ? reusableGraph(witness, workspaceRoot, environment, installation, before)
657
638
  : null;
658
- if (cached !== null)
639
+ if (!forceGraphRpc && cached !== null)
659
640
  return cached;
660
641
  const { projectGraph } = await daemonClient.getProjectGraphAndSourceMaps();
661
642
  const after = workspaceSnapshot(workspaceRoot, new WorkspaceContext(workspaceRoot, data), before);
662
- const finalInstallation = graphInstallationIdentity(workspaceRoot, nxJson, packageResolution.readModulePackageJson);
663
- const stableGeneration = snapshotsEqual(before, after) && nodesUnchanged(before.nodes);
643
+ const finalInstallation = graphInstallationIdentity(workspaceRoot, nxJson, packageResolution.readModulePackageJson, expandOutputs, graphInputContractIdentity(workspaceRoot, nxJson, after));
644
+ // `after` re-hashed every node whose stamp does not prove it (its ctime alone moved, or `before` read it in the tick
645
+ // it changed in), and snapshotsEqual compares those hashes.
646
+ const stableGeneration = snapshotsEqual(before, after) && movedNodes(before.nodes, () => true) === null;
664
647
  if (installation !== null && installation === finalInstallation && stableGeneration) {
665
648
  const next = { version: 1, workspaceRoot, environment, installation, snapshot: after, projectGraph };
666
649
  writeWitness(witnessPath, next);
@@ -844,6 +827,8 @@ export function compareWithArtifacts(workspaceRoot, claims, artifacts, expandOut
844
827
  throw error;
845
828
  }
846
829
  }
830
+ // Read before the comparison's first stat: a node it reads in the tick it changed in is recorded unproven.
831
+ const start = censusStart();
847
832
  const comparison = {
848
833
  expandOutputs,
849
834
  left: Buffer.allocUnsafe(COMPARE_CHUNK_BYTES),
@@ -865,7 +850,11 @@ export function compareWithArtifacts(workspaceRoot, claims, artifacts, expandOut
865
850
  version: 1,
866
851
  workspaceRoot,
867
852
  claims: binding,
868
- nodes: comparison.observed.map(({ taskId, path, stats }) => ({ taskId, path, stamp: nodeStamp(stats) })),
853
+ nodes: comparison.observed.map(({ taskId, path, stats }) => ({
854
+ taskId,
855
+ path,
856
+ stamp: recordedStamp(stats, start),
857
+ })),
869
858
  };
870
859
  writeWitness(witnessPath, next);
871
860
  }
@@ -16,6 +16,7 @@ export declare const CPU_POOL_ENV = "BOUNDED_EXEC_CPU_POOL";
16
16
  /** An inherited pool descriptor; only a grant from its endpoint proves a live allocation. */
17
17
  export interface InheritedCpuPool {
18
18
  readonly socket: string;
19
+ /** The count the parent names beside its endpoint: 0 for a resident's relay pool, which holds no token. */
19
20
  readonly tokens: number;
20
21
  }
21
22
  /** A running pool: the environment a child inherits to reach it, and how to close it. */
@@ -35,24 +36,38 @@ type CloseOutcome = {
35
36
  ok: false;
36
37
  error: string;
37
38
  };
39
+ /**
40
+ * The run's count of descendant work queued for host CPU tokens (specs/cowshed/05_gateway.md, "The bounds start at
41
+ * the grant"). A queued job is not an idle one: its owner stops the run's idle clock while any wait is held. Every
42
+ * pool of one run, its sub-pools included, reports to the same one.
43
+ */
44
+ export interface HostWaits {
45
+ begin(): void;
46
+ end(): void;
47
+ }
38
48
  /**
39
49
  * The inherited descriptor, or null when malformed or absent. A missing or bare count, or an empty
40
- * or NUL-bearing endpoint, proves no allocation. A valid descriptor still needs a live endpoint grant.
50
+ * or NUL-bearing endpoint, proves no allocation. A resident's relay pool names a count of 0 beside its
51
+ * endpoint: it holds no token for its lifetime and asks the host for each child that asks it, so zero is
52
+ * valid only with the endpoint, and every other count is a positive whole number. A valid descriptor still
53
+ * needs a live endpoint grant (specs/cowshed/05_gateway.md, "Host CPU budget", "A resident holds no token").
41
54
  */
42
55
  export declare function readInheritedCpuPool(environment: Readonly<NodeJS.ProcessEnv>): InheritedCpuPool | null;
43
56
  /**
44
- * Ask the immediate parent pool for `min(want, parent.tokens, ceil(cores / 2))` tokens. A granted
45
- * lease is the child's local allocation: its connection is the grant, and closing it returns only
57
+ * Ask the immediate parent pool for `want` tokens. Neither the inherited count nor the host's core count bounds the
58
+ * ask: a lent pool grants at most what it holds, and a gate's or a resident's relay pool asks the host for each
59
+ * child. A granted lease is the child's local allocation: its connection is the grant, and closing it returns only
46
60
  * that allocation. An absent endpoint allows normal host acquisition; a connected endpoint's refusal
47
61
  * or protocol failure must fail admission rather than taking a second grant above its parent.
48
62
  */
49
- export declare function takeParentCpuTokens(parent: InheritedCpuPool, want: number, cores: number): Promise<TokenGrant>;
63
+ export declare function takeParentCpuTokens(parent: InheritedCpuPool, want: number): Promise<TokenGrant>;
50
64
  /**
51
65
  * Make a pool of `tokens` that lives while `closed` does: when `closed` resolves the pool refuses
52
- * grants, ends its child connections and removes its directory. Setup failures are values; a
53
- * non-positive or unsafe count is a programmer bug and throws.
66
+ * grants, ends its child connections and removes its directory. A child's `host-wait` is reported
67
+ * to `waits` for as long as its connection holds it; a sub-pool reports to the same `waits`.
68
+ * Setup failures are values; a non-positive or unsafe count is a programmer bug and throws.
54
69
  */
55
- export declare function createCpuPool(tokens: number, closed: Promise<void>): Promise<{
70
+ export declare function createCpuPool(tokens: number, closed: Promise<void>, waits: HostWaits): Promise<{
56
71
  ok: true;
57
72
  pool: CpuPool;
58
73
  } | {
@@ -1 +1 @@
1
- {"version":3,"file":"cpu-pool.d.ts","sourceRoot":"","sources":["../../../src/executors/bounded-exec/cpu-pool.ts"],"names":[],"mappings":"AAKA,OAAO,EAAwC,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAGxF;;;;;;;;;;;GAWG;AAEH,yGAAyG;AACzG,eAAO,MAAM,YAAY,0BAA0B,CAAC;AAEpD,6FAA6F;AAC7F,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,yFAAyF;AACzF,MAAM,WAAW,OAAO;IACtB,0DAA0D;IAC1D,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7C;;;;OAIG;IACH,KAAK,IAAI,OAAO,CAAC,YAAY,CAAC,CAAC;CAChC;AAED,KAAK,YAAY,GAAG;IAAE,EAAE,EAAE,IAAI,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAoDhE;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,gBAAgB,GAAG,IAAI,CAOtG;AAED;;;;;GAKG;AACH,wBAAsB,mBAAmB,CAAC,MAAM,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAgCpH;AAED;;;;GAIG;AACH,wBAAsB,aAAa,CACjC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,GACpB,OAAO,CAAC;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,O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AAM,EACd,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,EACrB,KAAK,EAAE,SAAS,GACf,OAAO,CAAC;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,OAAO,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAiRrE"}
@@ -25,32 +25,45 @@ import { holdLease } from './gateway-lease.js';
25
25
  /** The environment name a child reads its parent's pool endpoint from; its count is `CPU_TOKENS_ENV`. */
26
26
  export const CPU_POOL_ENV = 'BOUNDED_EXEC_CPU_POOL';
27
27
  const parseRequest = (() => {
28
- const _io0 = input => "cpu-pool" === input.op && ("number" === typeof input.want && (_isTypeUint32_1._isTypeUint32(input.want) && 1 <= input.want)) && (undefined === input.children || "boolean" === typeof input.children);
29
- const __is = input => "object" === typeof input && null !== input && _io0(input);
28
+ const _io0 = input => "cpu-pool" === input.op && ("number" === typeof input.want && (_isTypeUint32_1._isTypeUint32(input.want) && 1 <= input.want)) && (undefined === input.children || "boolean" === typeof input.children) && (undefined === input.grow || "boolean" === typeof input.grow);
29
+ const _io1 = input => "host-wait" === input.op;
30
+ const _iu0 = input => (() => {
31
+ if ("cpu-pool" === input.op)
32
+ return _io0(input);
33
+ else if ("host-wait" === input.op)
34
+ return _io1(input);
35
+ else
36
+ return false;
37
+ })();
38
+ const __is = input => "object" === typeof input && null !== input && _iu0(input);
30
39
  return input => { input = JSON.parse(input); return __is(input) ? input : null; };
31
40
  })();
32
41
  const stringifyReply = (() => {
33
42
  const _ip0 = input => true === input["ok"];
34
43
  const _so0 = input => `{"ok":${String(input.ok)},"lease":${"\"" + input.lease + "\""}}`;
35
44
  const _so1 = input => `{${_jsonStringifyTail_1._jsonStringifyTail(`"ok":${String(input.ok)},"lease":${"\"" + input.lease + "\""},"tokens":${String(_jsonStringifyNumber_1._jsonStringifyNumber(input.tokens))},${undefined === input.pool ? "" : `"pool":${undefined !== input.pool ? _jsonStringifyString_1._jsonStringifyString(input.pool) : undefined}`}`)}}`;
36
- const _so2 = input => `{"ok":${String(input.ok)},"code":${"\"" + input.code + "\""},"error":${_jsonStringifyString_1._jsonStringifyString(input.error)}}`;
45
+ const _so2 = input => `{"ok":${String(input.ok)},"wait":${"\"" + input.wait + "\""}}`;
46
+ const _so3 = input => `{"ok":${String(input.ok)},"code":${"\"" + input.code + "\""},"error":${_jsonStringifyString_1._jsonStringifyString(input.error)}}`;
37
47
  const _su0 = input => (() => {
38
48
  if ("queued" === input.lease)
39
49
  return _so0(input);
40
50
  else if ("granted" === input.lease)
41
51
  return _so1(input);
42
- else if (false === input.ok)
52
+ else if (undefined !== input.wait)
43
53
  return _so2(input);
54
+ else if (false === input.ok)
55
+ return _so3(input);
44
56
  else
45
57
  _throwTypeGuardError_1._throwTypeGuardError({
46
58
  method: "typia.json.createStringify",
47
- expected: "({ ok: true; lease: \"queued\"; } | { ok: true; lease: \"granted\"; tokens: number; pool?: string | undefined; } | { ok: false; code: \"invalid-request\"; error: string; })",
59
+ expected: "({ ok: true; lease: \"queued\"; } | { ok: true; lease: \"granted\"; tokens: number; pool?: string | undefined; } | { ok: true; wait: \"held\"; } | { ok: false; code: \"invalid-request\"; error: string; })",
48
60
  value: input
49
61
  });
50
62
  })();
51
63
  const _io0 = input => _ip0(input) && "queued" === input.lease;
52
64
  const _io1 = input => _ip0(input) && "granted" === input.lease && "number" === typeof input.tokens && (undefined === input.pool || "string" === typeof input.pool);
53
- const _io2 = input => false === input.ok && "invalid-request" === input.code && "string" === typeof input.error;
65
+ const _io2 = input => _ip0(input) && "held" === input.wait;
66
+ const _io3 = input => false === input.ok && "invalid-request" === input.code && "string" === typeof input.error;
54
67
  return input => _su0(input);
55
68
  })();
56
69
  /** A request over this many bytes is refused as `invalid-request` (specs/cowshed/05_gateway.md, "Wire"). */
@@ -66,26 +79,31 @@ const CLOSED_WHILE_MADE = 'the grant that lends this CPU pool closed while the p
66
79
  const frame = (reply) => `${stringifyReply(reply)}\n`;
67
80
  /**
68
81
  * The inherited descriptor, or null when malformed or absent. A missing or bare count, or an empty
69
- * or NUL-bearing endpoint, proves no allocation. A valid descriptor still needs a live endpoint grant.
82
+ * or NUL-bearing endpoint, proves no allocation. A resident's relay pool names a count of 0 beside its
83
+ * endpoint: it holds no token for its lifetime and asks the host for each child that asks it, so zero is
84
+ * valid only with the endpoint, and every other count is a positive whole number. A valid descriptor still
85
+ * needs a live endpoint grant (specs/cowshed/05_gateway.md, "Host CPU budget", "A resident holds no token").
70
86
  */
71
87
  export function readInheritedCpuPool(environment) {
72
88
  const socket = environment[CPU_POOL_ENV];
73
- const tokens = parseInheritedTokens(environment[CPU_TOKENS_ENV]);
89
+ const count = environment[CPU_TOKENS_ENV];
90
+ // Zero is valid only as the literal 0 a relay pool names; any other count must be a positive safe integer.
91
+ const tokens = count === '0' ? 0 : parseInheritedTokens(count);
74
92
  if (socket === undefined || socket.length === 0 || socket.includes('\0') || tokens === null) {
75
93
  return null;
76
94
  }
77
95
  return { socket, tokens };
78
96
  }
79
97
  /**
80
- * Ask the immediate parent pool for `min(want, parent.tokens, ceil(cores / 2))` tokens. A granted
81
- * lease is the child's local allocation: its connection is the grant, and closing it returns only
98
+ * Ask the immediate parent pool for `want` tokens. Neither the inherited count nor the host's core count bounds the
99
+ * ask: a lent pool grants at most what it holds, and a gate's or a resident's relay pool asks the host for each
100
+ * child. A granted lease is the child's local allocation: its connection is the grant, and closing it returns only
82
101
  * that allocation. An absent endpoint allows normal host acquisition; a connected endpoint's refusal
83
102
  * or protocol failure must fail admission rather than taking a second grant above its parent.
84
103
  */
85
- export async function takeParentCpuTokens(parent, want, cores) {
86
- const ask = Math.min(want, parent.tokens, Math.ceil(cores / 2));
87
- if (!Number.isSafeInteger(ask) || ask < 1) {
88
- throw new RangeError(`a child asks its parent pool for a positive count, not ${ask} (want ${want}, pool ${parent.tokens}, cores ${cores})`);
104
+ export async function takeParentCpuTokens(parent, want) {
105
+ if (!Number.isSafeInteger(want) || want < 1) {
106
+ throw new RangeError(`a child asks its parent pool for a positive count, not ${want} (pool ${parent.tokens})`);
89
107
  }
90
108
  if (parent.socket.length === 0 || parent.socket.includes('\0')) {
91
109
  return {
@@ -94,7 +112,7 @@ export async function takeParentCpuTokens(parent, want, cores) {
94
112
  reason: `the parent CPU pool's endpoint ${JSON.stringify(parent.socket)} is not a socket path`,
95
113
  };
96
114
  }
97
- const lease = await holdLease(parent.socket, { op: 'cpu-pool', want: ask }, 'the parent CPU pool', {
115
+ const lease = await holdLease(parent.socket, { op: 'cpu-pool', want }, 'the parent CPU pool', {
98
116
  ackMs: 2_000,
99
117
  afterCloseMs: 5_000,
100
118
  grantMs: null,
@@ -103,22 +121,23 @@ export async function takeParentCpuTokens(parent, want, cores) {
103
121
  return lease;
104
122
  }
105
123
  const tokens = lease.answer.tokens;
106
- if (typeof tokens !== 'number' || !Number.isInteger(tokens) || tokens < 1 || tokens > ask) {
124
+ if (typeof tokens !== 'number' || !Number.isInteger(tokens) || tokens < 1 || tokens > want) {
107
125
  lease.release();
108
126
  return {
109
127
  granted: false,
110
128
  cause: 'other',
111
- reason: `the parent CPU pool granted ${JSON.stringify(tokens)} tokens for ${ask}`,
129
+ reason: `the parent CPU pool granted ${JSON.stringify(tokens)} tokens for ${want}`,
112
130
  };
113
131
  }
114
132
  return { granted: true, tokens, release: lease.release, closed: lease.closed, inherited: true };
115
133
  }
116
134
  /**
117
135
  * Make a pool of `tokens` that lives while `closed` does: when `closed` resolves the pool refuses
118
- * grants, ends its child connections and removes its directory. Setup failures are values; a
119
- * non-positive or unsafe count is a programmer bug and throws.
136
+ * grants, ends its child connections and removes its directory. A child's `host-wait` is reported
137
+ * to `waits` for as long as its connection holds it; a sub-pool reports to the same `waits`.
138
+ * Setup failures are values; a non-positive or unsafe count is a programmer bug and throws.
120
139
  */
121
- export async function createCpuPool(tokens, closed) {
140
+ export async function createCpuPool(tokens, closed, waits) {
122
141
  if (!Number.isSafeInteger(tokens) || tokens < 1) {
123
142
  throw new RangeError(`a CPU pool holds a positive safe integer of tokens, not ${tokens}`);
124
143
  }
@@ -173,7 +192,7 @@ export async function createCpuPool(tokens, closed) {
173
192
  else
174
193
  waiter.child.socket.once('close', done);
175
194
  });
176
- const creation = createCpuPool(granted, ended).then(async (made) => {
195
+ const creation = createCpuPool(granted, ended, waits).then(async (made) => {
177
196
  if (!made.ok) {
178
197
  failures.push(made.error);
179
198
  // Keep holding until close credits exactly this allocation once.
@@ -219,6 +238,9 @@ export async function createCpuPool(tokens, closed) {
219
238
  else if (child.phase.kind === 'holding') {
220
239
  free += child.phase.tokens;
221
240
  }
241
+ else if (child.phase.kind === 'waiting') {
242
+ waits.end();
243
+ }
222
244
  child.phase = { kind: 'done' };
223
245
  drain();
224
246
  });
@@ -273,7 +295,14 @@ export async function createCpuPool(tokens, closed) {
273
295
  request = null;
274
296
  }
275
297
  if (request === null) {
276
- refuse(child, 'a request is {"op":"cpu-pool","want":<a whole number of tokens, at least 1>}');
298
+ refuse(child, 'a request is {"op":"cpu-pool","want":<a whole number of tokens, at least 1>} or {"op":"host-wait"}');
299
+ return;
300
+ }
301
+ if (request.op === 'host-wait') {
302
+ // Counted from here until the connection closes, which `close` reports however it ends.
303
+ child.phase = { kind: 'waiting' };
304
+ waits.begin();
305
+ socket.write(frame({ ok: true, wait: 'held' }));
277
306
  return;
278
307
  }
279
308
  child.phase = { kind: 'queued' };
@@ -34,7 +34,15 @@ export interface ProcessTreeKiller {
34
34
  kill(pid: number, signal: NodeJS.Signals): Promise<void>;
35
35
  }
36
36
  /** Where the command's TMPDIR comes from; `null` leaves the inherited one. */
37
- export type TempVolume = Pick<RamTempVolume, 'acquire' | 'release' | 'fullness' | 'reap'>;
37
+ export type TempVolume = Pick<RamTempVolume, 'acquire' | 'release' | 'fullness' | 'space' | 'reap'>;
38
+ /**
39
+ * The cowshed a run's disk commands use, in precedence order: the target's named one, an
40
+ * explicit one inherited from the parent process, the installed one on PATH, and — only when
41
+ * PATH provides none — the launcher this workspace itself provides (its own cowshed package,
42
+ * or a linked one's bin). An environment with no cowshed anywhere keeps the bare name, so
43
+ * its spawn failure names the missing installed tool.
44
+ */
45
+ export declare function resolveCowshedExecutable(root: string, named: string | undefined, inherited: string | undefined, pathValue: string | undefined, cwd: string, exists?: (path: string) => boolean): string | undefined;
38
46
  export default function boundedExecExecutor(options: BoundedExecOptions, context: NxTaskContext): Promise<BoundedExecResult>;
39
47
  /** Runs with the normal process, RAM lease and CPU-budget owners, with an optional stdout sink. */
40
48
  export declare function runDefaultBoundedExec(options: BoundedExecOptions, context: BoundedExecContext): Promise<BoundedExecResult>;
@@ -50,8 +58,9 @@ export declare function recordContext(context: NxTaskContext): BoundedExecContex
50
58
  *
51
59
  * `inherited` is the parent's CPU pool (`cpu-pool.ts`) that lends this run its tokens. The run asks that pool first
52
60
  * and the host budget only when the pool refuses. Whatever it is granted, the run serves its own sub-pool to its
53
- * descendants, closed before the grant returns. A borrowed grant that closes while the command runs stops the command
54
- * as a lost grant, which is a failure.
61
+ * descendants, closed before the grant returns. A grant whose connection closes while the command runs (a gateway
62
+ * restart, or the lending parent's exit) ends its accounting, never the command: the command runs on over budget to
63
+ * its own exit, and the run says so.
55
64
  */
56
65
  export declare function runBoundedExec(options: BoundedExecOptions, context: BoundedExecContext, killer: ProcessTreeKiller, tempVolume: TempVolume | null, budget: CpuBudget | null, inherited?: InheritedCpuPool | null, captureDiagnostics?: typeof captureHangDiagnostics): Promise<BoundedExecResult>;
57
66
  export declare function createProcessTreeKiller(): ProcessTreeKiller;