Repository navigation
feat(coverage): show clause discharge next to the marker count in coverage --tests and trace (#1168) - #1171
Merged
Conversation
…erage --tests and trace (#1168) `rivet coverage --tests` now prints the discharge `rivet verify` recorded beside each requirement's marker count (`clauses 2/3`, `clauses stale`, or `clauses —` when the description states no clause list), and `rivet trace` and `rivet trace-results` print it for the traced requirement. JSON gains a `discharge` object of the form {discharged, total, stale}; a stale record carries no fraction. The logic lives in rivet_core::discharge::discharge_state. Implements: REQ-308 Refs: #1168 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KEjmjar6S6RytNLRfgD24W
…e ambiguous and gone-list cells (#1168) A `discharged-clauses` value stored as the string "[1, 2]" is now read as a record instead of reading as 0/N. The verify-clauses topic now says that `—` also covers ambiguous numbering, and that a stale record whose clause list is gone has a JSON entry with total null. Implements: REQ-308 Refs: #1168 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KEjmjar6S6RytNLRfgD24W
📐 Rivet artifact deltaNo artifact changes in this PR. Code-only changes (renderer, CLI wiring, tests) don't touch the artifact graph. |
Codecov Report❌ Patch coverage is
📢 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.
Closes #1168
rivet coverage --testsnow prints the clause discharge thatrivet verifyrecorded (#838 / #1164) next to each requirement's marker count.rivet traceandrivet trace-resultsprint the same value for the traced requirement. Before this,1 test markerread the same as a full discharge.Acceptance criteria
2/3in text and JSON.coverage --testsprintsREQ-1 1 test marker clauses 2/3.trace REQ-1andtrace-results REQ-1printclauses discharged: 2/3.coverage --tests --format jsongains adischargeobject keyed by artifact id, with"REQ-1": {"discharged": 2, "total": 3, "stale": false}.trace-results --format jsongains"discharge": {...}for the root.coverage_and_trace_show_clause_discharge, which asserts each exact cell.discharge-stale), the text cell readsclauses stale/clauses discharged: stale.{"discharged": null, "total": 3, "stale": true}. The old fraction is not shown.discharge_state_reports_fraction_stale_or_nothing. That test includes the case where the clause list was removed: the record still reads stale, not silently absent.coverage --testsprintsclauses —.traceandtrace-resultsprint no discharge line.dischargeentry for that id, and none on thetrace-resultsroot.rivet-cli/tests/cli_commands.rs::coverage_and_trace_show_clause_discharge.Design notes
rivet_core::discharge::discharge_state(&Artifact) -> Option<DischargeState>, built on the existingdischarge_summaryandis_stale. Staleness uses the sameis_stale(description, fingerprint)call as thedischarge-stalerule invalidate.rs.0/N."[1, 2]"is still read as a record, so it doesn't show as0/N. This covers records written before the field was typed fromcommon.yaml. An independent review pass flagged it.coverage --testsrows are serialized as[id, markers]tuples, so the per-requirement object goes in a top-leveldischargemap keyed by id rather than inside each row. Both JSON additions appear only when there is something to report, so the output for a project without clause lists is unchanged.rivet verifywould refuse as ambiguous shows—, the same as no list. The docs say so and point torivet verify --explain-clauses.rivet docs verify-clauseshas a new "In the reports" section, anddocs/reference/verify-clauses.mdis regenerated. There is also a CHANGELOG entry.Gates (run locally)
cargo fmt --all -- --checkcargo clippy --all-targets -- -D warningscargo test --workspacerivet validaterivet docs checkChangelogStructurefindings already on main (no tags in this shallow clone, plus duplicate headings in old released sections)Trailers:
Implements: REQ-308,Refs: #1168.Generated by Claude Code