fix(coverage): relabel per-rule totals so they don't read as artifact counts (REQ-110/111)#348
Open
avrabe wants to merge 1 commit into
Open
fix(coverage): relabel per-rule totals so they don't read as artifact counts (REQ-110/111)#348avrabe wants to merge 1 commit into
avrabe wants to merge 1 commit into
Conversation
…ct counts
Bug-hunt findings REQ-110 (HTML) + REQ-111 (JSON), 3/3 lens-confirmed. The
coverage overview summed per-RULE denominators (an artifact in N rules counts
N times) but labelled the result "artifacts covered" / exposed it under the
JSON key `total` — the same key `stats` uses for the distinct-artifact count.
Two different cardinalities, one label.
Per the relabel decision (numbers unchanged):
- HTML overview: "{n} / {m} coverage checks across R rules" (was "artifacts
covered").
- coverage --format json `overall`: `checks_covered` / `checks_total`
(the ambiguous `total`/`covered` keys are removed from `overall`). Per-rule
`entries[]` keep `covered`/`total`, correct at rule scope.
Regression test asserts the `checks_*` keys exist and the bare `total`/
`covered` keys are absent from `overall`.
Fixes: REQ-110, REQ-111
Verifies: REQ-110, REQ-111
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
📐 Rivet artifact deltaNo artifact changes in this PR. Code-only changes (renderer, CLI wiring, tests) don't touch the artifact graph. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First fix of the v0.15.0 "report correctness" track. Bug-hunt findings REQ-110 (HTML) + REQ-111 (JSON), 3/3 lens-confirmed.
The bug
The coverage overview summed per-rule denominators (an artifact satisfying N traceability rules is counted N times) but presented the result as if it were an artifact count:
{n} / {m} artifacts coveredcoverage --format json→overall.total/overall.covered…where
statsusestotalfor the distinct-artifact count. Same label, two cardinalities.The fix (relabel — numbers unchanged, per decision)
{n} / {m} coverage checks across R rulesoverall:checks_covered/checks_total(the ambiguoustotal/coveredkeys are removed fromoverall— a JSON consumer change, noted in CHANGELOG). Per-ruleentries[]keepcovered/total, which are correct at rule scope.Regression test asserts the
checks_*keys exist and the baretotal/coveredare absent fromoverall.rivet validatePASS.Fixes REQ-110, REQ-111.
🤖 Generated with Claude Code