@smoothbricks/nx-plugin 0.5.4 → 0.5.6

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 (48) hide show
  1. package/README.md +81 -16
  2. package/dist/ensure-built-receipt.d.ts +2 -2
  3. package/dist/ensure-built-receipt.d.ts.map +1 -1
  4. package/dist/ensure-built-receipt.js +7 -2
  5. package/dist/ensure-built-witness.d.ts +12 -1
  6. package/dist/ensure-built-witness.d.ts.map +1 -1
  7. package/dist/ensure-built-witness.js +32 -0
  8. package/dist/ensure-built.d.ts +2 -2
  9. package/dist/ensure-built.d.ts.map +1 -1
  10. package/dist/ensure-built.js +27 -5
  11. package/dist/executors/bounded-exec/executor.d.ts.map +1 -1
  12. package/dist/executors/bounded-exec/executor.js +48 -11
  13. package/dist/executors/bounded-exec/progress.d.ts +1 -3
  14. package/dist/executors/bounded-exec/progress.d.ts.map +1 -1
  15. package/dist/executors/bounded-exec/progress.js +1 -2
  16. package/dist/executors/bounded-exec/runner-hook.d.ts +2 -0
  17. package/dist/executors/bounded-exec/runner-hook.d.ts.map +1 -0
  18. package/dist/executors/bounded-exec/runner-hook.js +301 -0
  19. package/dist/executors/bounded-exec/runner-lifecycle.d.ts +18 -0
  20. package/dist/executors/bounded-exec/runner-lifecycle.d.ts.map +1 -0
  21. package/dist/executors/bounded-exec/runner-lifecycle.js +92 -0
  22. package/dist/producer-receipts.d.ts +24 -1
  23. package/dist/producer-receipts.d.ts.map +1 -1
  24. package/dist/producer-receipts.js +91 -60
  25. package/dist/runtime-input-policy.d.ts +60 -0
  26. package/dist/runtime-input-policy.d.ts.map +1 -0
  27. package/dist/runtime-input-policy.js +379 -0
  28. package/managed/raw/git-format-staged.yml +16 -3
  29. package/managed/raw/patches/nx@23.2.1.patch +397 -33
  30. package/package.json +7 -2
  31. package/src/ensure-built-receipt.ts +8 -2
  32. package/src/ensure-built-witness.ts +29 -1
  33. package/src/ensure-built.ts +39 -7
  34. package/src/executors/bounded-exec/cargo-progress-host.test.ts +332 -0
  35. package/src/executors/bounded-exec/executor.test.ts +89 -42
  36. package/src/executors/bounded-exec/executor.ts +45 -11
  37. package/src/executors/bounded-exec/progress.test.ts +1 -14
  38. package/src/executors/bounded-exec/progress.ts +2 -5
  39. package/src/executors/bounded-exec/runner-hook.test.ts +193 -0
  40. package/src/executors/bounded-exec/runner-hook.ts +292 -0
  41. package/src/executors/bounded-exec/runner-lifecycle.test.ts +82 -0
  42. package/src/executors/bounded-exec/runner-lifecycle.ts +102 -0
  43. package/src/nx-daemon-start-never.test.ts +137 -0
  44. package/src/producer-receipts.test.ts +99 -0
  45. package/src/producer-receipts.ts +111 -58
  46. package/src/runtime-input-policy.ts +395 -0
  47. package/src/runtime-input.test.ts +160 -3
  48. package/test-timings.json +4 -0
