evilution 0.9.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.beads/.migration-hint-ts +1 -1
- data/.beads/issues.jsonl +15 -14
- data/CHANGELOG.md +34 -0
- data/README.md +12 -4
- data/lib/evilution/cli.rb +1 -10
- data/lib/evilution/config.rb +4 -24
- data/lib/evilution/equivalent/detector.rb +42 -0
- data/lib/evilution/equivalent/heuristic/alias_swap.rb +37 -0
- data/lib/evilution/equivalent/heuristic/dead_code.rb +51 -0
- data/lib/evilution/equivalent/heuristic/method_body_nil.rb +23 -0
- data/lib/evilution/equivalent/heuristic/noop_source.rb +13 -0
- data/lib/evilution/mcp/mutate_tool.rb +37 -6
- data/lib/evilution/mutator/operator/argument_nil_substitution.rb +42 -0
- data/lib/evilution/mutator/operator/arithmetic_replacement.rb +3 -1
- data/lib/evilution/mutator/operator/array_literal.rb +7 -0
- data/lib/evilution/mutator/operator/boolean_literal_replacement.rb +15 -0
- data/lib/evilution/mutator/operator/collection_replacement.rb +9 -1
- data/lib/evilution/mutator/operator/comparison_replacement.rb +4 -4
- data/lib/evilution/mutator/operator/float_literal.rb +7 -0
- data/lib/evilution/mutator/operator/hash_literal.rb +7 -0
- data/lib/evilution/mutator/operator/integer_literal.rb +7 -0
- data/lib/evilution/mutator/operator/nil_replacement.rb +10 -6
- data/lib/evilution/mutator/operator/regexp_mutation.rb +11 -6
- data/lib/evilution/mutator/operator/send_mutation.rb +49 -0
- data/lib/evilution/mutator/operator/string_literal.rb +7 -0
- data/lib/evilution/mutator/operator/symbol_literal.rb +7 -0
- data/lib/evilution/mutator/registry.rb +3 -1
- data/lib/evilution/reporter/cli.rb +11 -1
- data/lib/evilution/reporter/html.rb +252 -0
- data/lib/evilution/reporter/json.rb +5 -1
- data/lib/evilution/result/mutation_result.rb +5 -1
- data/lib/evilution/result/summary.rb +9 -1
- data/lib/evilution/runner.rb +32 -13
- data/lib/evilution/version.rb +1 -1
- data/lib/evilution.rb +4 -4
- metadata +10 -6
- data/lib/evilution/coverage/collector.rb +0 -47
- data/lib/evilution/coverage/test_map.rb +0 -25
- data/lib/evilution/diff/file_filter.rb +0 -29
- data/lib/evilution/diff/parser.rb +0 -47
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 75b54000885c712ef99cba9fe62d841b66e24a77730c84c2b1887390bda48210
|
|
4
|
+
data.tar.gz: 8c9d01ab7e64a0d00863d2868da561c39f4b9e99a6f7922039260c384f31c20d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 703e6bd316ba86d75f0e472adce7de078d5249f563cfbc110537c000b1d44e1904a07ccfabc7633e2df8bc8cf2401f55dbdb30d62b182eab861f93b8a9e215f2
|
|
7
|
+
data.tar.gz: 752b81e0d695029e586e5459d1bfa2a73535e37c65fe0e6ee21262d8db241d1d33d0c1b76348d8e0fa0fdafb515cf01cac64f7eac1b4fd69ff0e8bc06b26ba66
|
data/.beads/.migration-hint-ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
1774024848
|
data/.beads/issues.jsonl
CHANGED
|
@@ -83,10 +83,10 @@
|
|
|
83
83
|
{"id":"EV-4.9","title":"Integrate diff-based targeting into Runner","description":"Update Runner to optionally use Diff::Parser + FileFilter when --diff flag is set. Filter subjects before mutation generation. File: lib/evilution/runner.rb (edit).","status":"closed","priority":2,"issue_type":"task","owner":"denis.kiselyov@gmail.com","created_at":"2026-03-02T00:06:45.851982561+07:00","created_by":"Denis Kiselev","updated_at":"2026-03-02T11:54:25.596280246+07:00","closed_at":"2026-03-02T11:54:25.596280246+07:00","close_reason":"Closed","dependencies":[{"issue_id":"EV-4.9","depends_on_id":"EV-4","type":"parent-child","created_at":"0001-01-01T00:00:00Z"},{"issue_id":"EV-4.9","depends_on_id":"EV-4.6","type":"blocks","created_at":"0001-01-01T00:00:00Z"},{"issue_id":"EV-4.9","depends_on_id":"EV-2.12","type":"blocks","created_at":"0001-01-01T00:00:00Z"}]}
|
|
84
84
|
{"id":"EV-40","title":"Separate rspec noise from evilution output (stdout/stderr)","description":"RSpec warnings flood stdout and corrupt JSON output. When using --format json, the JSON gets buried in hundreds of lines of rspec warnings. Fix: redirect rspec subprocess output to stderr (or /dev/null), keep evilution results on stdout. Critical for piping JSON output.","status":"closed","priority":1,"issue_type":"bug","owner":"denis.kiselyov@gmail.com","created_at":"2026-03-13T09:56:58.604909176+07:00","created_by":"Denis Kiselev","updated_at":"2026-03-16T11:15:15.02691418+07:00","closed_at":"2026-03-16T11:15:15.02691418+07:00","close_reason":"Fixed and merged via PR #86"}
|
|
85
85
|
{"id":"EV-41","title":"Progress indicator during mutation runs","description":"Zero output during multi-minute runs makes it look stuck. Add a simple 'mutation 3/19 killed...' progress line to stderr so users know work is happening. Only show in text mode or when stderr is a TTY.","status":"closed","priority":2,"issue_type":"feature","owner":"denis.kiselyov@gmail.com","created_at":"2026-03-13T09:57:01.023293323+07:00","created_by":"Denis Kiselev","updated_at":"2026-03-16T11:38:40.674664201+07:00","closed_at":"2026-03-16T11:38:40.674664201+07:00","close_reason":"Fixed and merged via PR #87"}
|
|
86
|
-
{"id":"EV-42","title":"Expand mutation operators (method call removal, receiver replacement, etc.)","description":"Currently 18 operators generating ~19 mutations vs mutant's 78 for the same method. Missing operators: method call removal, self receiver replacement, additional boolean logic mutations, nil substitutions. Higher operator count catches more subtle bugs and produces a more meaningful mutation score.","status":"
|
|
86
|
+
{"id":"EV-42","title":"Expand mutation operators (method call removal, receiver replacement, etc.)","description":"Currently 18 operators generating ~19 mutations vs mutant's 78 for the same method. Missing operators: method call removal, self receiver replacement, additional boolean logic mutations, nil substitutions. Higher operator count catches more subtle bugs and produces a more meaningful mutation score.","status":"closed","priority":2,"issue_type":"feature","owner":"denis.kiselyov@gmail.com","created_at":"2026-03-13T09:57:03.039944039+07:00","created_by":"Denis Kiselev","updated_at":"2026-03-21T10:13:27.879564703+07:00","closed_at":"2026-03-21T10:13:27.879564703+07:00","close_reason":"All requested operators implemented: method call removal, receiver replacement, block removal, send mutation, argument removal, conditional flip, range/regexp, and operator deepening. Operator count grown from 18 to 26.","external_ref":"gh-76","dependencies":[{"issue_id":"EV-42","depends_on_id":"EV-45","type":"parent-child","created_at":"0001-01-01T00:00:00Z"}]}
|
|
87
87
|
{"id":"EV-43","title":"Fix --version flag (returns 'version unknown')","description":"Running 'evilution --version' returns 'version unknown' instead of the actual version. The 'evilution version' subcommand works, but --version as a flag does not. Users expect --version to work.","status":"closed","priority":1,"issue_type":"bug","owner":"denis.kiselyov@gmail.com","created_at":"2026-03-13T09:57:05.048211823+07:00","created_by":"Denis Kiselev","updated_at":"2026-03-16T10:31:01.045381336+07:00","closed_at":"2026-03-16T10:31:01.045381336+07:00","close_reason":"Fixed and merged"}
|
|
88
88
|
{"id":"EV-44","title":"Re-introduce parallel execution","description":"Bring back parallel mutation execution. Consider whether two-level fork model is still right, temp-file isolation needs, and auto-detecting when parallelism is worthwhile. GH #35.","status":"closed","priority":2,"issue_type":"feature","owner":"denis.kiselyov@gmail.com","created_at":"2026-03-16T10:15:42.050318104+07:00","created_by":"Denis Kiselev","updated_at":"2026-03-16T16:26:30.341909415+07:00","closed_at":"2026-03-16T16:26:30.341909415+07:00","close_reason":"PR #90 merged — process-based parallel pool with --jobs flag"}
|
|
89
|
-
{"id":"EV-45","title":"Epic: Close mutation operator gap with mutant","description":"Track all missing mutation operators to approach mutant's ~78 mutations per method. Currently at ~19 with 18 operators. This is a long-term effort — prioritize high-value operators first.","status":"
|
|
89
|
+
{"id":"EV-45","title":"Epic: Close mutation operator gap with mutant","description":"Track all missing mutation operators to approach mutant's ~78 mutations per method. Currently at ~19 with 18 operators. This is a long-term effort — prioritize high-value operators first.","status":"closed","priority":2,"issue_type":"epic","owner":"denis.kiselyov@gmail.com","created_at":"2026-03-16T21:50:07.597313227+07:00","created_by":"Denis Kiselev","updated_at":"2026-03-21T10:13:38.546539396+07:00","closed_at":"2026-03-21T10:13:38.546539396+07:00","close_reason":"All 10 children complete. Operator count grew from 18 to 26 with deeper variant coverage across all operators, significantly closing the gap with mutant."}
|
|
90
90
|
{"id":"EV-46","title":"Operator: MethodCallRemoval","description":"Remove method call, keep receiver. e.g. obj.foo(x) → obj. High bug-finding value — catches untested side effects.","status":"closed","priority":3,"issue_type":"feature","owner":"denis.kiselyov@gmail.com","created_at":"2026-03-16T21:50:22.890467537+07:00","created_by":"Denis Kiselev","updated_at":"2026-03-19T15:45:33.224167585+07:00","closed_at":"2026-03-17T09:29:15.588415782+07:00","close_reason":"PR merged — MethodCallRemoval operator (19th operator)","external_ref":"gh-94","dependencies":[{"issue_id":"EV-46","depends_on_id":"EV-45","type":"parent-child","created_at":"0001-01-01T00:00:00Z"}]}
|
|
91
91
|
{"id":"EV-47","title":"Operator: BlockRemoval","description":"Remove block from method call. e.g. items.map { |x| x * 2 } → items.map. Catches untested block logic.","status":"closed","priority":3,"issue_type":"feature","owner":"denis.kiselyov@gmail.com","created_at":"2026-03-16T21:50:23.067266925+07:00","created_by":"Denis Kiselev","updated_at":"2026-03-19T16:07:53.696798964+07:00","closed_at":"2026-03-19T16:07:53.696798964+07:00","close_reason":"Implemented BlockRemoval operator with 8 specs","external_ref":"gh-95","dependencies":[{"issue_id":"EV-47","depends_on_id":"EV-45","type":"parent-child","created_at":"0001-01-01T00:00:00Z"}]}
|
|
92
92
|
{"id":"EV-48","title":"Operator: RangeReplacement","description":"Swap inclusive/exclusive ranges. e.g. 1..10 → 1...10 and vice versa. Trivial to implement.","status":"closed","priority":3,"issue_type":"feature","owner":"denis.kiselyov@gmail.com","created_at":"2026-03-16T21:50:23.172934653+07:00","created_by":"Denis Kiselev","updated_at":"2026-03-19T18:45:22.811573395+07:00","closed_at":"2026-03-19T18:45:22.811573395+07:00","close_reason":"Implemented RangeReplacement operator with 6 specs, 100% mutation score","external_ref":"gh-96","dependencies":[{"issue_id":"EV-48","depends_on_id":"EV-45","type":"parent-child","created_at":"0001-01-01T00:00:00Z"}]}
|
|
@@ -99,17 +99,17 @@
|
|
|
99
99
|
{"id":"EV-5.5","title":"Write README.md","description":"Replace placeholder README with: gem description, installation, quick start, CLI usage, configuration, output formats (JSON schema), operator list, comparison with mutant, contributing guide, license.","status":"closed","priority":2,"issue_type":"task","owner":"denis.kiselyov@gmail.com","created_at":"2026-03-02T00:06:58.454635118+07:00","created_by":"Denis Kiselev","updated_at":"2026-03-02T11:54:29.226280116+07:00","closed_at":"2026-03-02T11:54:29.226280116+07:00","close_reason":"Closed","dependencies":[{"issue_id":"EV-5.5","depends_on_id":"EV-5","type":"parent-child","created_at":"0001-01-01T00:00:00Z"},{"issue_id":"EV-5.5","depends_on_id":"EV-4.9","type":"blocks","created_at":"0001-01-01T00:00:00Z"},{"issue_id":"EV-5.5","depends_on_id":"EV-5.1","type":"blocks","created_at":"0001-01-01T00:00:00Z"}]}
|
|
100
100
|
{"id":"EV-5.6","title":"Update CHANGELOG.md for v0.1.0","description":"Document all features in the initial release: operator list, RSpec integration, JSON/CLI output, parallel execution, coverage-based selection, diff-based targeting.","status":"closed","priority":2,"issue_type":"task","owner":"denis.kiselyov@gmail.com","created_at":"2026-03-02T00:06:58.571499415+07:00","created_by":"Denis Kiselev","updated_at":"2026-03-02T11:54:29.22634981+07:00","closed_at":"2026-03-02T11:54:29.22634981+07:00","close_reason":"Closed","dependencies":[{"issue_id":"EV-5.6","depends_on_id":"EV-5","type":"parent-child","created_at":"0001-01-01T00:00:00Z"},{"issue_id":"EV-5.6","depends_on_id":"EV-5.5","type":"blocks","created_at":"0001-01-01T00:00:00Z"}]}
|
|
101
101
|
{"id":"EV-50","title":"Operator: ConditionalFlip","description":"Flip if/unless. e.g. if cond → unless cond. Catches single-branch conditional testing.","status":"closed","priority":3,"issue_type":"feature","owner":"denis.kiselyov@gmail.com","created_at":"2026-03-16T21:50:23.379431887+07:00","created_by":"Denis Kiselev","updated_at":"2026-03-19T16:25:00.912700206+07:00","closed_at":"2026-03-19T16:25:00.912700206+07:00","close_reason":"Implemented ConditionalFlip operator with 10 specs","external_ref":"gh-98","dependencies":[{"issue_id":"EV-50","depends_on_id":"EV-45","type":"parent-child","created_at":"0001-01-01T00:00:00Z"}]}
|
|
102
|
-
{"id":"EV-51","title":"Operator: SendMutation","description":"Replace known method families. e.g. flat_map → map, public_send → send, gsub → sub. Catches untested method semantics.","status":"
|
|
102
|
+
{"id":"EV-51","title":"Operator: SendMutation","description":"Replace known method families. e.g. flat_map → map, public_send → send, gsub → sub. Catches untested method semantics.","status":"closed","priority":4,"issue_type":"feature","owner":"denis.kiselyov@gmail.com","created_at":"2026-03-16T21:50:23.483414117+07:00","created_by":"Denis Kiselev","updated_at":"2026-03-20T23:14:12.811639741+07:00","closed_at":"2026-03-20T23:14:12.811639741+07:00","close_reason":"Implemented SendMutation operator with 17 method family replacements (flat_map/map, public_send/send, gsub/sub, detect/find, collect/map, each_with_object/inject, reverse_each/each, length/size, values_at/fetch_values). 19 specs passing.","external_ref":"gh-99","dependencies":[{"issue_id":"EV-51","depends_on_id":"EV-45","type":"parent-child","created_at":"0001-01-01T00:00:00Z"}]}
|
|
103
103
|
{"id":"EV-52","title":"Operator: ArgumentRemoval","description":"Remove, permute, and replace individual method call arguments. e.g. foo(a, b) → foo(a), foo(b, a), foo(a, nil). This is the #1 cited gap vs mutant — where mutant catches the most bugs evilution misses. Includes: removing each argument individually, swapping argument order, replacing with nil.","status":"closed","priority":2,"issue_type":"feature","owner":"denis.kiselyov@gmail.com","created_at":"2026-03-16T21:50:23.587291445+07:00","created_by":"Denis Kiselev","updated_at":"2026-03-19T15:45:33.832675896+07:00","closed_at":"2026-03-17T23:16:28.920737471+07:00","close_reason":"Merged","external_ref":"gh-100","dependencies":[{"issue_id":"EV-52","depends_on_id":"EV-45","type":"parent-child","created_at":"0001-01-01T00:00:00Z"}]}
|
|
104
104
|
{"id":"EV-53","title":"Operator: ReceiverReplacement","description":"Drop explicit self receiver. e.g. self.foo → foo. Low bug-finding value.","status":"closed","priority":3,"issue_type":"feature","owner":"denis.kiselyov@gmail.com","created_at":"2026-03-16T21:50:23.692244528+07:00","created_by":"Denis Kiselev","updated_at":"2026-03-19T20:56:21.943424181+07:00","closed_at":"2026-03-19T20:56:21.943424181+07:00","close_reason":"Implemented ReceiverReplacement operator with 8 specs, 100% mutation score","external_ref":"gh-101","dependencies":[{"issue_id":"EV-53","depends_on_id":"EV-45","type":"parent-child","created_at":"0001-01-01T00:00:00Z"}]}
|
|
105
|
-
{"id":"EV-54","title":"Deepen existing operators with more replacement variants","description":"Existing operators generate limited variants per node. E.g. integer 5 only produces 0 and 1, but could also produce -1 and nil. Expanding variant sets across all 18 operators would significantly increase mutation coverage.","status":"
|
|
106
|
-
{"id":"EV-54.1","title":"Add nil variants to literal operators","description":"Add nil as a mutation variant to IntegerLiteral, FloatLiteral, StringLiteral, BooleanLiteralReplacement, ArrayLiteral, HashLiteral, and SymbolLiteral operators. Nil-safety is one of the most common sources of production bugs in Ruby, making this the highest-ROI expansion.","status":"
|
|
107
|
-
{"id":"EV-54.2","title":"Expand NilReplacement with false, 0, and empty string variants","description":"Currently nil only mutates to true. Add false, 0, and empty string variants since nil is commonly used in boolean, numeric, and string contexts.","status":"
|
|
108
|
-
{"id":"EV-54.3","title":"Expand CollectionReplacement with more method swaps","description":"Add sort↔sort_by, find↔detect, any?↔all?, count↔length swaps. These are very common collection methods with subtle behavioral differences.","status":"
|
|
109
|
-
{"id":"EV-54.4","title":"Expand ComparisonReplacement with opposite direction flips","description":"Currently > only mutates to >= and ==. Add full opposite flips: >→<, >=→<=, <→>, <=→>=. Catches inverted comparison bugs.","status":"
|
|
110
|
-
{"id":"EV-54.5","title":"Add always-matching regexp variant","description":"Currently regexp only mutates to never-matching /a\\A/. Add always-matching /.*/ variant to test both match and no-match code paths.","status":"
|
|
111
|
-
{"id":"EV-54.6","title":"Expand ArithmeticReplacement with bitwise shift operators","description":"Add <<→>> swap. Niche but catches bitwise shift bugs. Lowest priority in this epic.","status":"
|
|
112
|
-
{"id":"EV-54.7","title":"Operator: ArgumentNilSubstitution","description":"Replace each method argument with nil, one at a time. E.g. foo(a, b) → foo(nil, b) and foo(a, nil). Works for single-arg calls too (unlike ArgumentRemoval which requires 2+). This catches 'default value' bugs where a method has a sensible fallback for nil — e.g. I18n.with_locale(user.locale) → I18n.with_locale(nil) silently falls back to default locale. Identified from real-world feedback where mutant caught a locale test gap that evilution missed (v0.7.0).","status":"
|
|
105
|
+
{"id":"EV-54","title":"Deepen existing operators with more replacement variants","description":"Existing operators generate limited variants per node. E.g. integer 5 only produces 0 and 1, but could also produce -1 and nil. Expanding variant sets across all 18 operators would significantly increase mutation coverage.","status":"closed","priority":3,"issue_type":"feature","owner":"denis.kiselyov@gmail.com","created_at":"2026-03-16T21:50:23.797359784+07:00","created_by":"Denis Kiselev","updated_at":"2026-03-21T10:12:24.735777721+07:00","closed_at":"2026-03-21T10:12:24.735777721+07:00","close_reason":"All 7 subtasks complete: nil variants for literals, NilReplacement expansion, CollectionReplacement swaps, ComparisonReplacement flips, regexp always-match, ArithmeticReplacement bitwise shifts, and ArgumentNilSubstitution.","external_ref":"gh-102","dependencies":[{"issue_id":"EV-54","depends_on_id":"EV-45","type":"parent-child","created_at":"0001-01-01T00:00:00Z"}]}
|
|
106
|
+
{"id":"EV-54.1","title":"Add nil variants to literal operators","description":"Add nil as a mutation variant to IntegerLiteral, FloatLiteral, StringLiteral, BooleanLiteralReplacement, ArrayLiteral, HashLiteral, and SymbolLiteral operators. Nil-safety is one of the most common sources of production bugs in Ruby, making this the highest-ROI expansion.","status":"closed","priority":2,"issue_type":"task","owner":"denis.kiselyov@gmail.com","created_at":"2026-03-19T21:21:06.464726693+07:00","created_by":"Denis Kiselev","updated_at":"2026-03-21T01:35:34.750595584+07:00","closed_at":"2026-03-21T01:35:34.750595584+07:00","close_reason":"Added nil variant to all 7 literal operators: IntegerLiteral, FloatLiteral, StringLiteral, BooleanLiteralReplacement, ArrayLiteral, HashLiteral, SymbolLiteral. 722 specs passing, 100% mutation score.","external_ref":"gh-167","dependencies":[{"issue_id":"EV-54.1","depends_on_id":"EV-54","type":"parent-child","created_at":"0001-01-01T00:00:00Z"}]}
|
|
107
|
+
{"id":"EV-54.2","title":"Expand NilReplacement with false, 0, and empty string variants","description":"Currently nil only mutates to true. Add false, 0, and empty string variants since nil is commonly used in boolean, numeric, and string contexts.","status":"closed","priority":2,"issue_type":"task","owner":"denis.kiselyov@gmail.com","created_at":"2026-03-19T21:21:20.731673229+07:00","created_by":"Denis Kiselev","updated_at":"2026-03-21T09:27:04.480824365+07:00","closed_at":"2026-03-21T09:27:04.480824365+07:00","close_reason":"Added false, 0, and empty string variants to NilReplacement alongside existing true. Each nil literal now produces 4 mutations. All 722 specs pass.","external_ref":"gh-168","dependencies":[{"issue_id":"EV-54.2","depends_on_id":"EV-54","type":"parent-child","created_at":"0001-01-01T00:00:00Z"}]}
|
|
108
|
+
{"id":"EV-54.3","title":"Expand CollectionReplacement with more method swaps","description":"Add sort↔sort_by, find↔detect, any?↔all?, count↔length swaps. These are very common collection methods with subtle behavioral differences.","status":"closed","priority":3,"issue_type":"task","owner":"denis.kiselyov@gmail.com","created_at":"2026-03-19T21:21:20.842448904+07:00","created_by":"Denis Kiselev","updated_at":"2026-03-21T09:33:35.1684274+07:00","closed_at":"2026-03-21T09:33:35.1684274+07:00","close_reason":"Added sort↔sort_by, find↔detect, any?↔all?, count↔length swaps. 731 specs pass.","external_ref":"gh-169","dependencies":[{"issue_id":"EV-54.3","depends_on_id":"EV-54","type":"parent-child","created_at":"0001-01-01T00:00:00Z"}]}
|
|
109
|
+
{"id":"EV-54.4","title":"Expand ComparisonReplacement with opposite direction flips","description":"Currently > only mutates to >= and ==. Add full opposite flips: >→<, >=→<=, <→>, <=→>=. Catches inverted comparison bugs.","status":"closed","priority":3,"issue_type":"task","owner":"denis.kiselyov@gmail.com","created_at":"2026-03-19T21:21:20.944147572+07:00","created_by":"Denis Kiselev","updated_at":"2026-03-21T09:45:06.468344416+07:00","closed_at":"2026-03-21T09:45:06.468344416+07:00","close_reason":"Added opposite direction flips (>↔<, >=↔<=). 731 specs pass, 100% mutation score.","external_ref":"gh-170","dependencies":[{"issue_id":"EV-54.4","depends_on_id":"EV-54","type":"parent-child","created_at":"0001-01-01T00:00:00Z"}]}
|
|
110
|
+
{"id":"EV-54.5","title":"Add always-matching regexp variant","description":"Currently regexp only mutates to never-matching /a\\A/. Add always-matching /.*/ variant to test both match and no-match code paths.","status":"closed","priority":3,"issue_type":"task","owner":"denis.kiselyov@gmail.com","created_at":"2026-03-19T21:21:21.049402671+07:00","created_by":"Denis Kiselev","updated_at":"2026-03-21T10:05:45.034075069+07:00","closed_at":"2026-03-21T10:05:45.034075069+07:00","close_reason":"Added always-matching /.*/ variant alongside never-matching /a\\A/. Each regexp now produces 2 mutations. 731 specs pass, 100% mutation score.","external_ref":"gh-171","dependencies":[{"issue_id":"EV-54.5","depends_on_id":"EV-54","type":"parent-child","created_at":"0001-01-01T00:00:00Z"}]}
|
|
111
|
+
{"id":"EV-54.6","title":"Expand ArithmeticReplacement with bitwise shift operators","description":"Add <<→>> swap. Niche but catches bitwise shift bugs. Lowest priority in this epic.","status":"closed","priority":4,"issue_type":"task","owner":"denis.kiselyov@gmail.com","created_at":"2026-03-19T21:21:21.152296396+07:00","created_by":"Denis Kiselev","updated_at":"2026-03-21T01:03:32.687774444+07:00","closed_at":"2026-03-21T01:03:32.687774444+07:00","close_reason":"Added << >> bitwise shift swap to ArithmeticReplacement operator. 714 specs passing, 100% mutation score.","external_ref":"gh-172","dependencies":[{"issue_id":"EV-54.6","depends_on_id":"EV-54","type":"parent-child","created_at":"0001-01-01T00:00:00Z"}]}
|
|
112
|
+
{"id":"EV-54.7","title":"Operator: ArgumentNilSubstitution","description":"Replace each method argument with nil, one at a time. E.g. foo(a, b) → foo(nil, b) and foo(a, nil). Works for single-arg calls too (unlike ArgumentRemoval which requires 2+). This catches 'default value' bugs where a method has a sensible fallback for nil — e.g. I18n.with_locale(user.locale) → I18n.with_locale(nil) silently falls back to default locale. Identified from real-world feedback where mutant caught a locale test gap that evilution missed (v0.7.0).","status":"closed","priority":2,"issue_type":"task","owner":"denis.kiselyov@gmail.com","created_at":"2026-03-19T22:09:42.995246472+07:00","created_by":"Denis Kiselev","updated_at":"2026-03-20T23:43:12.098455761+07:00","closed_at":"2026-03-20T23:43:12.098455761+07:00","close_reason":"Implemented ArgumentNilSubstitution operator. Replaces each argument with nil one at a time, works for single-arg calls too (unlike ArgumentRemoval). Skips splat, keyword, block, and forwarding args. 12 specs passing, 705 total.","external_ref":"gh-175","dependencies":[{"issue_id":"EV-54.7","depends_on_id":"EV-54","type":"parent-child","created_at":"0001-01-01T00:00:00Z"}]}
|
|
113
113
|
{"id":"EV-55","title":"Concrete suggestions: Comparison & Arithmetic operators","description":"Generate concrete RSpec it blocks for ComparisonReplacement and ArithmeticReplacement mutations. Test should assert exact return value at boundary conditions.","status":"open","priority":3,"issue_type":"feature","owner":"denis.kiselyov@gmail.com","created_at":"2026-03-17T09:58:33.26716126+07:00","created_by":"Denis Kiselev","updated_at":"2026-03-17T09:58:33.26716126+07:00"}
|
|
114
114
|
{"id":"EV-56","title":"Concrete suggestions: Boolean operators","description":"Generate concrete RSpec it blocks for BooleanOperatorReplacement, BooleanLiteralReplacement, and NegationInsertion mutations. Test should assert true/false explicitly.","status":"open","priority":3,"issue_type":"feature","owner":"denis.kiselyov@gmail.com","created_at":"2026-03-17T09:58:33.370014645+07:00","created_by":"Denis Kiselev","updated_at":"2026-03-17T09:58:33.370014645+07:00"}
|
|
115
115
|
{"id":"EV-57","title":"Concrete suggestions: Literal operators","description":"Generate concrete RSpec it blocks for IntegerLiteral, FloatLiteral, StringLiteral, and SymbolLiteral mutations. Test should assert exact value returned.","status":"open","priority":3,"issue_type":"feature","owner":"denis.kiselyov@gmail.com","created_at":"2026-03-17T09:58:33.473990949+07:00","created_by":"Denis Kiselev","updated_at":"2026-03-17T09:58:33.473990949+07:00"}
|
|
@@ -123,8 +123,8 @@
|
|
|
123
123
|
{"id":"EV-64","title":"Class-level --target filtering","description":"Extend --target to accept class names without method (e.g. --target Game) to mutate all methods in the class. Currently only supports fully-qualified method names like Game#method.","status":"closed","priority":3,"issue_type":"feature","owner":"denis.kiselyov@gmail.com","created_at":"2026-03-17T10:15:03.858147999+07:00","created_by":"Denis Kiselev","updated_at":"2026-03-19T21:31:38.601679951+07:00","closed_at":"2026-03-19T21:31:38.601679951+07:00","close_reason":"Implemented class-level --target filtering with 3 new specs, 100% mutation score"}
|
|
124
124
|
{"id":"EV-65","title":"Incremental mode with result caching","description":"Cache mutation results and only re-run mutations on changed lines/methods. Big CI speed win for large codebases. Could key cache on file content hash + mutation fingerprint.","status":"closed","priority":3,"issue_type":"feature","owner":"denis.kiselyov@gmail.com","created_at":"2026-03-17T10:15:03.95132569+07:00","created_by":"Denis Kiselev","updated_at":"2026-03-19T21:47:19.95617067+07:00","closed_at":"2026-03-19T21:47:19.95617067+07:00","close_reason":"Implemented incremental mode with result caching. Cache class (9 specs), runner integration (4 specs), CLI --incremental flag, config support. 100% mutation score on cache."}
|
|
125
125
|
{"id":"EV-66","title":"Scope-aware spec resolution","description":"Improve convention-based spec resolution for nested modules. When a method is nested in a module, prefer spec/models/game_spec.rb over a generic match. Handle edge cases in app/ directory structures.","status":"closed","priority":3,"issue_type":"feature","owner":"denis.kiselyov@gmail.com","created_at":"2026-03-17T10:15:04.04579177+07:00","created_by":"Denis Kiselev","updated_at":"2026-03-19T22:15:01.15206232+07:00","closed_at":"2026-03-19T22:15:01.15206232+07:00","close_reason":"Implemented parent-path fallback in SpecResolver for nested module spec resolution"}
|
|
126
|
-
{"id":"EV-67","title":"HTML report with visual mutation map","description":"Generate an HTML report showing which lines are well-tested vs vulnerable. Visual mutation map per file with color-coded coverage.","status":"
|
|
127
|
-
{"id":"EV-68","title":"Equivalent mutation detection","description":"Add heuristics to skip mutations that produce provably identical behavior (dead code paths, no-op transformations). Reduces noise in mutation results.","status":"
|
|
126
|
+
{"id":"EV-67","title":"HTML report with visual mutation map","description":"Generate an HTML report showing which lines are well-tested vs vulnerable. Visual mutation map per file with color-coded coverage.","status":"closed","priority":4,"issue_type":"feature","owner":"denis.kiselyov@gmail.com","created_at":"2026-03-17T10:15:04.13552276+07:00","created_by":"Denis Kiselev","updated_at":"2026-03-20T23:58:29.045246978+07:00","closed_at":"2026-03-20T23:58:29.045246978+07:00","close_reason":"Implemented HTML reporter with visual mutation map. Self-contained HTML with inline CSS (dark theme), per-file mutation maps with color-coded lines (green=killed, red=survived, yellow=timeout), expandable survived mutation details with diffs and suggestions. Writes to evilution-report.html. 17 reporter specs, 724 total passing."}
|
|
127
|
+
{"id":"EV-68","title":"Equivalent mutation detection","description":"Add heuristics to skip mutations that produce provably identical behavior (dead code paths, no-op transformations). Reduces noise in mutation results.","status":"closed","priority":4,"issue_type":"feature","owner":"denis.kiselyov@gmail.com","created_at":"2026-03-17T10:15:04.226297798+07:00","created_by":"Denis Kiselev","updated_at":"2026-03-21T00:22:25.796367972+07:00","closed_at":"2026-03-21T00:22:25.796367972+07:00","close_reason":"Implemented equivalent mutation detection with 4 heuristics: NoopSource (identical source), MethodBodyNil (empty/nil method bodies), AliasSwap (detect/find, length/size, collect/map), DeadCode (unreachable code after return/raise). Integrated into runner pipeline, reporters (CLI/JSON/HTML), and MCP tool. Equivalents excluded from score denominator. 100% mutation score (211/211). 753 total specs passing."}
|
|
128
128
|
{"id":"EV-69","title":"Minitest integration","description":"Add Minitest support alongside existing RSpec integration. Broader ecosystem support for non-RSpec projects.","status":"open","priority":4,"issue_type":"feature","owner":"denis.kiselyov@gmail.com","created_at":"2026-03-17T10:15:04.313129974+07:00","created_by":"Denis Kiselev","updated_at":"2026-03-17T10:15:04.313129974+07:00"}
|
|
129
129
|
{"id":"EV-7","title":"Enable true per-mutation isolation with temp file copies","description":"Currently all mutations for the same file go to one worker (PR #4 fix). This means single-file projects get no parallelism benefit. Implement temp file copy approach: each worker copies the source file to a temp location, mutates the copy, and runs tests against it. This enables safe parallel mutation of the same file across multiple workers.","status":"closed","priority":2,"issue_type":"feature","owner":"denis.kiselyov@gmail.com","created_at":"2026-03-02T16:21:46.820210376+07:00","created_by":"Denis Kiselev","updated_at":"2026-03-06T11:46:55.740292929+07:00","closed_at":"2026-03-06T11:46:55.740292929+07:00","close_reason":"Already merged in PR #20"}
|
|
130
130
|
{"id":"EV-70","title":"Epic: Fix memory leaks and add memory observability","description":"Evilution processes consume up to 17.2 GB each due to memory leaks. This epic covers: (1) identifying and fixing root causes — double forking, upfront mutation array, source string retention in results, Marshal round-trips; (2) adding runtime memory instrumentation behind --verbose; (3) adding memory budget specs to catch regressions in CI.","status":"closed","priority":1,"issue_type":"epic","owner":"denis.kiselyov@gmail.com","created_at":"2026-03-18T18:51:39.345459861+07:00","created_by":"Denis Kiselev","updated_at":"2026-03-19T14:34:58.765114612+07:00","closed_at":"2026-03-19T14:34:58.765114612+07:00","close_reason":"All 14 sub-issues complete. Memory leaks fixed, observability added, rake memory:check in place for regression detection.","external_ref":"gh-124","labels":["v0.7.0"]}
|
|
@@ -143,6 +143,7 @@
|
|
|
143
143
|
{"id":"EV-70.8","title":"Lazy/streaming mutation generation","description":"Currently generate_mutations builds ALL mutations into an array before any are executed (runner.rb:38). For large codebases this holds thousands of Mutation objects (each with 2x full source strings + AST node) in memory simultaneously. Change to lazy enumeration so mutations are generated per-subject as needed.","status":"closed","priority":1,"issue_type":"bug","owner":"denis.kiselyov@gmail.com","created_at":"2026-03-18T18:52:05.552816007+07:00","created_by":"Denis Kiselev","updated_at":"2026-03-19T00:26:32.161184282+07:00","closed_at":"2026-03-19T00:26:32.161184282+07:00","close_reason":"Changed generate_mutations to lazy enumerator (subjects.lazy.flat_map). Mutations generated per-subject on demand, not all materialized upfront. Baseline now receives subjects instead of mutations. Pre-computed mutation_count passed to run methods for progress/fail_fast.","external_ref":"gh-132","labels":["v0.7.0"],"dependencies":[{"issue_id":"EV-70.8","depends_on_id":"EV-70","type":"parent-child","created_at":"0001-01-01T00:00:00Z"}]}
|
|
144
144
|
{"id":"EV-70.9","title":"Strip source strings from Mutation after result creation","description":"Each MutationResult retains its Mutation which holds original_source and mutated_source (full file contents). These are only needed for diff generation in reporters. Compute and cache the diff eagerly, then release the source strings to allow GC. Or store only the diff in MutationResult.","status":"closed","priority":2,"issue_type":"bug","owner":"denis.kiselyov@gmail.com","created_at":"2026-03-18T18:52:08.1904857+07:00","created_by":"Denis Kiselev","updated_at":"2026-03-19T10:31:19.673577645+07:00","closed_at":"2026-03-19T10:31:19.673577645+07:00","close_reason":"Implemented strip_sources! on Mutation (lazy diff caching, nil out source strings after execution). Wired into Runner sequential and parallel paths.","external_ref":"gh-133","labels":["v0.7.0"],"dependencies":[{"issue_id":"EV-70.9","depends_on_id":"EV-70","type":"parent-child","created_at":"0001-01-01T00:00:00Z"}]}
|
|
145
145
|
{"id":"EV-71","title":"Trim MCP tool response to reduce context window usage","description":"The evilution MCP tool returns full JSON report with all killed mutation diffs (~10k tokens). Only survived mutations are actionable. Trim killed/neutral/timed_out/errors detail arrays in MutateTool.call, keeping summary counts and survived details only.","status":"closed","priority":1,"issue_type":"task","owner":"denis.kiselyov@gmail.com","created_at":"2026-03-19T23:23:32.672265145+07:00","created_by":"Denis Kiselev","updated_at":"2026-03-19T23:31:18.511115181+07:00","closed_at":"2026-03-19T23:31:18.511115181+07:00","close_reason":"Trim killed/neutral/timed_out/errors detail arrays from MCP tool response, keeping only summary and survived details","external_ref":"marinazzio/evilution#178"}
|
|
146
|
-
{"id":"EV-72","title":"Add verbosity control to MCP tool response","description":"Add a verbosity parameter (full/summary/minimal) to the MCP tool to control response size. Default to summary for best context efficiency. Full keeps all entries without diffs, summary omits killed/neutral arrays, minimal keeps only summary + survived.","status":"
|
|
146
|
+
{"id":"EV-72","title":"Add verbosity control to MCP tool response","description":"Add a verbosity parameter (full/summary/minimal) to the MCP tool to control response size. Default to summary for best context efficiency. Full keeps all entries without diffs, summary omits killed/neutral arrays, minimal keeps only summary + survived.","status":"closed","priority":3,"issue_type":"feature","owner":"denis.kiselyov@gmail.com","created_at":"2026-03-19T23:41:41.837080367+07:00","created_by":"Denis Kiselev","updated_at":"2026-03-21T01:16:09.980410196+07:00","closed_at":"2026-03-21T01:16:09.980410196+07:00","close_reason":"Added verbosity parameter (full/summary/minimal) to MCP tool. Default is summary which omits killed/neutral/equivalent arrays. 718 specs passing, 100% mutation score. Updated README.","external_ref":"marinazzio/evilution#179"}
|
|
147
|
+
{"id":"EV-73","title":"Clean up deprecated CLI switches and config options","description":"Remove long-deprecated --diff, --no-coverage flags and coverage config option. GH #176.","status":"closed","priority":2,"issue_type":"task","owner":"denis.kiselyov@gmail.com","created_at":"2026-03-21T00:37:09.266487789+07:00","created_by":"Denis Kiselev","updated_at":"2026-03-21T00:49:24.827479374+07:00","closed_at":"2026-03-21T00:49:24.827479374+07:00","close_reason":"Removed deprecated --diff, --no-coverage CLI flags; removed diff_base, coverage, diff? from Config; removed filter_by_diff from Runner; deleted diff/parser, diff/file_filter, coverage/collector, coverage/test_map and their specs; cleaned up requires. 712 specs passing.","external_ref":"gh-176"}
|
|
147
148
|
{"id":"EV-8","title":"Investigate RSpec state accumulation across mutation runs","description":"RSpec.reset is called between mutations but loaded spec files persist in memory. Long mutation runs may accumulate state from previously loaded specs, potentially causing false positives/negatives. Investigate whether RSpec::Core::Runner.run properly isolates between runs or if additional cleanup is needed.","status":"closed","priority":2,"issue_type":"bug","owner":"denis.kiselyov@gmail.com","created_at":"2026-03-02T16:21:48.618669476+07:00","created_by":"Denis Kiselev","updated_at":"2026-03-05T11:57:56.965910759+07:00","closed_at":"2026-03-05T11:57:56.965910759+07:00","close_reason":"Investigation complete: fork isolation already prevents state accumulation. Added documentation explaining the guarantee and tests verifying independent consecutive runs."}
|
|
148
149
|
{"id":"EV-9","title":"Add multi-Ruby CI test matrix (3.2, 3.3, 4.0)","description":"CI currently only tests Ruby 4.0.1. Add a matrix strategy testing Ruby 3.2, 3.3, and 4.0 to ensure compatibility across supported Ruby versions. Prism ships with Ruby 3.3+ so 3.2 may need the prism gem as a dependency.","status":"closed","priority":2,"issue_type":"task","owner":"denis.kiselyov@gmail.com","created_at":"2026-03-02T16:21:51.239774764+07:00","created_by":"Denis Kiselev","updated_at":"2026-03-05T12:31:51.83181612+07:00","closed_at":"2026-03-05T12:31:51.83181612+07:00","close_reason":"Closed"}
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,39 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.11.0] - 2026-03-21
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- **Nil variants for literal operators** — BooleanLiteralReplacement, IntegerLiteralReplacement, FloatLiteralReplacement, StringLiteralReplacement, and SymbolLiteralReplacement now produce a `nil` mutation alongside their existing replacements (#193)
|
|
8
|
+
- **NilReplacement expansion** — `nil` now mutates to `true`, `false`, `0`, and `""` (was only `true`); covers boolean, numeric, and string contexts (#197)
|
|
9
|
+
- **CollectionReplacement expansion** — added 8 new method swaps: `sort`↔`sort_by`, `find`↔`detect`, `any?`↔`all?`, `count`↔`length` (14 total swaps, up from 6) (#198)
|
|
10
|
+
- **ComparisonReplacement expansion** — added opposite direction flips: `>`↔`<`, `>=`↔`<=` alongside existing boundary and equality mutations (#199)
|
|
11
|
+
- **RegexpMutation expansion** — added always-matching `/.*/` variant alongside the existing never-matching `/a\A/`; each regexp now produces 2 mutations (#200)
|
|
12
|
+
- **ArithmeticReplacement expansion** — added bitwise shift operators `<<`↔`>>` (#189)
|
|
13
|
+
- **MCP verbosity control** — MCP tool responses support configurable verbosity levels (#192)
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
- **Dependency updates** (#191)
|
|
18
|
+
|
|
19
|
+
## [0.10.0] - 2026-03-21
|
|
20
|
+
|
|
21
|
+
### Added
|
|
22
|
+
|
|
23
|
+
- **SendMutation operator** — new mutation operator that replaces method calls with semantically related alternatives (e.g. `detect` ↔ `find`, `map` ↔ `flat_map`, `length` ↔ `size`, `gsub` ↔ `sub`, `send` ↔ `public_send`, and more); 17 replacement pairs covering common Ruby method families
|
|
24
|
+
- **ArgumentNilSubstitution operator** — new mutation operator that replaces each positional argument with `nil` one at a time (e.g. `foo(a, b)` → `foo(nil, b)`, `foo(a, nil)`); skips splat, keyword, block, and forwarding arguments
|
|
25
|
+
- **HTML report** (`--format html`) — self-contained HTML mutation report with dark theme, color-coded mutation map, survived mutation diffs with suggestions, and score badge; written to `evilution-report.html`
|
|
26
|
+
- **Equivalent mutation detection** — automatically identifies mutations that produce semantically identical behavior using four heuristics: noop source (identical before/after), method body nil (empty/nil methods), alias swap (detect↔find, length↔size, collect↔map), and dead code (unreachable statements after return/raise); equivalent mutations are excluded from the mutation score denominator
|
|
27
|
+
- **MCP tool equivalent trimming** — diffs are stripped from equivalent mutation entries in MCP responses alongside killed and neutral entries
|
|
28
|
+
|
|
29
|
+
### Removed
|
|
30
|
+
|
|
31
|
+
- **`--diff` CLI flag** — deprecated since v0.2.0; use line-range targeting instead (e.g. `evilution run lib/foo.rb:15-30`)
|
|
32
|
+
- **`--no-coverage` CLI flag** — deprecated since v0.2.0; had no effect
|
|
33
|
+
- **`diff_base` and `coverage` config keys** — no longer recognized in `.evilution.yml`; config file warnings removed
|
|
34
|
+
- **`Diff::Parser` and `Diff::FileFilter` modules** — dead code removed along with specs
|
|
35
|
+
- **`Coverage::Collector` and `Coverage::TestMap` modules** — dead code removed along with specs
|
|
36
|
+
|
|
3
37
|
## [0.9.0] - 2026-03-19
|
|
4
38
|
|
|
5
39
|
### Added
|
data/README.md
CHANGED
|
@@ -42,10 +42,8 @@ evilution [command] [options] [files...]
|
|
|
42
42
|
| `-t`, `--timeout N` | Integer | 10 | Per-mutation timeout in seconds. |
|
|
43
43
|
| `-f`, `--format FORMAT` | String | `text` | Output format: `text` or `json`. |
|
|
44
44
|
| `--target METHOD` | String | _(none)_ | Only mutate the named method (e.g. `Foo::Bar#calculate`). |
|
|
45
|
-
| `--diff BASE` | String | _(none)_ | **DEPRECATED**: Use line-range targeting instead. Git ref. Only mutate methods whose definition line changed since BASE. |
|
|
46
45
|
| `--min-score FLOAT` | Float | 0.0 | Minimum mutation score (0.0–1.0) to pass. |
|
|
47
46
|
| `--spec FILES` | Array | _(none)_ | Spec files to run (comma-separated). Defaults to `spec/`. |
|
|
48
|
-
| `--no-coverage` | Boolean | false | **DEPRECATED, NO-OP**: Kept for backward compatibility. Will be removed. |
|
|
49
47
|
| `-j`, `--jobs N` | Integer | 1 | Number of parallel workers. Pool forks per batch; mutations run in-process inside workers. |
|
|
50
48
|
| `--no-baseline` | Boolean | _(enabled)_ | Skip baseline test suite check. By default, a baseline run detects pre-existing failures and marks those mutations as `neutral`. |
|
|
51
49
|
| `--fail-fast [N]` | Integer | _(none)_ | Stop after N surviving mutants (default 1 if no value given). |
|
|
@@ -162,6 +160,18 @@ If using Bundler, set the command to `bundle` and args to `["exec", "evilution",
|
|
|
162
160
|
|
|
163
161
|
The server exposes an `evilution-mutate` tool that accepts target files, method targets, spec overrides, parallelism, and timeout options — returning structured JSON results directly to the agent.
|
|
164
162
|
|
|
163
|
+
### Verbosity Control
|
|
164
|
+
|
|
165
|
+
The MCP tool accepts a `verbosity` parameter to control response size:
|
|
166
|
+
|
|
167
|
+
| Level | Default | What's included |
|
|
168
|
+
|-------------|---------|--------------------------------------------------------------|
|
|
169
|
+
| `summary` | Yes | `summary` + `survived` + `timed_out` + `errors` |
|
|
170
|
+
| `full` | | All entries (killed/neutral/equivalent diffs stripped) |
|
|
171
|
+
| `minimal` | | `summary` + `survived` only |
|
|
172
|
+
|
|
173
|
+
Use `minimal` when context window budget is tight and you only need to see what survived. Use `full` when you need to inspect killed/neutral/equivalent entries for debugging.
|
|
174
|
+
|
|
165
175
|
> **Note**: `.mcp.json` is gitignored by default since it is a local editor/agent configuration file.
|
|
166
176
|
|
|
167
177
|
## Recommended Workflows for AI Agents
|
|
@@ -182,8 +192,6 @@ bundle exec evilution run lib/foo.rb:15-30 lib/bar.rb:5-20 --format json --min-s
|
|
|
182
192
|
|
|
183
193
|
Target the exact lines you changed for fast, focused mutation testing. See line-range syntax below.
|
|
184
194
|
|
|
185
|
-
> **Note**: `--diff BASE` is deprecated and will be removed in a future version. Prefer line-range targeting for new workflows.
|
|
186
|
-
|
|
187
195
|
### 3. Line-range targeted scan (fastest)
|
|
188
196
|
|
|
189
197
|
```bash
|
data/lib/evilution/cli.rb
CHANGED
|
@@ -106,22 +106,13 @@ module Evilution
|
|
|
106
106
|
def add_core_options(opts)
|
|
107
107
|
opts.on("-j", "--jobs N", Integer, "Number of parallel workers (default: 1)") { |n| @options[:jobs] = n }
|
|
108
108
|
opts.on("-t", "--timeout N", Integer, "Per-mutation timeout in seconds") { |n| @options[:timeout] = n }
|
|
109
|
-
opts.on("-f", "--format FORMAT", "Output format: text, json") { |f| @options[:format] = f.to_sym }
|
|
110
|
-
opts.on("--diff BASE", "DEPRECATED: Use line-range targeting instead") do |b|
|
|
111
|
-
warn("Warning: --diff is deprecated and will be removed in a future version. " \
|
|
112
|
-
"Use line-range targeting instead: evilution run lib/foo.rb:15-30")
|
|
113
|
-
@options[:diff_base] = b
|
|
114
|
-
end
|
|
109
|
+
opts.on("-f", "--format FORMAT", "Output format: text, json, html") { |f| @options[:format] = f.to_sym }
|
|
115
110
|
end
|
|
116
111
|
|
|
117
112
|
def add_filter_options(opts)
|
|
118
113
|
opts.on("--min-score FLOAT", Float, "Minimum mutation score to pass") { |s| @options[:min_score] = s }
|
|
119
114
|
opts.on("--spec FILES", Array, "Spec files to run (comma-separated)") { |f| @options[:spec_files] = f }
|
|
120
115
|
opts.on("--target METHOD", "Only mutate the named method (e.g. Foo::Bar#calculate)") { |m| @options[:target] = m }
|
|
121
|
-
opts.on("--no-coverage", "DEPRECATED: Has no effect and will be removed in a future version") do
|
|
122
|
-
warn("Warning: --no-coverage is deprecated, currently has no effect, and will be removed in a future version.")
|
|
123
|
-
@options[:coverage] = false
|
|
124
|
-
end
|
|
125
116
|
end
|
|
126
117
|
|
|
127
118
|
def add_flag_options(opts)
|
data/lib/evilution/config.rb
CHANGED
|
@@ -9,11 +9,9 @@ module Evilution
|
|
|
9
9
|
DEFAULTS = {
|
|
10
10
|
timeout: 30,
|
|
11
11
|
format: :text,
|
|
12
|
-
diff_base: nil,
|
|
13
12
|
target: nil,
|
|
14
13
|
min_score: 0.0,
|
|
15
14
|
integration: :rspec,
|
|
16
|
-
coverage: true,
|
|
17
15
|
verbose: false,
|
|
18
16
|
quiet: false,
|
|
19
17
|
jobs: 1,
|
|
@@ -25,14 +23,13 @@ module Evilution
|
|
|
25
23
|
spec_files: []
|
|
26
24
|
}.freeze
|
|
27
25
|
|
|
28
|
-
attr_reader :target_files, :timeout, :format,
|
|
29
|
-
:target, :min_score, :integration, :
|
|
26
|
+
attr_reader :target_files, :timeout, :format,
|
|
27
|
+
:target, :min_score, :integration, :verbose, :quiet,
|
|
30
28
|
:jobs, :fail_fast, :baseline, :isolation, :incremental, :line_ranges, :spec_files
|
|
31
29
|
|
|
32
30
|
def initialize(**options)
|
|
33
31
|
file_options = options.delete(:skip_config_file) ? {} : load_config_file
|
|
34
32
|
merged = DEFAULTS.merge(file_options).merge(options)
|
|
35
|
-
warn_removed_options(merged, file_options)
|
|
36
33
|
assign_attributes(merged)
|
|
37
34
|
freeze
|
|
38
35
|
end
|
|
@@ -45,8 +42,8 @@ module Evilution
|
|
|
45
42
|
format == :text
|
|
46
43
|
end
|
|
47
44
|
|
|
48
|
-
def
|
|
49
|
-
|
|
45
|
+
def html?
|
|
46
|
+
format == :html
|
|
50
47
|
end
|
|
51
48
|
|
|
52
49
|
def line_ranges?
|
|
@@ -107,9 +104,6 @@ module Evilution
|
|
|
107
104
|
|
|
108
105
|
# Stop after N surviving mutants (default: disabled)
|
|
109
106
|
# fail_fast: 1
|
|
110
|
-
|
|
111
|
-
# DEPRECATED: Coverage filtering is deprecated and will be removed
|
|
112
|
-
# coverage: true
|
|
113
107
|
YAML
|
|
114
108
|
end
|
|
115
109
|
|
|
@@ -130,11 +124,9 @@ module Evilution
|
|
|
130
124
|
@target_files = Array(merged[:target_files])
|
|
131
125
|
@timeout = merged[:timeout]
|
|
132
126
|
@format = merged[:format].to_sym
|
|
133
|
-
@diff_base = merged[:diff_base]
|
|
134
127
|
@target = merged[:target]
|
|
135
128
|
@min_score = merged[:min_score].to_f
|
|
136
129
|
@integration = merged[:integration].to_sym
|
|
137
|
-
@coverage = merged[:coverage]
|
|
138
130
|
@verbose = merged[:verbose]
|
|
139
131
|
@quiet = merged[:quiet]
|
|
140
132
|
@jobs = validate_jobs(merged[:jobs])
|
|
@@ -166,18 +158,6 @@ module Evilution
|
|
|
166
158
|
raise ConfigError, "jobs must be a positive integer, got #{value.inspect}"
|
|
167
159
|
end
|
|
168
160
|
|
|
169
|
-
def warn_removed_options(_merged, file_options)
|
|
170
|
-
if file_options.key?(:coverage)
|
|
171
|
-
warn("Warning: 'coverage' in config file is deprecated and ignored. " \
|
|
172
|
-
"This option will be removed in a future version.")
|
|
173
|
-
end
|
|
174
|
-
|
|
175
|
-
return unless file_options[:diff_base]
|
|
176
|
-
|
|
177
|
-
warn("Warning: 'diff_base' in config file is deprecated and will be removed in a future version. " \
|
|
178
|
-
"Use line-range targeting instead: evilution run lib/foo.rb:15-30")
|
|
179
|
-
end
|
|
180
|
-
|
|
181
161
|
def load_config_file
|
|
182
162
|
self.class.file_options
|
|
183
163
|
end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "heuristic/noop_source"
|
|
4
|
+
require_relative "heuristic/method_body_nil"
|
|
5
|
+
require_relative "heuristic/alias_swap"
|
|
6
|
+
require_relative "heuristic/dead_code"
|
|
7
|
+
|
|
8
|
+
module Evilution
|
|
9
|
+
module Equivalent
|
|
10
|
+
class Detector
|
|
11
|
+
def initialize(heuristics: nil)
|
|
12
|
+
@heuristics = heuristics || default_heuristics
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def call(mutations)
|
|
16
|
+
equivalent = []
|
|
17
|
+
remaining = []
|
|
18
|
+
|
|
19
|
+
mutations.each do |mutation|
|
|
20
|
+
if @heuristics.any? { |h| h.match?(mutation) }
|
|
21
|
+
equivalent << mutation
|
|
22
|
+
else
|
|
23
|
+
remaining << mutation
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
[equivalent, remaining]
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
private
|
|
31
|
+
|
|
32
|
+
def default_heuristics
|
|
33
|
+
[
|
|
34
|
+
Heuristic::NoopSource.new,
|
|
35
|
+
Heuristic::MethodBodyNil.new,
|
|
36
|
+
Heuristic::AliasSwap.new,
|
|
37
|
+
Heuristic::DeadCode.new
|
|
38
|
+
]
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Evilution
|
|
4
|
+
module Equivalent
|
|
5
|
+
module Heuristic
|
|
6
|
+
class AliasSwap
|
|
7
|
+
ALIAS_PAIRS = Set[
|
|
8
|
+
Set[:detect, :find],
|
|
9
|
+
Set[:length, :size],
|
|
10
|
+
Set[:collect, :map]
|
|
11
|
+
].freeze
|
|
12
|
+
|
|
13
|
+
def match?(mutation)
|
|
14
|
+
return false unless mutation.operator_name == "send_mutation"
|
|
15
|
+
|
|
16
|
+
diff = mutation.diff
|
|
17
|
+
removed = extract_method(diff, "- ")
|
|
18
|
+
added = extract_method(diff, "+ ")
|
|
19
|
+
return false unless removed && added
|
|
20
|
+
|
|
21
|
+
pair = Set[removed.to_sym, added.to_sym]
|
|
22
|
+
ALIAS_PAIRS.include?(pair)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
private
|
|
26
|
+
|
|
27
|
+
def extract_method(diff, prefix)
|
|
28
|
+
line = diff.split("\n").find { |l| l.start_with?(prefix) }
|
|
29
|
+
return nil unless line
|
|
30
|
+
|
|
31
|
+
match = line.match(/\.(\w+)(?:[\s(]|$)/)
|
|
32
|
+
match && match[1]
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Evilution
|
|
4
|
+
module Equivalent
|
|
5
|
+
module Heuristic
|
|
6
|
+
class DeadCode
|
|
7
|
+
def match?(mutation)
|
|
8
|
+
return false unless mutation.operator_name == "statement_deletion"
|
|
9
|
+
|
|
10
|
+
node = mutation.subject.node
|
|
11
|
+
return false unless node
|
|
12
|
+
|
|
13
|
+
body = node.body
|
|
14
|
+
return false unless body.is_a?(Prism::StatementsNode)
|
|
15
|
+
|
|
16
|
+
statements = body.body
|
|
17
|
+
unreachable_lines = find_unreachable_lines(statements)
|
|
18
|
+
unreachable_lines.include?(mutation.line)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
private
|
|
22
|
+
|
|
23
|
+
def find_unreachable_lines(statements)
|
|
24
|
+
lines = Set.new
|
|
25
|
+
found_unconditional_return = false
|
|
26
|
+
|
|
27
|
+
statements.each do |stmt|
|
|
28
|
+
if found_unconditional_return
|
|
29
|
+
collect_lines(stmt, lines)
|
|
30
|
+
elsif unconditional_return?(stmt)
|
|
31
|
+
found_unconditional_return = true
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
lines
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def unconditional_return?(node)
|
|
39
|
+
node.is_a?(Prism::ReturnNode) ||
|
|
40
|
+
(node.is_a?(Prism::CallNode) && node.name == :raise)
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def collect_lines(node, lines)
|
|
44
|
+
start_line = node.location.start_line
|
|
45
|
+
end_line = node.location.end_line
|
|
46
|
+
(start_line..end_line).each { |l| lines.add(l) }
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Evilution
|
|
4
|
+
module Equivalent
|
|
5
|
+
module Heuristic
|
|
6
|
+
class MethodBodyNil
|
|
7
|
+
def match?(mutation)
|
|
8
|
+
return false unless mutation.operator_name == "method_body_replacement"
|
|
9
|
+
|
|
10
|
+
node = mutation.subject.node
|
|
11
|
+
return false unless node
|
|
12
|
+
|
|
13
|
+
body = node.body
|
|
14
|
+
return true if body.nil? || body.is_a?(Prism::NilNode)
|
|
15
|
+
|
|
16
|
+
return body.body.first.is_a?(Prism::NilNode) if body.is_a?(Prism::StatementsNode) && body.body.length == 1
|
|
17
|
+
|
|
18
|
+
false
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -8,7 +8,7 @@ require_relative "../reporter/json"
|
|
|
8
8
|
|
|
9
9
|
module Evilution
|
|
10
10
|
module MCP
|
|
11
|
-
class MutateTool < ::MCP::Tool
|
|
11
|
+
class MutateTool < ::MCP::Tool # rubocop:disable Metrics/ClassLength
|
|
12
12
|
tool_name "evilution-mutate"
|
|
13
13
|
description "Run mutation testing on Ruby source files"
|
|
14
14
|
input_schema(
|
|
@@ -38,19 +38,26 @@ module Evilution
|
|
|
38
38
|
type: "array",
|
|
39
39
|
items: { type: "string" },
|
|
40
40
|
description: "Spec files to run (overrides auto-detection)"
|
|
41
|
+
},
|
|
42
|
+
verbosity: {
|
|
43
|
+
type: "string",
|
|
44
|
+
enum: %w[full summary minimal],
|
|
45
|
+
description: "Response verbosity: full (all entries, diffs stripped from killed/neutral/equivalent), " \
|
|
46
|
+
"summary (omits killed/neutral/equivalent arrays; default), " \
|
|
47
|
+
"minimal (only summary + survived)"
|
|
41
48
|
}
|
|
42
49
|
}
|
|
43
50
|
)
|
|
44
51
|
|
|
45
52
|
class << self
|
|
46
|
-
def call(server_context:, files: [], target: nil, timeout: nil, jobs: nil, fail_fast: nil, spec: nil) # rubocop:disable Lint/UnusedMethodArgument
|
|
53
|
+
def call(server_context:, files: [], target: nil, timeout: nil, jobs: nil, fail_fast: nil, spec: nil, verbosity: nil) # rubocop:disable Lint/UnusedMethodArgument
|
|
47
54
|
parsed_files, line_ranges = parse_files(Array(files))
|
|
48
55
|
config_opts = build_config_opts(parsed_files, line_ranges, target, timeout, jobs, fail_fast, spec)
|
|
49
56
|
config = Config.new(**config_opts)
|
|
50
57
|
runner = Runner.new(config: config)
|
|
51
58
|
summary = runner.call
|
|
52
59
|
report = Reporter::JSON.new.call(summary)
|
|
53
|
-
compact = trim_report(report)
|
|
60
|
+
compact = trim_report(report, normalize_verbosity(verbosity))
|
|
54
61
|
|
|
55
62
|
::MCP::Tool::Response.new([{ type: "text", text: compact }])
|
|
56
63
|
rescue Evilution::Error => e
|
|
@@ -58,6 +65,8 @@ module Evilution
|
|
|
58
65
|
::MCP::Tool::Response.new([{ type: "text", text: ::JSON.generate(error_payload) }], error: true)
|
|
59
66
|
end
|
|
60
67
|
|
|
68
|
+
VALID_VERBOSITIES = %w[full summary minimal].freeze
|
|
69
|
+
|
|
61
70
|
private
|
|
62
71
|
|
|
63
72
|
def parse_files(raw_files)
|
|
@@ -99,10 +108,32 @@ module Evilution
|
|
|
99
108
|
opts
|
|
100
109
|
end
|
|
101
110
|
|
|
102
|
-
def
|
|
111
|
+
def normalize_verbosity(value)
|
|
112
|
+
normalized = value.to_s.strip.downcase
|
|
113
|
+
normalized = "summary" if normalized.empty?
|
|
114
|
+
return normalized if VALID_VERBOSITIES.include?(normalized)
|
|
115
|
+
|
|
116
|
+
raise ParseError, "invalid verbosity: #{value.inspect} (must be full, summary, or minimal)"
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
def trim_report(json_string, verbosity)
|
|
103
120
|
data = ::JSON.parse(json_string)
|
|
104
|
-
|
|
105
|
-
|
|
121
|
+
case verbosity
|
|
122
|
+
when "full"
|
|
123
|
+
strip_diffs(data, "killed")
|
|
124
|
+
strip_diffs(data, "neutral")
|
|
125
|
+
strip_diffs(data, "equivalent")
|
|
126
|
+
when "summary"
|
|
127
|
+
data.delete("killed")
|
|
128
|
+
data.delete("neutral")
|
|
129
|
+
data.delete("equivalent")
|
|
130
|
+
when "minimal"
|
|
131
|
+
data.delete("killed")
|
|
132
|
+
data.delete("neutral")
|
|
133
|
+
data.delete("equivalent")
|
|
134
|
+
data.delete("timed_out")
|
|
135
|
+
data.delete("errors")
|
|
136
|
+
end
|
|
106
137
|
::JSON.generate(data)
|
|
107
138
|
end
|
|
108
139
|
|