@smoothbricks/nx-plugin 0.5.1 → 0.5.3

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 (60) hide show
  1. package/README.md +74 -13
  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/cargo-source-hash.d.ts +2 -2
  7. package/dist/cargo-source-hash.d.ts.map +1 -1
  8. package/dist/cargo-source-hash.js +106 -46
  9. package/dist/ensure-built-witness.d.ts +33 -5
  10. package/dist/ensure-built-witness.d.ts.map +1 -1
  11. package/dist/ensure-built-witness.js +84 -18
  12. package/dist/ensure-built.d.ts.map +1 -1
  13. package/dist/ensure-built.js +19 -5
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +4 -0
  16. package/dist/owned-installation.d.ts +6 -5
  17. package/dist/owned-installation.d.ts.map +1 -1
  18. package/dist/owned-installation.js +324 -201
  19. package/dist/test-walk-policy.d.ts +8 -0
  20. package/dist/test-walk-policy.d.ts.map +1 -1
  21. package/dist/test-walk-policy.js +34 -0
  22. package/dist/workspace-manifest.d.ts +5 -5
  23. package/dist/workspace-manifest.d.ts.map +1 -1
  24. package/managed/raw/patches/nx@23.2.1.patch +196 -48
  25. package/managed/raw/tooling/direnv/developer-links.ts +37 -10
  26. package/managed/raw/tooling/direnv/linked-snapshots.ts +31 -4
  27. package/managed/raw/tooling/direnv/setup-environment.ts +2 -0
  28. package/managed/raw/tooling/git-hooks/pre-push.sh +34 -11
  29. package/package.json +3 -3
  30. package/runtime-input.sh +21 -9
  31. package/src/__tests__/cargo-closure-filesets.ts +94 -0
  32. package/src/__tests__/owned-installation.ts +5 -6
  33. package/src/bin/smoo-nx-test-clocks.ts +2 -2
  34. package/src/bin/smoo-nx-test-walks.ts +6 -9
  35. package/src/cargo-closure-filesets.test.ts +63 -0
  36. package/src/cargo-closure-input.test.ts +1 -1
  37. package/src/cargo-closure-input.ts +23 -15
  38. package/src/cargo-closure-key.test.ts +1 -1
  39. package/src/cargo-resolve-cache.test.ts +1 -1
  40. package/src/cargo-source-hash.test.ts +143 -2
  41. package/src/cargo-source-hash.ts +108 -44
  42. package/src/cross-check-policy.test.ts +53 -12
  43. package/src/ensure-built-witness.test.ts +53 -2
  44. package/src/ensure-built-witness.ts +103 -18
  45. package/src/ensure-built.test.ts +40 -5
  46. package/src/ensure-built.ts +28 -6
  47. package/src/index.ts +4 -0
  48. package/src/linked-snapshots.nx.test.ts +1 -1
  49. package/src/nextest-partitions.test.ts +1 -1
  50. package/src/nx-daemon-start-never.test.ts +126 -0
  51. package/src/nx-daemon-validity.test.ts +51 -0
  52. package/src/nx-task-output-lease.test.ts +136 -0
  53. package/src/owned-installation.test.ts +105 -0
  54. package/src/owned-installation.ts +335 -93
  55. package/src/runtime-input.test.ts +22 -1
  56. package/src/task-results.test.ts +1 -1
  57. package/src/test-walk-policy.test.ts +35 -0
  58. package/src/test-walk-policy.ts +32 -0
  59. package/src/workspace-manifest.ts +5 -5
  60. package/test-timings.json +95 -92
package/README.md CHANGED
@@ -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
@@ -413,8 +426,25 @@ toolchain pins, wrapper scripts, N-API configuration and CLI version.
413
426
  Runtime file identities are rooted in Cargo package name/version and the declared input role, not in the consuming
414
427
  checkout's absolute path or depth. Source paths are package-relative; compiled-in data keeps its declaring source and
415
428
  literal path as its identity. Identical main/shed inputs therefore share a key, while changed bytes, module names and
