Commit 3d2095b
test: real-pair checks fall back to pinned fixtures — rotation stops eating the evidence
Wires the fixture-fallback into both real-pair tests
(test/insertion-suppression.test.mjs, test/mitigation-output-form.test.mjs):
live capture present -> unchanged path (readCapture); capture absent ->
fall back to the pinned fixture via readPinnedFixture if one exists; both
absent -> skip with a stated reason, as before. Both readers yield the same
[n, line] tuple shape, so the replay loop in each test is unchanged either
way. Both the capture path and the fixture path are overridable via
CACHE_FIX_TEST_CAPTURE_OVERRIDE / CACHE_FIX_TEST_FIXTURE_OVERRIDE so the
fallback's own red-green test never has to touch the real capture file,
which is read-only evidence shared with other concurrent work.
Commits the first real pin: test/fixtures/harvested/pinned-s-633915a8-26-28
.json, the n=26->28 pair both real-pair tests already reference in their
comments, produced with `node tools/harvest.mjs --pin
s-633915a8 26..28` (holds the full prefix 0..28
per the previous commit's replay-from-start finding) and verified against
the fixed scrubber from the prior commit: replaying it through the actual
pipeline reproduces the live capture's exact values (mitigated=true,
outputForm="append", suppressed=1 at index 31, 0 safety violations).
test/harvest-pin.test.mjs gains the fallback's red-green proof: both
real-pair test files are run as actual subprocesses (not re-derived) with
env overrides -- capture+fixture both absent skips (never a false pass),
capture absent + the real committed fixture present runs and PASSES
(never a false fail). Both real-pair suites are green in both modes.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
(cherry picked from commit 2dfe0f0)1 parent 9702540 commit 3d2095b
4 files changed
Lines changed: 135 additions & 13 deletions
File tree
- test
- fixtures/harvested
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
11 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
12 | 21 | | |
13 | 22 | | |
14 | 23 | | |
| |||
189 | 198 | | |
190 | 199 | | |
191 | 200 | | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
228 | 229 | | |
229 | 230 | | |
230 | 231 | | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
231 | 240 | | |
| 241 | + | |
232 | 242 | | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
233 | 246 | | |
234 | 247 | | |
235 | 248 | | |
| |||
258 | 271 | | |
259 | 272 | | |
260 | 273 | | |
261 | | - | |
262 | | - | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
263 | 287 | | |
264 | 288 | | |
265 | 289 | | |
| |||
273 | 297 | | |
274 | 298 | | |
275 | 299 | | |
| 300 | + | |
276 | 301 | | |
277 | 302 | | |
278 | 303 | | |
| |||
292 | 317 | | |
293 | 318 | | |
294 | 319 | | |
295 | | - | |
| 320 | + | |
296 | 321 | | |
297 | 322 | | |
298 | 323 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
102 | 103 | | |
103 | 104 | | |
104 | 105 | | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
109 | 118 | | |
| 119 | + | |
110 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
111 | 124 | | |
112 | 125 | | |
113 | 126 | | |
| |||
125 | 138 | | |
126 | 139 | | |
127 | 140 | | |
128 | | - | |
129 | | - | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
130 | 154 | | |
131 | 155 | | |
132 | 156 | | |
| |||
148 | 172 | | |
149 | 173 | | |
150 | 174 | | |
151 | | - | |
| 175 | + | |
152 | 176 | | |
153 | 177 | | |
154 | 178 | | |
| |||
0 commit comments