@smoothbricks/nx-plugin 0.5.0 → 0.5.2

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 (79) hide show
  1. package/README.md +107 -46
  2. package/dist/bin/smoo-nx-test-clocks.js +2 -2
  3. package/dist/bin/smoo-nx-test-walks.js +6 -9
  4. package/dist/cargo-closure-input.d.ts.map +1 -1
  5. package/dist/cargo-closure-input.js +25 -15
  6. package/dist/ensure-built-witness.d.ts +33 -5
  7. package/dist/ensure-built-witness.d.ts.map +1 -1
  8. package/dist/ensure-built-witness.js +84 -18
  9. package/dist/ensure-built.d.ts.map +1 -1
  10. package/dist/ensure-built.js +33 -14
  11. package/dist/executors/bounded-exec/cpu-pool.d.ts +14 -7
  12. package/dist/executors/bounded-exec/cpu-pool.d.ts.map +1 -1
  13. package/dist/executors/bounded-exec/cpu-pool.js +297 -38
  14. package/dist/executors/bounded-exec/cpu-tokens.d.ts +19 -7
  15. package/dist/executors/bounded-exec/cpu-tokens.d.ts.map +1 -1
  16. package/dist/executors/bounded-exec/cpu-tokens.js +21 -7
  17. package/dist/executors/bounded-exec/executor.d.ts.map +1 -1
  18. package/dist/executors/bounded-exec/executor.js +12 -6
  19. package/dist/executors/bounded-exec/run-cpu-pool.d.ts.map +1 -1
  20. package/dist/executors/bounded-exec/run-cpu-pool.js +5 -4
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +4 -0
  23. package/dist/owned-installation.d.ts +6 -5
  24. package/dist/owned-installation.d.ts.map +1 -1
  25. package/dist/owned-installation.js +324 -201
  26. package/dist/producer-receipts.d.ts +10 -0
  27. package/dist/producer-receipts.d.ts.map +1 -1
  28. package/dist/producer-receipts.js +30 -5
  29. package/dist/test-walk-policy.d.ts +8 -0
  30. package/dist/test-walk-policy.d.ts.map +1 -1
  31. package/dist/test-walk-policy.js +34 -0
  32. package/dist/workspace-manifest.d.ts +5 -5
  33. package/dist/workspace-manifest.d.ts.map +1 -1
  34. package/managed/raw/patches/nx@23.2.1.patch +14 -3
  35. package/managed/raw/tooling/direnv/developer-links.ts +37 -10
  36. package/managed/raw/tooling/direnv/devenv.smoo.nix +1 -3
  37. package/managed/raw/tooling/direnv/linked-snapshots.ts +49 -12
  38. package/managed/raw/tooling/direnv/repo-path +1 -1
  39. package/managed/raw/tooling/direnv/setup-environment.ts +2 -0
  40. package/managed/raw/tooling/git-hooks/pre-push.sh +34 -11
  41. package/package.json +3 -3
  42. package/runtime-input.sh +21 -9
  43. package/src/__tests__/cargo-closure-filesets.ts +94 -0
  44. package/src/__tests__/counted-cargo.ts +1 -1
  45. package/src/__tests__/owned-installation.ts +5 -6
  46. package/src/bin/smoo-nx-test-clocks.ts +2 -2
  47. package/src/bin/smoo-nx-test-walks.ts +6 -9
  48. package/src/cargo-closure-filesets.test.ts +63 -0
  49. package/src/cargo-closure-input.test.ts +2 -2
  50. package/src/cargo-closure-input.ts +23 -15
  51. package/src/cargo-closure-key.test.ts +1 -1
  52. package/src/cargo-resolve-cache.test.ts +1 -1
  53. package/src/cross-check-policy.test.ts +53 -12
  54. package/src/ensure-built-witness.test.ts +53 -2
  55. package/src/ensure-built-witness.ts +103 -18
  56. package/src/ensure-built.test.ts +79 -5
  57. package/src/ensure-built.ts +51 -15
  58. package/src/executors/bounded-exec/cpu-pool.test.ts +132 -4
  59. package/src/executors/bounded-exec/cpu-pool.ts +300 -46
  60. package/src/executors/bounded-exec/cpu-tokens.test.ts +60 -15
  61. package/src/executors/bounded-exec/cpu-tokens.ts +34 -11
  62. package/src/executors/bounded-exec/executor.test.ts +72 -4
  63. package/src/executors/bounded-exec/executor.ts +12 -6
  64. package/src/executors/bounded-exec/run-cpu-pool.test.ts +3 -0
  65. package/src/executors/bounded-exec/run-cpu-pool.ts +5 -4
  66. package/src/index.ts +4 -0
  67. package/src/linked-snapshots.nx.test.ts +1 -1
  68. package/src/nextest-partitions.test.ts +1 -1
  69. package/src/nx-daemon-validity.test.ts +51 -0
  70. package/src/owned-installation.test.ts +105 -0
  71. package/src/owned-installation.ts +335 -93
  72. package/src/producer-receipts.test.ts +37 -15
  73. package/src/producer-receipts.ts +29 -5
  74. package/src/runtime-input.test.ts +22 -1
  75. package/src/task-results.test.ts +1 -1
  76. package/src/test-walk-policy.test.ts +35 -0
  77. package/src/test-walk-policy.ts +32 -0
  78. package/src/workspace-manifest.ts +5 -5
  79. package/test-timings.json +94 -92
