@cnc-tools/storm 0.14.2 → 0.15.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 (401) hide show
  1. package/dist/application.js +3 -1
  2. package/dist/bin/storm.js +9 -7
  3. package/dist/build-info.js +1 -1
  4. package/dist/chunks/chunk-4U4DZ7VG.js +40 -0
  5. package/dist/chunks/{chunk-GSC6SRTW.js → chunk-5CCP36QQ.js} +1 -1
  6. package/dist/chunks/chunk-5GBMR4HM.js +966 -0
  7. package/dist/chunks/{chunk-43MWZLJR.js → chunk-5VXBKPW6.js} +1 -1
  8. package/dist/chunks/{chunk-RA4L2ACU.js → chunk-AWBSONHB.js} +88 -34
  9. package/dist/chunks/{chunk-BRUIATTR.js → chunk-CN4EFA5J.js} +59 -12
  10. package/dist/chunks/{chunk-3HBPNQ4Y.js → chunk-CXAT7ZKP.js} +2 -2
  11. package/dist/chunks/chunk-E4PJNZVG.js +783 -0
  12. package/dist/chunks/{chunk-T6AZIDZD.js → chunk-F6N34UWB.js} +12 -244
  13. package/dist/chunks/{chunk-RUPD4TLT.js → chunk-KC4KDJ5K.js} +147 -26
  14. package/dist/chunks/{chunk-I7AN3DIJ.js → chunk-L36GBUBB.js} +1626 -676
  15. package/dist/chunks/{chunk-XZCDA5PE.js → chunk-OX7X4B2L.js} +7 -2
  16. package/dist/chunks/{chunk-UUBZTGLV.js → chunk-PN5ULTTH.js} +140 -130
  17. package/dist/chunks/chunk-QUHY6FGN.js +108 -0
  18. package/dist/chunks/chunk-QVS7HRU7.js +74 -0
  19. package/dist/chunks/{chunk-UC6DULWY.js → chunk-R7XVBZOY.js} +130 -39
  20. package/dist/chunks/{chunk-LUOHJ3LB.js → chunk-RAQEXKL6.js} +1120 -465
  21. package/dist/chunks/{chunk-GJOEPJJL.js → chunk-SZEURWRS.js} +446 -52
  22. package/dist/chunks/chunk-TJNFVNKR.js +246 -0
  23. package/dist/chunks/{chunk-BW2ADH7U.js → chunk-VUPZH7J2.js} +1 -1
  24. package/dist/chunks/{chunk-HDL4WKIB.js → chunk-XEVHP5ZW.js} +2 -2
  25. package/dist/chunks/{chunk-VH2POPW5.js → chunk-YV7GE6EV.js} +635 -79
  26. package/dist/chunks/{chunk-GQIL3AHY.js → chunk-ZG3WQ4UF.js} +1 -1
  27. package/dist/chunks/{live-app-SZGEILCQ.js → live-app-PI3BAN6Y.js} +28 -23
  28. package/dist/command-tree.d.ts +2 -2
  29. package/dist/command-tree.js +2 -2
  30. package/dist/commands/exec/across-sandboxes-outcomes.d.ts +364 -0
  31. package/dist/commands/exec/across-sandboxes-outcomes.js +229 -0
  32. package/dist/commands/exec/across-sandboxes-run.d.ts +180 -0
  33. package/dist/commands/exec/across-sandboxes-run.js +339 -0
  34. package/dist/commands/exec/command.d.ts +577 -75
  35. package/dist/commands/exec/command.js +165 -32
  36. package/dist/commands/exec/driver-plan.d.ts +8 -2
  37. package/dist/commands/exec/driver-plan.js +13 -3
  38. package/dist/commands/exec/exec-words.d.ts +17 -3
  39. package/dist/commands/exec/exec-words.js +27 -16
  40. package/dist/commands/exec/live-view.d.ts +3 -4
  41. package/dist/commands/exec/live-view.js +37 -28
  42. package/dist/commands/exec/metadata.js +2 -2
  43. package/dist/commands/exec/mint-failed.d.ts +4 -4
  44. package/dist/commands/exec/mint-failed.js +6 -6
  45. package/dist/commands/exec/outcomes.d.ts +530 -73
  46. package/dist/commands/exec/outcomes.js +202 -66
  47. package/dist/commands/exec/plan-only.d.ts +10 -0
  48. package/dist/commands/exec/plan-only.js +46 -0
  49. package/dist/commands/exec/plan-run.d.ts +54 -35
  50. package/dist/commands/exec/plan-run.js +81 -38
  51. package/dist/commands/exec/planned-outcome.d.ts +15 -0
  52. package/dist/commands/exec/planned-outcome.js +35 -0
  53. package/dist/commands/exec/progress.d.ts +2 -2
  54. package/dist/commands/exec/progress.js +35 -18
  55. package/dist/commands/exec/resource-refusals.d.ts +2 -2
  56. package/dist/commands/exec/resource-refusals.js +3 -3
  57. package/dist/commands/exec/run-bin.d.ts +1 -1
  58. package/dist/commands/exec/run-bin.js +2 -2
  59. package/dist/commands/exec/run-command.d.ts +345 -63
  60. package/dist/commands/exec/run-command.js +308 -258
  61. package/dist/commands/exec/run-metadata.d.ts +42 -8
  62. package/dist/commands/exec/run-metadata.js +40 -21
  63. package/dist/commands/exec/run-planned.d.ts +20 -0
  64. package/dist/commands/exec/run-planned.js +22 -0
  65. package/dist/commands/exec/sandbox-lines.d.ts +42 -0
  66. package/dist/commands/exec/sandbox-lines.js +59 -0
  67. package/dist/commands/exec/sandbox-progress.d.ts +30 -0
  68. package/dist/commands/exec/sandbox-progress.js +232 -0
  69. package/dist/commands/exec/sandbox-view.d.ts +19 -0
  70. package/dist/commands/exec/sandbox-view.js +72 -0
  71. package/dist/commands/exec/view.d.ts +3 -2
  72. package/dist/commands/exec/view.js +10 -6
  73. package/dist/commands/runs/facts.d.ts +51 -9
  74. package/dist/commands/runs/facts.js +49 -29
  75. package/dist/commands/runs/list/command.d.ts +80 -4
  76. package/dist/commands/runs/list/command.js +11 -10
  77. package/dist/commands/runs/list/metadata.js +1 -1
  78. package/dist/commands/runs/list/outcomes.d.ts +40 -2
  79. package/dist/commands/runs/logs/command.d.ts +103 -8
  80. package/dist/commands/runs/logs/command.js +139 -24
  81. package/dist/commands/runs/logs/metadata.d.ts +4 -0
  82. package/dist/commands/runs/logs/metadata.js +14 -7
  83. package/dist/commands/runs/logs/outcomes.d.ts +49 -2
  84. package/dist/commands/runs/logs/outcomes.js +110 -6
  85. package/dist/commands/runs/past-run.d.ts +77 -6
  86. package/dist/commands/runs/past-run.js +133 -4
  87. package/dist/commands/runs/show/command.d.ts +568 -10
  88. package/dist/commands/runs/show/command.js +634 -119
  89. package/dist/commands/runs/show/metadata.d.ts +17 -0
  90. package/dist/commands/runs/show/metadata.js +48 -7
  91. package/dist/commands/runs/show/outcomes.d.ts +276 -5
  92. package/dist/commands/runs/show/outcomes.js +484 -96
  93. package/dist/commands/snapshots/build/command.d.ts +109 -18
  94. package/dist/commands/snapshots/build/command.js +72 -36
  95. package/dist/commands/snapshots/build/metadata.d.ts +4 -0
  96. package/dist/commands/snapshots/build/metadata.js +5 -1
  97. package/dist/commands/snapshots/build/outcomes.d.ts +53 -8
  98. package/dist/commands/snapshots/build/outcomes.js +26 -3
  99. package/dist/commands/snapshots/list/command.d.ts +72 -7
  100. package/dist/commands/snapshots/list/command.js +57 -24
  101. package/dist/commands/snapshots/list/metadata.d.ts +4 -0
  102. package/dist/commands/snapshots/list/metadata.js +4 -0
  103. package/dist/commands/snapshots/list/outcomes.d.ts +31 -0
  104. package/dist/commands/snapshots/list/outcomes.js +25 -2
  105. package/dist/commands/suites/list/command.d.ts +129 -0
  106. package/dist/commands/suites/list/command.js +162 -0
  107. package/dist/commands/suites/list/metadata.d.ts +11 -0
  108. package/dist/commands/suites/list/metadata.js +15 -0
  109. package/dist/commands/suites/list/outcomes.d.ts +91 -0
  110. package/dist/commands/suites/list/outcomes.js +122 -0
  111. package/dist/commands/suites/metadata.js +8 -0
  112. package/dist/commands/test/command.d.ts +1389 -0
  113. package/dist/commands/test/command.js +583 -0
  114. package/dist/commands/test/metadata.js +8 -0
  115. package/dist/commands/test/outcomes.d.ts +765 -0
  116. package/dist/commands/test/outcomes.js +140 -0
  117. package/dist/commands/test/plan.d.ts +92 -0
  118. package/dist/commands/test/plan.js +128 -0
  119. package/dist/commands/test/test-words.d.ts +12 -0
  120. package/dist/commands/test/test-words.js +42 -0
  121. package/dist/config/check-resources.d.ts +14 -0
  122. package/dist/config/check-resources.js +98 -0
  123. package/dist/config/check-runner.d.ts +13 -0
  124. package/dist/config/check-runner.js +54 -0
  125. package/dist/config/check-suites.d.ts +14 -0
  126. package/dist/config/check-suites.js +99 -0
  127. package/dist/config/gateways.d.ts +24 -0
  128. package/dist/config/index.d.ts +6 -3
  129. package/dist/config/index.js +3 -1
  130. package/dist/config/live/file-lists-file-gateway.d.ts +4 -0
  131. package/dist/config/live/file-lists-file-gateway.js +27 -0
  132. package/dist/config/load.d.ts +11 -10
  133. package/dist/config/load.js +35 -103
  134. package/dist/config/recipe-run.d.ts +8 -1
  135. package/dist/config/recipe-run.js +2 -1
  136. package/dist/config/resolve.d.ts +3 -2
  137. package/dist/config/resolve.js +6 -3
  138. package/dist/config/resolver.d.ts +20 -6
  139. package/dist/config/resolver.js +11 -8
  140. package/dist/config/runner.d.ts +24 -0
  141. package/dist/config/runner.js +4 -0
  142. package/dist/config/schema.d.ts +26 -18
  143. package/dist/config/schema.js +41 -9
  144. package/dist/config/settings-file.d.ts +9 -3
  145. package/dist/config/settings-file.js +41 -4
  146. package/dist/config/suite.d.ts +39 -0
  147. package/dist/config/suite.js +5 -0
  148. package/dist/config-file/define.d.ts +49 -18
  149. package/dist/config-file/define.js +9 -8
  150. package/dist/config-file/runner.d.ts +12 -0
  151. package/dist/config-file/runner.js +9 -0
  152. package/dist/context.d.ts +12 -8
  153. package/dist/context.js +9 -3
  154. package/dist/core/across-sandboxes.d.ts +43 -0
  155. package/dist/core/across-sandboxes.js +319 -0
  156. package/dist/core/before-run.d.ts +5 -3
  157. package/dist/core/before-run.js +12 -1
  158. package/dist/core/events.d.ts +62 -6
  159. package/dist/core/events.js +14 -0
  160. package/dist/core/index.d.ts +4 -2
  161. package/dist/core/index.js +3 -1
  162. package/dist/core/payload.d.ts +2 -1
  163. package/dist/core/payload.js +2 -1
  164. package/dist/core/presentations.js +1 -1
  165. package/dist/core/resource.d.ts +1 -1
  166. package/dist/core/resources.d.ts +56 -6
  167. package/dist/core/resources.js +81 -5
  168. package/dist/core/run-state.js +9 -0
  169. package/dist/core/run.d.ts +77 -15
  170. package/dist/core/run.js +150 -86
  171. package/dist/core/sandbox-end.d.ts +64 -0
  172. package/dist/core/sandbox-end.js +128 -0
  173. package/dist/core/timeline.d.ts +4 -4
  174. package/dist/core/timeline.js +3 -3
  175. package/dist/credential/live/vercel-cli-gateway.d.ts +7 -0
  176. package/dist/credential/live/vercel-cli-gateway.js +14 -1
  177. package/dist/extensions/github/context.d.ts +1 -1
  178. package/dist/extensions/github/definition.d.ts +11 -9
  179. package/dist/extensions/github/definition.js +8 -6
  180. package/dist/extensions/github/extension.d.ts +3 -3
  181. package/dist/extensions/github/fixture-repo.d.ts +21 -2
  182. package/dist/extensions/github/fixture-repo.js +31 -2
  183. package/dist/extensions/github/index.d.ts +2 -2
  184. package/dist/extensions/github/index.js +2 -2
  185. package/dist/extensions/github/lifecycle.d.ts +16 -6
  186. package/dist/extensions/github/lifecycle.js +42 -25
  187. package/dist/extensions/github/options.d.ts +17 -11
  188. package/dist/extensions/github/options.js +14 -13
  189. package/dist/extensions/github/refusals.d.ts +23 -6
  190. package/dist/extensions/github/refusals.js +34 -12
  191. package/dist/extensions/github/resource.d.ts +21 -12
  192. package/dist/extensions/github/resource.js +16 -8
  193. package/dist/extensions/github/run/payload.d.ts +6 -6
  194. package/dist/extensions/github/run/payload.js +3 -5
  195. package/dist/extensions/github/split.d.ts +10 -0
  196. package/dist/extensions/github/split.js +12 -0
  197. package/dist/extensions/playwright/driver.js +6 -26
  198. package/dist/extensions/playwright/extension.js +1 -1
  199. package/dist/extensions/testserver/commands/pool/create/command.js +8 -8
  200. package/dist/extensions/testserver/commands/pool/list/command.js +4 -4
  201. package/dist/extensions/testserver/definition.d.ts +4 -4
  202. package/dist/extensions/testserver/definition.js +41 -31
  203. package/dist/extensions/testserver/extension.d.ts +4 -5
  204. package/dist/extensions/testserver/extension.js +14 -41
  205. package/dist/extensions/testserver/index.d.ts +1 -1
  206. package/dist/extensions/testserver/index.js +1 -1
  207. package/dist/extensions/testserver/lifecycle.d.ts +10 -2
  208. package/dist/extensions/testserver/lifecycle.js +29 -6
  209. package/dist/extensions/testserver/options/rules.d.ts +5 -5
  210. package/dist/extensions/testserver/options/rules.js +10 -8
  211. package/dist/extensions/testserver/options/sandboxes.d.ts +4 -2
  212. package/dist/extensions/testserver/options/sandboxes.js +8 -3
  213. package/dist/extensions/testserver/pool/gateways.d.ts +29 -4
  214. package/dist/extensions/testserver/pool/index.d.ts +2 -2
  215. package/dist/extensions/testserver/pool/index.js +1 -1
  216. package/dist/extensions/testserver/pool/lease.d.ts +10 -0
  217. package/dist/extensions/testserver/pool/lease.js +21 -0
  218. package/dist/extensions/testserver/pool/live/pool-store-gateway.js +38 -3
  219. package/dist/extensions/testserver/refusals.d.ts +12 -0
  220. package/dist/extensions/testserver/refusals.js +18 -0
  221. package/dist/extensions/testserver/release.d.ts +16 -0
  222. package/dist/extensions/testserver/release.js +56 -4
  223. package/dist/extensions/testserver/resource.d.ts +4 -4
  224. package/dist/extensions/testserver/resource.js +1 -1
  225. package/dist/extensions/testserver/split.d.ts +9 -0
  226. package/dist/extensions/testserver/split.js +22 -0
  227. package/dist/extensions/testserver/vitest/fixtures.d.ts +5 -5
  228. package/dist/extensions/testserver/vitest/fixtures.js +9 -38
  229. package/dist/extensions/vitest/driver.d.ts +7 -0
  230. package/dist/extensions/vitest/driver.js +33 -37
  231. package/dist/extensions/vitest/extension.js +1 -1
  232. package/dist/extensions/vitest/plan/plan-over.d.ts +8 -1
  233. package/dist/extensions/vitest/plan/plan-over.js +16 -2
  234. package/dist/extensions.d.ts +17 -16
  235. package/dist/extensions.js +5 -4
  236. package/dist/forward-sigterm.js +1 -1
  237. package/dist/launcher-resolvers/local-services.d.ts +1 -1
  238. package/dist/live-app.js +4 -3
  239. package/dist/local-services.js +1 -1
  240. package/dist/planning/driver-file-lists.d.ts +61 -0
  241. package/dist/planning/driver-file-lists.js +66 -0
  242. package/dist/{commands/exec → planning}/driver-refusals.d.ts +11 -10
  243. package/dist/{commands/exec → planning}/driver-refusals.js +18 -14
  244. package/dist/planning/file-lists-file.d.ts +58 -0
  245. package/dist/planning/file-lists-file.js +105 -0
  246. package/dist/planning/file-lists.d.ts +28 -0
  247. package/dist/planning/file-lists.js +52 -0
  248. package/dist/{commands/exec → planning}/final-results.d.ts +1 -1
  249. package/dist/{commands/exec → planning}/final-results.js +6 -6
  250. package/dist/planning/plan-only.d.ts +81 -0
  251. package/dist/planning/plan-only.js +83 -0
  252. package/dist/{commands/exec → planning}/redaction.d.ts +2 -2
  253. package/dist/{commands/exec → planning}/redaction.js +5 -4
  254. package/dist/{commands/exec → planning}/resource-flags.d.ts +5 -12
  255. package/dist/{commands/exec → planning}/resource-flags.js +6 -16
  256. package/dist/planning/run-kind-flags.d.ts +20 -0
  257. package/dist/planning/run-kind-flags.js +48 -0
  258. package/dist/planning/run-plan.d.ts +30 -0
  259. package/dist/planning/run-plan.js +4 -0
  260. package/dist/planning/sandbox-placeholders.d.ts +22 -0
  261. package/dist/planning/sandbox-placeholders.js +60 -0
  262. package/dist/planning/suite-not-found.d.ts +37 -0
  263. package/dist/planning/suite-not-found.js +36 -0
  264. package/dist/planning/suites.d.ts +43 -0
  265. package/dist/planning/suites.js +89 -0
  266. package/dist/{commands/exec → planning}/test-plan.d.ts +8 -3
  267. package/dist/{commands/exec → planning}/test-plan.js +32 -4
  268. package/dist/playwright/reporter.d.ts +20 -8
  269. package/dist/playwright/reporter.js +195 -15
  270. package/dist/presentation.d.ts +10 -6
  271. package/dist/presentation.js +13 -15
  272. package/dist/run-directory/gateways.d.ts +60 -4
  273. package/dist/run-directory/index.d.ts +4 -4
  274. package/dist/run-directory/index.js +2 -1
  275. package/dist/run-directory/live/run-directory-gateway.js +92 -16
  276. package/dist/run-directory/plan.d.ts +35 -2
  277. package/dist/run-directory/plan.js +44 -7
  278. package/dist/run-directory/reader.d.ts +26 -5
  279. package/dist/run-directory/reader.js +24 -1
  280. package/dist/run-directory/recording.d.ts +75 -49
  281. package/dist/run-directory/recording.js +214 -28
  282. package/dist/run-directory/run-directory.d.ts +22 -1
  283. package/dist/run-directory/run-directory.js +24 -0
  284. package/dist/run-directory/run-record.d.ts +144 -21
  285. package/dist/run-directory/run-record.js +118 -19
  286. package/dist/run-directory/timeline-facts.js +4 -4
  287. package/dist/runner/build-snapshots.d.ts +7 -7
  288. package/dist/runner/build-snapshots.js +12 -16
  289. package/dist/runner/events.d.ts +29 -8
  290. package/dist/runner/gateways.d.ts +49 -6
  291. package/dist/runner/index.d.ts +6 -4
  292. package/dist/runner/index.js +3 -2
  293. package/dist/runner/live/sandbox-gateway.js +161 -31
  294. package/dist/runner/network-policy.d.ts +55 -0
  295. package/dist/runner/network-policy.js +46 -0
  296. package/dist/runner/policy-writes.d.ts +40 -0
  297. package/dist/runner/policy-writes.js +124 -0
  298. package/dist/runner/prepare.d.ts +6 -7
  299. package/dist/runner/ready.d.ts +39 -10
  300. package/dist/runner/ready.js +59 -47
  301. package/dist/runner/recipe-check.d.ts +6 -0
  302. package/dist/runner/recipe-check.js +29 -0
  303. package/dist/runner/recipe-secrets.d.ts +67 -0
  304. package/dist/runner/recipe-secrets.js +230 -0
  305. package/dist/runner/recipe.d.ts +115 -26
  306. package/dist/runner/recipe.js +147 -154
  307. package/dist/runner/sandboxed-command.d.ts +22 -8
  308. package/dist/runner/sandboxed-command.js +33 -10
  309. package/dist/runner/scope.d.ts +107 -21
  310. package/dist/runner/scope.js +274 -54
  311. package/dist/runner/secrets.d.ts +42 -31
  312. package/dist/runner/secrets.js +62 -40
  313. package/dist/runner/session.d.ts +59 -26
  314. package/dist/runner/session.js +82 -41
  315. package/dist/runner/snapshot-build.d.ts +7 -4
  316. package/dist/runner/snapshot-build.js +48 -28
  317. package/dist/runner/snapshot-choice.d.ts +37 -0
  318. package/dist/runner/snapshot-choice.js +38 -0
  319. package/dist/runner/snapshot-key.d.ts +16 -14
  320. package/dist/runner/snapshot-key.js +24 -18
  321. package/dist/runner/steps.d.ts +13 -5
  322. package/dist/runner/steps.js +34 -4
  323. package/dist/runner/time-limit.d.ts +10 -0
  324. package/dist/runner/time-limit.js +43 -0
  325. package/dist/sdk/extension/commands.d.ts +1 -7
  326. package/dist/sdk/extension/driver.d.ts +39 -46
  327. package/dist/sdk/extension/driver.js +6 -6
  328. package/dist/sdk/extension/index.d.ts +3 -3
  329. package/dist/sdk/extension/index.js +3 -4
  330. package/dist/sdk/extension/lifecycle.d.ts +52 -9
  331. package/dist/sdk/extension/lifecycle.js +1 -1
  332. package/dist/sdk/extension/resource-definition.d.ts +13 -10
  333. package/dist/sdk/extension/resource-definition.js +7 -2
  334. package/dist/sdk/extension/resource.d.ts +2 -2
  335. package/dist/sdk/extension/secret-source.d.ts +58 -0
  336. package/dist/sdk/extension/secret-source.js +78 -0
  337. package/dist/sdk/index.d.ts +2 -2
  338. package/dist/sdk/index.js +1 -1
  339. package/dist/sdk/run/launcher.d.ts +1 -1
  340. package/dist/sdk/run/launcher.js +1 -1
  341. package/dist/sdk/run/payload.d.ts +16 -1
  342. package/dist/sdk/run/payload.js +17 -2
  343. package/dist/sdk/run/redact.js +2 -2
  344. package/dist/sdk/run/test-events.d.ts +23 -6
  345. package/dist/sdk/run/test-events.js +6 -4
  346. package/dist/sdk/run/test-result-writer.d.ts +8 -3
  347. package/dist/sdk/run/test-result-writer.js +22 -2
  348. package/dist/{commands/exec → shared}/cleanup.d.ts +3 -3
  349. package/dist/{commands/exec → shared}/cleanup.js +11 -6
  350. package/dist/shared/job-summary.d.ts +19 -0
  351. package/dist/{commands/exec → shared}/job-summary.js +17 -0
  352. package/dist/shared/sandbox-table.d.ts +48 -0
  353. package/dist/shared/sandbox-table.js +109 -0
  354. package/dist/{commands/exec → shared}/snapshot-text.d.ts +1 -1
  355. package/dist/{commands/exec → shared}/tests-summary.d.ts +22 -6
  356. package/dist/{commands/exec → shared}/tests-summary.js +74 -31
  357. package/dist/{commands/exec → shared}/text.d.ts +7 -2
  358. package/dist/{commands/exec → shared}/text.js +9 -1
  359. package/dist/{commands/exec → shared}/waterfall.d.ts +8 -6
  360. package/dist/{commands/exec → shared}/waterfall.js +71 -24
  361. package/dist/shared/worker-chart.d.ts +172 -0
  362. package/dist/shared/worker-chart.js +623 -0
  363. package/dist/vitest/config.d.ts +35 -11
  364. package/dist/vitest/config.js +47 -14
  365. package/dist/vitest/index.d.ts +1 -1
  366. package/dist/vitest/index.js +3 -3
  367. package/dist/vitest/sequencer.d.ts +23 -0
  368. package/dist/vitest/sequencer.js +73 -0
  369. package/dist/vitest/setup.d.ts +1 -0
  370. package/dist/vitest/setup.js +34 -0
  371. package/dist/vitest/test-events.d.ts +32 -6
  372. package/dist/vitest/test-events.js +25 -5
  373. package/dist/vitest/test-results.d.ts +8 -3
  374. package/dist/vitest/test-results.js +6 -0
  375. package/package.json +7 -2
  376. package/skills/overview.md +21 -17
  377. package/skills/plan-runs.md +67 -0
  378. package/skills/read-run-output.md +51 -19
  379. package/dist/chunks/chunk-E3QU74NX.js +0 -49
  380. package/dist/chunks/chunk-HP54VHGY.js +0 -201
  381. package/dist/chunks/chunk-NMVODY3P.js +0 -19
  382. package/dist/chunks/chunk-TVMEKVOW.js +0 -607
  383. package/dist/commands/exec/define-run-command.d.ts +0 -671
  384. package/dist/commands/exec/define-run-command.js +0 -91
  385. package/dist/commands/exec/job-summary.d.ts +0 -10
  386. package/dist/commands/exec/worker-chart.d.ts +0 -87
  387. package/dist/commands/exec/worker-chart.js +0 -343
  388. package/dist/commands/playwright/command.d.ts +0 -661
  389. package/dist/commands/playwright/command.js +0 -31
  390. package/dist/commands/playwright/metadata.js +0 -8
  391. package/dist/commands/vitest/command.d.ts +0 -662
  392. package/dist/commands/vitest/command.js +0 -31
  393. package/dist/commands/vitest/metadata.js +0 -8
  394. package/dist/sdk/extension/ci.d.ts +0 -2
  395. package/dist/sdk/extension/ci.js +0 -6
  396. package/dist/chunks/{chunk-YM6TZV4L.js → chunk-VL7WFTVQ.js} +52 -52
  397. package/dist/commands/{playwright → suites}/metadata.d.ts +1 -1
  398. package/dist/commands/{vitest → test}/metadata.d.ts +1 -1
  399. /package/dist/{commands → shared}/dashboard.d.ts +0 -0
  400. /package/dist/{commands → shared}/dashboard.js +0 -0
  401. /package/dist/{commands/exec → shared}/snapshot-text.js +0 -0