package/README.md CHANGED
@@ -315,6 +315,10 @@ The reliable diagnostic after a daemon or headless gate's decoder error is:
315
315
  cat .runtime-input-failures/*/report
316
316
  ```
317
317
 
318
+ `smoo github-ci nx-smart`, `nx-run-many` and `nx-deploy` print every report retained during a failed Nx run
319
+ (`runtimeInputFailureReports(root, sinceMs)`, `@smoothbricks/nx-plugin/runtime-input-policy`), so a CI log names the
320
+ command and its cause beside Nx's decoder error, which names neither.
321
+
318
322
  Each readable `report` names the command, its indexed arguments, working directory, exit status and original stderr.
319
323
  `argv` retains the exact NUL-delimited argument vector (including empty arguments), `stderr` retains the original bytes
320
324
  (including trailing newlines), and `exit-status` retains the decimal status. The wrapper also attempts a stderr summary
@@ -329,6 +333,26 @@ evidence path, timestamp or diagnostic enters a successful key. `runtime-input.t
329
333
  its hash with the previous success path, and plants a failure through real Nx (daemon and daemonless) to prove both
330
334
  refusal and retained evidence.
331
335
 
336
+ A runtime input runs only programs the workspace declares: devenv's Nix profile, the checkout's `node_modules/.bin` and
337
+ its own scripts. Nx hashes on a developer's Mac, on a NixOS CI runner and inside cowshed's sandbox, and only those are
338
+ the same in all three. A program the host's operating system ships is not: `shasum` is a Perl script that macOS ships in
339
+ `/usr/bin`, not coreutils, and no devenv profile provides it, so an input that named it hashed on every Mac and exited
340
+ 127 on a NixOS runner. Hash a file with Bun, as the plugin's own file inputs do (`Bun.CryptoHasher`); devenv's coreutils
341
+ provide `sha256sum` where a pipeline needs one. The only host paths admitted are `/bin/sh` and `/usr/bin/env`, which
342
+ NixOS keeps too. `@smoothbricks/nx-plugin/runtime-input-policy` exports `hostPrograms(command, { path, root, home })`:
343
+ each program the command runs (through the wrapper, `env`, `exec`, `command`, `sh -c` and command substitutions; a
344
+ script file it runs is that script's own concern) that PATH finds outside `/nix`, the checkout and the home, that
345
+ nothing on PATH provides, or that only a link in the checkout's `node_modules/.bin` to a build output of one of its own
346
+ packages provides. Bun links a workspace package's bin only when its target exists at install time, and a fresh checkout
347
+ installs before it builds, so such a name is absent on a fresh runner and present in every checkout that built first;
348
+ run the file instead (`node node_modules/@smoothbricks/nx-plugin/dist/bin/smoo-nx-cargo-hash.js`, as the plugin's own
349
+ Cargo input does). A consumer's installed package ships its build, so its bins are not refused. Each refusal is a tagged
350
+ `HostProgram`, and `hostProgramReason` says it. `runtime-input.test.ts` judges this repository's declared inputs on
351
+ `tooling/direnv/repo-path --print`, the PATH entries the devenv shell and CI give Nx (which hands a runtime input its
352
+ own environment): the devenv profile and the checkout's directories, with no `/usr/bin` or `/bin`, so a program only the
353
+ host provides fails on macOS as it does on the NixOS runner. A consumer judges its own declarations with the same
354
+ export.
355
+
332
356
  An input that runs inside a cowshed workspace's sandboxed daemon gets the client's environment, a host shell's `HOME`
333
357
  included, but not the client's filesystem view (cowshed `04_sandbox.md`). An input that reads the operator's home fails
334
358
  there, so a runtime input reads only the checkout and its declared environment. A `git` command in one sets
@@ -583,11 +607,13 @@ A test pays its setup once and asserts after each step; two cases that test one
583
607
  repositories enforce this in their root Nx lint with the `smoo-nx-test-walks` bin. The bin judges only pairs with a case
584
608
  changed since the upstream merge base. Among those pairs it reports each case's nearest refusing partner and its nearest
585
609
  advisory partner separately, so an advisory pair never hides a refusal. Existing pairs therefore need no allowance
586
- table. `smoo-nx-test-walks --base` prints that base for the target's runtime input, because the verdict depends on it
587
- and no file hash names it. `upstreamBase` picks the upstream in this order: `NX_BASE` (refused when it names no commit),
588
- `refs/remotes/main/main`, the local main's upstream branch, `refs/remotes/origin/main`, then `main`.
589
- `findDuplicateScenarios(root, files, changes)`, `formatDuplicateScenario`, `diffScope` and `upstreamBase` are exported
590
- from `@smoothbricks/nx-plugin/test-walk-policy`, and git failures come back as `GitAnswer` values.
610
+ table. The verdict depends on that base and no file hash names it, so the plugin resolves it as a run precondition
611
+ before Nx hashes any task (`assertUpstreamBasePrecondition`, from its pre-tasks hook): a checkout without a main ref
612
+ refuses the run with the check's own reason rather than carrying the base through a runtime input. `upstreamBase` picks
613
+ the upstream in this order: `NX_BASE` (refused when it names no commit), `refs/remotes/main/main`, the local main's
614
+ upstream branch, `refs/remotes/origin/main`, then `main`. `findDuplicateScenarios(root, files, changes)`,
615
+ `formatDuplicateScenario`, `diffScope` and `upstreamBase` are exported from `@smoothbricks/nx-plugin/test-walk-policy`,
616
+ and git failures come back as `GitAnswer` values.
591
617
 
592
618
  The policy reads bun:test `test`/`it` cases in test files and `#[test]`-family fns in any Rust file. A body that is one
593
619
  wrapper call, `await withHarness(memoryBackend, async (h) => { … })` or `runtime().block_on(async { … })`, walks the
@@ -984,6 +1010,23 @@ npm nodes of its project's dependency closure) are Nx's lockfile identities: the
984
1010
  `bun.lock` bind them, and no installed closure is resolved for them, since under Bun's isolated linker most of them do
985
1011
  not resolve from the task's project.
986
1012
 
1013
+ The pre-task hook stats every node of that installed closure on every run, and that is what lets it skip reading bytes.
1014
+ The census is a function of the nodes' stamps (device, inode, mode, size, and mtime and ctime in nanoseconds), not of
1015
+ the moment it runs: the hook records the census it took in Nx's workspace-data (`producer-installation-census.json`, a
1016
+ hash source, never a proof), and the next run takes the hash of every file whose stamp has not moved and that the record
1017
+ did not read in the tick it changed in. An unchanged closure reads no file bytes; a developer-linked package whose
1018
+ `dist` a rebuild rewrites in place, with no lockfile or `node_modules` change, moves those files' ctimes and they are
1019
+ read again. No cheaper generation (a lockfile, a manifest, an install marker) keys it, since such a rebuild moves none
1020
+ of those. The tool's nodes take the hash the census read instead of reading each file a second time: a write landing
1021
+ between two reads could make them disagree. Nor does the census take a stat pass of its own to prove itself: the tool's
1022
+ nodes stat each of its nodes again, a file whose stamp moved since the census read it is read again, and the capture's
1023
+ stability check refuses a tool node that moves before publication. For a consumer that links this plugin from a checkout
1024
+ (about 28,000 closure nodes) the hook took 9-17 s of synchronous I/O on the plugin worker before, with every file read
1025
+ twice, and 6-9 s after, almost all of it stats; on a host whose disk-image layer is saturated the reads ran for minutes,
1026
+ while the worker's event loop could neither answer Nx nor reap its exited children. The hook's phases are performance
1027
+ measures (`producerReceipts:graph`, `producerReceipts:source`, `producerReceipts:tools`, `producerReceipts:census`),
1028
+ which Nx reports under `NX_PERF_LOGGING=true`.
1029
+
987
1030
  Validity compares the committed tree, not the current HEAD spelling. An empty commit with an identical tree keeps the
988
1031
  receipt valid and its original basis SHA unchanged; the consumer never rewrites that provenance. A genuinely changed
989
1032
  tree invalidates the receipt. Multi-target consumers require one tree and retain each producer's actual basis.
@@ -1337,13 +1380,31 @@ waits for the event it is waiting for, however long a loaded host makes the work
1337
1380
  the run through `idleTimeoutMs`. `timeoutMs`, an absolute ceiling, is for commands that report no tests; a target names
1338
1381
  at least one of the two.
1339
1382
 
1340
- Direct `go test` invocations, including sequential `&&`, `||`, and `;` chains, are requested with `-json`. Go emits a
1341
- package's `Action:start` only after its build dependencies settle; a package terminal (`pass`, `fail`, or `skip`) ends
1342
- that execution interval. The unchanged idle bound runs while any package is executing, re-arms on test/package
1343
- completion, and stops when none is executing. Initial linking and inter-package compilation therefore spend no test idle
1344
- budget, while a stuck test or `TestMain` still expires after 180 s without a completion. `output`, `build-output`,
1345
- pause/continue events, and arbitrary compiler activity are not progress. Mixed runner commands and unknown wrappers keep
1346
- the existing spawn-based clock; Bun and Rust fixture compilation inside an active test gets no exemption.
1383
+ On POSIX hosts, direct Go and Cargo test commands (including chains joined by `&&`, `||`, or `;`) share one private
1384
+ runner lifecycle: `build`, `active`, and `terminal`. A per-command Node supervisor reports phases over an acknowledged
1385
+ descriptor that its actual tool child and nested fixtures do not inherit. Shell/supervisor startup is bounded; the tool
1386
+ starts only after its build phase is accepted, and native lifecycle-bearing stdout is forwarded only after its phase
1387
+ owns the clock. A malformed or prematurely closed lifecycle channel fails the run rather than silently disabling the
1388
+ watchdog.
1389
+
1390
+ | Runner | Authoritative end of build | End of active execution |
1391
+ | --------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
1392
+ | Go (`go test -json`) | Native package `Action:start`, after that package's build dependencies | Native package `pass`, `fail`, or `skip`; the clock runs while any package executes |
1393
+ | Cargo (`cargo test --message-format=json-render-diagnostics`) | Native `build-finished`, after `compile_tests` and before `run_unit_tests` | The owned Cargo child's close **and drained output**, never a libtest summary; custom harnesses, doctests, and teardown remain bounded |
1394
+ | Bun | No separate authoritative build event; active from command spawn | Command exit |
1395
+ | Unknown shell wrappers, mixed unsupported commands, and nextest | No inferred build exemption; active from command spawn | Command exit |
1396
+
1397
+ The unchanged 180 s interval re-arms on finished tests/packages. Initial Go linking, inter-package Go compilation, and
1398
+ initial or inter-command Cargo compilation spend no test idle budget. **Compiler-process activity is deliberately not a
1399
+ signal:** Go linking and Rust compilation before execution are build work; Bun's cold-compiler fixture (and a Rust test
1400
+ compiling a fixture) is active-test work and must still expire. Build output and heartbeats never reset the bound. Cargo
1401
+ uses its native build declaration without replacing configured target runners; a nested `test result` or
1402
+ `build-finished` line cannot retire the owned process or exempt its teardown. Absolute `timeoutMs`, when supplied, is
1403
+ unchanged.
1404
+
1405
+ Separately building test binaries and then executing them under the unchanged bound is a **workaround** for callers
1406
+ without a native lifecycle hook, not evidence that their combined cold-build command is safe. Direct Go/Cargo commands
1407
+ use the lifecycle channel instead; unknown wrappers retain conservative spawn accounting.
1347
1408
 
1348
1409
  Process-group timeout fixtures retain cleanup authority only until the command leader exits and every descendant closes
1349
1410
  its inherited lifetime FIFO. EOF is the terminal ownership event; a later `afterEach` must not signal the retired PGID
@@ -1361,6 +1422,10 @@ The final-five-second pre-signal snapshot attributes the runner's process tree a
1361
1422
  incomplete/raced results and no delay to termination. Its timing, visibility and evidence contract is defined in
1362
1423
  `specs/cowshed/08_testing.md`, "Integration tests (real substrate)".
1363
1424
 
1425
+ The snapshot-reset regression orders capture, test completion, and expiry through IPC, not heartbeat cadence. It
1426
+ deliberately holds the first capture's progress publication while another heartbeat arrives; only the observed PASS
1427
+ advances the next capture interval. Its 10 s virtual idle bound remains unchanged.
1428
+
1364
1429
  On a macOS host, every `bounded-exec` task runs with its own `TMPDIR` lease: a directory on one RAM-backed APFS volume
1365
1430
  per user, so test temp files never reach the SSD. The volume is created lazily by the first task that needs it and
1366
1431
  detached when the last live lease ends, since its pages return only on detach. It is a legacy DiskImages RAM disk, so it
@@ -1570,10 +1635,10 @@ task id and the hash it ran at:
1570
1635
  `type="test abort"`, `process aborted with signal 15 (SIGTERM)` (SIGKILL once the force-kill follows); they are the
1571
1636
  bound's casualties and do not make the run `failed`. A test that dies of any other signal, or that is aborted with no
1572
1637
  bound to explain it, does.
1573
- - `wedged`: `idleTimeoutMs` fired: no test finished for that long. A host that is only slow still finishes tests, so
1574
- this is a hang, never load. Its `tests` name the tests still running: those the runner said were running (nextest's
1575
- `SLOW`, libtest's `has been running for over`) and never said finished, and those the JUnit report says it aborted
1576
- when the bound stopped it.
1638
+ - `wedged`: `idleTimeoutMs` fired: no test finished during that much active test time. This proves the completion
1639
+ interval was exceeded, not that every process stopped: an oversized fixture can exceed it too. Its `tests` name those
1640
+ the runner reported running (nextest's `SLOW`, libtest's `has been running for over`) and never finished, and those
1641
+ the JUnit report says it aborted when the bound stopped it.
1577
1642
  - `no-space`: the command failed after its output said a write found no space (`ENOSPC` or `No space left on device`).
1578
1643
  Its tests failed on the disk, not on their own, whatever bound or hang followed: it records that line and, when the
1579
1644
  task held a RAM lease, the lease, the volume and its free bytes when the line arrived. A passing run that printed such
@@ -1,7 +1,7 @@
1
1
  import type { Task } from 'nx/src/config/task-graph';
2
2
  import type { expandOutputs, HashInputs } from 'nx/src/native';
3
3
  import type { EnsureBuiltOutputReceipt, EnsureBuiltProbeFailure, EnsureBuiltProducerFileInput, EnsureBuiltProducerReceipt, EnsureBuiltReceipt } from './ensure-built.js';
4
- import { type NodeWitness } from './ensure-built-witness.js';
4
+ import { type NodeWitness, type StampFields } from './ensure-built-witness.js';
5
5
  export type ReceiptEvidence<T> = {
6
6
  readonly ok: true;
7
7
  readonly value: T;
@@ -44,7 +44,7 @@ export declare function dirtyProviderPaths(status: string): string[];
44
44
  export declare function receiptNode(path: string, name: string, census?: {
45
45
  readonly start: bigint;
46
46
  readonly observed: NodeWitness[];
47
- }): EnsureBuiltOutputReceipt;
47
+ }, recorded?: (path: string, stats: StampFields) => string | undefined): EnsureBuiltOutputReceipt;
48
48
  /** Capture every tracked source byte at pre. Unrelated untracked files are not source basis. */