package/README.md CHANGED
@@ -275,9 +275,9 @@ The `@smoothbricks/nx-plugin:cargo-resolve` diagnostics channel reports `{ phase
275
275
  joins an existing flight. With no subscribers, inference neither allocates nor publishes an event. The cache regressions
276
276
  use this readiness signal and Cargo control-channel events to prove concurrency and child teardown without sleep-based
277
277
  timing assumptions; their outer hang guards report still-open test spans and process/gate state. The counted Cargo
278
- fixture delegates to the command selected before its shim was installed, with that original search path. An installed
279
- jobserver launcher remains in the chain; it must not rediscover the counted shim and recursively enter the broker. The
280
- real-producer regression covers both counted metadata and forwarded workspace discovery, with one metadata child.
278
+ fixture delegates to the command selected before its shim was installed, with that original search path, so nothing it
279
+ starts rediscovers the counted shim and recursively enters the broker. The real-producer regression covers both counted
280
+ metadata and forwarded workspace discovery, with one metadata child.
281
281
 
282
282
  Keep workspace-owned runtime state outside Nx's source index. The root `.nxignore` ignores every dot path with `.*` and
283
283
  re-includes each tracked dot input by its dot-named prefix, such as `!/.github` or `!/packages/lmao/.cargo`: a dot-named
@@ -400,6 +400,19 @@ the other directories the hash command skips), target sources outside it, its go
400
400
  `Cargo.lock`. Nx hashes those from the file hashes it already keeps, so hashing these inputs starts no process. A graph
401
401
  with unchanged resolution inputs starts no Cargo process either.
402
402
 
403
+ Fileset reduction works from the set of package directories: a path is covered exactly when it or one of its ancestors
404
+ is a member. Nested packages therefore need no extra subtree pattern, and shared ancestors are visited once. Sibling
405
+ names accumulate into the same brace pattern without copying each growing prefix. The ordered filesets are unchanged; no
406
+ new cache or retained index is introduced. For `P` packages and `F` distinct source paths of bounded depth, with `L`
407
+ loose files, reduction costs `O(P log P + F + L log L)` rather than enumerating package pairs and rebuilding sibling
408
+ prefixes.
409
+
410
+ `bun packages/nx-plugin/benchmarks/cargo-closure-input.bench.ts` measures the real async inference entry with cached
411
+ Cargo resolution/source scans at 1–4,096 packages, including a one-package overhead row. Its expansion oracle checks
412
+ complete ordered input equality before timing; filesystem scanning and Cargo resolution are not part of this
413
+ measurement. `bun packages/nx-plugin/benchmarks/compact-candidates.bench.ts` measures the unchanged output-directory
414
+ reduction and converging dependency-graph traversal separately, without invoking an executor or gate.
415
+
403
416
  Literal `include_str!` and `include_bytes!` files also belong to the closure, including data inside a crate and tracked
404
417
  files outside its directory (such as a shipped Markdown skill). One Rust lexer excludes comments and example strings;
405
418
  computed paths and arbitrary build-script reads still need explicit inputs. A compiled-in file is named only when Nx's
@@ -871,6 +884,17 @@ The installed-package census expands each declared `files` set and relative expo
871
884
  native output authority, always retaining the manifest, directory/alias namespace evidence and every resolution edge;
872
885
  without a file declaration it conservatively retains the whole package tree.
873
886
 
887
+ **Every call censuses the installed closure again; only file bytes are reused.** Each census resolves every edge, lists
888
+ every directory and stats every node. A file takes its SHA-256 from the census the witness records (or, after the graph
889
+ RPC, from the same call's earlier census) only when its stamp (device, inode, mode, size, and mtime and ctime in
890
+ nanoseconds) is the one that census read and that census did not read it in the tick it changed in; the witness records
891
+ those unproven files beside the identity, which binds what was read and never what was reused. Any write moves a file's
892
+ ctime to the tick it happens in, so a file written since, one the recorded census lacks, and one it recorded unproven
893
+ are read again. The key is the stamp and not a cheaper installation generation (a resolution, a manifest, an install
894
+ marker): a rebuild of a developer-linked package, this plugin's own `dist`, rewrites its files in place and moves none
895
+ of those. Measured on a 23,789-node closure (21,069 files): a census that reads every file takes 5–9 s on a loaded host,
896
+ its lstat pass alone 1.3–1.8 s.
897
+
874
898
  Ancestor directories bind device/inode/type/mode path identity; files and symlinks retain their full stamps, and a
875
899
  directory is upgraded to a full nanosecond node/namespace stamp when its membership is actually read.
876
900
 
@@ -883,10 +907,11 @@ This is git's racily clean rule (`Documentation/technical/racy-git.txt`), and th
883
907
  Nx's own file hashes. Node can read neither the jiffy nor a filesystem's granularity, and a shorter window reopens the
884
908
  gap on a slower kernel, so the window is the slowest tick and is not an option. A reader that meets an unproven stamp
885
909
  re-reads the node against its recorded bytes, link text or membership, as it does a node whose ctime alone moved; one
886
- that holds nothing to re-read it against counts it moved. A census whose stamps stand in for no bytes of their own (the
887
- installed-package census and the local plugin modules, which hash every byte on every read) records them as read. So
888
- does a workspace capture's own stability check, which compares the stamps it read: only the capture after it distrusts
889
- them.
910
+ that holds nothing to re-read it against counts it moved. The local plugin modules, which hash every byte on every read,
911
+ record their stamps as read. So does a workspace capture's own stability check, which compares the stamps it read: only
912
+ the capture after it distrusts them. The installed-package census records its stamps as read too, since its identity
913
+ binds what it read, and names beside them the files it read in their change tick, which the census that takes its hashes
914
+ reads again.
890
915
 
891
916
  A physically missing required factory after the clean cutover is an invalid installation and fails loudly; it is not a
892
917
  proof miss that can fall back to the graph RPC. Consumers adopt the normal static import only after the public producer
@@ -914,12 +939,16 @@ its own Nx plugin options as
914
939
  `producerReceipts: { targets: ["lmao:rust-dist", "lmao:cargo-wasm", "lmao:cargo-thread-ffi"] }`, naming every target a
915
940
  consumer's snapshot declaration names. The pre-task hook captures the committed HEAD/tree and tracked-source/tool basis;
916
941
  the post-task hook uses Nx's actual successful `TaskResults`, hashes/hash details, argv and start/end times, including
917
- successful uncacheable prerequisites, and atomically publishes the receipt in that checkout's existing Nx
918
- workspace-data. Disabled publication performs no source prepass, so an ordinary consumer CLI pays none of that producer
919
- work. No file permission, path, daemon state or cached row can invent a completion receipt. Nx takes one pre/post
920
- task-hook pair per plugin, so the plugin's pair runs the controller's `COWSHED_NX_TASK_RECEIPT_ID` task-results hint
921
- first and these producer hooks second, each with the same options and run context and neither reading the other's
922
- output.
942
+ successful uncacheable prerequisites, and atomically publishes the receipt in that checkout's
943
+ `.cache/producer-receipts`. That is its source tree, not Nx's workspace-data: under cowshed workspace-data is build
944
+ state on the checkout's build volume, which a consumer's read grant of the provider checkout does not reach, so the
945
+ consumer could not read the receipt it validates. The directory ignores itself with a `.gitignore` of `*`, so no
946
+ checkout tracks a record and Nx never hashes one. A missing receipt refuses naming the path it was looked for at; a
947
+ receipt the consumer cannot read refuses with the read error (EPERM under a sandbox). Disabled publication performs no
948
+ source prepass, so an ordinary consumer CLI pays none of that producer work. No file permission, path, daemon state or
949
+ cached row can invent a completion receipt. Nx takes one pre/post task-hook pair per plugin, so the plugin's pair runs
950
+ the controller's `COWSHED_NX_TASK_RECEIPT_ID` task-results hint first and these producer hooks second, each with the
951
+ same options and run context and neither reading the other's output.
923
952
 
924
953
  The receipt binds the selected target, basis commit SHA and committed tree SHA, actual argv, declared producer
925
954
  environment identity and bound tool/module inputs, independent product output SHA-256, measured wall time, and an
@@ -947,7 +976,9 @@ environment/tool inputs and actual output census. It never re-hashes the provide
947
976
  Its read of the recorded tools must stay stable through that census on the same terms as the producer's: a tool node
948
977
  whose ctime alone moved is re-read and compared with the receipt, and a refusal names the nodes that moved. A valid
949
978
  receipt is the hit. A missing, mismatched, stale or unbound receipt requires the authoritative graph RPC, then a loud
950
- miss/refusal without running a target or writing provider outputs. A managed consumer requires the installed
979
+ miss/refusal without running a target or writing provider outputs. That RPC goes only to a daemon already serving the
980
+ provider: the probe never starts one, since a start writes the provider's workspace data and a sandboxed consumer may
981
+ only read its provider, so with none serving the refusal names `no-daemon`. A managed consumer requires the installed
951
982
  `probeBuilt` operation and the complete producer-receipt contract; an old receipt lacking it refuses, never falls back
952
983
  to `ensureBuilt` or a producer writer. `ensureBuilt` remains the normal build/stream operation with its existing
953
984
  hit/built/failed results and Nx's current source/cache/artifact verdict.
@@ -1447,31 +1478,42 @@ per core, whatever `--jobs` says), a cargo build one per core, anything else one
1447
1478
  bounded by positive inherited `NEXTEST_TEST_THREADS`/`CARGO_BUILD_JOBS` ceilings. A configured count can lower an
1448
1479
  inherited ceiling, never raise it. The runner uses `min(bounded request, granted tokens)`: nextest's environment and
1449
1480
  named flag, Bun's parallel flag, Stryker's, Vitest's and go's worker flag (added when the command names none),
1450
- cargo-mutants' jobserver tasks, `--jobs` and per-process test threads, and Cargo's jobs are sized to that limit. A
1451
- runner that starts its own workers or jobserver (cargo-mutants, Stryker, Vitest, `go test`) ignores the `cargo`
1452
- launcher's fifo, so it must run under `bounded-exec`; the inferred `mutation` target does. Cargo's `RUST_TEST_THREADS`
1453
- retains its independent inherited/configured ceiling. `BOUNDED_EXEC_CPU_TOKENS`, the sub-ledger and telemetry still name
1454
- the actual held grant. The gateway shares tokens fairly between checkouts (Nx workspace roots). `timeoutMs` and
1455
- `idleTimeoutMs` start at the grant. The tokens go back when the command exits, or with the executor's socket when it is
1456
- killed. The wait prints one `cowshed: cpu-tokens wait done elapsed=… tokens=<granted>/<asked>` line. On a host whose
1457
- gateway socket does not exist (a CI runner, a machine without cowshed), the plugin's `preTasksExecution` serves each Nx
1458
- run that inherits no pool its own `BOUNDED_EXEC_CPU_POOL` of one token per core, and `postTasksExecution` closes it: the
1459
- run's targets, started side by side under `NX_PARALLEL=100%`, queue for its cores instead of each sizing its runner to
1460
- the whole host (`specs/cowshed/05_gateway.md`, "A run without a gateway budgets itself"). Its scope is one run. A
1461
- command no pool and no gateway answers runs exactly as configured and nothing is said; a gateway from before the budget
1462
- runs it unbudgeted and stderr says so.
1463
-
1464
- A granted executor serves a private `BOUNDED_EXEC_CPU_POOL` with its actual token count. A nested default executor asks
1465
- that immediate parent pool for its own demand, instead of taking from the host while the parent holds its grant; the
1466
- pool grants at most what it can. A lent pool accounts for siblings together; each admitted child serves only its own
1467
- allocation to grandchildren. Closing a child's connection returns its local allocation, never the parent's upstream
1468
- grant. Upstream loss revokes the downstream pool, so a dead parent grants nothing more; a command whose grant closes
1469
- while it runs (a gateway restart, or the lending parent's exit) runs on over budget to its own exit, and stderr says
1470
- `cowshed: cpu-tokens grant ended`. A bare count or absent endpoint follows normal host admission. A connected parent
1471
- pool's refusal or protocol failure instead fails admission: taking from the host then could wait on the parent's own
1472
- grant. `options.env` cannot inject either marker. Parent-pool grants record `cpu.inherited: true` and their actual local
1473
- wait; the span also says `inherited=true`. Pool setup, listener and cleanup errors fail rather than bypassing
1474
- accounting. Command bounds stay unchanged.
1481
+ cargo-mutants' jobserver tasks, `--jobs` and per-process test threads, and a cargo build's libtest and nextest test
1482
+ threads are sized to that limit. Cargo's rustc count needs no flag: the run's sub-pool is a GNU make jobserver fifo that
1483
+ `CARGO_MAKEFLAGS` and `MAKEFLAGS` name, so Cargo, its build scripts and every nested `cargo` share the grant's count
1484
+ with the sub-pool's socket children, and no grant sets `CARGO_BUILD_JOBS`. A command whose runner the executor cannot
1485
+ see (a script) gets `RUST_TEST_THREADS` and `NEXTEST_TEST_THREADS` set to its whole held grant, since test threads take
1486
+ no jobserver token. A runner that starts its own workers or jobserver (cargo-mutants, Stryker, Vitest, `go test`)
1487
+ ignores that fifo, so it must run under `bounded-exec`, whose runner kinds size its own flag; the inferred `mutation`
1488
+ target does. Test threads retain their independent inherited/configured ceilings. `BOUNDED_EXEC_CPU_TOKENS`, the
1489
+ sub-ledger and telemetry still name the actual held grant. The gateway shares tokens fairly between checkouts (Nx
1490
+ workspace roots). `timeoutMs` and `idleTimeoutMs` start at the grant. The tokens go back when the command exits, or with
1491
+ the executor's socket when it is killed. The wait prints one
1492
+ `cowshed: cpu-tokens wait done elapsed=… tokens=<granted>/<asked>` line. On a host whose gateway socket does not exist
1493
+ (a CI runner, a machine without cowshed), the plugin's `preTasksExecution` serves each Nx run that inherits no pool its
1494
+ own `BOUNDED_EXEC_CPU_POOL` of one token per core, with its jobserver fifo in `CARGO_MAKEFLAGS` for the Cargo that
1495
+ `nx:run-commands` starts, and `postTasksExecution` closes it: the run's targets, started side by side under
1496
+ `NX_PARALLEL=100%`, queue for its cores instead of each sizing its runner to the whole host
1497
+ (`specs/cowshed/05_gateway.md`, "A run without a gateway budgets itself"). Its scope is one run. A command no pool and
1498
+ no gateway answers runs exactly as configured and nothing is said; a gateway from before the budget runs it unbudgeted
1499
+ and stderr says so.
1500
+
1501
+ A granted executor serves a private `BOUNDED_EXEC_CPU_POOL` with its actual token count, and the same count as a make
1502
+ jobserver fifo beside it: `g − 1` token bytes, the command holding the implicit first, which the pool lends a socket
1503
+ child only once the fifo is empty. A socket grant takes fifo bytes first and that slot last, and its release writes the
1504
+ bytes back; the pool waits for a fifo byte on the event loop, so a token Cargo writes back wakes the queued child. Its
1505
+ close drains and removes the fifo. A nested default executor asks that immediate parent pool for its own demand, instead
1506
+ of taking from the host while the parent holds its grant; the pool grants at most what it can. A lent pool accounts for
1507
+ siblings together; each admitted child serves only its own allocation to grandchildren. Closing a child's connection
1508
+ returns its local allocation, never the parent's upstream grant. Upstream loss revokes the downstream pool, so a dead
1509
+ parent grants nothing more; a command whose grant closes while it runs (a gateway restart, or the lending parent's exit)
1510
+ runs on over budget to its own exit, and stderr says `cowshed: cpu-tokens grant ended`. A bare count or absent endpoint
1511
+ follows normal host admission. A connected parent pool's refusal or protocol failure instead fails admission: taking
1512
+ from the host then could wait on the parent's own grant. `options.env` cannot inject either marker, nor a jobserver
1513
+ (`CARGO_MAKEFLAGS`, `MAKEFLAGS`, `MFLAGS`); a parent make's jobserver the executor inherits still reaches an ungranted
1514
+ command. Parent-pool grants record `cpu.inherited: true` and their actual local wait; the span also says
1515
+ `inherited=true`. Pool setup, listener and cleanup errors fail rather than bypassing accounting. Command bounds stay
1516
+ unchanged.
1475
1517
 
1476
1518
  The absent-parent fixture uses the executor's injectable budget with a real, controlled outer pool as its backing. It
1477
1519
  proves a positive allocation and re-acquires it after the command ends, rather than depending on free tokens in the
@@ -1616,14 +1658,33 @@ A fixture retires on every exit path, a throwing body included: stop its daemon,
1616
1658
  its root. A daemon that outlives the stop keeps the alias and the root, so the next run's sweep still finds both.
1617
1659
 
1618
1660
  A fixture workspace that runs real Nx with this plugin links an installation it owns, never the host's.
1619
- `@smoothbricks/nx-plugin/owned-installation`'s `ownedInstallation(censusRoot, makeRoot)` copies the closure the graph
1661
+ `@smoothbricks/nx-plugin/owned-installation`'s `ownedInstallation(censusRoot, name)` copies the closure the graph
1620
1662
  witness's installation census resolves from `censusRoot` (Nx, this plugin and TypeScript, each package with its
1621
- dependency edges relinked beside it and the top-level bins in `.bin`) into the empty directory `makeRoot` creates, on
1622
- the first `nodeModules()`, and proves the copy. `retire()` fails, naming the changed nodes, if a fixture wrote into it,
1623
- then deletes it. The host's closure moves under a fixture that reads it: a shared Bun store relinked by another install,
1624
- or, in a workspace that developer-links this plugin, the checkout its author is editing and rebuilding. Either fails the
1625
- producer receipt's installation proof for work that is not the test's. This package's tests bind `censusRoot` to this
1626
- repository; a consumer binds it to its own workspace root.
1663
+ dependency edges relinked beside it and the top-level bins in `.bin`), and keeps the copy as `name` in `censusRoot`'s
1664
+ tool cache, `node_modules/.cache/smoothbricks-nx-plugin/owned-installations/<name>`. Nothing sweeps that directory: a
1665
+ cowshed fork clones it with the build volume and main adopts it at land (specs/cowshed/16_build_volumes.md), so it is
1666
+ cold only after `node_modules` is reinstalled or the build volume reseeded. Making the copy is most of what a test file
1667
+ costs (about 21,000 files: a 59 s copy and a 31–119 s removal per run on a loaded host), and clonefile cannot share it,
1668
+ since Bun's global store and every directory a cowshed job may write lie on different volumes. On the first
1669
+ `nodeModules()` of a run the census of the host closure and the proven census of the copy are compared package by
1670
+ package, by what each holds: resolution edges, node types and modes, and file bytes. A package whose copy no longer
1671
+ holds what the host's holds is copied again, and every package when the edges moved or the copy is unproved; a copy that
1672
+ was there and failed its proof is named on stderr with the reason. Both censuses take unmoved files' hashes from the
1673
+ ones recorded beside the copy, so a run that changes nothing reads no file bytes. `retire()` fails, naming the changed
1674
+ nodes, if a fixture wrote into the copy, and leaves it for the next run to prove. The host's closure moves under a
1675
+ fixture that reads it: a shared Bun store relinked by another install, or, in a workspace that developer-links this
1676
+ plugin, the checkout its author is editing and rebuilding. Either fails the producer receipt's installation proof for
1677
+ work that is not the test's. Each test file names its own copy; two runs of one file at once share it, and a copy one of
1678
+ them makes again fails the other. This package's tests bind `censusRoot` to this repository; a consumer binds it to its
1679
+ own workspace root.
1680
+
1681
+ The copy lies beneath `censusRoot`'s `node_modules`. Where `node_modules/.cache` is a real directory, as on a fresh CI
1682
+ checkout (a cowshed build volume links it elsewhere), Node's ancestor lookup from the copy reaches the host's own
1683
+ packages, so a census of a missing or incomplete copy would resolve the host's. A census of the copy that resolves any
1684
+ package outside the copy therefore proves nothing about it: the copy is unproved and made again, and stderr names the
1685
+ resolution. Node keeps each resolution for the life of a process, so a copy made whole goes to a new directory,
1686
+ `installation-<uuid>`, which the record beside it names. The same lookup lets a package in the copy that requires a
1687
+ dependency it does not declare load the host's top-level one; the census binds declared edges only and cannot see that.
1627
1688
 
1628
1689
  ## Managed workspace files
1629
1690
 
@@ -2,8 +2,8 @@
2
2
  import { findClockOracles, formatClockOracle, TEST_CLOCK_ORACLE } from '../test-clock-policy.js';
3
3
  import { diffScope, upstreamBase } from '../test-walk-policy.js';
4
4
  // TEST-CLOCK-ORACLE over the current directory's repository, judged on the cases changed since the upstream merge base
5
- // (`upstreamBase`, the base `smoo-nx-test-walks --base` prints for the lint target's runtime input). Every finding
6
- // prints `error[…]` and exits 1. Exit 2 when git cannot answer.
5
+ // (`upstreamBase`, resolved as a run precondition before Nx hashes anything). Every finding prints `error[…]` and
6
+ // exits 1. Exit 2 when git cannot answer.
7
7
  if (process.argv.length > 2) {
8
8
  process.stderr.write('usage: smoo-nx-test-clocks\n');
9
9
  process.exit(2);
@@ -1,12 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import { diffScope, findDuplicateScenarios, formatDuplicateScenario, REFUSES, TEST_ONE_WALK, upstreamBase, } from '../test-walk-policy.js';
3
3
  // TEST-ONE-WALK over the current directory's repository, judged on the cases changed since the upstream merge base
4
- // (`upstreamBase`). `--base` prints only that base, for an Nx runtime input: the verdict depends on it and no file
5
- // hash names it. Refusing kinds print `error[…]` and exit 1; advisory kinds print `warning[…]` for the writer and
6
- // reviewer and leave the exit at 0. Exit 2 when git cannot answer.
4
+ // (`upstreamBase`). The base is repository state, not task data: the plugin resolves it as a run precondition
5
+ // before Nx hashes anything (assertUpstreamBasePrecondition), so it is never carried by a runtime input.
6
+ // Refusing kinds print `error[…]` and exit 1; advisory kinds print `warning[…]` for the writer and reviewer and
7
+ // leave the exit at 0. Exit 2 when git cannot answer.
7
8
  const args = process.argv.slice(2);
8
- if (args.length > 1 || (args.length === 1 && args[0] !== '--base')) {
9
- process.stderr.write('usage: smoo-nx-test-walks [--base]\n');
9
+ if (args.length > 0) {
10
+ process.stderr.write('usage: smoo-nx-test-walks\n');
10
11
  process.exit(2);
11
12
  }
12
13
  const root = process.cwd();
@@ -15,10 +16,6 @@ if (!base.ok) {
15
16
  process.stderr.write(`${TEST_ONE_WALK.id} cannot find the upstream base: ${base.reason}\n`);
16
17
  process.exit(2);
17
18
  }
18
- if (args[0] === '--base') {
19
- process.stdout.write(`${base.value}\n`);
20
- process.exit(0);
21
- }
22
19
  const scope = diffScope(root, base.value);
23
20
  if (!scope.ok) {
24
21
  process.stderr.write(`${TEST_ONE_WALK.id} cannot read the changes since ${base.value}: ${scope.reason}\n`);
@@ -1 +1 @@
1
- {"version":3,"file":"cargo-closure-input.d.ts","sourceRoot":"","sources":["../src/cargo-closure-input.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAEpE,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,kBAAkB,EAKxB,MAAM,wBAAwB,CAAC;AAIhC;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,iBAAiB,CAAC;AAElD,KAAK,KAAK,GAAG,WAAW,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhE,mFAAmF;AACnF,qBAAa,sBAAuB,SAAQ,KAAK;IAC/C,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAE7B,YAAY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O,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,EACrC,kBAAkB,EAAE,GAAG,CAAC,MAAM,EAAE,kBAAkB,EAAE,CAAC,GACpD,OAAO,CAAC,kBAAkB,CAAC,CAI7B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAsB,kBAAkB,CACtC,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,SAAS,kBAAkB,EAAE,GACrC,OAAO,CAAC,KAAK,EAAE,CAAC,CAelB;AAkGD,wHAAwH;AACxH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,SAAS,iBAAiB,EAAE,EAAE,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,MAAM,EAAE,CAMlH"}
@@ -99,8 +99,8 @@ async function workspaceClosureInputs(projectRoot, source) {
99
99
  const lock = posix.join('{workspaceRoot}', posix.dirname(source.manifest), 'Cargo.lock');
100
100
  const closureArguments = `--closure ${shellWord(projectRoot)} ${shellWord(source.manifest)}`;
101
101
  const { root, cargo, indexed } = source;
102
- const packageDirectories = [];
103
- const files = [];
102
+ const packageDirectories = new Set();
103
+ const files = new Set();
104
104
  const compiledIn = [];
105
105
  let compiledFiles = [];
106
106
  let external = false;
@@ -127,12 +127,12 @@ async function workspaceClosureInputs(projectRoot, source) {
127
127
  throw new Error(`${compiled.source} was scanned outside ${directory}`);
128
128
  compiledIn.push({ declaring, file });
129
129
  }
130
- packageDirectories.push(directory);
130
+ packageDirectories.add(directory);
131
131
  for (const file of [...pkg.sources, pkg.governingManifest]) {
132
132
  const path = indexablePath(root, file);
133
133
  if (path === null)
134
134
  throw new Error(`${directory} compiles ${file}, which Nx's file index cannot hold`);