@@ -3,16 +3,18 @@
3
3
  // sandboxes needs the Vercel credential. It hides the launcher's stale Testserver variables from the command
4
4
  // (`STALE_TESTSERVER_VARIABLES`). It hands the run no secret, so it has no `secrets`. Acquiring it provisions
5
5
  // the run's Testserver sandboxes (`provision`), turning its options' `ttl` and `minTimeLeft` into minutes; releasing it
6
- // releases every lease.
6
+ // releases every lease, or, when the run's runner sandbox may still be running, drops the run's Testserver sandboxes
7
+ // from the pool, so no later run leases one that code in that runner sandbox can still reach.
7
8
  import { testserverCanceledLines } from "./canceled.js";
8
- import { releaseLeases } from "./pool/index.js";
9
+ import { dropLeasedEntries, releaseLeases } from "./pool/index.js";
9
10
  import { prBuildRefusal } from "./pr-build-facts.js";
10
11
  import { createWith, failedCreateFacts, provision, testserverCanceledFacts, unpooledFacts, } from "./provision.js";
11
12
  import { credentialRejected, noSandboxes, noUsableSandboxes, poolUnavailable, poolUnreadable, tokenRequestFailed, } from "./refusals.js";
12
- import { testserverPoolReleased, testserverPoolReleasedText, testserverPoolReleaseWarnings } from "./release.js";
13
+ import { testserverPoolDropped, testserverPoolDroppedText, testserverPoolDropWarnings, testserverPoolReleased, testserverPoolReleasedText, testserverPoolReleaseWarnings, } from "./release.js";
13
14
  import { testserverPoolResult, testserverPoolResultWarnings } from "./result.js";