49
49
  export declare function captureProducerSource(root: string, outputs: readonly string[]): ReceiptEvidence<ProducerSourceWitness>;
50
50
  export declare function producerSourceUnchanged(root: string, before: ProducerSourceWitness): ReceiptEvidence<true>;
@@ -1 +1 @@
1
- {"version":3,"file":"ensure-built-receipt.d.ts","sourceRoot":"","sources":["../src/ensure-built-receipt.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE/D,OAAO,KAAK,EACV,wBAAwB,EACxB,uBAAuB,EACvB,4BAA4B,EAC5B,0BAA0B,EAC1B,kBAAkB,EACnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAA2B,KAAK,WAAW,EAAiB,MAAM,2BAA2B,CAAC;AAErG,MAAM,MAAM,eAAe,CAAC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AA0B,EAAE,cAAc,CAAC,GACzD;IAAE,QAAQ,CAAC,WAAW,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,kBAAkB,CAAA;CAAE,GAAG,uBAAuB,CAyFjG;AACD,8FAA8F;AAC9F,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,EAC5C,WAAW,EAAE,SAAS,MAAM,EAAE,EAC9B,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,kBAAkB,EAAE,OAAO,GAC1B,kBAAkB,CAAC,eAAe,CAAC,CAqBrC"}
@@ -112,12 +112,17 @@ function sourceFileDigests(path, size, algorithm) {
112
112
  * One independently read node; absolute paths also serve tool/package closures. A census records the node's stamp as
113
113
  * of its `start` (recordedStamp); a re-read against a record records none.
114
114
  */
115
- export function receiptNode(path, name, census) {
115
+ export function receiptNode(path, name, census, recorded) {
116
116
  const stats = lstatSync(path, { bigint: true });
117
117
  census?.observed.push({ path, stamp: recordedStamp(stats, census.start) });
118
118
  const mode = Number(stats.mode & 4095n);
119
119
  if (stats.isFile())
120
- return { path: name, type: 'file', mode, sha256: hashFile(path, Number(stats.size), ['sha256'], false)[0] };
120
+ return {
121
+ path: name,
122
+ type: 'file',
123
+ mode,
124
+ sha256: recorded?.(path, stats) ?? hashFile(path, Number(stats.size), ['sha256'], false)[0],
125
+ };
121
126
  if (stats.isSymbolicLink())
122
127
  return { path: name, type: 'symlink', mode, linkText: readlinkSync(path) };
123
128
  if (stats.isDirectory()) {
@@ -63,7 +63,7 @@ export interface GraphWitness {
63
63
  }
64
64
  /** An absent, unreadable or malformed optional witness never authorizes reuse. */
65
65
  export declare function readGraphWitness(path: string): GraphWitness | null;
66
- export declare function writeWitness(path: string, value: GraphWitness | ArtifactWitness): void;
66
+ export declare function writeWitness(path: string, value: GraphWitness | ArtifactWitness | GraphInstallationCensus): void;
67
67
  /** Capture exact node identity and rehash new/replaced/rewritten nodes.
68
68
  * Nx's Unix archive uses whole-second mtimes, so allFileData alone cannot
69
69
  * prove an immediate same-second rewrite. An unbound archive hash is never
@@ -113,6 +113,17 @@ export declare function installationIdentityOf({ resolutions, nodes, files }: Gr
113
113
  * one that does not parse: a hash source for {@link graphInstallationCensus}, never a proof.
114
114
  */
115
115
  export declare function recordedInstallationCensus(identity: string, unproven: readonly string[]): GraphInstallationCensus | undefined;
116
+ /** The census a caller recorded at `path`, `unproven` included: a hash source for {@link graphInstallationCensus}, never a
117
+ * proof. An absent, unreadable or malformed record is no hash source, and the next census reads every file.
118
+ */
119
+ export declare function readInstallationCensus(path: string): GraphInstallationCensus | undefined;
120
+ /**
121
+ * The hash `census` read of the file at `path`, while `stats` is the stamp it read the file at and it did not read the
122
+ * file in the tick it changed in ({@link unproven}); otherwise `undefined`, and the caller reads the bytes. A second
123
+ * reader of a file the census holds takes this instead of reading it again: a write landing between two reads could
124
+ * make them disagree, and a write since the census moves the stamp, so it is read again.
125
+ */
126
+ export declare function censusFileHashes(census: GraphInstallationCensus): (path: string, stats: StampFields) => string | undefined;
116
127
  /**
117
128
  * A {@link graphInstallationCensus} that no node moved during: every node is read again after the census, and one
118
129
  * whose stamp moved fails it, unless only its ctime moved and its bytes are the ones hashed. `previous` is what the
@@ -1 +1 @@
1
- {"version":3,"file":"ensure-built-witness.d.ts","sourceRoot":"","sources":["../src/ensure-built-witness.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAe3C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,KAAK,EAAe,qCAAqC,EAAE,MAAM,2BAA2B,CAAC;AAEpG,OAAO,KAAK,EAAE,uBAAuB,E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BAAuB,GACjC,uBAAuB,GAAG,IAAI,CAgChC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,uBAAuB,CACrC,aAAa,EAAE,MAAM,EACrB,MAAM,EAAE,mBAAmB,EAC3B,cAAc,EAAE,OAAO,qCAAqC,EAC5D,MAAM,EAAE,OAAO,aAAa,EAC5B,WAAW,EAAE,uBAAuB,GAAG,IAAI,EAC3C,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,EACrC,QAAQ,CAAC,EAAE,uBAAuB,GACjC,uBAAuB,GAAG,IAAI,CAoLhC;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;IACpB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC,WAAW,GAAG;QAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE,CAAC;CACxE;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI,CAOxE"}
@@ -423,6 +423,38 @@ export function recordedInstallationCensus(identity, unproven) {
423
423
  throw error;
424
424
  }
425
425
  }
426
+ /** The census a caller recorded at `path`, `unproven` included: a hash source for {@link graphInstallationCensus}, never a
427
+ * proof. An absent, unreadable or malformed record is no hash source, and the next census reads every file.
428
+ */
429
+ export function readInstallationCensus(path) {
430
+ try {
431
+ return (() => {
432
+ const _ip0 = input => "string" === typeof input["path"];
433
+ const _io0 = input => 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]))) && (Array.isArray(input.nodes) && input.nodes.every(elem => "object" === typeof elem && null !== elem && _io1(elem))) && (Array.isArray(input.files) && input.files.every(elem => "object" === typeof elem && null !== elem && _io2(elem))) && (Array.isArray(input.unproven) && input.unproven.every(elem => "string" === typeof elem));
434
+ const _io1 = input => _ip0(input) && "string" === typeof input.stamp;
435
+ const _io2 = input => _ip0(input) && "string" === typeof input.sha256;
436
+ const __is = input => "object" === typeof input && null !== input && _io0(input);
437
+ return input => { input = JSON.parse(input); return __is(input) ? input : null; };
438
+ })()(readFileSync(path, 'utf8')) ?? undefined;
439
+ }
440
+ catch (error) {
441
+ if (error instanceof SyntaxError || systemError(error))
442
+ return undefined;
443
+ throw error;
444
+ }
445
+ }
446
+ /**
447
+ * The hash `census` read of the file at `path`, while `stats` is the stamp it read the file at and it did not read the
448
+ * file in the tick it changed in ({@link unproven}); otherwise `undefined`, and the caller reads the bytes. A second
449
+ * reader of a file the census holds takes this instead of reading it again: a write landing between two reads could
450
+ * make them disagree, and a write since the census moves the stamp, so it is read again.
451
+ */
452
+ export function censusFileHashes(census) {
453
+ const unprovenFiles = new Set(census.unproven);
454
+ const stamps = new Map(census.nodes.map(({ path, stamp }) => [path, stamp]));
455
+ const hashes = new Map(census.files.map(({ path, sha256 }) => [path, sha256]));
456
+ return (path, stats) => unprovenFiles.has(path) || stamps.get(path) !== nodeStamp(stats) ? undefined : hashes.get(path);
457
+ }
426
458
  /**
427
459
  * A {@link graphInstallationCensus} that no node moved during: every node is read again after the census, and one
428
460
  * whose stamp moved fails it, unless only its ctime moved and its bytes are the ones hashed. `previous` is what the
@@ -4,8 +4,8 @@ import type { NxJsonConfiguration } from 'nx/src/config/nx-json';
4
4
  import type { ProjectGraph, ProjectGraphProjectNode } from 'nx/src/config/project-graph';
5
5
  import type { Task, TaskGraph } from 'nx/src/config/task-graph';
6
6
  import type * as NxDaemonClient from 'nx/src/daemon/client/client';
7
+ import type * as NxCreateTaskHasher from 'nx/src/hasher/create-task-hasher';
7
8
  import type * as NxHashTask from 'nx/src/hasher/hash-task';
8
- import type * as NxTaskHasher from 'nx/src/hasher/task-hasher';
9
9
  import type * as NxNative from 'nx/src/native';
10
10
  import type * as NxTransformObjects from 'nx/src/native/transform-objects';
11
11
  import type * as NxExecutionHooks from 'nx/src/project-graph/plugins/tasks-execution-hooks';
@@ -26,7 +26,7 @@ interface NxRuntimeModules {
26
26
  readonly 'nx/src/config/nx-json': typeof NxConfiguration;
27
27
  readonly 'nx/src/daemon/client/client': typeof NxDaemonClient;
28
28
  readonly 'nx/src/hasher/hash-task': typeof NxHashTask;
29
- readonly 'nx/src/hasher/task-hasher': typeof NxTaskHasher;
29
+ readonly 'nx/src/hasher/create-task-hasher': typeof NxCreateTaskHasher;
30
30
  readonly 'nx/src/native': typeof NxNative;
31
31
  readonly 'nx/src/native/transform-objects': typeof NxTransformObjects;
32
32
  readonly 'nx/src/project-graph/utils/find-project-for-path': typeof NxProjectRootMappings;
@@ -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,SAAS,CAAC;AAe3C,OAAO,KAAK,KAAK,eAAe,MAAM,uBAAuB,CAAC;AAC9D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACzF,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,KAAK,KAAK,cAAc,MAAM,6BAA6B,CAAC;AACnE,OAAO,KAAK,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,KAAK,YAAY,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAK,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC/C,OAAO,KAAK,KAAK,kBAAkB,MAAM,iCAAiC,CAAC;AAC3E,OAAO,KAAK,KAAK,gBAAgB,MAAM,oDAAoD,CAAC;AAC5F,OAAO,KAAK,KAAK,qBAAqB,MAAM,oCAAoC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AQ,CAAC,KAAK,EAAE,WAAW,CAAC;CAC7B;AAkJD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,SAAS,YAAY,EAAE,GAAG,MAAM,GAAG,IAAI,CAwBhF;AA6DD,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC;CACxC;AAED;;;;;;;;GAQG;AACH,wBAAgB,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"}
@@ -441,8 +441,28 @@ async function withTaskHooks(workspaceRoot, selector, prepared, operation) {
441
441
  });
442
442
  return result;
443
443
  }
444
+ /**
445
+ * `work`, or `withoutDaemon` when the daemon it was using stopped under a client
446
+ * that may never start one (NX_DAEMON_START=never): the patched client's error
447
+ * carries `daemonStartForbidden`, and has already turned the daemon off for
448
+ * this process. The probe then answers as it does without a daemon.
449
+ */
450
+ async function orNoDaemon(work, withoutDaemon) {
451
+ try {
452
+ return await work();
453
+ }
454
+ catch (error) {
455
+ if (error instanceof Error && 'daemonStartForbidden' in error && error.daemonStartForbidden === true) {
456
+ return withoutDaemon();
457
+ }
458
+ throw error;
459
+ }
460
+ }
461
+ function noDaemonProbe(selector) {
462
+ return { kind: 'no-daemon', reason: { kind: 'no-daemon', taskId: selectorTaskId(selector) } };
463
+ }
444
464
  async function ensureBuiltInWorkspace(workspaceRoot, selector) {
445
- const prepared = await prepareWorkspaceProbe(workspaceRoot, selector, 'build');
465
+ const prepared = await orNoDaemon(() => prepareWorkspaceProbe(workspaceRoot, selector, 'build'), () => noDaemonProbe(selector));
446
466
  if (prepared.kind === 'no-daemon')
447
467
  return runViaCli(workspaceRoot, selector, prepared.reason);
448
468
  return withTaskHooks(workspaceRoot, selector, prepared, buildPreparedTarget);
@@ -451,7 +471,7 @@ async function buildPreparedTarget(workspaceRoot, selector, prepared) {
451
471
  const { nxJson, nxArgs, projectGraph, taskGraph, tasks, requireNx } = prepared;
452
472
  performance.mark('ensureBuilt:probe:start');
453
473
  const reason = missBeforeProbe(process.env, selectorTaskId(selector)) ??
454
- (await probe(workspaceRoot, nxJson, nxArgs, projectGraph, taskGraph, tasks, requireNx));
474
+ (await orNoDaemon(() => probe(workspaceRoot, nxJson, nxArgs, projectGraph, taskGraph, tasks, requireNx), () => noDaemonProbe(selector).reason));
455
475
  performance.measure('ensureBuilt:probe', 'ensureBuilt:probe:start');
456
476
  return reason === null ? HIT : runViaCli(workspaceRoot, selector, reason);
457
477
  }
@@ -463,7 +483,7 @@ async function probeBuiltInWorkspace(workspaceRoot, selector) {
463
483
  // A failed publication proof asks a serving Nx daemon for the authoritative
464
484
  // generation, but never hashes against the consumer environment, starts a
465
485
  // provider runner or starts the provider's daemon.
466
- const prepared = await prepareWorkspaceProbe(workspaceRoot, selector, 'read-only');
486
+ const prepared = await orNoDaemon(() => prepareWorkspaceProbe(workspaceRoot, selector, 'read-only'), () => noDaemonProbe(selector));
467
487
  const detail = prepared.kind === 'no-daemon'
468
488
  ? `${receipt.detail}; authoritative graph unavailable: ${describeMiss(prepared.reason)}`
469
489
  : receipt.detail;
@@ -700,7 +720,7 @@ export function workspaceFileChanges(daemonFiles, diskFiles) {
700
720
  /** `null` when the target is already built; otherwise the first reason it is not. */
701
721
  async function probe(workspaceRoot, nxJson, nxArgs, projectGraph, taskGraph, tasks, requireNx, verifyAllArtifacts = false) {
702
722
  const { daemonClient } = requireNx('nx/src/daemon/client/client');
703
- const { DaemonBasedTaskHasher } = requireNx('nx/src/hasher/task-hasher');
723
+ const { createTaskHasher } = requireNx('nx/src/hasher/create-task-hasher');
704
724
  const { getTaskDetails, hashTasks } = requireNx('nx/src/hasher/hash-task');
705
725
  const { getTaskSpecificEnv } = requireNx('nx/src/tasks-runner/task-env');
706
726
  const { getCache } = requireNx('nx/src/tasks-runner/cache');
@@ -712,7 +732,9 @@ async function probe(workspaceRoot, nxJson, nxArgs, projectGraph, taskGraph, tas
712
732
  // flag would add belong to the cloud runner, and the run path calls Nx's own
713
733
  // `getRunner` to obtain them.
714
734
  const runnerOptions = getRunnerOptions('default', nxJson, nxArgs, false);
715
- const hasher = new DaemonBasedTaskHasher(daemonClient, runnerOptions);
735
+ // Nx's own composition: the daemon's hasher, which continues in this process
736
+ // if the daemon stops under NX_DAEMON_START=never.
737
+ const hasher = createTaskHasher(projectGraph, nxJson, runnerOptions);
716
738
  performance.mark('ensureBuilt:hash:start');
717
739
  // Every task, each against its own environment — per-project and per-target
718
740
  // `.env` files and custom hashers that read env participate in the hash, so
@@ -1 +1 @@
1
- {"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../../src/executors/bounded-exec/executor.ts"],"names":[],"mappings":"AAMA,OAAO,EAKL,KAAK,gBAAgB,EAGtB,MAAM,eAAe,CAAC;AACvB,OAAO,EAEL,KAAK,SAAS,EAKf,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,sBAAsB,EAAmB,MAAM,uBAAuB,CAAC;AAGhF,OAAO,EAML,aAAa,EAEd,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAEL,KAAK,eAAe,EAarB,MAAM,cAAc,CAAC;AAuBtB,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,wFAAwF;IACxF,MAAM,CAAC,EAAE;QAAE,IAAI,EAAE,eAAe,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;IACtD,uFAAuF;IACvF,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAClC;AAED,qEAAqE;AACrE,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,C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AE,iBAAiB,EACzB,UAAU,EAAE,UAAU,GAAG,IAAI,EAC7B,MAAM,EAAE,SAAS,GAAG,IAAI,EACxB,SAAS,GAAE,gBAAgB,GAAG,IAAW,EACzC,kBAAkB,GAAE,OAAO,sBAA+C,GACzE,OAAO,CAAC,iBAAiB,CAAC,CA4lB5B;AAED,wBAAgB,uBAAuB,IAAI,iBAAiB,CAM3D"}
@@ -2,6 +2,8 @@ import { spawn } from 'node:child_process';
2
2
  import { accessSync, constants } from 'node:fs';
3
3
  import { availableParallelism, userInfo } from 'node:os';
4
4
  import { delimiter, isAbsolute, join, resolve as resolvePath } from 'node:path';
5
+ import { createInterface } from 'node:readline';
6
+ import { Duplex } from 'node:stream';
5
7
  import { workspaceDataDirectoryForWorkspace } from 'nx/src/utils/cache-directory.js';
6
8
  import { CPU_POOL_ENV, createCpuPool, readInheritedCpuPool, takeParentCpuTokens, } from './cpu-pool.js';
7
9
  import { CPU_TOKENS_ENV, gatewayCpuBudget, runnerDemand, sizeRunner, } from './cpu-tokens.js';
@@ -9,6 +11,7 @@ import { captureHangDiagnostics, HANG_CAPTURE_MS } from './hang-diagnostics.js';
9
11
  import { createNoSpaceWatch } from './no-space.js';
10
12
  import { createRunProgress, withProgressReport } from './progress.js';
11
13
  import { COWSHED_EXECUTABLE_ENV, createHostCommands, describeRamTempError, RAM_TEMP_CAPACITY_BYTES, RamTempVolume, ramTempPaths, } from './ram-temp.js';
14
+ import { createRunnerLifecycle, withRunnerLifecycle } from './runner-lifecycle.js';
12
15
  import { clearTaskDirectory, describeNoSpace, JUNIT_FILE, JUNIT_REPORT_ENV, judgeOperationalFailure, judgeRun, readJunitReport, taskDirectory, withJunitReport, writeRecord, } from './verdict.js';
13
16
  const DEFAULT_KILL_AFTER_MS = 10_000;
14
17
  const REAP_AFTER_FORCE_KILL_MS = 2_000;
@@ -327,13 +330,18 @@ export async function runBoundedExec(options, context, killer, tempVolume, budge
327
330
  ...sized.env,
328
331
  ...(pool?.environment ?? {}),
329
332
  };
333
+ const hooked = process.platform === 'win32' ? null : withRunnerLifecycle(command);
334
+ const lifecycle = hooked === null ? null : createRunnerLifecycle(hooked.runners);
335
+ let lifecycleFailure = null;
336
+ const isTesting = () => lifecycleFailure !== null || (lifecycle?.isTesting() ?? true);
330
337
  const startedAt = Date.now();
331
338
  let child;
332
339
  try {
333
- child = spawn(command, [], {
340
+ child = spawn(hooked?.command ?? command, [], {
334
341
  cwd,
335
342
  env: mergeEnv(lease, env),
336
343
  shell: true,
344
+ stdio: hooked === null ? 'pipe' : ['pipe', 'pipe', 'pipe', 'pipe'],
337
345
  detached: process.platform !== 'win32',
338
346
  windowsHide: true,
339
347
  });
@@ -405,7 +413,7 @@ export async function runBoundedExec(options, context, killer, tempVolume, budge
405
413
  idleTimer = setTimeout(() => expire({ kind: 'idle', limitMs, tests: progress.inFlight() }, queuedMs), leftMs);
406
414
  };
407
415
  const armIdleTimer = () => {
408
- if (idleTimeoutMs === undefined || state.settled || state.expiry !== null || !progress.isTesting()) {
416
+ if (idleTimeoutMs === undefined || state.settled || state.expiry !== null || !isTesting()) {
409
417
  return;
410
418
  }
411
419
  idleLeftMs = idleTimeoutMs;
@@ -438,7 +446,7 @@ export async function runBoundedExec(options, context, killer, tempVolume, budge
438
446
  const waitedMs = Date.now() - queuedSinceMs;
439
447
  queuedMs += waitedMs;
440
448
  queuedSinceMs = null;
441
- if (!progress.isTesting()) {
449
+ if (!isTesting()) {
442
450
  appendStderr(`bounded-exec: host CPU wait ended after ${waitedMs}ms; no test runner is active\n`);
443
451
  return;
444
452
  }
@@ -449,10 +457,8 @@ export async function runBoundedExec(options, context, killer, tempVolume, budge
449
457
  // Only the CHILD's own output is read for progress. The diagnostics below go
450
458
  // through appendStderr as well, and re-arming on those would let a teardown
451
459
  // message extend the very bound that just fired.
452
- const scanProgress = (stream, text) => {
453
- const wasTesting = progress.isTesting();
454
- const finished = progress.scan(stream, text);
455
- if (!progress.isTesting()) {
460
+ const updateIdle = (finished, wasTesting) => {
461
+ if (!isTesting()) {
456
462
  clearTimeout(idleTimer);
457
463
  cancelCapture();
458
464
  idleCapture = undefined;
@@ -461,6 +467,37 @@ export async function runBoundedExec(options, context, killer, tempVolume, budge
461
467
  armIdleTimer();
462
468
  }
463
469
  };
470
+ const scanProgress = (stream, text) => {
471
+ updateIdle(progress.scan(stream, text), isTesting());
472
+ };
473
+ if (lifecycle !== null) {
474
+ const channel = child.stdio[3];
475
+ if (!(channel instanceof Duplex))
476
+ throw new Error('runner lifecycle requires a duplex child descriptor');
477
+ const failLifecycle = (detail, wasTesting = isTesting()) => {
478
+ if (lifecycleFailure !== null || state.expiry !== null)
479
+ return;
480
+ lifecycleFailure = detail;
481
+ appendStderr(`bounded-exec: runner lifecycle failed: ${detail}\n`);
482
+ updateIdle(false, wasTesting);
483
+ };
484
+ createInterface({ input: channel }).on('line', (line) => {
485
+ const wasTesting = isTesting();
486
+ const event = lifecycle.accept(line);
487
+ if (event === null) {
488
+ failLifecycle(lifecycle.error() ?? 'invalid lifecycle event', wasTesting);
489
+ return;
490
+ }
491
+ updateIdle(false, wasTesting);
492
+ // Tool startup and native lifecycle-bearing stdout wait for their phase acknowledgement.
493
+ channel.write(`${JSON.stringify(event)}\n`);
494
+ });
495
+ channel.on('error', (error) => failLifecycle(error.message));
496
+ channel.on('end', () => {
497
+ if (!lifecycle.finished())
498
+ failLifecycle('supervisor channel ended without an owned terminal event');
499
+ });
500
+ }
464
501
  child.stdout?.on('data', (chunk) => {
465
502
  const text = chunk.toString();
466
503
  scanProgress('stdout', text);
@@ -518,7 +555,7 @@ export async function runBoundedExec(options, context, killer, tempVolume, budge
518
555
  state.settled = true;
519
556
  resolve({ code: 1, signal: null });
520
557
  });
521
- child.once('exit', (code, signal) => {
558
+ child.once(hooked === null ? 'exit' : 'close', (code, signal) => {
522
559
  state.settled = true;
523
560
  resolve({ code, signal });
524
561
  });
@@ -632,9 +669,9 @@ export async function runBoundedExec(options, context, killer, tempVolume, budge
632
669
  }
633
670
  }
634
671
  await releaseLease();
635
- // A run whose sub-pool did not close cleanly fails even when the command exited 0, and whatever bound also fired:
636
- // its verdict is an ordinary failure, never a bound.
637
- const operationalFailure = state.poolCloseError !== null;
672
+ // Broken resource ownership or a lost native lifecycle fails even if a shell branch later exited 0:
673
+ // its verdict is an ordinary operational failure, never a successful or silently unbounded run.
674
+ const operationalFailure = state.poolCloseError !== null || lifecycleFailure !== null;
638
675
  await recordRun(code, state.expiry, Date.now() - startedAt, operationalFailure, seen);
639
676
  return {
640
677
  success: !operationalFailure && state.expiry === null && code === 0,
@@ -19,15 +19,13 @@
19
19
  * `fail`, or `skip` ends that execution interval. Test terminals re-arm the bound, but `output` and
20
20
  * `build-output` never do. Initial and inter-package builds are outside an active test interval.
21
21
  *
22
- * A command without a recognised execution lifecycle remains bounded from spawn.
22
+ * Execution phases are owned by the private supervisor channel in runner-lifecycle.ts, never these text reports.
23
23
  */
24
24
  export interface RunProgress {
25
25
  /** One chunk of one of the command's output streams; true when it reports a finished test or Go package. */
26
26
  scan(stream: OutputStream, chunk: string): boolean;
27
27
  /** The tests the runner reported running and has not reported finished, in the order it first named them. */
28
28
  inFlight(): string[];
29
- /** Whether test idle time is currently chargeable; unknown runner lifecycles stay chargeable. */
30
- isTesting(): boolean;
31
29
  }
32
30
  export type OutputStream = 'stdout' | 'stderr';
33
31
  export declare function createRunProgress(command?: string): RunProgress;
@@ -1 +1 @@
1
- {"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../../src/executors/bounded-exec/progress.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,WAAW,WAAW;IAC1B,4GAA4G;IAC5G,IAAI,CAAC,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;IACnD,6GAA6G;IAC7G,QAAQ,IAAI,MAAM,EAAE,CAAC;IACrB,iGAAiG;IACjG,SAAS,IAAI,OAAO,CAAC;CACtB;AAED,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAqD/C,wBAAgB,iBAAiB,CAAC,OAAO,SAAK,GAAG,WAAW,CAqF3D;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAmB1D"}
1
+ {"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../../src/executors/bounded-exec/progress.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,WAAW,WAAW;IAC1B,4GAA4G;IAC5G,IAAI,CAAC,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;IACnD,6GAA6G;IAC7G,QAAQ,IAAI,MAAM,EAAE,CAAC;CACtB;AAED,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAqD/C,wBAAgB,iBAAiB,CAAC,OAAO,SAAK,GAAG,WAAW,CAoF3D;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAmB1D"}