416
- symlink targets still move it. Shared bytes are read once, and all identities are sorted before hashing. The Cargo
417
- resolution memo schema retains package names/versions; refreshing that memo does not reset the Nx task database.
429
+ symlink targets still move it. File identities retain their globally sorted `cargo-path-inputs-v2` transcript, including
430
+ the original insertion order for equal identities. The Cargo resolution memo schema retains package names/versions;
431
+ refreshing that memo does not reset the Nx task database.
432
+
433
+ Runtime include discovery is a bounded fuse, not a source-byte cache. Ordinary scheduled Rust sources are read once:
434
+ their buffer supplies both the existing literal scanner and SHA-256. `file` identities precede the same package's
435
+ `include` identities; packages sharing an identity are processed together. An earlier package's include can consume a
436
+ later package's source, but only its discovered references survive until that later identity's boundary. Retention is
437
+ one live file buffer plus the current UTF-8 decode/tokens and path metadata, including across package boundaries.
438
+ Literal spellings are copied into path-sized storage with the same UTF-8 encoding, without Unicode normalization, so
439
+ substring views cannot pin decoded source files.
440
+
441
+ Discovery still scans ignored sources, just as the graph scanner does. Discovery-only sources that are later included
442
+ (for example through an unignored symlink that resolves to an ignored `.rs`) are read twice: serving those from one read
443
+ would require retaining bytes across their discovery and sorted hash positions. This exception preserves the old digest
444
+ rather than introducing a workspace-sized cache. No source bytes or runtime discovery memo survive an invocation.
445
+ Read-count, timing, corpus-equivalence and retention evidence is recorded in
446
+ `benchmarks/cargo-source-read.results.json`; `benchmarks/cargo-source-read.bench.ts` measures real filesystem reads in a
447
+ Node bundle (Bun does not refresh named builtin imports when the benchmark installs its read observers).
418
448
 
419
449
  Members the file index cannot hold, outside the Nx workspace or under `node_modules`, are hashed by one runtime
420
450
  `smoo-nx-cargo-hash --closure <projectRoot> <Cargo.toml>` entry, present only while such members exist. Its cached
@@ -871,6 +901,17 @@ The installed-package census expands each declared `files` set and relative expo
871
901
  native output authority, always retaining the manifest, directory/alias namespace evidence and every resolution edge;
872
902
  without a file declaration it conservatively retains the whole package tree.
873
903
 
904
+ **Every call censuses the installed closure again; only file bytes are reused.** Each census resolves every edge, lists
905
+ every directory and stats every node. A file takes its SHA-256 from the census the witness records (or, after the graph
906
+ RPC, from the same call's earlier census) only when its stamp (device, inode, mode, size, and mtime and ctime in
907
+ nanoseconds) is the one that census read and that census did not read it in the tick it changed in; the witness records
908
+ those unproven files beside the identity, which binds what was read and never what was reused. Any write moves a file's
909
+ ctime to the tick it happens in, so a file written since, one the recorded census lacks, and one it recorded unproven
910
+ are read again. The key is the stamp and not a cheaper installation generation (a resolution, a manifest, an install
911
+ marker): a rebuild of a developer-linked package, this plugin's own `dist`, rewrites its files in place and moves none
912
+ 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,
913
+ its lstat pass alone 1.3–1.8 s.
914
+
874
915
  Ancestor directories bind device/inode/type/mode path identity; files and symlinks retain their full stamps, and a
875
916
  directory is upgraded to a full nanosecond node/namespace stamp when its membership is actually read.
876
917
 
@@ -883,10 +924,11 @@ This is git's racily clean rule (`Documentation/technical/racy-git.txt`), and th
883
924
  Nx's own file hashes. Node can read neither the jiffy nor a filesystem's granularity, and a shorter window reopens the
884
925
  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
926
  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.
927
+ that holds nothing to re-read it against counts it moved. The local plugin modules, which hash every byte on every read,
928
+ record their stamps as read. So does a workspace capture's own stability check, which compares the stamps it read: only
929
+ the capture after it distrusts them. The installed-package census records its stamps as read too, since its identity
930
+ binds what it read, and names beside them the files it read in their change tick, which the census that takes its hashes
931
+ reads again.
890
932
 
891
933
  A physically missing required factory after the clean cutover is an invalid installation and fails loudly; it is not a
892
934
  proof miss that can fall back to the graph RPC. Consumers adopt the normal static import only after the public producer
@@ -1633,14 +1675,33 @@ A fixture retires on every exit path, a throwing body included: stop its daemon,
1633
1675
  its root. A daemon that outlives the stop keeps the alias and the root, so the next run's sweep still finds both.
