@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
@@ -29,7 +29,9 @@
29
29
  * cargo re-runs those scripts against the current toolchain, and every target
30
30
  * directory's `.rustc_info.json`, so cargo asks the current rustc again.
31
31
  * Nothing else under target/ is touched; a checkout without target/ has
32
- * nothing to do.
32
+ * nothing to do. The DEVENV_SKIP_TASKS environment-capture pass only needs
33
+ * exported variables: leave probes and cache invalidation to final shell entry,
34
+ * after tasks and project hooks have settled the toolchain.
33
35
  */
34
36
  import { existsSync, readdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
35
37
  import { join, resolve } from 'node:path';
@@ -37,7 +39,7 @@ import { $ } from 'bun';
37
39
 
38
40
  const root = resolve(`${process.env.DEVENV_ROOT ?? process.cwd()}/../..`);
39
41
  const target = join(root, 'target');
40
- if (existsSync(target)) {
42
+ if (!process.env.DEVENV_SKIP_TASKS && existsSync(target)) {
41
43
  const stamp = join(target, '.toolchain-stamp');
42
44
  const identity = await toolchainIdentity();
43
45
  const recorded = existsSync(stamp) ? readFileSync(stamp, 'utf8') : null;
@@ -10,6 +10,15 @@
10
10
  # TTSC_GO_CACHE_DIR, where ttsc keeps the plugin binaries it compiles and the
11
11
  # Go build cache that compiles them.
12
12
  #
13
+ # This checkout is the directory the script is sourced from: devenv.smoo.nix's
14
+ # enterShell enters the workspace root first, and each git hook enters
15
+ # `git rev-parse --show-toplevel`. Sourced from any other directory, $PWD names
16
+ # no checkout, and every cache below would land beside that directory instead:
17
+ # a shell in HOME would create ~/.cache/ttsc. That directory is refused.
18
+ if [ ! -f "$PWD/tooling/direnv/ttsc-env.sh" ]; then
19
+ echo "ttsc-env.sh: not a workspace root (no tooling/direnv/ttsc-env.sh): $PWD; source it from the checkout root" >&2
20
+ return 1
21
+ fi
13
22
  # The compiler is always this checkout's own. An inherited cache directory is
14
23
  # the host's choice and stays (CI points it at a cache shared across runs),
15
24
  # unless the environment was bound for another workspace: an inherited
@@ -0,0 +1,227 @@
1
+ import {
2
+ closeSync,
3
+ existsSync,
4
+ lstatSync,
5
+ openSync,
6
+ readdirSync,
7
+ readFileSync,
8
+ readlinkSync,
9
+ readSync,
10
+ realpathSync,
11
+ statSync,
12
+ writeFileSync,
13
+ } from 'node:fs';
14
+ import path from 'node:path';
15
+
16
+ /**
17
+ * What keeps a uv environment location-independent, read and written on the filesystem alone: whether an existing
18
+ * environment is the relocatable one an install leaves (uvEnvironmentRelocatable), and the rewrite of each `.pth`
19
+ * line naming a directory in the checkout as a path relative to its site-packages (relativizeCheckoutPaths).
20
+ * setup-environment.ts's uv installer runs uv and stamps; this module decides nothing about when.
21
+ */
22
+
23
+ function sitePackagesDirectories(environment: string): string[] {
24
+ const lib = path.join(environment, 'lib');
25
+ const directories: string[] = [];
26
+ for (const python of existsSync(lib) ? readdirSync(lib) : []) {
27
+ if (!python.startsWith('python')) continue;
28
+ const sitePackages = path.join(lib, python, 'site-packages');
29
+ if (existsSync(sitePackages)) directories.push(sitePackages);
30
+ }
31
+ return directories;
32
+ }
33
+
34
+ /** One shell command line as its words: quotes group, backslash escapes, no expansion. */
35
+ function shellWords(line: string): string[] {
36
+ const words: string[] = [];
37
+ let word = '';
38
+ let quote: string | null = null;
39
+ let started = false;
40
+ for (let index = 0; index < line.length; index += 1) {
41
+ const char = line[index] ?? '';
42
+ if (quote !== null) {
43
+ if (char === quote) quote = null;
44
+ else if (char === '\\' && quote === '"' && index + 1 < line.length) word += line[++index];
45
+ else word += char;
46
+ continue;
47
+ }
48
+ if (char === "'" || char === '"') {
49
+ quote = char;
50
+ started = true;
51
+ } else if (char === '\\' && index + 1 < line.length) {
52
+ word += line[++index];
53
+ started = true;
54
+ } else if (/\s/.test(char)) {
55
+ if (started || word !== '') words.push(word);
56
+ word = '';
57
+ started = false;
58
+ } else {
59
+ word += char;
60
+ }
61
+ }
62
+ if (started || word !== '') words.push(word);
63
+ return words;
64
+ }
65
+
66
+ /**
67
+ * Whether an existing environment is the relocatable one install would leave: its config says
68
+ * so, no launcher or interpreter link names an environment or a checkout (its own, a foreign
69
+ * one, or a checkout's .devenv profile, in a shebang, a wrapper's exec argv, or the link
70
+ * itself), and no `.pth` line is an absolute path. The stamp alone cannot witness this — a
71
+ * copied checkout carries a matching stamp and an old absolute launcher together, and admits
72
+ * the launcher forever.
73
+ */
74
+ export function uvEnvironmentRelocatable(environment: string): boolean {
75
+ let config: string;
76
+ try {
77
+ config = readFileSync(path.join(environment, 'pyvenv.cfg'), 'utf8');
78
+ } catch (error) {
79
+ if (error instanceof Error && 'code' in error && error.code === 'ENOENT') return false;
80
+ throw error;
81
+ }
82
+ if (!/^relocatable\s*=\s*true\s*$/m.test(config)) return false;
83
+ const environmentReal = realpathSync(environment);
84
+ // Whether an absolute interpreter path names an environment or a checkout, as opposed to a
85
+ // store or system interpreter, which names neither: it is inside this environment, inside
86
+ // another environment (its home carries pyvenv.cfg), under a checkout's .devenv state, or
87
+ // it no longer exists at all.
88
+ const namesEnvironment = (interpreter: string): boolean => {
89
+ if (interpreter.startsWith(`${environment}/`) || interpreter.startsWith(`${environmentReal}/`)) return true;
90
+ if (!existsSync(interpreter)) return true;
91
+ if (interpreter.split(path.sep).includes('.devenv')) return true;
92
+ const home = path.dirname(path.dirname(interpreter));
93
+ return existsSync(path.join(home, 'pyvenv.cfg')) && home !== environment && home !== environmentReal;
94
+ };
95
+ const bin = path.join(environment, 'bin');
96
+ if (existsSync(bin)) {
97
+ const buffer = Buffer.alloc(256);
98
+ for (const name of readdirSync(bin)) {
99
+ const file = path.join(bin, name);
100
+ let size: number;
101
+ let isFile: boolean;
102
+ let isLink = false;
103
+ try {
104
+ const stat = statSync(file);
105
+ size = stat.size;
106
+ isFile = stat.isFile();
107
+ isLink = lstatSync(file).isSymbolicLink();
108
+ } catch {
109
+ return false;
110
+ }
111
+ if (!isFile) continue;
112
+ if (isLink) {
113
+ // The interpreter link itself is witnessed lexically, but only when it leaves the
114
+ // environment: a relative alias (bin/python3 -> python) is the layout uv itself
115
+ // writes and stays inside it. An absolute link into another checkout's .devenv
116
+ // state names that checkout even when its final target is a store interpreter,
117
+ // and no shebang reading ever sees it.
118
+ let linkTarget: string;
119
+ try {
120
+ linkTarget = readlinkSync(file);
121
+ } catch {
122
+ return false;
123
+ }
124
+ if (path.isAbsolute(linkTarget)) {
125
+ const lexical = path.resolve(bin, linkTarget);
126
+ if (lexical.split(path.sep).includes('.devenv')) return false;
127
+ const linkHome = path.dirname(path.dirname(lexical));
128
+ if (existsSync(path.join(linkHome, 'pyvenv.cfg')) && linkHome !== environment && linkHome !== environmentReal)
129
+ return false;
130
+ } else {
131
+ // A relative alias that resolves outside the environment is judged by where it
132
+ // lands, like an absolute one; only aliases staying inside are uv's own layout.
133
+ const lexical = path.resolve(bin, linkTarget);
134
+ if (
135
+ !lexical.startsWith(`${environment}${path.sep}`) &&
136
+ !lexical.startsWith(`${environmentReal}${path.sep}`) &&
137
+ namesEnvironment(lexical)
138
+ )
139
+ return false;
140
+ }
141
+ }
142
+ let head: string;
143
+ try {
144
+ const fd = openSync(file, 'r');
145
+ try {
146
+ head = buffer.toString('utf8', 0, readSync(fd, buffer, 0, buffer.length, 0));
147
+ } finally {
148
+ closeSync(fd);
149
+ }
150
+ } catch {
151
+ return false;
152
+ }
153
+ const shebang = /^#!\s*(\/\S+)(?:\s+(.*))?$/.exec(head.split('\n')[0] ?? '');
154
+ if (shebang === null) continue;
155
+ const interpreter = shebang[1] ?? '';
156
+ const program = path.basename(interpreter);
157
+ if (program === 'env') {
158
+ // An env trampoline naming a bare program resolves through PATH; one naming an
159
+ // absolute interpreter (after any flags, -S included) is judged as that interpreter.
160
+ const tokens = shellWords(shebang[2] ?? '');
161
+ let index = 0;
162
+ while (index < tokens.length && tokens[index]?.startsWith('-')) index += tokens[index] === '-u' ? 2 : 1;
163
+ const target = tokens[index];
164
+ if (target !== undefined && target.startsWith('/') && namesEnvironment(target)) return false;
165
+ continue;
166
+ }
167
+ if (['sh', 'bash', 'dash', 'zsh'].includes(program)) {
168
+ // A relocatable wrapper execs a self-locating interpreter; a legacy one execs an
169
+ // absolute environment path. Only exec lines are judged, tokenized as shell words
170
+ // (quotes group, so spaced paths stay whole; a $VAR expansion is not an absolute
171
+ // path and is never classified).
172
+ if (size > 262_144) return false;
173
+ let body: string;
174
+ try {
175
+ body = readFileSync(file, 'utf8');
176
+ } catch {
177
+ return false;
178
+ }
179
+ for (const line of body.split('\n')) {
180
+ // Producer headers are shell words too: a uv console script's polyglot first
181
+ // line tokenizes to the same exec argv as a plain exec line.
182
+ const words = shellWords(line);
183
+ if (words[0] !== 'exec') continue;
184
+ const target = words.find((word) => word.includes('/bin/python')) ?? words[1];
185
+ if (target !== undefined && target.startsWith('/') && namesEnvironment(target)) return false;
186
+ }
187
+ continue;
188
+ }
189
+ if (namesEnvironment(interpreter)) return false;
190
+ }
191
+ }
192
+ for (const sitePackages of sitePackagesDirectories(environment)) {
193
+ for (const name of readdirSync(sitePackages).filter((entry) => entry.endsWith('.pth'))) {
194
+ const content = readFileSync(path.join(sitePackages, name), 'utf8');
195
+ if (content.split('\n').some((line) => path.isAbsolute(line))) return false;
196
+ }
197
+ }
198
+ return true;
199
+ }
200
+
201
+ /**
202
+ * Rewrite every `.pth` line in the environment's site-packages that names a
203
+ * directory inside the checkout at `checkoutRoot` as a path relative to that
204
+ * site-packages, which is how Python's `site` resolves a relative line. Every
205
+ * other line — an `import` line, a path outside the checkout, a directory that
206
+ * does not exist — stays as uv wrote it.
207
+ */
208
+ export function relativizeCheckoutPaths(environment: string, checkoutRoot: string): void {
209
+ const root = `${realpathSync(checkoutRoot)}${path.sep}`;
210
+ for (const sitePackages of sitePackagesDirectories(environment)) {
211
+ const site = realpathSync(sitePackages);
212
+ for (const name of readdirSync(site).filter((entry) => entry.endsWith('.pth'))) {
213
+ const file = path.join(site, name);
214
+ const content = readFileSync(file, 'utf8');
215
+ const rewritten = content
216
+ .split('\n')
217
+ .map((line) => {
218
+ const target = path.isAbsolute(line) && existsSync(line) ? realpathSync(line) : null;
219
+ return target?.startsWith(root) ? path.relative(site, target) : line;
220
+ })
221
+ .join('\n');
222
+ if (rewritten !== content) {
223
+ writeFileSync(file, rewritten);
224
+ }
225
+ }
226
+ }
227
+ }
@@ -2,7 +2,8 @@
2
2
  cd "$(git rev-parse --show-toplevel)"
3
3
  TOOLING="$PWD/tooling"
4
4
 
5
- export PATH="$("$TOOLING/direnv/repo-path")"
5
+ # A bare assignment, not `export PATH=$(…)`: export's status would hide repo-path's refusal of an unserved workspace.
6
+ PATH="$("$TOOLING/direnv/repo-path")" || exit $?
6
7
  # ttsc compiles with this checkout's native TypeScript compiler into this
7
8
  # checkout's plugin cache, which the dev shell names. A hook runs outside that
8
9
  # shell, in whatever environment ran `git`; ttsc-env.sh names them the same way.
@@ -2,7 +2,8 @@
2
2
  cd "$(git rev-parse --show-toplevel)"
3
3
  TOOLING="$PWD/tooling"
4
4
 
5
- export PATH="$("$TOOLING/direnv/repo-path")"
5
+ # A bare assignment, not `export PATH=$(…)`: export's status would hide repo-path's refusal of an unserved workspace.
6
+ PATH="$("$TOOLING/direnv/repo-path")" || exit $?
6
7
  # ttsc compiles with this checkout's native TypeScript compiler into this
7
8
  # checkout's plugin cache, which the dev shell names. A hook runs outside that
8
9
  # shell, in whatever environment ran `git`; ttsc-env.sh names them the same way.
@@ -50,7 +50,8 @@ TOOLING="$PWD/tooling"
50
50
  # gates below guard publication only, so they do not apply.
51
51
  if [ "${1:-}" = backup ]; then exit 0; fi
52
52
 
53
- export PATH="$("$TOOLING/direnv/repo-path")"
53
+ # A bare assignment, not `export PATH=$(…)`: export's status would hide repo-path's refusal of an unserved workspace.
54
+ PATH="$("$TOOLING/direnv/repo-path")" || exit $?
54
55
  # ttsc compiles with this checkout's native TypeScript compiler into this
55
56
  # checkout's plugin cache, which the dev shell names. A hook runs outside that
56
57
  # shell, in whatever environment ran `git`; ttsc-env.sh names them the same way.
@@ -1,18 +1,96 @@
1
1
  name: Cache ttsc plugins
2
2
  description: >
3
- Restore/save compiled ttsc native plugin binaries (typia, etc.). These are content-keyed under TTSC_CACHE_DIR/plugins
4
- and skip the multi-minute `go build` when the cache key matches. The Go object cache (go-build/) is NOT cached — it is
5
- multi-GB and only helps when the plugin key misses. Do not use restore-keys: a prefix hit restores plugins built for a
6
- different lock/patch, then ttsc still compiles any missing plugin against a cold GOMODCACHE.
3
+ Restore or save the compiled ttsc native plugin binaries (typia, etc.) under TTSC_CACHE_DIR/plugins. ttsc names every
4
+ entry by a hash of what it was compiled from and skips the multi-minute `go build` when one matches. Setup restores
5
+ them, and save-nix-devenv saves the entries the job used when the job ends, red or green. The Go object cache
6
+ (go-build/) is NOT cached: it is multi-GB and only helps when the plugin key misses.
7
+
8
+ inputs:
9
+ mode:
10
+ description: Restore the plugin cache before the shell is built, or save it when the job ends.
11
+ required: false
12
+ default: restore
7
13
 
8
14
  runs:
9
15
  using: composite
10
16
  steps:
11
- - name: Cache ttsc plugin binaries
12
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
17
+ # The binaries are compiled from ttsc's own packages and from each package that ships a ttsc plugin, which declares
18
+ # ttsc as a dependency or peer (typia does). Those bun.lock entries, with the ttsc patch and the Go toolchain pins,
19
+ # are the whole key: a dependency change no plugin reaches, such as a release commit rewriting a workspace package's
20
+ # version, keeps the binaries. No match fails the step: this action only runs where bun.lock locks ttsc.
21
+ - name: Select ttsc lock entries
22
+ if: inputs.mode == 'restore'
23
+ shell: bash
24
+ run: |
25
+ mkdir -p .cache/ttsc
26
+ grep -E '^ +"(@ttsc/[^"]+|ttsc(/[^"]+)?)": |"ttsc": "' bun.lock > .cache/ttsc/plugin-lock-entries
27
+
28
+ # A prefix hit is safe. ttsc names every entry by a hash of what it was compiled from (the ttsc and tsgo versions,
29
+ # platform and architecture, the Go toolchain and its build environment, the plugin sources) and runs an entry only
30
+ # when its name is the one it computes for this checkout, so a restored entry of other inputs is dead weight and
31
+ # never a wrong binary.
32
+ - name: Restore ttsc plugin binaries
33
+ id: restore
34
+ if: inputs.mode == 'restore'
35
+ uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
13
36
  with:
14
37
  # Only the compiled plugin binaries (~30MB each). Path is relative to the
15
38
  # workspace; devenv sets TTSC_CACHE_DIR to <repo>/.cache/ttsc.
16
39
  path: .cache/ttsc/plugins
17
40
  # prettier-ignore
18
- key: ${{ runner.os }}-${{ runner.arch }}-ttsc-plugins-v1-${{ hashFiles('bun.lock', 'package.json', 'patches/ttsc@*.patch', 'tooling/direnv/devenv.lock', 'tooling/direnv/devenv.smoo.nix') }}
41
+ key: ${{ runner.os }}-${{ runner.arch }}-ttsc-plugins-v1-${{ hashFiles('.cache/ttsc/plugin-lock-entries', 'patches/ttsc@*.patch', 'tooling/direnv/devenv.lock', 'tooling/direnv/devenv.smoo.nix') }}
42
+ restore-keys: |
43
+ ${{ runner.os }}-${{ runner.arch }}-ttsc-plugins-v1-
44
+
45
+ # A composite action has no post step, so the save is a second call of this action, made by save-nix-devenv when
46
+ # the job ends. It then sees every plugin the job compiled, Nx tasks included, and it still runs after a red job:
47
+ # actions/cache saves in its own post step only after a green one. The save needs the key looked up here and the
48
+ # time of this restore. An exact hit, or a runner without a cache service, has nothing to save and leaves both unset.
49
+ - name: Note the key and time for the job-end save
50
+ if: steps.restore.outputs.cache-primary-key != '' && steps.restore.outputs.cache-hit != 'true'
51
+ shell: bash
52
+ env:
53
+ PRIMARY_KEY: ${{ steps.restore.outputs.cache-primary-key }}
54
+ run: |
55
+ {
56
+ echo "SMOO_TTSC_PLUGINS_SAVE_KEY=$PRIMARY_KEY"
57
+ echo "SMOO_TTSC_PLUGINS_RESTORED_AT_MS=$(($(date +%s) * 1000))"
58
+ } >> "$GITHUB_ENV"
59
+ echo "no exact hit: the job end saves the ttsc plugins it used under $PRIMARY_KEY"
60
+
61
+ # Each prefix hit restores the entries of earlier inputs, and saving them under the new key would carry every
62
+ # generation forward. ttsc evicts only from a cache it owns; one named by TTSC_CACHE_DIR belongs to the caller, so
63
+ # nothing else does. ttsc writes the epoch milliseconds into <entry>/.last-used on every hit and build, so an entry
64
+ # stamped before this job restored is one the job never used: it goes, with the lock directories ttsc keeps beside
65
+ # it (<entry>.lock*, which are not entries). A job that used no entry (it failed before ttsc ran) keeps none, and
66
+ # saving an emptied cache would pin it to the exact key for every later run, so it saves nothing.
67
+ - name: Drop ttsc plugin entries this job did not use
68
+ id: prune
69
+ if: inputs.mode == 'save' && env.SMOO_TTSC_PLUGINS_SAVE_KEY != ''
70
+ shell: bash
71
+ run: |
72
+ set -euo pipefail
73
+ shopt -s nullglob
74
+ : "${SMOO_TTSC_PLUGINS_RESTORED_AT_MS:?the restore of this action records when the job restored the cache}"
75
+ kept=0
76
+ for entry in "$GITHUB_WORKSPACE"/.cache/ttsc/plugins/*/; do
77
+ entry="${entry%/}"
78
+ case "$entry" in *.lock | *.lock.*) continue ;; esac
79
+ used=0
80
+ if [ -f "$entry/.last-used" ]; then used="$(<"$entry/.last-used")"; fi
81
+ if [ "$used" -ge "$SMOO_TTSC_PLUGINS_RESTORED_AT_MS" ]; then
82
+ kept=$((kept + 1))
83
+ else
84
+ echo "dropping ${entry##*/} (last used $used, job restored at $SMOO_TTSC_PLUGINS_RESTORED_AT_MS)"
85
+ rm -rf "$entry" "$entry".lock*
86
+ fi
87
+ done
88
+ echo "kept=$kept" >> "$GITHUB_OUTPUT"
89
+ echo "ttsc plugin entries this job used: $kept"
90
+
91
+ - name: Save ttsc plugin binaries
92
+ if: inputs.mode == 'save' && steps.prune.outputs.kept > 0
93
+ uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
94
+ with:
95
+ path: .cache/ttsc/plugins
96
+ key: ${{ env.SMOO_TTSC_PLUGINS_SAVE_KEY }}
@@ -1,7 +1,9 @@
1
1
  name: Save Nix/devenv caches
2
2
  description: >
3
- Save the devenv/direnv eval-cache segment after the job, on every ephemeral runner where setup missed and build-shell
4
- produced nix-eval-cache.db. The Nix store cache saves itself in setup-devenv's post phase (ephemeral runners only).
3
+ Save what must outlive the job, after it ends and whatever its result: the devenv/direnv eval-cache segment, on every
4
+ ephemeral runner where setup missed and build-shell produced nix-eval-cache.db, and the ttsc plugin binaries the job
5
+ used, when setup's restore was not an exact hit. The Nix store cache saves itself in setup-devenv's post phase
6
+ (ephemeral runners only).
5
7
 
6
8
  inputs:
7
9
  devenv-cache-hit:
@@ -30,3 +32,11 @@ runs:
30
32
  uses: ./.github/actions/cache-nix-devenv
31
33
  with:
32
34
  mode: save
35
+
36
+ # The plugins ttsc compiled during the whole job, Nx tasks included, which is why the save is here and not in setup,
37
+ # which returns before any of them runs. Setup's restore leaves the key to save under; where it left none (a host
38
+ # runner, an exact hit) this does nothing.
39
+ - name: 🧊 Save ttsc plugins
40
+ uses: ./.github/actions/cache-ttsc-plugins
41
+ with:
42
+ mode: save
@@ -319,6 +319,8 @@ runs:
319
319
  if: steps.runner-kind.outputs.host != 'true'
320
320
  uses: ./.github/actions/cache-node-modules
321
321
 
322
+ # Only the restore is here: save-nix-devenv saves the plugins when the job ends, after the tasks that run later
323
+ # have compiled theirs too.
322
324
  - name: 🧊 Cache ttsc plugins
323
325
  if: steps.runner-kind.outputs.host != 'true'
324
326
  uses: ./.github/actions/cache-ttsc-plugins
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smoothbricks/nx-plugin",
3
- "version": "0.5.7",
3
+ "version": "0.6.1",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "main": "./loader.js",
@@ -23,10 +23,10 @@
23
23
  "import": "./dist/eslint-file-set.js",
24
24
  "default": "./dist/eslint-file-set.js"
25
25
  },
26
- "./failure-summary": {
27
- "types": "./dist/failure-summary.d.ts",
28
- "import": "./dist/failure-summary.js",
29
- "default": "./dist/failure-summary.js"
26
+ "./cargo-build-script-env": {
27
+ "types": "./dist/cargo-build-script-env.d.ts",
28
+ "import": "./dist/cargo-build-script-env.js",
29
+ "default": "./dist/cargo-build-script-env.js"
30
30
  },
31
31
  "./bounded-test-policy": {
32
32
  "types": "./dist/bounded-test-policy.d.ts",
@@ -38,11 +38,21 @@
38
38
  "import": "./dist/build-state-output-policy.js",
39
39
  "default": "./dist/build-state-output-policy.js"
40
40
  },
41
+ "./task-graph-policy": {
42
+ "types": "./dist/task-graph-policy.d.ts",
43
+ "import": "./dist/task-graph-policy.js",
44
+ "default": "./dist/task-graph-policy.js"
45
+ },
41
46
  "./test-clock-policy": {
42
47
  "types": "./dist/test-clock-policy.d.ts",
43
48
  "import": "./dist/test-clock-policy.js",
44
49
  "default": "./dist/test-clock-policy.js"
45
50
  },
51
+ "./forbidden-spelling-policy": {
52
+ "types": "./dist/forbidden-spelling-policy.d.ts",
53
+ "import": "./dist/forbidden-spelling-policy.js",
54
+ "default": "./dist/forbidden-spelling-policy.js"
55
+ },
46
56
  "./test-walk-policy": {
47
57
  "types": "./dist/test-walk-policy.d.ts",
48
58
  "import": "./dist/test-walk-policy.js",
@@ -197,11 +207,12 @@
197
207
  "bin": {
198
208
  "smoo-nx-exec": "./dist/bin/smoo-nx-exec.js",
199
209
  "smoo-nx-cargo-hash": "./dist/bin/smoo-nx-cargo-hash.js",
200
- "smoo-nx-nextest-extract": "./dist/bin/smoo-nx-nextest-extract.js",
210
+ "smoo-nx-cargo-toolchain": "./dist/bin/smoo-nx-cargo-toolchain.js",
211
+ "smoo-nx-nextest-timings": "./dist/bin/smoo-nx-nextest-timings.js",
201
212
  "smoo-nx-bound-failures": "./dist/bin/smoo-nx-bound-failures.js",
202
- "smoo-nx-failures": "./dist/bin/smoo-nx-failures.js",
203
213
  "smoo-nx-test-walks": "./dist/bin/smoo-nx-test-walks.js",
204
- "smoo-nx-test-clocks": "./dist/bin/smoo-nx-test-clocks.js"
214
+ "smoo-nx-test-clocks": "./dist/bin/smoo-nx-test-clocks.js",
215
+ "smoo-nx-forbidden-spellings": "./dist/bin/smoo-nx-forbidden-spellings.js"
205
216
  },
206
217
  "generators": "./generators.json",
207
218
  "executors": "./executors.json",
@@ -218,11 +229,35 @@
218
229
  "test-shard2",
219
230
  "test-shard3",
220
231
  "test-shard4",
221
- "test-host"
232
+ "test-host",
233
+ "test-pool-silence"
222
234
  ]
223
235
  },
236
+ "test-pool-silence": {
237
+ "executor": "@smoothbricks/nx-plugin:bounded-exec",
238
+ "cache": true,
239
+ "inputs": [
240
+ "default",
241
+ "^dependencyDefault",
242
+ "bunToolchain",
243
+ "{workspaceRoot}/packages/cowshed/crates/cowshed-core/src/port_zero.cjs"
244
+ ],
245
+ "options": {
246
+ "command": "bun test --timeout=0 ./src/executors/bounded-exec/__tests__/cpu-pool.silence.ts",
247
+ "cwd": "{projectRoot}",
248
+ "idleTimeoutMs": 180000,
249
+ "killAfterMs": 10000
250
+ }
251
+ },
224
252
  "test-shard1": {
225
253
  "executor": "@smoothbricks/nx-plugin:bounded-exec",
254
+ "cache": true,
255
+ "inputs": [
256
+ "default",
257
+ "^dependencyDefault",
258
+ "bunToolchain",
259
+ "{workspaceRoot}/packages/cowshed/crates/cowshed-core/src/port_zero.cjs"
260
+ ],
226
261
  "options": {
227
262
  "command": "bun test --timeout=0 --timings=test-timings.json --shard=1/4 --path-ignore-patterns='**/*-host.test.ts'",
228
263
  "cwd": "{projectRoot}",
@@ -232,6 +267,13 @@
232
267
  },
233
268
  "test-shard2": {
234
269
  "executor": "@smoothbricks/nx-plugin:bounded-exec",
270
+ "cache": true,
271
+ "inputs": [
272
+ "default",
273
+ "^dependencyDefault",
274
+ "bunToolchain",
275
+ "{workspaceRoot}/packages/cowshed/crates/cowshed-core/src/port_zero.cjs"
276
+ ],
235
277
  "options": {
236
278
  "command": "bun test --timeout=0 --timings=test-timings.json --shard=2/4 --path-ignore-patterns='**/*-host.test.ts'",
237
279
  "cwd": "{projectRoot}",
@@ -241,6 +283,13 @@
241
283
  },
242
284
  "test-shard3": {
243
285
  "executor": "@smoothbricks/nx-plugin:bounded-exec",
286
+ "cache": true,
287
+ "inputs": [
288
+ "default",
289
+ "^dependencyDefault",
290
+ "bunToolchain",
291
+ "{workspaceRoot}/packages/cowshed/crates/cowshed-core/src/port_zero.cjs"
292
+ ],
244
293
  "options": {
245
294
  "command": "bun test --timeout=0 --timings=test-timings.json --shard=3/4 --path-ignore-patterns='**/*-host.test.ts'",
246
295
  "cwd": "{projectRoot}",
@@ -250,6 +299,13 @@
250
299
  },
251
300
  "test-shard4": {
252
301
  "executor": "@smoothbricks/nx-plugin:bounded-exec",
302
+ "cache": true,
303
+ "inputs": [
304
+ "default",
305
+ "^dependencyDefault",
306
+ "bunToolchain",
307
+ "{workspaceRoot}/packages/cowshed/crates/cowshed-core/src/port_zero.cjs"
308
+ ],
253
309
  "options": {
254
310
  "command": "bun test --timeout=0 --timings=test-timings.json --shard=4/4 --path-ignore-patterns='**/*-host.test.ts'",
255
311
  "cwd": "{projectRoot}",
@@ -259,16 +315,35 @@
259
315
  },
260
316
  "test-host": {
261
317
  "executor": "@smoothbricks/nx-plugin:bounded-exec",
318
+ "cache": true,
319
+ "inputs": [
320
+ "default",
321
+ "^dependencyDefault",
322
+ "bunToolchain",
323
+ "{workspaceRoot}/devenv.lock",
324
+ "{workspaceRoot}/tooling/direnv/devenv.lock",
325
+ "{workspaceRoot}/packages/cowshed/bin/**/*",
326
+ {
327
+ "dependentTasksOutputFiles": "**/*",
328
+ "transitive": true
329
+ }
330
+ ],
262
331
  "dependsOn": [
263
332
  {
264
333
  "projects": [
265
334
  "cowshed"
266
335
  ],
267
- "target": "build"
336
+ "target": "cli-native"
337
+ },
338
+ {
339
+ "projects": [
340
+ "cowshed"
341
+ ],
342
+ "target": "ram-fixture"
268
343
  }
269
344
  ],
270
345
  "options": {
271
- "command": "bun test --timeout=0 ./src/executors/bounded-exec/ram-temp-host.test.ts ./src/executors/bounded-exec/executor-host.test.ts ./src/executors/bounded-exec/go-progress-host.test.ts ./src/executors/bounded-exec/cargo-progress-host.test.ts",
346
+ "command": "bun test --timeout=0 ./src/executors/bounded-exec/ram-temp-host.test.ts ./src/executors/bounded-exec/executor-host.test.ts ./src/executors/bounded-exec/go-progress-host.test.ts ./src/executors/bounded-exec/cargo-progress-host.test.ts ./src/nx-daemon-stop-host.test.ts ./src/nx-daemon-watch-stream-host.test.ts ./src/executors/bounded-exec/hang-diagnostics-host.test.ts",
272
347
  "cwd": "{projectRoot}",
273
348
  "env": {
274
349
  "COWSHED_EXECUTABLE": "{workspaceRoot}/packages/cowshed/bin/cowshed"
@@ -294,6 +369,8 @@
294
369
  "generators.json",
295
370
  "executors.json",
296
371
  "!**/*.tsbuildinfo",
372
+ "!src/**/*.test.ts",
373
+ "!src/**/__tests__",
297
374
  "managed"
298
375
  ],
299
376
  "license": "MIT",
@@ -307,18 +384,22 @@
307
384
  },
308
385
  "dependencies": {
309
386
  "@nx/js": "23.2.1",
387
+ "@smoothbricks/build-inputs": "0.0.1-next.0",
388
+ "@smoothbricks/cargo-retain": "0.0.1-next.0",
389
+ "@smoothbricks/nextest-extract": "0.0.1-next.0",
310
390
  "jsonc-parser": "^3.3.1",
391
+ "minimatch": "10.2.5",
311
392
  "nx": "latest",
312
393
  "prettier": "^3.9.8",
313
394
  "smol-toml": "^1.6.1",
314
395
  "tslib": "^2.8.1",
315
396
  "typescript": "^6.0.3",
316
- "typia": "14.0.6",
397
+ "typia": "15.2.1",
317
398
  "yaml": "^2.9.0"
318
399
  },
319
400
  "devDependencies": {
320
- "@smoothbricks/lmao": "0.5.6",
321
- "@smoothbricks/validation": "0.1.12",
401
+ "@smoothbricks/lmao": "0.5.8",
402
+ "@smoothbricks/validation": "0.1.13",
322
403
  "fast-check": "^4.4.0"
323
404
  }
324
405
  }
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env node
2
+ import { cargoToolchainPaths, NIX_STORE_ROOT, resolveProgram } from '../cargo-toolchain-paths.js';
3
+
4
+ /** The runtime input of a cached cargo target: stdout is the value Nx hashes (cargo-toolchain-paths.ts says what it names). */
5
+ process.stdout.write(
6
+ cargoToolchainPaths({
7
+ environment: process.env,
8
+ storeRoot: NIX_STORE_ROOT,
9
+ resolve: (program) => resolveProgram(program, process.env.PATH),
10
+ }),
11
+ );