@smoothbricks/nx-plugin 0.5.7 → 0.6.1

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 (446) hide show
  1. package/README.md +1097 -360
  2. package/dist/.build-inputs.json +141 -0
  3. package/dist/bin/smoo-nx-cargo-toolchain.d.ts +3 -0
  4. package/dist/bin/smoo-nx-cargo-toolchain.d.ts.map +1 -0
  5. package/dist/bin/smoo-nx-cargo-toolchain.js +8 -0
  6. package/dist/bin/smoo-nx-forbidden-spellings.d.ts +3 -0
  7. package/dist/bin/smoo-nx-forbidden-spellings.d.ts.map +1 -0
  8. package/dist/bin/smoo-nx-forbidden-spellings.js +32 -0
  9. package/dist/bin/smoo-nx-nextest-timings.d.ts +3 -0
  10. package/dist/bin/smoo-nx-nextest-timings.d.ts.map +1 -0
  11. package/dist/bin/smoo-nx-nextest-timings.js +28 -0
  12. package/dist/bounded-test-policy.d.ts +1 -1
  13. package/dist/bounded-test-policy.d.ts.map +1 -1
  14. package/dist/bounded-test-policy.js +14 -15
  15. package/dist/build-state-output-policy.d.ts +95 -1
  16. package/dist/build-state-output-policy.d.ts.map +1 -1
  17. package/dist/build-state-output-policy.js +368 -30
  18. package/dist/bun-lock-scope.d.ts +44 -0
  19. package/dist/bun-lock-scope.d.ts.map +1 -0
  20. package/dist/bun-lock-scope.js +97 -0
  21. package/dist/cargo-build-script-env.d.ts +49 -0
  22. package/dist/cargo-build-script-env.d.ts.map +1 -0
  23. package/dist/cargo-build-script-env.js +324 -0
  24. package/dist/cargo-closure-input.d.ts +31 -4
  25. package/dist/cargo-closure-input.d.ts.map +1 -1
  26. package/dist/cargo-closure-input.js +66 -6
  27. package/dist/cargo-retention-hook.d.ts +17 -0
  28. package/dist/cargo-retention-hook.d.ts.map +1 -0
  29. package/dist/cargo-retention-hook.js +85 -0
  30. package/dist/cargo-source-hash.d.ts +25 -7
  31. package/dist/cargo-source-hash.d.ts.map +1 -1
  32. package/dist/cargo-source-hash.js +108 -43
  33. package/dist/cargo-toolchain-paths.d.ts +40 -0
  34. package/dist/cargo-toolchain-paths.d.ts.map +1 -0
  35. package/dist/cargo-toolchain-paths.js +84 -0
  36. package/dist/cargo-toolchain-policy.d.ts +25 -8
  37. package/dist/cargo-toolchain-policy.d.ts.map +1 -1
  38. package/dist/cargo-toolchain-policy.js +39 -5
  39. package/dist/cargo-workspace.d.ts +10 -4
  40. package/dist/cargo-workspace.d.ts.map +1 -1
  41. package/dist/cargo-workspace.js +65 -95
  42. package/dist/cross-check-policy.d.ts +9 -9
  43. package/dist/cross-check-policy.d.ts.map +1 -1
  44. package/dist/cross-check-policy.js +11 -11
  45. package/dist/disk-command-policy.d.ts.map +1 -1
  46. package/dist/disk-command-policy.js +1 -0
  47. package/dist/ensure-built-receipt.d.ts +22 -5
  48. package/dist/ensure-built-receipt.d.ts.map +1 -1
  49. package/dist/ensure-built-receipt.js +168 -48
  50. package/dist/ensure-built-witness.d.ts +27 -8
  51. package/dist/ensure-built-witness.d.ts.map +1 -1
  52. package/dist/ensure-built-witness.js +45 -15
  53. package/dist/ensure-built.d.ts.map +1 -1
  54. package/dist/ensure-built.js +9 -1
  55. package/dist/eslint-config-closure.d.ts +7 -0
  56. package/dist/eslint-config-closure.d.ts.map +1 -0
  57. package/dist/eslint-config-closure.js +346 -0
  58. package/dist/executors/bounded-exec/bounds.d.ts +56 -0
  59. package/dist/executors/bounded-exec/bounds.d.ts.map +1 -0
  60. package/dist/executors/bounded-exec/bounds.js +43 -0
  61. package/dist/executors/bounded-exec/cpu-pool-thread.d.ts +28 -0
  62. package/dist/executors/bounded-exec/cpu-pool-thread.d.ts.map +1 -0
  63. package/dist/executors/bounded-exec/cpu-pool-thread.js +20 -0
  64. package/dist/executors/bounded-exec/cpu-pool.d.ts +35 -38
  65. package/dist/executors/bounded-exec/cpu-pool.d.ts.map +1 -1
  66. package/dist/executors/bounded-exec/cpu-pool.js +56 -120
  67. package/dist/executors/bounded-exec/executor.d.ts +19 -12
  68. package/dist/executors/bounded-exec/executor.d.ts.map +1 -1
  69. package/dist/executors/bounded-exec/executor.js +389 -239
  70. package/dist/executors/bounded-exec/gateway-lease.d.ts +23 -19
  71. package/dist/executors/bounded-exec/gateway-lease.d.ts.map +1 -1
  72. package/dist/executors/bounded-exec/gateway-lease.js +102 -29
  73. package/dist/executors/bounded-exec/hang-diagnostics.d.ts +18 -1
  74. package/dist/executors/bounded-exec/hang-diagnostics.d.ts.map +1 -1
  75. package/dist/executors/bounded-exec/hang-diagnostics.js +148 -30
  76. package/dist/executors/bounded-exec/lease-wait.d.ts +64 -0
  77. package/dist/executors/bounded-exec/lease-wait.d.ts.map +1 -0
  78. package/dist/executors/bounded-exec/lease-wait.js +72 -0
  79. package/dist/executors/bounded-exec/lock-wait.d.ts +51 -0
  80. package/dist/executors/bounded-exec/lock-wait.d.ts.map +1 -0
  81. package/dist/executors/bounded-exec/lock-wait.js +108 -0
  82. package/dist/executors/bounded-exec/mbx-pool.d.ts +31 -0
  83. package/dist/executors/bounded-exec/mbx-pool.d.ts.map +1 -0
  84. package/dist/executors/bounded-exec/mbx-pool.js +24 -0
  85. package/dist/executors/bounded-exec/owned-subtree.d.ts +84 -0
  86. package/dist/executors/bounded-exec/owned-subtree.d.ts.map +1 -0
  87. package/dist/executors/bounded-exec/owned-subtree.js +178 -0
  88. package/dist/executors/bounded-exec/progress.d.ts +4 -1
  89. package/dist/executors/bounded-exec/progress.d.ts.map +1 -1
  90. package/dist/executors/bounded-exec/progress.js +5 -2
  91. package/dist/executors/bounded-exec/ram-attach.d.ts +19 -0
  92. package/dist/executors/bounded-exec/ram-attach.d.ts.map +1 -0
  93. package/dist/executors/bounded-exec/ram-attach.js +207 -0
  94. package/dist/executors/bounded-exec/ram-detach.d.ts +25 -0
  95. package/dist/executors/bounded-exec/ram-detach.d.ts.map +1 -0
  96. package/dist/executors/bounded-exec/ram-detach.js +207 -0
  97. package/dist/executors/bounded-exec/ram-temp-fixtures.d.ts +76 -0
  98. package/dist/executors/bounded-exec/ram-temp-fixtures.d.ts.map +1 -1
  99. package/dist/executors/bounded-exec/ram-temp-fixtures.js +296 -0
  100. package/dist/executors/bounded-exec/ram-temp.d.ts +388 -88
  101. package/dist/executors/bounded-exec/ram-temp.d.ts.map +1 -1
  102. package/dist/executors/bounded-exec/ram-temp.js +1213 -399
  103. package/dist/executors/bounded-exec/run-cpu-pool.d.ts +10 -4
  104. package/dist/executors/bounded-exec/run-cpu-pool.d.ts.map +1 -1
  105. package/dist/executors/bounded-exec/run-cpu-pool.js +122 -35
  106. package/dist/executors/bounded-exec/runner-hook.js +14 -5
  107. package/dist/executors/bounded-exec/runner-lifecycle.d.ts +14 -1
  108. package/dist/executors/bounded-exec/runner-lifecycle.d.ts.map +1 -1
  109. package/dist/executors/bounded-exec/runner-lifecycle.js +27 -6
  110. package/dist/executors/bounded-exec/{cpu-tokens.d.ts → runner-sizing.d.ts} +14 -42
  111. package/dist/executors/bounded-exec/runner-sizing.d.ts.map +1 -0
  112. package/dist/executors/bounded-exec/{cpu-tokens.js → runner-sizing.js} +5 -35
  113. package/dist/executors/bounded-exec/runtime-pin.d.ts +73 -0
  114. package/dist/executors/bounded-exec/runtime-pin.d.ts.map +1 -0
  115. package/dist/executors/bounded-exec/runtime-pin.js +167 -0
  116. package/dist/executors/bounded-exec/schema.d.ts +18 -1
  117. package/dist/executors/bounded-exec/schema.d.ts.map +1 -1
  118. package/dist/executors/bounded-exec/verdict.d.ts +48 -11
  119. package/dist/executors/bounded-exec/verdict.d.ts.map +1 -1
  120. package/dist/executors/bounded-exec/verdict.js +89 -20
  121. package/dist/executors/cargo-zigbuild/executor.d.ts +21 -0
  122. package/dist/executors/cargo-zigbuild/executor.d.ts.map +1 -1
  123. package/dist/executors/cargo-zigbuild/executor.js +67 -12
  124. package/dist/executors/clean-outputs/executor.js +1 -0
  125. package/dist/executors/scriptc-native/executor.d.ts +79 -0
  126. package/dist/executors/scriptc-native/executor.d.ts.map +1 -0
  127. package/dist/executors/scriptc-native/executor.js +367 -0
  128. package/dist/executors/scriptc-native/ffi-paths.d.ts +9 -0
  129. package/dist/executors/scriptc-native/ffi-paths.d.ts.map +1 -0
  130. package/dist/executors/scriptc-native/ffi-paths.js +25 -0
  131. package/dist/executors/scriptc-native/schema.d.ts +34 -0
  132. package/dist/executors/scriptc-native/schema.d.ts.map +1 -0
  133. package/dist/executors/scriptc-native/schema.js +1 -0
  134. package/dist/executors/typescript-emit/emit-overrides.d.ts +14 -0
  135. package/dist/executors/typescript-emit/emit-overrides.d.ts.map +1 -0
  136. package/dist/executors/typescript-emit/emit-overrides.js +24 -0
  137. package/dist/executors/typescript-emit/executor.d.ts +3 -1
  138. package/dist/executors/typescript-emit/executor.d.ts.map +1 -1
  139. package/dist/executors/typescript-emit/executor.js +146 -33
  140. package/dist/forbidden-spelling-policy.d.ts +56 -0
  141. package/dist/forbidden-spelling-policy.d.ts.map +1 -0
  142. package/dist/forbidden-spelling-policy.js +176 -0
  143. package/dist/generators/create-package/generator.d.ts.map +1 -1
  144. package/dist/generators/create-package/generator.js +3 -4
  145. package/dist/graph-input-contract.d.ts +14 -0
  146. package/dist/graph-input-contract.d.ts.map +1 -1
  147. package/dist/graph-input-contract.js +67 -2
  148. package/dist/index.d.ts +23 -6
  149. package/dist/index.d.ts.map +1 -1
  150. package/dist/index.js +672 -214
  151. package/dist/managed-assets.d.ts +2 -0
  152. package/dist/managed-assets.d.ts.map +1 -1
  153. package/dist/managed-files/files.d.ts +3 -3
  154. package/dist/managed-files/files.d.ts.map +1 -1
  155. package/dist/managed-files/files.js +28 -3
  156. package/dist/managed-files/managed-format.d.ts.map +1 -1
  157. package/dist/managed-files/managed-format.js +1 -0
  158. package/dist/managed-files/publish-workflow.js +14 -11
  159. package/dist/nextest-code-bound.js +1 -0
  160. package/dist/nextest-timings.d.ts +35 -0
  161. package/dist/nextest-timings.d.ts.map +1 -0
  162. package/dist/nextest-timings.js +168 -0
  163. package/dist/owned-installation.d.ts +6 -5
  164. package/dist/owned-installation.d.ts.map +1 -1
  165. package/dist/owned-installation.js +150 -26
  166. package/dist/package-target-policy.d.ts.map +1 -1
  167. package/dist/package-target-policy.js +2 -3
  168. package/dist/process-children.d.ts +7 -0
  169. package/dist/process-children.d.ts.map +1 -0
  170. package/dist/process-children.darwin.d.ts +7 -0
  171. package/dist/process-children.darwin.d.ts.map +1 -0
  172. package/dist/process-children.darwin.js +13 -0
  173. package/dist/process-children.js +14 -0
  174. package/dist/process-children.linux.d.ts +8 -0
  175. package/dist/process-children.linux.d.ts.map +1 -0
  176. package/dist/process-children.linux.js +25 -0
  177. package/dist/process-group.d.ts +108 -0
  178. package/dist/process-group.d.ts.map +1 -0
  179. package/dist/process-group.js +171 -0
  180. package/dist/process-listing.d.ts +7 -0
  181. package/dist/process-listing.d.ts.map +1 -0
  182. package/dist/process-listing.js +51 -0
  183. package/dist/producer-receipts.d.ts +8 -2
  184. package/dist/producer-receipts.d.ts.map +1 -1
  185. package/dist/producer-receipts.js +514 -47
  186. package/dist/task-graph-policy.d.ts +21 -0
  187. package/dist/task-graph-policy.d.ts.map +1 -0
  188. package/dist/task-graph-policy.js +91 -0
  189. package/dist/test-timings.js +4 -4
  190. package/dist/test-walk-policy.d.ts +14 -5
  191. package/dist/test-walk-policy.d.ts.map +1 -1
  192. package/dist/test-walk-policy.js +8 -2
  193. package/dist/testing.d.ts +73 -28
  194. package/dist/testing.d.ts.map +1 -1
  195. package/dist/testing.js +217 -223
  196. package/dist/tool-bins.d.ts +33 -0
  197. package/dist/tool-bins.d.ts.map +1 -0
  198. package/dist/tool-bins.js +72 -0
  199. package/dist/typecheck-test-policy.d.ts.map +1 -1
  200. package/dist/typecheck-test-policy.js +3 -4
  201. package/dist/wait-why-policy.d.ts +28 -0
  202. package/dist/wait-why-policy.d.ts.map +1 -0
  203. package/dist/wait-why-policy.js +223 -0
  204. package/dist/workspace-config-policy.d.ts +14 -8
  205. package/dist/workspace-config-policy.d.ts.map +1 -1
  206. package/dist/workspace-config-policy.js +60 -16
  207. package/dist/workspace-manifest.d.ts +41 -6
  208. package/dist/workspace-manifest.d.ts.map +1 -1
  209. package/dist/workspace-manifest.js +57 -0
  210. package/executors.json +16 -1
  211. package/loader.js +2 -0
  212. package/managed/raw/envrc +11 -0
  213. package/managed/raw/patches/nx@23.2.1.patch +2840 -199
  214. package/managed/raw/patches/ttsc@0.34.1.patch +119 -0
  215. package/managed/raw/tooling/direnv/cargo-fetch-bound.ts +245 -0
  216. package/managed/raw/tooling/direnv/cargo-fetch-run.ts +299 -0
  217. package/managed/raw/tooling/direnv/compiler-variables.sh +42 -0
  218. package/managed/raw/tooling/direnv/developer-links.ts +464 -25
  219. package/managed/raw/tooling/direnv/devenv.smoo.nix +78 -38
  220. package/managed/raw/tooling/direnv/github-actions-bootstrap.sh +14 -12
  221. package/managed/raw/tooling/direnv/installed-bun-links.ts +308 -0
  222. package/managed/raw/tooling/direnv/linked-snapshots.ts +62 -3
  223. package/managed/raw/tooling/direnv/nx-socket-dir.sh +56 -17
  224. package/managed/raw/tooling/direnv/repo-path +68 -6
  225. package/managed/raw/tooling/direnv/secret-references.ts +13 -4
  226. package/managed/raw/tooling/direnv/setup-environment.ts +128 -537
  227. package/managed/raw/tooling/direnv/toolchain-stamp.ts +4 -2
  228. package/managed/raw/tooling/direnv/ttsc-env.sh +9 -0
  229. package/managed/raw/tooling/direnv/uv-relocation.ts +227 -0
  230. package/managed/raw/tooling/git-hooks/commit-msg.sh +2 -1
  231. package/managed/raw/tooling/git-hooks/pre-commit.sh +2 -1
  232. package/managed/raw/tooling/git-hooks/pre-push.sh +2 -1
  233. package/managed/templates/github/actions/cache-ttsc-plugins/action.yml +85 -7
  234. package/managed/templates/github/actions/save-nix-devenv/action.yml +12 -2
  235. package/managed/templates/github/actions/setup-devenv/action.yml +2 -0
  236. package/package.json +95 -14
  237. package/src/bin/smoo-nx-cargo-toolchain.ts +11 -0
  238. package/src/bin/smoo-nx-forbidden-spellings.ts +33 -0
  239. package/src/bin/smoo-nx-nextest-timings.ts +31 -0
  240. package/src/bounded-test-policy.ts +12 -14
  241. package/src/build-state-output-policy.ts +458 -34
  242. package/src/bun-lock-scope.ts +108 -0
  243. package/src/cargo-build-script-env.ts +265 -0
  244. package/src/cargo-closure-input.ts +74 -7
  245. package/src/cargo-retention-hook.ts +94 -0
  246. package/src/cargo-source-hash.ts +138 -41
  247. package/src/cargo-toolchain-paths.ts +95 -0
  248. package/src/cargo-toolchain-policy.ts +49 -5
  249. package/src/cargo-workspace.ts +72 -123
  250. package/src/cross-check-policy.ts +12 -10
  251. package/src/disk-command-policy.ts +1 -0
  252. package/src/ensure-built-receipt.ts +173 -39
  253. package/src/ensure-built-witness.ts +62 -10
  254. package/src/ensure-built.ts +11 -1
  255. package/src/eslint-config-closure.ts +357 -0
  256. package/src/executors/bounded-exec/bounds.ts +76 -0
  257. package/src/executors/bounded-exec/cpu-pool-thread.ts +43 -0
  258. package/src/executors/bounded-exec/cpu-pool.ts +55 -120
  259. package/src/executors/bounded-exec/executor.ts +442 -260
  260. package/src/executors/bounded-exec/gateway-lease.ts +94 -35
  261. package/src/executors/bounded-exec/hang-diagnostics.ts +173 -31
  262. package/src/executors/bounded-exec/lease-wait.ts +116 -0
  263. package/src/executors/bounded-exec/lock-wait.ts +141 -0
  264. package/src/executors/bounded-exec/mbx-pool.ts +48 -0
  265. package/src/executors/bounded-exec/owned-subtree.ts +235 -0
  266. package/src/executors/bounded-exec/progress.ts +9 -3
  267. package/src/executors/bounded-exec/ram-attach.ts +238 -0
  268. package/src/executors/bounded-exec/ram-detach.ts +226 -0
  269. package/src/executors/bounded-exec/ram-temp-fixtures.ts +358 -0
  270. package/src/executors/bounded-exec/ram-temp-registry.txt +440 -0
  271. package/src/executors/bounded-exec/ram-temp.ts +1497 -460
  272. package/src/executors/bounded-exec/run-cpu-pool.ts +129 -35
  273. package/src/executors/bounded-exec/runner-hook.ts +14 -6
  274. package/src/executors/bounded-exec/runner-lifecycle.ts +31 -8
  275. package/src/executors/bounded-exec/{cpu-tokens.ts → runner-sizing.ts} +13 -59
  276. package/src/executors/bounded-exec/runtime-pin.ts +232 -0
  277. package/src/executors/bounded-exec/schema.json +11 -2
  278. package/src/executors/bounded-exec/schema.ts +19 -1
  279. package/src/executors/bounded-exec/verdict.ts +145 -35
  280. package/src/executors/cargo-zigbuild/executor.ts +82 -8
  281. package/src/executors/clean-outputs/executor.ts +1 -0
  282. package/src/executors/scriptc-native/executor.ts +394 -0
  283. package/src/executors/scriptc-native/ffi-paths.ts +29 -0
  284. package/src/executors/scriptc-native/schema.json +60 -0
  285. package/src/executors/scriptc-native/schema.ts +34 -0
  286. package/src/executors/typescript-emit/emit-overrides.ts +24 -0
  287. package/src/executors/typescript-emit/executor.ts +186 -38
  288. package/src/forbidden-spelling-policy.ts +226 -0
  289. package/src/generators/create-package/generator.ts +7 -7
  290. package/src/graph-input-contract.ts +61 -2
  291. package/src/index.ts +788 -224
  292. package/src/managed-assets.ts +3 -0
  293. package/src/managed-files/files.ts +28 -3
  294. package/src/managed-files/managed-format.ts +1 -0
  295. package/src/managed-files/publish-workflow.ts +20 -15
  296. package/src/nextest-code-bound.ts +1 -0
  297. package/src/nextest-timings.ts +106 -0
  298. package/src/owned-installation.ts +150 -23
  299. package/src/package-target-policy.ts +2 -3
  300. package/src/process-children.darwin.ts +14 -0
  301. package/src/process-children.linux.ts +33 -0
  302. package/src/process-children.ts +22 -0
  303. package/src/process-group.ts +209 -0
  304. package/src/process-listing.ts +54 -0
  305. package/src/producer-receipts.ts +92 -41
  306. package/src/task-graph-policy.ts +98 -0
  307. package/src/test-walk-policy.ts +23 -8
  308. package/src/testing.ts +240 -232
  309. package/src/tool-bins.ts +108 -0
  310. package/src/typecheck-test-policy.ts +2 -3
  311. package/src/wait-why-policy.ts +226 -0
  312. package/src/workspace-config-policy.ts +63 -15
  313. package/src/workspace-manifest.ts +89 -6
  314. package/test-timings.json +124 -99
  315. package/dist/bin/smoo-nx-failures.d.ts +0 -3
  316. package/dist/bin/smoo-nx-failures.d.ts.map +0 -1
  317. package/dist/bin/smoo-nx-failures.js +0 -3
  318. package/dist/bin/smoo-nx-nextest-extract.d.ts +0 -3
  319. package/dist/bin/smoo-nx-nextest-extract.d.ts.map +0 -1
  320. package/dist/bin/smoo-nx-nextest-extract.js +0 -42
  321. package/dist/executors/bounded-exec/cpu-tokens.d.ts.map +0 -1
  322. package/dist/failure-summary.d.ts +0 -5
  323. package/dist/failure-summary.d.ts.map +0 -1
  324. package/dist/failure-summary.js +0 -118
  325. package/dist/nextest-extraction.d.ts +0 -117
  326. package/dist/nextest-extraction.d.ts.map +0 -1
  327. package/dist/nextest-extraction.js +0 -303
  328. package/managed/raw/patches/ttsc@0.30.4.patch +0 -2255
  329. package/src/__tests__/cargo-closure-filesets.ts +0 -94
  330. package/src/__tests__/cargo-closure-fixture.ts +0 -113
  331. package/src/__tests__/counted-cargo-process.ts +0 -286
  332. package/src/__tests__/counted-cargo.ts +0 -713
  333. package/src/__tests__/directory-change.ts +0 -27
  334. package/src/__tests__/fixture-cargo-home.ts +0 -36
  335. package/src/__tests__/fixture-nx-env.ts +0 -193
  336. package/src/__tests__/owned-installation.ts +0 -13
  337. package/src/__tests__/past-tick.ts +0 -12
  338. package/src/__tests__/progress-clock.ts +0 -43
  339. package/src/__tests__/runtime-input.ts +0 -23
  340. package/src/bin/smoo-nx-bound-failures.test.ts +0 -127
  341. package/src/bin/smoo-nx-failures.ts +0 -4
  342. package/src/bin/smoo-nx-nextest-extract.ts +0 -44
  343. package/src/bounded-test-policy.test.ts +0 -1029
  344. package/src/build-state-output-policy.test.ts +0 -115
  345. package/src/bun-bootstrap.test.ts +0 -102
  346. package/src/bun-file-packages.test.ts +0 -47
  347. package/src/cargo-closure-filesets.test.ts +0 -63
  348. package/src/cargo-closure-input.property.test.ts +0 -50
  349. package/src/cargo-closure-input.test.ts +0 -506
  350. package/src/cargo-closure-key.test.ts +0 -240
  351. package/src/cargo-resolve-cache.test.ts +0 -1181
  352. package/src/cargo-source-hash.test.ts +0 -707
  353. package/src/cargo-workspace.test.ts +0 -615
  354. package/src/cross-check-policy.test.ts +0 -316
  355. package/src/disk-command-policy.test.ts +0 -61
  356. package/src/ensure-built-receipt.test.ts +0 -279
  357. package/src/ensure-built-witness.test.ts +0 -688
  358. package/src/ensure-built.test.ts +0 -1462
  359. package/src/executors/all-verdicts/executor.test.ts +0 -135
  360. package/src/executors/bounded-exec/cargo-progress-host.test.ts +0 -332
  361. package/src/executors/bounded-exec/cpu-pool.test.ts +0 -684
  362. package/src/executors/bounded-exec/cpu-tokens.test.ts +0 -519
  363. package/src/executors/bounded-exec/disk-lease.test.ts +0 -219
  364. package/src/executors/bounded-exec/executor-host.test.ts +0 -800
  365. package/src/executors/bounded-exec/executor.test.ts +0 -1819
  366. package/src/executors/bounded-exec/go-progress-host.test.ts +0 -171
  367. package/src/executors/bounded-exec/hang-diagnostics.test.ts +0 -291
  368. package/src/executors/bounded-exec/progress.test.ts +0 -139
  369. package/src/executors/bounded-exec/ram-temp-held.test.ts +0 -264
  370. package/src/executors/bounded-exec/ram-temp-host.test.ts +0 -635
  371. package/src/executors/bounded-exec/ram-temp.test.ts +0 -750
  372. package/src/executors/bounded-exec/run-cpu-pool.test.ts +0 -79
  373. package/src/executors/bounded-exec/runner-hook.test.ts +0 -193
  374. package/src/executors/bounded-exec/runner-lifecycle.test.ts +0 -82
  375. package/src/executors/bounded-exec/verdict.test.ts +0 -545
  376. package/src/executors/cargo-zigbuild/executor.test.ts +0 -129
  377. package/src/executors/clean-outputs/executor.test.ts +0 -20
  378. package/src/executors/typescript-emit/executor.test.ts +0 -83
  379. package/src/failure-summary.ts +0 -119
  380. package/src/generators/bounded-test-targets/generator.test.ts +0 -138
  381. package/src/generators/bun-test-tracing/generator.test.ts +0 -250
  382. package/src/generators/create-package/generator.test.ts +0 -190
  383. package/src/generators/make-public/generator.test.ts +0 -137
  384. package/src/graph-input-contract.test.ts +0 -379
  385. package/src/host-controller-wiring.test.ts +0 -31
  386. package/src/index.test.ts +0 -3321
  387. package/src/linked-snapshots.nx.test.ts +0 -254
  388. package/src/managed-files/forgejo-artifact.test.ts +0 -395
  389. package/src/managed-files/generator.test.ts +0 -243
  390. package/src/managed-files/github-host-cache-isolation.test.ts +0 -86
  391. package/src/managed-files/json-edit.test.ts +0 -216
  392. package/src/managed-files/managed-content.test.ts +0 -166
  393. package/src/managed-files/managed-format-json.test.ts +0 -308
  394. package/src/managed-files/repo-path.test.ts +0 -172
  395. package/src/managed-files/setup-devenv-free-disk.test.ts +0 -95
  396. package/src/managed-files/trace-db-artifact.test.ts +0 -7
  397. package/src/managed-files/tree-permissions.test.ts +0 -109
  398. package/src/managed-files/tree.test.ts +0 -123
  399. package/src/manifest-hash.test.ts +0 -219
  400. package/src/nextest-code-bound.test.ts +0 -161
  401. package/src/nextest-extraction.test.ts +0 -216
  402. package/src/nextest-extraction.ts +0 -371
  403. package/src/nextest-partitions.test.ts +0 -501
  404. package/src/nx-cache-bound.test.ts +0 -109
  405. package/src/nx-cache-restore-mtime.test.ts +0 -170
  406. package/src/nx-daemon-claim.test.ts +0 -279
  407. package/src/nx-daemon-idle-cpu.test.ts +0 -80
  408. package/src/nx-daemon-idle-policy.test.ts +0 -111
  409. package/src/nx-daemon-ignore-files.test.ts +0 -210
  410. package/src/nx-daemon-root-normalization.test.ts +0 -105
  411. package/src/nx-daemon-start-never.test.ts +0 -292
  412. package/src/nx-daemon-validity.test.ts +0 -1055
  413. package/src/nx-dot-input-policy.test.ts +0 -353
  414. package/src/nx-failure-life-cycles.test.ts +0 -207
  415. package/src/nx-files-archive-racy.test.ts +0 -97
  416. package/src/nx-foreign-workspace-env.test.ts +0 -329
  417. package/src/nx-incomplete-run-summary.test.ts +0 -70
  418. package/src/nx-plugin-load-errors.test.ts +0 -120
  419. package/src/nx-project-graph-errors.test.ts +0 -70
  420. package/src/nx-project-resolution-cache.test.ts +0 -176
  421. package/src/nx-raw-inputs.test.ts +0 -166
  422. package/src/nx-resident-graph-workers.test.ts +0 -112
  423. package/src/nx-run-information.test.ts +0 -118
  424. package/src/nx-skipped-task-exit.test.ts +0 -180
  425. package/src/nx-state-location.test.ts +0 -63
  426. package/src/nx-store-resolution.test.ts +0 -81
  427. package/src/nx-task-graph-cycles.test.ts +0 -148
  428. package/src/nx-task-output-lease.test.ts +0 -550
  429. package/src/nx-use-local.test.ts +0 -105
  430. package/src/owned-installation.test.ts +0 -105
  431. package/src/package-target-policy.test.ts +0 -1014
  432. package/src/producer-receipts.test.ts +0 -285
  433. package/src/release-config-policy.test.ts +0 -311
  434. package/src/runtime-input.test.ts +0 -393
  435. package/src/serial-group-wiring.test.ts +0 -326
  436. package/src/task-history-namespace.test.ts +0 -181
  437. package/src/task-results.test.ts +0 -228
  438. package/src/test-clock-policy.test.ts +0 -338
  439. package/src/test-program.test.ts +0 -303
  440. package/src/test-timings.test.ts +0 -240
  441. package/src/test-walk-policy.test.ts +0 -620
  442. package/src/testing.test.ts +0 -509
  443. package/src/typecheck-test-policy.test.ts +0 -1468
  444. package/src/typescript-resolution.test.ts +0 -76
  445. package/src/version-actions.test.ts +0 -80
  446. package/src/workspace-config-policy.test.ts +0 -737
