@whaaaley/crush 0.0.0-stage → 0.2.7

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 (358) hide show
  1. package/LICENSE +32 -0
  2. package/README.md +185 -2
  3. package/SKILL.md +187 -0
  4. package/THIRD_PARTY_NOTICES.md +277 -0
  5. package/dist/capture/capture.operations.d.ts +23 -0
  6. package/dist/capture/capture.operations.js +231 -0
  7. package/dist/capture/capture.schema.d.ts +73 -0
  8. package/dist/capture/capture.schema.js +28 -0
  9. package/dist/collapse/collapse.operations.d.ts +2 -0
  10. package/dist/collapse/collapse.operations.js +82 -0
  11. package/dist/collapse/collapse.schema.d.ts +40 -0
  12. package/dist/collapse/collapse.schema.js +35 -0
  13. package/dist/crush.tables.d.ts +3583 -0
  14. package/dist/crush.tables.js +456 -0
  15. package/dist/crushes/callback.crush.d.ts +2 -0
  16. package/dist/crushes/callback.crush.js +19 -0
  17. package/dist/crushes/crush.d.ts +36 -0
  18. package/dist/crushes/crush.js +12 -0
  19. package/dist/crushes/crush.names.d.ts +1 -0
  20. package/dist/crushes/crush.names.js +2 -0
  21. package/dist/crushes/crushes.d.ts +2 -0
  22. package/dist/crushes/crushes.js +9 -0
  23. package/dist/crushes/default-value.crush.d.ts +2 -0
  24. package/dist/crushes/default-value.crush.js +29 -0
  25. package/dist/crushes/drop-operand.crush.d.ts +2 -0
  26. package/dist/crushes/drop-operand.crush.js +37 -0
  27. package/dist/crushes/fold.d.ts +64 -0
  28. package/dist/crushes/fold.js +366 -0
  29. package/dist/crushes/force-fork.crush.d.ts +2 -0
  30. package/dist/crushes/force-fork.crush.js +79 -0
  31. package/dist/crushes/loop-once.crush.d.ts +2 -0
  32. package/dist/crushes/loop-once.crush.js +71 -0
  33. package/dist/crushes/optional-chain.crush.d.ts +2 -0
  34. package/dist/crushes/optional-chain.crush.js +30 -0
  35. package/dist/crushes/switch-case.crush.d.ts +2 -0
  36. package/dist/crushes/switch-case.crush.js +19 -0
  37. package/dist/decisions/decide.d.ts +61 -0
  38. package/dist/decisions/decide.js +161 -0
  39. package/dist/decisions/decisions.d.ts +24 -0
  40. package/dist/decisions/decisions.js +62 -0
  41. package/dist/decisions/forks.decision.d.ts +4 -0
  42. package/dist/decisions/forks.decision.js +32 -0
  43. package/dist/decisions/kinds.d.ts +101 -0
  44. package/dist/decisions/kinds.js +38 -0
  45. package/dist/decisions/loops.decision.d.ts +4 -0
  46. package/dist/decisions/loops.decision.js +39 -0
  47. package/dist/decisions/shorts.decision.d.ts +3 -0
  48. package/dist/decisions/shorts.decision.js +66 -0
  49. package/dist/decisions/switches.decision.d.ts +3 -0
  50. package/dist/decisions/switches.decision.js +20 -0
  51. package/dist/decisions/throws.decision.d.ts +3 -0
  52. package/dist/decisions/throws.decision.js +35 -0
  53. package/dist/decisions/values.decision.d.ts +3 -0
  54. package/dist/decisions/values.decision.js +67 -0
  55. package/dist/explore/edges/explore.d.ts +60 -0
  56. package/dist/explore/edges/explore.db.d.ts +22 -0
  57. package/dist/explore/edges/explore.db.js +55 -0
  58. package/dist/explore/edges/explore.js +305 -0
  59. package/dist/explore/edges/random.d.ts +2 -0
  60. package/dist/explore/edges/random.js +32 -0
  61. package/dist/explore/explore.operations.d.ts +30 -0
  62. package/dist/explore/explore.operations.js +117 -0
  63. package/dist/explore/limits.operations.d.ts +14 -0
  64. package/dist/explore/limits.operations.js +20 -0
  65. package/dist/explore/targets.operations.d.ts +36 -0
  66. package/dist/explore/targets.operations.js +32 -0
  67. package/dist/explore/utils/draws.d.ts +6 -0
  68. package/dist/explore/utils/draws.js +2 -0
  69. package/dist/explore/utils/edits.d.ts +15 -0
  70. package/dist/explore/utils/edits.js +151 -0
  71. package/dist/explore/utils/guide.d.ts +23 -0
  72. package/dist/explore/utils/guide.js +35 -0
  73. package/dist/explore/utils/keep.d.ts +10 -0
  74. package/dist/explore/utils/keep.js +61 -0
  75. package/dist/explore/utils/pools.d.ts +17 -0
  76. package/dist/explore/utils/pools.js +121 -0
  77. package/dist/explore/utils/reads.d.ts +19 -0
  78. package/dist/explore/utils/reads.js +118 -0
  79. package/dist/explore/utils/twin.d.ts +21 -0
  80. package/dist/explore/utils/twin.js +55 -0
  81. package/dist/forks/forks.operations.d.ts +32 -0
  82. package/dist/forks/forks.operations.js +134 -0
  83. package/dist/forks/forks.schema.d.ts +20 -0
  84. package/dist/forks/forks.schema.js +14 -0
  85. package/dist/graph/cfg/cfg.d.ts +28 -0
  86. package/dist/graph/cfg/cfg.js +31 -0
  87. package/dist/graph/cfg/code-paths/analyzer.d.ts +27 -0
  88. package/dist/graph/cfg/code-paths/analyzer.js +358 -0
  89. package/dist/graph/cfg/code-paths/segments.d.ts +44 -0
  90. package/dist/graph/cfg/code-paths/segments.js +105 -0
  91. package/dist/graph/cfg/code-paths/state.d.ts +121 -0
  92. package/dist/graph/cfg/code-paths/state.js +611 -0
  93. package/dist/graph/cfg/entries.d.ts +13 -0
  94. package/dist/graph/cfg/entries.js +120 -0
  95. package/dist/graph/cfg/functions.d.ts +6 -0
  96. package/dist/graph/cfg/functions.js +47 -0
  97. package/dist/graph/cfg/paths.d.ts +27 -0
  98. package/dist/graph/cfg/paths.js +91 -0
  99. package/dist/graph/cfg/scopes/scopes.d.ts +40 -0
  100. package/dist/graph/cfg/scopes/scopes.js +375 -0
  101. package/dist/graph/symbols/file.d.ts +90 -0
  102. package/dist/graph/symbols/file.js +427 -0
  103. package/dist/graph/symbols/keys.d.ts +13 -0
  104. package/dist/graph/symbols/keys.js +22 -0
  105. package/dist/graph/symbols/resolve.operations.d.ts +4 -0
  106. package/dist/graph/symbols/resolve.operations.js +33 -0
  107. package/dist/graph/symbols/symbols.d.ts +12 -0
  108. package/dist/graph/symbols/symbols.js +155 -0
  109. package/dist/graph/symbols/symbols.schema.d.ts +32 -0
  110. package/dist/graph/symbols/symbols.schema.js +19 -0
  111. package/dist/graph/unused/tests.d.ts +7 -0
  112. package/dist/graph/unused/tests.js +95 -0
  113. package/dist/graph/unused/unused.d.ts +53 -0
  114. package/dist/graph/unused/unused.js +319 -0
  115. package/dist/graph/walk/walk.d.ts +7 -0
  116. package/dist/graph/walk/walk.js +39 -0
  117. package/dist/instrument/instrument.operations.d.ts +72 -0
  118. package/dist/instrument/instrument.operations.js +786 -0
  119. package/dist/instrument/instrument.schema.d.ts +257 -0
  120. package/dist/instrument/instrument.schema.js +100 -0
  121. package/dist/judge/counters.d.ts +86 -0
  122. package/dist/judge/counters.js +402 -0
  123. package/dist/judge/edges/api.d.ts +14 -0
  124. package/dist/judge/edges/api.js +80 -0
  125. package/dist/judge/edges/completion.reporter.d.ts +9 -0
  126. package/dist/judge/edges/completion.reporter.js +51 -0
  127. package/dist/judge/edges/hints.reporter.d.ts +13 -0
  128. package/dist/judge/edges/hints.reporter.js +29 -0
  129. package/dist/judge/edges/judge.edges.d.ts +52 -0
  130. package/dist/judge/edges/judge.edges.js +59 -0
  131. package/dist/judge/edges/judge.fs.d.ts +8 -0
  132. package/dist/judge/edges/judge.fs.js +45 -0
  133. package/dist/judge/edges/merge.d.ts +11 -0
  134. package/dist/judge/edges/merge.js +60 -0
  135. package/dist/judge/edges/plugin.d.ts +132 -0
  136. package/dist/judge/edges/plugin.js +441 -0
  137. package/dist/judge/edges/reach.d.ts +68 -0
  138. package/dist/judge/edges/reach.js +132 -0
  139. package/dist/judge/edges/speed.d.ts +32 -0
  140. package/dist/judge/edges/speed.js +34 -0
  141. package/dist/judge/edges/strays.d.ts +1 -0
  142. package/dist/judge/edges/strays.js +14 -0
  143. package/dist/judge/edges/vitest.d.ts +20 -0
  144. package/dist/judge/edges/vitest.js +36 -0
  145. package/dist/judge/edges/vitest.schema.d.ts +14 -0
  146. package/dist/judge/edges/vitest.schema.js +16 -0
  147. package/dist/judge/explore.test.d.ts +1 -0
  148. package/dist/judge/explore.test.js +101 -0
  149. package/dist/judge/hints.d.ts +11 -0
  150. package/dist/judge/hints.js +44 -0
  151. package/dist/judge/judge.operations.d.ts +218 -0
  152. package/dist/judge/judge.operations.js +464 -0
  153. package/dist/judge/judge.schema.d.ts +135 -0
  154. package/dist/judge/judge.schema.js +129 -0
  155. package/dist/judge/judge.shard-1.test.d.ts +1 -0
  156. package/dist/judge/judge.shard-1.test.js +3 -0
  157. package/dist/judge/judge.shard-2.test.d.ts +1 -0
  158. package/dist/judge/judge.shard-2.test.js +3 -0
  159. package/dist/judge/judge.test.d.ts +1 -0
  160. package/dist/judge/judge.test.js +3 -0
  161. package/dist/judge/refusals.d.ts +14 -0
  162. package/dist/judge/refusals.js +10 -0
  163. package/dist/judge/report.test.d.ts +1 -0
  164. package/dist/judge/report.test.js +432 -0
  165. package/dist/judge/runner.d.ts +3 -0
  166. package/dist/judge/runner.js +1602 -0
  167. package/dist/judge/stresses.test.d.ts +1 -0
  168. package/dist/judge/stresses.test.js +12 -0
  169. package/dist/judge/task-meta.d.ts +14 -0
  170. package/dist/judge/task-meta.js +1 -0
  171. package/dist/justify/edges/load.d.ts +7 -0
  172. package/dist/justify/edges/load.js +40 -0
  173. package/dist/justify/edges/refresh.fs.d.ts +8 -0
  174. package/dist/justify/edges/refresh.fs.js +15 -0
  175. package/dist/justify/justify.operations.d.ts +46 -0
  176. package/dist/justify/justify.operations.js +80 -0
  177. package/dist/justify/justify.schema.d.ts +21 -0
  178. package/dist/justify/justify.schema.js +11 -0
  179. package/dist/mutators/arithmetic-operator.mutator.d.ts +2 -0
  180. package/dist/mutators/arithmetic-operator.mutator.js +22 -0
  181. package/dist/mutators/array-declaration.mutator.d.ts +2 -0
  182. package/dist/mutators/array-declaration.mutator.js +12 -0
  183. package/dist/mutators/arrow-function.mutator.d.ts +2 -0
  184. package/dist/mutators/arrow-function.mutator.js +10 -0
  185. package/dist/mutators/assignment-operator.mutator.d.ts +2 -0
  186. package/dist/mutators/assignment-operator.mutator.js +29 -0
  187. package/dist/mutators/await-expression.mutator.d.ts +2 -0
  188. package/dist/mutators/await-expression.mutator.js +7 -0
  189. package/dist/mutators/bitwise-operator.mutator.d.ts +2 -0
  190. package/dist/mutators/bitwise-operator.mutator.js +19 -0
  191. package/dist/mutators/block-statement.mutator.d.ts +2 -0
  192. package/dist/mutators/block-statement.mutator.js +30 -0
  193. package/dist/mutators/boolean-literal.mutator.d.ts +2 -0
  194. package/dist/mutators/boolean-literal.mutator.js +5 -0
  195. package/dist/mutators/coercion.mutator.d.ts +2 -0
  196. package/dist/mutators/coercion.mutator.js +28 -0
  197. package/dist/mutators/conditional-expression.mutator.d.ts +2 -0
  198. package/dist/mutators/conditional-expression.mutator.js +36 -0
  199. package/dist/mutators/disposal.mutator.d.ts +2 -0
  200. package/dist/mutators/disposal.mutator.js +13 -0
  201. package/dist/mutators/empty-destructuring.mutator.d.ts +2 -0
  202. package/dist/mutators/empty-destructuring.mutator.js +35 -0
  203. package/dist/mutators/empty-return.mutator.d.ts +2 -0
  204. package/dist/mutators/empty-return.mutator.js +35 -0
  205. package/dist/mutators/equality-operator.mutator.d.ts +2 -0
  206. package/dist/mutators/equality-operator.mutator.js +16 -0
  207. package/dist/mutators/loop-exit.mutator.d.ts +2 -0
  208. package/dist/mutators/loop-exit.mutator.js +5 -0
  209. package/dist/mutators/method-expression.mutator.d.ts +2 -0
  210. package/dist/mutators/method-expression.mutator.js +59 -0
  211. package/dist/mutators/missing-lookup.mutator.d.ts +2 -0
  212. package/dist/mutators/missing-lookup.mutator.js +25 -0
  213. package/dist/mutators/mutator.d.ts +40 -0
  214. package/dist/mutators/mutator.js +49 -0
  215. package/dist/mutators/mutator.names.d.ts +3 -0
  216. package/dist/mutators/mutator.names.js +43 -0
  217. package/dist/mutators/mutators.d.ts +8 -0
  218. package/dist/mutators/mutators.js +84 -0
  219. package/dist/mutators/nested-condition.mutator.d.ts +2 -0
  220. package/dist/mutators/nested-condition.mutator.js +16 -0
  221. package/dist/mutators/number-literal.mutator.d.ts +3 -0
  222. package/dist/mutators/number-literal.mutator.js +13 -0
  223. package/dist/mutators/object-literal.mutator.d.ts +2 -0
  224. package/dist/mutators/object-literal.mutator.js +6 -0
  225. package/dist/mutators/odd-number.mutator.d.ts +2 -0
  226. package/dist/mutators/odd-number.mutator.js +15 -0
  227. package/dist/mutators/operand-deletion.mutator.d.ts +2 -0
  228. package/dist/mutators/operand-deletion.mutator.js +9 -0
  229. package/dist/mutators/outcome.mutator.d.ts +3 -0
  230. package/dist/mutators/outcome.mutator.js +45 -0
  231. package/dist/mutators/plain-assignment.mutator.d.ts +2 -0
  232. package/dist/mutators/plain-assignment.mutator.js +7 -0
  233. package/dist/mutators/power-operator.mutator.d.ts +2 -0
  234. package/dist/mutators/power-operator.mutator.js +13 -0
  235. package/dist/mutators/private-brand.mutator.d.ts +2 -0
  236. package/dist/mutators/private-brand.mutator.js +7 -0
  237. package/dist/mutators/regex.mutator.d.ts +2 -0
  238. package/dist/mutators/regex.mutator.js +29 -0
  239. package/dist/mutators/short-iteration.mutator.d.ts +2 -0
  240. package/dist/mutators/short-iteration.mutator.js +8 -0
  241. package/dist/mutators/string-literal.mutator.d.ts +3 -0
  242. package/dist/mutators/string-literal.mutator.js +149 -0
  243. package/dist/mutators/switch-default.mutator.d.ts +2 -0
  244. package/dist/mutators/switch-default.mutator.js +13 -0
  245. package/dist/mutators/sync-iteration.mutator.d.ts +3 -0
  246. package/dist/mutators/sync-iteration.mutator.js +9 -0
  247. package/dist/mutators/thrown-call.mutator.d.ts +2 -0
  248. package/dist/mutators/thrown-call.mutator.js +7 -0
  249. package/dist/mutators/unary-operator.mutator.d.ts +2 -0
  250. package/dist/mutators/unary-operator.mutator.js +18 -0
  251. package/dist/mutators/unbound-call.mutator.d.ts +2 -0
  252. package/dist/mutators/unbound-call.mutator.js +14 -0
  253. package/dist/mutators/update-operator.mutator.d.ts +2 -0
  254. package/dist/mutators/update-operator.mutator.js +15 -0
  255. package/dist/mutators/yield-value.mutator.d.ts +2 -0
  256. package/dist/mutators/yield-value.mutator.js +7 -0
  257. package/dist/parity/compare.d.ts +27 -0
  258. package/dist/parity/compare.js +26 -0
  259. package/dist/parity/corpus.parity.d.ts +1 -0
  260. package/dist/parity/corpus.parity.js +97 -0
  261. package/dist/parity/edges/corpus.fs.d.ts +3 -0
  262. package/dist/parity/edges/corpus.fs.js +30 -0
  263. package/dist/parity/edges/ports.d.ts +2 -0
  264. package/dist/parity/edges/ports.js +21 -0
  265. package/dist/parity/edges/vitest.d.ts +2 -0
  266. package/dist/parity/edges/vitest.js +3 -0
  267. package/dist/parity/parity.operations.d.ts +33 -0
  268. package/dist/parity/parity.operations.js +60 -0
  269. package/dist/parity/parity.schema.d.ts +5 -0
  270. package/dist/parity/parity.schema.js +6 -0
  271. package/dist/parity/stryker/compare.d.ts +14 -0
  272. package/dist/parity/stryker/compare.js +52 -0
  273. package/dist/parity/stryker/edges/ports.d.ts +12 -0
  274. package/dist/parity/stryker/edges/ports.js +28 -0
  275. package/dist/parity/stryker/equivalence.d.ts +1 -0
  276. package/dist/parity/stryker/equivalence.js +42 -0
  277. package/dist/parity/stryker/intended.d.ts +29 -0
  278. package/dist/parity/stryker/intended.js +152 -0
  279. package/dist/parity/stryker/normalize.d.ts +27 -0
  280. package/dist/parity/stryker/normalize.js +181 -0
  281. package/dist/parity/stryker/rules.d.ts +6 -0
  282. package/dist/parity/stryker/rules.js +116 -0
  283. package/dist/parity/stryker/sides.d.ts +46 -0
  284. package/dist/parity/stryker/sides.js +199 -0
  285. package/dist/parity/stryker/stryker.parity.d.ts +1 -0
  286. package/dist/parity/stryker/stryker.parity.js +147 -0
  287. package/dist/parity/stryker/stryker.schema.d.ts +6 -0
  288. package/dist/parity/stryker/stryker.schema.js +7 -0
  289. package/dist/parity/views.d.ts +21 -0
  290. package/dist/parity/views.js +119 -0
  291. package/dist/questions/questions.operations.d.ts +110 -0
  292. package/dist/questions/questions.operations.js +446 -0
  293. package/dist/questions/questions.schema.d.ts +57 -0
  294. package/dist/questions/questions.schema.js +28 -0
  295. package/dist/record/edges/calls.db.d.ts +10 -0
  296. package/dist/record/edges/calls.db.js +91 -0
  297. package/dist/record/edges/hits.db.d.ts +3 -0
  298. package/dist/record/edges/hits.db.js +5 -0
  299. package/dist/record/edges/holds.db.d.ts +4 -0
  300. package/dist/record/edges/holds.db.js +31 -0
  301. package/dist/record/edges/judged-state.db.d.ts +5 -0
  302. package/dist/record/edges/judged-state.db.js +25 -0
  303. package/dist/record/edges/markers.db.d.ts +11 -0
  304. package/dist/record/edges/markers.db.js +55 -0
  305. package/dist/record/edges/merge.db.d.ts +7 -0
  306. package/dist/record/edges/merge.db.js +46 -0
  307. package/dist/record/edges/parts.db.d.ts +42 -0
  308. package/dist/record/edges/parts.db.js +389 -0
  309. package/dist/record/edges/parts.edges.d.ts +2 -0
  310. package/dist/record/edges/parts.edges.js +7 -0
  311. package/dist/record/edges/parts.fs.d.ts +1 -0
  312. package/dist/record/edges/parts.fs.js +11 -0
  313. package/dist/record/edges/parts.writer.d.ts +1 -0
  314. package/dist/record/edges/parts.writer.js +85 -0
  315. package/dist/record/edges/passes.db.d.ts +19 -0
  316. package/dist/record/edges/passes.db.js +31 -0
  317. package/dist/record/edges/plan.db.d.ts +21 -0
  318. package/dist/record/edges/plan.db.js +174 -0
  319. package/dist/record/edges/reach.db.d.ts +6 -0
  320. package/dist/record/edges/reach.db.js +62 -0
  321. package/dist/record/edges/record.db.d.ts +22 -0
  322. package/dist/record/edges/record.db.js +176 -0
  323. package/dist/record/edges/record.fs.d.ts +3 -0
  324. package/dist/record/edges/record.fs.js +7 -0
  325. package/dist/record/edges/site-verdicts.db.d.ts +11 -0
  326. package/dist/record/edges/site-verdicts.db.js +66 -0
  327. package/dist/record/edges/verified.db.d.ts +7 -0
  328. package/dist/record/edges/verified.db.js +71 -0
  329. package/dist/record/parts.operations.d.ts +26 -0
  330. package/dist/record/parts.operations.js +31 -0
  331. package/dist/record/path-checks.operations.d.ts +15 -0
  332. package/dist/record/path-checks.operations.js +84 -0
  333. package/dist/record/record.operations.d.ts +36 -0
  334. package/dist/record/record.operations.js +11 -0
  335. package/dist/stresses/edges/stresses.record.d.ts +4 -0
  336. package/dist/stresses/edges/stresses.record.js +37 -0
  337. package/dist/stresses/stresses.operations.d.ts +28 -0
  338. package/dist/stresses/stresses.operations.js +22 -0
  339. package/dist/utils/ast.d.ts +55 -0
  340. package/dist/utils/ast.js +181 -0
  341. package/dist/utils/errors.d.ts +8 -0
  342. package/dist/utils/errors.js +12 -0
  343. package/dist/utils/faults.d.ts +6 -0
  344. package/dist/utils/faults.js +10 -0
  345. package/dist/utils/lookup.d.ts +4 -0
  346. package/dist/utils/lookup.js +27 -0
  347. package/dist/utils/order.d.ts +2 -0
  348. package/dist/utils/order.js +17 -0
  349. package/dist/utils/retry.d.ts +14 -0
  350. package/dist/utils/retry.js +15 -0
  351. package/dist/utils/safe.d.ts +11 -0
  352. package/dist/utils/safe.js +31 -0
  353. package/migrations/main/20261129123324_initial/migration.sql +418 -0
  354. package/migrations/main/20261129123324_initial/snapshot.json +3641 -0
  355. package/package.json +89 -4
  356. package/references/consumer-setup.md +92 -0
  357. package/src/graph/cfg/code-paths/LICENSE +21 -0
  358. package/src/graph/cfg/scopes/LICENSE +24 -0