1634
1676
 
1635
1677
  A fixture workspace that runs real Nx with this plugin links an installation it owns, never the host's.
1636
- `@smoothbricks/nx-plugin/owned-installation`'s `ownedInstallation(censusRoot, makeRoot)` copies the closure the graph
1678
+ `@smoothbricks/nx-plugin/owned-installation`'s `ownedInstallation(censusRoot, name)` copies the closure the graph
1637
1679
  witness's installation census resolves from `censusRoot` (Nx, this plugin and TypeScript, each package with its
1638
- dependency edges relinked beside it and the top-level bins in `.bin`) into the empty directory `makeRoot` creates, on
1639
- the first `nodeModules()`, and proves the copy. `retire()` fails, naming the changed nodes, if a fixture wrote into it,
1640
- then deletes it. The host's closure moves under a fixture that reads it: a shared Bun store relinked by another install,
1641
- or, in a workspace that developer-links this plugin, the checkout its author is editing and rebuilding. Either fails the
1642
- producer receipt's installation proof for work that is not the test's. This package's tests bind `censusRoot` to this
1643
- repository; a consumer binds it to its own workspace root.
1680
+ dependency edges relinked beside it and the top-level bins in `.bin`), and keeps the copy as `name` in `censusRoot`'s
1681
+ tool cache, `node_modules/.cache/smoothbricks-nx-plugin/owned-installations/<name>`. Nothing sweeps that directory: a
1682
+ cowshed fork clones it with the build volume and main adopts it at land (specs/cowshed/16_build_volumes.md), so it is
1683
+ cold only after `node_modules` is reinstalled or the build volume reseeded. Making the copy is most of what a test file
1684
+ 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,
1685
+ since Bun's global store and every directory a cowshed job may write lie on different volumes. On the first
1686
+ `nodeModules()` of a run the census of the host closure and the proven census of the copy are compared package by
1687
+ package, by what each holds: resolution edges, node types and modes, and file bytes. A package whose copy no longer
1688
+ holds what the host's holds is copied again, and every package when the edges moved or the copy is unproved; a copy that
1689
+ was there and failed its proof is named on stderr with the reason. Both censuses take unmoved files' hashes from the
1690
+ ones recorded beside the copy, so a run that changes nothing reads no file bytes. `retire()` fails, naming the changed
1691
+ nodes, if a fixture wrote into the copy, and leaves it for the next run to prove. The host's closure moves under a
1692
+ fixture that reads it: a shared Bun store relinked by another install, or, in a workspace that developer-links this
1693
+ plugin, the checkout its author is editing and rebuilding. Either fails the producer receipt's installation proof for
1694
+ 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
1695
+ them makes again fails the other. This package's tests bind `censusRoot` to this repository; a consumer binds it to its
1696
+ own workspace root.
1697
+
1698
+ The copy lies beneath `censusRoot`'s `node_modules`. Where `node_modules/.cache` is a real directory, as on a fresh CI
1699
+ checkout (a cowshed build volume links it elsewhere), Node's ancestor lookup from the copy reaches the host's own
1700
+ packages, so a census of a missing or incomplete copy would resolve the host's. A census of the copy that resolves any
1701
+ package outside the copy therefore proves nothing about it: the copy is unproved and made again, and stderr names the
1702
+ resolution. Node keeps each resolution for the life of a process, so a copy made whole goes to a new directory,
1703
+ `installation-<uuid>`, which the record beside it names. The same lookup lets a package in the copy that requires a
1704
+ dependency it does not declare load the host's top-level one; the census binds declared edges only and cannot see that.
1644
1705
 
1645
1706
  ## Managed workspace files
1646
1707
 
@@ -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,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAS9C;CACF;AAgBD;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,4FAA4F;IAC5F,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,uCAAuC;IACvC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;IAC7B,6EAA6E;IAC7E,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACtC,QAAQ,CAAC,kBAAkB,EAAE,GAAG,CAAC,MAAM,EAAE,kBAAkB,EAAE,CAAC,CAAC;CAChE;AAED;;;;GAIG;AACH,wBAAsB,qBAAqB,CAAC,aAAa,EAAE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,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
  }
@@ -83,8 +83,8 @@ export interface CompiledCargoInput {
83
83
  }
