Repository navigation
fv(diff): Kani proofs for hunk-body line mapping (#13681) - #13765
Conversation
Extract the pure coordinate step (hunk_step) and header-count accounting (hunk_account) that ParserState::consume_hunk_line and account_hunk_line already performed inline, with unchanged behavior, and prove them with three Kani harnesses: every body line records exactly the cursor line and never line 0 (all usize coordinates, including exhaustion); a consistent body maps each line to start plus preceding lines; and accounting settles exactly when the body agrees with the header counts. Driving the full parser state through CBMC produced no verdict in 25 minutes, so per RIPR-SPEC-0371 the smaller pure core is proved and the existing parser tests cover its use. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UNUoLVPtDQ1Bdq3NszjhqS
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Next included review available in 25 minutes. View limit details
|
…13681) Review follow-up: the module doc now names the body harnesses and says the surrounding state machine is covered by ordinary tests, and the changelog claims only the remaining-count accounting, not malformed-hunk recording. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UNUoLVPtDQ1Bdq3NszjhqS
|
Independent review (fresh-context subagent, no stake), head Inspected: the full diff, the surrounding
The reviewer's own Kani rerun on Generated by Claude Code |
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY
Subject: head 182ac16e546a180556da2e06f336d7cb767e2ad2.
Independent review by a fresh-context reviewer with no stake in the change. Full record: #13765 (comment).
- Verdict: CLEAN on
b21627b8. - Both non-blocking findings (module doc scope, changelog overclaim) are fixed in
182ac16e, which touches doc comments and the changelog only. - Behavior preservation of
consume_hunk_line/account_hunk_linewas checked line by line. - The harness oracles are independent of the implementation, the domains are stated, and every cover is reachable.
Local evidence on 182ac16e:
cargo kani0.68.0: 5/5 hunk harnesses VERIFIED, 11/11 covers SATISFIED.cargo xtask precommit: exit 0.
Missing until CI completes: hosted Ripr Rust Small Result and the advisory Kani lane. This is not REVIEW_READY for merge.
Generated by Claude Code
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY for head 182ac16
This supersedes my previous review. Its closing sentence was meant only as a scope note, and that note follows here.
The independent fresh-context review found the source clean; record: #13765 (comment). Both of its non-blocking findings are fixed on this head.
Local Kani on this head: 5/5 hunk harnesses VERIFIED, 11/11 covers satisfied. Precommit: exit 0.
Hosted Ripr Rust Small Result and the advisory Kani lane are still to run. The final merge judgment follows their results.
Generated by Claude Code
ripr static exposure checkCommit Took 84s. |
|
The
The existing main-health fix is #13778 ("rebless CLI reference for repair/continue --json"). I am not duplicating it here. Once it lands I will re-apply Generated by Claude Code |
|
Update on the Each failed run composed this head with a I checked current Generated by Claude Code |
Refresh the integration basis: the hosted merge ref was composing with a stale main (3c84be7) that predates the CLI reference reblesses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UNUoLVPtDQ1Bdq3NszjhqS
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY for head 586daf8
This head is a clean merge of current main (5d5951b) into the previously reviewed head 182ac16, with no conflicts. Its diff against main is the same three files, byte for byte: parse.rs, hunk_kani.rs and the changelog fragment. The source and oracle review recorded for 182ac16 still applies unchanged; only the integration basis moved.
Why the merge: the hosted merge ref kept composing with an old main (3c84be7) that predates the CLI reference reblesses #13778 and #13811, so cli_reference_matches_the_binary kept reporting a stale doc in the Rust-only lane.
Local check on this head: cargo test -p ripr --lib analysis::diff passed 313 tests.
Generated by Claude Code
EffortlessSteven
left a comment
There was a problem hiding this comment.
REVIEW_READY for head 586daf8
Final merge judgment for this head.
- Source and oracle review: independent, clean. Both findings were fixed in 182ac16. The diff since then is unchanged; 586daf8 only merges current main into it, with no conflicts.
- Hosted checks on this head all pass: Ripr Rust Small Result (gates and four test shards), Rust-only feature lane, the Kani lane, the Windows gate, cargo-deny, security, the Python journeys and the paste lanes.
- There are no review threads. The only bot output is CodeRabbit and Gemini quota notices plus the advisory ripr comment, so no review findings are pending.
Merging as a squash pinned to this head.
Generated by Claude Code
Requested by Steven Zimmerman · project thread
Summary
hunk_step) and header-count accounting (hunk_account) thatParserState::consume_hunk_line/account_hunk_linealready did inline. Behavior is unchanged: the same refusal at a zero side, the same overflow close, the same+S,0anchor (fix(diff): removed-line new_side_line is one low in a zero-new-count hunk (+S,0), found by the #12918 differential #13098) and+0,0→ line 1 (check: deletion-only diff reports its finding at line 0 (./src/lib.rs:0) #11486).analysis/diff/parse/hunk_kani.rs(beside the existing header proofs):hunk_step_records_the_cursor_line_and_never_line_zero: over allusizecoordinates, a body line records exactly the cursor line and advances that side by one, is refused iff its side is 0, exhausts iff its counter isusize::MAX; no recorded line or anchor is 0.hunk_body_maps_each_line_to_its_exact_coordinate: feeding back the core's ownnext_*, a consistent 3-line body maps each line to start plus the preceding lines (starts over all ofusizeshort of exhaustion).hunk_account_settles_exactly_when_body_matches_header: a 0–4 line body against any stated counts settles at(0,0)iff its own counts equal the header's (over- and under-delivery both fail to settle).record_malformed_hunk, end-of-hunk settlement) is covered by ordinary parser tests, not these proofs.Decision (documented on #13681): harnesses that drove the whole
ParserState(map,PathBufkeys, line text) got no CBMC verdict in 25 minutes, three attempts. Per RIPR-SPEC-0371 ("a smaller pure core is proved"), the proofs target the extracted core; the 306 existinganalysis::difftests keep covering how the state machine uses it.Swarm / Source Boundary
ripr-swarmSource-of-truth Links
Proposal: none
Spec: RIPR-SPEC-0371 (Kani lane; harness rules unchanged)
ADR: none
Plan item: #12109 internal-assurance track; related #12904
Governing issue or accepted claim: #13681
Acceptance delta (one sentence): Kani now proves the diff parser's hunk-body coordinate mapping and its remaining-count accounting against the hunk header, which previously had no proofs.
Candidate Relationships
Candidate branch:
claude/project-thread-zlw2o0Stack parent or prerequisite PR: none
Proposed replacement of PR: none
Local evidence
182ac16e(doc/changelog only sinceb21627b8):cargo kani(0.68.0) — 3 new + 2 existing hunk harnesses VERIFIED (0.5s / 3.1s / 1.3s; existing 69s, 9s); 11/11cover!SATISFIED.cargo xtask precommit: exit 0.b21627b8:cargo test -p ripr --lib analysis::diff: 306 passed. Negative control: mutating production (context step not advancingnew; accounting saturating instead of checked) makes all 3 new harnesses FAILED. Restored.🤖 Generated with Claude Code
https://claude.ai/code/session_01UNUoLVPtDQ1Bdq3NszjhqS