@smoothbricks/nx-plugin 0.5.7 → 0.6.0

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 (432) hide show
  1. package/README.md +1086 -360
  2. package/dist/.build-inputs.json +138 -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 +13 -5
  48. package/dist/ensure-built-receipt.d.ts.map +1 -1
  49. package/dist/ensure-built-receipt.js +126 -47
  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.d.ts +33 -36
  62. package/dist/executors/bounded-exec/cpu-pool.d.ts.map +1 -1
  63. package/dist/executors/bounded-exec/cpu-pool.js +54 -119
  64. package/dist/executors/bounded-exec/executor.d.ts +19 -12
  65. package/dist/executors/bounded-exec/executor.d.ts.map +1 -1
  66. package/dist/executors/bounded-exec/executor.js +371 -239
  67. package/dist/executors/bounded-exec/gateway-lease.d.ts +22 -19
  68. package/dist/executors/bounded-exec/gateway-lease.d.ts.map +1 -1
  69. package/dist/executors/bounded-exec/gateway-lease.js +81 -28
  70. package/dist/executors/bounded-exec/hang-diagnostics.d.ts +18 -1
  71. package/dist/executors/bounded-exec/hang-diagnostics.d.ts.map +1 -1
  72. package/dist/executors/bounded-exec/hang-diagnostics.js +148 -30
  73. package/dist/executors/bounded-exec/lease-wait.d.ts +43 -0
  74. package/dist/executors/bounded-exec/lease-wait.d.ts.map +1 -0
  75. package/dist/executors/bounded-exec/lease-wait.js +68 -0
  76. package/dist/executors/bounded-exec/lock-wait.d.ts +51 -0
  77. package/dist/executors/bounded-exec/lock-wait.d.ts.map +1 -0
  78. package/dist/executors/bounded-exec/lock-wait.js +108 -0
  79. package/dist/executors/bounded-exec/owned-subtree.d.ts +84 -0
  80. package/dist/executors/bounded-exec/owned-subtree.d.ts.map +1 -0
  81. package/dist/executors/bounded-exec/owned-subtree.js +178 -0
  82. package/dist/executors/bounded-exec/progress.d.ts +4 -1
  83. package/dist/executors/bounded-exec/progress.d.ts.map +1 -1
  84. package/dist/executors/bounded-exec/progress.js +5 -2
  85. package/dist/executors/bounded-exec/ram-attach.d.ts +19 -0
  86. package/dist/executors/bounded-exec/ram-attach.d.ts.map +1 -0
  87. package/dist/executors/bounded-exec/ram-attach.js +207 -0
  88. package/dist/executors/bounded-exec/ram-detach.d.ts +25 -0
  89. package/dist/executors/bounded-exec/ram-detach.d.ts.map +1 -0
  90. package/dist/executors/bounded-exec/ram-detach.js +207 -0
  91. package/dist/executors/bounded-exec/ram-temp-fixtures.d.ts +76 -0
  92. package/dist/executors/bounded-exec/ram-temp-fixtures.d.ts.map +1 -1
  93. package/dist/executors/bounded-exec/ram-temp-fixtures.js +296 -0
  94. package/dist/executors/bounded-exec/ram-temp.d.ts +388 -88
  95. package/dist/executors/bounded-exec/ram-temp.d.ts.map +1 -1
  96. package/dist/executors/bounded-exec/ram-temp.js +1213 -399
  97. package/dist/executors/bounded-exec/run-cpu-pool.d.ts +4 -4
  98. package/dist/executors/bounded-exec/run-cpu-pool.d.ts.map +1 -1
  99. package/dist/executors/bounded-exec/run-cpu-pool.js +20 -30
  100. package/dist/executors/bounded-exec/runner-hook.js +14 -5
  101. package/dist/executors/bounded-exec/runner-lifecycle.d.ts +14 -1
  102. package/dist/executors/bounded-exec/runner-lifecycle.d.ts.map +1 -1
  103. package/dist/executors/bounded-exec/runner-lifecycle.js +27 -6
  104. package/dist/executors/bounded-exec/{cpu-tokens.d.ts → runner-sizing.d.ts} +14 -42
  105. package/dist/executors/bounded-exec/runner-sizing.d.ts.map +1 -0
  106. package/dist/executors/bounded-exec/{cpu-tokens.js → runner-sizing.js} +5 -35
  107. package/dist/executors/bounded-exec/runtime-pin.d.ts +73 -0
  108. package/dist/executors/bounded-exec/runtime-pin.d.ts.map +1 -0
  109. package/dist/executors/bounded-exec/runtime-pin.js +167 -0
  110. package/dist/executors/bounded-exec/schema.d.ts +18 -1
  111. package/dist/executors/bounded-exec/schema.d.ts.map +1 -1
  112. package/dist/executors/bounded-exec/verdict.d.ts +40 -11
  113. package/dist/executors/bounded-exec/verdict.d.ts.map +1 -1
  114. package/dist/executors/bounded-exec/verdict.js +88 -19
  115. package/dist/executors/cargo-zigbuild/executor.d.ts +21 -0
  116. package/dist/executors/cargo-zigbuild/executor.d.ts.map +1 -1
  117. package/dist/executors/cargo-zigbuild/executor.js +67 -12
  118. package/dist/executors/clean-outputs/executor.js +1 -0
  119. package/dist/executors/scriptc-native/executor.d.ts +79 -0
  120. package/dist/executors/scriptc-native/executor.d.ts.map +1 -0
  121. package/dist/executors/scriptc-native/executor.js +367 -0
  122. package/dist/executors/scriptc-native/ffi-paths.d.ts +9 -0
  123. package/dist/executors/scriptc-native/ffi-paths.d.ts.map +1 -0
  124. package/dist/executors/scriptc-native/ffi-paths.js +25 -0
  125. package/dist/executors/scriptc-native/schema.d.ts +34 -0
  126. package/dist/executors/scriptc-native/schema.d.ts.map +1 -0
  127. package/dist/executors/scriptc-native/schema.js +1 -0
  128. package/dist/executors/typescript-emit/executor.d.ts +3 -1
  129. package/dist/executors/typescript-emit/executor.d.ts.map +1 -1
  130. package/dist/executors/typescript-emit/executor.js +164 -33
  131. package/dist/forbidden-spelling-policy.d.ts +56 -0
  132. package/dist/forbidden-spelling-policy.d.ts.map +1 -0
  133. package/dist/forbidden-spelling-policy.js +176 -0
  134. package/dist/generators/create-package/generator.d.ts.map +1 -1
  135. package/dist/generators/create-package/generator.js +3 -4
  136. package/dist/graph-input-contract.d.ts +14 -0
  137. package/dist/graph-input-contract.d.ts.map +1 -1
  138. package/dist/graph-input-contract.js +67 -2
  139. package/dist/index.d.ts +23 -6
  140. package/dist/index.d.ts.map +1 -1
  141. package/dist/index.js +672 -214
  142. package/dist/managed-assets.d.ts +2 -0
  143. package/dist/managed-assets.d.ts.map +1 -1
  144. package/dist/managed-files/files.d.ts +3 -3
  145. package/dist/managed-files/files.d.ts.map +1 -1
  146. package/dist/managed-files/files.js +28 -3
  147. package/dist/managed-files/managed-format.d.ts.map +1 -1
  148. package/dist/managed-files/managed-format.js +1 -0
  149. package/dist/nextest-code-bound.js +1 -0
  150. package/dist/nextest-timings.d.ts +35 -0
  151. package/dist/nextest-timings.d.ts.map +1 -0
  152. package/dist/nextest-timings.js +168 -0
  153. package/dist/owned-installation.d.ts +6 -5
  154. package/dist/owned-installation.d.ts.map +1 -1
  155. package/dist/owned-installation.js +150 -26
  156. package/dist/package-target-policy.d.ts.map +1 -1
  157. package/dist/package-target-policy.js +2 -3
  158. package/dist/process-children.d.ts +7 -0
  159. package/dist/process-children.d.ts.map +1 -0
  160. package/dist/process-children.darwin.d.ts +7 -0
  161. package/dist/process-children.darwin.d.ts.map +1 -0
  162. package/dist/process-children.darwin.js +13 -0
  163. package/dist/process-children.js +14 -0
  164. package/dist/process-children.linux.d.ts +8 -0
  165. package/dist/process-children.linux.d.ts.map +1 -0
  166. package/dist/process-children.linux.js +25 -0
  167. package/dist/process-group.d.ts +108 -0
  168. package/dist/process-group.d.ts.map +1 -0
  169. package/dist/process-group.js +171 -0
  170. package/dist/process-listing.d.ts +7 -0
  171. package/dist/process-listing.d.ts.map +1 -0
  172. package/dist/process-listing.js +51 -0
  173. package/dist/producer-receipts.d.ts +8 -2
  174. package/dist/producer-receipts.d.ts.map +1 -1
  175. package/dist/producer-receipts.js +75 -48
  176. package/dist/task-graph-policy.d.ts +21 -0
  177. package/dist/task-graph-policy.d.ts.map +1 -0
  178. package/dist/task-graph-policy.js +91 -0
  179. package/dist/test-timings.js +4 -4
  180. package/dist/test-walk-policy.d.ts +14 -5
  181. package/dist/test-walk-policy.d.ts.map +1 -1
  182. package/dist/test-walk-policy.js +8 -2
  183. package/dist/testing.d.ts +73 -28
  184. package/dist/testing.d.ts.map +1 -1
  185. package/dist/testing.js +217 -223
  186. package/dist/tool-bins.d.ts +33 -0
  187. package/dist/tool-bins.d.ts.map +1 -0
  188. package/dist/tool-bins.js +72 -0
  189. package/dist/typecheck-test-policy.d.ts.map +1 -1
  190. package/dist/typecheck-test-policy.js +3 -4
  191. package/dist/wait-why-policy.d.ts +28 -0
  192. package/dist/wait-why-policy.d.ts.map +1 -0
  193. package/dist/wait-why-policy.js +223 -0
  194. package/dist/workspace-config-policy.d.ts +14 -8
  195. package/dist/workspace-config-policy.d.ts.map +1 -1
  196. package/dist/workspace-config-policy.js +60 -16
  197. package/dist/workspace-manifest.d.ts +41 -6
  198. package/dist/workspace-manifest.d.ts.map +1 -1
  199. package/dist/workspace-manifest.js +57 -0
  200. package/executors.json +16 -1
  201. package/loader.js +2 -0
  202. package/managed/raw/envrc +11 -0
  203. package/managed/raw/patches/nx@23.2.1.patch +2840 -199
  204. package/managed/raw/patches/ttsc@0.34.1.patch +119 -0
  205. package/managed/raw/tooling/direnv/cargo-fetch-bound.ts +245 -0
  206. package/managed/raw/tooling/direnv/cargo-fetch-run.ts +299 -0
  207. package/managed/raw/tooling/direnv/compiler-variables.sh +42 -0
  208. package/managed/raw/tooling/direnv/developer-links.ts +464 -25
  209. package/managed/raw/tooling/direnv/devenv.smoo.nix +78 -38
  210. package/managed/raw/tooling/direnv/github-actions-bootstrap.sh +14 -12
  211. package/managed/raw/tooling/direnv/installed-bun-links.ts +308 -0
  212. package/managed/raw/tooling/direnv/linked-snapshots.ts +62 -3
  213. package/managed/raw/tooling/direnv/nx-socket-dir.sh +56 -17
  214. package/managed/raw/tooling/direnv/repo-path +68 -6
  215. package/managed/raw/tooling/direnv/secret-references.ts +13 -4
  216. package/managed/raw/tooling/direnv/setup-environment.ts +128 -537
  217. package/managed/raw/tooling/direnv/toolchain-stamp.ts +4 -2
  218. package/managed/raw/tooling/direnv/ttsc-env.sh +9 -0
  219. package/managed/raw/tooling/direnv/uv-relocation.ts +227 -0
  220. package/managed/raw/tooling/git-hooks/commit-msg.sh +2 -1
  221. package/managed/raw/tooling/git-hooks/pre-commit.sh +2 -1
  222. package/managed/raw/tooling/git-hooks/pre-push.sh +2 -1
  223. package/managed/templates/github/actions/cache-ttsc-plugins/action.yml +85 -7
  224. package/managed/templates/github/actions/save-nix-devenv/action.yml +12 -2
  225. package/managed/templates/github/actions/setup-devenv/action.yml +2 -0
  226. package/package.json +77 -13
  227. package/src/bin/smoo-nx-cargo-toolchain.ts +11 -0
  228. package/src/bin/smoo-nx-forbidden-spellings.ts +33 -0
  229. package/src/bin/smoo-nx-nextest-timings.ts +31 -0
  230. package/src/bounded-test-policy.ts +12 -14
  231. package/src/build-state-output-policy.ts +458 -34
  232. package/src/bun-lock-scope.ts +108 -0
  233. package/src/cargo-build-script-env.ts +265 -0
  234. package/src/cargo-closure-input.ts +74 -7
  235. package/src/cargo-retention-hook.ts +94 -0
  236. package/src/cargo-source-hash.ts +138 -41
  237. package/src/cargo-toolchain-paths.ts +95 -0
  238. package/src/cargo-toolchain-policy.ts +49 -5
  239. package/src/cargo-workspace.ts +72 -123
  240. package/src/cross-check-policy.ts +12 -10
  241. package/src/disk-command-policy.ts +1 -0
  242. package/src/ensure-built-receipt.ts +132 -39
  243. package/src/ensure-built-witness.ts +62 -10
  244. package/src/ensure-built.ts +11 -1
  245. package/src/eslint-config-closure.ts +357 -0
  246. package/src/executors/bounded-exec/bounds.ts +76 -0
  247. package/src/executors/bounded-exec/cpu-pool.ts +51 -117
  248. package/src/executors/bounded-exec/executor.ts +423 -259
  249. package/src/executors/bounded-exec/gateway-lease.ts +82 -33
  250. package/src/executors/bounded-exec/hang-diagnostics.ts +173 -31
  251. package/src/executors/bounded-exec/lease-wait.ts +89 -0
  252. package/src/executors/bounded-exec/lock-wait.ts +141 -0
  253. package/src/executors/bounded-exec/owned-subtree.ts +235 -0
  254. package/src/executors/bounded-exec/progress.ts +9 -3
  255. package/src/executors/bounded-exec/ram-attach.ts +238 -0
  256. package/src/executors/bounded-exec/ram-detach.ts +226 -0
  257. package/src/executors/bounded-exec/ram-temp-fixtures.ts +358 -0
  258. package/src/executors/bounded-exec/ram-temp-registry.txt +440 -0
  259. package/src/executors/bounded-exec/ram-temp.ts +1497 -460
  260. package/src/executors/bounded-exec/run-cpu-pool.ts +22 -30
  261. package/src/executors/bounded-exec/runner-hook.ts +14 -6
  262. package/src/executors/bounded-exec/runner-lifecycle.ts +31 -8
  263. package/src/executors/bounded-exec/{cpu-tokens.ts → runner-sizing.ts} +13 -59
  264. package/src/executors/bounded-exec/runtime-pin.ts +232 -0
  265. package/src/executors/bounded-exec/schema.json +11 -2
  266. package/src/executors/bounded-exec/schema.ts +19 -1
  267. package/src/executors/bounded-exec/verdict.ts +137 -34
  268. package/src/executors/cargo-zigbuild/executor.ts +82 -8
  269. package/src/executors/clean-outputs/executor.ts +1 -0
  270. package/src/executors/scriptc-native/executor.ts +394 -0
  271. package/src/executors/scriptc-native/ffi-paths.ts +29 -0
  272. package/src/executors/scriptc-native/schema.json +60 -0
  273. package/src/executors/scriptc-native/schema.ts +34 -0
  274. package/src/executors/typescript-emit/executor.ts +205 -38
  275. package/src/forbidden-spelling-policy.ts +226 -0
  276. package/src/generators/create-package/generator.ts +7 -7
  277. package/src/graph-input-contract.ts +61 -2
  278. package/src/index.ts +788 -224
  279. package/src/managed-assets.ts +3 -0
  280. package/src/managed-files/files.ts +28 -3
  281. package/src/managed-files/managed-format.ts +1 -0
  282. package/src/nextest-code-bound.ts +1 -0
  283. package/src/nextest-timings.ts +106 -0
  284. package/src/owned-installation.ts +150 -23
  285. package/src/package-target-policy.ts +2 -3
  286. package/src/process-children.darwin.ts +14 -0
  287. package/src/process-children.linux.ts +33 -0
  288. package/src/process-children.ts +22 -0
  289. package/src/process-group.ts +209 -0
  290. package/src/process-listing.ts +54 -0
  291. package/src/producer-receipts.ts +68 -45
  292. package/src/task-graph-policy.ts +98 -0
  293. package/src/test-walk-policy.ts +23 -8
  294. package/src/testing.ts +240 -232
  295. package/src/tool-bins.ts +108 -0
  296. package/src/typecheck-test-policy.ts +2 -3
  297. package/src/wait-why-policy.ts +226 -0
  298. package/src/workspace-config-policy.ts +63 -15
  299. package/src/workspace-manifest.ts +89 -6
  300. package/test-timings.json +122 -98
  301. package/dist/bin/smoo-nx-failures.d.ts +0 -3
  302. package/dist/bin/smoo-nx-failures.d.ts.map +0 -1
  303. package/dist/bin/smoo-nx-failures.js +0 -3
  304. package/dist/bin/smoo-nx-nextest-extract.d.ts +0 -3
  305. package/dist/bin/smoo-nx-nextest-extract.d.ts.map +0 -1
  306. package/dist/bin/smoo-nx-nextest-extract.js +0 -42
  307. package/dist/executors/bounded-exec/cpu-tokens.d.ts.map +0 -1
  308. package/dist/failure-summary.d.ts +0 -5
  309. package/dist/failure-summary.d.ts.map +0 -1
  310. package/dist/failure-summary.js +0 -118
  311. package/dist/nextest-extraction.d.ts +0 -117
  312. package/dist/nextest-extraction.d.ts.map +0 -1
  313. package/dist/nextest-extraction.js +0 -303
  314. package/managed/raw/patches/ttsc@0.30.4.patch +0 -2255
  315. package/src/__tests__/cargo-closure-filesets.ts +0 -94
  316. package/src/__tests__/cargo-closure-fixture.ts +0 -113
  317. package/src/__tests__/counted-cargo-process.ts +0 -286
  318. package/src/__tests__/counted-cargo.ts +0 -713
  319. package/src/__tests__/directory-change.ts +0 -27
  320. package/src/__tests__/fixture-cargo-home.ts +0 -36
  321. package/src/__tests__/fixture-nx-env.ts +0 -193
  322. package/src/__tests__/owned-installation.ts +0 -13
  323. package/src/__tests__/past-tick.ts +0 -12
  324. package/src/__tests__/progress-clock.ts +0 -43
  325. package/src/__tests__/runtime-input.ts +0 -23
  326. package/src/bin/smoo-nx-bound-failures.test.ts +0 -127
  327. package/src/bin/smoo-nx-failures.ts +0 -4
  328. package/src/bin/smoo-nx-nextest-extract.ts +0 -44
  329. package/src/bounded-test-policy.test.ts +0 -1029
  330. package/src/build-state-output-policy.test.ts +0 -115
  331. package/src/bun-bootstrap.test.ts +0 -102
  332. package/src/bun-file-packages.test.ts +0 -47
  333. package/src/cargo-closure-filesets.test.ts +0 -63
  334. package/src/cargo-closure-input.property.test.ts +0 -50
  335. package/src/cargo-closure-input.test.ts +0 -506
  336. package/src/cargo-closure-key.test.ts +0 -240
  337. package/src/cargo-resolve-cache.test.ts +0 -1181
  338. package/src/cargo-source-hash.test.ts +0 -707
  339. package/src/cargo-workspace.test.ts +0 -615
  340. package/src/cross-check-policy.test.ts +0 -316
  341. package/src/disk-command-policy.test.ts +0 -61
  342. package/src/ensure-built-receipt.test.ts +0 -279
  343. package/src/ensure-built-witness.test.ts +0 -688
  344. package/src/ensure-built.test.ts +0 -1462
  345. package/src/executors/all-verdicts/executor.test.ts +0 -135
  346. package/src/executors/bounded-exec/cargo-progress-host.test.ts +0 -332
  347. package/src/executors/bounded-exec/cpu-pool.test.ts +0 -684
  348. package/src/executors/bounded-exec/cpu-tokens.test.ts +0 -519
  349. package/src/executors/bounded-exec/disk-lease.test.ts +0 -219
  350. package/src/executors/bounded-exec/executor-host.test.ts +0 -800
  351. package/src/executors/bounded-exec/executor.test.ts +0 -1819
  352. package/src/executors/bounded-exec/go-progress-host.test.ts +0 -171
  353. package/src/executors/bounded-exec/hang-diagnostics.test.ts +0 -291
  354. package/src/executors/bounded-exec/progress.test.ts +0 -139
  355. package/src/executors/bounded-exec/ram-temp-held.test.ts +0 -264
  356. package/src/executors/bounded-exec/ram-temp-host.test.ts +0 -635
  357. package/src/executors/bounded-exec/ram-temp.test.ts +0 -750
  358. package/src/executors/bounded-exec/run-cpu-pool.test.ts +0 -79
  359. package/src/executors/bounded-exec/runner-hook.test.ts +0 -193
  360. package/src/executors/bounded-exec/runner-lifecycle.test.ts +0 -82
  361. package/src/executors/bounded-exec/verdict.test.ts +0 -545
  362. package/src/executors/cargo-zigbuild/executor.test.ts +0 -129
  363. package/src/executors/clean-outputs/executor.test.ts +0 -20
  364. package/src/executors/typescript-emit/executor.test.ts +0 -83
  365. package/src/failure-summary.ts +0 -119
  366. package/src/generators/bounded-test-targets/generator.test.ts +0 -138
  367. package/src/generators/bun-test-tracing/generator.test.ts +0 -250
  368. package/src/generators/create-package/generator.test.ts +0 -190
  369. package/src/generators/make-public/generator.test.ts +0 -137
  370. package/src/graph-input-contract.test.ts +0 -379
  371. package/src/host-controller-wiring.test.ts +0 -31
  372. package/src/index.test.ts +0 -3321
  373. package/src/linked-snapshots.nx.test.ts +0 -254
  374. package/src/managed-files/forgejo-artifact.test.ts +0 -395
  375. package/src/managed-files/generator.test.ts +0 -243
  376. package/src/managed-files/github-host-cache-isolation.test.ts +0 -86
  377. package/src/managed-files/json-edit.test.ts +0 -216
  378. package/src/managed-files/managed-content.test.ts +0 -166
  379. package/src/managed-files/managed-format-json.test.ts +0 -308
  380. package/src/managed-files/repo-path.test.ts +0 -172
  381. package/src/managed-files/setup-devenv-free-disk.test.ts +0 -95
  382. package/src/managed-files/trace-db-artifact.test.ts +0 -7
  383. package/src/managed-files/tree-permissions.test.ts +0 -109
  384. package/src/managed-files/tree.test.ts +0 -123
  385. package/src/manifest-hash.test.ts +0 -219
  386. package/src/nextest-code-bound.test.ts +0 -161
  387. package/src/nextest-extraction.test.ts +0 -216
  388. package/src/nextest-extraction.ts +0 -371
  389. package/src/nextest-partitions.test.ts +0 -501
  390. package/src/nx-cache-bound.test.ts +0 -109
  391. package/src/nx-cache-restore-mtime.test.ts +0 -170
  392. package/src/nx-daemon-claim.test.ts +0 -279
  393. package/src/nx-daemon-idle-cpu.test.ts +0 -80
  394. package/src/nx-daemon-idle-policy.test.ts +0 -111
  395. package/src/nx-daemon-ignore-files.test.ts +0 -210
  396. package/src/nx-daemon-root-normalization.test.ts +0 -105
  397. package/src/nx-daemon-start-never.test.ts +0 -292
  398. package/src/nx-daemon-validity.test.ts +0 -1055
  399. package/src/nx-dot-input-policy.test.ts +0 -353
  400. package/src/nx-failure-life-cycles.test.ts +0 -207
  401. package/src/nx-files-archive-racy.test.ts +0 -97
  402. package/src/nx-foreign-workspace-env.test.ts +0 -329
  403. package/src/nx-incomplete-run-summary.test.ts +0 -70
  404. package/src/nx-plugin-load-errors.test.ts +0 -120
  405. package/src/nx-project-graph-errors.test.ts +0 -70
  406. package/src/nx-project-resolution-cache.test.ts +0 -176
  407. package/src/nx-raw-inputs.test.ts +0 -166
  408. package/src/nx-resident-graph-workers.test.ts +0 -112
  409. package/src/nx-run-information.test.ts +0 -118
  410. package/src/nx-skipped-task-exit.test.ts +0 -180
  411. package/src/nx-state-location.test.ts +0 -63
  412. package/src/nx-store-resolution.test.ts +0 -81
  413. package/src/nx-task-graph-cycles.test.ts +0 -148
  414. package/src/nx-task-output-lease.test.ts +0 -550
  415. package/src/nx-use-local.test.ts +0 -105
  416. package/src/owned-installation.test.ts +0 -105
  417. package/src/package-target-policy.test.ts +0 -1014
  418. package/src/producer-receipts.test.ts +0 -285
  419. package/src/release-config-policy.test.ts +0 -311
  420. package/src/runtime-input.test.ts +0 -393
  421. package/src/serial-group-wiring.test.ts +0 -326
  422. package/src/task-history-namespace.test.ts +0 -181
  423. package/src/task-results.test.ts +0 -228
  424. package/src/test-clock-policy.test.ts +0 -338
  425. package/src/test-program.test.ts +0 -303
  426. package/src/test-timings.test.ts +0 -240
  427. package/src/test-walk-policy.test.ts +0 -620
  428. package/src/testing.test.ts +0 -509
  429. package/src/typecheck-test-policy.test.ts +0 -1468
  430. package/src/typescript-resolution.test.ts +0 -76
  431. package/src/version-actions.test.ts +0 -80
  432. package/src/workspace-config-policy.test.ts +0 -737
