@whaaaley/crush 0.0.0-stage → 0.2.6
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.
- package/LICENSE +32 -0
- package/README.md +185 -2
- package/SKILL.md +187 -0
- package/THIRD_PARTY_NOTICES.md +277 -0
- package/dist/capture/capture.operations.d.ts +23 -0
- package/dist/capture/capture.operations.js +231 -0
- package/dist/capture/capture.schema.d.ts +73 -0
- package/dist/capture/capture.schema.js +28 -0
- package/dist/collapse/collapse.operations.d.ts +2 -0
- package/dist/collapse/collapse.operations.js +82 -0
- package/dist/collapse/collapse.schema.d.ts +40 -0
- package/dist/collapse/collapse.schema.js +35 -0
- package/dist/crush.tables.d.ts +3583 -0
- package/dist/crush.tables.js +456 -0
- package/dist/crushes/callback.crush.d.ts +2 -0
- package/dist/crushes/callback.crush.js +19 -0
- package/dist/crushes/crush.d.ts +36 -0
- package/dist/crushes/crush.js +12 -0
- package/dist/crushes/crush.names.d.ts +1 -0
- package/dist/crushes/crush.names.js +2 -0
- package/dist/crushes/crushes.d.ts +2 -0
- package/dist/crushes/crushes.js +9 -0
- package/dist/crushes/default-value.crush.d.ts +2 -0
- package/dist/crushes/default-value.crush.js +29 -0
- package/dist/crushes/drop-operand.crush.d.ts +2 -0
- package/dist/crushes/drop-operand.crush.js +37 -0
- package/dist/crushes/fold.d.ts +64 -0
- package/dist/crushes/fold.js +366 -0
- package/dist/crushes/force-fork.crush.d.ts +2 -0
- package/dist/crushes/force-fork.crush.js +79 -0
- package/dist/crushes/loop-once.crush.d.ts +2 -0
- package/dist/crushes/loop-once.crush.js +71 -0
- package/dist/crushes/optional-chain.crush.d.ts +2 -0
- package/dist/crushes/optional-chain.crush.js +30 -0
- package/dist/crushes/switch-case.crush.d.ts +2 -0
- package/dist/crushes/switch-case.crush.js +19 -0
- package/dist/decisions/decide.d.ts +61 -0
- package/dist/decisions/decide.js +161 -0
- package/dist/decisions/decisions.d.ts +24 -0
- package/dist/decisions/decisions.js +62 -0
- package/dist/decisions/forks.decision.d.ts +4 -0
- package/dist/decisions/forks.decision.js +32 -0
- package/dist/decisions/kinds.d.ts +101 -0
- package/dist/decisions/kinds.js +38 -0
- package/dist/decisions/loops.decision.d.ts +4 -0
- package/dist/decisions/loops.decision.js +39 -0
- package/dist/decisions/shorts.decision.d.ts +3 -0
- package/dist/decisions/shorts.decision.js +66 -0
- package/dist/decisions/switches.decision.d.ts +3 -0
- package/dist/decisions/switches.decision.js +20 -0
- package/dist/decisions/throws.decision.d.ts +3 -0
- package/dist/decisions/throws.decision.js +35 -0
- package/dist/decisions/values.decision.d.ts +3 -0
- package/dist/decisions/values.decision.js +67 -0
- package/dist/explore/edges/explore.d.ts +60 -0
- package/dist/explore/edges/explore.db.d.ts +22 -0
- package/dist/explore/edges/explore.db.js +55 -0
- package/dist/explore/edges/explore.js +305 -0
- package/dist/explore/edges/random.d.ts +2 -0
- package/dist/explore/edges/random.js +32 -0
- package/dist/explore/explore.operations.d.ts +30 -0
- package/dist/explore/explore.operations.js +117 -0
- package/dist/explore/limits.operations.d.ts +14 -0
- package/dist/explore/limits.operations.js +20 -0
- package/dist/explore/targets.operations.d.ts +36 -0
- package/dist/explore/targets.operations.js +32 -0
- package/dist/explore/utils/draws.d.ts +6 -0
- package/dist/explore/utils/draws.js +2 -0
- package/dist/explore/utils/edits.d.ts +15 -0
- package/dist/explore/utils/edits.js +151 -0
- package/dist/explore/utils/guide.d.ts +23 -0
- package/dist/explore/utils/guide.js +35 -0
- package/dist/explore/utils/keep.d.ts +10 -0
- package/dist/explore/utils/keep.js +61 -0
- package/dist/explore/utils/pools.d.ts +17 -0
- package/dist/explore/utils/pools.js +121 -0
- package/dist/explore/utils/reads.d.ts +19 -0
- package/dist/explore/utils/reads.js +118 -0
- package/dist/explore/utils/twin.d.ts +21 -0
- package/dist/explore/utils/twin.js +55 -0
- package/dist/forks/forks.operations.d.ts +32 -0
- package/dist/forks/forks.operations.js +134 -0
- package/dist/forks/forks.schema.d.ts +20 -0
- package/dist/forks/forks.schema.js +14 -0
- package/dist/graph/cfg/cfg.d.ts +28 -0
- package/dist/graph/cfg/cfg.js +31 -0
- package/dist/graph/cfg/code-paths/analyzer.d.ts +27 -0
- package/dist/graph/cfg/code-paths/analyzer.js +358 -0
- package/dist/graph/cfg/code-paths/segments.d.ts +44 -0
- package/dist/graph/cfg/code-paths/segments.js +105 -0
- package/dist/graph/cfg/code-paths/state.d.ts +121 -0
- package/dist/graph/cfg/code-paths/state.js +611 -0
- package/dist/graph/cfg/entries.d.ts +13 -0
- package/dist/graph/cfg/entries.js +120 -0
- package/dist/graph/cfg/functions.d.ts +6 -0
- package/dist/graph/cfg/functions.js +47 -0
- package/dist/graph/cfg/paths.d.ts +27 -0
- package/dist/graph/cfg/paths.js +91 -0
- package/dist/graph/cfg/scopes/scopes.d.ts +40 -0
- package/dist/graph/cfg/scopes/scopes.js +375 -0
- package/dist/graph/symbols/file.d.ts +90 -0
- package/dist/graph/symbols/file.js +427 -0
- package/dist/graph/symbols/keys.d.ts +13 -0
- package/dist/graph/symbols/keys.js +22 -0
- package/dist/graph/symbols/resolve.operations.d.ts +4 -0
- package/dist/graph/symbols/resolve.operations.js +33 -0
- package/dist/graph/symbols/symbols.d.ts +12 -0
- package/dist/graph/symbols/symbols.js +155 -0
- package/dist/graph/symbols/symbols.schema.d.ts +32 -0
- package/dist/graph/symbols/symbols.schema.js +19 -0
- package/dist/graph/unused/tests.d.ts +7 -0
- package/dist/graph/unused/tests.js +95 -0
- package/dist/graph/unused/unused.d.ts +53 -0
- package/dist/graph/unused/unused.js +319 -0
- package/dist/graph/walk/walk.d.ts +7 -0
- package/dist/graph/walk/walk.js +39 -0
- package/dist/instrument/instrument.operations.d.ts +72 -0
- package/dist/instrument/instrument.operations.js +786 -0
- package/dist/instrument/instrument.schema.d.ts +257 -0
- package/dist/instrument/instrument.schema.js +100 -0
- package/dist/judge/counters.d.ts +86 -0
- package/dist/judge/counters.js +402 -0
- package/dist/judge/edges/api.d.ts +14 -0
- package/dist/judge/edges/api.js +80 -0
- package/dist/judge/edges/completion.reporter.d.ts +9 -0
- package/dist/judge/edges/completion.reporter.js +51 -0
- package/dist/judge/edges/hints.reporter.d.ts +13 -0
- package/dist/judge/edges/hints.reporter.js +29 -0
- package/dist/judge/edges/judge.edges.d.ts +52 -0
- package/dist/judge/edges/judge.edges.js +59 -0
- package/dist/judge/edges/judge.fs.d.ts +8 -0
- package/dist/judge/edges/judge.fs.js +45 -0
- package/dist/judge/edges/merge.d.ts +11 -0
- package/dist/judge/edges/merge.js +60 -0
- package/dist/judge/edges/plugin.d.ts +132 -0
- package/dist/judge/edges/plugin.js +441 -0
- package/dist/judge/edges/reach.d.ts +68 -0
- package/dist/judge/edges/reach.js +132 -0
- package/dist/judge/edges/speed.d.ts +32 -0
- package/dist/judge/edges/speed.js +34 -0
- package/dist/judge/edges/strays.d.ts +1 -0
- package/dist/judge/edges/strays.js +14 -0
- package/dist/judge/edges/vitest.d.ts +20 -0
- package/dist/judge/edges/vitest.js +36 -0
- package/dist/judge/edges/vitest.schema.d.ts +14 -0
- package/dist/judge/edges/vitest.schema.js +16 -0
- package/dist/judge/explore.test.d.ts +1 -0
- package/dist/judge/explore.test.js +101 -0
- package/dist/judge/hints.d.ts +11 -0
- package/dist/judge/hints.js +44 -0
- package/dist/judge/judge.operations.d.ts +218 -0
- package/dist/judge/judge.operations.js +464 -0
- package/dist/judge/judge.schema.d.ts +135 -0
- package/dist/judge/judge.schema.js +129 -0
- package/dist/judge/judge.shard-1.test.d.ts +1 -0
- package/dist/judge/judge.shard-1.test.js +3 -0
- package/dist/judge/judge.shard-2.test.d.ts +1 -0
- package/dist/judge/judge.shard-2.test.js +3 -0
- package/dist/judge/judge.test.d.ts +1 -0
- package/dist/judge/judge.test.js +3 -0
- package/dist/judge/refusals.d.ts +14 -0
- package/dist/judge/refusals.js +10 -0
- package/dist/judge/report.test.d.ts +1 -0
- package/dist/judge/report.test.js +432 -0
- package/dist/judge/runner.d.ts +3 -0
- package/dist/judge/runner.js +1602 -0
- package/dist/judge/stresses.test.d.ts +1 -0
- package/dist/judge/stresses.test.js +12 -0
- package/dist/judge/task-meta.d.ts +51 -0
- package/dist/judge/task-meta.js +3 -0
- package/dist/justify/edges/load.d.ts +7 -0
- package/dist/justify/edges/load.js +40 -0
- package/dist/justify/edges/refresh.fs.d.ts +8 -0
- package/dist/justify/edges/refresh.fs.js +15 -0
- package/dist/justify/justify.operations.d.ts +46 -0
- package/dist/justify/justify.operations.js +80 -0
- package/dist/justify/justify.schema.d.ts +21 -0
- package/dist/justify/justify.schema.js +11 -0
- package/dist/mutators/arithmetic-operator.mutator.d.ts +2 -0
- package/dist/mutators/arithmetic-operator.mutator.js +22 -0
- package/dist/mutators/array-declaration.mutator.d.ts +2 -0
- package/dist/mutators/array-declaration.mutator.js +12 -0
- package/dist/mutators/arrow-function.mutator.d.ts +2 -0
- package/dist/mutators/arrow-function.mutator.js +10 -0
- package/dist/mutators/assignment-operator.mutator.d.ts +2 -0
- package/dist/mutators/assignment-operator.mutator.js +29 -0
- package/dist/mutators/await-expression.mutator.d.ts +2 -0
- package/dist/mutators/await-expression.mutator.js +7 -0
- package/dist/mutators/bitwise-operator.mutator.d.ts +2 -0
- package/dist/mutators/bitwise-operator.mutator.js +19 -0
- package/dist/mutators/block-statement.mutator.d.ts +2 -0
- package/dist/mutators/block-statement.mutator.js +30 -0
- package/dist/mutators/boolean-literal.mutator.d.ts +2 -0
- package/dist/mutators/boolean-literal.mutator.js +5 -0
- package/dist/mutators/coercion.mutator.d.ts +2 -0
- package/dist/mutators/coercion.mutator.js +28 -0
- package/dist/mutators/conditional-expression.mutator.d.ts +2 -0
- package/dist/mutators/conditional-expression.mutator.js +36 -0
- package/dist/mutators/disposal.mutator.d.ts +2 -0
- package/dist/mutators/disposal.mutator.js +13 -0
- package/dist/mutators/empty-destructuring.mutator.d.ts +2 -0
- package/dist/mutators/empty-destructuring.mutator.js +35 -0
- package/dist/mutators/empty-return.mutator.d.ts +2 -0
- package/dist/mutators/empty-return.mutator.js +35 -0
- package/dist/mutators/equality-operator.mutator.d.ts +2 -0
- package/dist/mutators/equality-operator.mutator.js +16 -0
- package/dist/mutators/loop-exit.mutator.d.ts +2 -0
- package/dist/mutators/loop-exit.mutator.js +5 -0
- package/dist/mutators/method-expression.mutator.d.ts +2 -0
- package/dist/mutators/method-expression.mutator.js +59 -0
- package/dist/mutators/missing-lookup.mutator.d.ts +2 -0
- package/dist/mutators/missing-lookup.mutator.js +25 -0
- package/dist/mutators/mutator.d.ts +40 -0
- package/dist/mutators/mutator.js +49 -0
- package/dist/mutators/mutator.names.d.ts +3 -0
- package/dist/mutators/mutator.names.js +43 -0
- package/dist/mutators/mutators.d.ts +8 -0
- package/dist/mutators/mutators.js +84 -0
- package/dist/mutators/nested-condition.mutator.d.ts +2 -0
- package/dist/mutators/nested-condition.mutator.js +16 -0
- package/dist/mutators/number-literal.mutator.d.ts +3 -0
- package/dist/mutators/number-literal.mutator.js +13 -0
- package/dist/mutators/object-literal.mutator.d.ts +2 -0
- package/dist/mutators/object-literal.mutator.js +6 -0
- package/dist/mutators/odd-number.mutator.d.ts +2 -0
- package/dist/mutators/odd-number.mutator.js +15 -0
- package/dist/mutators/operand-deletion.mutator.d.ts +2 -0
- package/dist/mutators/operand-deletion.mutator.js +9 -0
- package/dist/mutators/outcome.mutator.d.ts +3 -0
- package/dist/mutators/outcome.mutator.js +45 -0
- package/dist/mutators/plain-assignment.mutator.d.ts +2 -0
- package/dist/mutators/plain-assignment.mutator.js +7 -0
- package/dist/mutators/power-operator.mutator.d.ts +2 -0
- package/dist/mutators/power-operator.mutator.js +13 -0
- package/dist/mutators/private-brand.mutator.d.ts +2 -0
- package/dist/mutators/private-brand.mutator.js +7 -0
- package/dist/mutators/regex.mutator.d.ts +2 -0
- package/dist/mutators/regex.mutator.js +29 -0
- package/dist/mutators/short-iteration.mutator.d.ts +2 -0
- package/dist/mutators/short-iteration.mutator.js +8 -0
- package/dist/mutators/string-literal.mutator.d.ts +3 -0
- package/dist/mutators/string-literal.mutator.js +149 -0
- package/dist/mutators/switch-default.mutator.d.ts +2 -0
- package/dist/mutators/switch-default.mutator.js +13 -0
- package/dist/mutators/sync-iteration.mutator.d.ts +3 -0
- package/dist/mutators/sync-iteration.mutator.js +9 -0
- package/dist/mutators/thrown-call.mutator.d.ts +2 -0
- package/dist/mutators/thrown-call.mutator.js +7 -0
- package/dist/mutators/unary-operator.mutator.d.ts +2 -0
- package/dist/mutators/unary-operator.mutator.js +18 -0
- package/dist/mutators/unbound-call.mutator.d.ts +2 -0
- package/dist/mutators/unbound-call.mutator.js +14 -0
- package/dist/mutators/update-operator.mutator.d.ts +2 -0
- package/dist/mutators/update-operator.mutator.js +15 -0
- package/dist/mutators/yield-value.mutator.d.ts +2 -0
- package/dist/mutators/yield-value.mutator.js +7 -0
- package/dist/parity/compare.d.ts +27 -0
- package/dist/parity/compare.js +26 -0
- package/dist/parity/corpus.parity.d.ts +1 -0
- package/dist/parity/corpus.parity.js +97 -0
- package/dist/parity/edges/corpus.fs.d.ts +3 -0
- package/dist/parity/edges/corpus.fs.js +30 -0
- package/dist/parity/edges/ports.d.ts +2 -0
- package/dist/parity/edges/ports.js +21 -0
- package/dist/parity/edges/vitest.d.ts +2 -0
- package/dist/parity/edges/vitest.js +3 -0
- package/dist/parity/parity.operations.d.ts +33 -0
- package/dist/parity/parity.operations.js +60 -0
- package/dist/parity/parity.schema.d.ts +5 -0
- package/dist/parity/parity.schema.js +6 -0
- package/dist/parity/stryker/compare.d.ts +14 -0
- package/dist/parity/stryker/compare.js +52 -0
- package/dist/parity/stryker/edges/ports.d.ts +12 -0
- package/dist/parity/stryker/edges/ports.js +28 -0
- package/dist/parity/stryker/equivalence.d.ts +1 -0
- package/dist/parity/stryker/equivalence.js +42 -0
- package/dist/parity/stryker/intended.d.ts +29 -0
- package/dist/parity/stryker/intended.js +152 -0
- package/dist/parity/stryker/normalize.d.ts +27 -0
- package/dist/parity/stryker/normalize.js +181 -0
- package/dist/parity/stryker/rules.d.ts +6 -0
- package/dist/parity/stryker/rules.js +116 -0
- package/dist/parity/stryker/sides.d.ts +46 -0
- package/dist/parity/stryker/sides.js +199 -0
- package/dist/parity/stryker/stryker.parity.d.ts +1 -0
- package/dist/parity/stryker/stryker.parity.js +147 -0
- package/dist/parity/stryker/stryker.schema.d.ts +6 -0
- package/dist/parity/stryker/stryker.schema.js +7 -0
- package/dist/parity/views.d.ts +21 -0
- package/dist/parity/views.js +119 -0
- package/dist/questions/questions.operations.d.ts +110 -0
- package/dist/questions/questions.operations.js +446 -0
- package/dist/questions/questions.schema.d.ts +57 -0
- package/dist/questions/questions.schema.js +28 -0
- package/dist/record/edges/calls.db.d.ts +10 -0
- package/dist/record/edges/calls.db.js +91 -0
- package/dist/record/edges/hits.db.d.ts +3 -0
- package/dist/record/edges/hits.db.js +5 -0
- package/dist/record/edges/holds.db.d.ts +4 -0
- package/dist/record/edges/holds.db.js +31 -0
- package/dist/record/edges/judged-state.db.d.ts +5 -0
- package/dist/record/edges/judged-state.db.js +25 -0
- package/dist/record/edges/markers.db.d.ts +11 -0
- package/dist/record/edges/markers.db.js +55 -0
- package/dist/record/edges/merge.db.d.ts +7 -0
- package/dist/record/edges/merge.db.js +46 -0
- package/dist/record/edges/parts.db.d.ts +42 -0
- package/dist/record/edges/parts.db.js +389 -0
- package/dist/record/edges/parts.edges.d.ts +2 -0
- package/dist/record/edges/parts.edges.js +7 -0
- package/dist/record/edges/parts.fs.d.ts +1 -0
- package/dist/record/edges/parts.fs.js +11 -0
- package/dist/record/edges/parts.writer.d.ts +1 -0
- package/dist/record/edges/parts.writer.js +85 -0
- package/dist/record/edges/passes.db.d.ts +19 -0
- package/dist/record/edges/passes.db.js +31 -0
- package/dist/record/edges/plan.db.d.ts +21 -0
- package/dist/record/edges/plan.db.js +174 -0
- package/dist/record/edges/reach.db.d.ts +6 -0
- package/dist/record/edges/reach.db.js +62 -0
- package/dist/record/edges/record.db.d.ts +22 -0
- package/dist/record/edges/record.db.js +176 -0
- package/dist/record/edges/record.fs.d.ts +3 -0
- package/dist/record/edges/record.fs.js +7 -0
- package/dist/record/edges/site-verdicts.db.d.ts +11 -0
- package/dist/record/edges/site-verdicts.db.js +66 -0
- package/dist/record/edges/verified.db.d.ts +7 -0
- package/dist/record/edges/verified.db.js +71 -0
- package/dist/record/parts.operations.d.ts +26 -0
- package/dist/record/parts.operations.js +31 -0
- package/dist/record/path-checks.operations.d.ts +15 -0
- package/dist/record/path-checks.operations.js +84 -0
- package/dist/record/record.operations.d.ts +36 -0
- package/dist/record/record.operations.js +11 -0
- package/dist/stresses/edges/stresses.record.d.ts +4 -0
- package/dist/stresses/edges/stresses.record.js +37 -0
- package/dist/stresses/stresses.operations.d.ts +28 -0
- package/dist/stresses/stresses.operations.js +22 -0
- package/dist/utils/ast.d.ts +55 -0
- package/dist/utils/ast.js +181 -0
- package/dist/utils/errors.d.ts +8 -0
- package/dist/utils/errors.js +12 -0
- package/dist/utils/faults.d.ts +6 -0
- package/dist/utils/faults.js +10 -0
- package/dist/utils/lookup.d.ts +4 -0
- package/dist/utils/lookup.js +27 -0
- package/dist/utils/order.d.ts +2 -0
- package/dist/utils/order.js +17 -0
- package/dist/utils/retry.d.ts +14 -0
- package/dist/utils/retry.js +15 -0
- package/dist/utils/safe.d.ts +11 -0
- package/dist/utils/safe.js +31 -0
- package/migrations/main/20261129123324_initial/migration.sql +418 -0
- package/migrations/main/20261129123324_initial/snapshot.json +3641 -0
- package/package.json +89 -4
- package/references/consumer-setup.md +92 -0
- package/src/graph/cfg/code-paths/LICENSE +21 -0
- package/src/graph/cfg/scopes/LICENSE +24 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
(MIT)
|
|
2
|
+
|
|
3
|
+
Original code Copyright (c) 2026 Dustin Dowell
|
|
4
|
+
|
|
5
|
+
ESLint code-path analysis, ported in src/graph/cfg/code-paths/, Copyright OpenJS
|
|
6
|
+
Foundation and other contributors, <www.openjsf.org>
|
|
7
|
+
|
|
8
|
+
eslint-scope referencer, ported in src/graph/cfg/scopes/ under the BSD 2-Clause
|
|
9
|
+
License, Copyright JS Foundation and other contributors, https://js.foundation,
|
|
10
|
+
and Copyright (C) 2012-2013 Yusuke Suzuki and other contributors
|
|
11
|
+
|
|
12
|
+
Portions translated from StrykerJS's mutators, in src/mutators/, are licensed
|
|
13
|
+
under the Apache License, Version 2.0. Their notices and the full license texts
|
|
14
|
+
are in THIRD_PARTY_NOTICES.md.
|
|
15
|
+
|
|
16
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
17
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
18
|
+
the Software without restriction, including without limitation the rights to
|
|
19
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
20
|
+
of the Software, and to permit persons to whom the Software is furnished to do
|
|
21
|
+
so, subject to the following conditions:
|
|
22
|
+
|
|
23
|
+
The above copyright notice and this permission notice shall be included in all
|
|
24
|
+
copies or substantial portions of the Software.
|
|
25
|
+
|
|
26
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
27
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
28
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
29
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
30
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
31
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
32
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,186 @@
|
|
|
1
|
-
#
|
|
1
|
+
# crush
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://github.com/whaaaley/crush/actions/workflows/release.yaml)
|
|
4
|
+
[](https://www.npmjs.com/package/@whaaaley/crush)
|
|
5
|
+
[](https://jsr.io/@whaaaley/crush)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
|
|
8
|
+
crush is a mutation engine for TypeScript, built for agent loops: every piece of code stands only while a test holds it up, and every doubtful piece becomes a question an agent answers with a test, simpler code or a justification.
|
|
9
|
+
It's a Vite plugin with Vitest projects: you add its projects to your `vite.config.ts`, its plugin instruments your sources as Vite transforms them, and its commands are plain `vp test` runs of your own tests.
|
|
10
|
+
In crush's own repository, `package.json` defines the tasks and `vite.config.ts` the lint, format and test settings and the Vitest projects each command runs.
|
|
11
|
+
Separate docs cover [the entries a project declares](docs/entries.md), [the stresses a report counts](docs/stresses.md), and [parity with ESLint and StrykerJS](docs/parity.md), and [SKILL.md](SKILL.md) covers answering a report.
|
|
12
|
+
|
|
13
|
+
## Background
|
|
14
|
+
|
|
15
|
+
It runs on Node and Vitest through Vite+, parsing with oxc and keeping its record in SQLite through Drizzle.
|
|
16
|
+
|
|
17
|
+
- It builds each file's control-flow graph from ESLint's code paths over oxc's tree, and a dependency graph of the whole project's files, exports, bindings and functions, joined by the loads, reads and calls between them.
|
|
18
|
+
- It finds every place the code can go more than one way, from the decision kinds in `src/decisions/`.
|
|
19
|
+
- It removes one side of a decision at a time with the crushes in `src/crushes/`, and changes one value at a time with the mutators in `src/mutators/`.
|
|
20
|
+
- It collapses the graph with `src/collapse/`, where a crush site stands only while some case runs its side and fails without it.
|
|
21
|
+
- It asks one question per open item, each named by a stable id that holds its kind, file, function and code, never a line, built in `src/questions/`.
|
|
22
|
+
- It keeps what only a run can know in `.crush/record.db`, whose tables `src/crush.tables.ts` defines, and deletes and rebuilds a record of another version, since every row can be recorded again.
|
|
23
|
+
|
|
24
|
+
## Install
|
|
25
|
+
|
|
26
|
+
You need Node, Vite+ (`vp`) and a project under git, whose tests run in Vitest.
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
npm install --save-dev @whaaaley/crush
|
|
30
|
+
jsr add --dev @whaaaley/crush
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
crush uses your project's own `vite-plus`, which it names as a peer dependency, so its tests and yours register with one Vitest.
|
|
34
|
+
Add crush's projects to your `vite.config.ts`, importing them from `@whaaaley/crush`, and its tasks to your `package.json`, with `--reporter @whaaaley/crush/reporter`, as [references/consumer-setup.md](references/consumer-setup.md) shows.
|
|
35
|
+
|
|
36
|
+
## Usage
|
|
37
|
+
|
|
38
|
+
Run each from the root of the project crush is set up in, waiting for one to finish before the next.
|
|
39
|
+
|
|
40
|
+
- `vp run record` saves the baseline.
|
|
41
|
+
- `vp run record:related <paths>` records only the test files those paths reach, keeping the rest of the record.
|
|
42
|
+
- `vp run judge` judges the mutations and verifies the removals, stopping at each mutation's first catching test.
|
|
43
|
+
- `vp run judge:related <paths>` judges only the sites those paths reach.
|
|
44
|
+
- `vp run judge:redundant` judges as `vp run judge` does, then reruns the other tests of each catch to find a second catcher, which is what shows a test redundant and asks whether it can go.
|
|
45
|
+
- `vp run questions` lists the open questions.
|
|
46
|
+
- `vp run questions:related <paths>` lists only the questions of the sources those paths reach.
|
|
47
|
+
- `vp run explore` searches a property for inputs that break it, seeded from the record. Explore is experimental in 0.1: its findings can change between releases, and it may move to a plugin of its own.
|
|
48
|
+
- `vp run explore:related <paths>` searches only the exports those paths reach.
|
|
49
|
+
- `vp run stresses` prints how many tests each mutator and the crushes drive.
|
|
50
|
+
|
|
51
|
+
A question no test can answer takes an inline literal `meta: { justifies: [{ id, basis, reason }] }` on the function's `describe` in its test file:
|
|
52
|
+
|
|
53
|
+
1. Put the reported id in the final array slot with the basis `refresh`, and write why no input can answer the question.
|
|
54
|
+
2. Run `vp run questions`, which writes the current basis in place of `refresh` and accepts the entry.
|
|
55
|
+
|
|
56
|
+
A justification whose code moves is reported apart from new questions; setting its basis to `refresh` again accepts it once its reason still holds.
|
|
57
|
+
|
|
58
|
+
The answer stands while its position, source and the code read by its verdicts stay the same, and a justified crush is never collapsed.
|
|
59
|
+
|
|
60
|
+
### What each command prints last
|
|
61
|
+
|
|
62
|
+
Record, judge, questions and explore end with a blank line, then a `hint:` line, a `skill:` line, one or more `don't:` lines and a `next:` line, which names one command to run as printed.
|
|
63
|
+
Stresses prints none, since its output is the work.
|
|
64
|
+
A related run names the related task, as `vp run judge:related <paths>` after `vp run record:related <paths>`.
|
|
65
|
+
|
|
66
|
+
| Command and state | `next:` names |
|
|
67
|
+
| ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
|
|
68
|
+
| record, a test failed | fixing each failing test, then `vp run record` again |
|
|
69
|
+
| record, passed | `vp run judge` |
|
|
70
|
+
| judge, a test failed | fixing each failure, then `vp run judge` again |
|
|
71
|
+
| judge, passed | `vp run questions` |
|
|
72
|
+
| explore | `vp run questions` |
|
|
73
|
+
| questions, some open | answering the first open question, in its file, then `vp run record:related <file>`, `vp run judge:related <file>` and `vp run questions` |
|
|
74
|
+
| questions, open, no file | answering them from the top, then `vp run record`, `vp run judge` and `vp run questions` |
|
|
75
|
+
| questions, none open, failed | fixing each failure printed, then `vp run questions` again |
|
|
76
|
+
| questions, none open, passed | done, and `vp run judge:redundant` |
|
|
77
|
+
|
|
78
|
+
The questions hint names asking the user, with the question's id and both readings, when the code's intent is unknown, and a `don't:` line says not to stop at such a question but to note it for the user and take the next.
|
|
79
|
+
|
|
80
|
+
### Explore and mutation
|
|
81
|
+
|
|
82
|
+
Judging checks whether your tests notice a change to your code: a mutant no test catches, or a branch no test needs, becomes a question.
|
|
83
|
+
It can't find a bug the code and its tests agree on, as an input no test passes that the code gets wrong.
|
|
84
|
+
Explore looks for those, with inputs generated from the calls your tests made, in two ways:
|
|
85
|
+
|
|
86
|
+
- **Exports:** it calls each export with generated inputs, and a throw from a place no test covers becomes a question.
|
|
87
|
+
- **Properties:** it calls a property, and each input it fails becomes a question. A property is an exported function in a test file that returns `'passed'`, `'discarded'` or `'failed'` for an input, a throw counting as failed, such as "decoding what was encoded gives back the input". A Vitest test names it in `meta: { explores }`.
|
|
88
|
+
|
|
89
|
+
Properties pay off mostly for parsers, encoders and state machines, so judging alone is enough for most code.
|
|
90
|
+
|
|
91
|
+
## Why
|
|
92
|
+
|
|
93
|
+
A mutation score says how many mutants survived, but not what to do about each one.
|
|
94
|
+
crush turns every doubtful piece of code into one question, named by an id that survives edits, and an agent answers it with a test, simpler code or a justification that stays answered until the code under it moves.
|
|
95
|
+
It removes whole branches as well as changing values, so it finds code no test needs, not only values no test checks.
|
|
96
|
+
It runs inside Vitest as plain `vp test` runs of your own tests, with no separate runner, so judging sees the same setup, aliases and plugins your tests do.
|
|
97
|
+
|
|
98
|
+
## Tested on
|
|
99
|
+
|
|
100
|
+
crush is built and tested on Node 26.13.0 and Vite+ 1.7 with its bundled Vitest.
|
|
101
|
+
Its ports are checked for parity against ESLint and StrykerJS over this corpus, and hono and zod are the projects its record and judge are timed on:
|
|
102
|
+
|
|
103
|
+
- ESLint v10.15.0, Vite v8.3.8, TypeScript v5.6.3, Babel v7.25.7, Acorn 8.12.1, Prettier 3.3.3 and Vue core v3.5.45
|
|
104
|
+
- hono v4.13.19, Svelte 5.58.0, date-fns v4.4.0, zod v4.6.7, TanStack Query core 5.108.1 and Astro 7.4.13
|
|
105
|
+
- redux-saga 1.3.0, NestJS v10.4.4, TypeORM 0.3.20, RxJS 7.8.1, type-fest v4.26.1, Preact 10.24.2 and Excalidraw v0.17.0
|
|
106
|
+
- three.js r168, Jest v29.7.0, Vitest v5.1.1, babel-plugin-jsx v3.0.0, Deno v2.9.8, swc v1.16.22, Tailwind CSS v4.3.3 and cva v0.7.1
|
|
107
|
+
|
|
108
|
+
## Speed
|
|
109
|
+
|
|
110
|
+
<img src="https://raw.githubusercontent.com/whaaaley/crush-bench/14f8a0c/results.svg" width="100%" alt="Whole run per project, crush compared with StrykerJS">
|
|
111
|
+
|
|
112
|
+
[crush-bench](https://github.com/whaaaley/crush-bench) times crush against StrykerJS 10.1.1 over the same sources and the same test file, each tool's whole run three times in fresh processes, the fastest counting.
|
|
113
|
+
crush's run is a record then a judge; StrykerJS's is `stryker run` with its Vitest runner and per-test coverage.
|
|
114
|
+
The chart names the date, the crush commit, the Node version and the machine it was measured on, and crush-bench's README says how each workload is set up.
|
|
115
|
+
|
|
116
|
+
The two tools judge different changes, crush removing branches as well as changing values, so the figures compare whole runs, not the cost of each change.
|
|
117
|
+
|
|
118
|
+
## Known limits
|
|
119
|
+
|
|
120
|
+
crush can judge some code wrong, or not at all, in these cases:
|
|
121
|
+
|
|
122
|
+
- **Module state between reruns:** a mutant's rerun can leave module state a later test reads, so a later site can read survived where a fresh load would catch it.
|
|
123
|
+
- **Tests that leak globals:** a project's test files share one process per run with no isolation between files, so a test that sets a global and never restores it, as hono's `global.fetch` mock does, can change later files' verdicts.
|
|
124
|
+
- **Unsteady tests:** a test whose work differs between runs with nothing forced, as one deciding with `Math.random`, gives verdicts that can differ between judges; crush marks it unsteady and asks about its steps.
|
|
125
|
+
- **Generators:** an exported generator expression is captured by its arguments alone, since its body runs as the caller iterates, so explore seeds from its calls but the path checks never see them; an exported generator declaration isn't captured at all.
|
|
126
|
+
- **Captured async exports:** reading an async export's result attaches a handler, so in crush's baseline a rejection the test leaves unhandled isn't reported; the project's own `vp test` still reports it.
|
|
127
|
+
- **Explore is experimental:** its search, its findings and how it reports them may change, and nothing should gate on its output yet.
|
|
128
|
+
- **ES modules only:** every file but a `.cjs` one is read as an ES module, as ESLint does, and CommonJS isn't supported.
|
|
129
|
+
|
|
130
|
+
## Project structure
|
|
131
|
+
|
|
132
|
+
- `src/`: The engine, one folder per stage: `decisions/`, `crushes/`, `mutators/`, `graph/`, `collapse/`, `capture/`, `instrument/`, `record/`, `judge/`, `questions/`, `justify/`, `forks/`, `stresses/`, `explore/` and `parity/`, with shared helpers in `utils/`.
|
|
133
|
+
- `docs/` and `references/`: The docs this README links and the consumer setup `SKILL.md` points to.
|
|
134
|
+
- `scripts/`: The CI scripts the workflows run, and `check`, the format, lint and test gate.
|
|
135
|
+
- `tools.config.json`: The settings crush's own tools read, such as the reviewer saga runs.
|
|
136
|
+
|
|
137
|
+
## Testing instructions
|
|
138
|
+
|
|
139
|
+
- `vp run test:unit` and `vp run test:integration` at the root run the two suites.
|
|
140
|
+
- `vp run typecheck` at the root checks types.
|
|
141
|
+
- `vp run lint` and `vp run fmt` at the root check lint and formatting.
|
|
142
|
+
- `vp run konsistent` at the root checks the structure `konsistent.json` declares.
|
|
143
|
+
|
|
144
|
+
## Code style
|
|
145
|
+
|
|
146
|
+
Where the shared rules name a placeholder, this repository's value is:
|
|
147
|
+
|
|
148
|
+
- `<product>.tables.ts` is `src/crush.tables.ts`.
|
|
149
|
+
|
|
150
|
+
Load the skill for each kind of change:
|
|
151
|
+
|
|
152
|
+
- `crush` for reading a report or answering its questions.
|
|
153
|
+
- `konsistent` for `konsistent.json`.
|
|
154
|
+
- `test` for a suite.
|
|
155
|
+
- `write-skill` for `SKILL.md`.
|
|
156
|
+
- `write-docs` for this README or the docs.
|
|
157
|
+
|
|
158
|
+
## Pins
|
|
159
|
+
|
|
160
|
+
- `drizzle-orm` and `drizzle-kit` are held exactly to a 1.0 release candidate in `package.json`, since Drizzle's driver for Node's built-in `node:sqlite` ships only in the 1.0 line, and a prerelease promises nothing from one candidate to the next; both move together to the 1.0 release once it is published.
|
|
161
|
+
- `eslint` and `eslint-scope` are held exactly in `package.json` as dev dependencies, since the code-path and scope ports in `src/graph/cfg/` follow those releases line by line and `vp run parity:eslint` defines parity against them.
|
|
162
|
+
Each moves only together with its port.
|
|
163
|
+
- `@stryker-mutator/instrumenter` is held exactly as a dev dependency in `package.json`, since `vp run parity:stryker` compares crush's ports with the mutants that one StrykerJS release makes, and a new release can change its mutators, so a bump is a deliberate step that reruns the check and sorts any new difference.
|
|
164
|
+
|
|
165
|
+
## Unsupported
|
|
166
|
+
|
|
167
|
+
Nothing has been proposed and declined yet.
|
|
168
|
+
|
|
169
|
+
## Contributing
|
|
170
|
+
|
|
171
|
+
1. Clone crush and run `vp install` at its root.
|
|
172
|
+
2. Run the checks in Testing instructions before each commit.
|
|
173
|
+
3. Write the commit message as a Conventional Commits subject.
|
|
174
|
+
|
|
175
|
+
A pull request runs `.github/workflows/check.yaml`, and each push to `main` runs `.github/workflows/release.yaml`, which publishes to npm and JSR and tags a release once those checks pass, all at package.json's major and minor with the run number as the patch, as `scripts/ci/release-version.sh` prints it.
|
|
176
|
+
|
|
177
|
+
## License
|
|
178
|
+
|
|
179
|
+
[MIT](LICENSE), copyright 2026 Dustin Dowell. Parts of the code and tests are translated from these projects:
|
|
180
|
+
|
|
181
|
+
- [ESLint](https://github.com/eslint/eslint) copyright OpenJS Foundation and other contributors (MIT): code-path analysis and its tests
|
|
182
|
+
- [eslint-scope](https://github.com/eslint/js/tree/main/packages/eslint-scope) copyright JS Foundation and other contributors (BSD-2-Clause): the scope referencer and its tests
|
|
183
|
+
- [StrykerJS](https://github.com/stryker-mutator/stryker-js) copyright Nico Jansen, Simon de Lang and the StrykerJS contributors (Apache-2.0): mutators
|
|
184
|
+
- Modifications copyright 2026 Dustin Dowell
|
|
185
|
+
|
|
186
|
+
Each project's full notice and license is in [`THIRD_PARTY_NOTICES.md`](THIRD_PARTY_NOTICES.md).
|
package/SKILL.md
ADDED
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: crush
|
|
3
|
+
description: "Checks TypeScript code with Vitest by removing branches and mutating expressions, then asks which tests, simplifications, or justifications should answer the results. Use when recording a project with crush, reading its report, answering its questions, or exploring a property."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Never edit a test's expected result to match a value observed in the record
|
|
7
|
+
Copying the result into the assertion lets the same bug pass on the next run
|
|
8
|
+
|
|
9
|
+
Work out each expected result from the contract and input before running the test
|
|
10
|
+
A failed assertion then exposes a disagreement between the contract and the code
|
|
11
|
+
|
|
12
|
+
Move tests from `Deno.test` or `node:test` to `vite-plus/test` before recording them with crush
|
|
13
|
+
Crush runs inside Vitest and needs Vitest test registration to rerun each test against a change
|
|
14
|
+
|
|
15
|
+
Add crush's projects to `vite.config.ts` as shown in [Consumer setup](references/consumer-setup.md)
|
|
16
|
+
The normal project runs the suite, and record mode makes the instrumented projects available to the record tasks
|
|
17
|
+
|
|
18
|
+
Extend the consumer's `TaskMeta` with `CrushTaskMeta` from `@whaaaley/crush/task-meta`, as [Consumer setup](references/consumer-setup.md) shows
|
|
19
|
+
The declaration supplies the `meta` fields tests answer, justify and state steps with
|
|
20
|
+
|
|
21
|
+
Run the project's type check before recording
|
|
22
|
+
A type error can make a recorded failure look like a behavioral difference
|
|
23
|
+
|
|
24
|
+
Run `vp run record` from the project root to save the baseline
|
|
25
|
+
The baseline supplies captured calls and test results to the later commands
|
|
26
|
+
|
|
27
|
+
Run `vp run judge` to judge mutations and verify removals together
|
|
28
|
+
Judge captures baseline evidence for a test file when its saved baseline is missing or stale
|
|
29
|
+
|
|
30
|
+
Declare the measured count in `meta.steps` for each eligible passing test with a steady count when step checking is enabled
|
|
31
|
+
Step checking defaults to enabled, so questions asks for a count from each eligible passing test, even when it measured zero
|
|
32
|
+
|
|
33
|
+
Run `vp run record:related <file>` for edited files during the questions loop
|
|
34
|
+
The related run reruns tests a change reaches and reuses the untouched files' recorded results
|
|
35
|
+
|
|
36
|
+
Wait for record or judge to finish before reading its saved results
|
|
37
|
+
An interrupted run can leave partial results
|
|
38
|
+
|
|
39
|
+
Run the `next:` line each command's output ends with as printed, its file included
|
|
40
|
+
It names the one step the state the run left calls for, as the README's table shows
|
|
41
|
+
|
|
42
|
+
Set aside a question that needs the user's intent, noting its id and both readings for the user, and answer the next
|
|
43
|
+
One question no file can settle would otherwise stall every question below it
|
|
44
|
+
|
|
45
|
+
Read the report tests and their annotations from the top, including failures, questions, and their printed answers
|
|
46
|
+
One answer can settle questions farther down, and the report shows which tests and changes still need attention
|
|
47
|
+
|
|
48
|
+
List open questions with `vp run questions`, or use `vp run questions:related <paths>` for the sources those paths reach
|
|
49
|
+
Both commands read the saved baseline and verdicts
|
|
50
|
+
|
|
51
|
+
Resolve a failed baseline before interpreting its mutation results
|
|
52
|
+
A failing test cannot show which change broke its behavior
|
|
53
|
+
|
|
54
|
+
Make a test that fails its rerun with nothing changed pass every run, as by building its fixtures inside its own body
|
|
55
|
+
Crush judges each change by rerunning a test in place, so a test that keeps state between runs, as a RuleTester instance refusing a case it has seen, judges nothing
|
|
56
|
+
|
|
57
|
+
Follow each question's printed answers, choosing a test for required behavior or simpler code when that behavior can go
|
|
58
|
+
A blanket yes-or-no convention would reverse the meaning of questions such as whether to remove a crush site
|
|
59
|
+
|
|
60
|
+
Follow `src/questions/questions.operations.ts` for the question kinds and answer rules
|
|
61
|
+
The wording and evidence checks there determine what each answer must demonstrate
|
|
62
|
+
|
|
63
|
+
Declare the exact printed question id in `meta.answers` on every test written to supply site or graph evidence, as one string or a list of ids when the test answers several
|
|
64
|
+
Crush checks that the named test reaches the code or catches the change the question asks about
|
|
65
|
+
|
|
66
|
+
Rewrite older question ids with raw `|` inside a field by escaping it as `%7C`, and escape a raw `%` as `%25` before escaping pipes
|
|
67
|
+
In records at the current `recordVersion` in `src/record/edges/record.db.ts`, raw `|` separates fields and the percent-encoded forms represent characters inside them
|
|
68
|
+
|
|
69
|
+
Keep a site or graph answer's `meta.answers` id while crush still builds the underlying question
|
|
70
|
+
The validator accepts evidence for closed site and graph questions, but rejects ids whose underlying questions disappeared
|
|
71
|
+
|
|
72
|
+
Answer steps and test-retention questions with their dedicated metadata fields
|
|
73
|
+
Step counts use `meta.steps` and heavy counts can include `meta.stepsReason`, while retaining a redundant test uses `meta.keeps`
|
|
74
|
+
|
|
75
|
+
Answer `reach`, `side`, and `call` with a test whose input reaches the code, takes the side, or enters the function the question names
|
|
76
|
+
An input that returns before the questioned code leaves the report without the evidence it asks for
|
|
77
|
+
|
|
78
|
+
Search for an input that tells the code apart before answering `no`, reading the conditions of every dependency whose result the code combines
|
|
79
|
+
Code that joins two results, as a library's estimate with its answer, looks redundant until an input makes them disagree
|
|
80
|
+
|
|
81
|
+
Answer `crush`, `tell`, and `matter` with an assertion that passes on the required behavior and fails on the questioned change
|
|
82
|
+
Executing the code without distinguishing its result leaves the changed behavior free to pass
|
|
83
|
+
|
|
84
|
+
Answer `behavior` by choosing an input that reaches the printed outcome site and asserting what the function should return or throw
|
|
85
|
+
The question asks "What should ... give at ...?", leaving the input for the test to choose
|
|
86
|
+
|
|
87
|
+
Answer `unused` by removing dead code or reaching it from a real entry or test
|
|
88
|
+
A source file outside the entry and test graph can otherwise remain unused without a runtime check
|
|
89
|
+
|
|
90
|
+
Answer `unexport` by dropping the export or importing it where it is needed
|
|
91
|
+
An export used only within its own file exposes an interface with no caller
|
|
92
|
+
|
|
93
|
+
Answer `untested` by testing the exported pattern directly or dropping its export
|
|
94
|
+
A pattern exported for tests has no reason to stay public when no test reads it
|
|
95
|
+
|
|
96
|
+
Answer `testonly` by removing the code and the tests that only reach it or by naming its real entry in the Crush project options
|
|
97
|
+
Another test cannot establish a production entry point
|
|
98
|
+
|
|
99
|
+
Remove a test the report finds redundant unless it pins an independent requirement, which belongs in `meta.keeps` as a reason
|
|
100
|
+
A redundant test adds work to each judgment, while an independent requirement can matter even when no checked change needs it
|
|
101
|
+
|
|
102
|
+
Write answering tests by hand beside the module that decides the behavior
|
|
103
|
+
A generated test or a distant scenario can obscure which input and assertion distinguish the change
|
|
104
|
+
|
|
105
|
+
Keep answering tests on values, with side effects in thin `edges/` modules covered by the project's integration tests
|
|
106
|
+
Disk, process, network, database, and clock work repeats under mutation and can make the verdict depend on external state
|
|
107
|
+
|
|
108
|
+
Keep worked examples from outside sources in the project's own example tests
|
|
109
|
+
An external example can pin an independent requirement even when the record finds it redundant as mutation evidence
|
|
110
|
+
|
|
111
|
+
Prove a regression with a failing test against the buggy code before fixing it
|
|
112
|
+
A test that passes either way pins nothing about the fix
|
|
113
|
+
|
|
114
|
+
Test a refusal when a reachable input violates the function's contract
|
|
115
|
+
A silent wrong result leaves callers without a reliable boundary
|
|
116
|
+
|
|
117
|
+
Restructure away code no input can reach before justifying it
|
|
118
|
+
Looping over a map's entries, for example, removes a needless lookup and its missing-value fork
|
|
119
|
+
|
|
120
|
+
Parse loose values at the boundary where they enter
|
|
121
|
+
Downstream `??`, `?.`, and `typeof` checks can otherwise leave forks that no valid input takes
|
|
122
|
+
|
|
123
|
+
Read an index known to exist through iteration, a non-empty type, or a shared checked lookup with a test
|
|
124
|
+
Repeated optional access or fallback values add unreachable forks for the same invariant
|
|
125
|
+
|
|
126
|
+
Justify a question only when no test can answer it and the code must stay
|
|
127
|
+
A reason written for convenience hides behavior a test or simpler code could settle
|
|
128
|
+
|
|
129
|
+
Justify a branch only the environment decides, such as one on `process.platform` or the runtime's version, never overwriting a global to reach it
|
|
130
|
+
A replaced global leaks into every later test sharing the process, and deleting the branch breaks the environment that takes it
|
|
131
|
+
|
|
132
|
+
Write each justification in `meta.justifies` on the function's `describe` in its test file, as shown in [Consumer setup](references/consumer-setup.md)
|
|
133
|
+
Crush reads reasons for keeping code only from that metadata, so a reason written anywhere else answers nothing
|
|
134
|
+
|
|
135
|
+
Read the remaining justifications before closing a review
|
|
136
|
+
A narrowing justification can conceal an invariant the source could express directly
|
|
137
|
+
|
|
138
|
+
Remove a justification when its question disappears
|
|
139
|
+
The report treats a reason attached to a closed question as an invalid justification
|
|
140
|
+
|
|
141
|
+
Reread a stale justification's reason against the current code before setting its basis to `refresh`
|
|
142
|
+
The basis moves when the code or the tests it rests on change, so a refresh set unread keeps a reason that may no longer hold
|
|
143
|
+
|
|
144
|
+
Investigate a changed fork-test count before updating `meta.steps`
|
|
145
|
+
Accepting a changed count without investigation can hide extra work or work that moved into an uninstrumented file
|
|
146
|
+
|
|
147
|
+
Investigate an unsteady count in the test's setup and shared state
|
|
148
|
+
Leaving an unsteady count unstated avoids claiming a false count, but the open steps question still fails the final report while step checking is enabled
|
|
149
|
+
|
|
150
|
+
Explain a necessary heavy test with `meta.stepsReason` beside its stated `meta.steps`
|
|
151
|
+
An explanation applies to that count, and the heavy-test question in `src/questions/questions.operations.ts` asks again when its work changes
|
|
152
|
+
|
|
153
|
+
Compare the same test's measured work before and after a speed-up
|
|
154
|
+
The report's hottest sides and slowest tests point to work worth investigating, but a faster path can drop behavior unless an assertion pins it
|
|
155
|
+
|
|
156
|
+
Repeat the related record after answering a batch of questions
|
|
157
|
+
The report checks whether the answers supplied evidence and whether the edits opened new questions
|
|
158
|
+
|
|
159
|
+
Use a full run when checking the entire project
|
|
160
|
+
A related run keeps untouched results. Delete `.crush/record.db` when the check needs an empty record.
|
|
161
|
+
|
|
162
|
+
Finish the record loop with passing report tests and no open questions, invalid answers, invalid justifications, failing baselines, or tests failing their rerun
|
|
163
|
+
The project report checks those items together, while coverage and mutation figures alone miss failures
|
|
164
|
+
|
|
165
|
+
Declare an explore property through `meta.explores` on a Vitest test when the installed crush revision supports explore, naming the exported property function in that test module
|
|
166
|
+
Explore uses the name to call the property with inputs generated from recorded calls
|
|
167
|
+
|
|
168
|
+
Run `vp run explore` after a record, when the installed crush revision supports explore and the project defines the task
|
|
169
|
+
Explore searches from whatever the record holds, and its findings come back as more questions
|
|
170
|
+
|
|
171
|
+
Set `explore: { maxTotalTime, runs }` in `exploreProject` to bound Explore by seconds or target calls
|
|
172
|
+
The defaults are `0` seconds and `-1` runs, leaving both limits open. When both are set, the first one reached ends the run
|
|
173
|
+
|
|
174
|
+
In crush's own checkout set `explore.maxTotalTime` or `explore.runs` in the settings of its `vite.config.ts` before `vp run explore` or `vp run explore:related`
|
|
175
|
+
Those tasks read the limits from the config, as a consumer's `exploreProject` settings set them
|
|
176
|
+
|
|
177
|
+
Stop an unbounded run with Ctrl-C and read saved findings with `vp run questions`
|
|
178
|
+
Explore saves each finding as it is found, so Questions can show those already found when the run stops
|
|
179
|
+
|
|
180
|
+
Reproduce an explore finding with a regression test before recording again
|
|
181
|
+
The finding supplies an input that breaks the property, and the regression test keeps that input checked on later runs
|
|
182
|
+
|
|
183
|
+
Remove an explore finding's id from `meta.answers` once the finding closes
|
|
184
|
+
Crush refuses a closed explore id because only open explore findings enter answer validation
|
|
185
|
+
|
|
186
|
+
Keep the worktree's `.crush/record.db` between runs
|
|
187
|
+
Related runs reuse its evidence, and `vp run record` automatically rebuilds it when the version in `src/record/edges/record.db.ts` changes
|