84
84
  /**
85
85
  * Existing literal include_str!/include_bytes! files read by this package's Rust sources.
86
- * One graph owns the memo; runtime hashes use a fresh memo. Nested packages own their
87
- * sources separately. Computed paths and arbitrary build-script reads remain explicit inputs.
86
+ * One graph owns the memo; runtime hashing consumes the same discovery alongside source
87
+ * bytes. Nested packages own their sources separately. Computed paths remain explicit inputs.
88
88
  */
89
89
  export declare function compiledInFiles(root: string, cache: Map<string, CompiledCargoInput[]>): CompiledCargoInput[];
90
90
  //# sourceMappingURL=cargo-source-hash.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cargo-source-hash.d.ts","sourceRoot":"","sources":["../src/cargo-source-hash.ts"],"names":[],"mappings":"AAqFA,mFAAmF;AACnF,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,iHAAiH;IACjH,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;CACpC;AAED,kGAAkG;AAClG,MAAM,WAAW,YAAY;IAC3B,0CAA0C;IAC1C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,2EAA2E;IAC3E,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACtC,QAAQ,CAAC,KAAK,EAAE,SAAS,iBAAiB,EAAE,CAAC;IAC7C,sFAAsF;IACtF,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,GAAG,IAAI,CAAC;CAC/D;AAED,MAAM,WAAW,sBAAsB;IACrC,oHAAoH;IACpH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAkJD,2GAA2G;AAC3G,eAAO,MAAM,wBAAwB,YACnC,QAAQ,EACR,MAAM,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AAM,EAChB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,GAAG,SAAS,EAOvC;CACF;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC;IAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAAC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,CAAC,CAmF7D;AAoCD,wBAAsB,mBAAmB,CACvC,YAAY,EAAE,MAAM,EACpB,aAAa,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE,sBAAsB,GAC/B,OAAO,CAAC,MAAM,CAAC,CAoLjB;AAED;;;;GAIG;AACH,wBAAsB,iBAAiB,CAAC,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAc5G;AAoGD,yFAAyF;AACzF,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAgDD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,kBAAkB,EAAE,CAAC,GAAG,kBAAkB,EAAE,CAU5G"}
@@ -697,6 +697,7 @@ export async function hashCargoPathInputs(manifestPath, workspaceRoot, options)
697
697
  const inputKey = (pkg, role, path) => JSON.stringify([pkg.name, pkg.version, role, path.split(sep).join('/')]);
698
698
  const directories = new Map();
699
699
  const files = new Map();
700
+ const compareInputs = (left, right) => left.key < right.key ? -1 : left.key > right.key ? 1 : left.order - right.order;
700
701
  const ancestors = new Set();
701
702
  const links = new Map();
702
703
  const packageSources = [];
@@ -704,8 +705,12 @@ export async function hashCargoPathInputs(manifestPath, workspaceRoot, options)
704
705
  // deterministic without using a consuming checkout's mount path as an input.
705
706
  const includeFile = (file, key) => {
706
707
  const prior = files.get(file);
707
- if (prior === undefined || key < prior)
708
- files.set(file, key);
708
+ if (prior !== undefined && key >= prior.key)
709
+ return undefined;
710
+ // Rekeying must retain the old Map insertion order for equal v2 identities.
711
+ const input = { file, key, order: prior?.order ?? files.size };
712
+ files.set(file, input);
713
+ return input;
709
714
  };
710
715
  const packages = [...cargo.local].sort((left, right) => left.name < right.name
711
716
  ? -1
@@ -782,14 +787,21 @@ export async function hashCargoPathInputs(manifestPath, workspaceRoot, options)
782
787
  }
783
788
  for (const [directory, owner] of directories)
784
789
  await walk(directory, owner, '');
785
- const compiledCache = new Map();
790
+ const scans = new Map();
791
+ const groups = new Map();
786
792
  for (const [directory, owner] of directories) {
787
- for (const input of compiledInFiles(directory, compiledCache)) {
788
- if (!ignored(input.file)) {
789
- includeFile(await realpath(input.file), inputKey(owner, 'include', relative(directory, input.source) + '\0' + input.literal));
790
- }
791
- }
793
+ const scan = { directory, owner, sources: [...compiledSourceFiles(directory)], found: new Map() };
794
+ for (const source of scan.sources)
795
+ scans.set(source, scan);
796
+ // Equal package identities can interleave, so their discovery shares one boundary.
797
+ const prefix = JSON.stringify([owner.name, owner.version]).slice(0, -1) + ',';
798
+ const group = groups.get(prefix);
799
+ if (group === undefined)
800
+ groups.set(prefix, [scan]);
801
+ else
802
+ group.push(scan);
792
803
  }
