Repository navigation
Kani harnesses: diff hunk range line-zero guard and hunk-number digits - #11911
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SvmPmqCNvFAErf575FjLhG
|
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 35 minutes. View limit details
|
There was a problem hiding this comment.
Independent review (fresh-context reviewer, head 99c3375): REPAIR_REQUIRED
Inspected:
- Merge base 7eb558f -> head 99c3375. The declared baseRefOid (fa621a3) is NOT an ancestor of this head, so I diffed against the merge base; that three-dot diff matches the 4-file GraphQL file list (1 commit in range).
- crates/ripr/src/analysis/diff/parse.rs:16-19 (module wiring) and :150-169 (
parse_range,parse_hunk_number) at head; crates/ripr/src/analysis/diff/parse/hunk_kani.rs:1-50 (both harnesses) at head. - changelog.d/fv-diff-hunk-range-kani.md at head.
- Cargo.toml
[workspace.lints.rust]at merge base and at head (nounexpected_cfgs/check-cfgentry); crates/ripr/Cargo.toml[lints] workspace = trueat head. - .github/workflows/rust-gates.yml:226-228 ("Strict workspace Clippy" ->
cargo clippy --workspace --all-targets -- -D warnings) at fa621a3. - xtask/src/policy/changelog_fragments.rs:243-252 (per-entry issue/PR reference rule), :60 (file-naming rule); xtask/src/main.rs:1741 (
check_changelog_fragments()insiderun_policy_checks(), reached bycargo xtask ci-policy). - policy/proof-packs.toml (no Kani pack) and xtask/src (no
kanioccurrence anywhere). - Hosted check runs at head 99c3375, grouped by workflow run id. No prior review exists on this PR.
Blocking:
- crates/ripr/src/analysis/diff/parse.rs:18 -
#[cfg(kani)] mod hunk_kani;introduces a cfg name the workspace never declares.Cargo.toml[workspace.lints.rust]at this head has nounexpected_cfgsentry and nocheck-cfglist, so rustc's warn-by-defaultunexpected_cfgslint fires at parse.rs:18;.github/workflows/rust-gates.yml:228runscargo clippy --workspace --all-targets -- -D warnings, which promotes that warning to an error. The required Rust lane fails on this candidate the moment it is not skipped. The repair already exists in this repo: open PR #11624 (head 3dcb5ce) adds exactlyunexpected_cfgs = { level = "warn", check-cfg = ['cfg(kani)'] }to[workspace.lints.rust], and its commit 517c77c is titled "build: declare cfg(kani) so the proof modules do not warn as unexpected_cfgs". Candidate-attributable: the base tree contains no#[cfg(kani)]attribute anywhere; this PR adds the first one. - changelog.d/fv-diff-hunk-range-kani.md:2 - the entry names no issue or PR. xtask/src/policy/changelog_fragments.rs:243-252 rejects any
-entry without an issue/PR reference ("names no issue or PR; add(#N)or a link to it"), and that gate runs in the required lane throughcargo xtask ci-policy->run_policy_checks()->check_changelog_fragments()(xtask/src/main.rs:1741). The file name also departs from the documented<pr-or-issue>-<short-slug>.mdconvention (changelog_fragments.rs:60):fv-diff-hunk-range-kani.mdcarries no issue or PR prefix. Sibling PRs #11624 ((#11624)), #11517 ((#10686)), #11415 ((#7415),(#11353)) and #11930 ((#4987)) all carry the reference; this one does not.
Non-blocking:
- crates/ripr/src/analysis/diff/parse/hunk_kani.rs:44 - the overflow half of
hunk_range_exclusive_end_never_overflowsis not a discriminator at the stated bound.bufis 5 ASCII bytes (hunk_kani.rs:37), so the largest reachablestartis 99999 and the largest reachablestart + countis 100000 (no comma) or 1008 (one comma leaves <= 9 for start, <= 999 for count).usize::MAXis unreachable, andassert!(start.checked_add(count).is_some())holds by arithmetic on the bound, not because of the production guardstart.checked_add(count).is_none()at parse.rs:158. A mutant that replaced the guardedchecked_addwith an unchecked add, or deleted that guard, would still pass at this bound. The other half is discriminating:assert!(count == 0 || start >= 1)(hunk_kani.rs:46) fails if thecount > 0 && start == 0guard at parse.rs:158 is removed. The fragment states both properties in one sentence ("never accepts a span whose exclusive end overflowsusizeor a positive span at line 0"), so it advertises more than the harness demonstrates; the module doc (hunk_kani.rs:6-8) scopes it more tightly ("inputs are ASCII byte strings of a fixed small length"), so fragment and module doc disagree. - crates/ripr/src/analysis/diff/parse/hunk_kani.rs:14-31 -
hunk_number_accepts_only_nonempty_ascii_digitsis a real discriminator:parse_hunk_numberrejects non-digits at parse.rs:165 and the harness assertsSome(value) => text.bytes().all(|b| b.is_ascii_digit())(hunk_kani.rs:22). TheNone-branch cover (hunk_kani.rs:26-29) needs a non-digit input and is reachable. TheSome-branch cover (hunk_kani.rs:23) requiresvalue > 0, soparse_hunk_number("0")is the one accepted input the cover does not name - consistent with its label, worth stating. - No declared proof lane executes this harness.
policy/proof-packs.tomlhas no Kani pack; theanalysis-fixturepack coveringcrates/ripr/src/analysis/**requirescargo test --workspace,cargo xtask fixtures,cargo xtask goldens check,cargo xtask check-fixture-contracts, and a#[cfg(kani)]module is compiled out by all four.xtask/src/contains nokanireference at all. The proof claim rests entirely on the author's localcargo kanirun, which the repository's own automation cannot reproduce. Disclosed gap, not a defect - but it is not repo-established proof. - The harness module is not registered in
.ripr/traceability.tomlnor in any proof pack. I checked the convention against the sibling Kani PRs in flight (#11624, #11843, #11877): none registers a harness file there either, and RIPR-SPEC-0367 requires traceability registration for spec-owned artifacts, not for verification modules no spec owns. Not a finding against this PR. - The head is behind
main(merge base 7eb558f;mainis at fa621a3). The diff is small and self-contained, but a merge must rebase over what landed since 7eb558f.
Not run:
- No local build, test, clippy, fmt,
cargo xtaskgate, orcargo kaniharness execution was run: the Rust toolchain on this host is not onPATHand the working tree is shared, so I did not build. Theunexpected_cfgsanalysis is a source reading ofCargo.tomlplus.github/workflows/rust-gates.yml:228, not an observed compiler diagnostic; the author's own note in #11912's body ("4 warnings areunexpected_cfgsforcfg(kani)") corroborates the mechanism but is not a receipt from this head. - Hosted lanes at head 99c3375 are skipped, not green and not red: this PR is a draft and the Rust lanes arm on the
merge-readylabel event. Observed: 41244767450 ub-review = success; 41244767484 (Qualify ripr-rs Python Wheel) "clean uv install and useful Python journey", "clean pip install and useful Python journey", "build and inspect Linux x64 wheel", "workflow policy and wheel applicability" = success, "pinned MCP evidence before and after (advisory)" = skipped; CodeRabbit = neutral; GitGuardian Security Checks = success. Skipped: 41244767421 macos-advisory, 41244767428 rust-tests-junit, 41244767449 rust-coverage, 41244767453 (msrv, source-identity, Rust-only feature lane, ci-result, Perl and release proof, vscode), 41244767459 paste matrix, 41244767480 cargo-deny/dependency-review, 41244767490 future-clippy, 41244767552 windows-advisory / -subset / -runner-probe, 41244767579. Not observed on this head: any clippy execution, any Rust test execution, anycargo xtaskpolicy gate, any Kani harness execution. The blockingunexpected_cfgsdefect is a source-level defect the hosted head cannot currently expose; it will surface as a red "Strict workspace Clippy" step once this draft leaves draft.
Reviewed by an independent Mavis review agent on behalf of the maintainer; bound to head 99c3375c68ad4ce1da9d181cd3df0d10e28ecdc7. Not an approval.
Review blockers: unexpected_cfgs check-cfg for cfg(kani) so the strict Clippy lane stays clean, and an issue/PR reference plus accurate proof scope in the changelog fragment. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SvmPmqCNvFAErf575FjLhG
There was a problem hiding this comment.
Independent review (fresh-context reviewer, head 6587beb): REVIEW_INCOMPLETE
Supersedes my earlier review at head 99c3375. The head moved while I was reviewing; this review re-reads the current head and covers the delta.
Inspected:
- The delta 99c3375 -> 6587beb in full: one commit, "Declare cfg(kani) and fix changelog fragment reference", touching Cargo.toml (+2) and the changelog fragment (renamed, +2/-2). No harness file changed.
- The current head's Cargo.toml
[workspace.lints.rust], crates/ripr/src/analysis/diff/parse.rs:16-19 and :150-169, crates/ripr/src/analysis/diff/parse/hunk_kani.rs:1-50, and changelog.d/11911-fv-diff-hunk-range-kani.md. - Re-read at the new head: crates/ripr/src/analysis/diff/parse/hunk_kani.rs:1-16 (module doc and harness names), the
cfg(kani)attribute sites, and policy/proof-packs.toml plus xtask/src (nokanireference) to re-confirm the proof-lane position. - Hosted check runs at head 6587beb, grouped by workflow run id. The earlier review at 99c3375 remains on the PR; this review states which of its findings are repaired, which still hold and which are now stale.
Blocking:
- none. Both blocking findings from my review at 99c3375 are REPAIRED at this head.
- The undeclared
cfg(kani)is fixed. Cargo.toml now carries# \cfg(kani)` gates the bounded-model-checking proof modules; Kani sets it, rustc does not know it.followed byunexpected_cfgs = { level = "warn", check-cfg = ['cfg(kani)'] }in[workspace.lints.rust]. That is byte-identical to the declaration open PR #11624 carries at head 3dcb5ce9, so rustc's warn-by-defaultunexpected_cfgslint no longer fires at crates/ripr/src/analysis/diff/parse.rs:18 and.github/workflows/rust-gates.yml:228(cargo clippy --workspace --all-targets -- -D warnings`) will no longer fail on this candidate. - The changelog fragment is fixed.
changelog.d/fv-diff-hunk-range-kani.mdis renamed tochangelog.d/11911-fv-diff-hunk-range-kani.md- satisfying the documented<pr-or-issue>-<short-slug>.mdconvention (xtask/src/policy/changelog_fragments.rs:60) - and the entry now carries(#11911), satisfying the per-entry issue/PR reference rule at changelog_fragments.rs:243-252 thatcargo xtask ci-policy->run_policy_checks()->check_changelog_fragments()(xtask/src/main.rs:1741) enforces.
- The undeclared
Non-blocking:
- The overflow overclaim is repaired in the release note, but the harness still carries it. The fragment now reads "...prove, within a 5-byte input bound, that the unified-diff hunk-range parser never accepts a positive span at line 0 and accepts hunk numbers only from ASCII digits. The bound is too small to exercise the
usizeoverflow guard, so overflow is not claimed (#11911)." That is exactly the correction my earlier review asked for, and it is accepted. The source still names the harnesshunk_range_exclusive_end_never_overflowsand still carries the inline comment "// Downstreamstart + countarithmetic cannot overflow." aboveassert!(start.checked_add(count).is_some());- an assertion that is tautological at this bound, because withbuf: [u8; 5]the largest reachablestart + countis 100000 (no comma) or 1008 (one comma), far fromusize::MAX. The release note is now honest; the harness name and the comment are not. Renaming the harness (for example tohunk_range_rejects_line_zero_spans) and dropping the comment, or raising the bound so the guard at crates/ripr/src/analysis/diff/parse.rs:158 is actually reachable, would close the gap in code as well as in prose. - Still holds from my earlier review: the line-0 half of the harness is the genuinely discriminating one.
assert!(count == 0 || start >= 1)(hunk_kani.rs:46) fails if thecount > 0 && start == 0guard at crates/ripr/src/analysis/diff/parse.rs:158 is removed;hunk_number_accepts_only_nonempty_ascii_digits(hunk_kani.rs:14-31) is a real discriminator becauseparse_hunk_numberrejects non-digits at parse.rs:165 and theNone-branch cover at hunk_kani.rs:26-29 is reachable. TheSome-branch cover at hunk_kani.rs:23 requiresvalue > 0, soparse_hunk_number("0")remains the one accepted input the cover does not name - consistent with its label. - Still holds from my earlier review: no declared proof lane executes this harness.
policy/proof-packs.tomlhas no Kani pack; theanalysis-fixturepack coveringcrates/ripr/src/analysis/**requirescargo test --workspace,cargo xtask fixtures,cargo xtask goldens checkandcargo xtask check-fixture-contracts, and a#[cfg(kani)]module is compiled out by all four.xtask/src/contains nokanireference at all, so nocargo xtasksurface runs it. The proof claim rests entirely on the author's localcargo kanirun. Disclosed, but not repo-established proof. - Still holds from my earlier review: the harness module is registered in neither
.ripr/traceability.tomlnor any proof pack, and the sibling Kani PRs in flight (#11624, #11843, #11877) behave the same way, so this is not a finding against this PR. - New coordination point, not a defect: this PR, #11912 (head 40e6bda) and #11624 (head 3dcb5ce) now carry a byte-identical two-line Cargo.toml hunk, and open draft PR #11787 adds the same declaration to the same file for the same reason. Four PRs, one hunk. Whichever lands second will need a rebase, and because the hunk is identical rather than conflicting, the resolution is trivial - but one owner should land it and the others should drop the duplicate. Setting
[workspace.lints.rust] unexpected_cfgsalso replaces the workspace's own check-cfg list; cargo passes feature cfgs separately, so this is additive in practice, but it is still worth landing once. - The head is still behind
main(the base fa621a3 is an ancestor of this head; the merge base is unchanged from my earlier review), so a merge must rebase over whatever landed since.
Not run:
- No local build, test, clippy, fmt,
cargo xtaskgate, orcargo kaniharness execution was run: the Rust toolchain on this host is not onPATHand the working tree is shared, so I did not build. Theunexpected_cfgsanalysis is a source reading of Cargo.toml plus.github/workflows/rust-gates.yml:228; it is not an observed compiler diagnostic. - Hosted at head 6587beb: this PR is a Draft, so the Rust lanes are skipped - not green, not red. Observed: 41249151620 "workflow policy and wheel applicability" = success, "build and inspect Linux x64 wheel" = in_progress, "pinned MCP evidence before and after (advisory)" = skipped; 41249151535 ub-review = in_progress; CodeRabbit = neutral; GitGuardian Security Checks = success. Skipped: 41249151537 (Rust-only feature lane, source-identity, Perl and release proof, msrv, ci-result, vscode), 41249151667 macos-advisory, 41249151677 dependency-review and cargo-deny, 41249151681 windows-advisory / -subset / -runner-probe, 41249151691 paste matrix, 41249151777 rust-tests-junit, 41249151796 future-clippy, 41249151797 rust-coverage. Not observed at this head: any clippy execution, any Rust test execution, any
cargo xtaskpolicy gate, and any Kani harness execution. That includes the newly addedunexpected_cfgsdeclaration itself: the fix that repairs my blocking finding has not been validated by a compiler, because the lane that would compile it is skipped while the PR is a draft. That is the whole of what remains unverified, and it is why the disposition is REVIEW_INCOMPLETE rather than READY - the source and oracle review is complete and I found no blocking defect.
Reviewed by an independent Mavis review agent on behalf of the maintainer; bound to head 6587beb90937f0ec33b123b795f122af9c6a275d. Not an approval.
…ow assert At the 5-byte bound the usize overflow guard is unreachable, so the assertion could not fail. Keep the line-0 discriminator under an honest name. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SvmPmqCNvFAErf575FjLhG
There was a problem hiding this comment.
Independent review (fresh-context reviewer, head ef08c71): REVIEW_INCOMPLETE
Consolidated re-review. This supersedes my two earlier reviews on this PR (at heads 99c3375 and 6587beb) and covers the full delta from the head I first reviewed.
Inspected:
- The full delta 99c3375 -> ef08c71, which is two commits: 6587beb ("Declare cfg(kani) and fix changelog fragment reference") and ef08c71 ("Rename hunk-range harness to what it proves; drop tautological overflow assert"). I read both diffs in full.
- The complete PR diff at this head, verified against the GraphQL file list and merge base 7eb558f: Cargo.toml (+2), changelog.d/11911-fv-diff-hunk-range-kani.md (+2), crates/ripr/src/analysis/diff/parse.rs (+3), crates/ripr/src/analysis/diff/parse/hunk_kani.rs (+48) - four files, 55 insertions.
- The current head's crates/ripr/src/analysis/diff/parse/hunk_kani.rs in full, crates/ripr/src/analysis/diff/parse.rs:16-19 and :150-169 (production
parse_rangeandparse_hunk_number), Cargo.toml[workspace.lints.rust], and changelog.d/11911-fv-diff-hunk-range-kani.md. - Re-confirmed at this head: policy/proof-packs.toml declares no Kani pack, and xtask/src contains no
kanireference at all. - .github/workflows/rust-gates.yml:226-228 at fa621a3; xtask/src/policy/changelog_fragments.rs:243-252 and :60; xtask/src/main.rs:1741.
- Hosted check runs at head ef08c71, grouped by workflow run id.
Blocking:
- none. Every finding from my first review at 99c3375 is now REPAIRED at this head.
- The undeclared
cfg(kani)is fixed: Cargo.toml[workspace.lints.rust]now carriesunexpected_cfgs = { level = "warn", check-cfg = ['cfg(kani)'] }, byte-identical to the declaration in open PR #11624 at head 3dcb5ce, so rustc's warn-by-defaultunexpected_cfgslint no longer fires at crates/ripr/src/analysis/diff/parse.rs:18 and.github/workflows/rust-gates.yml:228(cargo clippy --workspace --all-targets -- -D warnings) will not fail on this candidate. - The changelog fragment is fixed:
changelog.d/fv-diff-hunk-range-kani.mdis renamed tochangelog.d/11911-fv-diff-hunk-range-kani.md, satisfying the documented<pr-or-issue>-<short-slug>.mdconvention (changelog_fragments.rs:60), and the entry carries(#11911), satisfying the per-entry issue/PR reference rule at changelog_fragments.rs:243-252 thatcargo xtask ci-policy->run_policy_checks()->check_changelog_fragments()(xtask/src/main.rs:1741) enforces. - The overflow overclaim is fixed in the prose and now in the code. The fragment reads "...prove, within a 5-byte input bound, that the unified-diff hunk-range parser never accepts a positive span at line 0 and accepts hunk numbers only from ASCII digits. The bound is too small to exercise the
usizeoverflow guard, so overflow is not claimed (#11911)." And ef08c71 renames the harness fromhunk_range_exclusive_end_never_overflowstohunk_range_rejects_positive_span_at_line_zeroand deletes both the tautologicalassert!(start.checked_add(count).is_some())and the overclaiming comment "// Downstreamstart + countarithmetic cannot overflow." At the 5-byte bound the largest reachablestart + countis 100000, so that assertion could never fail and could not discriminate against a mutant of the guard at crates/ripr/src/analysis/diff/parse.rs:158. Removing it leaves the harness asserting exactly what it can prove. REPAIRED, and this is the substantive form of the fix - a renamed harness and a deleted assertion, not a reworded comment.
- The undeclared
Non-blocking:
- The harness that remains is a genuine discriminator.
hunk_range_rejects_positive_span_at_line_zeroassertscount == 0 || start >= 1, which fails if thecount > 0 && start == 0guard at crates/ripr/src/analysis/diff/parse.rs:158 is removed;hunk_number_accepts_only_nonempty_ascii_digitsassertsSome(value) => text.bytes().all(|b| b.is_ascii_digit())against a productionparse_hunk_numberthat rejects non-digits at parse.rs:165, and itsNone-branch cover is reachable via a non-digit input. TheSome-branch cover requiresvalue > 0, soparse_hunk_number("0")remains the one accepted input the cover does not name - consistent with its label. - No declared proof lane executes this harness, and that has not changed.
policy/proof-packs.tomlhas no Kani pack; theanalysis-fixturepack coveringcrates/ripr/src/analysis/**requirescargo test --workspace,cargo xtask fixtures,cargo xtask goldens checkandcargo xtask check-fixture-contracts, and a#[cfg(kani)]module is compiled out by all four.xtask/src/contains nokanireference at all, so nocargo xtasksurface runs it. The proof claim rests entirely on the author's localcargo kanirun, which the repository's own automation cannot reproduce. Disclosed in the PR body; not repo-established proof. - The harness module is registered in neither
.ripr/traceability.tomlnor any proof pack. The sibling Kani PRs in flight (#11624, #11843, #11877) behave the same way and RIPR-SPEC-0367 requires traceability registration for spec-owned artifacts rather than for verification modules that no spec owns, so this is not a finding against this PR. - Coordination, not a defect: this PR, #11912 (head 40e6bda) and #11624 (head 3dcb5ce) now carry a byte-identical two-line Cargo.toml hunk, and open draft PR #11787 adds the same declaration to the same file for the same reason. Four PRs, one hunk. Because the hunk is identical rather than conflicting, the resolution is trivial, but one owner should land it and the others should drop the duplicate.
- The head is behind
main. The PR's declared base is main at fa621a3, andgit merge-base --is-ancestor fa621a32e ef08c71caexits non-zero - the base is NOT an ancestor of the head. The merge base is 7eb558f, and a merge must rebase over whatever landed since. (This corrects a clause in my review at 6587beb, which asserted the opposite; I withdrew it there and repeat the corrected statement here.)
Not run:
- No local build, test, clippy, fmt,
cargo xtaskgate, orcargo kaniharness execution was run: the Rust toolchain on this host is not onPATHand the working tree is shared, so I did not build. Theunexpected_cfgsanalysis is a source reading of Cargo.toml plus.github/workflows/rust-gates.yml:228; it is not an observed compiler diagnostic, and the harness rename and assertion deletion are source reads, not executed proofs. - Hosted at head ef08c71: this PR is a Draft, so the Rust lanes are skipped - not green, not red. Observed: 41249629940 "workflow policy and wheel applicability" = in_progress and "pinned MCP evidence before and after (advisory)" = skipped; CodeRabbit = neutral; GitGuardian Security Checks = success. Skipped: 41249629911 cargo-deny and dependency-review, 41249629916 macos-advisory, 41249629918 (msrv, Rust-only feature lane, source-identity, ci-result, vscode, Perl and release proof), 41249629921 windows-advisory / -subset / -runner-probe, 41249629926 rust-tests-junit, 41249629930 paste matrix, 41249629950 future-clippy, 41249630003 rust-coverage. Not observed at this head: any clippy execution, any Rust test execution, any
cargo xtaskpolicy gate, and any Kani harness execution. That includes compiler validation of the newly addedunexpected_cfgsdeclaration itself and of the edited harness: the fixes that repair my findings have not been validated by a compiler, because the lane that would compile them is skipped while the PR is a draft. That is the whole of what remains unverified, and it is why the disposition is REVIEW_INCOMPLETE rather than READY - the source and oracle review is complete and I found no blocking defect.
Reviewed by an independent Mavis review agent on behalf of the maintainer; bound to head ef08c71ca7ccf2a5dffce8f350972c7fab833667. Not an approval.
There was a problem hiding this comment.
Decision
- Needs verification checks before upstream.
Verification questions
- Confirm the PR adds Kani harnesses but no ordinary regression test that distinguishes pre-change and post-change behavior; the new proof module is cfg-gated and absent from normal test execution.
- Confirm the digit-only harness has a discriminating postcondition but no explicit non-vacuity mutation receipt.
- Confirm the range harness proves rejection of positive spans at line zero only within five ASCII bytes, not the originally claimed usize overflow property.
- Confirm alternate range parsers or arithmetic helpers were not comprehensively inventoried, so sibling completeness remains unproven.
- Confirm the PR body claims a Kani proof that exclusive-end usize overflow cannot occur, but the current five-byte harness cannot reach overflow-scale inputs and the changelog explicitly disclaims that claim. Update the PR description to match the reviewed head.
Refuted
- The current harness proves the line-zero invariant but cannot exercise the usize overflow guard.
Evidence gaps
- The PR body's non-vacuity experiment is a manual, unreceipted mutation claim; the packet contains no artifact showing the guard-removal run failing and being reverted.
- The supplied packet lacks completed cargo-test and ripr execution receipts, so compilation and proof behavior remain unconfirmed by available evidence.
- Model proof intent was rejected by deterministic validation.
- Execution evidence is incomplete: cargo-test is scheduled without a receipt and ripr failed with exit code 2.
- The provided packet lacks completed cargo-test and Kani proof receipts, while the ripr sensor failed with exit code 2.
All Kani PRs now carry the byte-identical declaration at the same place in [workspace.lints.rust] as #11787, so whichever lands first the others merge cleanly and the key is never defined twice. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SvmPmqCNvFAErf575FjLhG
There was a problem hiding this comment.
Independent review (fresh-context reviewer, head e879ef3): REVIEW_INCOMPLETE
Inspected:
- Rebind bundle
.tmp-review-rebind/pr-11911.md; heade879ef33db16d37b9a9e29a66c81f8685a8d9284, base refmain@fa621a32eaf4c3dc6c17119021ea943641696aef, merge base vs current main7eb558fb4727298c7da10702496c6b2f385f08bd, current main tipa69bf0214f7bd7e0537a1cdd07e95608e5a366e8, draft, mergeable MERGEABLE, mergeStateStatus BLOCKED, no labels. Delta since the previously reviewed headef08c71cais one path:Cargo.toml, +2/-2. - That delta re-positions the
unexpected_cfgsdeclaration inside[workspace.lints.rust]— it removes the copy that sat lower in the table (with the comment "cfg(kani)gates the bounded-model-checking proof modules; Kani sets it, rustc does not know it.") and adds an identical-semantics copy immediately afterunsafe_code = "forbid"(nowCargo.toml:23) with the comment "cfg(kani)is set only bycargo kani(RIPR-SPEC-0370).". The lint name,level = "warn"andcheck-cfg = ['cfg(kani)']are unchanged, so this is a placement and comment change with no semantic effect. The resulting table holds exactly oneunexpected_cfgskey. - Semantic owner and scope, unchanged by the delta:
crates/ripr/src/analysis/diff/parse/hunk_kani.rs—hunk_number_accepts_only_nonempty_ascii_digitsat:14andhunk_range_rejects_positive_span_at_line_zeroat:36— gated by#[cfg(kani)] mod hunk_kani;incrates/ripr/src/analysis/diff/parse.rs:18. The production code they target isparse_hunk_number(parse.rs:165) andparse_range(parse.rs:150-169), including thecount > 0 && start == 0guard atparse.rs:158. - Merge basis: GitHub test-merge tree
c3496c6629a15b7d33a5eb69f2ed65ec5c1fa61dagainst main tipa69bf0214f7bd7e0537a1cdd07e95608e5a366e8. This check mattered: the branch's previous blob carried the declaration at a different position in the same TOML table, so a careless application could have produced twounexpected_cfgskeys in one table — a TOML duplicate-key parse error that breaks every cargo invocation in the workspace. The mergedCargo.tomlcarries exactly one entry, and main carries none, so the merge adds exactly the two lines and the hazard is gone. - Duplicate-claim survey: I hashed
Cargo.tomlat the head of all 117 open PRs. Nine carry the byte-identical blob874fef728with this exact declaration:#11624,#11787,#11811,#11823,#11843,#11877,#11911,#11912,#11954. This PR is one of the nine, and this delta is what brought it into line with the other eight.
Blocking:
- None attributable to this candidate, and no regression in the delta. Hosted Rust proof is nevertheless missing at this head, so this cannot be REVIEW_READY: the required context
Ripr Rust Small Resultis ABSENT ate879ef33d(27 contexts; 17 SKIPPED, 9 SUCCESS, 1 NEUTRAL) and every Rust lane is SKIPPED (source-identity,rust-coverage,future-clippy,cargo-deny,rust-tests-junit,Rust-only feature lane,msrv,ci-result). An absent required check is not a failing check; this PR is a draft with nomerge-readylabel, so no Rust qualification was dispatched for this head.
Non-blocking:
- Every finding from the predecessor's review at
ef08c71caremains REPAIRED; the delta touches onlyCargo.tomland no artefact those findings were raised against. Thecheck-cfgdeclaration is present; the changelog fragment remainschangelog.d/11911-fv-diff-hunk-range-kani.mdcarrying(#11911); the harness remains renamed tohunk_range_rejects_positive_span_at_line_zerowith the tautologicalassert!(start.checked_add(count).is_some())deleted, so the harness now asserts exactly what it can prove at a 5-byte bound. The fragment's own wording ("The bound is too small to exercise theusizeoverflow guard, so overflow is not claimed") and the body's "Not claimed" section both state the limit explicitly rather than implying it. - The surviving harness is a genuine discriminator, and I verified the code rather than trusting the description:
hunk_range_rejects_positive_span_at_line_zeroassertscount == 0 || start >= 1(hunk_kani.rs:44), which fails if thecount > 0 && start == 0guard atcrates/ripr/src/analysis/diff/parse.rs:158is removed, andhunk_number_accepts_only_nonempty_ascii_digitsassertsSome(value) => text.bytes().all(|b| b.is_ascii_digit())against a productionparse_hunk_numberthat rejects non-digits atparse.rs:165, with a reachableNone-branch cover. - One precision note on the surviving harness: the
Some-branchkani::cover!requiresvalue > 0, soparse_hunk_number("0")is the one accepted input the cover does not name. That is consistent with the cover's own label, and the predecessor already recorded it; nothing in the delta changes it. - Earlier finding that no declared proof lane executes this harness — STILL HOLDS.
policy/proof-packs.tomldeclares no Kani pack; theanalysis-fixturepack coveringcrates/ripr/src/analysis/**requirescargo test --workspace,cargo xtask fixtures,cargo xtask goldens checkandcargo xtask check-fixture-contracts, and a#[cfg(kani)]module is compiled out by all four;xtask/srccontains nokanireference at all. The proof claim rests entirely on the author's localcargo kanirun, which the repository's own automation cannot reproduce. Disclosed in the body; not repo-established proof. - Earlier finding that the harness module is registered in neither
.ripr/traceability.tomlnor any proof pack — STILL HOLDS, and is not a finding against this PR: the sibling Kani PRs in flight behave the same way, and RIPR-SPEC-0367 requires traceability registration for spec-owned artefacts rather than for verification modules that no spec owns. - Coordination, not a defect: the shared two-line hunk now has nine owners (listed above) rather than the four the predecessor counted. All nine are byte-identical, so the merge resolution is trivial — whichever lands second rebases and drops the hunk — but one owner should land it and the others should drop the duplicate. Survivor recommendation for the key:
#11624— among the twomerge-readymembers it is the one whose body is already consistent with the declaration being present ("The workspaceunexpected_cfgslint now declarescfg(kani)so normal builds do not warn"), whereas this PR's own body,#11787's and#11823's still describe the declaration as pending elsewhere.#11787keeps the distinct surface it owns —.github/workflows/kani.yml, the xtask lane,crates/ripr/src/kani_smoke.rs, RIPR-SPEC-0370 — which is the lane, not the lint key, so it is not a duplicate of the declaration. The other seven members should rebase and drop the hunk, since main carries nounexpected_cfgsentry (verified ata69bf0214). - The new comment cites RIPR-SPEC-0370, which does not exist on main; it lands only with the draft
#11787. If#11787is dropped or reworked, the citation dangles. Low impact, but the comment should point at a spec that has landed or drop the reference. - The head is still behind
main: the declared basefa621a32eis not an ancestor of this head and the merge base is7eb558fb, so a merge must rebase over whatever landed since. The diff itself is small and self-contained. - Merge-loss check (new, positive): the test-merge tree's
.ripr/traceability.tomlblob is9cd12b80a2ad6b1f427dd2d90dec684d4822aef6, identical to main's, so the merge drops no live[[behavior]]or fixture registrations. - Efficiency: no efficiency concern. The delta adds a lint declaration and reorders two lines in a TOML table; it changes no shipped code path, adds no runtime work, no I/O, no cache and no retained collection. The harnesses are excluded from normal builds by
#[cfg(kani)], so there is no compile or run cost outsidecargo kani. No magnitude claim needs verifying.
Not run:
- The Rust toolchain on this host is not on
PATH, so nocargo xtask precommit,cargo test,cargo fmt --check,cargo xtask ci-policy, clippy orcargo kaniwas executed. Every Rust-level statement above comes from reading source at this head, not from execution. - Hosted CI at this head did not exercise the Rust lane (all Rust contexts SKIPPED, required context absent), so neither the re-positioned declaration nor the harnesses have hosted compile or test evidence bound to
e879ef33d. - The CBMC runtimes and the injected-bug result in the body are unverified; there is no hosted CBMC artefact and no local toolchain here.
Reviewed by an independent Mavis review agent on behalf of the maintainer; bound to head e879ef33db16d37b9a9e29a66c81f8685a8d9284. Not an approval.
# Conflicts: # Cargo.toml
|
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.
REVIEW_READY
Head reviewed: 5258e5a. Static review against RIPR-SPEC-0371; I did not run cargo xtask kani or inspect hosted checks.
Soundness. Both harnesses call the real parse_hunk_number / parse_range on symbolic ASCII (4 and 5 bytes, explicit assume(< 128), stated in the header). hunk_range_rejects_positive_span_at_line_zero asserts count == 0 || start >= 1 against production's (count > 0 && start == 0) rejection, with covers on both an accepted non-empty range and the accepted empty 0,0 range, so it is not vacuous (0,0 and 1,1 fit in 5 bytes). The changelog explicitly disclaims the checked_add overflow guard ("bound too small to exercise it, overflow is not claimed"), which is the honest statement.
Nit (non-blocking). hunk_number_accepts_only_nonempty_ascii_digits is named for non-emptiness, but the buffer is a fixed 4 bytes, so the empty string is never explored and the assertion is only "accepted ⇒ all ASCII digits". Production's raw.is_empty() guard happens to be redundant with "".parse::<usize>() failing, so there is no behavioral gap, but either rename (..._accepts_only_ascii_digits) or add a symbolic length so emptiness is actually in scope. The changelog wording ("only from ASCII digits") is accurate as is.
Leftover spec refs. None (0370 absent).
Generated by Claude Code
There was a problem hiding this comment.
Decision
- Needs verification checks before upstream.
Verification questions
- Confirm the digit harness has a discriminating accepted-input postcondition but its rejection-path cover does not ensure every non-digit string is rejected.
- Confirm the digit harness's fixed four-byte input cannot distinguish the empty-string behavior from the stated nonempty claim.
- Confirm the PR contains no ordinary regression test that fails before the change and passes after it.
- Confirm the digit harness proves accepted implies every byte is ASCII-digit, but its fixed four-byte buffer cannot exercise the empty-string path despite its name.
- Confirm the digit harness covers only fixed-length four-byte input, so its name implies nonempty coverage that is not exercised.
Evidence gaps
- The scheduled cargo-test receipt is absent, and the repository ripr sensor failed with exit code 2.
- Model proof intent was rejected by deterministic validation.
- The manual non-vacuity experiment and bounded Kani claims remain unreceipted in the supplied evidence.
- The packet contains a manual non-vacuity claim but no hosted Kani receipt or mutation artifact; the failed ripr sensor and absent cargo-test receipt do not prove either harness.
- No automated cargo-test or Kani receipt is available in the packet to confirm the harnesses compile and remain discriminating.
EffortlessSteven
left a comment
There was a problem hiding this comment.
REVIEW_READY — head 6935648
Delta since my last reviewed head 5258e5a: merge-of-main only; PR-owned files byte-identical, so the earlier review carries forward. Admission: the body says "Governing issue or accepted claim: new (formal verification of own code)", which has no #N. Link or file the Kani formal-verification claim issue before applying merge-ready. Hosted: no Ripr Rust Small Result on this exact head yet, so merge waits on it.
Generated by Claude Code
|
Governing claim and deferred claim boundaries for this PR are tracked in #12109. Deferred items are listed there so they are not dropped; merge-ready was applied with the admission already passed on this head. Generated by Claude Code |
There was a problem hiding this comment.
Decision
- Needs verification checks before upstream.
Verification questions
- Confirm the digit harness name claims nonempty coverage, but its fixed four-byte buffer can never represent the empty string; the proven postcondition is only accepted implies all ASCII digits.
- Confirm the digit harness name mentions nonempty input, but its fixed four-byte buffer cannot represent the empty string; the assertion still proves only accepted implies all ASCII digits.
- Confirm the digit harness name claims nonemptiness, but its fixed four-byte buffer cannot represent an empty input.
- Confirm the stated range property is correctly bounded to positive spans at line zero, and the changelog explicitly avoids claiming that the five-byte bound exercises usize overflow.
- Confirm rename hunk_number_accepts_only_nonempty_ascii_digits to hunk_number_accepts_only_ascii_digits, or add a separately bounded empty-input case; the current proof cannot reach the empty string.
Refuted
- The digit harness name claims nonempty coverage, but its fixed [u8; 4] input never represents the empty string, so the proof establishes only accepted implies all ASCII digits.
Parked follow-ups
- The proof scope is deliberately narrow: four- and five-byte inputs, explicit overflow disclaimer, and no coverage of other range parsers or counter arithmetic.
Evidence gaps
- The bounded properties have no executable Kani or mutation receipt in the supplied packet; the PR body's manual mutation is explicitly described as unreceipted.
- Model proof intent was rejected by deterministic validation.
- No hosted Kani receipt or deterministic mutation witness is supplied, so the manual non-vacuity experiment remains unverified.
- The supplied evidence contains no completed Kani or mutation-witness artifact for either harness, so execution and non-vacuity remain manual claims rather than independently reviewable receipts.
…count claim (#11621) (#13338) The slim section of docs/interop/mcp.md now states ten outputSchema documents (#11911 added the tenth tool after #11943 wrote nine) and carries the measured wire sizes (45,424 B full / 16,710 B slim over stdio); a new guard test reads the sentence back against the live payload (RED at base: docs said nine, tools/list advertises 10). The recorded $defs/$ref factoring rejection in mcp/protocol.rs is refreshed with today's arithmetic: cross-document duplication is ~870 B x 10 tools (~8.7 KB), still semantically blocked for standalone validators; per-document factoring measures a net loss (28,554 -> 28,633 B), largest repeated object 61 B x 2. The Full defaults stay; the flip question is re-surfaced for the owner in the PR body with numbers.
Requested by Steven · project thread
Governing issue or accepted claim: #12109 (Kani bounded model checking of ripr decision logic)
Acceptance delta (one sentence): Two
#[cfg(kani)]harnesses prove, within a 5-byte input bound, that the production unified-diff hunk parsers never yield a positive span starting at line 0 and accept hunk numbers only from ASCII digits.Harnesses live in
crates/ripr/src/analysis/diff/parse/hunk_kani.rs(declared#[cfg(kani)] mod hunk_kani;inparse.rs); normal builds are unaffected. They call productionparse_hunk_numberandparse_range.hunk_number_accepts_only_nonempty_ascii_digitsparse_hunk_numberreturns Some only for all-digit input; no panichunk_range_rejects_positive_span_at_line_zeroparse_rangeSome((s,c)) impliesc == 0 || s >= 1Not claimed:
usizeoverflow ofstart + count. At a 5-byte bound the largest reachable sum is 100000, so the overflow guard inparse_rangeis unreachable and an overflow assertion could not fail. An earlier revision named the range harness..._never_overflowsand asserted this; it was removed after review.Non-vacuity: temporarily removing the
count > 0 && start == 0guard inparse_rangemade the range harness FAIL (assertion failed: count == 0 || start >= 1); reverted. This was a manual experiment during development; the repository has no hosted Kani receipt until the Kani lane (#11787) lands.Not tractable (removed): full
parse_hunk_header(CBMC timeout > 580s onsplit_whitespace) andparse_rangeatusizeextremes (timeout > 500s inmemchr). Not covered:consume_hunk_linecounter arithmetic, range overlap, git.rs helpers.Local checks:
cargo fmt --check.cargo xtask precommitnot run (host disk space).Generated by Claude Code
https://claude.ai/code/session_01SvmPmqCNvFAErf575FjLhG
Generated by Claude Code