14
15
  import { STALE_TESTSERVER_VARIABLES, testserverConnectionOf } from "./run-sandbox.js";
15
16
  import { mayLeaveSandbox } from "./sandbox/index.js";
17
+ import { splitTestserverConnection } from "./split.js";
16
18
  /**
17
19
  * The Testserver pool's lifecycle over `context`. Its acquire takes the hosts it leases.
18
20
  *
@@ -25,7 +27,13 @@ import { mayLeaveSandbox } from "./sandbox/index.js";
25
27
  * A mint that fails with no Testserver sandbox in hand answers `mintFailed`, which ends the run as the run's own
26
28
  * `mint_failed`.
27
29
  * - `releaseAfterRun` releases every lease, reports how many it released and each release that failed as a warning,
28
- * and answers, when none failed, that the run holds no lease.
30
+ * and answers, when none failed, that the run holds no lease. When the launcher didn't fence the run's runner
31
+ * sandbox (`runnerSandboxFenced` is false), it may still be running, and code in it still has each Testserver URL,
32
+ * so a released lease would hand a later run a Testserver sandbox the earlier run can still use. It then drops each
33
+ * Testserver sandbox it took from the pool instead (`dropLeasedEntries`), the pool entry and its lease together,
34
+ * reports how many it dropped and why, and warns that it did (`sandboxes_dropped`). A Testserver sandbox it couldn't
35
+ * drop keeps its lease, which a later run reclaims once this process exits, so it warns of each (`drop_failed`).
36
+ * Nothing deletes a Testserver sandbox: a dropped one runs until its TTL ends.
29
37
  */