804
+ const scheduled = [...files.values()].sort(compareInputs);
793
805
  const hash = createHash('sha256');
794
806
  hash.update('cargo-path-inputs-v2\0');
795
807
  for (const { key, target } of [...links.values()].sort((left, right) => left.key < right.key ? -1 : left.key > right.key ? 1 : 0)) {
@@ -798,14 +810,54 @@ export async function hashCargoPathInputs(manifestPath, workspaceRoot, options)
798
810
  hash.update(target);
799
811
  hash.update('\0');
800
812
  }
801
- for (const [file, key] of [...files].sort((left, right) => (left[1] < right[1] ? -1 : left[1] > right[1] ? 1 : 0))) {
802
- const bytes = await readFile(file);
803
- hash.update(key);
813
+ async function consume(input) {
814
+ if (files.get(input.file) !== input)
815
+ return;
816
+ const bytes = await readFile(input.file);
817
+ const scan = scans.get(input.file);
818
+ if (scan !== undefined) {
819
+ scans.delete(input.file);
820
+ collectCompiledInputs(input.file, bytes.toString('utf8'), scan.found);
821
+ }
822
+ hash.update(input.key);
804
823
  hash.update('\0');
805
824
  hash.update(String(bytes.length));
806
825
  hash.update('\0');
807
826
  hash.update(bytes);
808
827
  }
828
+ let next = 0;
829
+ for (const [prefix, group] of [...groups].sort(([left], [right]) => (left < right ? -1 : left > right ? 1 : 0))) {
830
+ // All ordinary sources have a file identity before this package's include identities.
831
+ // Earlier includes may already have consumed a later package's source; only its
832
+ // discovered references survive that boundary, never the source buffer.
833
+ const boundary = prefix + '"include",';
834
+ while (next < scheduled.length && scheduled[next].key < boundary)
835
+ await consume(scheduled[next++]);
836
+ const included = [];
837
+ for (const scan of group) {
838
+ for (const source of scan.sources) {
839
+ if (!scans.delete(source))
840
+ continue;
841
+ // Discovery also visits ignored sources. They have no scheduled identity;
842
+ // if an include alias later names one, preserve the old read-then-hash path.
843
+ collectCompiledInputs(source, readFileSync(source, 'utf8'), scan.found);
844
+ }
845
+ for (const input of [...scan.found.values()].sort((left, right) => left.file < right.file ? -1 : left.file > right.file ? 1 : 0)) {
846
+ if (ignored(input.file))
847
+ continue;
848
+ const accepted = includeFile(await realpath(input.file), inputKey(scan.owner, 'include', relative(scan.directory, input.source) + '\0' + input.literal));
849
+ if (accepted !== undefined)
850
+ included.push(accepted);
851
+ }
852
+ scan.found.clear();
853
+ }
854
+ for (const input of included.sort(compareInputs))
855
+ await consume(input);
856
+ while (next < scheduled.length && scheduled[next].key.startsWith(prefix))
857
+ await consume(scheduled[next++]);
858
+ }
859
+ while (next < scheduled.length)
860
+ await consume(scheduled[next++]);
809
861
  return hash.digest('hex');
810
862
  }