@@ -0,0 +1,32 @@
1
+ export type PlanSpeed = {
2
+ plan: number;
3
+ cachedPlan: number;
4
+ built: number;
5
+ cached: number;
6
+ writes: number;
7
+ };
8
+ export type BaselineSpeed = {
9
+ started: number;
10
+ ended: number;
11
+ writes: number;
12
+ };
13
+ export type PassSpeed = {
14
+ ms: number;
15
+ reruns: number;
16
+ sites: number;
17
+ };
18
+ export type JudgeSpeed = {
19
+ judge: PassSpeed;
20
+ merge: number;
21
+ verify: {
22
+ ms: number;
23
+ reruns: number;
24
+ };
25
+ writes: number;
26
+ reused: number;
27
+ };
28
+ export declare const planSpeedKey = "crushPlanSpeed";
29
+ export declare const judgeSpeedOf: () => JudgeSpeed;
30
+ export declare const judgeSpeedsOf: (speeds: readonly JudgeSpeed[]) => JudgeSpeed;
31
+ export declare const now: () => number;
32
+ export declare const baselineMsOf: (files: BaselineSpeed[]) => number;
@@ -0,0 +1,34 @@
1
+ export const planSpeedKey = 'crushPlanSpeed';
2
+ export const judgeSpeedOf = () => ({
3
+ judge: { ms: 0, reruns: 0, sites: 0 },
4
+ merge: 0,
5
+ verify: { ms: 0, reruns: 0 },
6
+ writes: 0,
7
+ reused: 0,
8
+ });
9
+ // The shards' figures as one command's: their counts added, and each pass timed by the shard that took longest, since the shards run it side by side.
10
+ export const judgeSpeedsOf = (speeds) => {
11
+ const total = judgeSpeedOf();
12
+ for (const { judge, merge, verify, writes, reused } of speeds) {
13
+ total.judge.ms = Math.max(total.judge.ms, judge.ms);
14
+ total.judge.reruns += judge.reruns;
15
+ total.judge.sites += judge.sites;
16
+ total.merge = Math.max(total.merge, merge);
17
+ total.verify.ms = Math.max(total.verify.ms, verify.ms);
18
+ total.verify.reruns += verify.reruns;
19
+ total.writes += writes;
20
+ total.reused += reused;
21
+ }
22
+ return total;
23
+ };
24
+ export const now = () => performance.timeOrigin + performance.now();
25
+ // Parallel files' baseline intervals count once in wall time.
26
+ export const baselineMsOf = (files) => {
27
+ let time = 0;
28
+ let through = 0;
29
+ for (const { started, ended } of files.toSorted((a, b) => a.started - b.started)) {
30
+ time += Math.max(0, ended - Math.max(through, started));
31
+ through = Math.max(through, ended);
32
+ }
33
+ return time;
34
+ };
@@ -0,0 +1 @@
1
+ export declare const droppedStrays: () => AsyncDisposable;
@@ -0,0 +1,14 @@
1
+ // A forced site can leave a promise rejecting or a callback throwing outside any rerun, which would fail the whole file, so they are dropped while sites run.
2
+ // Node reports a rejection nobody awaited a turn after it happens, so the release waits a turn before the last stray goes unheard.
3
+ export const droppedStrays = () => {
4
+ const drop = () => { };
5
+ process.on('unhandledRejection', drop);
6
+ process.on('uncaughtException', drop);
7
+ return {
8
+ [Symbol.asyncDispose]: async () => {
9
+ await new Promise((resolve) => setImmediate(resolve));
10
+ process.off('unhandledRejection', drop);
11
+ process.off('uncaughtException', drop);
12
+ },
13
+ };
14
+ };
@@ -0,0 +1,20 @@
1
+ export declare const vitestProvideKey = "crushVitest";
2
+ export declare const phaseProvideKey = "crushPhase";
3
+ export declare const rulesProvideKey = "crushRules";
4
+ export declare const rootProvideKey = "crushRoot";
5
+ export declare const removableTestsProvideKey = "crushRemovableTests";
6
+ export declare const stepsProvideKey = "crushSteps";
7
+ export declare const recordTestFilesProvideKey = "crushRecordTestFiles";
8
+ export declare const explorePathsProvideKey = "crushExplorePaths";
9
+ export declare const exploreLimitsProvideKey = "crushExploreLimits";
10
+ export declare const exploreSeedProvideKey = "crushExploreSeed";
11
+ export declare const judgeFilesProvideKey = "crushJudgeFiles";
12
+ export declare const judgeRelatedProvideKey = "crushJudgeRelated";
13
+ export declare const questionsRelatedProvideKey = "crushQuestionsRelated";
14
+ export declare const judgeRedundantProvideKey = "crushJudgeRedundant";
15
+ export declare const judgeShardsProvideKey = "crushJudgeShards";
16
+ export declare const ownExtension: string;
17
+ export declare const judgeCoordinators: string[];
18
+ export declare const crushFolderOf: (root: string) => string;
19
+ export declare const recordPathOf: (root: string) => string;
20
+ export declare const refusedMarkerOf: (folder: string) => string;
@@ -0,0 +1,36 @@
1
+ import { extname, join } from 'node:path';
2
+ // The keys the command projects provide, which Vitest hands their workers alone, so no process a test spawns inherits them.
3
+ // The project's `vite-plus/test`, the copy its tests register with.
4
+ export const vitestProvideKey = 'crushVitest';
5
+ // The pass a judging project runs: judging every site, the owed pass, or the joint check.
6
+ export const phaseProvideKey = 'crushPhase';
7
+ // What every verdict rests on beside its riders and reads: the record version, crush's own code and the project's settings, fork plugins included.
8
+ export const rulesProvideKey = 'crushRules';
9
+ // The project root, which the merge and the report read the record under.
10
+ export const rootProvideKey = 'crushRoot';
11
+ // Which tests the report may ask to remove.
12
+ export const removableTestsProvideKey = 'crushRemovableTests';
13
+ // Whether the report asks each test's step questions.
14
+ export const stepsProvideKey = 'crushSteps';
15
+ export const recordTestFilesProvideKey = 'crushRecordTestFiles';
16
+ export const explorePathsProvideKey = 'crushExplorePaths';
17
+ export const exploreLimitsProvideKey = 'crushExploreLimits';
18
+ export const exploreSeedProvideKey = 'crushExploreSeed';
19
+ export const judgeFilesProvideKey = 'crushJudgeFiles';
20
+ export const judgeRelatedProvideKey = 'crushJudgeRelated';
21
+ // The paths a related questions run names, from Vitest's own `related` filter, whose reach the report shows alone.
22
+ export const questionsRelatedProvideKey = 'crushQuestionsRelated';
23
+ // Whether the judge searches each caught site's other tests for a second catcher, which finds the redundant tests and only `judge:redundant` does.
24
+ export const judgeRedundantProvideKey = 'crushJudgeRedundant';
25
+ // How many of the judge command's coordinators judge, as many as run at once, since a shard waits for every other at the end of each pass.
26
+ export const judgeShardsProvideKey = 'crushJudgeShards';
27
+ // The extension crush's own files carry where it runs, `.ts` from its source or `.js` once built, so every file it hands Vitest by name exists.
28
+ export const ownExtension = extname(import.meta.filename);
29
+ // The judge command's coordinator test files, one for each shard, each judging its share of the project's test files beside the others.
30
+ export const judgeCoordinators = ['judge', 'judge.shard-1', 'judge.shard-2'].map((name) => `${name}.test${ownExtension}`);
31
+ // Where crush keeps its working files and record, beside the project's own files.
32
+ export const crushFolderOf = (root) => join(root, '.crush');
33
+ // The record every phase reads and writes, in crush's folder.
34
+ export const recordPathOf = (root) => join(crushFolderOf(root), 'record.db');
35
+ // The marker a refused run leaves in crush's folder, which stops `record` before a phase reads parts that run never wrote.
36
+ export const refusedMarkerOf = (folder) => join(folder, 'refused');
@@ -0,0 +1,14 @@
1
+ import type * as Vitest from 'vite-plus/test';
2
+ import type { RunnerTestFile } from 'vite-plus/test';
3
+ import { z } from 'zod';
4
+ export declare const runnerModuleOutput: z.ZodObject<{
5
+ TestRunner: z.ZodCustom<typeof Vitest.TestRunner, typeof Vitest.TestRunner>;
6
+ }, z.core.$strip>;
7
+ export type BrowserFunction = (paths: string[], runner: InstanceType<typeof Vitest.TestRunner>) => Promise<RunnerTestFile[]>;
8
+ export declare const browserModuleOutput: z.ZodObject<{
9
+ collectTests: z.ZodCustom<BrowserFunction, BrowserFunction>;
10
+ startTests: z.ZodCustom<BrowserFunction, BrowserFunction>;
11
+ }, z.core.$strip>;
12
+ export declare const workerStateOutput: z.ZodObject<{
13
+ providedContext: z.ZodCustom<object, object>;
14
+ }, z.core.$strip>;
@@ -0,0 +1,16 @@
1
+ import { z } from 'zod';
2
+ // Vitest's own runner class, from the copy the project's tests register with.
3
+ export const runnerModuleOutput = z.object({
4
+ TestRunner: z.custom((value) => typeof value === 'function'),
5
+ });
6
+ const browserFunction = z.custom((value) => typeof value === 'function');
7
+ // The two functions of Vitest's browser module crush calls, neither of which Vitest exports publicly.
8
+ export const browserModuleOutput = z.object({
9
+ collectTests: browserFunction,
10
+ startTests: browserFunction,
11
+ });
12
+ // Vitest's private worker state: the context the project provided, which each pass rewrites.
13
+ // It is Vitest's own object, kept as it is, so a rewrite reaches Vitest.
14
+ export const workerStateOutput = z.object({
15
+ providedContext: z.custom((value) => typeof value === 'object' && value !== null),
16
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,101 @@
1
+ var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExtension) || function (path, preserveJsx) {
2
+ if (typeof path === "string" && /^\.\.?\//.test(path)) {
3
+ return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
4
+ return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
5
+ });
6
+ }
7
+ return path;
8
+ };
9
+ import { join } from 'node:path';
10
+ import { describe, expect, inject, it } from 'vite-plus/test';
11
+ import { exploreExport } from '../explore/edges/explore.js';
12
+ import { getCovered, getSeeds, getUnreplayable, setExploreRun, setFindings } from '../explore/edges/explore.db.js';
13
+ import { explorableOf, graphOf, skippedOf, unexploredOf } from '../explore/targets.operations.js';
14
+ import { shareOf } from '../explore/explore.operations.js';
15
+ import { exploreBudgetOf } from '../explore/limits.operations.js';
16
+ import { getReachEdges, getReachNodes } from '../record/edges/reach.db.js';
17
+ import { openRecord } from '../record/edges/record.db.js';
18
+ import { unitFieldsOf } from '../record/record.operations.js';
19
+ import { exploreLimitsProvideKey, explorePathsProvideKey, exploreSeedProvideKey, recordPathOf, rootProvideKey } from './edges/vitest.js';
20
+ import { testFilePattern } from './edges/plugin.js';
21
+ // Crush's explore of every export the record's baselines called with data it kept, each for a throw from a site no test covered, in what the step's cap leaves after the property pass.
22
+ const root = inject(rootProvideKey);
23
+ const seed = inject(exploreSeedProvideKey);
24
+ const record = openRecord(recordPathOf(root));
25
+ const seeds = getSeeds(record);
26
+ const covered = getCovered(record);
27
+ const limits = inject(exploreLimitsProvideKey);
28
+ // The paths a related explore names, or null for a full one, as the plugin provides them.
29
+ const paths = inject(explorePathsProvideKey);
30
+ const graph = graphOf({ nodes: getReachNodes(record), edges: getReachEdges(record) });
31
+ // The runner collects properties before this test. Export search excludes edge-reaching targets and respects related paths.
32
+ const candidates = [...seeds.keys()].filter((key) => !testFilePattern.test(unitFieldsOf(key)[0]));
33
+ const explorable = new Set(explorableOf({ ...graph, keys: candidates, paths: paths && new Set(paths) }).map(({ key }) => key));
34
+ const exports = [...seeds].filter(([key]) => explorable.has(key));
35
+ describe('crush:explore', () => {
36
+ it('explores every replayable export', { timeout: 0 }, async ({ annotate, crushExploreProperties }) => {
37
+ const now = () => performance.now();
38
+ const budget = exploreBudgetOf(limits, now);
39
+ const targets = [
40
+ ...(crushExploreProperties ?? []),
41
+ ...exports.map(([key, lists]) => {
42
+ let resume;
43
+ return {
44
+ key,
45
+ search: async (slice) => {
46
+ resume ??= exploreExport({ root, key, module: await import(__rewriteRelativeImportExtension(join(root, unitFieldsOf(key)[0]))), seeds: lists, covered, seed });
47
+ return resume(slice);
48
+ },
49
+ };
50
+ }),
51
+ ];
52
+ const found = new Set();
53
+ const stopped = [];
54
+ const spent = new Map();
55
+ const searched = new Set();
56
+ let active = targets;
57
+ while (active.length && budget.isLeft()) {
58
+ const again = [];
59
+ for (const [index, target] of active.entries()) {
60
+ if (!budget.isLeft())
61
+ break;
62
+ const { key } = target;
63
+ const started = now();
64
+ const used = budget.used();
65
+ // A finite run shares its remaining time. An unlimited one uses slices so every target gets a turn.
66
+ const leftMs = budget.remainingMs();
67
+ const limitMs = Number.isFinite(leftMs) ? Math.max(1, shareOf({ leftMs, count: active.length - index })) : 2000;
68
+ const takeRun = () => now() - started < limitMs && budget.takeRun();
69
+ // oxlint-disable-next-line no-await-in-loop -- each target shares the same budget and saves its own result before the next one runs
70
+ const explored = await target.search({ limitMs, now, takeRun });
71
+ const ms = Math.round(now() - started);
72
+ const reason = explored instanceof Error ? explored.message : explored.stopped;
73
+ setExploreRun(record, { key, ms, at: Temporal.Now.instant().epochMilliseconds, stopped: reason });
74
+ if (explored instanceof Error)
75
+ throw explored;
76
+ if (reason)
77
+ stopped.push({ key, reason });
78
+ if (explored.isSearched) {
79
+ searched.add(key);
80
+ spent.set(key, (spent.get(key) ?? 0) + ms);
81
+ }
82
+ if (explored.finding) {
83
+ setFindings(record, { targets: [key], findings: [explored.finding] });
84
+ found.add(key);
85
+ }
86
+ else if (!reason && (explored.isSearched || budget.used() > used || now() - started >= limitMs))
87
+ again.push(target);
88
+ }
89
+ active = again;
90
+ }
91
+ setFindings(record, { targets: [...searched].filter((key) => !found.has(key)), findings: [] });
92
+ await annotate(`${searched.size} of ${targets.length} targets explored from seed ${seed}, ${budget.used()} runs, ${found.size} findings`, 'explore');
93
+ const isStopped = (key) => stopped.some((each) => each.key === key);
94
+ const unsearched = targets.map(({ key }) => key).filter((key) => !searched.has(key) && !isStopped(key));
95
+ const unexplorable = candidates.filter((key) => !explorable.has(key));
96
+ const skipped = { unreplayable: getUnreplayable(record), unexplorable, stopped, unsearched };
97
+ await annotate(['explored:', ...[...spent].map(([key, ms]) => `${key}: ${ms} ms`), 'skipped:', ...skippedOf(skipped)].join('\n'), 'targets');
98
+ if (limits.runs !== 0)
99
+ expect(searched.size || budget.used(), unexploredOf(skipped)).toBeGreaterThan(0);
100
+ });
101
+ });
@@ -0,0 +1,11 @@
1
+ type HintCommand = 'record' | 'judge' | 'questions' | 'explore';
2
+ export type HintsInput = {
3
+ command: HintCommand;
4
+ isPassed: boolean;
5
+ related: string[];
6
+ open: number;
7
+ firstFile: string | null;
8
+ };
9
+ export declare const plainPathPattern: RegExp;
10
+ export declare const hintLinesOf: (input: HintsInput) => string[];
11
+ export {};
@@ -0,0 +1,44 @@
1
+ const skillLine = "skill: load the crush skill, or read the SKILL.md in crush's checkout, before acting on this output";
2
+ const hints = {
3
+ record: 'hint: judge reuses every verdict whose basis still holds, so after an edit a related record and judge cost only what the edit reaches',
4
+ judge: 'hint: questions lists each open question with its printed answers, and one answer near the top can settle questions farther down',
5
+ questions: "hint: answer with a test for behavior that must stay, with simpler code for behavior that can go, and with a justification only when no input can answer; ask the user, with the question's id and both readings, when the code's intent is unknown",
6
+ explore: 'hint: each finding is a question, answered by a test that pins the input explore found',
7
+ };
8
+ // Matches a path a shell reads as one word with no quoting.
9
+ export const plainPathPattern = /^[\w./@+-]+$/;
10
+ // Quotes a path for a shell only when it holds a character the shell would split or read.
11
+ const shellPathOf = (path) => (plainPathPattern.test(path) ? path : `'${path.replaceAll("'", "'\\''")}'`);
12
+ const unedited = "edit a test's expected result to match a value the record shows";
13
+ // Where a run leaves the three-step loop of record, judge and questions, as the step to take next and the mistakes to avoid there.
14
+ const stepsOf = ({ command, isPassed, related, open, firstFile }) => {
15
+ const scope = related.length ? `:related ${related.map(shellPathOf).join(' ')}` : '';
16
+ if (command === 'record' && !isPassed)
17
+ return { next: `step 1 of 3, record: make each failing test printed above these lines pass, then run \`vp run record${scope}\` again`, dont: [unedited] };
18
+ if (command === 'record')
19
+ return { next: `step 2 of 3, judge: run \`vp run judge${scope}\``, dont: ['read questions before judging, since they come from the judged record'] };
20
+ if (command === 'judge' && !isPassed)
21
+ return { next: `step 2 of 3, judge: fix each failure printed above these lines, then run \`vp run judge${scope}\` again`, dont: [unedited] };
22
+ if (command === 'judge')
23
+ return { next: `step 3 of 3, questions: run \`vp run questions${scope}\` and answer each question from the top`, dont: ['answer from an earlier report, since judging may have settled or opened questions'] };
24
+ if (command === 'explore')
25
+ return { next: `step 3 of 3, questions: run \`vp run questions${scope}\` to read explore's findings with the other questions`, dont: ["gate a release on explore's findings, since explore is experimental"] };
26
+ if (!isPassed && !open)
27
+ return { next: `step 3 of 3, questions: fix each failure printed above these lines, then run \`vp run questions${scope}\` again`, dont: [unedited] };
28
+ if (!open)
29
+ return { next: 'done: 0 questions are open; run `vp run judge:redundant` to find tests another test already catches', dont: ['add a test no question asked for'] };
30
+ const dont = [unedited, 'justify a question an input or simpler code can answer', "stop at a question that needs the user's intent; note it for the user and take the next"];
31
+ // Questions only the project test asks, as an unused file, name no file, so the full commands follow them.
32
+ if (!firstFile)
33
+ return { next: `step 3 of 3, questions: answer the ${open} open questions from the top as their printed answers say, then run \`vp run record\`, \`vp run judge\` and \`vp run questions\``, dont };
34
+ const file = shellPathOf(firstFile);
35
+ return {
36
+ next: `step 3 of 3, questions: answer the first of the ${open} open questions, in ${firstFile}, as its printed answers say, then run \`vp run record:related ${file}\`, \`vp run judge:related ${file}\` and \`vp run questions\``,
37
+ dont,
38
+ };
39
+ };
40
+ // The lines that end a command's output, with the next step last so an agent reading from the bottom sees it first.
41
+ export const hintLinesOf = (input) => {
42
+ const { next, dont } = stepsOf(input);
43
+ return ['', hints[input.command], skillLine, ...dont.map((line) => `don't: ${line}`), `next: ${next}`];
44
+ };
@@ -0,0 +1,218 @@
1
+ import type { CrushInput, PlanFileInput } from '../instrument/instrument.schema.ts';
2
+ import { type Functions, type JudgedSite } from '../questions/questions.operations.ts';
3
+ import { type CrushError } from '../utils/errors.ts';
4
+ import { type Safe } from '../utils/safe.ts';
5
+ import type { Candidate, Hold, Judged, RemovableTests, TestName } from './judge.schema.ts';
6
+ export type Rider = {
7
+ key: string;
8
+ ticks: number;
9
+ group: string;
10
+ };
11
+ export type Status = 'caught' | 'survived' | 'unjudged' | 'unreached';
12
+ export type Verdict = {
13
+ key: string;
14
+ status: Status;
15
+ catcher: string | null;
16
+ backup: string | null;
17
+ };
18
+ export declare const ridersOf: (reached: Iterable<string>, tests: ReadonlyMap<string, Rider>) => Rider[];
19
+ type Task = {
20
+ id: string;
21
+ type: 'test';
22
+ } | {
23
+ id: string;
24
+ type: 'suite';
25
+ tasks: Task[];
26
+ };
27
+ export declare const testsUnderOf: (root: Task) => Map<string, string[]>;
28
+ export declare const creditedOf: (reached: ReadonlyMap<number, ReadonlySet<string>>, testsUnder: ReadonlyMap<string, readonly string[]>) => Map<number, Set<string>>;
29
+ export type HookSequence = 'stack' | 'list' | 'parallel';
30
+ type Hook = () => unknown;
31
+ type Around = (use: () => Promise<void>) => unknown;
32
+ export type Hooks = {
33
+ before: Hook[][];
34
+ after: Hook[][];
35
+ around: Around[];
36
+ };
37
+ export type Hooked = () => Promise<Error | null>;
38
+ type HookedOfInput = {
39
+ sequence: HookSequence;
40
+ wraps: 'test' | 'suite';
41
+ hooks: Hooks;
42
+ body: Hooked;
43
+ };
44
+ export declare const caughtOf: (fn: () => unknown) => Hooked;
45
+ export declare const hookedOf: ({ sequence, wraps, hooks, body }: HookedOfInput) => Hooked;
46
+ type SuitedOfInput = {
47
+ sequence: HookSequence;
48
+ suites: Hooks[];
49
+ body: Hooked;
50
+ };
51
+ export declare const suitedOf: ({ sequence, suites, body }: SuitedOfInput) => Hooked;
52
+ export declare const groupOf: (file: string, groups: readonly string[]) => string;
53
+ type Backing = Rider & {
54
+ answers: string[];
55
+ };
56
+ export type AnsweredSite = {
57
+ key: string;
58
+ answerSites: ReadonlyMap<string, ReadonlySet<string>>;
59
+ };
60
+ export declare const answerSitesOf: (files: PlanFileInput[]) => Map<string, ReadonlySet<string>>;
61
+ type BackupRidersInput = {
62
+ riders: readonly Backing[];
63
+ catcher: Rider;
64
+ site: AnsweredSite;
65
+ };
66
+ export declare const backupRidersOf: ({ riders, catcher, site }: BackupRidersInput) => Backing[];
67
+ export declare const answeringRidersOf: ({ riders, catcher, site }: BackupRidersInput) => Backing[];
68
+ type RidingSide = 'true' | 'false' | 'repeat';
69
+ export declare const ridingSidesOf: ({ forced, skips }: Pick<CrushInput, 'forced' | 'skips'>) => RidingSide[];
70
+ export declare const askedSideOf: (crush: Pick<CrushInput, 'forced' | 'skips'>) => RidingSide;
71
+ export declare const functionsOf: (files: PlanFileInput[], runs: Pick<Judged, 'entered' | 'hits' | 'tests' | 'rerunFailing'>[]) => Functions;
72
+ export declare const judgedSitesOf: (files: PlanFileInput[], merged: ReadonlyMap<string, Verdict>) => JudgedSite[];
73
+ export declare const verdictBasesOf: (runs: {
74
+ verdicts: {
75
+ key: string;
76
+ readHash?: string;
77
+ }[];
78
+ }[]) => Map<string, Set<string>>;
79
+ export declare const mergedOf: (runs: Verdict[][]) => Map<string, Verdict>;
80
+ export declare const pointKeyOf: (path: string, decision: string) => string;
81
+ export declare const sideKeyOf: (point: string, side: string) => string;
82
+ export type FigureSite = {
83
+ key: string;
84
+ status: Status;
85
+ mutator: string;
86
+ point: string;
87
+ };
88
+ type FiguresInput = {
89
+ points: {
90
+ key: string;
91
+ kind: string;
92
+ }[];
93
+ taken: ReadonlySet<string>;
94
+ sites: FigureSite[];
95
+ justified: ReadonlySet<string>;
96
+ };
97
+ export declare const figuresOf: ({ points, taken, sites, justified }: FiguresInput) => string;
98
+ export declare const widthOf: ({ edits }: {
99
+ edits: {
100
+ start: number;
101
+ end: number;
102
+ }[];
103
+ }) => number;
104
+ export declare const candidatesOf: (crushes: Candidate[], statusOf: ReadonlyMap<string, Status>, held: ReadonlySet<string>) => Candidate[];
105
+ export declare const candidatesHashOf: (list: Candidate[]) => string;
106
+ type HoldBasisInput = {
107
+ sources: {
108
+ path: string;
109
+ hash: string;
110
+ }[];
111
+ tests: {
112
+ file: string;
113
+ hash: string;
114
+ }[];
115
+ };
116
+ export declare const holdBasisOf: ({ sources, tests }: HoldBasisInput) => string;
117
+ export declare const heldAfter: (held: readonly Hold[], dropped: Iterable<{
118
+ key: string;
119
+ tests: string[];
120
+ }>, statusOf: ReadonlyMap<string, Status>, basisOf: (key: string) => string) => Hold[];
121
+ export declare const isRemovableOf: ({ answers, keeps }: {
122
+ answers: string[];
123
+ keeps: string | null;
124
+ }, removableTests: RemovableTests) => boolean;
125
+ export type Shard = {
126
+ index: number;
127
+ count: number;
128
+ };
129
+ export declare const shareOf: (files: readonly string[], { index, count }: Shard) => string[];
130
+ type StaleInput = {
131
+ parts: {
132
+ file: string;
133
+ hash: string;
134
+ reads: {
135
+ path: string;
136
+ hash: string;
137
+ }[];
138
+ }[];
139
+ testFiles: string[];
140
+ hashOf: (path: string) => string | null;
141
+ };
142
+ type StaleChange = {
143
+ path: string;
144
+ reason: 'changed' | 'missing' | 'unrecorded';
145
+ };
146
+ type StalePart = {
147
+ file: string;
148
+ changes: StaleChange[];
149
+ };
150
+ export declare const stalePartsOf: ({ parts, testFiles, hashOf: currentHashOf }: StaleInput) => StalePart[];
151
+ export declare const testKeyOf: (file: string, name: TestName, seen: Map<string, number>) => string;
152
+ export declare const testFileOfKey: (key: string) => string;
153
+ export declare const testDisplayNameOf: (file: string, name: TestName, seen: Map<string, number>) => TestName;
154
+ export declare const testLabelOf: ({ file, groups, title, occurrence }: TestName & {
155
+ file: string;
156
+ }, seen?: Map<string, number>) => string;
157
+ type RunKeyInput = {
158
+ file: string;
159
+ titles: readonly string[] | null;
160
+ };
161
+ export declare const runKeyOf: ({ file, titles }: RunKeyInput) => string;
162
+ type Tested = {
163
+ key: string;
164
+ passed: boolean;
165
+ ticks: number;
166
+ answers: string[];
167
+ keeps: string | null;
168
+ };
169
+ type RemovableInput = {
170
+ tests: Tested[];
171
+ reach: ReadonlyMap<string, ReadonlySet<string>>;
172
+ verdicts: ReadonlyMap<string, Verdict>;
173
+ holds: readonly Hold[];
174
+ removableTests: RemovableTests;
175
+ liveQuestions: ReadonlySet<string>;
176
+ catchingTests: ReadonlySet<string>;
177
+ };
178
+ export type Removable = {
179
+ key: string;
180
+ firsts: number;
181
+ backups: {
182
+ key: string;
183
+ count: number;
184
+ }[];
185
+ };
186
+ export declare const removableOf: ({ tests, reach, verdicts, holds, removableTests, liveQuestions, catchingTests }: RemovableInput) => Removable[];
187
+ export declare const dropsAgree: (checks: {
188
+ dropped: {
189
+ key: string;
190
+ }[];
191
+ }[]) => boolean;
192
+ type SettledInput = {
193
+ reach: ReadonlyMap<string, ReadonlySet<string>>;
194
+ fileOfSite: ReadonlyMap<string, string>;
195
+ openFiles: ReadonlySet<string>;
196
+ };
197
+ export declare const unsettledTestsOf: ({ reach, fileOfSite, openFiles }: SettledInput) => Set<string>;
198
+ export declare const metaOf: (meta: object) => Safe<{
199
+ statedSteps: number | null;
200
+ stepsReason: string | null;
201
+ answers: string[];
202
+ keeps: string | null;
203
+ }, CrushError>;
204
+ export declare const timedOutPattern: RegExp;
205
+ export type SuiteNode = {
206
+ type: string;
207
+ name: string;
208
+ result?: {
209
+ state?: string;
210
+ errors?: readonly {
211
+ message: string;
212
+ }[];
213
+ };
214
+ tasks?: readonly SuiteNode[];
215
+ };
216
+ export declare const fileFailureOf: (file: SuiteNode) => string | null;
217
+ export declare const runFailureOf: (file: SuiteNode) => string | null;
218
+ export {};