30
38
  export function testserverPoolLifecycle(context) {
31
39
  return {
@@ -34,7 +42,12 @@ export function testserverPoolLifecycle(context) {
34
42
  if (!prepared.ok)
35
43
  return poolUnavailable(prepared.failure);
36
44
  return {
37
- use: { secrets: {}, needsVercelCredential: options.create, hiddenVariables: STALE_TESTSERVER_VARIABLES },
45
+ use: {
46
+ secrets: {},
47
+ needsVercelCredential: options.create,
48
+ needsRunnerSandbox: false,
49
+ hiddenVariables: STALE_TESTSERVER_VARIABLES,
50
+ },
38
51
  };
39
52
  },
40
53
  acquireForRun: async ({ options, credential, take, report, signal, }) => {
@@ -65,7 +78,17 @@ export function testserverPoolLifecycle(context) {
65
78
  },
66
79
  };
67
80
  },
68
- releaseAfterRun: async ({ taken, report, }) => {
81
+ split: splitTestserverConnection,
82
+ releaseAfterRun: async ({ taken, runnerSandboxFenced, report, }) => {
83
+ if (!runnerSandboxFenced) {
84
+ const dropFailures = await dropLeasedEntries(context, taken);
85
+ const dropped = testserverPoolDroppedText(taken, dropFailures);
86
+ if (dropped !== undefined)
87
+ await report.cleanup(dropped);
88
+ for (const { reason, message } of testserverPoolDropWarnings(taken, dropFailures))
89
+ await report.warning(reason, message);
90
+ return testserverPoolDropped(dropFailures);
91
+ }
69
92
  const releaseFailures = await releaseLeases(context, taken);
70
93
  const released = testserverPoolReleasedText(taken, releaseFailures);
71
94
  if (released !== undefined)
@@ -6,15 +6,15 @@ import { type OptionSources, type PlannedRun, type ResolvedOptions } from "../..
6
6
  */
7
7
  export declare const testserverPoolRules: {
8
8
  /**
9
- * How many Testserver sandboxes a run gets: 1 to 32; by default 1, or one per 4 test files `storm vitest` or
10
- * `storm playwright` counted, at most 8, for a run that counts (`testPlan`).
9
+ * How many Testserver sandboxes a run gets: 1 to 32; by default 1, or one per 4 test files `storm test` counted,
10
+ * at most 8, for a run that counts (`testPlan` or `--count-tests`).
11
11
  */
12
12
  readonly sandboxes: {
13
13
  readonly schema: z.ZodNumber;
14
- readonly default: ({ testPlan }: PlannedRun) => number;
14
+ readonly default: ({ testPlan, sandboxes: runnerSandboxes }: PlannedRun) => number;
15
15
  readonly flag: {
16
16
  readonly valueLabel: "N";
17
- readonly description: "How many Testserver sandboxes the command gets, 1 to 32, overriding resources.testserverPool.sandboxes in storm.config.ts; default 1, or one per 4 test files when storm vitest or storm playwright counts them (testPlan in storm.config.ts), at most 8. Gives the run the Testserver pool.";
17
+ readonly description: "How many Testserver sandboxes the run gets in all, 1 to 32 and at least one for each runner sandbox, overriding resources.testserverPool.sandboxes in storm.config.ts; default 1, or one per 4 test files when storm test counts them (testPlan in storm.config.ts or --count-tests), at most 8. With --sandboxes, each runner sandbox gets its own part of them, and the default is at least 1 and at most 8 for each runner sandbox. Gives the run the Testserver pool.";
18
18
  };
19
19
  };
20
20
  /**
@@ -56,7 +56,7 @@ export declare const testserverPoolRules: {
56
56
  readonly schema: z.ZodBoolean;
57
57
  readonly default: true;
58
58
  readonly flag: {
59
- readonly description: "Whether the run may create Testserver sandboxes, overriding resources.testserverPool.create in storm.config.ts; default true. --testserver-create=false runs only on Testserver sandboxes already in the pool, never minting for Testserver or creating: it needs no --scope or --project with --unsandboxed, and takes no --testserver-ttl. --testserver-create turns creating on over the file's create: false. Gives the run the Testserver pool.";
59
+ readonly description: "Whether the run may create Testserver sandboxes, overriding resources.testserverPool.create in storm.config.ts; default true. --testserver-create=false runs only on Testserver sandboxes already in the pool, never minting for Testserver or creating: it needs no --scope or --project with the launch machine runner, and takes no --testserver-ttl. --testserver-create turns creating on over the file's create: false. Gives the run the Testserver pool.";
60
60
  };
61
61
  };
62
62
  };
@@ -6,7 +6,7 @@
6
6
  import { z } from "zod";
7
7
  import { booleanOption, mustBe, nonEmptyString, } from "../../../sdk/extension/index.js";
8
8
  import { buildReferenceText, parseBuildReference } from "./build-reference.js";
9
- import { MAX_SANDBOXES, MIN_SANDBOXES, sandboxesForTests } from "./sandboxes.js";
9
+ import { MAX_SANDBOXES, MIN_SANDBOXES, sandboxesForRunnerSandboxes, sandboxesForTests } from "./sandboxes.js";
10
10
  import { parseDuration, parseTtl } from "./ttl.js";
11
11
  const SANDBOX_COUNT = `a whole number from ${MIN_SANDBOXES} to ${MAX_SANDBOXES}`;
12
12
  const sandboxCount = z
@@ -35,17 +35,19 @@ const ttl = z.string(mustBe(TTL)).refine((value) => parseTtl(value) !== undefine
35
35
  */
36
36
  export const testserverPoolRules = {
37
37
  /**
38
- * How many Testserver sandboxes a run gets: 1 to 32; by default 1, or one per 4 test files `storm vitest` or
39
- * `storm playwright` counted, at most 8, for a run that counts (`testPlan`).
38
+ * How many Testserver sandboxes a run gets: 1 to 32; by default 1, or one per 4 test files `storm test` counted,
39
+ * at most 8, for a run that counts (`testPlan` or `--count-tests`).
40
40
  */
41
41
  sandboxes: {
42
42
  schema: sandboxCount,
43
- // `storm vitest` and `storm playwright` size the run from its test files where the config file sets `testPlan`; a
44
- // run that counts none, such as `storm exec`'s, asks for one.
45
- default: ({ testPlan }) => testPlan.kind === "counted" ? sandboxesForTests(testPlan.files) : MIN_SANDBOXES,
43
+ // `storm test` sizes the run from its test files when the config file sets `testPlan` or `--count-tests` is
44
+ // passed; a run that counts none, such as `storm exec`'s, asks for one.
45
+ default: ({ testPlan, sandboxes: runnerSandboxes }) => testPlan.kind === "counted"
46
+ ? sandboxesForTests(testPlan.files, runnerSandboxes)
47
+ : sandboxesForRunnerSandboxes(runnerSandboxes),
46
48
  flag: {
47
49
  valueLabel: "N",
48
- description: "How many Testserver sandboxes the command gets, 1 to 32, overriding resources.testserverPool.sandboxes in storm.config.ts; default 1, or one per 4 test files when storm vitest or storm playwright counts them (testPlan in storm.config.ts), at most 8. Gives the run the Testserver pool.",
50
+ description: "How many Testserver sandboxes the run gets in all, 1 to 32 and at least one for each runner sandbox, overriding resources.testserverPool.sandboxes in storm.config.ts; default 1, or one per 4 test files when storm test counts them (testPlan in storm.config.ts or --count-tests), at most 8. With --sandboxes, each runner sandbox gets its own part of them, and the default is at least 1 and at most 8 for each runner sandbox. Gives the run the Testserver pool.",
49
51
  },
50
52
  },
51
53
  /**
@@ -87,7 +89,7 @@ export const testserverPoolRules = {
87
89
  schema: booleanOption,
88
90
  default: true,
89
91
  flag: {
90
- description: "Whether the run may create Testserver sandboxes, overriding resources.testserverPool.create in storm.config.ts; default true. --testserver-create=false runs only on Testserver sandboxes already in the pool, never minting for Testserver or creating: it needs no --scope or --project with --unsandboxed, and takes no --testserver-ttl. --testserver-create turns creating on over the file's create: false. Gives the run the Testserver pool.",
92
+ description: "Whether the run may create Testserver sandboxes, overriding resources.testserverPool.create in storm.config.ts; default true. --testserver-create=false runs only on Testserver sandboxes already in the pool, never minting for Testserver or creating: it needs no --scope or --project with the launch machine runner, and takes no --testserver-ttl. --testserver-create turns creating on over the file's create: false. Gives the run the Testserver pool.",
91
93
  },
92
94
  },
93
95
  };
@@ -4,7 +4,7 @@ export declare const MAX_SANDBOXES = 32;
4
4
  /**
5
5
  * One Testserver sandbox per this many test files, when a run sizes from its tests: a file's tests run in one vitest
6
6
  * worker, and the Testserver Vitest fixtures run `WORKERS_PER_SANDBOX` (4) workers on each Testserver sandbox
7
- * (`testserverWorkers`), so more Testserver sandboxes would sit idle. A run `storm playwright` counted sizes the same
7
+ * (`testserverWorkers`), so more Testserver sandboxes would sit idle. A run `storm test` counted sizes the same
8
8
  * way until its own numbers are measured.
9
9
  */
10
10
  export declare const FILES_PER_SANDBOX = 4;
@@ -14,7 +14,9 @@ export declare const MOST_SANDBOXES_FROM_TESTS = 8;
14
14
  * The Testserver sandboxes a run whose tests are in `files` files asks for when nothing else says: one per
15
15
  * `FILES_PER_SANDBOX` files, at least `MIN_SANDBOXES` and at most `MOST_SANDBOXES_FROM_TESTS`.
16
16
  */
17
- export declare function sandboxesForTests(files: number): number;
17
+ export declare function sandboxesForTests(files: number, runnerSandboxes?: number): number;
18
+ /** The Testserver sandboxes a run that counts no tests asks for when nothing else says: one for each runner sandbox. */
19
+ export declare function sandboxesForRunnerSandboxes(runnerSandboxes: number): number;
18
20
  /** How many creates a run has in flight at once. */
19
21
  export declare const CREATE_CONCURRENCY = 8;
20
22
  /**
@@ -6,7 +6,7 @@ export const MAX_SANDBOXES = 32;
6
6
  /**
7
7
  * One Testserver sandbox per this many test files, when a run sizes from its tests: a file's tests run in one vitest
8
8
  * worker, and the Testserver Vitest fixtures run `WORKERS_PER_SANDBOX` (4) workers on each Testserver sandbox
9
- * (`testserverWorkers`), so more Testserver sandboxes would sit idle. A run `storm playwright` counted sizes the same
9
+ * (`testserverWorkers`), so more Testserver sandboxes would sit idle. A run `storm test` counted sizes the same
10
10
  * way until its own numbers are measured.
11
11
  */
12
12
  export const FILES_PER_SANDBOX = 4;
@@ -16,8 +16,13 @@ export const MOST_SANDBOXES_FROM_TESTS = 8;
16
16
  * The Testserver sandboxes a run whose tests are in `files` files asks for when nothing else says: one per
17
17
  * `FILES_PER_SANDBOX` files, at least `MIN_SANDBOXES` and at most `MOST_SANDBOXES_FROM_TESTS`.
18
18
  */
19
- export function sandboxesForTests(files) {
20
- return Math.min(MOST_SANDBOXES_FROM_TESTS, Math.max(MIN_SANDBOXES, Math.ceil(files / FILES_PER_SANDBOX)));
19
+ export function sandboxesForTests(files, runnerSandboxes = 1) {
20
+ const wanted = Math.max(MIN_SANDBOXES * runnerSandboxes, Math.ceil(files / FILES_PER_SANDBOX));
21
+ return Math.min(MAX_SANDBOXES, MOST_SANDBOXES_FROM_TESTS * runnerSandboxes, wanted);
22
+ }
23
+ /** The Testserver sandboxes a run that counts no tests asks for when nothing else says: one for each runner sandbox. */
24
+ export function sandboxesForRunnerSandboxes(runnerSandboxes) {
25
+ return Math.min(MAX_SANDBOXES, MIN_SANDBOXES * runnerSandboxes);
21
26
  }
22
27
  /** How many creates a run has in flight at once. */
23
28
  export const CREATE_CONCURRENCY = 8;
@@ -154,16 +154,35 @@ export type DropOutcome = {
154
154
  readonly kind: "failed";
155
155
  readonly failure: PoolStoreFailure;
156
156
  };
157
+ /**
158
+ * What dropping a leased entry did.
159
+ *
160
+ * - `dropped`: this process held the entry's lease, and the entry and that lease are gone from the pool. No run saw
161
+ * the entry free in between.
162
+ * - `not-held`: this process holds no lease on the entry; nothing changed.
163
+ * - `guarded`: another run holds the lease guard (at path `guard`); nothing changed, so the lease stays.
164
+ */
165
+ export type DropLeasedOutcome = {
166
+ readonly kind: "dropped";
167
+ } | {
168
+ readonly kind: "not-held";
169
+ } | {
170
+ readonly kind: "guarded";
171
+ readonly guard: string;
172
+ } | {
173
+ readonly kind: "failed";
174
+ readonly failure: PoolStoreFailure;
175
+ };
157
176
  /**
158
177
  * The pool and the channel resolutions kept beside it. Every method returns its expected failures and never
159
178
  * rejects. The store owns the mechanism (files, links, lease guards, whether a holder's pid still runs, this
160
179
  * process's own pid and hostname); the policy that decides staleness is the caller's (`isStaleLease`).
161
180
  *
162
181
  * Taking a lease needs no lease guard: it only ever creates a lease where none is, and never replaces one.
163
- * Removing a lease does: only the holder of a host's lease guard removes its lease, so a release, a reclaim
164
- * or a drop never removes a lease another run took meanwhile. A lease guard is never taken over; a method
165
- * that finds one held returns `guarded` at once. The one exception is a lease attempt or a leased add that
166
- * undoes the lease it has just created, which no other run can have judged stale.
182
+ * Removing a lease does: only the holder of a host's lease guard removes its lease, so a release, a reclaim,
183
+ * or a drop, of a free entry or a leased one, never removes a lease another run took meanwhile. A lease guard
184
+ * is never taken over; a method that finds one held returns `guarded` at once. The one exception is a lease
185
+ * attempt or a leased add that undoes the lease it has just created, which no other run can have judged stale.
167
186
  */
168
187
  export interface PoolStoreGateway {
169
188
  /** Makes the pool's directories, so a run learns the pool is unusable before it creates anything. */
@@ -189,6 +208,12 @@ export interface PoolStoreGateway {
189
208
  * lease. An entry another holder leases is left alone.
190
209
  */
191
210
  dropEntry(host: string): Promise<DropOutcome>;
211
+ /**
212
+ * Under the lease guard: drops the entry for `host` only if this process holds its lease (same pid and
213
+ * hostname), removing the entry first and then that lease, so no run ever sees the entry free. For a run that
214
+ * can't hand its Testserver sandbox on to a later run.
215
+ */
216
+ dropLeasedEntry(host: string): Promise<DropLeasedOutcome>;
192
217
  /** Every channel resolution, by build channel. None recorded, or a record storm can't read, is none. */
193
218
  readChannelResolutions(): Promise<PoolStoreResult<Readonly<Record<string, ChannelResolution>>>>;
194
219
  /** Records what `channel` resolved to, replacing any earlier resolution. */
@@ -1,9 +1,9 @@
1
1
  export { type BuildMatch, buildMatch, type BuildResolution, resolveBuild, type UnresolvedChannelReason, } from "./channels.ts";
2
2
  export { buildTime, PR_BUILD_LIFETIME_MS, type PrBuildContext, type PrBuildOutcome, type PrBuildRefusal, type PrBuildResolution, resolvePrBuild, } from "./pull-request.ts";
3
3
  export { createPooledSandbox, type PooledCreateOutcome } from "./create.ts";
4
- export type { ChannelResolution, DropOutcome, LeaseHolder, LeaseOutcome, LeaseRecord, ListedEntry, ObservedLease, PoolEntry, PoolListing, PoolStoreFailure, PoolStoreGateway, PoolStoreOperation, PoolStoreResult, ReclaimOutcome, ReleaseOutcome, UnreadableEntry, } from "./gateways.ts";
4
+ export type { ChannelResolution, DropLeasedOutcome, DropOutcome, LeaseHolder, LeaseOutcome, LeaseRecord, ListedEntry, ObservedLease, PoolEntry, PoolListing, PoolStoreFailure, PoolStoreGateway, PoolStoreOperation, PoolStoreResult, ReclaimOutcome, ReleaseOutcome, UnreadableEntry, } from "./gateways.ts";
5
5
  export { sandboxHost } from "./host.ts";
6
6
  export { type InspectedChannelResolution, type InspectedEntry, type InspectedLease, inspectPool, type PoolInspection, } from "./inspect.ts";
7
- export { type LeasedEntry, type LeaseReport, leaseUsable, releaseLeases, type CheckedEntry, type EntryVerdict, } from "./lease.ts";
7
+ export { dropLeasedEntries, type LeasedEntry, type LeaseReport, leaseUsable, releaseLeases, type CheckedEntry, type EntryVerdict, } from "./lease.ts";
8
8
  export { livePoolStoreGateway, type LivePoolStoreOptions, unavailablePoolStoreGateway, } from "./live/pool-store-gateway.ts";
9
9
  export { minutesSince } from "./staleness.ts";
@@ -5,6 +5,6 @@ export { buildTime, PR_BUILD_LIFETIME_MS, resolvePrBuild, } from "./pull-request
5
5
  export { createPooledSandbox } from "./create.js";
6
6
  export { sandboxHost } from "./host.js";
7
7
  export { inspectPool, } from "./inspect.js";
8
- export { leaseUsable, releaseLeases, } from "./lease.js";
8
+ export { dropLeasedEntries, leaseUsable, releaseLeases, } from "./lease.js";
9
9
  export { livePoolStoreGateway, unavailablePoolStoreGateway, } from "./live/pool-store-gateway.js";
10
10
  export { minutesSince } from "./staleness.js";
@@ -82,3 +82,13 @@ export declare function leaseUsable(context: {
82
82
  export declare function releaseLeases(context: {
83
83
  readonly pool: PoolStoreGateway;
84
84
  }, hosts: readonly string[]): Promise<readonly PoolStoreFailure[]>;
85
+ /**
86
+ * Drops from the pool the entries on `hosts` that this process leases, in parallel, and returns the drops that
87
+ * failed. For a run whose runner sandbox may still be running: code there can still reach those Testserver
88
+ * sandboxes, so no later run may lease them, and a released lease would hand them on. A drop that fails
89
+ * leaves the entry and its lease, and one that finds another run holding the lease guard fails at the guard:
90
+ * a later run reclaims that lease once this process exits, and can then lease the Testserver sandbox.
91
+ */
92
+ export declare function dropLeasedEntries(context: {
93
+ readonly pool: PoolStoreGateway;
94
+ }, hosts: readonly string[]): Promise<readonly PoolStoreFailure[]>;
@@ -107,6 +107,27 @@ export async function releaseLeases(context, hosts) {
107
107
  }
108
108
  });
109
109
  }
110
+ /**
111
+ * Drops from the pool the entries on `hosts` that this process leases, in parallel, and returns the drops that
112
+ * failed. For a run whose runner sandbox may still be running: code there can still reach those Testserver
113
+ * sandboxes, so no later run may lease them, and a released lease would hand them on. A drop that fails
114
+ * leaves the entry and its lease, and one that finds another run holding the lease guard fails at the guard:
115
+ * a later run reclaims that lease once this process exits, and can then lease the Testserver sandbox.
116
+ */
117
+ export async function dropLeasedEntries(context, hosts) {
118
+ const dropped = await Promise.all(hosts.map((host) => context.pool.dropLeasedEntry(host)));
119
+ return dropped.flatMap((outcome) => {
120
+ switch (outcome.kind) {
121
+ case "failed":
122
+ return [outcome.failure];
123
+ case "guarded":
124
+ return [{ path: outcome.guard, message: "another storm run holds this lease's guard" }];
125
+ case "dropped":
126
+ case "not-held":
127
+ return [];
128
+ }
129
+ });
130
+ }
110
131
  function matches(listed, match) {
111
132
  return "resolvedBuild" in match
112
133
  ? listed.entry.resolvedBuild === match.resolvedBuild
@@ -2,7 +2,8 @@
2
2
  //
3
3
  // entries/<host>.json one pool entry per Testserver sandbox
4
4
  // leases/<host>.json the lease on it, if any
5
- // leases/<host>.guard/ the lease guard, while a run releases, reclaims, or drops that lease
5
+ // leases/<host>.guard/ the lease guard, while a run releases, reclaims, or drops that lease, or drops its
6
+ // leased entry
6
7
  // channels.json the channel resolutions
7
8
  //
8
9
  // Entries and `channels.json` are written to a temp file and renamed into place. A lease is written to a temp
@@ -29,6 +30,7 @@ export function livePoolStoreGateway(options) {
29
30
  release: (host) => store.release(host),
30
31
  reclaim: (host, isStale) => store.reclaim(host, isStale),
31
32
  dropEntry: (host) => store.dropEntry(host),
33
+ dropLeasedEntry: (host) => store.dropLeasedEntry(host),
32
34
  readChannelResolutions: () => store.readChannelResolutions(),
33
35
  writeChannelResolution: (channel, resolution) => store.writeChannelResolution(channel, resolution),
34
36
  };
@@ -49,6 +51,7 @@ export function unavailablePoolStoreGateway(pattern, reason) {
49
51
  release: failed,
50
52
  reclaim: failed,
51
53
  dropEntry: failed,
54
+ dropLeasedEntry: failed,
52
55
  readChannelResolutions: fail,
53
56
  writeChannelResolution: fail,
54
57
  };
@@ -184,6 +187,14 @@ class LivePoolStore {
184
187
  return { kind: "gone" };
185
188
  return guarded;
186
189
  }
190
+ async dropLeasedEntry(host) {
191
+ const guarded = await this.#underGuard(host, () => this.#dropLeasedUnderGuard(host));
192
+ if (guarded.kind === "done")
193
+ return guarded.value;
194
+ if (guarded.kind === "no-leases")
195
+ return { kind: "not-held" };
196
+ return guarded;
197
+ }
187
198
  async readChannelResolutions() {
188
199
  const text = await readText(this.#channels);
189
200
  if (!text.ok)
@@ -229,8 +240,9 @@ class LivePoolStore {
229
240
  await rmdir(guard).catch(() => { });
230
241
  }
231
242
  }
232
- async #releaseUnderGuard(path) {
233
- const text = await readText(path);
243
+ /** Confirms this process holds the lease at `leasePath`. */
244
+ async #checkOwnLease(leasePath) {
245
+ const text = await readText(leasePath);
234
246
  if (!text.ok)
235
247
  return { kind: "failed", failure: text.failure };
236
248
  if (text.value === undefined)
@@ -238,6 +250,12 @@ class LivePoolStore {
238
250
  const parsed = parseLease(text.value);
239
251
  if (!parsed.ok || parsed.value.pid !== this.#self.pid || parsed.value.hostname !== this.#self.hostname)
240
252
  return { kind: "not-held" };
253
+ return { kind: "held" };
254
+ }
255
+ async #releaseUnderGuard(path) {
256
+ const owned = await this.#checkOwnLease(path);
257
+ if (owned.kind !== "held")
258
+ return owned;
241
259
  const removed = await removeFile(path);
242
260
  return removed.ok ? { kind: "released" } : { kind: "failed", failure: removed.failure };
243
261
  }
@@ -263,6 +281,23 @@ class LivePoolStore {
263
281
  await unlink(this.#leasePath(host)).catch(() => { });
264
282
  return { kind: "dropped" };
265
283
  }
284
+ /**
285
+ * Removes the entry for `host` and then this process's lease on it, only if this process holds that lease. The
286
+ * entry goes first, so no run sees it free in between; an entry that can't be removed keeps its lease.
287
+ */
288
+ async #dropLeasedUnderGuard(host) {
289
+ const leasePath = this.#leasePath(host);
290
+ const owned = await this.#checkOwnLease(leasePath);
291
+ if (owned.kind !== "held")
292
+ return owned;
293
+ // An entry already gone is fine: the lease on it is this process's, so no other run dropped it.
294
+ const removed = await removeFile(this.#entryPath(host));
295
+ if (!removed.ok)
296
+ return { kind: "failed", failure: removed.failure };
297
+ // A lease left behind on no entry leases nothing: no run lists it, and hosts aren't reused.
298
+ await unlink(leasePath).catch(() => { });
299
+ return { kind: "dropped" };
300
+ }
266
301
  async #reclaimUnderGuard(path, isStale) {
267
302
  const observed = await this.#observeLease(path);
268
303
  if (!observed.ok)
@@ -59,6 +59,18 @@ export interface NoSandboxesData {
59
59
  * create may have left a Testserver sandbox, it says so.
60
60
  */
61
61
  export declare function noSandboxes(data: NoSandboxesData): Refusal;
62
+ /** `fewer_sandboxes_than_runner_sandboxes`'s data. */
63
+ export interface FewerSandboxesThanRunnerSandboxesData {
64
+ /** How many Testserver sandboxes the run got. */
65
+ readonly sandboxes: number;
66
+ /** The run's number of runner sandboxes. */
67
+ readonly runnerSandboxes: number;
68
+ }
69
+ /**
70
+ * The run got fewer Testserver sandboxes than it has runner sandboxes, so its split can't give each runner sandbox its
71
+ * own: the run refuses rather than share one.
72
+ */
73
+ export declare function fewerSandboxesThanRunnerSandboxes(data: FewerSandboxesThanRunnerSandboxesData): Refusal;
62
74
  /** `no_usable_sandboxes`'s data. */
63
75
  export interface NoUsableSandboxesData {
64
76
  readonly requested: number;
@@ -97,6 +97,24 @@ export function noSandboxes(data) {
97
97
  ...(mayExist ? { next: mayExistSteps(mayExist, ttlMinutes) } : {}),
98
98
  };
99
99
  }
100
+ /**
101
+ * The run got fewer Testserver sandboxes than it has runner sandboxes, so its split can't give each runner sandbox its
102
+ * own: the run refuses rather than share one.
103
+ */
104
+ export function fewerSandboxesThanRunnerSandboxes(data) {
105
+ const { sandboxes, runnerSandboxes } = data;
106
+ return {
107
+ refused: "fewer_sandboxes_than_runner_sandboxes",
108
+ data: { ...data },
109
+ message: `Got ${sandboxes} Testserver ${sandboxes === 1 ? "sandbox" : "sandboxes"} for ${runnerSandboxes} runner sandboxes, and each runner sandbox needs its own. ${NOT_RUN}`,
110
+ next: [
111
+ {
112
+ type: "text",
113
+ text: `Run with fewer runner sandboxes, set ${CREATE_KEY_PATH} to true so the run creates what the pool lacks, or check the pool with storm ext testserver pool list.`,
114
+ },
115
+ ],
116
+ };
117
+ }
100
118
  /**
101
119
  * With create false, the pool had no usable Testserver sandbox on the build, so the command didn't run. A run with
102
120
  * create false never creates one.
@@ -12,3 +12,19 @@ export declare function testserverPoolReleaseWarnings(releaseFailures: readonly
12
12
  * holds no lease.
13
13
  */
14
14
  export declare function testserverPoolReleased(releaseFailures: readonly PoolStoreFailure[]): Released;
15
+ /**
16
+ * The line dropping the Testserver sandboxes `leased` from the pool reports, of which `dropFailures` failed: how many
17
+ * it dropped, and why; none when it dropped none.
18
+ */
19
+ export declare function testserverPoolDroppedText(leased: readonly string[], dropFailures: readonly PoolStoreFailure[]): string | undefined;
20
+ /**
21
+ * The warnings dropping the Testserver sandboxes `leased` from the pool gives, of which `dropFailures` failed: one
22
+ * `sandboxes_dropped` when it dropped any, since the pool lost them, and one `drop_failed` for each it couldn't drop,
23
+ * whose lease stays until this process exits.
24
+ */
25
+ export declare function testserverPoolDropWarnings(leased: readonly string[], dropFailures: readonly PoolStoreFailure[]): readonly Warning<"sandboxes_dropped" | "drop_failed">[];
26
+ /**
27
+ * What dropping the run's Testserver sandboxes from the pool did, from the drops that failed (`dropFailures`): when
28
+ * none did, that the run holds no lease, since each lease went with its pool entry.
29
+ */
30
+ export declare function testserverPoolDropped(dropFailures: readonly PoolStoreFailure[]): Released;
@@ -1,7 +1,11 @@
1
- // What releasing the Testserver pool reports: the line its cleanup reports (`testserverPoolReleasedText`), how many
2
- // leases it released, its warnings (`testserverPoolReleaseWarnings`), the leases it couldn't release, which a later run
3
- // reclaims once this one has exited, and its answer (`testserverPoolReleased`): when it released every lease, that the
4
- // run holds none.
1
+ // What releasing the Testserver pool reports. A run whose runner sandbox stopped, or that had none, releases its
2
+ // leases: the line its cleanup reports (`testserverPoolReleasedText`), how many leases it released, its warnings
3
+ // (`testserverPoolReleaseWarnings`), the leases it couldn't release, which a later run reclaims once this one has
4
+ // exited, and its answer (`testserverPoolReleased`): when it released every lease, that the run holds none. A run whose
5
+ // runner sandbox may still be running drops its Testserver sandboxes from the pool instead, since code there can still
6
+ // reach them: the line its cleanup reports (`testserverPoolDroppedText`), how many it dropped and why, its warnings
7
+ // (`testserverPoolDropWarnings`), that it dropped them, and each it couldn't drop, whose lease stays, and its answer
8
+ // (`testserverPoolDropped`). Nothing deletes a Testserver sandbox: a dropped one runs until its TTL ends.
5
9
  /**
6
10
  * The line releasing the leases `leased` reports, of which `releaseFailures` failed: how many it released; none when
7
11
  * it released none.
@@ -24,3 +28,51 @@ export function testserverPoolReleaseWarnings(releaseFailures) {
24
28
  export function testserverPoolReleased(releaseFailures) {
25
29
  return { done: releaseFailures.length === 0 ? ["The run holds no lease."] : [] };
26
30
  }
31
+ /** How many of the Testserver sandboxes `leased` a run dropped from the pool, of which `dropFailures` failed. */
32
+ function droppedCount(leased, dropFailures) {
33
+ return Math.max(0, leased.length - dropFailures.length);
34
+ }
35
+ /** `count` Testserver sandboxes, in words: `1 Testserver sandbox`, `2 Testserver sandboxes`. */
36
+ function sandboxes(count) {
37
+ return `${count} Testserver ${count === 1 ? "sandbox" : "sandboxes"}`;
38
+ }
39
+ /**
40
+ * The line dropping the Testserver sandboxes `leased` from the pool reports, of which `dropFailures` failed: how many
41
+ * it dropped, and why; none when it dropped none.
42
+ */
43
+ export function testserverPoolDroppedText(leased, dropFailures) {
44
+ const dropped = droppedCount(leased, dropFailures);
45
+ return dropped === 0
46
+ ? undefined
47
+ : `dropped ${sandboxes(dropped)} from the pool: the runner sandbox may still be running and could still reach ${dropped === 1 ? "it" : "them"}`;
48
+ }
49
+ /**
50
+ * The warnings dropping the Testserver sandboxes `leased` from the pool gives, of which `dropFailures` failed: one
51
+ * `sandboxes_dropped` when it dropped any, since the pool lost them, and one `drop_failed` for each it couldn't drop,
52
+ * whose lease stays until this process exits.
53
+ */
54
+ export function testserverPoolDropWarnings(leased, dropFailures) {
55
+ const dropped = droppedCount(leased, dropFailures);
56
+ const one = dropped === 1;
57
+ return [
58
+ ...(dropped === 0
59
+ ? []
60
+ : [
61
+ {
62
+ reason: "sandboxes_dropped",
63
+ message: `Dropped ${sandboxes(dropped)} from the pool, because the runner sandbox may still be running and could still reach ${one ? "it" : "them"}. No later run leases ${one ? "it" : "them"}; nothing can delete ${one ? "it" : "them"}, so ${one ? "it runs" : "each runs"} until its TTL ends.`,
64
+ },
65
+ ]),
66
+ ...dropFailures.map(({ path, message }) => ({
67
+ reason: "drop_failed",
68
+ message: `Couldn't drop a Testserver sandbox from the pool at ${path}: ${message}. Its lease stays, so a later run may lease that Testserver sandbox once this one has exited, while the runner sandbox may still be running and could still reach it.`,
69
+ })),
70
+ ];
71
+ }
72
+ /**
73
+ * What dropping the run's Testserver sandboxes from the pool did, from the drops that failed (`dropFailures`): when
74
+ * none did, that the run holds no lease, since each lease went with its pool entry.
75
+ */
76
+ export function testserverPoolDropped(dropFailures) {
77
+ return { done: dropFailures.length === 0 ? ["The run holds no lease."] : [] };
78
+ }
@@ -7,7 +7,7 @@ export type { TestserverPoolOptions } from "./options/index.ts";
7
7
  * resources: { testserverPool: testserverPool({ build: "latest_main", minTimeLeft: "45m" }) }
8
8
  * ```
9
9
  *
10
- * Its presence gives a run the Testserver pool; `testserverPool()` takes every default. `storm vitest` and
10
+ * Its presence gives a run the Testserver pool; `testserverPool()` takes every default. `storm test` and
11
11
  * `storm exec` override each option with its own flag, `--testserver-<option>`, and `storm ext testserver pool create`
12
12
  * reads `build` and `ttl`. A runner recipe reads its options with `run.get(testserverPool)`, such as the run's
13
13
  * `sandboxes` to size the runner sandbox's vCPUs.
@@ -15,10 +15,10 @@ export type { TestserverPoolOptions } from "./options/index.ts";
15
15
  export declare const testserverPool: import("../../sdk/extension/resource-factory.ts").ResourceFactory<import("../../sdk/extension/resource-definition.ts").ResourceDefinition<"testserverPool", {
16
16
  readonly sandboxes: {
17
17
  readonly schema: import("zod").ZodNumber;
18
- readonly default: ({ testPlan }: import("../../sdk/extension/resource-definition.ts").PlannedRun) => number;
18
+ readonly default: ({ testPlan, sandboxes: runnerSandboxes }: import("../../sdk/extension/resource-definition.ts").PlannedRun) => number;
19
19
  readonly flag: {
20
20
  readonly valueLabel: "N";
21
- readonly description: "How many Testserver sandboxes the command gets, 1 to 32, overriding resources.testserverPool.sandboxes in storm.config.ts; default 1, or one per 4 test files when storm vitest or storm playwright counts them (testPlan in storm.config.ts), at most 8. Gives the run the Testserver pool.";
21
+ readonly description: "How many Testserver sandboxes the run gets in all, 1 to 32 and at least one for each runner sandbox, overriding resources.testserverPool.sandboxes in storm.config.ts; default 1, or one per 4 test files when storm test counts them (testPlan in storm.config.ts or --count-tests), at most 8. With --sandboxes, each runner sandbox gets its own part of them, and the default is at least 1 and at most 8 for each runner sandbox. Gives the run the Testserver pool.";
22
22
  };
23
23
  };
24
24
  readonly build: {
@@ -49,7 +49,7 @@ export declare const testserverPool: import("../../sdk/extension/resource-factor
49
49
  readonly schema: import("zod").ZodBoolean;
50
50
  readonly default: true;
51
51
  readonly flag: {
52
- readonly description: "Whether the run may create Testserver sandboxes, overriding resources.testserverPool.create in storm.config.ts; default true. --testserver-create=false runs only on Testserver sandboxes already in the pool, never minting for Testserver or creating: it needs no --scope or --project with --unsandboxed, and takes no --testserver-ttl. --testserver-create turns creating on over the file's create: false. Gives the run the Testserver pool.";
52
+ readonly description: "Whether the run may create Testserver sandboxes, overriding resources.testserverPool.create in storm.config.ts; default true. --testserver-create=false runs only on Testserver sandboxes already in the pool, never minting for Testserver or creating: it needs no --scope or --project with the launch machine runner, and takes no --testserver-ttl. --testserver-create turns creating on over the file's create: false. Gives the run the Testserver pool.";
53
53
  };
54
54
  };
55
55
  }, import("./run/connection.ts").TestserverConnection, import("./context.ts").TestserverPoolContext>>;
@@ -11,7 +11,7 @@ import { testserverPoolDefinition } from "./definition.js";
11
11
  * resources: { testserverPool: testserverPool({ build: "latest_main", minTimeLeft: "45m" }) }
12
12
  * ```
13
13
  *
14
- * Its presence gives a run the Testserver pool; `testserverPool()` takes every default. `storm vitest` and
14
+ * Its presence gives a run the Testserver pool; `testserverPool()` takes every default. `storm test` and
15
15
  * `storm exec` override each option with its own flag, `--testserver-<option>`, and `storm ext testserver pool create`
16
16
  * reads `build` and `ttl`. A runner recipe reads its options with `run.get(testserverPool)`, such as the run's
17
17
  * `sandboxes` to size the runner sandbox's vCPUs.
@@ -0,0 +1,9 @@
1
+ import type { SplitAnswer, SplitInput } from "../../sdk/extension/index.ts";
2
+ import type { TestserverConnection } from "./run/connection.ts";
3
+ /**
4
+ * Splits the run's Testserver sandboxes across its runner sandboxes: each runner sandbox gets its own part of the
5
+ * Testserver sandbox list, in order, runner sandbox 0 the first, and the parts' sizes differ by one at most, the
6
+ * larger ones first. Refuses (`fewer_sandboxes_than_runner_sandboxes`) when the list has fewer Testserver sandboxes
7
+ * than the run has runner sandboxes.
8
+ */
9
+ export declare function splitTestserverConnection({ payload, sandboxes: runnerSandboxes, }: SplitInput<TestserverConnection>): SplitAnswer<TestserverConnection>;
@@ -0,0 +1,22 @@
1
+ // The Testserver pool's split: how a run across runner sandboxes gives each runner sandbox its own part of the
2
+ // Testserver connection that the pool's acquire hands the command. Pure: it reads only the connection and the number of
3
+ // runner sandboxes.
4
+ import { fewerSandboxesThanRunnerSandboxes } from "./refusals.js";
5
+ /**
6
+ * Splits the run's Testserver sandboxes across its runner sandboxes: each runner sandbox gets its own part of the
7
+ * Testserver sandbox list, in order, runner sandbox 0 the first, and the parts' sizes differ by one at most, the
8
+ * larger ones first. Refuses (`fewer_sandboxes_than_runner_sandboxes`) when the list has fewer Testserver sandboxes
9
+ * than the run has runner sandboxes.
10
+ */
11
+ export function splitTestserverConnection({ payload, sandboxes: runnerSandboxes, }) {
12
+ const { sandboxes } = payload;
13
+ if (sandboxes.length < runnerSandboxes)
14
+ return fewerSandboxesThanRunnerSandboxes({ sandboxes: sandboxes.length, runnerSandboxes });
15
+ const size = Math.floor(sandboxes.length / runnerSandboxes);
16
+ const larger = sandboxes.length % runnerSandboxes;
17
+ const parts = Array.from({ length: runnerSandboxes }, (_, index) => {
18
+ const start = index * size + Math.min(index, larger);
19
+ return { sandboxes: sandboxes.slice(start, start + size + (index < larger ? 1 : 0)) };
20
+ });
21
+ return { parts };
22
+ }