811
863
  /**
@@ -929,16 +981,7 @@ function gitRepository(directory) {
929
981
  const INCLUDE_CLOSERS = { '(': ')', '[': ']', '{': '}' };
930
982
  const INCLUDE_STRING = /^"([^"\\\r\n]*)"$/u;
931
983
  const INCLUDE_RAW_STRING = /^r(#*)"([\s\S]*)"\1$/u;
932
- /**
933
- * Existing literal include_str!/include_bytes! files read by this package's Rust sources.
934
- * One graph owns the memo; runtime hashes use a fresh memo. Nested packages own their
935
- * sources separately. Computed paths and arbitrary build-script reads remain explicit inputs.
936
- */
937
- export function compiledInFiles(root, cache) {
938
- const cached = cache.get(root);
939
- if (cached !== undefined)
940
- return cached;
941
- const found = new Map();
984
+ function* compiledSourceFiles(root) {
942
985
  const skipped = HASH_SKIPPED_DIRECTORIES;
943
986
  const scan = [root];
944
987
  while (scan.length > 0) {
@@ -952,34 +995,51 @@ export function compiledInFiles(root, cache) {
952
995
  scan.push(child);
953
996
  }
954
997
  else if (entry.isFile() && entry.name.endsWith('.rs')) {
955
- const text = readFileSync(child, 'utf8');
956
- if (!text.includes('include_'))
957
- continue;
958
- const tokens = rustTokens(text);
959
- for (let index = 0; index < tokens.length; index += 1) {
960
- if (tokens[index]?.text !== 'include_str' && tokens[index]?.text !== 'include_bytes')
961
- continue;
962
- if (tokens[index + 1]?.text !== '!')
963
- continue;
964
- const closing = INCLUDE_CLOSERS[tokens[index + 2]?.text ?? ''];
965
- const end = tokens[index + 4]?.text === ',' ? index + 5 : index + 4;
966
- if (closing === undefined || tokens[end]?.text !== closing)
967
- continue;
968
- const literal = tokens[index + 3]?.text ?? '';
969
- const path = INCLUDE_STRING.exec(literal)?.[1] ?? INCLUDE_RAW_STRING.exec(literal)?.[2];
970
- if (path === undefined || path === '')
971
- continue;
972
- const file = resolve(current, path);
973
- if (statSync(file, { throwIfNoEntry: false })?.isFile()) {
974
- const prior = found.get(file);
975
- if (prior === undefined || child < prior.source || (child === prior.source && path < prior.literal)) {
976
- found.set(file, { file, source: child, literal: path });
977
- }
978
- }
979
- }
998
+ yield child;
999
+ }
1000
+ }
1001
+ }
1002
+ }
1003
+ function collectCompiledInputs(source, text, found) {
1004
+ if (!text.includes('include_'))
1005
+ return;
1006
+ const tokens = rustTokens(text);
1007
+ for (let index = 0; index < tokens.length; index += 1) {
1008
+ if (tokens[index]?.text !== 'include_str' && tokens[index]?.text !== 'include_bytes')
1009
+ continue;
1010
+ if (tokens[index + 1]?.text !== '!')
1011
+ continue;
1012
+ const closing = INCLUDE_CLOSERS[tokens[index + 2]?.text ?? ''];
1013
+ const end = tokens[index + 4]?.text === ',' ? index + 5 : index + 4;
1014
+ if (closing === undefined || tokens[end]?.text !== closing)
1015
+ continue;
1016
+ // Own the spelling before matching: captures (and RegExp's last-match state)
1017
+ // must reference path-sized storage, not a view into the decoded source.
1018
+ const literal = Buffer.from(tokens[index + 3]?.text ?? '', 'utf8').toString('utf8');
1019
+ const path = INCLUDE_STRING.exec(literal)?.[1] ?? INCLUDE_RAW_STRING.exec(literal)?.[2];
1020
+ if (path === undefined || path === '')
1021
+ continue;
1022
+ const file = resolve(dirname(source), path);
1023
+ if (statSync(file, { throwIfNoEntry: false })?.isFile()) {
1024
+ const prior = found.get(file);
1025
+ if (prior === undefined || source < prior.source || (source === prior.source && path < prior.literal)) {
1026
+ found.set(file, { file, source, literal: path });
980
1027
  }
981
1028
  }
982
1029
  }
1030
+ }
1031
+ /**
1032
+ * Existing literal include_str!/include_bytes! files read by this package's Rust sources.
1033
+ * One graph owns the memo; runtime hashing consumes the same discovery alongside source
1034
+ * bytes. Nested packages own their sources separately. Computed paths remain explicit inputs.
1035
+ */
1036
+ export function compiledInFiles(root, cache) {
1037
+ const cached = cache.get(root);
1038
+ if (cached !== undefined)
1039
+ return cached;
1040
+ const found = new Map();
1041
+ for (const source of compiledSourceFiles(root))
1042
+ collectCompiledInputs(source, readFileSync(source, 'utf8'), found);
983
1043
  const files = [...found.values()].sort((left, right) => left.file < right.file ? -1 : left.file > right.file ? 1 : 0);
984
1044
  cache.set(root, files);
985
1045
  return files;
@@ -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.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,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