@@ -8,7 +8,7 @@ import { runtimeInput, shellWord } from './runtime-input.js';
8
8
  * The DECLARED pin, hashed as an ordinary file. devenv resolves this lock into
9
9
  * the rustc, cargo, linker, C toolchain and SDK that every cargo command
10
10
  * inherits, so a bump here is exactly the event that must invalidate a cached
11
- * artifact — and it is the only such event the workspace can state portably.
11
+ * artifact — and it is the half of the identity that a file can state portably.
12
12
  *
13
13
  * This replaces a runtime input that dumped the ambient cargo environment
14
14
  * (every `CARGO_`, `RUST`, `CC`, `CXX`, `AR`, `SDKROOT`, `LIBCLANG_PATH`,
@@ -44,14 +44,31 @@ export const CARGO_TOOLCHAIN_PIN_INPUTS = [
44
44
  '{workspaceRoot}/tooling/direnv/devenv.lock',
45
45
  ];
46
46
  /**
47
- * The name a repository's own `inputs` declaration uses to reach the pin
48
- * without restating its paths.
47
+ * The runtime input naming the programs the shell declares for Cargo to compile and link with, by Nix store object:
48
+ * the other half of the identity, which no file states (cargo-toolchain-paths.ts says what it names, and why). Nx runs
49
+ * a runtime input from the workspace root, so the command names the plugin as the workspace's `node_modules` links it.
50
+ */
51
+ const CARGO_TOOLCHAIN_PATHS_COMMAND = 'node node_modules/@smoothbricks/nx-plugin/dist/bin/smoo-nx-cargo-toolchain.js';
52
+ /** The runtime input of the programs the shell declares, a fresh value for each caller. */
53
+ export function cargoToolchainPathsInput() {
54
+ return runtimeInput(CARGO_TOOLCHAIN_PATHS_COMMAND);
55
+ }
56
+ /** Every input a cargo task's key names of its toolchain: the pin files, then the programs the shell declares. */
57
+ export function cargoToolchainInputs() {
58
+ return [...CARGO_TOOLCHAIN_PIN_INPUTS, cargoToolchainPathsInput()];
59
+ }
60
+ /**
61
+ * The name a repository's own `inputs` declaration uses to reach the whole
62
+ * toolchain identity without restating it.
49
63
  *
50
64
  * A declared target REPLACES the inferred input list, pin included, so a
51
65
  * hand-written `inputs` array silently drops the toolchain identity and the
52
66
  * target stops seeing a toolchain bump at all. Inference defines this named
53
67
  * input on every project that has cargo targets so a declaration can name one
54
68
  * token that cannot drift from what the plugin attaches.
69
+ *
70
+ * The identity holds an input no fileset can state, so a declaration names this
71
+ * rather than restating the lock.
55
72
  */
56
73
  export const CARGO_TOOLCHAIN_NAMED_INPUT = 'cargoToolchain';
57
74
  /** The toolchain versions `command` prints, from the directory whose rust-toolchain selects them. */
@@ -59,12 +76,29 @@ export function cargoRuntimeInput(projectRoot, command) {
59
76
  return runtimeInput(`sh -c ${shellWord(`cd "$0" && ${command}`)} ${shellWord(projectRoot)}`);
60
77
  }
61
78
  /**
62
- * Does one resolved input string carry the toolchain identity?
79
+ * Does one resolved input string hold a toolchain lock?
63
80
  *
64
81
  * Resolved: named inputs already expanded. The check is by suffix rather than
65
82
  * by exact path because a repository may keep its lock at a location this list
66
83
  * does not name; what matters is that a devenv lock is hashed, not which one.
67
84
  */
68
- export function isCargoToolchainInput(input) {
85
+ function isCargoToolchainLock(input) {
69
86
  return !input.startsWith('!') && input.endsWith('/devenv.lock');
70
87
  }
88
+ /**
89
+ * Does a resolved input list carry the toolchain identity?
90
+ *
91
+ * `reached` is what a declaration's inputs hold once their named inputs are resolved. The inference-owned
92
+ * `cargoToolchain`, left unresolved, stands for the whole identity. Otherwise the list must hold both halves itself: a
93
+ * devenv lock that nothing in the list excludes, and the programs runtime input exactly as inference spells it. A lock
94
+ * restated without the programs is refused, however it is reached: no fileset can state the programs the shell
95
+ * declares, so a list that stops at the lock misses a change to the linker.
96
+ */
97
+ export function carriesCargoToolchain(reached) {
98
+ if (reached.includes(CARGO_TOOLCHAIN_NAMED_INPUT))
99
+ return true;
100
+ const excluded = new Set(reached.flatMap((input) => (typeof input === 'string' && input.startsWith('!') ? [input.slice(1)] : [])));
101
+ const hasLock = reached.some((input) => typeof input === 'string' && isCargoToolchainLock(input) && !excluded.has(input));
102
+ const programs = cargoToolchainPathsInput().runtime;
103
+ return hasLock && reached.some((input) => typeof input === 'object' && input.runtime === programs);
104
+ }
@@ -1,5 +1,5 @@
1
1
  import { type TomlTable } from 'smol-toml';
2
- import { type CompiledCargoInput } from './cargo-source-hash.js';
2
+ import { type CargoResolve, type CompiledCargoInput } from './cargo-source-hash.js';
3
3
  export interface CargoWorkspacePackage {
4
4
  name: string;
5
5
  dir: string;
@@ -38,6 +38,8 @@ export interface CargoPackageTestInputsOptions {
38
38
  /** The cargo workspace root holding the top-level `Cargo.toml`. */
39
39
  absoluteProjectRoot: string;
40
40
  memberDir: string;
41
+ /** Cargo's locked resolve of that workspace, which decides the crates the member's tests build. */
42
+ cargo: CargoResolve;
41
43
  /** Shared across every call of one graph computation; see {@link createCargoInputsCache}. */
42
44
  cache?: CargoInputsCache;
43
45
  }
@@ -58,14 +60,18 @@ export interface CargoInputsCache {
58
60
  }
59
61
  export declare function createCargoInputsCache(): CargoInputsCache;
60
62
  export declare function cargoPackageTestInputs(options: CargoPackageTestInputsOptions): Promise<string[]>;
63
+ /**
64
+ * Refuses inputs outside the Nx workspace that `nx.json` gives no `externalRustCrates` runtime hash for: no fileset
65
+ * can hash them, and a key without them would replay a verdict across their edits. `external` maps each input's name
66
+ * to its path.
67
+ */
68
+ export declare function requireExternalRustCratesInput(workspaceRoot: string, manifest: string, external: ReadonlyMap<string, string>): void;
61
69
  /**
62
70
  * The aggregate that actually runs a cargo workspace's tests. Named here because
63
71
  * both target inference and the policy that verifies `test` reaches it need the
64
72
  * same string, and a drifted copy would make the policy vacuous.
65
73
  */
66
74
  export declare const CARGO_TEST_TARGET = "cargo-test";
67
- /** Prerequisite that compiles the workspace; not a per-crate runner. */
68
- export declare const CARGO_TEST_COMPILE_TARGET = "cargo-test-compile";
69
75
  /**
70
76
  * The one workspace-wide `cargo nextest archive` every per-crate runner
71
77
  * executes from. Named here beside the other cargo target names so the policy
@@ -256,7 +262,7 @@ export declare const PLUGIN_NEXTEST_CONFIG_PATH = "node_modules/@smoothbricks/nx
256
262
  * contain spaces.
257
263
  *
258
264
  * The file is named through the workspace root's `node_modules` link, as
259
- * `NEXTEST_EXTRACT_BIN` is, never through where the plugin really lives: a
265
+ * tool package CLIs are (tool-bins.ts), never through where the plugin really lives: a
260
266
  * plugin linked from a checkout outside the workspace sits a different number
261
267
  * of `../` away from each workspace depending on how deep that workspace is,
262
268
  * and that count re-keyed every target of every Cargo project — and every
@@ -1 +1 @@
1
- {"version":3,"file":"cargo-workspace.d.ts","sourceRoot":"","sources":["../src/cargo-workspace.ts"],"names":[],"mappings":"AAIA,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC;AAE/D,OAAO,EAAE,KAAK,kBAAkB,EAAmB,MAAM,wBAAwB,CAAC;AAElF,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,qBAAq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AqG;IACrG,KAAK,EAAE,oBAAoB,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,gBAAgB,CAAC,iBAAiB,EAAE,MAAM,GAAG,eAAe,EAAE,CAuC7E;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,oBAAoB,CAMhE;AAmKD,iFAAiF;AACjF,eAAO,MAAM,0BAA0B,sDAAsD,CAAC;AAE9F;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAGhE;AAED,+EAA+E;AAC/E,eAAO,MAAM,wBAAwB,yBAAyB,CAAC"}
@@ -1,9 +1,9 @@
1
1
  import { existsSync, readdirSync, readFileSync } from 'node:fs';
2
- import { readFile } from 'node:fs/promises';
3
- import { dirname, isAbsolute, join, normalize, posix, relative, resolve, sep } from 'node:path';
2
+ import { readFile, realpath } from 'node:fs/promises';
3
+ import { dirname, isAbsolute, join, posix, relative, resolve, sep } from 'node:path';
4
4
  import { readNxJson } from 'nx/src/config/nx-json.js';
5
5
  import { parse as parseToml } from 'smol-toml';
6
- import { compiledInFiles } from './cargo-source-hash.js';
6
+ import { buildClosure, compiledInFiles } from './cargo-source-hash.js';
7
7
  export function listCargoWorkspacePackages(absoluteProjectRoot) {
8
8
  const workspaceTomlPath = join(absoluteProjectRoot, 'Cargo.toml');
9
9
  if (!existsSync(workspaceTomlPath)) {
@@ -183,7 +183,7 @@ export function cargoPackageTestInputs(options) {
183
183
  cache.results.set(key, derived);
184
184
  return derived;
185
185
  }
186
- async function deriveCargoPackageTestInputs({ workspaceRoot, absoluteProjectRoot, memberDir }, cache) {
186
+ async function deriveCargoPackageTestInputs({ workspaceRoot, absoluteProjectRoot, memberDir, cargo }, cache) {
187
187
  // Every fileset is anchored at `{workspaceRoot}`, never `{projectRoot}`: Nx
188
188
  // hashes a `{projectRoot}` glob against only the files its project OWNS, and
189
189
  // a nested Nx project owns the crates under it. A repository-root cargo
@@ -200,98 +200,61 @@ async function deriveCargoPackageTestInputs({ workspaceRoot, absoluteProjectRoot
200
200
  cache.manifests.set(normalized, parsed);
201
201
  return parsed;
202
202
  };
203
- const rootManifest = await loadManifest(join(absoluteProjectRoot, 'Cargo.toml'));
204
- // The closure over in-tree path dependencies, not the direct edge set: a
203
+ // Cargo reports canonical paths, so every path below is related to the canonical roots.
204
+ const [nxRoot, cargoRoot, crateDirectory] = await Promise.all([
205
+ realpath(workspaceRoot),
206
+ realpath(absoluteProjectRoot),
207
+ realpath(join(absoluteProjectRoot, memberDir)),
208
+ ]);
209
+ const crate = cargo.local.find((pkg) => pkg.directory === crateDirectory);
210
+ if (crate === undefined) {
211
+ throw new Error(`Cargo's resolve of ${join(absoluteProjectRoot, 'Cargo.toml')} holds no package at ${memberDir}`);
212
+ }
213
+ // Exactly the crates Cargo builds for this crate's tests, read from Cargo's
214
+ // own resolve: the crate's normal, build and dev dependencies, and below it
215
+ // only normal and build ones (`buildClosure`), with the workspace's patches
216
+ // and replacements already applied. The closure, not the direct edge set: a
205
217
  // test binary links every crate beneath it, and the chained cargo-test
206
- // targets order runs without contributing to each other's hash, so a
207
- // dependency reachable only through another crate would otherwise change
208
- // nothing in the target that links it.
218
+ // targets order runs without contributing to each other's hash. A
219
+ // dependency's own dev-dependencies never compile into this crate's test
220
+ // binaries, so an edit to one leaves this key alone.
221
+ const closure = buildClosure(cargo, [crate.id]);
209
222
  const dirs = new Set();
210
223
  const external = new Map();
211
- const pending = [normalize(memberDir).split(sep).join('/')];
212
224
  const declaredSources = new Set();
213
- // Workspace patches/replacements can substitute local code for locked sources.
214
- if (isRecord(rootManifest.patch)) {
215
- for (const replacements of Object.values(rootManifest.patch)) {
216
- enqueuePathDependencies({ dependencies: replacements }, '.', new Map(), pending, external, absoluteProjectRoot, workspaceRoot);
217
- }
218
- }
219
- if (isRecord(rootManifest.replace)) {
220
- enqueuePathDependencies({ dependencies: rootManifest.replace }, '.', new Map(), pending, external, absoluteProjectRoot, workspaceRoot);
221
- }
222
- while (pending.length > 0) {
223
- const dir = pending.pop();
224
- if (dir === undefined || dirs.has(dir)) {
225
+ for (const pkg of cargo.local) {
226
+ if (!closure.has(pkg.id))
225
227
  continue;
228
+ if (isOutsideRoot(relative(nxRoot, pkg.directory))) {
229
+ external.set(pkg.name, pkg.directory);
226
230
  }
227
- dirs.add(dir);
228
- const crateTomlPath = join(absoluteProjectRoot, dir, 'Cargo.toml');
229
- if (!existsSync(crateTomlPath)) {
230
- continue;
231
- }
232
- const crateParsed = await loadManifest(crateTomlPath);
233
- if (!isRecord(crateParsed)) {
234
- continue;
235
- }
236
- let owner = resolve(absoluteProjectRoot, dir);
237
- if (isRecord(crateParsed.package) && typeof crateParsed.package.workspace === 'string') {
238
- owner = resolve(owner, crateParsed.package.workspace);
239
- if (isOutsideRoot(relative(workspaceRoot, owner))) {
240
- external.set(`${dir} workspace`, owner);
241
- }
242
- }
243
- let workspacePathDeps = new Map();
244
- while (!isOutsideRoot(relative(workspaceRoot, owner))) {
245
- const manifestPath = join(owner, 'Cargo.toml');
246
- if (existsSync(manifestPath)) {
247
- const manifest = await loadManifest(manifestPath);
248
- if (isRecord(manifest.workspace)) {
249
- workspacePathDeps = workspacePathDependencies(manifest, owner);
250
- declaredSources.add(manifestPath);
251
- break;
252
- }
253
- }
254
- const parent = dirname(owner);
255
- if (parent === owner)
256
- break;
257
- owner = parent;
258
- }
259
- enqueuePathDependencies(crateParsed, dir, workspacePathDeps, pending, external, absoluteProjectRoot, workspaceRoot);
260
- // All cfg variants can affect a compiled target; do not evaluate Cargo cfg here.
261
- if (isRecord(crateParsed.target)) {
262
- for (const target of Object.values(crateParsed.target)) {
263
- if (isRecord(target)) {
264
- enqueuePathDependencies(target, dir, workspacePathDeps, pending, external, absoluteProjectRoot, workspaceRoot);
265
- }
266
- }
231
+ else {
232
+ dirs.add(relative(cargoRoot, pkg.directory).split(sep).join('/') || '.');
267
233
  }
268
- if (isRecord(crateParsed.package) && typeof crateParsed.package.build === 'string') {
269
- declaredSources.add(resolve(absoluteProjectRoot, dir, crateParsed.package.build));
270
- }
271
- for (const targetName of ['lib', 'bin', 'example', 'test', 'bench']) {
272
- const targets = crateParsed[targetName];
273
- for (const target of Array.isArray(targets) ? targets : [targets]) {
274
- if (isRecord(target) && typeof target.path === 'string') {
275
- declaredSources.add(resolve(absoluteProjectRoot, dir, target.path));
276
- }
277
- }
234
+ // Target sources outside the package's directory (a shared build script, a `[lib] path`), and its governing
235
+ // manifest.
236
+ for (const source of [...pkg.sources, pkg.governingManifest]) {
237
+ if (isOutsideRoot(relative(pkg.directory, source)))
238
+ declaredSources.add(source);
278
239
  }
279
240
  }
280
241
  const inputPath = (absolutePath) => {
281
- const cargoRelative = relative(absoluteProjectRoot, absolutePath).split(sep).join('/');
242
+ const cargoRelative = relative(cargoRoot, absolutePath).split(sep).join('/');
282
243
  return isOutsideRoot(cargoRelative)
283
- ? posix.join('{workspaceRoot}', relative(workspaceRoot, absolutePath).split(sep).join('/'))
244
+ ? posix.join('{workspaceRoot}', relative(nxRoot, absolutePath).split(sep).join('/'))
284
245
  : posix.join(inputRoot, cargoRelative);
285
246
  };
286
- const inputs = new Set([`${inputRoot}/Cargo.toml`, `${inputRoot}/Cargo.lock`]);
247
+ // Cargo.lock is not a fileset here: the runner names the crate's lock-scope
248
+ // node, the lock entries its closure reaches (cargo-closure-input.ts).
249
+ const inputs = new Set([`${inputRoot}/Cargo.toml`]);
287
250
  const exclusions = new Set();
288
251
  for (const dir of [...dirs].sort()) {
289
- const absoluteDir = resolve(absoluteProjectRoot, dir);
252
+ const absoluteDir = resolve(cargoRoot, dir);
290
253
  // Cargo packages can compile include_bytes!, headers, schemas and build.rs,
291
254
  // not only Rust sources. Nested packages are separate source owners.
292
255
  inputs.add(`${inputPath(absoluteDir)}/**/*`);
293
256
  for (const child of nestedCrateDirs(absoluteDir, cache)) {
294
- const childDir = relative(absoluteProjectRoot, child).split(sep).join('/');
257
+ const childDir = relative(cargoRoot, child).split(sep).join('/');
295
258
  if (!dirs.has(childDir))
296
259
  exclusions.add(`!${inputPath(child)}/**`);
297
260
  }
@@ -304,7 +267,7 @@ async function deriveCargoPackageTestInputs({ workspaceRoot, absoluteProjectRoot
304
267
  }
305
268
  }
306
269
  for (const source of [...declaredSources].sort()) {
307
- const sourceRelative = relative(workspaceRoot, source);
270
+ const sourceRelative = relative(nxRoot, source);
308
271
  if (isOutsideRoot(sourceRelative)) {
309
272
  external.set(source, source);
310
273
  }
@@ -314,7 +277,7 @@ async function deriveCargoPackageTestInputs({ workspaceRoot, absoluteProjectRoot
314
277
  }
315
278
  // Cargo/rustup search from the command's working directory upwards. Do not
316
279
  // hash unrelated descendant configuration or generated Cargo target caches.
317
- for (let current = resolve(absoluteProjectRoot);; current = dirname(current)) {
280
+ for (let current = cargoRoot;; current = dirname(current)) {
318
281
  for (const config of [
319
282
  '.cargo/config',
320
283
  '.cargo/config.toml',
@@ -332,14 +295,14 @@ async function deriveCargoPackageTestInputs({ workspaceRoot, absoluteProjectRoot
332
295
  const cargoConfig = await loadManifest(configPath);
333
296
  if (isRecord(cargoConfig.build) && typeof cargoConfig.build['target-dir'] === 'string') {
334
297
  const targetDir = resolve(current, cargoConfig.build['target-dir']);
335
- if (!isOutsideRoot(relative(workspaceRoot, targetDir))) {
298
+ if (!isOutsideRoot(relative(nxRoot, targetDir))) {
336
299
  exclusions.add(`!${inputPath(targetDir)}/**`);
337
300
  }
338
301
  }
339
302
  }
340
303
  }
341
304
  }
342
- if (current === resolve(workspaceRoot) || dirname(current) === current)
305
+ if (current === nxRoot || dirname(current) === current)
343
306
  break;
344
307
  }
345
308
  inputs.add(`${inputRoot}/.config/nextest.toml`);
@@ -353,19 +316,27 @@ async function deriveCargoPackageTestInputs({ workspaceRoot, absoluteProjectRoot
353
316
  // Arbitrary build-script reads outside package trees, custom output trees,
354
317
  // and ambient tools/environment require explicit target or named inputs.
355
318
  if (external.size > 0) {
356
- if (readNxJson(workspaceRoot).namedInputs?.[EXTERNAL_RUST_CRATES_INPUT] === undefined) {
357
- const listed = [...external]
358
- .sort(([left], [right]) => left.localeCompare(right))
359
- .map(([name, dir]) => `${name} -> ${dir}`)
360
- .join(', ');
361
- throw new Error(`${memberDir}/Cargo.toml references inputs outside the Nx workspace (${listed}) that no fileset can hash; ` +
362
- `declare namedInputs.${EXTERNAL_RUST_CRATES_INPUT} in ${join(workspaceRoot, 'nx.json')} ` +
363
- 'with runtime inputs that hash those external sources and configuration');
364
- }
319
+ requireExternalRustCratesInput(workspaceRoot, `${memberDir}/Cargo.toml`, external);
365
320
  inputs.add(EXTERNAL_RUST_CRATES_INPUT);
366
321
  }
367
322
  return [...inputs];
368
323
  }
324
+ /**
325
+ * Refuses inputs outside the Nx workspace that `nx.json` gives no `externalRustCrates` runtime hash for: no fileset
326
+ * can hash them, and a key without them would replay a verdict across their edits. `external` maps each input's name
327
+ * to its path.
328
+ */
329
+ export function requireExternalRustCratesInput(workspaceRoot, manifest, external) {
330
+ if (readNxJson(workspaceRoot).namedInputs?.[EXTERNAL_RUST_CRATES_INPUT] !== undefined)
331
+ return;
332
+ const listed = [...external]
333
+ .sort(([left], [right]) => left.localeCompare(right))
334
+ .map(([name, dir]) => `${name} -> ${dir}`)
335
+ .join(', ');
336
+ throw new Error(`${manifest} references inputs outside the Nx workspace (${listed}) that no fileset can hash; ` +
337
+ `declare namedInputs.${EXTERNAL_RUST_CRATES_INPUT} in ${join(workspaceRoot, 'nx.json')} ` +
338
+ 'with runtime inputs that hash those external sources and configuration');
339
+ }
369
340
  /** Every directory beneath `root` that holds its own `Cargo.toml`, the walk stopping at each. */
370
341
  function nestedCrateDirs(root, cache) {
371
342
  const cached = cache.nestedCrateDirs.get(root);
@@ -476,7 +447,9 @@ function isRecord(value) {
476
447
  * exact partition of whatever the crate currently contains.
477
448
  *
478
449
  * It is declared rather than inferred because the only honest input is how long
479
- * the suite takes, which target inference cannot measure. Defaulting to 1 keeps
450
+ * the suite takes, which target inference cannot measure. Measured time places a
451
+ * crate's slow tests instead of the hash once `.config/nextest-timings.json` names
452
+ * them (nextest-timings.ts). Defaulting to 1 keeps
480
453
  * small crates on a single target without paying another Cargo freshness check.
481
454
  */
482
455
  function readTestShards(cratePackage, crateTomlPath) {
@@ -498,8 +471,6 @@ function readTestShards(cratePackage, crateTomlPath) {
498
471
  * same string, and a drifted copy would make the policy vacuous.
499
472
  */
500
473
  export const CARGO_TEST_TARGET = 'cargo-test';
501
- /** Prerequisite that compiles the workspace; not a per-crate runner. */
502
- export const CARGO_TEST_COMPILE_TARGET = 'cargo-test-compile';
503
474
  /**
504
475
  * The one workspace-wide `cargo nextest archive` every per-crate runner
505
476
  * executes from. Named here beside the other cargo target names so the policy
@@ -616,7 +587,6 @@ export function cargoTestGroupTargetName(group) {
616
587
  */
617
588
  export function packageNameFromCargoTestTarget(targetName) {
618
589
  if (!targetName.startsWith('cargo-test-') ||
619
- targetName === CARGO_TEST_COMPILE_TARGET ||
620
590
  targetName === CARGO_TEST_ARCHIVE_TARGET ||
621
591
  targetName.startsWith(CARGO_TEST_GROUP_PREFIX)) {
622
592
  return null;
@@ -927,7 +897,7 @@ export const PLUGIN_NEXTEST_CONFIG_PATH = 'node_modules/@smoothbricks/nx-plugin/
927
897
  * contain spaces.
928
898
  *
929
899
  * The file is named through the workspace root's `node_modules` link, as
930
- * `NEXTEST_EXTRACT_BIN` is, never through where the plugin really lives: a
900
+ * tool package CLIs are (tool-bins.ts), never through where the plugin really lives: a
931
901
  * plugin linked from a checkout outside the workspace sits a different number
932
902
  * of `../` away from each workspace depending on how deep that workspace is,
933
903
  * and that count re-keyed every target of every Cargo project — and every
@@ -144,15 +144,15 @@ export declare const CARGO_DENY_WARNINGS = "--config 'build.warnings=\"deny\"'";
144
144
  */
145
145
  export declare const CARGO_CROSS_LINT_COMMAND = "command -v cargo-zigbuild >/dev/null || { echo 'cargo-lint-cross needs cargo-zigbuild from the linux-cross toolchain; run: bun run check:linux' >&2; exit 2; }; cargo-zigbuild clippy --frozen --workspace --all-targets --target x86_64-unknown-linux-gnu --target-dir target/cargo-lint-cross --config 'build.warnings=\"deny\"'";
146
146
  /**
147
- * No `--target-dir`: clippy writes the workspace's own `target/`, beside every
148
- * dev build. Check units carry their mode in the unit hash, so they never
149
- * collide with build units, and the host units a dev build already compiled —
150
- * build scripts and their host-only dependencies — are reused rather than
151
- * compiled a second time in a directory of their own. A dependency that both
152
- * a proc-macro and ordinary code use stays a distinct unit: a dev build
153
- * compiles it once at the target profile, while a check build needs a separate
154
- * host copy. Distinct hashes coexist, so neither command dirties the other.
155
- * A plain `cargo clippy --workspace --all-targets` checks exactly these units.
147
+ * `target/cargo-lint`: clippy writes a directory of its own, as the cross lint
148
+ * does. Cargo flocks one build directory per invocation, and a workspace-wide
149
+ * check is the longest Cargo invocation in a gate, so in the dev build's
150
+ * `target/` it would queue the test archive and every dev build behind its lock.
151
+ * The price is that clippy compiles its own host units (build scripts,
152
+ * proc-macros) once per directory; cargo retention passes it as a nested root of
153
+ * the target directory, reclaiming its superseded generations but not its
154
+ * `incremental/`. A plain `cargo clippy --workspace --all-targets
155
+ * --target-dir target/cargo-lint` checks exactly these units.
156
156
  */
157
157
  export declare const CARGO_LINT_CLIPPY_COMMAND: string;
158
158
  /** Root `package.json` script name, in the repo's `verb:qualifier` style. */
@@ -1 +1 @@
1
- {"version":3,"file":"cross-check-policy.d.ts","sourceRoot":"","sources":["../src/cross-check-policy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;;GAGG;AACH,eAAO,MAAM,kBAAkB,6BAA6B,CAAC;AAE7D;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,gBAAgB,CAAC;AAElD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,uBAAuB,qBAAqB,CAAC;AAE1D;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,mGAC6D,CAAC;AAInG;;;;GAIG;A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const CARGO_DENY_WARNINGS = `--config 'build.warnings="deny"'`;
158
158
  */
159
159
  export const CARGO_CROSS_LINT_COMMAND = `${CARGO_CROSS_LINT_GUARD}; ${CARGO_ZIGBUILD_CLIPPY_FROZEN_PREFIX}--workspace --all-targets --target ${CARGO_LINUX_TRIPLE} --target-dir target/cargo-lint-cross ${CARGO_DENY_WARNINGS}`;
160
160
  /**
161
- * No `--target-dir`: clippy writes the workspace's own `target/`, beside every
162
- * dev build. Check units carry their mode in the unit hash, so they never
163
- * collide with build units, and the host units a dev build already compiled —
164
- * build scripts and their host-only dependencies — are reused rather than
165
- * compiled a second time in a directory of their own. A dependency that both
166
- * a proc-macro and ordinary code use stays a distinct unit: a dev build
167
- * compiles it once at the target profile, while a check build needs a separate
168
- * host copy. Distinct hashes coexist, so neither command dirties the other.
169
- * A plain `cargo clippy --workspace --all-targets` checks exactly these units.
170
- */
171
- export const CARGO_LINT_CLIPPY_COMMAND = cargoFrozen(`clippy --workspace --all-targets ${CARGO_DENY_WARNINGS}`);
161
+ * `target/cargo-lint`: clippy writes a directory of its own, as the cross lint
162
+ * does. Cargo flocks one build directory per invocation, and a workspace-wide
163
+ * check is the longest Cargo invocation in a gate, so in the dev build's
164
+ * `target/` it would queue the test archive and every dev build behind its lock.
165
+ * The price is that clippy compiles its own host units (build scripts,
166
+ * proc-macros) once per directory; cargo retention passes it as a nested root of
167
+ * the target directory, reclaiming its superseded generations but not its
168
+ * `incremental/`. A plain `cargo clippy --workspace --all-targets
169
+ * --target-dir target/cargo-lint` checks exactly these units.
170
+ */
171
+ export const CARGO_LINT_CLIPPY_COMMAND = cargoFrozen(`clippy --workspace --all-targets --target-dir target/cargo-lint ${CARGO_DENY_WARNINGS}`);
172
172
  /** Root `package.json` script name, in the repo's `verb:qualifier` style. */
173
173
  export const CROSS_CHECK_SCRIPT_NAME = 'check:linux';
174
174
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"disk-command-policy.d.ts","sourceRoot":"","sources":["../src/disk-command-policy.ts"],"names":[],"mappings":"AAKA,0GAA0G;AAC1G,eAAO,MAAM,mBAAmB,+EAA+E,CAAC;AAEhH,kGAAkG;AAClG,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,SAAK,GAAG,MAAM,EAAE,CA8CtE;AAED,kGAAkG;AAClG,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAqC/D"}
1
+ {"version":3,"file":"disk-command-policy.d.ts","sourceRoot":"","sources":["../src/disk-command-policy.ts"],"names":[],"mappings":"AAKA,0GAA0G;AAC1G,eAAO,MAAM,mBAAmB,+EAA+E,CAAC;AAEhH,kGAAkG;AAClG,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,SAAK,GAAG,MAAM,EAAE,CA8CtE;AAED,kGAAkG;AAClG,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAsC/D"}
@@ -47,6 +47,7 @@ export function directDiskCommands(source, path = '') {
47
47
  }
48
48
  /** Scan tracked code, tests and scripts, never build output, prose or recorded benchmark data. */
49
49
  export function checkDiskCommandBoundary(root) {
50
+ // eslint-disable-next-line deadline/no-unbounded-wait -- WHY unbounded: a local git file listing whose length is its own read of this repository: it asks no remote, and a held index.lock fails it at once rather than waiting, so only the operator's interrupt ends a hung one
50
51
  const files = execFileSync('git', ['ls-files', '-z', '--cached', '--others', '--exclude-standard'], {
51
52
  cwd: root,
52
53
  encoding: 'utf8',
@@ -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, type StampFields } from './ensure-built-witness.js';
4
+ import { type CensusRead, 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;
@@ -39,21 +39,38 @@ export declare function receiptGit(root: string, args: string[]): ReceiptEvidenc
39
39
  export declare function dirtyProviderPaths(status: string): string[];
40
40
  /**
41
41
  * One independently read node; absolute paths also serve tool/package closures. A census records the node's stamp as
42
- * of its `start` (recordedStamp); a re-read against a record records none.
42
+ * of its `start` (recordedStamp); a re-read against a record records none. `known` is what a census of the same capture
43
+ * already read of the node ({@link CensusRead}): its stat, listing and start stand for this read, so a capture stats a
44
+ * node once; the stability check after execution reads it again.
43
45
  */
44
46
  export declare function receiptNode(path: string, name: string, census?: {
45
47
  readonly start: bigint;
46
48
  readonly observed: NodeWitness[];
47
- }, recorded?: (path: string, stats: StampFields) => string | undefined): EnsureBuiltOutputReceipt;
48
- /** Capture every tracked source byte at pre. Unrelated untracked files are not source basis. */
49
+ }, recorded?: (path: string, stats: StampFields) => string | undefined, known?: CensusRead): EnsureBuiltOutputReceipt;
50
+ /**
51
+ * Capture every tracked source byte at pre. Unrelated untracked files are not source basis. A tracked public output is
52
+ * source while it holds HEAD's bytes, so a later task can read it as a FILE input; one that differs from HEAD is the
53
+ * run's to write, and no input binds to it.
54
+ */
49
55
  export declare function captureProducerSource(root: string, outputs: readonly string[]): ReceiptEvidence<ProducerSourceWitness>;
56
+ /** Share Git and tracked-byte acquisition, never one target's output exemption with another. */
57
+ export declare function captureProducerSources(root: string, targets: ReadonlyMap<string, readonly string[]>): ReceiptEvidence<ReadonlyMap<string, ProducerSourceWitness>>;
50
58
  export declare function producerSourceUnchanged(root: string, before: ProducerSourceWitness): ReceiptEvidence<true>;
51
59
  /** Enumerate exact public nodes; never exempt a broad directory of tracked source. */
52
60
  export declare function producerOutputPaths(root: string, tasks: readonly Task[], expand: typeof expandOutputs): string[];
61
+ /**
62
+ * Remove what a producer's previous receipt declared as task outputs and its current task graph no longer declares,
63
+ * inside the declaring task's project root. A layout change (an output moved, a target renamed) otherwise leaves the
64
+ * old layout's files where a package's published `files` still packs them, so a consumer's capture hashes them as the
65
+ * producer's tools and ships them. A previously declared directory that holds a currently declared output loses only
66
+ * its other entries. A previous task that left this graph while its target still exists is not this producer's to
67
+ * clean: `defined` says whether a task's target still exists. Returns the removed paths, relative to `root`.
68
+ */
69
+ export declare function removeOrphanedOutputs(root: string, previous: readonly Task[], current: readonly Task[], expand: typeof expandOutputs, defined: (task: Task) => boolean): string[];
53
70
  export declare function providerReceipt(root: string, taskId: string, tasks: readonly Task[], proof: ProviderInputProof, expand: typeof expandOutputs, source: ProducerSourceWitness, producer: Omit<EnsureBuiltProducerReceipt, 'outputSha256'>): {
54
71
  readonly disposition: 'hit';
55
72
  readonly receipt: EnsureBuiltReceipt;
56
73
  } | EnsureBuiltProbeFailure;
57
- /** Admit only version recipes emitted by the owning generator and declared toolchain pins. */
74
+ /** Admit only the recipes emitted by the owning generator: the version recipes, the declared-programs one, and declared toolchain pins. */
58
75
  export declare function boundedReceiptRuntimes(inputs: Readonly<Record<string, HashInputs>>, directories: readonly string[], files: readonly string[], installationProved: boolean): ProviderInputProof['runtimeSource'];
59
76
  //# sourceMappingURL=ensure-built-receipt.d.ts.map
@@ -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,KAAK,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAEvH,MAAM,MAAM,eAAe,CAAC,CAAC,IACzB;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,C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