@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,257 @@
1
+ import { z } from 'zod';
2
+ export declare const offMutatorNames: readonly ['ThrownCall', 'OddNumber', 'ShortIteration', 'EmptyDestructuring', 'UnboundCall', 'Disposal', 'YieldValue', 'SyncIteration', 'PrivateBrand'];
3
+ export declare const mutationSettingsInput: z.ZodObject<{
4
+ excludedMutators: z.ZodDefault<z.ZodArray<z.ZodEnum<{
5
+ ArithmeticOperator: "ArithmeticOperator";
6
+ ArrayDeclaration: "ArrayDeclaration";
7
+ ArrowFunction: "ArrowFunction";
8
+ AssignmentOperator: "AssignmentOperator";
9
+ AwaitExpression: "AwaitExpression";
10
+ BitwiseOperator: "BitwiseOperator";
11
+ BlockStatement: "BlockStatement";
12
+ BooleanLiteral: "BooleanLiteral";
13
+ Coercion: "Coercion";
14
+ ConditionalExpression: "ConditionalExpression";
15
+ Disposal: "Disposal";
16
+ EmptyDestructuring: "EmptyDestructuring";
17
+ EmptyReturn: "EmptyReturn";
18
+ EqualityOperator: "EqualityOperator";
19
+ LoopExit: "LoopExit";
20
+ MethodExpression: "MethodExpression";
21
+ MissingLookup: "MissingLookup";
22
+ NestedCondition: "NestedCondition";
23
+ NumberLiteral: "NumberLiteral";
24
+ ObjectLiteral: "ObjectLiteral";
25
+ OddNumber: "OddNumber";
26
+ OperandDeletion: "OperandDeletion";
27
+ Outcome: "Outcome";
28
+ PlainAssignment: "PlainAssignment";
29
+ PowerOperator: "PowerOperator";
30
+ PrivateBrand: "PrivateBrand";
31
+ Regex: "Regex";
32
+ ShortIteration: "ShortIteration";
33
+ StringLiteral: "StringLiteral";
34
+ SwitchDefault: "SwitchDefault";
35
+ SyncIteration: "SyncIteration";
36
+ ThrownCall: "ThrownCall";
37
+ UnaryOperator: "UnaryOperator";
38
+ UnboundCall: "UnboundCall";
39
+ UpdateOperator: "UpdateOperator";
40
+ YieldValue: "YieldValue";
41
+ }>>>;
42
+ outcomes: z.ZodDefault<z.ZodBoolean>;
43
+ excludedCalls: z.ZodDefault<z.ZodArray<z.ZodString>>;
44
+ excludedProps: z.ZodDefault<z.ZodArray<z.ZodString>>;
45
+ }, z.core.$strip>;
46
+ export type MutationSettings = z.infer<typeof mutationSettingsInput>;
47
+ declare const pointInput: z.ZodObject<{
48
+ index: z.ZodNumber;
49
+ decision: z.ZodString;
50
+ kind: z.ZodString;
51
+ }, z.core.$strip>;
52
+ declare const switchInput: z.ZodObject<{
53
+ index: z.ZodNumber;
54
+ key: z.ZodString;
55
+ mutator: z.ZodString;
56
+ owner: z.ZodString;
57
+ code: z.ZodString;
58
+ replacement: z.ZodString;
59
+ start: z.ZodNumber;
60
+ line: z.ZodNumber;
61
+ }, z.core.$strip>;
62
+ declare const forcedEffectInput: z.ZodObject<{
63
+ code: z.ZodString;
64
+ kind: z.ZodEnum<{
65
+ logicalAssign: "logicalAssign";
66
+ short: "short";
67
+ }>;
68
+ always: z.ZodBoolean;
69
+ }, z.core.$strip>;
70
+ export type ForcedEffect = z.infer<typeof forcedEffectInput>;
71
+ declare const crushInput: z.ZodObject<{
72
+ key: z.ZodString;
73
+ crush: z.ZodString;
74
+ decision: z.ZodString;
75
+ side: z.ZodString;
76
+ point: z.ZodNumber;
77
+ start: z.ZodNumber;
78
+ end: z.ZodNumber;
79
+ forced: z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"once">]>;
80
+ skips: z.ZodBoolean;
81
+ forcedEffect: z.ZodOptional<z.ZodObject<{
82
+ code: z.ZodString;
83
+ kind: z.ZodEnum<{
84
+ logicalAssign: "logicalAssign";
85
+ short: "short";
86
+ }>;
87
+ always: z.ZodBoolean;
88
+ }, z.core.$strip>>;
89
+ owner: z.ZodString;
90
+ code: z.ZodString;
91
+ edits: z.ZodArray<z.ZodObject<{
92
+ start: z.ZodNumber;
93
+ end: z.ZodNumber;
94
+ text: z.ZodString;
95
+ }, z.core.$strip>>;
96
+ dedents: z.ZodArray<z.ZodObject<{
97
+ start: z.ZodNumber;
98
+ end: z.ZodNumber;
99
+ by: z.ZodNumber;
100
+ }, z.core.$strip>>;
101
+ line: z.ZodNumber;
102
+ }, z.core.$strip>;
103
+ declare const unitInput: z.ZodObject<{
104
+ index: z.ZodNumber;
105
+ name: z.ZodString;
106
+ hash: z.ZodString;
107
+ }, z.core.$strip>;
108
+ export declare const planFileInput: z.ZodObject<{
109
+ path: z.ZodString;
110
+ hash: z.ZodString;
111
+ points: z.ZodArray<z.ZodObject<{
112
+ index: z.ZodNumber;
113
+ decision: z.ZodString;
114
+ kind: z.ZodString;
115
+ }, z.core.$strip>>;
116
+ switches: z.ZodArray<z.ZodObject<{
117
+ index: z.ZodNumber;
118
+ key: z.ZodString;
119
+ mutator: z.ZodString;
120
+ owner: z.ZodString;
121
+ code: z.ZodString;
122
+ replacement: z.ZodString;
123
+ start: z.ZodNumber;
124
+ line: z.ZodNumber;
125
+ }, z.core.$strip>>;
126
+ crushes: z.ZodArray<z.ZodObject<{
127
+ key: z.ZodString;
128
+ crush: z.ZodString;
129
+ decision: z.ZodString;
130
+ side: z.ZodString;
131
+ point: z.ZodNumber;
132
+ start: z.ZodNumber;
133
+ end: z.ZodNumber;
134
+ forced: z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"once">]>;
135
+ skips: z.ZodBoolean;
136
+ forcedEffect: z.ZodOptional<z.ZodObject<{
137
+ code: z.ZodString;
138
+ kind: z.ZodEnum<{
139
+ logicalAssign: "logicalAssign";
140
+ short: "short";
141
+ }>;
142
+ always: z.ZodBoolean;
143
+ }, z.core.$strip>>;
144
+ owner: z.ZodString;
145
+ code: z.ZodString;
146
+ edits: z.ZodArray<z.ZodObject<{
147
+ start: z.ZodNumber;
148
+ end: z.ZodNumber;
149
+ text: z.ZodString;
150
+ }, z.core.$strip>>;
151
+ dedents: z.ZodArray<z.ZodObject<{
152
+ start: z.ZodNumber;
153
+ end: z.ZodNumber;
154
+ by: z.ZodNumber;
155
+ }, z.core.$strip>>;
156
+ line: z.ZodNumber;
157
+ }, z.core.$strip>>;
158
+ units: z.ZodArray<z.ZodObject<{
159
+ index: z.ZodNumber;
160
+ name: z.ZodString;
161
+ hash: z.ZodString;
162
+ }, z.core.$strip>>;
163
+ left: z.ZodObject<{
164
+ excluded: z.ZodNumber;
165
+ overlap: z.ZodNumber;
166
+ }, z.core.$strip>;
167
+ }, z.core.$strip>;
168
+ declare const planTestInput: z.ZodObject<{
169
+ path: z.ZodString;
170
+ hash: z.ZodString;
171
+ metadataHash: z.ZodOptional<z.ZodString>;
172
+ units: z.ZodArray<z.ZodObject<{
173
+ index: z.ZodNumber;
174
+ name: z.ZodString;
175
+ hash: z.ZodString;
176
+ }, z.core.$strip>>;
177
+ }, z.core.$strip>;
178
+ declare const planInput: z.ZodObject<{
179
+ files: z.ZodArray<z.ZodObject<{
180
+ path: z.ZodString;
181
+ hash: z.ZodString;
182
+ points: z.ZodArray<z.ZodObject<{
183
+ index: z.ZodNumber;
184
+ decision: z.ZodString;
185
+ kind: z.ZodString;
186
+ }, z.core.$strip>>;
187
+ switches: z.ZodArray<z.ZodObject<{
188
+ index: z.ZodNumber;
189
+ key: z.ZodString;
190
+ mutator: z.ZodString;
191
+ owner: z.ZodString;
192
+ code: z.ZodString;
193
+ replacement: z.ZodString;
194
+ start: z.ZodNumber;
195
+ line: z.ZodNumber;
196
+ }, z.core.$strip>>;
197
+ crushes: z.ZodArray<z.ZodObject<{
198
+ key: z.ZodString;
199
+ crush: z.ZodString;
200
+ decision: z.ZodString;
201
+ side: z.ZodString;
202
+ point: z.ZodNumber;
203
+ start: z.ZodNumber;
204
+ end: z.ZodNumber;
205
+ forced: z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"once">]>;
206
+ skips: z.ZodBoolean;
207
+ forcedEffect: z.ZodOptional<z.ZodObject<{
208
+ code: z.ZodString;
209
+ kind: z.ZodEnum<{
210
+ logicalAssign: "logicalAssign";
211
+ short: "short";
212
+ }>;
213
+ always: z.ZodBoolean;
214
+ }, z.core.$strip>>;
215
+ owner: z.ZodString;
216
+ code: z.ZodString;
217
+ edits: z.ZodArray<z.ZodObject<{
218
+ start: z.ZodNumber;
219
+ end: z.ZodNumber;
220
+ text: z.ZodString;
221
+ }, z.core.$strip>>;
222
+ dedents: z.ZodArray<z.ZodObject<{
223
+ start: z.ZodNumber;
224
+ end: z.ZodNumber;
225
+ by: z.ZodNumber;
226
+ }, z.core.$strip>>;
227
+ line: z.ZodNumber;
228
+ }, z.core.$strip>>;
229
+ units: z.ZodArray<z.ZodObject<{
230
+ index: z.ZodNumber;
231
+ name: z.ZodString;
232
+ hash: z.ZodString;
233
+ }, z.core.$strip>>;
234
+ left: z.ZodObject<{
235
+ excluded: z.ZodNumber;
236
+ overlap: z.ZodNumber;
237
+ }, z.core.$strip>;
238
+ }, z.core.$strip>>;
239
+ tests: z.ZodArray<z.ZodObject<{
240
+ path: z.ZodString;
241
+ hash: z.ZodString;
242
+ metadataHash: z.ZodOptional<z.ZodString>;
243
+ units: z.ZodArray<z.ZodObject<{
244
+ index: z.ZodNumber;
245
+ name: z.ZodString;
246
+ hash: z.ZodString;
247
+ }, z.core.$strip>>;
248
+ }, z.core.$strip>>;
249
+ }, z.core.$strip>;
250
+ export type PointInput = z.infer<typeof pointInput>;
251
+ export type SwitchInput = z.infer<typeof switchInput>;
252
+ export type CrushInput = z.infer<typeof crushInput>;
253
+ export type UnitInput = z.infer<typeof unitInput>;
254
+ export type PlanFileInput = z.infer<typeof planFileInput>;
255
+ export type PlanTestInput = z.infer<typeof planTestInput>;
256
+ export type PlanInput = z.infer<typeof planInput>;
257
+ export {};
@@ -0,0 +1,100 @@
1
+ import { z } from 'zod';
2
+ import { mutatorNames } from '../mutators/mutator.names.js';
3
+ // The mutators left off unless a project turns them on.
4
+ export const offMutatorNames = ['ThrownCall', 'OddNumber', 'ShortIteration', 'EmptyDestructuring', 'UnboundCall', 'Disposal', 'YieldValue', 'SyncIteration', 'PrivateBrand'];
5
+ // A call or property name, or a pattern whose `*` stands for any run of characters, capped as a short name.
6
+ const namePatternInput = z.string().min(1).max(256);
7
+ // Which mutants a project's record makes: the mutators it leaves out, whether outcome mutants run, and the calls and properties whose code gets no site or crush.
8
+ export const mutationSettingsInput = z.object({
9
+ excludedMutators: z.array(z.enum(mutatorNames)).default([...offMutatorNames]),
10
+ outcomes: z.boolean().default(true),
11
+ excludedCalls: z.array(namePatternInput).default([]),
12
+ excludedProps: z.array(namePatternInput).default([]),
13
+ });
14
+ // A path the plan names, capped as a path.
15
+ const pathInput = z.string().max(2048);
16
+ // Code the plan carries, or a key built from it, which can span a whole function, so it is capped at what one source can hold.
17
+ const codeInput = z.string().max(1_048_576);
18
+ const indexInput = z.number().int().nonnegative();
19
+ // One fork counter: its index and the decision it counts the sides of.
20
+ const pointInput = z.object({
21
+ index: indexInput,
22
+ decision: codeInput,
23
+ kind: z.string().min(1).max(64),
24
+ });
25
+ // One mutator site's switch: its index, its stable key, and the code it swaps.
26
+ const switchInput = z.object({
27
+ index: indexInput,
28
+ key: codeInput,
29
+ mutator: z.string().min(1).max(64),
30
+ owner: z.string().max(256),
31
+ code: codeInput,
32
+ replacement: codeInput,
33
+ start: indexInput,
34
+ line: indexInput,
35
+ });
36
+ // One change a crush makes to the source at its original offsets.
37
+ const editInput = z.object({
38
+ start: indexInput,
39
+ end: indexInput,
40
+ text: codeInput,
41
+ });
42
+ // Lines a crush's edits leave too deep, and the columns to take off them.
43
+ const dedentInput = z.object({
44
+ start: indexInput,
45
+ end: indexInput,
46
+ by: indexInput,
47
+ });
48
+ const forcedEffectInput = z.object({
49
+ code: codeInput,
50
+ kind: z.enum(['short', 'logicalAssign']),
51
+ always: z.boolean(),
52
+ });
53
+ // One crush site, judged by forcing its decision's point, as the removal it names leaves that point.
54
+ // `once` lets a loop take at most one pass, the removal of its repeat side.
55
+ // `skips` marks a crush whose forced point is never read though reading it did work, which every test reaching the point then misses.
56
+ const crushInput = z.object({
57
+ key: codeInput,
58
+ crush: z.string().min(1).max(64),
59
+ decision: codeInput,
60
+ side: z.string().min(1).max(64),
61
+ point: indexInput,
62
+ start: indexInput,
63
+ end: indexInput,
64
+ forced: z.union([z.boolean(), z.literal('once')]),
65
+ skips: z.boolean(),
66
+ forcedEffect: forcedEffectInput.optional(),
67
+ owner: z.string().max(256),
68
+ code: codeInput,
69
+ edits: z.array(editInput),
70
+ dedents: z.array(dedentInput),
71
+ line: indexInput,
72
+ });
73
+ // One unit a verdict rests on: a file's top level, named '', or one of its functions, with the hash of its own text.
74
+ const unitInput = z.object({
75
+ index: indexInput,
76
+ name: z.string().max(256),
77
+ hash: z.string().min(1).max(128),
78
+ });
79
+ // One source file's part of the plan: the source's hash, every counter, switch and crush its instrumented code answers to, and its units.
80
+ export const planFileInput = z.object({
81
+ path: pathInput,
82
+ hash: z.string().min(1).max(128),
83
+ points: z.array(pointInput),
84
+ switches: z.array(switchInput),
85
+ crushes: z.array(crushInput),
86
+ units: z.array(unitInput),
87
+ // The sites planning left out: those the settings exclude, and those repeating another site or a crush.
88
+ left: z.object({ excluded: indexInput, overlap: indexInput }),
89
+ });
90
+ // One test file's part of the plan: its hash and its units, each test's body among them, which marks itself entered but is never mutated.
91
+ const planTestInput = z.object({
92
+ path: pathInput,
93
+ hash: z.string().min(1).max(128),
94
+ metadataHash: z.string().optional(),
95
+ units: z.array(unitInput),
96
+ });
97
+ const planInput = z.object({
98
+ files: z.array(planFileInput),
99
+ tests: z.array(planTestInput),
100
+ });
@@ -0,0 +1,86 @@
1
+ import { AsyncLocalStorage } from 'node:async_hooks';
2
+ import type { callOutcomes } from '../crush.tables.ts';
3
+ export declare const loadId = "crush:load";
4
+ type CounterState = {
5
+ forced: Map<number, boolean | 'once'>;
6
+ site: number;
7
+ current: string;
8
+ steps: number;
9
+ ticks: number;
10
+ limit: number;
11
+ isLimitHit: boolean;
12
+ lastHit: string[];
13
+ lastReach: string[];
14
+ hits: Map<number, Set<string>>;
15
+ passes: Map<number, number>;
16
+ reach: Map<number, Set<string>>;
17
+ repeats: Map<number, Set<string>>;
18
+ loaded: Set<string>;
19
+ outside: Set<string>;
20
+ entered: Set<number>;
21
+ entries: Map<number, Set<string>>;
22
+ weighed: Set<number>;
23
+ infected: Map<number, Set<string>>;
24
+ isCapturing: boolean;
25
+ calls: Call[];
26
+ counts: Map<string, number>;
27
+ open: number;
28
+ sequence: number;
29
+ epoch: number;
30
+ frames: AsyncLocalStorage<Live[]>;
31
+ metadataReaders: Set<string>;
32
+ };
33
+ type Counters = {
34
+ __t: (index: number, value: unknown) => unknown;
35
+ __n: (index: number) => boolean | undefined;
36
+ __l: (index: number, pass: number) => boolean;
37
+ __r: (index: number, entered: number) => boolean;
38
+ __s: (index: number) => boolean;
39
+ __w: (indices: number[], replacements: () => unknown[], value: unknown) => unknown;
40
+ __c: (index: number, discriminant: unknown, test: unknown) => unknown;
41
+ __d: (index: number, discriminant: unknown) => unknown;
42
+ __o: (index: number, iterable: Iterable<unknown>) => Iterable<unknown>;
43
+ __i: (index: number, object: unknown) => unknown;
44
+ __v: (index: number, value: unknown) => unknown;
45
+ __q: (index: number, object: unknown) => unknown;
46
+ __f: (index: number, callback: (...args: unknown[]) => unknown) => (this: unknown, ...args: unknown[]) => unknown;
47
+ __u: (path: string) => void;
48
+ __m: (path: string) => void;
49
+ __e: (index: number) => void;
50
+ __x: <T>(key: string, value: T) => T;
51
+ __b: <R>(key: string, args: ArrayLike<unknown>, run: () => R) => R;
52
+ };
53
+ export type Call = {
54
+ id: number;
55
+ exportKey: string;
56
+ test: string;
57
+ parent: number | null;
58
+ depth: number;
59
+ args: unknown[];
60
+ outcome: (typeof callOutcomes)[number];
61
+ result: unknown;
62
+ stack: string;
63
+ path: [number, number, number][];
64
+ isPathCut: boolean;
65
+ };
66
+ type Live = {
67
+ call: Call;
68
+ isSettled: boolean;
69
+ epoch: number;
70
+ };
71
+ export declare const stateOf: () => CounterState;
72
+ export declare const classSourcePattern: RegExp;
73
+ export declare const callLimit = 64;
74
+ export declare const pathLimit = 1024;
75
+ export declare const stepLimitFactor = 10;
76
+ export declare const stepLimitFloor = 1000;
77
+ export declare const stepLimitOf: (ticks: number) => number;
78
+ export declare const limitedRun: <T>(state: CounterState, limit: number, call: () => T) => T;
79
+ export declare const clearedCalls: (state: CounterState) => void;
80
+ export declare const setObservations: (state: CounterState, hits?: CounterState['hits'], reach?: CounterState['reach']) => void;
81
+ export declare const countersOf: (state: CounterState) => Counters;
82
+ export declare const state: CounterState;
83
+ export declare const __j: (entries: readonly unknown[]) => readonly unknown[];
84
+ export declare const isLiteralJustification: (entries: object) => boolean;
85
+ export declare const __t: (index: number, value: unknown) => unknown, __n: (index: number) => boolean | undefined, __l: (index: number, pass: number) => boolean, __r: (index: number, entered: number) => boolean, __s: (index: number) => boolean, __w: (indices: number[], replacements: () => unknown[], value: unknown) => unknown, __c: (index: number, discriminant: unknown, test: unknown) => unknown, __d: (index: number, discriminant: unknown) => unknown, __o: (index: number, iterable: Iterable<unknown>) => Iterable<unknown>, __i: (index: number, object: unknown) => unknown, __v: (index: number, value: unknown) => unknown, __q: (index: number, object: unknown) => unknown, __f: (index: number, callback: (...args: unknown[]) => unknown) => (this: unknown, ...args: unknown[]) => unknown, __u: (path: string) => void, __m: (path: string) => void, __e: (index: number) => void, __x: <T>(key: string, value: T) => T, __b: <R>(key: string, args: ArrayLike<unknown>, run: () => R) => R;
86
+ export {};