mutineer 1.7.0 → 1.8.1

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 (46) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +466 -0
  3. data/README.md +157 -747
  4. data/lib/mutineer/baseline.rb +1 -1
  5. data/lib/mutineer/changed_lines.rb +2 -1
  6. data/lib/mutineer/cli.rb +132 -28
  7. data/lib/mutineer/concern_blocks.rb +187 -5
  8. data/lib/mutineer/config.rb +6 -0
  9. data/lib/mutineer/coverage_map.rb +92 -17
  10. data/lib/mutineer/daemon_backend.rb +75 -32
  11. data/lib/mutineer/daemon_client.rb +50 -17
  12. data/lib/mutineer/daemon_server.rb +93 -41
  13. data/lib/mutineer/external_backend.rb +150 -17
  14. data/lib/mutineer/init.rb +1 -1
  15. data/lib/mutineer/isolation.rb +70 -25
  16. data/lib/mutineer/job_plan.rb +119 -34
  17. data/lib/mutineer/kill_channel.rb +24 -14
  18. data/lib/mutineer/migrate.rb +10 -8
  19. data/lib/mutineer/minitest_integration/in_test_database_error.rb +184 -0
  20. data/lib/mutineer/minitest_integration/kill_recorder.rb +25 -17
  21. data/lib/mutineer/minitest_integration.rb +44 -14
  22. data/lib/mutineer/mutators/array_literal.rb +4 -2
  23. data/lib/mutineer/mutators/base.rb +22 -0
  24. data/lib/mutineer/mutators/call_to_receiver.rb +20 -7
  25. data/lib/mutineer/mutators/chain_link.rb +6 -6
  26. data/lib/mutineer/mutators/condition_forcing.rb +6 -3
  27. data/lib/mutineer/mutators/operand_removal.rb +4 -2
  28. data/lib/mutineer/mutators/range_literal.rb +105 -4
  29. data/lib/mutineer/mutators/return_nil.rb +1 -0
  30. data/lib/mutineer/orphan_guard.rb +18 -6
  31. data/lib/mutineer/pairing.rb +62 -1
  32. data/lib/mutineer/project.rb +226 -12
  33. data/lib/mutineer/rails_worker_db.rb +200 -16
  34. data/lib/mutineer/redaction.rb +112 -11
  35. data/lib/mutineer/reporter.rb +109 -21
  36. data/lib/mutineer/result.rb +33 -5
  37. data/lib/mutineer/runner.rb +126 -18
  38. data/lib/mutineer/statement_lines.rb +14 -8
  39. data/lib/mutineer/subject.rb +13 -5
  40. data/lib/mutineer/test_runners/minitest.rb +2 -1
  41. data/lib/mutineer/test_runners.rb +4 -2
  42. data/lib/mutineer/triage.rb +2 -2
  43. data/lib/mutineer/version.rb +1 -1
  44. data/lib/mutineer/worker_pool.rb +2 -1
  45. data/skills/mutineer/SKILL.md +84 -0
  46. metadata +5 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2afb9e81b16cbdf3b7ecd0d074365ee05eb58bdb0045ff6a73643a68893a4b1a
4
- data.tar.gz: 949369679de39fbc53025fc470896bbef0c5310fc59c11cb928ad80aa748cc22
3
+ metadata.gz: '081f3529886cfc83b690d64e36364e98233618681f2fd5378d74c2fdc7417494'
4
+ data.tar.gz: 9eb4fb6837004332586b527f12cb55fbaaf8def2982e38ba9752b816fbd74b02
5
5
  SHA512:
