mutineer 1.8.1 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +733 -0
  3. data/README.md +85 -50
  4. data/lib/mutineer/changed_lines.rb +2 -1
  5. data/lib/mutineer/child_cause.rb +149 -0
  6. data/lib/mutineer/child_stdout.rb +12 -1
  7. data/lib/mutineer/cli.rb +540 -59
  8. data/lib/mutineer/command_redact.rb +38 -0
  9. data/lib/mutineer/concern_blocks.rb +95 -24
  10. data/lib/mutineer/config.rb +112 -6
  11. data/lib/mutineer/coverage_map.rb +1345 -156
  12. data/lib/mutineer/daemon_backend.rb +41 -18
  13. data/lib/mutineer/daemon_client.rb +104 -21
  14. data/lib/mutineer/daemon_server.rb +85 -14
  15. data/lib/mutineer/database_urls.rb +189 -0
  16. data/lib/mutineer/external_backend.rb +93 -6
  17. data/lib/mutineer/fs_path.rb +125 -0
  18. data/lib/mutineer/isolation.rb +380 -25
  19. data/lib/mutineer/job_plan.rb +352 -41
  20. data/lib/mutineer/minitest_integration/file_order.rb +56 -0
  21. data/lib/mutineer/minitest_integration/in_test_database_error.rb +243 -19
  22. data/lib/mutineer/minitest_integration.rb +26 -58
  23. data/lib/mutineer/mutant_id.rb +4 -1
  24. data/lib/mutineer/mutation.rb +10 -4
  25. data/lib/mutineer/mutator_registry.rb +6 -3
  26. data/lib/mutineer/mutators/collection_method.rb +195 -6
  27. data/lib/mutineer/mutators/literal_mutation.rb +33 -3
  28. data/lib/mutineer/mutators/range_literal.rb +78 -29
  29. data/lib/mutineer/mutators/rescue_body.rb +126 -0
  30. data/lib/mutineer/mutators/return_nil.rb +23 -6
  31. data/lib/mutineer/output_filter.rb +451 -0
  32. data/lib/mutineer/pairing.rb +463 -31
  33. data/lib/mutineer/parser.rb +53 -0
  34. data/lib/mutineer/project_path.rb +15 -8
  35. data/lib/mutineer/rails_worker_db.rb +366 -6
  36. data/lib/mutineer/reach_probe.rb +229 -0
  37. data/lib/mutineer/redaction.rb +301 -41
  38. data/lib/mutineer/reload_guards.rb +985 -0
  39. data/lib/mutineer/reporter.rb +467 -58
  40. data/lib/mutineer/result.rb +6 -7
  41. data/lib/mutineer/run_seed.rb +16 -0
  42. data/lib/mutineer/runner.rb +194 -55
  43. data/lib/mutineer/source_bytes.rb +187 -0
  44. data/lib/mutineer/statement_lines.rb +108 -14
  45. data/lib/mutineer/test_runners/rspec.rb +118 -10
  46. data/lib/mutineer/test_runners/rspec_seed.rb +151 -0
  47. data/lib/mutineer/test_runners.rb +3 -2
  48. data/lib/mutineer/triage.rb +55 -10
  49. data/lib/mutineer/version.rb +1 -1
  50. data/lib/mutineer.rb +1 -0
  51. data/skills/mutineer/SKILL.md +12 -4
  52. metadata +13 -1