@@ -0,0 +1,68 @@
1
+ /** Peer wait classes from specs/cowshed/05_gateway.md, "Deadlines". */
2
+ export const CONTROL_MS = 5_000;
3
+ export const HEARTBEAT_MS = 5_000;
4
+ export const HEARTBEAT_SILENCE_MS = 15_000;
5
+ /** Pure CPU admission policy; its injected monotonic clock performs no I/O or scheduling. */
6
+ export class CpuLeaseWait {
7
+ now;
8
+ started;
9
+ state = { kind: 'sending' };
10
+ /** When the client last looked at its wait or read a frame of it. */
11
+ looked;
12
+ constructor(now = () => performance.now()) {
13
+ this.now = now;
14
+ this.started = now();
15
+ this.looked = this.started;
16
+ }
17
+ /** The kernel took the complete request; only peer silence bounds the answer from here. */
18
+ sent() {
19
+ this.looked = this.now();
20
+ if (this.state.kind === 'sending') {
21
+ this.state = { kind: 'waiting', at: this.now(), last: 'request sent', sequence: 0 };
22
+ }
23
+ }
24
+ /** A queue entry proves actor progress, not a deadline for returning a token. */
25
+ queued() {
26
+ this.sent();
27
+ if (this.state.kind === 'waiting') {
28
+ this.state = { ...this.state, at: this.now(), last: 'queued' };
29
+ }
30
+ }
31
+ /** Only an advancing actor sequence renews silence; duplicate or invalid progress proves nothing. */
32
+ heartbeat(sequence) {
33
+ this.sent();
34
+ if (this.state.kind !== 'waiting' || !Number.isSafeInteger(sequence) || sequence <= this.state.sequence)
35
+ return false;
36
+ this.state = { kind: 'waiting', at: this.now(), last: `heartbeat ${sequence}`, sequence };
37
+ return true;
38
+ }
39
+ /**
40
+ * The client looks at its wait before judging it. A look later than the silence bound plus a heartbeat
41
+ * after its previous look or frame means the client's own event loop did not run (a loaded host), so
42
+ * what the pool sent meanwhile is unread: the pool gets one heartbeat more from now (05_gateway.md
43
+ * "Deadlines"). A client that looks in time judges the pool at the bound.
44
+ */
45
+ look() {
46
+ const now = this.now();
47
+ if (this.state.kind === 'waiting' && now - this.looked > HEARTBEAT_SILENCE_MS + HEARTBEAT_MS) {
48
+ this.state = { ...this.state, at: Math.max(this.state.at, now - HEARTBEAT_SILENCE_MS + HEARTBEAT_MS) };
49
+ }
50
+ this.looked = now;
51
+ }
52
+ /** Milliseconds until the current phase's bound, clipped at zero. */
53
+ remainingMs() {
54
+ const due = this.state.kind === 'sending' ? this.started + CONTROL_MS : this.state.at + HEARTBEAT_SILENCE_MS;
55
+ return Math.max(0, due - this.now());
56
+ }
57
+ /** No total queue age exists: an advancing heartbeat keeps the wait alive indefinitely. */
58
+ expired() {
59
+ if (this.remainingMs() > 0)
60
+ return null;
61
+ return {
62
+ code: this.state.kind === 'sending' ? 'TIMEOUT' : 'SILENT',
63
+ boundMs: this.state.kind === 'sending' ? CONTROL_MS : HEARTBEAT_SILENCE_MS,
64
+ elapsedMs: this.now() - this.started,
65
+ last: this.state.kind === 'sending' ? 'connecting or sending request' : this.state.last,
66
+ };
67
+ }
68
+ }
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Lock-wait evidence from open-file tables. Pure: no I/O and no clock. `hang-diagnostics.ts` runs `lsof` and hands its
3
+ * output here, so every decision is a function of the rows it was given.
4
+ *
5
+ * A wait is open-handle evidence, not a kernel lock owner. flock(2) and fcntl(2) name no holder, so a regular file the
6
+ * run holds on a numbered descriptor, and that another process also holds open, is the only candidate for the lock a
7
+ * run blocks on. Nothing here observes the lock call itself.
8
+ */
9
+ /** One row of an `lsof -nP -p ...` table: a file a process holds open. */
10
+ export interface OpenFile {
11
+ readonly pid: number;
12
+ readonly fd: string;
13
+ readonly type: string;
14
+ readonly path: string;
15
+ }
16
+ /** A process that holds a file open. */
17
+ export interface Opener {
18
+ readonly pid: number;
19
+ readonly command: string;
20
+ }
21
+ /** An opener that `lsof -F` named for one path. */
22
+ export interface PathOpener extends Opener {
23
+ readonly path: string;
24
+ }
25
+ /**
26
+ * A regular file the run holds on a numbered descriptor while processes outside the run also hold it open. `waiters`
27
+ * are the run's pids holding it; `holders` are the outside processes, never a run pid.
28
+ */
29
+ export interface LockWait {
30
+ readonly path: string;
31
+ readonly waiters: readonly number[];
32
+ readonly holders: readonly Opener[];
33
+ }
34
+ /** The rows of an `lsof -nP` table. The header and any row that does not parse are skipped. */
35
+ export declare function parseLsofTable(text: string): OpenFile[];
36
+ /** The distinct lockable paths in `tree`, sorted. */
37
+ export declare function lockCandidates(tree: readonly OpenFile[]): string[];
38
+ /**
39
+ * The lock waits in `tree`, the open files of the run's processes. A path is a wait only when some process outside
40
+ * the run (`treePids` excludes the run) also holds it open. Sorted by path; holders deduplicated by pid and sorted.
41
+ */
42
+ export declare function lockWaits(tree: readonly OpenFile[], treePids: ReadonlySet<number>, openers: readonly PathOpener[]): LockWait[];
43
+ /**
44
+ * Parse `lsof -F pcn` output: `p<pid>` opens a process, `c<command>` names it, `f<fd>` opens a file (lsof always
45
+ * emits one), and `n<path>` names the file. `null` for any other shape: the caller must then call the census
46
+ * incomplete, never empty.
47
+ */
48
+ export declare function parseLsofFields(text: string): PathOpener[] | null;
49
+ /** The holders as a reader names them: `pid 51234 (cargo), pid 9 (rustc)`. */
50
+ export declare function describeHolders(holders: readonly Opener[]): string;
51
+ //# sourceMappingURL=lock-wait.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lock-wait.d.ts","sourceRoot":"","sources":["../../../src/executors/bounded-exec/lock-wait.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,0EAA0E;AAC1E,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,wCAAwC;AACxC,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,mDAAmD;AACnD,MAAM,WAAW,UAAW,SAAQ,MAAM;IACxC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC;AAKD,+FAA+F;AAC/F,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,EAAE,CAOvD;AAiBD,qDAAqD;AACrD,wBAAgB,cAAc,CAAC,IAAI,EAAE,SAAS,QAAQ,EAAE,GAAG,MAAM,EAAE,CAElE;AAED;;;GAGG;AACH,wBAAgB,SAAS,CACvB,IAAI,EAAE,SAAS,QAAQ,EAAE,EACzB,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,EAC7B,OAAO,EAAE,SAAS,UAAU,EAAE,GAC7B,QAAQ,EAAE,CAkBZ;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,EAAE,GAAG,IAAI,CA+BjE;AAED,8EAA8E;AAC9E,wBAAgB,eAAe,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAElE"}
@@ -0,0 +1,108 @@
1
+ /**
2
+ * Lock-wait evidence from open-file tables. Pure: no I/O and no clock. `hang-diagnostics.ts` runs `lsof` and hands its
3
+ * output here, so every decision is a function of the rows it was given.
4
+ *
5
+ * A wait is open-handle evidence, not a kernel lock owner. flock(2) and fcntl(2) name no holder, so a regular file the
6
+ * run holds on a numbered descriptor, and that another process also holds open, is the only candidate for the lock a
7
+ * run blocks on. Nothing here observes the lock call itself.
8
+ */
9
+ /** COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME; NAME is everything from the ninth column on, spaces included. */
10
+ const TABLE_ROW = /^\S+\s+(?<pid>\d+)\s+\S+\s+(?<fd>\S+)\s+(?<type>\S+)\s+\S+\s+\S+\s+\S+\s+(?<path>.+)$/;
11
+ /** The rows of an `lsof -nP` table. The header and any row that does not parse are skipped. */
12
+ export function parseLsofTable(text) {
13
+ const rows = [];
14
+ for (const line of text.split('\n')) {
15
+ const row = toOpenFile(line);
16
+ if (row !== null)
17
+ rows.push(row);
18
+ }
19
+ return rows;
20
+ }
21
+ function toOpenFile(line) {
22
+ const groups = TABLE_ROW.exec(line)?.groups ?? {};
23
+ const { pid, fd, type, path } = groups;
24
+ if (pid === undefined || fd === undefined || type === undefined || path === undefined)
25
+ return null;
26
+ return { pid: Number(pid), fd, type, path };
27
+ }
28
+ /**
29
+ * A regular file on a numbered descriptor: the only kind a blocking flock or fcntl can wait on. `cwd`, `txt`, `rtd`,
30
+ * `mem` and the other unnumbered descriptors name files a process runs or maps, not files it locks.
31
+ */
32
+ function isLockable(row) {
33
+ return row.type === 'REG' && /^\d/.test(row.fd);
34
+ }
35
+ /** The distinct lockable paths in `tree`, sorted. */
36
+ export function lockCandidates(tree) {
37
+ return [...new Set(tree.filter(isLockable).map((row) => row.path))].sort();
38
+ }
39
+ /**
40
+ * The lock waits in `tree`, the open files of the run's processes. A path is a wait only when some process outside
41
+ * the run (`treePids` excludes the run) also holds it open. Sorted by path; holders deduplicated by pid and sorted.
42
+ */
43
+ export function lockWaits(tree, treePids, openers) {
44
+ const waits = [];
45
+ for (const path of lockCandidates(tree)) {
46
+ const holders = new Map();
47
+ for (const opener of openers) {
48
+ if (opener.path === path && !treePids.has(opener.pid) && !holders.has(opener.pid)) {
49
+ holders.set(opener.pid, { pid: opener.pid, command: opener.command });
50
+ }
51
+ }
52
+ if (holders.size === 0)
53
+ continue;
54
+ const waiters = [...new Set(tree.filter((row) => isLockable(row) && row.path === path).map((row) => row.pid))];
55
+ waits.push({
56
+ path,
57
+ waiters: waiters.sort((a, b) => a - b),
58
+ holders: [...holders.values()].sort((a, b) => a.pid - b.pid),
59
+ });
60
+ }
61
+ return waits;
62
+ }
63
+ /**
64
+ * Parse `lsof -F pcn` output: `p<pid>` opens a process, `c<command>` names it, `f<fd>` opens a file (lsof always
65
+ * emits one), and `n<path>` names the file. `null` for any other shape: the caller must then call the census
66
+ * incomplete, never empty.
67
+ */
68
+ export function parseLsofFields(text) {
69
+ const openers = [];
70
+ let pid = null;
71
+ let command = null;
72
+ for (const line of text.split('\n')) {
73
+ if (line === '')
74
+ continue;
75
+ const value = line.slice(1);
76
+ switch (line.charAt(0)) {
77
+ case 'p': {
78
+ const next = Number(value);
79
+ if (!Number.isSafeInteger(next) || next <= 0)
80
+ return null;
81
+ pid = next;
82
+ command = null;
83
+ break;
84
+ }
85
+ case 'c':
86
+ if (pid === null || command !== null)
87
+ return null;
88
+ command = value;
89
+ break;
90
+ case 'f':
91
+ if (pid === null)
92
+ return null;
93
+ break;
94
+ case 'n':
95
+ if (pid === null || command === null)
96
+ return null;
97
+ openers.push({ pid, command, path: value });
98
+ break;
99
+ default:
100
+ return null;
101
+ }
102
+ }
103
+ return openers;
104
+ }
105
+ /** The holders as a reader names them: `pid 51234 (cargo), pid 9 (rustc)`. */
106
+ export function describeHolders(holders) {
107
+ return holders.map(({ pid, command }) => `pid ${pid} (${command})`).join(', ');
108
+ }
@@ -0,0 +1,84 @@
1
+ import type { Readable } from 'node:stream';
2
+ /**
3
+ * What a `bounded-exec` command leaves running, owned the way cowshed's supervisor owns a job's processes
4
+ * (specs/cowshed/11_shell.md, "Process identity and signal ownership"): by the tree the supervisor observes from
5
+ * fork, never by who works in a directory. The command runs as `cowshed subtree-root`, which asks its job's
6
+ * supervisor for a handle on itself while it is alive, writes that answer to an inherited descriptor, and execs the
7
+ * command in the same life. At the end, `cowshed retire-descendants` hands the handle back: the supervisor signals
8
+ * the live members its tree records under that root, and nothing else, so a process that merely works in the
9
+ * command's directory is never touched.
10
+ */
11
+ /** Set by a cowshed runtime for a job only when a supervisor serves that job's socket. */
12
+ export declare const SUPERVISOR_SOCKET_ENV = "COWSHED_SUPERVISOR_SOCKET";
13
+ /**
14
+ * The variable naming the cowshed executable that runs `cowshed disk-command` and `cowshed subtree-root`. Unset, it is
15
+ * the installed `cowshed` on PATH. A repository that tests its own cowshed sets it, on the targets that test it, to that
16
+ * checkout's build: an installed cowshed that predates a command its own checkout added would fail the very code under
17
+ * test. The executor passes the one it resolved to the command, so it is part of what the command runs.
18
+ */
19
+ export declare const COWSHED_EXECUTABLE_ENV = "COWSHED_EXECUTABLE";
20
+ /**
21
+ * The descriptor `cowshed subtree-root` writes its admission to. fd 3 is the runner lifecycle's duplex socket
22
+ * (`runner-hook.ts`), which must reach the command, so the admission takes the next one.
23
+ */
24
+ export declare const HANDLE_FD = 4;
25
+ /** The supervisor's opaque capability for one subtree; only `retire-descendants` reads it. */
26
+ export type SubtreeHandle = Readonly<Record<string, unknown>>;
27
+ /** Why the supervisor answered no, by its own typed reason. */
28
+ export type SubtreeRefusal = 'foldUnavailable' | 'notMember' | 'foreignHandle' | 'jobEnded' | 'spentHandle';
29
+ /** What `cowshed subtree-root` wrote, or why nothing readable came. */
30
+ export type SubtreeAdmission = {
31
+ kind: 'admitted';
32
+ handle: SubtreeHandle;
33
+ } | {
34
+ kind: 'refused';
35
+ reason: SubtreeRefusal;
36
+ } | {
37
+ kind: 'unread';
38
+ detail: string;
39
+ };
40
+ /** A process the retirement signalled: its pid, and its image when the supervisor read one. */
41
+ export interface SignalledProcess {
42
+ readonly pid: number;
43
+ readonly image: string | null;
44
+ readonly signal: number;
45
+ }
46
+ /** Where the supervisor's observation of the subtree may have missed something. */
47
+ export interface CoverageGap {
48
+ readonly kind: string;
49
+ readonly pid: number | null;
50
+ }
51
+ export type SubtreeRetirement = {
52
+ kind: 'retired';
53
+ signalled: readonly SignalledProcess[];
54
+ /** True when the supervisor could not list every process it signalled. */
55
+ signalledIncomplete: boolean;
56
+ gaps: readonly CoverageGap[];
57
+ } | {
58
+ kind: 'refused';
59
+ reason: SubtreeRefusal;
60
+ } | {
61
+ kind: 'failed';
62
+ detail: string;
63
+ };
64
+ /** The client half: how a command becomes an owned subtree root, and how its subtree ends. */
65
+ export interface SubtreeOwner {
66
+ /** The argv that runs the shell `command` as an owned subtree root, its admission on {@link HANDLE_FD}. */
67
+ rootArgv(command: string): {
68
+ file: string;
69
+ args: string[];
70
+ };
71
+ /** Retire every live member recorded under `handle`'s root: TERM, then KILL after `graceMs`. */
72
+ retire(handle: SubtreeHandle, graceMs: number): Promise<SubtreeRetirement>;
73
+ }
74
+ /** Parse the admission JSON line `cowshed subtree-root` writes. */
75
+ export declare function parseAdmission(text: string): SubtreeAdmission;
76
+ /** A handle recorded as JSON, or null when the record holds none: a writer that died mid-write left no handle. */
77
+ export declare function parseHandle(text: string): SubtreeHandle | null;
78
+ /** Read the admission from the command's handle descriptor; it closes before the command execs. */
79
+ export declare function readAdmission(stream: Readable | null | undefined): Promise<SubtreeAdmission>;
80
+ /** Parse the retirement JSON line `cowshed retire-descendants` prints. */
81
+ export declare function parseRetirement(text: string): SubtreeRetirement;
82
+ /** The owner a cowshed runtime serves, through the installed `cowshed`'s own native socket client. */
83
+ export declare function cowshedSubtreeOwner(cowshed: string): SubtreeOwner;
84
+ //# sourceMappingURL=owned-subtree.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"owned-subtree.d.ts","sourceRoot":"","sources":["../../../src/executors/bounded-exec/owned-subtree.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAG5C;;;;;;;;GAQG;AAEH,0FAA0F;AAC1F,eAAO,MAAM,qBAAqB,8BAA8B,CAAC;AAEjE;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,uBAAuB,CAAC;AAE3D;;;GAGG;AACH,eAAO,MAAM,SAAS,IAAI,CAAC;AAE3B,8FAA8F;AAC9F,MAAM,MAAM,aAAa,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAE9D,+DAA+D;AAC/D,MAAM,MAAM,cAAc,GAAG,iBAAiB,GAAG,WAAW,GAAG,eAAe,GAAG,UAAU,GAAG,aAAa,CAAC;AAI5G,uEAAuE;AACvE,MAAM,MAAM,gBAAgB,GACxB;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,MAAM,EAAE,aAAa,CAAA;CAAE,GAC3C;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,cAAc,CAAA;CAAE,GAC3C;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvC,+FAA+F;AAC/F,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,mFAAmF;AACnF,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,MAAM,MAAM,iBAAiB,GACzB;IACE,IAAI,EAAE,SAAS,CAAC;IAChB,SAAS,EAAE,SAAS,gBAAgB,EAAE,CAAC;IACvC,0EAA0E;IAC1E,mBAAmB,EAAE,OAAO,CAAC;IAC7B,IAAI,EAAE,SAAS,WAAW,EAAE,CAAC;CAC9B,GACD;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,cAAc,CAAA;CAAE,GAC3C;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvC,8FAA8F;AAC9F,MAAM,WAAW,YAAY;IAC3B,2GAA2G;IAC3G,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IAC5D,gGAAgG;IAChG,MAAM,CAAC,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;CAC5E;AAMD,mEAAmE;AACnE,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,CAoB7D;AAED,kHAAkH;AAClH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAO9D;AAED,mGAAmG;AACnG,wBAAgB,aAAa,CAAC,MAAM,EAAE,QAAQ,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAoB5F;AAED,0EAA0E;AAC1E,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,iBAAiB,CAwD/D;AAED,sGAAsG;AACtG,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,YAAY,CAqCjE"}
@@ -0,0 +1,178 @@
1
+ import { spawn } from 'node:child_process';
2
+ import { isRecord } from '../../type-guards.js';
3
+ /**
4
+ * What a `bounded-exec` command leaves running, owned the way cowshed's supervisor owns a job's processes
5
+ * (specs/cowshed/11_shell.md, "Process identity and signal ownership"): by the tree the supervisor observes from
6
+ * fork, never by who works in a directory. The command runs as `cowshed subtree-root`, which asks its job's
7
+ * supervisor for a handle on itself while it is alive, writes that answer to an inherited descriptor, and execs the
8
+ * command in the same life. At the end, `cowshed retire-descendants` hands the handle back: the supervisor signals
9
+ * the live members its tree records under that root, and nothing else, so a process that merely works in the
10
+ * command's directory is never touched.
11
+ */
12
+ /** Set by a cowshed runtime for a job only when a supervisor serves that job's socket. */
13
+ export const SUPERVISOR_SOCKET_ENV = 'COWSHED_SUPERVISOR_SOCKET';
14
+ /**
15
+ * The variable naming the cowshed executable that runs `cowshed disk-command` and `cowshed subtree-root`. Unset, it is
16
+ * the installed `cowshed` on PATH. A repository that tests its own cowshed sets it, on the targets that test it, to that
17
+ * checkout's build: an installed cowshed that predates a command its own checkout added would fail the very code under
18
+ * test. The executor passes the one it resolved to the command, so it is part of what the command runs.
19
+ */
20
+ export const COWSHED_EXECUTABLE_ENV = 'COWSHED_EXECUTABLE';
21
+ /**
22
+ * The descriptor `cowshed subtree-root` writes its admission to. fd 3 is the runner lifecycle's duplex socket
23
+ * (`runner-hook.ts`), which must reach the command, so the admission takes the next one.
24
+ */
25
+ export const HANDLE_FD = 4;
26
+ const REFUSALS = ['foldUnavailable', 'notMember', 'foreignHandle', 'jobEnded', 'spentHandle'];
27
+ function isRefusal(value) {
28
+ return typeof value === 'string' && REFUSALS.includes(value);
29
+ }
30
+ /** Parse the admission JSON line `cowshed subtree-root` writes. */
31
+ export function parseAdmission(text) {
32
+ let value;
33
+ try {
34
+ value = JSON.parse(text);
35
+ }
36
+ catch {
37
+ return {
38
+ kind: 'unread',
39
+ detail: `cowshed subtree-root wrote no admission JSON: ${JSON.stringify(text.slice(0, 200))}`,
40
+ };
41
+ }
42
+ if (isRecord(value) && value.kind === 'admitted' && isRecord(value.handle)) {
43
+ return { kind: 'admitted', handle: value.handle };
44
+ }
45
+ if (isRecord(value) && value.kind === 'refused' && isRefusal(value.reason)) {
46
+ return { kind: 'refused', reason: value.reason };
47
+ }
48
+ return {
49
+ kind: 'unread',
50
+ detail: `cowshed subtree-root wrote an admission this client does not know: ${text.trim()}`,
51
+ };
52
+ }
53
+ /** A handle recorded as JSON, or null when the record holds none: a writer that died mid-write left no handle. */
54
+ export function parseHandle(text) {
55
+ try {
56
+ const value = JSON.parse(text);
57
+ return isRecord(value) ? value : null;
58
+ }
59
+ catch {
60
+ return null;
61
+ }
62
+ }
63
+ /** Read the admission from the command's handle descriptor; it closes before the command execs. */
64
+ export function readAdmission(stream) {
65
+ if (stream === null || stream === undefined) {
66
+ return Promise.resolve({ kind: 'unread', detail: 'the command was started without its handle descriptor' });
67
+ }
68
+ const chunks = [];
69
+ let settle;
70
+ const answer = new Promise((resolve) => {
71
+ settle = resolve;
72
+ });
73
+ stream.on('data', (chunk) => chunks.push(chunk));
74
+ stream.once('error', (error) => settle({ kind: 'unread', detail: `handle descriptor: ${error.message}` }));
75
+ stream.once('end', () => {
76
+ const text = Buffer.concat(chunks).toString('utf8');
77
+ settle(text.trim() === ''
78
+ ? { kind: 'unread', detail: 'cowshed subtree-root closed its handle descriptor without an admission' }
79
+ : parseAdmission(text));
80
+ });
81
+ return answer;
82
+ }
83
+ /** Parse the retirement JSON line `cowshed retire-descendants` prints. */
84
+ export function parseRetirement(text) {
85
+ let value;
86
+ try {
87
+ value = JSON.parse(text);
88
+ }
89
+ catch {
90
+ return {
91
+ kind: 'failed',
92
+ detail: `cowshed retire-descendants printed no JSON: ${JSON.stringify(text.slice(0, 200))}`,
93
+ };
94
+ }
95
+ if (isRecord(value) && value.kind === 'refused' && isRefusal(value.reason)) {
96
+ return { kind: 'refused', reason: value.reason };
97
+ }
98
+ if (isRecord(value) && value.kind === 'retired' && isRecord(value.retirement)) {
99
+ const { containment, outlived, outlivedIncomplete } = value.retirement;
100
+ // `kernel` is a kernel-proven membership (a Linux cgroup), so it carries no gaps; `observed` lists what its fold
101
+ // may have missed (specs/cowshed/07_api.md, `containment`).
102
+ const lost = !isRecord(containment)
103
+ ? null
104
+ : containment.kind === 'kernel'
105
+ ? []
106
+ : containment.kind === 'observed' && Array.isArray(containment.lost)
107
+ ? containment.lost
108
+ : null;
109
+ if (lost !== null && Array.isArray(outlived)) {
110
+ const signalled = [];
111
+ for (const entry of outlived) {
112
+ if (!isRecord(entry) || typeof entry.pid !== 'number' || typeof entry.signal !== 'number') {
113
+ return {
114
+ kind: 'failed',
115
+ detail: `cowshed retire-descendants named a process this client cannot read: ${JSON.stringify(entry)}`,
116
+ };
117
+ }
118
+ signalled.push({
119
+ pid: entry.pid,
120
+ image: typeof entry.image === 'string' ? entry.image : null,
121
+ signal: entry.signal,
122
+ });
123
+ }
124
+ const gaps = [];
125
+ for (const entry of lost) {
126
+ if (!isRecord(entry) || typeof entry.kind !== 'string') {
127
+ return {
128
+ kind: 'failed',
129
+ detail: `cowshed retire-descendants named a coverage gap this client cannot read: ${JSON.stringify(entry)}`,
130
+ };
131
+ }
132
+ gaps.push({ kind: entry.kind, pid: typeof entry.pid === 'number' ? entry.pid : null });
133
+ }
134
+ return { kind: 'retired', signalled, signalledIncomplete: outlivedIncomplete === true, gaps };
135
+ }
136
+ }
137
+ return {
138
+ kind: 'failed',
139
+ detail: `cowshed retire-descendants printed a retirement this client does not know: ${text.trim()}`,
140
+ };
141
+ }
142
+ /** The owner a cowshed runtime serves, through the installed `cowshed`'s own native socket client. */
143
+ export function cowshedSubtreeOwner(cowshed) {
144
+ return {
145
+ rootArgv(command) {
146
+ return {
147
+ file: cowshed,
148
+ args: ['subtree-root', '--handle-fd', String(HANDLE_FD), '--', '/bin/sh', '-c', command],
149
+ };
150
+ },
151
+ retire(handle, graceMs) {
152
+ const child = spawn(cowshed, ['retire-descendants', '--grace-ms', String(graceMs)], {
153
+ stdio: ['pipe', 'pipe', 'pipe'],
154
+ });
155
+ const out = [];
156
+ const err = [];
157
+ child.stdout.on('data', (chunk) => out.push(chunk));
158
+ child.stderr.on('data', (chunk) => err.push(chunk));
159
+ child.stdin.end(`${JSON.stringify(handle)}\n`);
160
+ // eslint-disable-next-line deadline/no-unbounded-wait -- WHY unbounded: the cowshed CLI bounds its own supervisor call (control bound, then the 15 s heartbeat silence; 05_gateway.md, "Deadlines") and exits with the answer or its TIMEOUT/SILENT failure
161
+ return new Promise((resolve) => {
162
+ child.once('error', (error) => resolve({ kind: 'failed', detail: `${cowshed} retire-descendants: ${error.message}` }));
163
+ child.once('close', (code, signal) => {
164
+ const stdout = Buffer.concat(out).toString('utf8');
165
+ if (code === 0) {
166
+ resolve(parseRetirement(stdout));
167
+ return;
168
+ }
169
+ const stderr = Buffer.concat(err).toString('utf8').trim();
170
+ resolve({
171
+ kind: 'failed',
172
+ detail: `${cowshed} retire-descendants exited ${code ?? `on ${signal}`}${stderr === '' ? '' : `: ${stderr}`}`,
173
+ });
174
+ });
175
+ });
176
+ },
177
+ };
178
+ }
@@ -12,6 +12,9 @@
12
12
  * spells `classname name`.
