| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
dormant_rules computed one of three distinct diagnoses and then rendered it away into prose, so the only way to ask which one it was was to match a substring. Four tests did exactly that. That fails open. Reword a diagnosis for clarity, keep the matched substring by luck, and the test still passes while checking something weaker than it was written to check -- the failure mode is invisible because a passing test looks the same either way. _Dormant now carries `kind` (a Literal, so mypy rejects a typo) and `detail` (the shadower's issue, when there is one). main() renders the sentence from _DORMANT_WHY. The computation no longer knows any wording, so rephrasing a diagnosis is a change to output alone. No behavior change. The two _run_main tests still assert on the rendered EXPLAINED NOTHING lines and still pass, which is what pins the output format across this refactor. Both mutation proofs still fail as they should: swapping the reverted/excluded kinds fails 4 tests, removing the internal _sorted_rules call fails 1. Gates unmoved at 108/0, 90/0 and 1/0. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## master #374 +/- ##
=======================================
Coverage 98.51% 98.51%
=======================================
Files 44 44
Lines 2895 2895
=======================================
Hits 2852 2852
Misses 43 43 ☔ View full report in Codecov by Harness.
|
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Follow-up to #373, from its review. dormant_rules computed one of three distinct diagnoses — reverted / shadowed / excluded — then rendered it away into prose, so the only way to ask which one it was was to match a substring. Four tests did exactly that:
That fails open. Reword a diagnosis for clarity, keep the matched substring by luck, and the test still passes while checking something weaker than it was written to check. A passing test looks identical either way.
The change
_Dormant now carries the distinction the function already computed:
main() renders the sentence from a _DORMANT_WHY table. The computation no longer knows any wording, so rephrasing a diagnosis is a change to output alone. kind is a Literal, so mypy rejects a typo'd kind rather than letting it reach a test.
No behavior change, and here is what pins that
The two _run_main tests assert on the rendered EXPLAINED NOTHING lines and are untouched by this PR. They still pass, which is precisely what proves the output format survived a refactor that moved where the prose is built.
Both of #373's mutation proofs still fail as they should — and the first one got stronger:
The swap catching more is the payoff. Under substring matching it was caught only where the two kinds happened to produce visibly different sentences; under kind == every test naming a kind catches it, because the assertion is about identity rather than about text that happens to differ.
Measured
Gates unmoved: 108/0 at 1.4.0, 90/0 at 2.0.0, 1/0 at 2.1.0, all exit 0. Suite 3217, ruff and mypy clean.
🤖 Generated with Claude Code