data/CHANGELOG.md CHANGED
@@ -6,6 +6,737 @@ All notable changes to this project are documented here. The format is based on
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [1.9.0] - 2026-11-16
10
+
11
+ ### Added
12
+
13
+ - **New opt-in operator `rescue_body` mutates `rescue` clauses (#418).**
14
+ It replaces the whole body of each `rescue` clause with `nil`, including a one-statement body.
15
+ It also turns `x rescue y` into `x rescue nil`.
16
+ A re-raise or a `retry` body is mutated too, because `nil` swallows the error.
17
+ An empty body, a body that is already `nil`, `(nil)` or `()`, and an `ensure` body give no mutant.
18
+ A body whose value is discarded and that holds only literals and variable reads is declined, and counts in `summary.declined_by_operator`.
19
+ See `docs/equivalent-skips.md`, "Rescue body".
20
+ Before this, no operator mutated a one-statement `rescue` body.
21
+ The default operator set does not change.
22
+ - **`return_nil` reaches a method with a def-level `rescue`, `else` or `ensure` (#418).**
23
+ It replaces the final expression of the body, or of the `else` clause when there is one, with `nil`.
24
+ It does the same for each `rescue` clause. The `ensure` value is not a return value, so it is left alone.
25
+ Before this, `return_nil` gave such a method no final-expression mutant.
26
+ A run with `return_nil` can now report a different number of mutants and new survivors. With `--baseline`, refresh the baseline.
27
+ With both operators, a one-statement `rescue` body gives the same edit twice. The run keeps the `return_nil` mutant, lists the `rescue_body` id in its `copies`, and counts that copy in `dropped`.
28
+ A final explicit `begin ... end` block gets the same mutants as the def-level form, so RuboCop's `Style/RedundantBegin` autocorrect does not change them (#470).
29
+ - **`run` says when an `ignore:` entry matches no mutant (#377).**
30
+ The warning names the id and says the list covers only that run's sources and operators.
31
+ The warning does not change the exit code.
32
+ `--format json` lists the ids in `summary.unmatched_ignores`, in file order, each id once.
33
+ `--dry-run` prints the same warning, and `--dry-run --format json` lists the same ids.
34
+ `--since` does not warn about an entry whose mutant is outside the diff: matching happens before the diff narrows the run.
35
+ A run of some files warns about entries those files and operators do not match. The warning says so.
36
+ A source you passed that has no paired test still counts: its entries are not reported as unmatched, and `run` agrees with `run --dry-run` of the same files.
37
+ `--only` skips the check. The list is then empty, which does not mean every entry matched.
38
+ A dropped repeat of an edit counts as matched.
39
+ An old-format id that still matches is not in this list. The old-id warning still names it.
40
+ `mutineer migrate --dry-run` over every source lists entries that match nothing and exits 1.
41
+ That exit code is the CI check, in 1.x and after 2.0.
42
+ The key is part of schema `1.10`.
43
+ - **A report names the dropped copy of an edit (#374).**
44
+ When two operators, or one operator twice, make the same change on one
45
+ line, one copy runs and the other is dropped. The JSON report now lists
46
+ each dropped id on the kept mutant as `copies`, on survivors, ignored
47
+ mutants, and the other mutant rows. `summary.dropped` counts them. They
48
+ stay out of `total` and out of the score. `mutineer triage` prints an
49
+ `ignore:` entry for the survivor and for each of those ids, so one round
50
+ writes every entry. An entry still ignores only its own id. The human
51
+ report, the HTML report, the dry run, and the Action summary show the
52
+ count. A dropped copy of an ignored mutant is listed on the kept mutant,
53
+ so that entry no longer looks unused. Both keys are part of schema `1.10`.
54
+ - **A source that cannot load alone points at `boot:` (#376).**
55
+ When a source raises `NameError` (including `NoMethodError`) while it
56
+ loads, and the run has no `boot:` file, stderr adds one line. The names
57
+ it needs come from `boot:` or `--boot`, which loads before the sources.
58
+ Listing the entry file as an earlier source also loads it first.
59
+ In that run, `require:` files still load after the sources, so a source
60
+ cannot use them while it loads. With a boot file they load after the
61
+ boot file, and the parent does not require the sources.
62
+ `--test-command` does not load `require:` files. The hint line is absent
63
+ for any other load error, and for a `NameError` in the boot file or a
64
+ `require:` file. A dry run does not load the source, so it does not print
65
+ the line. `--daemon` and `--test-command` do not require sources in the
66
+ tool process, so they do not print it either. `--help` describes `--boot`
67
+ as an app entry point or a gem's `lib/<name>.rb`, and no longer limits it
68
+ to Rails apps.
69
+ - **A run counts sources that have no paired test (#381).**
70
+ The report names each skipped source and how many mutants it holds.
71
+ JSON adds `summary.unpaired_sources`, `summary.unpaired_mutants`, and `unpaired_sources[]`.
72
+ The human report, the HTML report, and the dry run show the same counts.
73
+ Unpaired mutants are excluded from the score and cannot fail `--threshold`.
74
+ They join the unrun-share stderr warning, except under `--fail-fast`.
75
+ That warning does not change the exit code.
76
+ Schema version is `1.10`.
77
+ Compare it as two integers, so `1.10` follows `1.9`.
78
+ On Fizzy at `d5b7b749d`, 106 sources and 312 mutants were unpaired.
79
+ The paired run total was 759, so the share was 29.1%.
80
+ On Fizzy at `f220e4832`, 92 sources and 149 mutants were unpaired.
81
+ The paired total was 922, so the raw share was 13.9%.
82
+ After the 10 ignored mutants leave the denominator, the share is 14.0%.
83
+ Mutineer now parses those sources.
84
+ A disable-line warning or a git-diff warning can name them.
85
+ The Action step summary does not show these counts (#481).
86
+ A dry run with `--rails` or `--boot` and no `--test` still exits 2 (#410).
87
+ #349 measured the unrun share (of attempted plus unrun) on Fizzy at `f220e4832`, with Mutineer at `46ee2bb3`.
88
+ A full daemon run with the default operators had 840 attempted mutants, 1 unplaceable, 0 skipped (invalid) and 149 unpaired.
89
+ Without the unpaired mutants, the share was 1 of 841 (0.12%).
90
+ With them, it was 150 of 990 (15.2%), so the warning fired.
91
+ With all 21 operators, the four paired files that can hold an unrun mutant had 24 under redefine and 20 under reload.
92
+ Against the default run's 840 attempted mutants, that is at most 2.8%.
93
+ The 10% limit stays.
94
+ A share above it that comes from unpaired mutants is a true count, not noise.
95
+ The 2 skipped (invalid) mutants in the all-operator runs came from a `literal_mutation` bug that this release fixes (#469).
96
+ - **A concern pairs with the test that mirrors its namespace (#379).**
97
+ `app/models/concerns/storage/totaled.rb` can pair with `test/models/storage/totaled_test.rb`.
98
+ That path matches `Storage::Totaled`.
99
+ The `concerns/` path still wins when it has a test.
100
+ Existing pairs stay the same.
101
+ Before this, the concern was skipped and added no score.
102
+ The skip line was `no test found by convention`.
103
+ A concern that was skipped can now run.
104
+ That can change a score or a gate.
105
+ `--baseline` treats new survivors as new.
106
+ Refresh the baseline.
107
+ See `docs/ci.md`, "Refresh the baseline".
108
+ A failed namespace load can move a `--threshold` run from exit 0 to exit 1.
109
+ Those mutants move from `no_coverage` to `uncapturable`.
110
+ A `nil` score with a broken mutant then fails the gate.
111
+ The share of mutants with no verdict also rises.
112
+ With `use-bundler: false`, an Action with an empty `version` installs the latest gem.
113
+ Pin `version`, or refresh the baseline, before the next run.
114
+ With `use-bundler: true`, the Gemfile picks the version.
115
+ A failed namespace test does not mark a concern that has a test at its `concerns/` path.
116
+ A namespace split name pairs under #408.
117
+ - **A concern pairs with a split test at its namespace path (#408).**
118
+ `app/models/concerns/storage/totaled.rb` can pair with `test/models/storage/totaled_bytes_test.rb`.
119
+ The `concerns/` path still wins when it has a test that pairs, exact or split.
120
+ A split owned by a longer source does not count.
121
+ A longer source keeps its file when that source pairs with it.
122
+ That includes a longer concern with no test of its own, and a model or `lib/` file of the longer name.
123
+ A model keeps a split file it already pairs with. The concern may use that same file. The model does not lose it.
124
+ A shorter concern keeps a namespace split when the longer concern already has a test at the `concerns/` path.
125
+ The longer concern does not add that file.
126
+ A namespace spec stays the only file. A failed split beside it does not mark the concern.
127
+ Before this, a namespace split name left the concern skipped, with no score.
128
+ A concern that was skipped can now run. That can change a score or a gate.
129
+ `--baseline` treats new survivors as new. Refresh the baseline.
130
+ See `docs/ci.md`, "Refresh the baseline".
131
+ A failed namespace split moves those mutants from `no_coverage` to `uncapturable`.
132
+ On the Fizzy tree measured for #379, no unpaired concern had a namespace split name.
133
+ One of 352 `app/` sources paired with a split file.
134
+ - **Mutineer now reports the methods that got no mutants (#386).** A
135
+ method whose body is one `if` with a `rescue` gets no mutant from the
136
+ default operators, and the run did not say so. The dry run summary now
137
+ ends with `no mutants in N of M methods`, and `--dry-run --verbose`
138
+ prints one `no mutants:` line per method. The human report has a
139
+ `No mutants:` row. The JSON report adds `summary.subjects`,
140
+ `summary.unmutated_subjects` and a top-level `unmutated_subjects[]`
141
+ list, and `schema_version` is now `1.10`. A program that calls
142
+ `Reporter#report` without the method counts gets `null` for all three,
143
+ not `0`; the CLI always fills them. An empty run says how many
144
+ methods it found and points to `--list-operators`. Scores, exit codes,
145
+ the mutants that run and the default operators do not change. The
146
+ README names `condition_true` and `condition_false` for these methods.
147
+ For a one-statement `rescue` body, use the new opt-in `rescue_body`
148
+ operator (#418).
149
+ - **`mutineer config KEY` prints a resolved setting (#394).** It prints the
150
+ `cache_dir` or `baseline` that `mutineer run` would use with the same
151
+ options and `.mutineer.yml`. It writes nothing. An unknown key exits 2. The
152
+ GitHub Action now asks the installed CLI for these two settings, so it no
153
+ longer copies the CLI's rules. With an older installed CLI that does not
154
+ have the command, the Action uses its own copy of the rules, as before.
155
+ - **The JSON report names why a mutant errored (#388).** When the mutant's
156
+ child raises, under `reload`, `redefine` or the daemon,
157
+ `no_verdict[].details` now holds `Class: first message line`, at most 500
158
+ characters, for example `ArgumentError: enum declared twice`. Before, it
159
+ said only `child exited with status 2` or `daemon verdict: error`, and the
160
+ cause was on stderr alone. The line is redacted in the child, and every
161
+ `details` value is redacted again when the report is written.
162
+ - **Errored mutants without a raised exception name their cause (#417).** A
163
+ Minitest database connection or lock error puts
164
+ `a test failed with a database error: Class: message` in `details`. An
165
+ RSpec error outside examples uses a fixed line that names that case. A
166
+ `--matrix` early end after a serial database error uses its own fixed
167
+ line. `--test-command` and the human/HTML errored lists stay deferred (#480).
168
+ - **A daemon crash names itself in `details` (#388).** A mutant whose daemon
169
+ died or did not reply in time now has `daemon crashed` or `daemon stopped
170
+ answering`, not `daemon verdict: error`.
171
+ - **`no_verdict[]` entries gain `operator` and `token` (#388),** as in
172
+ `no_coverage[]`. Both are `null` for an entry with no mutant. Schema
173
+ `1.10`.
174
+ - **`.mutineer.yml` accepts a `tests:` map (#382).**
175
+ Each entry names `sources` and `tests` patterns.
176
+ When the run holds a matching source, those test files join the run's test list beside convention-paired tests.
177
+ Coverage still picks the tests for each mutant.
178
+ `--test` replaces pairing and the map.
179
+ A malformed map exits 2; without `--test`, a pattern that matches no file exits 2 (including `--dry-run`).
180
+ - **`--test` accepts a file, a directory, or a quoted glob (#380).**
181
+ A directory selects `*_test.rb`, `*_spec.rb`, and `test_*.rb` files.
182
+ It skips `test_helper.rb`.
183
+ A blank value exits 2.
184
+ A directory or glob with no test file exits 2.
185
+ With `--test-command`, an empty directory stays as typed.
186
+ Each expanded directory or glob prints its file count on stderr.
187
+ The Action `test` input accepts a directory.
188
+ A directory needs mutineer 1.9.0 or later.
189
+ - **JSON reports list every killed mutant (#361).** `--format json` adds a
190
+ top-level `killed[]` of lean mutant objects (`subject`, `file`, `line`,
191
+ `operator`, `token`, `id`), sorted like `no_coverage[]`. Its length equals
192
+ `summary.killed`. `schema_version` is `1.10`.
193
+ - **`--dry-run --format json` prints candidates with stable ids (#362).** The
194
+ document carries `mutants[]` (same lean shape) and a summary with `total`,
195
+ `by_operator`, `declined`, and `declined_by_operator`. Ids match a later real
196
+ run of the same job plan. `--output` writes the file; `--format html` under
197
+ `--dry-run` stays human and warns that the format is unused.
198
+
199
+ ### Changed
200
+
201
+ - **Behavior change.** An in-process `--since` run with no mutant on a changed line
202
+ skips the coverage map (#396). It no longer boots the app or runs the unmutated suite to say there is nothing to test.
203
+ A red suite or a boot file that fails no longer fails that run.
204
+ A missing `--boot` or `--require` file is still a usage error.
205
+ Thanks to @dannyward630.
206
+ - **`collection_method` skips `each` and `map` when the result is discarded (#436).**
207
+ For Enumerable, `each` returns the receiver and `map` returns a new array.
208
+ No test can tell those two apart when that value is thrown away.
209
+ A method of either name on another class can still differ. The check does
210
+ not see the class, so that skip can hide the difference.
211
+ The swap is declined, and the dry run and JSON report count it in
212
+ `declined_by_operator`.
213
+ The last expression of a method, block, or lambda is still swapped.
214
+ So are assignment, an argument, a chained call, `return` / `break` / `next`,
215
+ and a condition.
216
+ A `while`, `until`, `for`, or `ensure` body is skipped, including its last line.
217
+ The value read by string or symbol interpolation, a backtick or `%x`
218
+ command, or an interpolated regexp still swaps. Interpolation calls `to_s`
219
+ on that value, the command runs, and the regexp is compiled, even when
220
+ their result is thrown away. An earlier statement inside the interpolation
221
+ is still skipped. `defined?` does not evaluate its operand, so an `each` or
222
+ `map` inside it is skipped, including a `lazy` chain and an interpolation.
223
+ A hash key still swaps, because insertion calls `hash` and `eql?`.
224
+ The last line of each `rescue` clause, including a later clause, is kept or discarded as its `begin` is.
225
+ A receiver chain that calls `lazy` still swaps, because `Enumerator::Lazy#each`
226
+ runs the block and `Lazy#map` does not.
227
+ A lazy enumerator stored in a variable is still skipped.
228
+ `all?`, `any?`, `first`, `last`, `min`, `max`, `select`, and `reject` are unchanged.
229
+ The operator is not in the default set, so a default run's mutant count and
230
+ score do not change.
231
+ On `lib/` of this repository, 86 of 149 `each` and `map` calls are discarded
232
+ (57.7%).
233
+ The other 313 `collection_method` swaps on `lib/` stay.
234
+ The operator's mutant count there drops from 462 to 376.
235
+ A run that names `collection_method` can report fewer mutants and a different score.
236
+ With `--baseline`, refresh the baseline.
237
+ The report that opened the issue found this mutant in 4 of 23 ignore entries.
238
+ See `docs/equivalent-skips.md`.
239
+ - **Behavior change.** A continuation-line survivor that ran is scored (#345).
240
+ Ruby counts one line of a statement. A mutant on a later line is a `:maybe`
241
+ selection (#254, #289): Mutineer runs the tests of the statement's other
242
+ lines, and a kill already counted. A survivor was `no_coverage` even when
243
+ those tests had run the mutated expression, so it left the score. The child
244
+ now writes a sentinel the first time that expression returns during a test.
245
+ That survivor moves from `no_coverage` to `survived`: it appears in
246
+ `survivors[]` and in `summary.survived`, and it leaves `summary.no_coverage`.
247
+ It enters the score. A survivor the sentinel does not record stays
248
+ `no_coverage`, still outside the score, and `summary.no_coverage` still
249
+ counts it. The same rule covers a trailing operator (`&&`, `+`), a method
250
+ chain, a multi-line argument list, a hash entry, and a heredoc
251
+ interpolation, under `reload`, `redefine`, and `--daemon`. A call that runs
252
+ only while the mutant file loads does not count: that write is cleared
253
+ before the tests. A raise inside the expression does not count, so an
254
+ operand that fails before a mutated operator runs stays `no_coverage`.
255
+ Every one of the 24,918 mutants from every operator on this gem's `lib/`
256
+ and `test/fixtures/` either does not re-parse, as before, or wraps. The
257
+ fallback that would leave an unwrappable mutant as `no_coverage` did not
258
+ occur. A score can fall. A `--threshold` gate that passed can fail.
259
+ `--baseline` treats the new survivors as new. Refresh the baseline.
260
+ - **A coverage cache hit checks only the tests that cover the sources
261
+ (#398).** Before, a hit ran every `--test` file alone and then all of them
262
+ together. Now it runs only the files that cover a line of the run's
263
+ sources. With the built-in runner, a mutant runs only those files, so the
264
+ other files cannot change a result. `--test-command` builds no coverage
265
+ map, so its clean run still runs every `--test` file. A red covering test
266
+ still stops the run. A file whose last capture failed is captured again
267
+ on each hit and does not also run alone. The together check after a
268
+ fresh capture and with `--coverage-from` also uses the covering files
269
+ only. Mutineer prints one stderr line with the number of files it did not
270
+ check. When no test covers any source line, every file is still checked.
271
+ A standalone run no longer treats a line that ran only while the sources
272
+ loaded as coverage of every test (#426).
273
+ - **Behavior change.** On a cache hit, a red test that covers no source
274
+ line no longer stops the run. A fresh capture still stops on it, because
275
+ capture runs every test (#96). So the same red test can stop a cold run
276
+ and pass a warm one.
277
+ - **A method-body edit recaptures only the tests that cover that source
278
+ (#421).** The cache stores a run-inputs digest, a skeleton of each
279
+ source, and a fingerprint of each test. When a source changes only
280
+ inside method bodies, and the edit does not move a line or change a
281
+ method that ran at load, the next run recaptures the tests in that
282
+ source's map entries, plus any test file that was added or edited.
283
+ The paired test keeps lines that ran only at load. Recapturing
284
+ another test does not give it those lines, or another source's
285
+ load-only lines. The map matches a full capture. A red covering test
286
+ still stops the run. A class-body edit, an added or removed line, a
287
+ load-time method, a `--require` file, a change to which test pairs
288
+ with a source, or a project file the tests load still recaptures
289
+ every test. A cache saved before this change rebuilds once.
290
+ #421 stays open for files outside the run's sources, and for the
291
+ Fizzy timing check.
292
+ - **The error for a test file passed as a source names three fixes (#380).**
293
+ Quote the glob, pass the directory, or repeat `--test`.
294
+ - **`--dry-run` exits 2 for a blank `--test` or a directory with no test file (#380).**
295
+ Those values used to exit 0 on a dry run.
296
+
297
+ ### Fixed
298
+
299
+ - **A clean check that times out is reported as a timeout (#476).**
300
+ The combined clean check runs the files selected for the clean check in one process.
301
+ It had the same deadline as one file's capture, 120 s by default.
302
+ A green suite that took longer was killed and reported as "the unmutated suite is not green (combined suite)", with the seed hint.
303
+ Now the message says the check timed out after N s, that no test failed, and to set `--capture-timeout` above the longest deadline that passed.
304
+ A real failure still says "not green". When one check times out and another file fails, the message names both.
305
+ The combined check's deadline is now the larger of `--capture-timeout` and 1.5 times the summed capture seconds of the files it runs, rounded up.
306
+ A per-file clean check on a cache hit that times out is reported the same way.
307
+ - **`literal_mutation` no longer writes `""` over a string that has no quotes of its own (#469).**
308
+ That covers a heredoc line, a part of a `%(...)` or `%Q(...)` string, a `%w[]` or `%W[]` element, and a text part of a regex, a backtick string or an interpolated symbol (`:"a#{x}"`, a `%I[]` element).
309
+ The edit inserted text instead of emptying the string. Some of these mutants broke the parse and were counted as skipped (invalid). The others ran as the wrong edit.
310
+ Each such string is now declined and counts in `summary.declined_by_operator`. A text part of a `"..."` string still mutates, because `""` closes and reopens the string.
311
+ A run with `literal_mutation` can report fewer mutants. With `--baseline`, refresh the baseline.
312
+ On Fizzy at `f220e4832` (392 files in `app/` and `lib/`), `literal_mutation` made 1290 `""` mutants before this change, and 6 of them did not parse. It now declines 147 of them (11.4%) and makes 1143, none invalid.
313
+ - **A standalone cache hit no longer checks every test just because each
314
+ test loads the sources (#426).** Standalone capture loads every source
315
+ before each test. The class line, the `def` line, and any other line that
316
+ runs only then were credited to every test, so the clean check kept them
317
+ all. Those lines still count as `ran_at_load`. A test keeps such a line
318
+ when it is a convention-paired test for that source. A `tests:` map entry
319
+ does not count. When the run has no convention-paired test for the source,
320
+ every test keeps the line, so a reload kill is not dropped.
321
+ A line the test runs after the sources load stays credited to that test,
322
+ including the `def` line of a method the test calls. Boot and daemon runs
323
+ already omitted the load lines and do not change. A coverage cache saved
324
+ before this change rebuilds once. So does a cache whose paired tests no
325
+ longer match, including when an exact spec that the run did not select
326
+ appears or disappears and replaces a split test.
327
+ **Score effect.** The exact-survivor oracle does not change. A reload kill
328
+ of a line that runs only at load stays a kill when the convention-paired
329
+ test is in the run (`Catalog.price`, and a hook def the file calls while
330
+ it loads). `--strategy redefine` still reports `ran_at_load` for that line.
331
+ An unpaired test no longer runs that mutant when a convention-paired test
332
+ is in the run.
333
+ A kill that only the unpaired test would have caught can become
334
+ `ran_at_load` or a survivor. The checked fixtures do not hit that case.
335
+ Issue #467 tracks that case and the run with no paired test.
336
+ - **A restored subclass skip keeps the reloaded parent conditions (#440).**
337
+ A parent callback with `if:` or `unless:`, and a subclass `skip_callback`
338
+ with `if:` or `unless:`, leave a merged copy on the subclass. Reloading
339
+ the parent appended the new callback and dropped that copy. The reload
340
+ then put the copy back, so the subclass still ran the parent's old
341
+ conditions. The copy is now built again from the reloaded callback, and
342
+ the subclass's own conditions are added the way `skip_callback` adds
343
+ them. A subclass callback that is not that copy stays as it was. So
344
+ does a copy left when the parent callback had no conditions (#414):
345
+ there is no parent condition object to carry, and a subclass callback
346
+ of the same name must not be rewritten. A parent condition that is only
347
+ a symbol, or another interned object, is also left on the old copy. An
348
+ independent subclass callback can name that same symbol, so the symbol
349
+ is not evidence of a `skip_callback` merge. A Proc copied from the
350
+ parent is evidence, and that Proc is carried. Redefine does not re-run
351
+ the class body, so it does not take this path. Reload and the daemon do.
352
+ - **A non-ASCII path and a non-UTF-8 source no longer stop the run (#346).**
353
+ With `LANG` and `LC_ALL` unset, a source file, test file, or project
354
+ folder whose name is not ASCII made coverage fail, or the path missed
355
+ its match, so the run stopped or scored those mutants `no_coverage`.
356
+ Those mutants now get a verdict, so a score can change. With `--baseline`, refresh the baseline.
357
+ Paths are read as UTF-8 when the bytes are UTF-8, and as binary
358
+ otherwise, and compared in that encoding. Minitest is given the path
359
+ in `Dir.pwd`'s encoding when those bytes are valid there, and as binary
360
+ otherwise (under `LC_ALL=C` that encoding is already binary). Its
361
+ failure backtrace is retagged the same way, so a killed mutant is not
362
+ reported as an error. RSpec is given the
363
+ path as UTF-8, which its path regexp requires.
364
+ This covers the in-process coverage subprocess, the fork capture used
365
+ by `--rails` and `--daemon`, pairing (including a split test name),
366
+ and `--since` path keys.
367
+ A source file whose magic comment names an encoding (`# encoding: EUC-JP`,
368
+ and the other forms Ruby accepts) is read in that encoding. The comment
369
+ is taken from the first line, or the second after a shebang, within the
370
+ first 4096 bytes. The mutant keeps those bytes, so Ruby can load it.
371
+ The daemon receives the text through JSON, which is Unicode, and writes
372
+ the file back in the encoding the comment names. The comment forms are
373
+ the ones Ruby accepts, including an indented comment and a vim
374
+ `fileencoding` modeline. `# encoding=NAME` with no space is not one of
375
+ them. A file with no such comment is still read as UTF-8. A redefine
376
+ snippet has no comment of its own, so the write adds one when the
377
+ snippet is already in another encoding. The daemon still reads `db/schema.rb`
378
+ as UTF-8. `rails_worker_db.rb` loads on the app's Ruby, which may not
379
+ ship Prism, and requiring Prism there would turn off worker-database
380
+ routing.
381
+ - **The clean check and the mutant runs share one RSpec seed, and one order inside a Minitest file (#282).**
382
+ A random RSpec order used a new seed in every process.
383
+ The clean check and a mutant run could disagree, and a hang could score `killed` on one run and `timeout` on the next.
384
+ A random order now uses seed `1` for coverage capture, the clean checks and the mutant runs, unless the suite sets a seed (`--seed`, `--order rand:N`, `SPEC_OPTS`, `.rspec`, or `config.seed`).
385
+ A defined order is left as it is.
386
+ A mutant run now passes each spec file by its real path, as the clean check does.
387
+ RSpec hashes that path into the random order, so a symlinked project root (such as `/var` on macOS) no longer gives the two runs different orders.
388
+ Reading `config.seed` in a spec helper, as the generated `Kernel.srand config.seed` does, does not set one.
389
+ A `config.seed=` in a spec helper, a `--require` file, or the boot file does, and the clean check and the mutant runs keep it.
390
+ The coverage cache includes `SPEC_OPTS` and the project `.rspec` and `.rspec-local` files, so a changed seed there is captured again.
391
+ `~/.rspec` is not part of that cache key.
392
+ Minitest already used seed `1`.
393
+ Classes inside one file were still shuffled with the whole class list, so adding a file changed their order.
394
+ Each file is now shuffled from that seed alone, on the clean check and the mutant runs.
395
+ Files run in the order that run was given.
396
+ A mutant run's files stay in coverage order (paired, then cheapest).
397
+ The combined clean check uses the order the tests were given.
398
+ Those two file lists can differ.
399
+ `--test-command` still sets no seed (#368).
400
+ A coverage cache from another `SPEC_OPTS`, or from a version that did not pin the RSpec seed, is captured again.
401
+ - **Direct stderr and stdout hide the `DATABASE_URL` password in more cases (#341).**
402
+ A boot file, a forked test, and a program that test starts inherit a pipe.
403
+ Mutineer copies each line and hides the `DATABASE_URL` password before the
404
+ line reaches the terminal. `abort` in a boot file is included. A line with
405
+ no password is unchanged. A fork that sets `DATABASE_URL` itself is
406
+ redacted in that process. A password that contains a newline stays
407
+ together until a newline follows it or the stream ends, so neither half is
408
+ printed. The daemon does not boot when stderr cannot be redirected. A fork
409
+ whose own copier cannot start writes nothing further. A fork that execs a
410
+ program hands it the parent's pipe, so that output is still shown and
411
+ redacted. If the program would run with a `DATABASE_URL` the parent does
412
+ not know, its output is dropped instead. The same holds for `spawn` and
413
+ `system` when their environment hash sets a `DATABASE_URL` this process
414
+ does not know. That program's own redirects of stdout and stderr are
415
+ replaced too, so an `Open3` capture of it gets no output. Other ways to start a program with its own password, such
416
+ as backticks, `IO.popen`, or a shell command that sets the variable, still
417
+ pass that password through. Shutdown writes every byte already
418
+ queued, including a report a slow reader has not taken yet. The daemon does this in its own process, so a
419
+ password the boot file assigns is hidden even when the tool's environment
420
+ does not have it. `--test-command` output is redacted with the tool's
421
+ `DATABASE_URL` and with `DATABASE_URL` from dotenv files in the project
422
+ (`.env`, `.env.local`, `.env.development`, `.env.development.local`,
423
+ `.env.test`, `.env.test.local`). A double-quoted value may span lines. A
424
+ quote that never closes is a plain value on its own line, as in dotenv. A
425
+ backslash before `$` is a literal dollar. An invalid byte does not stop
426
+ the read. A Ruby process the command starts hides a bare password it
427
+ assigns itself, including one set only in that process (#457). A program
428
+ that is not Ruby ignores that copier, so when that Ruby execs a program
429
+ with a `DATABASE_URL` the tool did not know, the program's output is
430
+ dropped. A password inside a URL is still hidden.
431
+ - **Redaction no longer blanks a host, a database name, one character, or a
432
+ common word (#341).** A password that equals the host or the database name
433
+ stays readable outside a URL, as a password that equals the username
434
+ already did. A one-character password (`a`, `1`) stays readable outside a
435
+ URL, so it does not erase that character from every line. The words
436
+ `password`, `test`, `secret`, `postgres`, and the rest of the list in
437
+ `Redaction::COMMON_WORDS` stay readable as bare words. The password is
438
+ still hidden inside a URL and as the value of a `password=` parameter.
439
+ Local and CI URLs often use these words. A production password usually
440
+ does not.
441
+ - **A `file:` SQLite name locks the file it opens (#412).**
442
+ `file:storage/test.sqlite3?mode=rwc` takes the same run lock as
443
+ `storage/test.sqlite3` when both names open that file. A second daemon
444
+ run stops with `another Mutineer run is using <file>`. A memory URI
445
+ (`file::memory:` or `mode=memory`) takes no lock. An empty `file:` URI
446
+ is a private temporary database and takes no lock. A relative `file:`
447
+ path is resolved from the working directory, which the daemon sets to
448
+ the app root before the lock. A later `mode` that adds write or create
449
+ access, such as `mode=ro&mode=rw`, is a URI SQLite rejects, so it takes
450
+ no lock. Other run-lock gaps are unchanged (#416): in-process `--rails`
451
+ runs, the lock taken after boot and `--require` files, a prepare daemon
452
+ that fails to boot, and the `--jobs 1` respawn window. A custom VFS that
453
+ does not open the URI path is not covered.
454
+ - **An RSpec example's database error scores `error`, and a parallel Minitest
455
+ class follows queue order (#347).** The first failed RSpec example now
456
+ follows the Minitest rule. An Active Record connection or lock error
457
+ (`ConnectionNotEstablished`, including pool timeouts, `ConnectionFailed`,
458
+ `Deadlocked`, `LockWaitTimeout`) scores `error`, on a full run, a stop, and
459
+ `--matrix`. A later example's connection error does not change an earlier
460
+ assertion. On Rails 8, `ConnectionNotDefined` is a code error and still scores
461
+ `killed`. Rails 7.2 raises a plain `ConnectionNotEstablished` for an undefined
462
+ connection, so that mutant scores `error`. Other statement errors, such as bad
463
+ SQL, still score `killed`. A `before` hook counts as the example's own exception. An `after`
464
+ hook does not replace it. The stderr line is the same one Minitest writes.
465
+ With `--matrix`, that example is not a killer and the row stays incomplete.
466
+ There is no `--daemon` for RSpec. Errors are out of the score, so a lost
467
+ connection during a run no longer raises it, and a run that used to count
468
+ the example as a kill can change its score or fail `--threshold`. Refresh
469
+ the baseline when that happens.
470
+ Under Minitest `parallelize_me!`, the first failure is the earliest test in
471
+ the queue, not the thread that finishes first. A serial failure still
472
+ decides, because those classes run first. A mutant that mixed a database
473
+ error and an assertion in one parallel class no longer flips between
474
+ `killed` and `error` across runs. The JSON report names a Minitest
475
+ in-test database error in `no_verdict[].details` (#417). It does not name
476
+ an RSpec example's database error (#480). Active Record 7.2
477
+ reports SQLite `database is locked` as `StatementInvalid`, so that mutant
478
+ still scores `killed` (#347).
479
+ - **`--strategy redefine` no longer false-kills path anchors in a read-only
480
+ source directory (#339).** Redefine loads the mutated method from a hidden
481
+ file. When that directory is not writable, the file is in the system temp
482
+ directory. `__dir__`, `__FILE__`, and `require_relative` then pointed there,
483
+ so every mutant raised `ENOENT` or `LoadError` and scored `killed`. The
484
+ snippet now resolves those against the original source file, including
485
+ calls on `self` and `Kernel` and `send` with a literal name, whether the
486
+ directory is writable or not. A leading `~` stays a path segment, and the
487
+ load does not call an instance method named `require`. A symlinked source keeps the loaded path for
488
+ `__FILE__` and the real directory for `__dir__` and `require_relative`. A
489
+ test that checks `__FILE__` against the source path used to fail for every
490
+ redefined mutant. It now fails only when the mutation changes the result,
491
+ so a redefine score can go down. Reload, in process and on the daemon,
492
+ still needs a writable directory: the write fails and the mutant scores
493
+ `error`, which stays out of the score. The read-only warning is gone.
494
+ - **A killed mutant stays killed when the failure message holds raw bytes (#434).**
495
+ Rails' `assert_response` appends a short response body as raw bytes.
496
+ The reporter prints that message on the silenced stdout.
497
+ After Rails sets both `Encoding.default_external` and `Encoding.default_internal`
498
+ to UTF-8, that write raised `Encoding::UndefinedConversionError`, and the child
499
+ scored the mutant `errored`. The silenced stdout is binary now, so the bytes
500
+ are discarded and the failure still counts as a kill. Those mutants move
501
+ from `errored` into the score, so a score can rise. This holds for
502
+ in-process reload and redefine runs and for daemon reload runs.
503
+ The daemon forces reload; redefine is not available there.
504
+ RSpec already writes its failure text to a StringIO, which accepts the bytes.
505
+ - **A mutant in `define_method` or `define_singleton_method` on a load line is `ran_at_load` (#435).**
506
+ A class method such as `greets` runs when the including class loads.
507
+ Rails turns eager load on when `CI` is set, so that call happens before
508
+ the mutant. The call's own mutants were `ran_at_load`. A mutant of a
509
+ string inside the block on that same line was a survivor, and the score
510
+ fell to 0.0. It is now `ran_at_load` too, under `reload`, `redefine`, and
511
+ the daemon. A kill still counts. `CI` itself changes nothing: only
512
+ whether the line ran at load does. Without eager load the class loads
513
+ after the mutant, and those mutants stay killed. An equivalent
514
+ `each` → `map` still survives in that case. On the reported method, 2 of
515
+ 5 mutants moved, so that run's score goes from 0.0 to no score. A run
516
+ that still has other survivors can score higher, because these mutants
517
+ leave the denominator. `--threshold` passes a nil score when no mutant broke, as here. The new case is
518
+ a `define_method` or `define_singleton_method` call whose line ran at
519
+ load, including the block that call stores. Another block on that line,
520
+ such as `each` with an empty array, stays scored: the line can count
521
+ without the block, and a test can run the mutated block. An
522
+ empty `each` that shares its line with `define_method` can still hide
523
+ that call (#286). That needs the call to have been made with no elements while
524
+ the class loaded, then again with elements by a test that does not check
525
+ the generated method. The reported call is `greets :alice`. Re-running
526
+ the caller's class body, so these mutants can be killed, stays #389. A
527
+ one-line or endless `def` still uses its call count, so a block on the
528
+ `def` line is unchanged (#389).
529
+ - **An endless range on a Hash, Proc, or other non-literal receiver is swapped (#344).**
530
+ The `range` operator skipped an endless range (`1..`, `1..nil`) used as an
531
+ index of `[]`, `[]=`, `slice`, `slice!`, `byteslice`, `bytesplice`,
532
+ `values_at`, or an index write. The only exception was a constant whose
533
+ name contained a lower-case letter, such as `Array[1..]`. Every variable,
534
+ call, and other constant was skipped, including `HASH[1..]`, `ARGV[1..]`,
535
+ `list[1..]`, `fn[1..]`, and `{(1..) => :a}[1..]`. A Hash, a Proc, and a
536
+ custom `[]` or `slice` can tell `1..` from `1...`, so the skip hid a mutant
537
+ a test can kill. The operator now skips that range only when the receiver
538
+ is an array or string literal, including parentheses around one. A
539
+ `begin` counts only when every branch that can supply its value is such
540
+ a literal, so a rescue or an else that returns a Hash is swapped.
541
+ Backticks are swapped too, because `` ` `` can be overridden. A
542
+ variable, a call, or a constant is swapped, and an earlier
543
+ assignment is not followed. On a real Array or String the new mutant is
544
+ often equivalent, as in `argv[1..]` or `text.byteslice(offset..)`. In this
545
+ gem's `lib/`, 14 such ranges were skipped and none was a literal, so a
546
+ `range` run there goes from 45 mutants to 59. A run that names `range`
547
+ can gain mutants, survivors, and new mutant ids. Re-check `ignore:` entries
548
+ for `range`, and save a new baseline. Active Record conditions such as
549
+ `where(created_at: time..)`, `where.not`, `find_by`, and `exists?` were
550
+ already swapped. They still are: both ranges become the same `>=` SQL.
551
+ Suppress one equivalent mutant with an `ignore:` entry.
552
+ `# mutineer:disable-line range` hides every `range` mutant on that line,
553
+ so use it only when every one of them is equivalent.
554
+ - **Reload pairs a repeated callback when the other entry is a different one (#413).**
555
+ After a class body ran again, the repeat was paired by kind and by a
556
+ filter identity that still put different callbacks in one bucket.
557
+ `&:name` procs have no source, so they shared one bucket. Blocks in
558
+ the reloaded file shared a bucket when Ruby gave them the same label,
559
+ with no comparison of their code. A validator shared a bucket with
560
+ another of its class and attributes, with no comparison of option
561
+ names. `if:` and `unless:` were not part of the bucket. The class
562
+ body's new copy then stayed beside the old one, and a test that
563
+ counts errors or callback runs killed every mutant of the file.
564
+ `&:name` now matches the symbol. A block matches its code, so a value
565
+ it captured that differs on each load (a new object, a time, a random
566
+ value) still pairs when no other entry has that code. A validator
567
+ matches its option names, not values a mutant method can change. An
568
+ `if:` or `unless:` is part of the match.
569
+ A concern entry that is the same symbol, the same code, or the same
570
+ option names still cannot be told apart, so both copies stay. A
571
+ callback the class body adds only on its first run (`@done ||=`) still
572
+ keeps every identical copy. Issue #479 tracks those cases. Full reload
573
+ (#389) would build the class once. Reload and the daemon share this
574
+ path. Redefine does not run the class body again, so it does not add
575
+ the second copy.
576
+ **Score change:** a Rails model whose test counts those callbacks can
577
+ now show survivors that were false kills, so its score can go down.
578
+ - **`--since` narrows the No mutants method count (#420).**
579
+ `summary.subjects`, `summary.unmutated_subjects`, and `unmutated_subjects[]`
580
+ keep methods whose `def` range intersects a changed line. The human and
581
+ dry-run lines no longer say the count is un-narrowed.
582
+ - **The HTML report and Action step summary show the No mutants count (#419).**
583
+ HTML adds `no_mutants` / `methods` (and `declined` when present). The Action
584
+ summary table gains a No mutants column from `summary.unmutated_subjects`.
585
+ - **A not-green clean run names the failing test and the first error (#360).**
586
+ The SmokeCheckError line still says `not green` once and lists the files.
587
+ It now also prints the reporter's failing test name and first failure
588
+ message (capped), for Minitest and RSpec, including `--rails` / `--daemon`
589
+ forks and a warm-cache clean check.
590
+ - **The Action accepts an `output` path that starts with a dash, a tilde, or
591
+ ends in a newline (#401).** Before, `output: -dash/pr.json` stopped the step
592
+ with a `dirname` or `ruby` usage error, so a same-file `baseline` was not
593
+ checked. Path ops use Ruby (portable on macOS BSD tools) with `--`, so a
594
+ leading dash stays a path. `report=` uses `File.absolute_path`, so a
595
+ literal `~` name is not treated as a home shortcut. An `output` folder or
596
+ file name that ended in a newline lost it, so the report went to the wrong
597
+ place or the `report` output named the wrong path. A folder that differs
598
+ from the cache directory only by a newline is not created. The same-file
599
+ error keeps a newline in the path. The Action test runs one table of
600
+ unusual names (space, newline, leading dash, `*`, non-ASCII, `~`) through
601
+ every path input. A `.mutineer.yml` baseline that ends in a newline works
602
+ with `mutineer config` (#394).
603
+ - **A reload of a parent class no longer puts a skipped callback back on
604
+ its subclasses (#414).** With the subclasses already loaded, Rails
605
+ appended the parent's `before_save` again, including onto a subclass
606
+ that had skipped it. Saves then failed, and a weak test looked strong.
607
+ Reload, redefine, and the daemon now leave each subclass chain as it was.
608
+ A callback replaced on one chain stays on every other chain.
609
+ - **A second SQLite daemon run stops instead of sharing worker files (#404).**
610
+ Two `--rails --daemon` runs in one checkout used the same worker database
611
+ files, and both could stop with a false "the unmutated suite is not green".
612
+ A run now holds a lock on `<base file>-mutineer.lock` beside the database
613
+ file, and a second run stops with `another Mutineer run is using <base>`,
614
+ as PostgreSQL and MySQL runs already do. Mutineer never deletes the lock
615
+ file. A `file:` name that opens a disk file takes that same lock (#412).
616
+
617
+ ## [1.8.2] - 2026-11-10
618
+
619
+ ### Fixed
620
+
621
+ - **Redaction no longer hides a password inside other words (#341).** A
622
+ form of the database password (raw, decoded or escaped) longer than 3
623
+ characters, made only of ASCII letters, digits and underscores, is now
624
+ hidden only as a whole word, like a short one. With
625
+ password `test`, the backtrace path `user_test.rb` stays readable. Such a
626
+ password inside a longer word is no longer hidden. The word `test` on its
627
+ own is still hidden, also right after an escape such as `%40` or `\n`, a
628
+ colour code, or a `-p` flag. That escape rule now covers short forms
629
+ too. A longer form with any
630
+ other character is still hidden wherever it appears.
631
+ - **Redaction keeps the host after a password with an `@` (#341).** In
632
+ `postgres://u:p@ss@h/db and p@ss`, only `p@ss` is hidden now. Before, the
633
+ host and the rest of the line were hidden too. One known limit: in a URL
634
+ other than DATABASE_URL, a password that holds an `@`, a host, a `/`, `:`,
635
+ `?` or `#`, and a space, shows the part after that `@` when the URL's own
636
+ host has nothing after it, or has an `@` in its path or query. #341 tracks
637
+ it.
638
+ - **Daemon shutdown no longer waits a second (#341).** A process the app
639
+ started could keep the daemon's error output open. Each quit or respawn of
640
+ `--daemon` then waited one second. Mutineer now stops waiting once the
641
+ daemon has exited and its output is read.
642
+ - **One line that Prism 2 rejects no longer skips every mutant in the file
643
+ (#392).** Prism 2.0 and later report an operator write to a bare constant
644
+ inside a method (`T += 1`, `T ||= 1`, `T &&= 1`) as a dynamic constant
645
+ assignment. Ruby's `parse.y` does the same, but Ruby 3.4 and 4.0 load such
646
+ a file with their own Prism 1. Mutineer kept a mutant only when the mutated
647
+ file parsed with no errors, so on Prism 2 every mutant of that file was
648
+ counted as `skipped (invalid)`. When Prism reports an error, Mutineer now
649
+ asks the running Ruby to compile the mutant, and skips it only when Ruby
650
+ cannot. This holds in the dry run, in process, with `--test-command`, on
651
+ `--daemon`, and for the redefine strategy's method snippet. A project gets
652
+ Prism 2 when its bundle loads it, for example
653
+ through minitest 6.1. On Prism 2, the mutants of such a file that were
654
+ skipped now get a verdict, so the score, the counts, and the JSON report
655
+ can change for those projects. Prism 1 runs do not change.
656
+ - **`--test-command` warns about a random test order (#338).** Mutineer
657
+ sets no seed for your command, so the clean run and each mutant run can
658
+ run the tests in different orders. An order-dependent suite can then fail
659
+ a mutant run for a reason the mutant did not cause, and that mutant
660
+ scores a false `killed`. When the clean run prints a random seed
661
+ (Minitest `Run options: --seed N`, RSpec `Randomized with seed N`) and
662
+ Mutineer finds no fixed seed, it now prints one warning with the fix for
663
+ that runner: put `SEED=1` before the `mutineer` command for Minitest, or
664
+ add `--order defined` to an RSpec command and keep `--order rand` out of
665
+ `SPEC_OPTS`, which RSpec reads after the command. The docs for
666
+ `--test-command` say the same. Mutineer does not set the seed itself, so scores do not
667
+ change. It cannot see a seed set in a wrapper script or `.rspec`, or a
668
+ Minitest `test_order`, so the warning can print when the order is
669
+ already fixed. #368 tracks these limits.
670
+ - **Reload places a hook-block mutant before the rest of its file runs
671
+ (#348).** Under `--strategy reload`, a placeable mutated method from a
672
+ concern's `included` or `prepended` block reached the classes that include
673
+ or prepend the concern only after the whole mutant file loaded. Methods
674
+ that reload cannot place still score `unplaceable`. A later line in the same
675
+ file that called the method while the file loaded, such as
676
+ `TOTAL = Host.new.doubled(2)`, still used the original method. Mutineer
677
+ now places the mutated method when the load reaches the hook call, before
678
+ the rest of the file runs, in-process and on `--daemon`. Such a mutant can
679
+ now be killed where it used to survive or score `ran_at_load`, so the
680
+ score of an affected file can change. A mutant that raises in such a
681
+ load-time call now scores `error`. The alias and kept-method checks
682
+ still score `error`. The kept-method check runs after the load, so a
683
+ method handle the file holds only while it loads does not count.
684
+ - **The Action creates the cache folder when `output` points into it
685
+ (#340).** On a fresh checkout, `output: .mutineer/pr.json` exited 2,
686
+ because `.mutineer/` did not exist yet. The CLI already created that
687
+ folder (#270), but the Action checks the path itself before it runs the
688
+ CLI. The Action now creates the cache folder when it is the missing parent
689
+ of `output`: `.mutineer` by default, the `cache_dir` from `.mutineer.yml`,
690
+ or a `--cache-dir` in `extra-args` (any short form the CLI accepts, such
691
+ as `--cache`). Any other missing folder still exits 2.
692
+ or a `--cache-dir` in `extra-args` (or a prefix of it down to `--cac`, such as
693
+ `--cache`). Any other missing folder still exits 2.
694
+ - **Reload runs a Rails class body a second time without errors (#378,
695
+ #384).** Reload loads the mutant file over the class that is already
696
+ defined, so its body runs again. A model that declares an `enum`, and a
697
+ class that calls `skip_callback` (a controller's `skip_before_action` or
698
+ `allow_unauthenticated_access` calls it), raised on that second run, and
699
+ every mutant in the file scored `error`. While the mutant file loads, an
700
+ enum the class had before the load now skips Rails' conflict check, and
701
+ `skip_callback` does not raise for a callback the first run already
702
+ removed: one named by a method the class has, such as a callback from the
703
+ parent class or an included concern. A skip that names no such method or
704
+ parent callback still raises. Both checks run as usual while the tests
705
+ run. This holds on `--daemon` and with `--strategy reload`.
706
+ - **Reload no longer runs validators and block callbacks twice (#390).**
707
+ The second run of a class body added a second copy of each `validates`,
708
+ each `validate` block, and each callback written as a block or a lambda,
709
+ such as `before_save do ... end`. Rails removes a repeated callback only
710
+ when it names a method. A test that counts errors or side effects then
711
+ failed for every mutant in the file, so those mutants scored `killed`
712
+ falsely. After the mutant file loads, Mutineer now keeps one copy of each:
713
+ the new one, in the place of the old one, so the order of callbacks does
714
+ not change. Entries from an included concern stay, because the reload does
715
+ not run the concern's block again. When Mutineer cannot tell which old
716
+ entry a new one repeats, it keeps both, as before (#413). This holds on
717
+ `--daemon` and with `--strategy reload`. With eager loading on, a mutant
718
+ of a parent class file still adds a callback back to each subclass that
719
+ skipped it (#414).
720
+ **Score change:** a Rails model with such a test can now show survivors
721
+ that were false kills before, so its score can go down.
722
+ - **Concern mutants load when the test app loads lazily (#383).** With
723
+ `eager_load` off (the Rails test default), the mutant's load was the first
724
+ use of the concern, so Rails loaded the original file inside it. The
725
+ original `included` block then came back, and the mutant's block raised
726
+ `MultipleIncludedBlocks`. Mutineer now loads the original file first, through
727
+ the app's autoloader, so the mutant's block replaces it.
728
+ - **The pending-migration check no longer trips `shared_databases` (#385).**
729
+ `rails/test_help` checks every database for pending migrations when the
730
+ tests load, shared ones too. A parallel `--daemon` run then reported the
731
+ shared database as used and scored every mutant `error`. Mutant forks of a
732
+ run with `shared_databases` now turn that check off. The clean check, which
733
+ runs before any mutant, still makes it.
734
+ - **No Rails deprecation warning from concern mutants (#387).** Placing a
735
+ mutant inside an `included` block looked at every module. Rails 8.2 keeps a
736
+ deprecated constant as a module that warns on every call, so each such
737
+ mutant printed `LoadInterlockAwareMonitor is deprecated`. Mutineer now skips
738
+ that module.
739
+
9
740
  ## [1.8.1] - 2026-11-02
10
741
 
11
742
  ### Fixed
@@ -1861,6 +2592,8 @@ Rails hardening + CI batch (issues #8–#13), all verified Rails-free.
1861
2592
  - `.mutineer.yml` configuration (CLI > config > default precedence).
1862
2593
  - Byte-correct source handling for multibyte (UTF-8) sources.
1863
2594
 
2595
+ [1.9.0]: https://github.com/davidteren/mutineer/releases/tag/v1.9.0
2596
+ [1.8.2]: https://github.com/davidteren/mutineer/releases/tag/v1.8.2
1864
2597
  [1.8.1]: https://github.com/davidteren/mutineer/releases/tag/v1.8.1
1865
2598
  [1.8.0]: https://github.com/davidteren/mutineer/releases/tag/v1.8.0
1866
2599
  [1.7.0]: https://github.com/davidteren/mutineer/releases/tag/v1.7.0