Skip to content

fix(coverage): relabel per-rule totals so they don't read as artifact counts (REQ-110/111)#348

Merged
avrabe merged 3 commits into
mainfrom
fix/req-110-111-coverage-relabel
May 31, 2026
Merged

fix(coverage): relabel per-rule totals so they don't read as artifact counts (REQ-110/111)#348
avrabe merged 3 commits into
mainfrom
fix/req-110-111-coverage-relabel

Conversation

@avrabe
Copy link
Copy Markdown
Contributor

@avrabe avrabe commented May 30, 2026

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:

  • HTML overview: {n} / {m} artifacts covered
  • coverage --format jsonoverall.total / overall.covered

…where stats uses total for the distinct-artifact count. Same label, two cardinalities.

The fix (relabel — numbers unchanged, per decision)

  • HTML: {n} / {m} coverage checks across R rules
  • JSON overall: checks_covered / checks_total (the ambiguous total/covered keys are removed from overall — a JSON consumer change, noted in CHANGELOG). Per-rule entries[] keep covered/total, which are correct at rule scope.

Regression test asserts the checks_* keys exist and the bare total/covered are absent from overall. rivet validate PASS.

Fixes REQ-110, REQ-111.

🤖 Generated with Claude Code

…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>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 30, 2026

📐 Rivet artifact delta

No artifact changes in this PR. Code-only changes (renderer, CLI wiring, tests) don't touch the artifact graph.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Rivet Criterion Benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.

Benchmark suite Current: cc95800 Previous: b55a9c6 Ratio
link_graph_build/10000 37302370 ns/iter (± 2416403) 28455287 ns/iter (± 1590137) 1.31
traceability_matrix/1000 60982 ns/iter (± 664) 45621 ns/iter (± 172) 1.34

This comment was automatically generated by workflow using github-action-benchmark.

@avrabe avrabe merged commit 0d1f3f2 into main May 31, 2026
@avrabe avrabe deleted the fix/req-110-111-coverage-relabel branch May 31, 2026 08:19
avrabe added a commit that referenced this pull request May 31, 2026
…363)

Mark-implemented sweep — acceptance met by merged code:
- REQ-105 (HTML export self-containment, v0.14.0)  draft    -> implemented
- REQ-110/111 (coverage relabel, #348)             draft    -> implemented
- REQ-124 (diagnostic remediation, v0.14.0)        approved -> implemented

Also re-files REQ-131 (the #349 required-backlink fix, status implemented):
its artifact was dropped when #351 was reworked to add alternate-backlink
support, so the code shipped on main without the requirement. Restores the
traceability that issue comments on #349/#350 reference.

rivet validate PASS.

Refs: REQ-105, REQ-110, REQ-111, REQ-124, REQ-131

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant