Commit d40304d
committed
fix(mutmut): wire MUTATE_PATH->TEST_RUNNER_FILES mapping + hard-fail on unknown
v1.1 item A from the 2026-05-18 pre-release sweep — closes the
misconfiguration that produced 45 phantom wl_csv.py survivors.
## Problem
Prior scripts/mutmut.sh defaulted TEST_RUNNER_FILES to the
wl_validation test set regardless of MUTATE_PATH. When a contributor
ran with MUTATE_PATH=bin/wl_csv.py (or any non-default module)
without also overriding TEST_RUNNER_FILES, mutmut applied
mutations to wl_csv.py while running tests that never imported
wl_csv. Every mutation trivially survived — not because of a real
coverage gap but because the tests didn't exercise the mutated
code at all. The 2026-05-18 session caught 45 wl_csv 'survivors'
that were entirely artifacts of this misconfig.
## Fix
Add derive_test_files_for() in scripts/mutmut.sh that maps each
bin/wl_*.py module to the test files that actually exercise it.
When MUTATE_PATH is set but TEST_RUNNER_FILES is not, auto-derive
the right test list. Hard-fail with a clear error on unknown
modules — silent fallback is exactly what produced the incident,
so loud failure is the policy now.
Special cases:
- bin/wl_handler.py is explicitly REJECTED (integration tests only,
multi-day runs; policy already documented but not mechanical
before this commit)
- Unknown MUTATE_PATH hard-fails with a pointer to:
(a) add a case branch, OR
(b) set TEST_RUNNER_FILES explicitly to override
Escape hatch preserved: explicit TEST_RUNNER_FILES env var still
bypasses derivation. The default invocation (no env vars) is
fully backward-compatible — same module, same test list.
## New
- 'mappings' subcommand prints the module -> tests table so
contributors don't have to read derive_test_files_for to know
what's mapped:
scripts/mutmut.sh mappings
## Verification
Smoke-tested all 5 derivation branches:
- known module (bin/wl_csv.py) -> correct test list
- handler -> rejection with policy message
- unknown module -> rejection with mapping pointer
- fim_watch (group entry) -> shared test file
- default (no env vars) -> backward-compatible result
Exit code 1 on all rejection paths (confirmed via separate run).
## Doc update
docs/MUTATION_TESTING.md "Recommended improvements" section
marks item 1 (the mapping table) CLOSED, renumbers the open
items 1-4. Lessons-captured note unchanged.
doc-drift: OK (33 docs against build 660).1 parent eddcb62 commit d40304d
2 files changed
Lines changed: 191 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
199 | | - | |
| 199 | + | |
200 | 200 | | |
201 | | - | |
202 | | - | |
| 201 | + | |
203 | 202 | | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
210 | 211 | | |
211 | | - | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
212 | 215 | | |
213 | 216 | | |
214 | 217 | | |
215 | 218 | | |
216 | 219 | | |
217 | 220 | | |
218 | 221 | | |
219 | | - | |
| 222 | + | |
220 | 223 | | |
221 | 224 | | |
222 | 225 | | |
223 | | - | |
| 226 | + | |
224 | 227 | | |
225 | 228 | | |
226 | 229 | | |
227 | | - | |
| 230 | + | |
228 | 231 | | |
229 | 232 | | |
230 | 233 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
26 | 46 | | |
27 | 47 | | |
28 | 48 | | |
| |||
70 | 90 | | |
71 | 91 | | |
72 | 92 | | |
73 | | - | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
74 | 197 | | |
75 | 198 | | |
76 | 199 | | |
| |||
148 | 271 | | |
149 | 272 | | |
150 | 273 | | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
151 | 316 | | |
152 | 317 | | |
153 | 318 | | |
154 | 319 | | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
159 | 325 | | |
160 | | - | |
161 | | - | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
162 | 330 | | |
163 | 331 | | |
164 | 332 | | |
0 commit comments