6
- metadata.gz: d78d0145b257b25321b7a9f05ebebc51e1818459eacecd26917953ef2dd0296af34fcb755a3a782102ef5453a9f27d90cb3fb2d8261fd8760ab557f273b2d866
7
- data.tar.gz: 3d844218d9e05bc1c09bc7c1bfa7617c7fa79b49c943bb1a96af20ab68fa85312baf08ed9fa37d4f9929bc07c027c943717e2ce4344e15639509feeae66ff560
6
+ metadata.gz: 68417680427040b670ca63cf5c9bd65f3a1a144d32a3f7ca42ff34bd9eabeaa6f17f2db7e78eb59d28c293a47bd503d77ec7e6a55922f6fc08c6d8a2d7b3cefb
7
+ data.tar.gz: ab9d5c1ab942e221414af34e85b000847f71f512bf32efc4200d42b7a3fc43e091a7aeff5ae1136cbc83797d0d23debfea5483665e3bed3a30d48dceade0be49
data/CHANGELOG.md CHANGED
@@ -6,6 +6,470 @@ All notable changes to this project are documented here. The format is based on
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [1.8.1] - 2026-11-02
10
+
11
+ ### Fixed
12
+
13
+ - **No "already initialized constant" warnings under reload (#364).** Each
14
+ mutant loads its whole file again, so every constant in the file was
15
+ assigned twice. Ruby then printed two warning lines per constant, per
16
+ mutant, on stderr. Mutineer now turns warnings off while it loads the
17
+ mutant file, in-process and on `--daemon`, and turns them back on before
18
+ the tests run. Warnings that the tests raise still print. Other warnings
19
+ raised while the mutant file loads, such as an unused variable under `-w`,
20
+ no longer print either. Scores and the JSON report do not change.
21
+ - **The "not green" message says it once (#360).** When the clean run of a
22
+ file's tests failed, the message said "the unmutated suite is not green"
23
+ twice. It now says it once, then names the test files after `Failed:`.
24
+ A failure that only the check of all test files together finds is listed
25
+ as `Failed: combined suite`.
26
+ Under Minitest, the seed hint follows them.
27
+ The message itself still does not name the failing tests or the first
28
+ error; #360 tracks that. On the default in-process path, the failing
29
+ test's own report still prints on stderr before the message.
30
+ - **An unexpected error no longer prints an unredacted message (#341).**
31
+ An error that no other handler expected went to Ruby's default printer,
32
+ which did not hide a database password in its message. The CLI now prints
33
+ that error with the password hidden, with its backtrace, and exits 1, as
34
+ before. No known path raised such an error with the password.
35
+ - **An ambiguous or malformed option is a usage error (exit 2).** An option
36
+ that matches more than one flag, such as `--ver` (`--verbose` or
37
+ `--version`), or a value given to a flag that takes none, such as
38
+ `--verbose=1`, crashed with a backtrace and exit 1. It now prints one line
39
+ and exits 2, like every other bad option. This holds for `init` and
40
+ `triage` too.
41
+
42
+ ## [1.8.0] - 2026-10-29
43
+
44
+ ### Highlights
45
+
46
+ Read these before you upgrade. Details are in the sections below.
47
+
48
+ - **Scores can change after the upgrade.** Under `--strategy reload`, most methods
49
+ in a concern's `included` or `prepended` block are now scored (#297). Runs
50
+ that list `call_to_receiver` get more mutants (#274). Runs that list
51
+ `range` get new mutants for endless ranges (#299). A mutant that two
52
+ operators make now counts once (#275). These can change counts, scores
53
+ and survivors. If you gate on `--baseline`, write a new full baseline.
54
+ - **Delete `ignore:` entries for `range` mutants (#299).** A new `range`
55
+ mutant can take an old id, so an old entry can hide a real survivor.
56
+ - **Fewer false kills.** Under `--test-command`, a non-zero exit other than 1
57
+ scores `error`, and so does an exit 1 with no failing test in the summary
58
+ line (#292). An Active Record connection or lock error inside a Minitest
59
+ test scores `error` too (#296). Before, these scored `killed`.
60
+ - **Exit codes match STABILITY.md (#288).** A boot, source or `require:`
61
+ file that raises while it loads exits 1. A missing boot or `require:`
62
+ file exits 2.
63
+ - **`--threshold` compares the exact score (#280).** A run with 1999 of
64
+ 2000 mutants killed shows 100.0% but no longer passes `--threshold 100`.
65
+ - **New report data.** The JSON report adds `summary.declined` and
66
+ `summary.declined_by_operator` (schema `1.9`), and stderr warns when many
67
+ mutants could not run (#291).
68
+ - **Parallel `--daemon` with unused test databases (#316).** List them under
69
+ `shared_databases` to run more than one worker. Needs Rails 7.1 or later.
70
+ - **The gem ships the agent skill (#315).**
71
+ - **Releases wait for a maintainer.** Nothing publishes on a schedule or on
72
+ a tag push.
73
+
74
+ ### Added
75
+
76
+ - **`shared_databases` config key** (#316). An app with a second test
77
+ database ran one worker under `--daemon`. List the databases your tests
78
+ never use (`shared_databases: [cable]`), and the workers share them and run
79
+ in parallel. After each mutant, a parallel worker checks those databases.
80
+ The mutant scores `error` when a pool for one is still connected after the
81
+ tests, or ran SQL during them. A replica in the same `connects_to` counts
82
+ as its database. Listing the primary database stops the run with exit 2.
83
+ A name that matches no test database warns and is not checked. The check
84
+ needs Rails 7.1 or later. Three safety changes come with it for
85
+ `--rails --daemon`: a test database with `database_tasks: false` now
86
+ counts toward the one-worker limit, and the run keeps one worker when the
87
+ app's databases cannot be listed or the first daemon does not boot
88
+ (before, each case could start several workers). See
89
+ [More than one database](https://github.com/davidteren/mutineer/blob/main/docs/rails-setup.md#more-than-one-database)
90
+ for the transactional-tests caveat.
91
+ - **Counts of mutants that were not scored (#291).** Operators now count the
92
+ candidates they decline: a heredoc they cannot mutate safely, or an
93
+ equivalent skip such as an endless range or a skipped chain-link name. The
94
+ dry run prints the count. The human report prints it when the run has
95
+ mutants; when every candidate was declined, the empty-run warning names the
96
+ count instead (that warning is off under `--allow-empty`). The JSON report
97
+ adds `summary.declined` and `summary.declined_by_operator` (schema `1.9`).
98
+ A new stderr warning fires when unplaceable and skipped-invalid mutants are
99
+ more than one and more than 10% of the mutants a run tried to score. The
100
+ warning does not change the exit code. Measured on commit caa9e1a (this
101
+ change merged with main) with every operator: the dry run on `lib/`
102
+ declines 195 candidates beside 17,374 mutations (call_to_receiver 122,
103
+ chain_link 45, range 12, statement_removal 10, return_nil 6); the dry run
104
+ on the Rails fixture app declines 0 beside 69 mutations. A
105
+ `--strategy redefine --rails` run on the fixture app models (order,
106
+ price_list, billing/fee) has 0 unplaceable and 0 skipped-invalid of 12
107
+ attempted, so no warning. The fixture has no concerns, so it cannot tune
108
+ the 10% limit.
109
+ - **Included and prepended block methods under reload.** After you upgrade,
110
+ follow the [full baseline refresh recipe](https://davidteren.github.io/mutineer/agentic-coding.html#ci-gate)
111
+ with `--no-since --format json --output .mutineer/refreshed-baseline.json` and your
112
+ existing source and test options. Review the report and replace the stored
113
+ baseline. This applies only to runs that use `--strategy reload`: under
114
+ redefine these methods stay `unplaceable`. GitHub Action users on reload,
115
+ the Action's default (a Rails app without a daemon uses redefine), must
116
+ replace the file passed to the `baseline` input too. A check against an older
117
+ report lists the new survivors as regressions.
118
+ Under `--strategy reload`, in-process and on the daemon, a method in a
119
+ concern's `included` or `prepended` block is now mutated and scored (#297).
120
+ Mutineer loads the mutated method into each class that already has it. A
121
+ prepended wrapper that calls `super` reaches that mutated method too. A
122
+ concern included into an object's singleton class is supported. A class
123
+ that includes the concern later gets it from the reloaded block. The
124
+ rest of the block does not run again, so validators and callbacks are not
125
+ added twice. These mutants used to be `unplaceable`, so a reload score can go
126
+ down and a `--threshold` gate can start to fail. Some methods stay
127
+ `unplaceable`: a method in a class, module or `Struct.new` block inside the
128
+ block, a method inside another method or block, a method with an explicit
129
+ receiver other than `self` (such as `def base.tag` in `included do |base|`),
130
+ a hook-block method whose source line conflicts with another `def` or an
131
+ explicit Ruby method creator (the full rule is in `docs/json-schema.md`),
132
+ every method in a block that uses `alias` or `alias_method`, a method the
133
+ block itself calls, and every method in a block whose `included do` call is
134
+ not a plain line of the module
135
+ body (for example inside `if`, `unless`, or `x = included do`). The full list
136
+ is in `docs/json-schema.md`. If a class aliases a method that Mutineer does
137
+ run (one not in that list) outside the block, the mutant scores `error`,
138
+ because the alias keeps the original method. This also applies when a
139
+ wrapper replaces the original name and calls the saved alias. A retained
140
+ `Method` or `UnboundMethod` for the original also makes the mutant score
141
+ `error`: a wrapper can call that handle without testing the mutated method.
142
+ `--strategy redefine` still
143
+ reports all of these methods `unplaceable`.
144
+ - **The gem ships the agent skill.** `skills/mutineer/SKILL.md` is now
145
+ packaged in the gem, and the gemspec opts in as a
146
+ [Rails Hyperdrive](https://github.com/rails-hyperdrive/rails-hyperdrive)
147
+ companion (`hyperdrive_targets: "*"`, `hyperdrive_artifacts: "skill"`). In a
148
+ Rails app that bundles mutineer, `bin/rails hyperdrive:init` installs the
149
+ skill to `.claude/skills/mutineer/SKILL.md`. A test in the default suite
150
+ fails if the gemspec stops shipping the skill or drops the opt-in (#315).
151
+
152
+ ### Fixed
153
+
154
+ - **`--daemon` stops on MySQL older than 8.0 (#298).** The support matrix said
155
+ MySQL 5.7 is not supported, but `--daemon` ran on it. Mutineer now reads the
156
+ server version before it copies any worker database. MySQL older than 8.0
157
+ stops the run with `could not provision <base>: MySQL <version> is not
158
+ supported`. Pass `--no-daemon` (or set `daemon: false`) to stay serial.
159
+ MariaDB, MySQL 9 or later, and a server version Mutineer cannot read print
160
+ one warning and run.
161
+ - **An in-test database error scores `error`, not `killed` (#296).** When
162
+ the first failing test of a Minitest mutant run failed with an Active
163
+ Record connection or lock error (`ConnectionNotEstablished`, including pool
164
+ timeouts, `ConnectionFailed`, `Deadlocked`, `LockWaitTimeout`), the mutant
165
+ now scores `error` on `--daemon` and in-process. This includes an error in
166
+ `setup`. Errors are out of the score, so a lost database connection during
167
+ a run no longer raises the score. A stderr line names the error. A mutant
168
+ that really causes a deadlock, or that breaks connection-handling code, now
169
+ also scores `error`. More `error` verdicts can fail a `--threshold` run
170
+ through the existing no-verdict gate. Other database errors, such as a bad
171
+ SQL statement, still score `killed`. So does `ConnectionNotDefined`, which
172
+ Rails 8 raises for an unknown role or shard. Rails 7.2 raises a plain
173
+ `ConnectionNotEstablished` there, so such a mutant scores `error` on 7.2.
174
+ With `--matrix`, a database-failed test is never a killer and leaves its
175
+ row incomplete, even if an earlier assertion already killed the mutant.
176
+ - **An old temp file of the other mode no longer stops the boot (#287).**
177
+ Before the app boots, each mode sweeps the source directories. In 1.7.0
178
+ an in-process run removed only old `mutineer_mutant*.rb` files and the
179
+ daemon removed only old `mutineer_daemon*.rb` files, so a file the other
180
+ mode left made Zeitwerk raise. Now both boot sweeps remove an orphan of
181
+ either mode, and the daemon tells Zeitwerk to skip both names. You no
182
+ longer delete such a file by hand. A file of your own whose name only
183
+ starts with `mutineer_mutant` or `mutineer_daemon`, such as
184
+ `mutineer_mutant_helper.rb`, is no longer removed: a sweep now matches
185
+ only the temp file shape. An unlocked old file is removed even when its
186
+ creator's pid has been reused; a held file lock still protects it.
187
+ Do not run Mutineer older than 1.7.0
188
+ at the same time in the same checkout: it still writes temp files
189
+ without the dot, and a newer run's mutants error when Zeitwerk finds
190
+ one.
191
+ - **A second in-process run no longer deletes a live mutant file (#295).**
192
+ Each in-process run sweeps the source directories before its boot and
193
+ after its run. That sweep treated every `.mutineer_mutant*.rb` file as an
194
+ orphan, so it could delete another run's file between the write and the
195
+ load, and that mutant scored `errored`. Now the file is locked while it
196
+ loads, as the daemon's file is, and a sweep keeps a file whose creating
197
+ process still runs.
198
+ - **The `range` operator swaps endless ranges outside slices.** Before, it
199
+ skipped every endless range (`1..`, `1..nil`) as equivalent. But `(1..)`
200
+ and `(1...)` differ on `==`, `hash`, `exclude_end?` and `to_s`, so a test
201
+ can kill that mutant. Now the operator skips an endless range only when it
202
+ is a direct index argument of `[]`, `[]=`, `slice`, `slice!`, `byteslice`,
203
+ `bytesplice`, `values_at` or an index write, and the receiver is not a
204
+ class (`Array[1..]` is swapped). A Hash, Proc, or custom `[]`/`slice` can
205
+ still tell `1..` from `1...`, so those skips can hide a killable mutant. See
206
+ [Equivalent skips](https://davidteren.github.io/mutineer/equivalent-skips.html#endless-range).
207
+ A run that names `range` can get new mutants, new survivors and new mutant
208
+ ids. A new mutant can take the id of an older `range` mutant in the same
209
+ method, so an old `ignore:` id can name a different mutant. If you use
210
+ `range`:
211
+ - Delete the `ignore:` entries for `range` mutants.
212
+ - Save a new report with the same operators you gate with:
213
+ `mutineer run <paths> --operators <list> --no-since --format json --output <file>`.
214
+ Use it as your new baseline.
215
+ - Print new entries with
216
+ `mutineer triage <file> --reason TEXT (--id ID ... | --all)` and paste
217
+ them under `ignore:`. The command does not edit files.
218
+
219
+ Some new mutants are equivalent, for example a range used only with
220
+ `include?`, or a range in an Active Record query such as
221
+ `where(created_at: time..)`. Suppress them with `# mutineer:disable-line`
222
+ or an `ignore:` entry. (#299)
223
+ - **A test file given as a source after `--test` now exits 2 in more layouts
224
+ (#293).** The check missed Minitest `test_*.rb` files under `test/` or
225
+ `spec/`, and `*_test.rb` or `*_spec.rb` files in the same directory as a
226
+ `--test` file, such as the project root. Mutineer then mutated that file as
227
+ a source and never ran it as a test. With `--format json`, the stray file's
228
+ Minitest output also made the report invalid JSON. A support file with a
229
+ `test_` name under the top-level `test/` or `spec/` (other than
230
+ `test_helper.rb`) now also exits 2 when given as a source with `--test`.
231
+ - **A mutant on a later line of a call inside a one-line block can be killed
232
+ (#289).** A call can span several lines, such as
233
+ `users.map { |u| format("%s",` with arguments on the next lines. Mutineer
234
+ used to pick no tests for a mutant on a later line, so it was always
235
+ `no_coverage`. Now, when the lines of the statement give no tests, Mutineer
236
+ retries. It runs the tests that ran the first or last line of the
237
+ statement, never the `def` line. A kill counts. A survivor stays
238
+ `no_coverage` (or `ran_at_load`), because those tests may not have run it. A
239
+ score can rise with no test change. Such a mutant can now also end as
240
+ `error` or `timeout`. That counts toward the `--threshold` completeness
241
+ check.
242
+ - Mutineer reads its files and pipes as UTF-8 when `LANG` and `LC_ALL` are
243
+ unset (#303). Before, a non-ASCII character in a source file, a baseline, a
244
+ coverage cache, a triage report, `.mutineer.yml` (for `migrate`),
245
+ `db/schema.rb`, a `--since` diff, test-command output, or a daemon message
246
+ stopped the run with "invalid byte sequence in US-ASCII" (exit 2) or a
247
+ backtrace (exit 1). An invalid byte in test-command output now shows as
248
+ `\xNN`. Non-ASCII file and folder names are not covered yet (#346).
249
+ - **Upgrade note for `--test-command` with a custom failure exit code (#292).**
250
+ An RSpec setup with `--failure-exit-code 3` now scores every kill as
251
+ `error`. Use the default exit code, or a wrapper that maps a failure to
252
+ exit 1. An `error` verdict leaves the score, so the score can drop, and more
253
+ `error` verdicts can fail a `--threshold` run through the existing no-verdict
254
+ check. A mutant that only trips a SimpleCov `minimum_coverage` gate now
255
+ scores `survived` when the output has SimpleCov's gate message and a
256
+ passing Minitest or RSpec summary line. Without a summary line that
257
+ Mutineer recognizes, the gate's exit scores `error`, which leaves the
258
+ score. Either way the old false kill is gone, so the score can drop. A `--baseline` made before
259
+ this change can report new survivors and errors: make a new baseline after
260
+ the upgrade.
261
+ - **A `--test-command` exit other than 1 no longer counts as a kill (#292).**
262
+ Only exit 1 scores `killed`, the same rule as the in-process backend. One
263
+ exception: a SimpleCov gate exit whose summary reports a failing test also
264
+ scores `killed`. Any other non-zero exit scores `error`, such as a wrapper's
265
+ 137 after an out-of-memory kill.
266
+ - **A load crash under `--test-command` scores `error` (#292).** When the clean
267
+ run prints a Minitest or RSpec summary line, an exit 1 also needs a failing
268
+ test in that line. Code under test that calls `exit 1` or `abort` while the
269
+ default Minitest reporter runs its tests still scores `killed`, as in
270
+ process. Under RSpec or minitest-reporters, that case now scores `error`.
271
+ When a SimpleCov `minimum_coverage` gate replaces the exit code, the summary
272
+ line decides: a failing test is a kill, and a passing run is `survived`, as
273
+ in process. When the clean run
274
+ prints no summary line, Mutineer warns once and keeps the exit-code rule.
275
+
276
+ - **`--output .mutineer/run.json` on a fresh checkout.** The documented
277
+ report path no longer exits 2 when `.mutineer/` does not exist yet. The
278
+ output check now creates the cache directory (`cache_dir`) when it is the
279
+ missing parent. Any other missing directory still exits 2. This is a CLI
280
+ fix: the GitHub Action's `output` input still needs an existing directory
281
+ (#270, #340).
282
+
283
+ - **`--output` can no longer replace its own baseline.** When `--output`
284
+ and `--baseline` or `baseline:` in `.mutineer.yml` name the same file
285
+ (also through a symlink or hard link), a real `mutineer run` exits 2
286
+ before the run, with the GitHub Action's error adapted for the CLI. A dry run
287
+ still works because it writes no report. Before, a
288
+ failing run wrote its report over the baseline, and the next run passed
289
+ against it (#281).
290
+
291
+ - **`--threshold` compares the exact score, not the rounded one (#280).** The
292
+ score is rounded to one decimal for display, and the gate used to compare that
293
+ rounded value. A run with 1999 of 2000 mutants killed showed 100.0% and passed
294
+ `--threshold 100` with a survivor. The exit code, the Action, and the PASSED or
295
+ FAILED line now use the exact counts. When the rounded score points the other
296
+ way, the PASSED or FAILED line gives the counts and says that the score is
297
+ rounded.
298
+
299
+ - **The Minitest clean check now runs the tests in the order the mutant runs
300
+ use (#282).** Since 1.1.0, each mutant run used seed `1`, but coverage
301
+ capture, the clean checks and the `--daemon` mutant runs used a random
302
+ seed. An order-dependent suite could pass the clean check and then fail in
303
+ every mutant run, so each mutant scored a false `killed`. Every Minitest
304
+ run that Mutineer starts itself (not `--test-command`, see #338) now uses seed `1`,
305
+ or `SEED` when the environment sets it. Such a suite now stops the run
306
+ with "the unmutated suite is not green". The message names the configured
307
+ seed or default and notes that test helpers can change it. Capture, clean
308
+ checks and mutant runs all read `SEED` after loading the tests and helpers.
309
+ Check the listed test files with the same seed and helpers to investigate
310
+ the order-dependent test. A coverage cache from another
311
+ `SEED` in Mutineer's environment or an older version is captured again. A
312
+ `--coverage-from` capture from another `SEED` or an older version is
313
+ rejected with exit 2: capture it again with this version. The internal constant
314
+ `MinitestIntegration::STOP_AT_FIRST_FAILURE_SEED` is now `PINNED_SEED`.
315
+ One gap stays: when a mutant runs several covering test files, their test
316
+ classes can still run in a different order than in the combined clean
317
+ check. RSpec does not change.
318
+
319
+ - **`--daemon` SQLite workers load the schema file the app names (#317).**
320
+ The daemon always loaded `db/schema.rb` over an out-of-date worker copy,
321
+ even when `config/database.yml` sets `schema_dump:` to another file. An
322
+ app that keeps its SQLite schema in `db/schema_sqlite.rb` beside a MySQL
323
+ `db/schema.rb` errored every mutant. The booted daemon now asks Rails for
324
+ the file: `SCHEMA` when it is set, else `schema_dump:`, else
325
+ `db/schema.rb`. With `structure.sql`, a missing file, or
326
+ `schema_dump: false` (unless `SCHEMA` is set) it loads no schema, even
327
+ when a `db/schema.rb` exists: the worker keeps its copy of the test
328
+ database. A Postgres worker is a copy of the test database, so it was not
329
+ affected. MySQL already asked Rails for the file. It now also reads the
330
+ database's own `schema_format:` (Rails 8.1) and a string format such as
331
+ `"sql"`, the same as SQLite.
332
+
333
+ - **No `DATABASE_URL` password in load errors and mutineer's own messages (#288).**
334
+ A load error in the tool process (an
335
+ in-process `--boot` or `--rails` run, a source file, or a `require:`
336
+ file) no longer prints the raw password or a backtrace. The run prints a
337
+ `mutineer: cannot load <path>: ...` message (a `SyntaxError` keeps its code
338
+ excerpt) and exits 1. By default, a load error adds a hint to re-run with `--verbose`;
339
+ verbose output gives a redacted backtrace and cause chain. CLI error messages, the
340
+ fork child's error line, the worker crash text in the report, the daemon's
341
+ stderr lines (except bare passwords known only to the app after boot),
342
+ the failing test report and any load error from the
343
+ clean-suite and coverage checks, and the `--verbose` test command output
344
+ are redacted too. Output that app code or a test writes straight to
345
+ stderr in a fork or subprocess is not filtered (#341 tracks this and the
346
+ other known gaps). A `password=` query parameter in DATABASE_URL is now
347
+ hidden too.
348
+ Daemon stderr is now copied line by line as UTF-8, so an invalid byte
349
+ shows as U+FFFD. Output without a newline waits for a newline or EOF, so
350
+ credentials split across writes can be redacted together. A password that
351
+ equals the username no longer blanks the same text elsewhere (for example
352
+ `role "postgres"`). Each password form of 3 characters or fewer is hidden
353
+ only when no ASCII letter, digit or underscore touches either edge.
354
+ The limit applies separately to raw, decoded and escaped forms: `%61%62`
355
+ is still replaced inside longer text, while its decoded `ab` is matched
356
+ only as a whole token. A longer form is hidden wherever it appears,
357
+ and the password inside a URL is always
358
+ hidden.
359
+
360
+ - **`--strategy redefine` and path-relative methods.** Redefine now loads
361
+ the mutated method from a hidden file beside the source, as reload does.
362
+ It used the system temp directory before, so `__dir__` and
363
+ `require_relative` in the method pointed there, and every mutant of such
364
+ a method was falsely killed (#279). Redefine is also the default under
365
+ `--rails` without `--daemon`. When a source directory is not writable,
366
+ redefine still uses the system temp directory there, as before, and
367
+ the run warns that path-relative methods there can be falsely killed
368
+ (tracked in #339).
369
+
370
+ - `--test-command` now sets `DISABLE_BOOTSNAP_COMPILE_CACHE=1` for the test
371
+ command. Mutineer writes each mutant over the source file, and Bootsnap keys
372
+ its compile cache on path, size and whole-second mtime. Two same-size mutants
373
+ written in the same second could load the first one's cached code, so a
374
+ mutant could be scored on code that was not the mutant. Each mutant boot now
375
+ compiles the app again, which is slower. The variable works through
376
+ `require "bootsnap/setup"` on Bootsnap 1.7.0 or later; an app that calls
377
+ `Bootsnap.setup` itself must pass
378
+ `compile_cache_iseq: ENV["DISABLE_BOOTSNAP_COMPILE_CACHE"].nil?`, so only
379
+ mutant runs lose the cache. The `--daemon` path is unchanged (#285).
380
+
381
+ - **A mutant that two operators make is scored once** (#275).
382
+ `literal_mutation` and `string_literal` both turn `"hi"` into `""`, and
383
+ `chain_link` and `call_to_receiver` both turn `node.name.name` into
384
+ `node.name`. Each copy had its own id, so one surviving edit counted twice.
385
+ Now one copy runs: the copy of the operator that comes first in
386
+ `mutineer --list-operators`, whatever the `--operators` order. Only the
387
+ same text counts: a single-quoted `'hi'` still gives two mutants (`""` and
388
+ `''`). Both edits must also start on the same line: in a chain with one
389
+ call per line, the two copies start on different lines, so both are kept,
390
+ and `--since` filters each copy by its own start line.
391
+ - Every kept mutant keeps its id. The dropped copy's id no longer appears
392
+ in reports. Runs that use only one of these operators keep the same
393
+ mutants and ids.
394
+ - If you combine these operators, the mutant count and the score can move
395
+ with no code change, so a `--threshold` or `--baseline` gate can change
396
+ its result. Regenerate a `--baseline` file after upgrading, from a full
397
+ `--format json` run with no `--since`, `--only` or `--fail-fast` (pass
398
+ `--no-since` and `--no-fail-fast` when `.mutineer.yml` sets them). A
399
+ scoped report is refused as a baseline, and a partial one misses
400
+ mutants. In a full (unscoped) comparison, a dropped copy that survived
401
+ is listed as fixed.
402
+ - An ignore entry for one copy's id still ignores only that copy, as for
403
+ the #159 copies. So if you ignore the copy a report shows, the other copy
404
+ then runs and is reported, and it needs its own entry. Keep both entries:
405
+ a run with one operator alone still uses its entry, and
406
+ `mutineer migrate` keeps both as current ids. This also fixes the #159
407
+ copies: an `ignore:` list that names both copies of a repeated edit no
408
+ longer makes `mutineer migrate` exit 1.
409
+ - An old-format ignore entry that matches only a dropped copy gets the
410
+ old-id-format warning and counts in `summary.legacy_id_matches.ignore`,
411
+ so `mutineer migrate` updates it. For the #159 copies this is new: such
412
+ an entry was not counted before, so with one operator the count can go
413
+ up, and the warning can name an id that no report shows.
414
+ - Within a method, mutants now run and list in the `--list-operators`
415
+ order. This applies to any run whose `--operators` or `operators:` list
416
+ is in another order, so `--dry-run` lists and `--fail-fast` can differ.
417
+ - **A nested method's mutant under `--strategy redefine`.** Redefine now
418
+ also loads the mutated method into each method that encloses it. Before,
419
+ a call to the outer method defined the original inner method again, so
420
+ the mutant could falsely survive (#290). For a method nested in other
421
+ methods, redefine now gives the same verdict as reload when a test calls
422
+ an enclosing method by its own name. Mutant ids do not change, so
423
+ baselines and `ignore:` entries stay valid. Scores under redefine can
424
+ rise, and an `ignore:` entry added only to hide such a survivor can now
425
+ be removed. A method defined inside a non-builder block (for example
426
+ inside `define_method`), inside a `module_function` method, inside
427
+ `class << self` in a method, or called through an alias of the outer
428
+ method can still falsely survive under redefine. An enclosing method
429
+ that a memoizer or decorator wraps after its `def` loses that wrapper
430
+ when redefine loads it, so its verdict can differ from reload. Use
431
+ `--strategy reload` for those cases.
432
+
433
+ ### Changed
434
+
435
+ - **A release waits for a maintainer.** The Monday release-PR schedule is
436
+ gone, and pushing a `vX.Y.Z` tag leaves the gem unpublished. A human
437
+ collaborator with maintain or admin prepares a release PR by hand, tags by
438
+ hand, then runs the Release workflow on that tag with `confirm=publish`.
439
+ A required reviewer approves the `rubygems` GitHub environment before the
440
+ gem is pushed. A new Release run refuses to start the publish when that
441
+ environment is missing, has no required reviewers, or lets admins bypass
442
+ them. Re-running only the publish job of an earlier run does not repeat
443
+ that check. The publish job builds the commit that was dispatched, and it
444
+ stops before `gem push` if the tag moved while the job waited for
445
+ approval. The job no longer moves the floating major tag (`v1`). When the
446
+ release is the newest stable tag in its line, the job prints the command
447
+ and a maintainer runs it, so a ruleset can keep that tag for maintainers.
448
+ For a patch on an older line, it prints no command.
449
+ - **Load failures now use the runtime-error exit code (#288).** An
450
+ `ArgumentError` or `SystemCallError` raised while a boot file, a source
451
+ file or a `.mutineer.yml` `require:` file loads now exits 1 (runtime
452
+ error), instead of 2 (usage error). A missing boot or `require:` file now
453
+ exits 2 (usage error) with a one-line message. Before, it crashed with a
454
+ raw `LoadError` and a backtrace, and exited 1. With `--daemon` it is
455
+ checked before the daemon starts, so it exits 2 there too. Both moves bring
456
+ the code in line with the exit-code table in STABILITY.md, which already
457
+ lists a bad path as 2 and a runtime error as 1.
458
+ - **`call_to_receiver` now mutates last-call conversions such as `to_s` and
459
+ `to_i`.** `m[1].to_i` now gives the mutant `m[1]`. Before, the operator skipped the
460
+ same names as `chain_link`. Now it skips only `new`, `dup`, `clone`,
461
+ `freeze`, `itself` and `to_set`. `chain_link` does not change. Only runs
462
+ that list `call_to_receiver` in `--operators` (or `operators:`) change: they
463
+ get more mutants (113 more on Mutineer's own `lib/`). If you gate such a run
464
+ with `--threshold` or `--baseline`, expect new survivors: write a new
465
+ full-scope baseline with `mutineer run ... --no-since --no-fail-fast
466
+ --format json`, with no `--only`. A `to_s` mutant on a value that is already
467
+ a String is equivalent: suppress it with
468
+ `# mutineer:disable-line call_to_receiver` or an `ignore:` entry. (#274)
469
+ - Explain mutation testing before setup, with a runnable beginner guide and a
470
+ first run on one file. Simplify wording across the website and clarify Rails
471
+ setup, CI baselines, and reasons for ignoring a mutant.
472
+
9
473
  ## [1.7.0] - 2026-10-23
10
474
 
11
475
  ### Added
@@ -1397,6 +1861,8 @@ Rails hardening + CI batch (issues #8–#13), all verified Rails-free.
1397
1861
  - `.mutineer.yml` configuration (CLI > config > default precedence).
1398
1862
  - Byte-correct source handling for multibyte (UTF-8) sources.
1399
1863
 
1864
+ [1.8.1]: https://github.com/davidteren/mutineer/releases/tag/v1.8.1
1865
+ [1.8.0]: https://github.com/davidteren/mutineer/releases/tag/v1.8.0
1400
1866
  [1.7.0]: https://github.com/davidteren/mutineer/releases/tag/v1.7.0
1401
1867
  [1.6.0]: https://github.com/davidteren/mutineer/releases/tag/v1.6.0
1402
1868
  [1.5.0]: https://github.com/davidteren/mutineer/releases/tag/v1.5.0