fix(proofs): Kani proof CoverageEntry init missing exempt/exempt_ids (REQ-309, #848) - #865
Conversation
…exempt_ids (REQ-309, #848) REQ-309 added `exempt: usize` and `exempt_ids: Vec<String>` to `CoverageEntry` (rivet-core/src/coverage.rs) for the "declared exemption" surface. The Kani proof harness at `rivet-core/src/proofs.rs:216` builds a `CoverageEntry` by field to exercise `percentage()` bounds, and it wasn't updated when the fields landed. `cargo kani -p rivet-core` therefore fails to compile on `main` and on every PR head that inherits it: error[E0063]: missing fields `exempt` and `exempt_ids` in initializer of `coverage::CoverageEntry` --> rivet-core/src/proofs.rs:216:21 Fix: initialize both fields to their empty values. The proof is about `percentage()`, which reads only `covered` and `total`, so `exempt: 0` and `exempt_ids: vec![]` are the correct inputs and preserve the existing proof's bounds. Not gated by CI today: `Kani Proofs` is `continue-on-error: true` (#839), so this regression rode along invisibly. Fixing it now clears the noise on every subsequent PR that would otherwise see a Kani failure that isn't theirs (surfaced first on #864). Fixes: REQ-309 Refs: #848, #839, #864
📐 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! |
|
CI Gate is green on Kani Proofs — runner shutdown, not the fix. The log shows Exit 143 = SIGTERM. This is precisely the self-hosted-fleet-restart pattern #862 documents (and one #839's failures were probably conflating). The fix itself compiled cleanly before the runner went away, so the E0063 is genuinely resolved. Will spend the one re-run for this per the drive-to-green rules. Mutation Testing (rivet-core, PR-diff) — advisory, surviving mutant is in Kani-gated code. The log: Line 209 is the Generated by Claude Code |
Kani Proofs on this PR's head is red for a compile error in code the diff doesn't touch (rivet-core/src/proofs.rs:216, missing exempt / exempt_ids fields added by REQ-309 / #848 to `CoverageEntry`). The fix is already up at #865. Ported here so this PR's Kani stops being red on an unrelated failure; no-ops once #865 merges. Fixes: REQ-309 Refs: #848, #865
The failure
Kani Proofsfails on every PR head off currentmainwith a two-field struct-init mismatch:Reproduces on
main@ 83c7d91 and on my #864 head. Surfaced by the Kani check on that PR — the diff there doesn't touchrivet-coreat all, so the failure isn't its.Root cause
REQ-309 / #848 added two fields to
CoverageEntryinrivet-core/src/coverage.rs:The Kani harness
proof_coverage_percentage_bounds(rivet-core/src/proofs.rs:216) builds aCoverageEntryfield-by-field and wasn't updated when the fields landed.mod proofsis gated on#[cfg(kani)], so plaincargo check -p rivet-coredoesn't compile it — that's how the miss escaped the merge of #848.The fix
Initialize both new fields to their empty values (
exempt: 0,exempt_ids: vec[]). The proof asserts bounds onpercentage(), which reads onlycoveredandtotal, so the empty values are the correct inputs and preserve the existing proof's semantics.Why it wasn't caught
Kani Proofsiscontinue-on-error: trueand outsideci-gate'sneeds:(issue #839), so a red Kani doesn't block the merge and this regression rode along invisibly across every subsequent PR. #839 flags Kani's environmental flakes (exit 143 / SIGTERM); this failure is a different mode — a deterministic compile error — that #839's flake pattern was masking.Verification
cargo check -p rivet-core— clean before and after (the#[cfg(kani)]gate makes this insensitive to the change).coverage.rs:59-95, exactly the fields the E0063 error names.Commit trailer
Fixes: REQ-309,Refs: #848, #839, #864.Generated by Claude Code