13
13
  * - libtest (`cargo test`): `test tests::quick ... ok` (or `FAILED`, `ignored`); a test still running is named by
14
14
  * `test tests::slow has been running for over 60 seconds`.
15
+ * - vitest: timed ✓/× test results, timed ❯ failed-file results, and ↓ skipped-file results. The default
16
+ * reporter prints a completed file as ✓ file (N tests) Xms, plus slow or failed tests beneath it.
17
+ * Reporter headers, summaries and stack locations report no new completion.
15
18
  * - bun: a line of dots, one per test finished (`--dots`, which `withProgressReport` asks for: bun prints nothing
16
19
  * per passing test when it believes an agent runs it), or a `(pass)`/`(fail)`/`(skip)`/`(todo)` line. bun names
17
20
  * no test before it finishes, so a bun run names nothing in flight.
@@ -22,7 +25,7 @@
22
25
  * Execution phases are owned by the private supervisor channel in runner-lifecycle.ts, never these text reports.
23
26
  */
24
27
  export interface RunProgress {
25
- /** One chunk of one of the command's output streams; true when it reports a finished test or Go package. */
28
+ /** One chunk of one output stream; true when it reports a finished test, file or Go package. */
26
29
  scan(stream: OutputStream, chunk: string): boolean;
27
30
  /** The tests the runner reported running and has not reported finished, in the order it first named them. */
28
31
  inFlight(): string[];
@@ -1 +1 @@
1
- {"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../../src/executors/bounded-exec/progress.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,WAAW,WAAW;IAC1B,4GAA4G;IAC5G,IAAI,CAAC,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;IACnD,6GAA6G;IAC7G,QAAQ,IAAI,MAAM,EAAE,CAAC;CACtB;AAED,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAqD/C,wBAAgB,iBAAiB,CAAC,OAAO,SAAK,GAAG,WAAW,CAoF3D;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAmB1D"}
1
+ {"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../../src/executors/bounded-exec/progress.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,WAAW,WAAW;IAC1B,gGAAgG;IAChG,IAAI,CAAC,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;IACnD,6GAA6G;IAC7G,QAAQ,IAAI,MAAM,EAAE,CAAC;CACtB;AAED,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAwD/C,wBAAgB,iBAAiB,CAAC,OAAO,SAAK,GAAG,WAAW,CAoF3D;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAmB1D"}
@@ -1,12 +1,15 @@
1
1
  import typia from 'typia';
2
- import { invocationSpan, withInvocationFlag } from './cpu-tokens.js';
2
+ import { invocationSpan, withInvocationFlag } from './runner-sizing.js';
3
3
  import { BUN_TEST, GO_TEST, NEXTEST_RUN } from './verdict.js';
4
4
  const ANSI = new RegExp(`${String.fromCharCode(27)}\\[[0-9;]*[A-Za-z]`, 'g');
5
- /** Lines naming a test that finished; group 1 is its name. */
5
+ /** Lines naming a test or file that finished; group 1 is its name. */
6
6
  const FINISHED = [
7
7
  /^\s*(?:[A-Z0-9][A-Z0-9-]*\s+)+\[\s*[0-9.]+s\]\s+\(\s*\d+\/\d+\)\s+(\S.*)$/,
8
8
  /^test (\S+) \.\.\. (?:ok|FAILED|ignored)\b/,
9
9
  /^\((?:pass|fail|skip|todo)\) (.+)$/,
10
+ /^\s*[✓×]\s+(\S.*?)\s+\d+ms\b/,
11
+ /^\s*❯\s+(\S.*?)\s+\(\d+ tests?(?: \| \d+ (?:failed|skipped|todo))*\)\s+\d+ms\b/,
12
+ /^\s*↓\s+(\S.*?)\s+\(\d+ tests?(?: \| \d+ (?:skipped|todo))+\)(?:\s+\d+ms\b|$)/,
10
13
  ];
11
14
  /** Lines naming a test still running; group 1 is its name. */
12
15
  const RUNNING = [
@@ -0,0 +1,19 @@
1
+ import type { RamDiskLease, RamUnavailable, Result } from './ram-temp.js';
2
+ /**
3
+ * The client of the cowshed gateway's `ram-lease` (specs/cowshed/05_gateway.md, "RAM disks"). The RAM temp volume's
4
+ * disk lives in the `diskimages-helper` that `hdiutil attach ram://<n>` forks. Forked inside a task's job, the helper is
5
+ * that job's member, and the job's end retires it with the disk under every other job's lease on the volume. The helper
6
+ * belongs to the gateway, which no job contains and which attaches the disk; no job's retirement reaches it.
7
+ *
8
+ * The client writes one line, `{"op":"ram-lease","sectors":<n>}`, and keeps its connection open; the gateway answers
9
+ * one line, `{"ok":true,"ramDisk":{"device":"/dev/diskN","registryEntry":"0x…"}}` or a refusal. The connection is the
10
+ * lease: the gateway holds the disk until the client writes `{"end":"keep"}`, after which the disk is the caller's, or
11
+ * `{"end":"release"}`, which the gateway answers with its detach as `ram-detach` does. A connection that ends first,
12
+ * at the client's deadline or with its process, has the gateway detach the disk. An end the gateway never answers leaves
13
+ * nothing known: the gateway may have handed the disk over or left it to its next startup scan, so the caller detaches it
14
+ * by its entry.
15
+ */
16
+ export declare const RAM_LEASE_OP = "ram-lease";
17
+ /** Ask the gateway at `socket` for a RAM disk of `sectors` 512-byte sectors; its lease, or why there is none. */
18
+ export declare function attachRamDisk(socket: string, sectors: number, deadlineMs: number): Promise<Result<RamDiskLease, string | RamUnavailable>>;
19
+ //# sourceMappingURL=ram-attach.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ram-attach.d.ts","sourceRoot":"","sources":["../../../src/executors/bounded-exec/ram-attach.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE1E;;;;;;;;;;;;;GAaG;AAEH,eAAO,MAAM,YAAY,cAAc,CAAC;AAoBxC,iHAAiH;AACjH,wBAAsB,aAAa,CACjC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,GAAG,cAAc,CAAC,CAAC,CAaxD"}