Repository navigation
Commit e6a660b
committed
fix(cli): blame a mismatched fixture id only when it hid every fixture
`sg-fixture-id-matches-rule` was attributed from `fixturesExcludedById`
alone. That flag is rule-wide — true if ANY discovered test file was
skipped for carrying another rule's `id:` — while the shortfall it was
gating is a per-coverage-state fact summed over every file the rule
owns. A rule-wide boolean cannot decide a per-coverage-state question,
and the two come apart as soon as a rule ships more than one test file.
The reachable case: `<id>-a-test.yml` with the right id but only a
`valid:` bucket, beside `<id>-b-test.yml` with a wrong id, also
`valid:`-only. Combined coverage is `valid-only`, so the shortfall is
"has only valid: fixtures — half a claim", and the exclusion flag
attached that message to the id constraint. The author would have been
sent to fix an id in a file they may not have been thinking about, and
fixing it would not have moved the shortfall at all: neither file has an
`invalid:` case. The real defect — that nothing shows the rule fires —
goes unmentioned behind an unrelated diagnosis.
The gate now also requires `fixtures === "none"`, which is the state the
constraint's own rationale describes: an exclusion making a rule read as
having shipped no fixtures. Both halves are needed, and each rules out a
different wrong answer — without the flag, a rule with no cases is told
to hunt for a mismatched id; without the coverage check, a rule with a
partial-but-counted fixture is told the same thing.1 parent 71f896e commit e6a660b
4 files changed
Lines changed: 67 additions & 8 deletions
File tree
- openspec/changes/reference-fixture-cases
- packages/cli
- src/rules
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
195 | | - | |
196 | | - | |
197 | | - | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
356 | 356 | | |
357 | 357 | | |
358 | 358 | | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
364 | 381 | | |
365 | 382 | | |
366 | 383 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
108 | 114 | | |
109 | 115 | | |
110 | 116 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
293 | 293 | | |
294 | 294 | | |
295 | 295 | | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
296 | 329 | | |
297 | 330 | | |
298 | 331 | | |
| |||
0 commit comments