135
- files.push(path);
135
+ files.add(path);
136
136
  }
137
137
  }
138
138
  const compiledPaths = [...new Set(compiledIn.flatMap(({ declaring, file }) => [declaring, file]))];
@@ -146,21 +146,22 @@ async function workspaceClosureInputs(projectRoot, source) {
146
146
  catch (error) {
147
147
  throw new CargoClosureInputError(projectRoot, error);
148
148
  }
149
- // A package nested in another member's directory is already covered by it.
150
- const directories = [...new Set(packageDirectories)]
149
+ // Query the directory set by path ancestors, not by expanding all pairs.
150
+ // Removing nested members leaves an antichain with the same covered files.
151
+ const directories = [...packageDirectories]
151
152
  .sort()
152
- .filter((directory, index, sorted) => !sorted.slice(0, index).some((outer) => contains(outer, directory)));
153
+ .filter((directory) => !covered(packageDirectories, parent(directory)));
153
154
  const ancestors = new Set();
154
155
  for (const directory of directories) {
155
- for (let ancestor = parent(directory); ancestor !== null; ancestor = parent(ancestor)) {
156
- const candidate = ancestor;
157
- if (!directories.some((outer) => contains(outer, candidate)))
158
- ancestors.add(candidate);
156
+ // An ancestor of an outermost member cannot be inside another member.
157
+ // Once this walk joins an earlier walk, all remaining ancestors are held.
158
+ for (let ancestor = parent(directory); ancestor !== null && !ancestors.has(ancestor); ancestor = parent(ancestor)) {
159
+ ancestors.add(ancestor);
159
160
  }
160
161
  }
161
162
  // Target sources outside every package directory, and governing manifests
162
163
  // that are not already one of the ancestors' manifests.
163
- const loose = new Set(files.filter((file) => !directories.some((directory) => contains(directory, file)) &&
164
+ const loose = new Set([...files].filter((file) => !covered(packageDirectories, file) &&
164
165
  !(posix.basename(file) === 'Cargo.toml' && ancestors.has(parent(file) ?? ''))));
165
166
  // Sibling packages share one pattern, `crates/{a,b}/…`, so a closure of
166
167
  // dozens of crates reads as a few lines in `nx show project`.
@@ -169,7 +170,11 @@ async function workspaceClosureInputs(projectRoot, source) {
169
170
  const key = parent(directory);
170
171
  if (key === null)
171
172
  continue;
172
- siblings.set(key, [...(siblings.get(key) ?? []), posix.basename(directory)]);
173
+ const names = siblings.get(key);
174
+ if (names === undefined)
175
+ siblings.set(key, [posix.basename(directory)]);
176
+ else
177
+ names.push(posix.basename(directory));
173
178
  }
174
179
  const packageGlobs = directories.includes('')
175
180
  ? ['']
@@ -217,6 +222,11 @@ function parent(path) {
217
222
  const directory = posix.dirname(path);
218
223
  return directory === '.' ? '' : directory;
219
224
  }
220
- function contains(directory, path) {
221
- return directory === '' || path === directory || path.startsWith(`${directory}/`);
225
+ /** Membership in the union of package subtrees, bounded by path depth rather than package count. */
226
+ function covered(directories, path) {
227
+ for (let candidate = path; candidate !== null; candidate = parent(candidate)) {
228
+ if (directories.has(candidate))
229
+ return true;
230
+ }
231
+ return false;
222
232
  }
@@ -8,6 +8,8 @@ import type { GraphInputContractProof } from './graph-input-contract.js';
8
8
  export type StampFields = Pick<BigIntStats, 'dev' | 'ino' | 'mode' | 'size' | 'mtimeNs' | 'ctimeNs'>;
9
9
  /** The stamp a node reads as now: device, inode, mode, size, mtime and ctime. What a recorded stamp is compared with. */
10
10
  export declare function nodeStamp(stats: StampFields): string;
11
+ /** The file type and permission bits a {@link nodeStamp} records: what a copy of the node keeps of its stamp. */
12
+ export declare function stampMode(stamp: string): string;
11
13
  /**
12
14
  * How an observed stamp compares with the recorded one: `same`; `ctime` when device, inode, mode, size and mtime are
13
15
  * kept and only the ctime moved (a same-mode chmod, which Bun's bin linking does to a shared store file on any
@@ -50,10 +52,12 @@ export interface WorkspaceSnapshot {
50
52
  readonly stable: boolean;
51
53
  }
52
54
  export interface GraphWitness {
53
- readonly version: 1;
55
+ readonly version: 2;
54
56
  readonly workspaceRoot: string;
55
57
  readonly environment: string;
56
58
  readonly installation: string;
59
+ /** The census behind `installation` read these files in the tick they changed in: {@link GraphInstallationCensus}. */
60
+ readonly installationUnproven: readonly string[];
57
61
  readonly snapshot: WorkspaceSnapshot;
58
62
  readonly projectGraph: ProjectGraph;
59
63
  }
@@ -82,8 +86,9 @@ export declare function movedNodes(nodes: readonly NodeWitness[], same?: (path:
82
86
  */
83
87
  export declare function snapshotsEqual(left: WorkspaceSnapshot, right: WorkspaceSnapshot): boolean;
84
88
  export declare function reusableGraph(witness: GraphWitness | null, workspaceRoot: string, environment: string, installation: string | null, snapshot: WorkspaceSnapshot): ProjectGraph | null;
85
- /** What {@link graphInstallationIdentity} binds: resolution edges `[from, name, physical manifest]`, node stamps and
86
- * file hashes, read once.
89
+ /** What {@link graphInstallationIdentity} binds: resolution edges `[from, name, physical manifest]`, node stamps as
90
+ * read and file hashes, read once. `unproven` names the files this census read in the tick they changed in
91
+ * ({@link unproven}); it is not part of the identity, only what a later census that reuses these hashes must re-read.
87
92
  */
88
93
  export interface GraphInstallationCensus {
89
94
  readonly resolutions: readonly (readonly [string, string, string | null])[];
@@ -92,6 +97,7 @@ export interface GraphInstallationCensus {
92
97
  readonly path: string;
93
98
  readonly sha256: string;
94
99
  }[];
100
+ readonly unproven: readonly string[];
95
101
  }
96
102
  /** Plugins with opaque external graph inputs cannot borrow this proof.
97
103
  * For the repository plugin and Nx, bind the entire owned module/file tree
@@ -101,11 +107,33 @@ export interface GraphInstallationCensus {
101
107
  * tree that moved while reading. A missing optional dependency is recorded too.
102
108
  */
103
109
  export declare function graphInstallationIdentity(workspaceRoot: string, nxJson: NxJsonConfiguration, resolvePackage: typeof readModulePackageJsonWithoutFallbacks, expand: typeof expandOutputs, localInputs: GraphInputContractProof | null, onUnproved?: (detail: string) => void): string | null;
104
- /** One read of the installation closure {@link graphInstallationIdentity} binds, without its final check that no node
110
+ /** The identity {@link graphInstallationIdentity} names for a proven census: what it read, never what it reused. */
111
+ export declare function installationIdentityOf({ resolutions, nodes, files }: GraphInstallationCensus, localInputs: GraphInputContractProof | null): string;
112
+ /** The census behind a recorded identity ({@link installationIdentityOf}) and its unproven files, or `undefined` for
113
+ * one that does not parse: a hash source for {@link graphInstallationCensus}, never a proof.
114
+ */
115
+ export declare function recordedInstallationCensus(identity: string, unproven: readonly string[]): GraphInstallationCensus | undefined;
116
+ /**
117
+ * A {@link graphInstallationCensus} that no node moved during: every node is read again after the census, and one
118
+ * whose stamp moved fails it, unless only its ctime moved and its bytes are the ones hashed. `previous` is what the
119
+ * census may take hashes from. `null`, with `onUnproved` told why, for a closure that cannot be read or that moved.
120
+ */
121
+ export declare function provenInstallationCensus(workspaceRoot: string, nxJson: NxJsonConfiguration, resolvePackage: typeof readModulePackageJsonWithoutFallbacks, expand: typeof expandOutputs, localInputs: GraphInputContractProof | null, onUnproved?: (detail: string) => void, previous?: GraphInstallationCensus): GraphInstallationCensus | null;
122
+ /**
123
+ * One read of the installation closure {@link graphInstallationIdentity} binds, without its final check that no node
105
124
  * moved while it was read: what a caller that needs the closure, not a proof of it, reads. `null`, with `onUnproved`
106
125
  * told why, for a closure that cannot be read.
126
+ *
127
+ * Every census resolves every edge, lists every directory and stats every node; only file bytes are reused. A file
128
+ * takes its hash from `previous` when its stamp (device, inode, mode, size, and mtime and ctime in nanoseconds) is
129
+ * the one `previous` read and `previous` did not read it in the tick it changed in. A write moves a file's ctime to
130
+ * the tick it happens in, so a file written since `previous` stat-ed it, even between that stat and its read, one
131
+ * whose stamp `previous` lacks, and one `previous` recorded unproven are read again; `previous` need not be proven.
132
+ * The key is the stamp, not a cheaper generation (a resolution, a manifest, an install marker): a rebuild of a
133
+ * developer-linked package, this plugin's own `dist`, rewrites its files in place and moves none of those, so a census
134
+ * keyed on them would describe a tree that is no longer there.
107
135
  */
108
- export declare function graphInstallationCensus(workspaceRoot: string, nxJson: NxJsonConfiguration, resolvePackage: typeof readModulePackageJsonWithoutFallbacks, expand: typeof expandOutputs, localInputs: GraphInputContractProof | null, onUnproved?: (detail: string) => void): GraphInstallationCensus | null;
136
+ export declare function graphInstallationCensus(workspaceRoot: string, nxJson: NxJsonConfiguration, resolvePackage: typeof readModulePackageJsonWithoutFallbacks, expand: typeof expandOutputs, localInputs: GraphInputContractProof | null, onUnproved?: (detail: string) => void, previous?: GraphInstallationCensus): GraphInstallationCensus | null;
109
137
  export interface ArtifactWitness {
110
138
  readonly version: 1;
111
139
  readonly workspaceRoot: string;
@@ -1 +1 @@
1
- {"version":3,"file":"ensure-built-witness.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