Repository navigation
test(lsp): Kani proofs for diagnostic budget limits and refresh generations - #11877
Conversation
…ations Factor the budget rule into BudgetCursor and the generation rules into bump_generation/generation_is_current (behavior unchanged) so they are formally checkable. 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 60ebcd3): REPAIR_REQUIRED
Inspected:
- The whole diff:
crates/ripr/src/lsp/diagnostic_budget.rs(+65/-6),crates/ripr/src/lsp/refresh_scheduler.rs(+21/-7), the two new proof filescrates/ripr/src/lsp/diagnostic_budget/kani_proofs.rs(171 lines) andcrates/ripr/src/lsp/refresh_scheduler/kani_proofs.rs(73 lines), and the newchangelog.d/fv-kani-lsp-budget-refresh.md. I fetched both blobs (head60ebcd35, base9bfac376) and diffed them myself; the PR's single commit is60ebcd35. - Head source read at:
BudgetDecisionandBudgetCursor::decide/commitindiagnostic_budget.rs, the rewrittenevaluate_diagnostic_budgetwalk,#[cfg(kani)] mod kani_proofs;atdiagnostic_budget.rs:783,bump_generationandgeneration_is_currentinrefresh_scheduler.rsand their call sites, and every harness in both proof files. - Repo gates read at this base:
.github/workflows/rust-gates.yml:246("Strict workspace Clippy":cargo clippy --workspace --all-targets -- -D warnings) and:219(cargo xtask ci-policy);.github/workflows/routed-rust.yml:469(cargo xtask precommit); the rootCargo.toml[workspace.lints.rust]block (L21-34);xtask/src/main.rs:641(check_no_panic_family()) and:730(check_changelog_fragments());xtask/src/policy/all.rs:7-13;xtask/src/no_panic.rs:21,:191-203(forbidden_panic_patterns),:330-353(collect_semantic_panic_findings),:614-639(evaluate_semantic_no_panic_policy);xtask/src/policy/changelog_fragments.rs:162-203,:249,:404-412,:417-439. policy/no-panic-allowlist.tomlat head60ebcd35(1285 lines) and the changelog fragment at head.- Sibling PRs: #11787 (
claude/fv-infrastructure, draft, headc509253e) and #11517 (codex/kani-source-context, draft), both open and both owning Kani-adjacent surface. - Hosted proof: REST
commits/60ebcd35/check-runs.
Blocking:
-
- This head cannot pass the repo's required Clippy gate.
crates/ripr/src/lsp/diagnostic_budget.rs:783and the matching declaration incrates/ripr/src/lsp/refresh_scheduler.rsare#[cfg(kani)], and the rootCargo.tomlat this PR's base9bfac376has nocheck-cfgand nounexpected_cfgssetting anywhere in its 219 lines; the workspace rust lint block (L21-34) lists onlyunsafe_code,const_item_interior_mutations,function_casts_as_integer,unused_must_useandunsafe_op_in_unsafe_fn.cfg(kani)is therefore an unrecognised cfg name, so rustc's warn-by-defaultunexpected_cfgslint fires on both attributes, and the required hosted gate at.github/workflows/rust-gates.yml:246runscargo clippy --workspace --all-targets -- -D warnings, which promotes that warning to an error. The owning fix isunexpected_cfgs = { level = "warn", check-cfg = ['cfg(kani)'] }, and that line exists only in the head of draft PR #11787 (c509253e); it is absent from #11787's own base8f0e1b08and from main's tip515e7dbc. The PR body acknowledges the warnings and defers them to "the sibling lane", which leaves this head red until #11787 lands and this branch rebases, and #11787 is not declared as a stack parent here.
- This head cannot pass the repo's required Clippy gate.
-
- The new changelog fragment names no issue or PR.
changelog.d/fv-kani-lsp-budget-refresh.mdhas one bullet under<!-- section: Added -->and contains no#N, no/issues/Nand no/pull/Ntoken at all.xtask/src/policy/changelog_fragments.rsrequires an issue or PR reference per entry - the violation text at L249 is "entry{}names no issue or PR; add(#N)or a link to it", andhas_issue_reference(L417-439) accepts only a#followed by digits as its own token or a/issues/Nor/pull/Nmarker. The identical rule text is present at this PR's base.cargo xtask precommitcallscheck_changelog_fragments()(xtask/src/main.rs:730) and CI runscargo xtask precommit(.github/workflows/routed-rust.yml:469), so this is an enforced gate. The filenamefv-kani-lsp-budget-refreshdoes satisfyis_kebab_slug(L404-412); only the missing reference is at fault. Sibling fragments in this campaign do carry the reference (for examplechangelog.d/10174-mock-count-paths.mduses(#10174)), so the convention is established.
- The new changelog fragment names no issue or PR.
-
- The new proof file contains an unallowlisted panic-family call.
crates/ripr/src/lsp/diagnostic_budget/kani_proofs.rs:66readsOmittedDiagnosticReason::ProfileFiltered => unreachable!(),.unreachable!is one of the forbidden panic-family patterns (xtask/src/no_panic.rs:191-203). The semantic scanner walks every.rsfile undercrates/ripr/src(no_panic.rs:21,collect_semantic_panic_findingsL330-353) and parses it withra_ap_syntaxto find realMacroCallnodes, with no cfg-based exclusion, so a#[cfg(kani)]module is scanned like any other file.evaluate_semantic_no_panic_policy(no_panic.rs:614-639) turns any finding with no matching allowlist entry into a violation ("contains unallowed panic-family 'unreachable'; add exact allowlist entry with explanation"), andpolicy/no-panic-allowlist.tomlat head60ebcd35contains no entry for this path (nokaniorlspmatch in 1285 lines).cargo xtask precommitcallscheck_no_panic_family()(xtask/src/main.rs:641) andcargo xtask ci-policyreaches it throughcheck_policy_all()(xtask/src/policy/all.rs:12-13); both run in hosted CI. Replacing the arm with an explicit handling of the unreachable variant, or adding a scoped allowlist entry with an explanation, keeps the proof honest either way.
- The new proof file contains an unallowlisted panic-family call.
Non-blocking:
- The production refactor is behaviour-preserving on every path I could trace, which is the main thing a test-only-proof PR can get wrong. In
evaluate_diagnostic_budgetthe base branchif selected_bytes.saturating_add(payload) > limit { insert overflow; if !selected.is_empty() { omit; continue } }maps exactly ontodecide'sbyte_overflow && self.selected_len != 0omission plus itsSelect { byte_overflow }arm, which still records theSerializedByteLimitoverflow reason;selected.is_empty()andcursor.selected_len == 0agree becausecommitincrements the counter exactly once per selected item;inline_detail_omittedis still computed only on the select branch; andselected_byteskeeps its saturating addition incommit.bump_generationissaturating_add(1)andgeneration_is_currentis!stopping && newest == generation, each identical to the inlined expression it replaces. - The proofs establish safety but not liveness, and that distinction should be stated rather than implied.
budget_item_limits_hold_over_walkasserts count identities (selected_len == per_doc[0] + per_doc[1],selected_len + omitted == STEPS) and per-limit bounds, all of which still hold for adecidethat omitted every item, so no harness requires an eligible item to be selected. Thekani::cover!lines are coverage markers, not assertions. The other harnesses are sound for what they claim:budget_inline_detail_flag_is_exactasserts the flag equalsdetail > max_inline_detail_bytesexactly, andstale_generation_never_current_after_bumpandonly_newest_generation_is_current_and_stop_blocks_allfail if the currency predicate is loosened. - Two limits are stated honestly rather than assumed away, which is the right shape:
budget_bytes_never_exceed_limit_or_wrapexcludesmax_serialized_bytes == usize::MAXwith an explicitkani::assumeand a comment explaining the saturating-clamp case, andgeneration_counter_saturates_at_maxpins theu64::MAXsaturation limit and the comment says the stale-result proofs therefore assumegeneration < u64::MAX. - Nothing on this head compiles or executes the proofs.
#[cfg(kani)]is off in a normal build and thekanilane that would run them belongs to the unlanded draft #11787, so a type error or typo inside eitherkani_proofs.rswould not be caught by this PR's own CI. The PR's central claim - formal verification of its own code - therefore has no executed evidence anywhere at this head. - The PR is a draft with no labels, so the routing workflow never admitted it: on
60ebcd35every Rust lane (ci-result,future-clippy,msrv,source-identity,rust-tests-junit,rust-coverage,Rust-only feature lane,windows-advisory,windows-advisory-subset,macos-advisory,vscode) isskippedand there is no "Rust gates" or test-shard check at all. - There is no duplication hazard between this PR and the open Kani siblings: #11787 owns the CI lane and the
check-cfgline, #11517 owns source-context inventory, and this PR owns the LSP budget and generation proofs. The deciding criterion for thecheck-cfgdependency is that #11787 is the survivor, so the cleanest repair is for this PR to land the one-linecheck-cfgitself or to declare and rebase onto #11787 rather than to compete with it.
Not run:
- No local build or test: the Rust toolchain on this host is not on
PATH, socargo fmt --check,cargo xtask precommit,cargo xtask ci-policy,cargo clippy --workspace --all-targets -- -D warningsandcargo kaniwere not executed. The PR body itself records that fullcargo xtask precommitand the lib test binary could not be run on its host, which is consistent with the three gate failures above not having been caught locally. - Hosted lanes observed on
60ebcd35(RESTcommits/60ebcd35/check-runs): "workflow policy and wheel applicability" SUCCESS, "build and inspect Linux x64 wheel" SUCCESS, "clean uv install and useful Python journey" SUCCESS, "clean pip install and useful Python journey" SUCCESS, "ub-review" SUCCESS, "GitGuardian Security Checks" SUCCESS; every Rust laneskipped. - Unobserved: all Rust proof for this head, and any execution of the two Kani harnesses. No
cargo kanilane exists in this repository at this commit.
Reviewed by an independent Mavis review agent on behalf of the maintainer; bound to head 60ebcd35d5be26e3b134665a4ab5ba44860cbde4. 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
The no-panic-family policy scans cfg(kani) modules too. kani::assert(false) keeps the same meaning: the proof fails if the arm is reachable. 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 7c1a7ce): REVIEW_INCOMPLETE
Inspected:
- PR #11877 at head 7c1a7ce (base 9bfac37). It is still a Draft with no labels, so every Rust lane reports skipped at this head and no hosted lane has ever run on it. Changed paths: Cargo.toml +2/-0, changelog.d/11877-fv-kani-lsp-budget-refresh.md +2/-0, crates/ripr/src/lsp/diagnostic_budget.rs +102/-37, crates/ripr/src/lsp/diagnostic_budget/kani_proofs.rs +174/-0, crates/ripr/src/lsp/refresh_scheduler.rs +21/-5, crates/ripr/src/lsp/refresh_scheduler/kani_proofs.rs +72/-0.
- The head moved under me while I was reviewing. The previously reviewed head was 022f886, and 7c1a7ce is "Replace unreachable! in the budget Kani harness with kani::assert", one commit, +5/-1 in crates/ripr/src/lsp/diagnostic_budget/kani_proofs.rs.
- crates/ripr/src/lsp/diagnostic_budget.rs at 7c1a7ce: BudgetCursor at :194, decide at :202, commit at :235, production use at :271, :286 and :311, #[cfg(kani)] mod kani_proofs at :783-784, #[cfg(test)] mod tests at :786-787. crates/ripr/src/lsp/refresh_scheduler.rs: bump_generation at :191, generation_is_current at :197, production call sites at :358, :463, :482 and :501, #[cfg(test)] next_generation_for_test at :604-611, #[cfg(kani)] mod kani_proofs at :614-615, #[cfg(test)] mod tests at :617-618. crates/ripr/src/lsp/diagnostic_budget/kani_proofs.rs:69 now reads kani::assert(false, "budget cursor never omits for profile filtering") inside the #[kani::proof] harness budget_item_limits_hold_over_walk at :40-83.
- xtask/src/no_panic.rs:191-203 forbidden_panic_patterns() and the semantic scanner's file collection, and policy/no-panic-allowlist.toml at this head.
- Root Cargo.toml at this head: [workspace.lints.rust] at :21 and unexpected_cfgs = { level = "warn", check-cfg = ['cfg(kani)'] } at :31, with the explanatory comment at :30. changelog.d/11877-fv-kani-lsp-budget-refresh.md carries the (#11877) reference.
Blocking:
- No candidate defect is blocking, and I withdraw the one I raised against the previous head. It is repaired, verified by reading the new commit rather than by inference: crates/ripr/src/lsp/diagnostic_budget/kani_proofs.rs:69 replaces the unallowlisted unreachable!() with kani::assert(false, "budget cursor never omits for profile filtering"), which is the idiomatic Kani form and sits inside the #[kani::proof] harness at :40-83 where kani::assert is legal. unreachable! is in xtask/src/no_panic.rs:191-203 forbidden_panic_patterns(), and policy/no-panic-allowlist.toml at this head has no entry for kani, diagnostic_budget or refresh_scheduler, so the previous red is gone rather than allowlisted around. I scanned all four changed Rust files for the six forbidden patterns (unwrap(, expect(, panic!, todo!, unimplemented!, unreachable!) and found none, so no new no-panic finding exists either.
- The disposition is nevertheless not REVIEW_READY, for a reason that is not a defect: the PR is still a Draft with no labels, so every Rust lane reports skipped and no hosted lane has ever run at this head. Per the shared brief a Draft PR can never be REVIEW_READY, and hosted proof is therefore not established, which is REVIEW_INCOMPLETE.
Non-blocking:
- Earlier blocking #1 REPAIRED: the Clippy unexpected_cfgs red is answered by Cargo.toml:31 adding check-cfg = ['cfg(kani)'], with the comment at :30 explaining that Kani sets the cfg and rustc does not. The key sits in [workspace.lints.rust], so it applies to every workspace member including xtask.
- Earlier blocking #2 REPAIRED: the fragment is now changelog.d/11877-fv-kani-lsp-budget-refresh.md and its body carries (#11877). The name satisfies the repository's kebab-slug convention and the issue-reference requirement.
- The proof harnesses are never compiled or executed by any hosted lane at this head. Both modules are gated behind #[cfg(kani)] (diagnostic_budget.rs:783-784, refresh_scheduler.rs:614-615) and no workflow under .github/workflows invokes cargo kani at 7c1a7ce, so nothing in CI type-checks or runs the 246 lines of harness code this PR adds. The sibling PR #11787 (Draft, head ae52017) is titled "feat(ci): Kani bounded-model-checking lane and smoke harness (RIPR-SPEC-0367)" and adds .github/workflows/kani.yml (+70) and xtask/src/kani_lane.rs (+532), so the lane that would exercise these proofs is owned there. Until it lands, the harnesses are unverified by CI. That is a property of the missing lane, not a defect in the harnesses.
- One direct discriminator is missing for the extracted predicate. generation_is_current (refresh_scheduler.rs:197) is called only from production code at :501 and no ordinary test calls it, so its only direct checks are the Kani harnesses stale_generation_never_current_after_bump and only_newest_generation_is_current_and_stop_blocks_all. The budget side is better covered: seventeen ordinary tests in diagnostic_budget.rs's #[cfg(test)] mod tests call evaluate_diagnostic_budget (:1183, :1194, :1228, :1268, :1295, :1415), including document_and_byte_limits_record_each_omission, first_item_over_byte_budget_stays_selected_and_marks_overflow and profile_filtered_items_never_consume_the_budget, so the BudgetCursor extraction is exercised by CI-compiled tests even though its own call sites are production-only. bump_generation does have a test-only entry point at refresh_scheduler.rs:604-611.
- Duplicate ownership to settle before this can land cleanly: #11787 also adds the same key to the same table. Its Cargo.toml patch inserts unexpected_cfgs = { level = "warn", check-cfg = ['cfg(kani)'] } immediately after unsafe_code = "forbid" in [workspace.lints.rust], while this PR inserts it at Cargo.toml:30-31 after unsafe_op_in_unsafe_fn. Two open PRs writing the same key into the same TOML table will conflict on merge, and a resolution that keeps both copies is a TOML duplicate-key parse error that breaks every cargo invocation in the workspace. Deciding criterion: exactly one PR may own the workspace-wide lint key, whichever lands first keeps it and the other rebases and drops its copy. I name #11787 as the natural owner only because it carries the lane that makes cfg(kani) meaningful end to end, not because its scope is wider.
- Efficiency: neutral. The refactor moves the budget rule into a small pure helper that production calls once per eligible item (diagnostic_budget.rs:286 decide, :311 commit) and the generation rule into two pure functions; it introduces no new I/O, no process spawn, no cache and no retained collection, and it does not change how many times the existing budget walk runs. The harness code is compile-time-only work under cfg(kani). The one thing worth watching is that decide now returns a decision object per item instead of deciding inline, which is one small enum construction per eligible diagnostic: a constant-factor allocation on a path sized by the number of diagnostics in a response, not a growth-rate change. I did not profile it and therefore state the cost as unestablished rather than quantified.
Not run:
- The Rust toolchain on this host is not on
PATH: rustc, cargo and rustup are absent from PATH, so cargo xtask precommit, cargo test, cargo fmt --check, clippy and cargo xtask check-no-panic-family could not be run, and the shared checkout was not built while other agents hold it. Every Rust-level statement above comes from reading source at SHA 7c1a7ce and from the repository's policy files. - cargo kani was not run, for the same reason, so the harnesses are unexecuted here and their proof status is unestablished. I verified only that they are consistent with the surrounding code and that no lane compiles them.
- No hosted lane ran on this head: because the PR is a Draft with no labels, every run at 7c1a7ce reports skipped (CI, Coverage, macOS Advisory, Windows Advisory, Future Clippy, Test Analytics, Security) and the only non-skipped runs are ub-review and Qualify ripr-rs Python Wheel, which say nothing about the Rust lanes. The repository's own CI therefore contributes no evidence either way for this candidate.
Reviewed by an independent Mavis review agent on behalf of the maintainer; bound to head 7c1a7ce6dbb02c5c5abf36bd0c2c1d641a353998. Not an approval.
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.
Verification questions
- Confirm the byte proof's exact-sum assertion is weaker than its comment claims because selected_bytes is saturated while exact is a u128 total.
- Confirm the refresh helper extraction is routed through every changed scheduler transition, but the requested and invalidation methods still increment the counter only after their existing early-return paths, so proof coverage of all transition sequences is not established.
- Confirm the budget proof assumes max_serialized_bytes < usize::MAX, while production validation accepts usize::MAX; the stated invariant that byte totals never exceed the limit therefore does not cover every accepted budget.
- Confirm the byte-budget harness does not assert the stated byte-limit invariant for a lone first selected item; it only checks that selected item's payload exceeds the limit after selection.
- Confirm the Kani harness models budget decisions with symbolic payload lengths but does not exercise an actual backing-store resize or stale-length snapshot.
- Confirm the budget helper is a scalar-only boundary consumed by the production walk, but its harness does not prove end-to-end equivalence with the previous walk over collections and item metadata.
- Confirm the proof files cover the extracted scalar helpers but do not establish parity across other diagnostic-budget or generation-like routes elsewhere in the repository.
Evidence gaps
- The PR's formal-verification claim is not backed by a completed lane receipt in the supplied evidence.
- Normal-build and test behavior lacks a completed receipt: ripr failed with exit code 2, and cargo-test was scheduled late without a supplied receipt.
- Independent execution evidence is incomplete in this packet because ripr failed and cargo-test receipt is absent.
- Model proof intent was rejected by deterministic validation.
- The review lacks completed cargo-test evidence and the ripr sensor failed with exit code 2, limiting verification of behavior and resource impact beyond the bounded harnesses.
There was a problem hiding this comment.
Independent review (fresh-context reviewer, head fea3d28): REVIEW_INCOMPLETE
Inspected:
- Rebind bundle
.tmp-review-rebind/pr-11877.md; headfea3d2890637dfcb807c5ef87efa22eff8a955d7, base9bfac376cb7d0e1f036bd05f0451848945d1d019, draft, mergeable MERGEABLE, mergeStateStatus BLOCKED, no labels, rollup SUCCESS. Delta since the previously reviewed head7c1a7ce6dis one path:Cargo.toml, +2/-2. - That delta re-positions the
unexpected_cfgsdeclaration inside[workspace.lints.rust]— it removes the copy that sat afterunsafe_op_in_unsafe_fn(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/lsp/diagnostic_budget.rs(BudgetCursor::decide/commit, and the#[cfg(kani)] mod kani_proofs;declaration),crates/ripr/src/lsp/diagnostic_budget/kani_proofs.rs(harnesses at:42,:90,:135,:157),crates/ripr/src/lsp/refresh_scheduler.rs(bump_generation,generation_is_current, and its#[cfg(kani)] mod kani_proofs;declaration), andcrates/ripr/src/lsp/refresh_scheduler/kani_proofs.rs. The production code they target isevaluate_diagnostic_budgetand the scheduler's generation transitions. - Merge basis: GitHub test-merge tree
e66a9005e657b02c89b59b5c9c41a9e8c43acaccagainst 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 atfea3d2890(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:
- Earlier blocking finding 1 (the
#[cfg(kani)]declarations atdiagnostic_budget.rs:783andrefresh_scheduler.rs:614would tripunexpected_cfgsunder the requiredcargo clippy --workspace --all-targets -- -D warningsgate) — REPAIRED, and still repaired at this head:Cargo.toml:23declarescfg(kani), and I confirmed in the merge result that exactly one such declaration exists. - Earlier blocking finding 2 (the changelog fragment named no issue or PR) — REPAIRED, and still repaired: the fragment remains
changelog.d/11877-fv-kani-lsp-budget-refresh.mdand its body carries(#11877), which satisfieshas_issue_referenceinxtask/src/policy/changelog_fragments.rs. - Earlier blocking finding 3 (the unallowlisted
unreachable!()atdiagnostic_budget/kani_proofs.rs:66) — REPAIRED, and still repaired: the current head useskani::assert(false, ...)inside the harness, and I scanned the changed Rust files for the forbidden panic-family patterns and found nounwrap(,expect(,panic!,todo!,unimplemented!orunreachable!. - Earlier finding about duplicate ownership of the workspace lint key — STILL HOLDS as a coordination point, but the severity has dropped because this delta removes the mechanism that made it dangerous. The predecessor warned that
#11787and this PR inserted the same key into the same TOML table at different positions, so a merge resolution keeping both copies would be a duplicate-key parse error. Both now write the byte-identical blob874fef728, so no such resolution is possible; whichever lands second rebases and drops the hunk. Survivor recommendation for the key:#11624— among the twomerge-readymembers it is the one whose body is already consistent with the declaration being present, whereas#11787is a draft whose body says the check-cfg is "intentionally left to another change".#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). This supersedes the predecessor's naming of#11787as the key owner: that choice was made while the copies still differed, and lane ownership no longer discriminates the key now that all nine are byte-identical. - New: the body is stale against its own head. It ends "Not run: ...
unexpected cfg kaniwarnings are expected until check-cfg lands from the sibling lane." The check-cfg declaration is this head'sCargo.toml:23; there is no sibling lane left to wait for on that point, andcargo check -p riprwill not emit that warning at this head. - Earlier finding that the proof harnesses are never compiled or executed by any hosted lane — STILL HOLDS. Both modules are gated behind
#[cfg(kani)]and no workflow under.github/workflowsinvokescargo kaniat this head; the sibling#11787(draft) is where that lane lives. So the 246 lines of harness code this PR adds have no CI type-check or execution evidence. - Earlier finding that
generation_is_currenthas no ordinary test discriminator — STILL HOLDS. It is called only from production code, so its only direct checks are the Kani harnessesstale_generation_never_current_after_bumpandonly_newest_generation_is_current_and_stop_blocks_all. The budget side is better covered: the#[cfg(test)] mod testsindiagnostic_budget.rsexercisesevaluate_diagnostic_budgetwith seventeen ordinary tests, so theBudgetCursorextraction is covered by CI-compiled tests even though its own call sites are production-only. - Earlier finding that the proofs establish safety but not liveness — STILL HOLDS and should stay stated.
budget_item_limits_hold_over_walkasserts count identities and per-limit bounds that would still hold for adecidethat omitted every item; thekani::cover!lines are coverage markers, not assertions. - The two limits the body states are stated honestly, which is the right shape:
budget_bytes_never_exceed_limit_or_wrapexcludesmax_serialized_bytes == usize::MAXwith an explicitkani::assumeand a comment explaining the saturating-clamp case, andgeneration_counter_saturates_at_maxpins theu64::MAXsaturation limit. Both are disclosed limits, not silent gaps. - 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. - 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: still neutral, and the delta does not change that. The delta adds a lint declaration and reorders two lines in a TOML table; it changes no shipped code path, adds no I/O, no process spawn, no cache and no retained collection, and it does not change how many times the existing budget walk runs. The one cost the predecessor flagged still stands as unquantified:
decidenow returns a decision object per eligible item instead of deciding inline, which is one small enum construction per eligible diagnostic — a constant-factor allocation on a path sized by the number of diagnostics in a response, not a growth-rate change. I did not profile it, so I state the cost as unestablished rather than quantified. The harness code is compile-time-only work undercfg(kani).
Not run:
- The Rust toolchain on this host is not on
PATH, so nocargo xtask precommit,cargo test,cargo fmt --check,cargo xtask check-no-panic-family, 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
fea3d2890. - The CBMC runtimes and injected-bug failures 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 fea3d2890637dfcb807c5ef87efa22eff8a955d7. Not an approval.
…refresh # 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.
REPAIR_REQUIRED
Head reviewed: 73c902b. Static review against RIPR-SPEC-0371; I did not run cargo xtask kani or inspect hosted checks.
Production refactor: behavior-preserving (checked line by line). BudgetCursor::decide/commit reproduce the old order (document limit, workspace limit, byte limit with the lone-first-item exception, then inline detail), the same saturating_adds, and selected.len() becomes cursor.selected_len which is incremented on exactly the select path. bump_generation / generation_is_current are the old expressions extracted. Existing unit tests still cover the walk.
Finding 1 (must fix): the changelog states properties the proofs exclude. The entry says serialized-byte limits "never wrap" and "a result stamped with an older generation is never current". The harnesses prove less, and the author knows it:
budget_bytes_never_exceed_limit_or_wrapassumesmax_serialized_bytes < usize::MAX; the comment records that the proof itself found the saturating sum can clamp to the limit at exactlyusize::MAX.stale_generation_never_current_after_bumpassumesstamped < u64::MAX - 3and 1–3 intervening bumps;generation_counter_saturates_at_maxdocuments that atu64::MAXa captured generation still looks current.- The walk proofs cover 4 items over 2 documents with item limits in
1..=3.
Under RIPR-SPEC-0371 ("states exactly what a proof covers") the changelog should carry those bounds and the saturation caveat, as the sibling Kani PRs' entries do ("within stated bounds"). One-sentence fix; no code change needed.
Non-blocking. generation_counter_saturates_at_max has no cover! (constant check). In budget_item_limits_hold_over_walk, the WorkspaceItemLimit arm asserts the reached limit but not the matching overflow value, and the SerializedByteLimit arm asserts nothing (it is covered in the bytes harness instead); acceptable, though a symmetric overflow == assertion is cheap.
Fine. The ProfileFiltered arm uses kani::assert(false, ..) so reaching it fails the proof; budget validation accepted-set assertions are correct; covers are non-trivial.
Leftover spec refs. None (0370 absent).
Generated by Claude Code
…get/refresh changelog (#11877) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SvmPmqCNvFAErf575FjLhG
EffortlessSteven
left a comment
There was a problem hiding this comment.
REVIEW_READY
Head reviewed: f882eca (delta from 73c902b is the changelog fragment only; production refactor and harnesses unchanged, so the earlier behavior-preservation check stands). Static review only; I did not run cargo xtask kani or inspect hosted checks.
The earlier finding is resolved. The changelog now states the walk bound (4 items, 2 documents, item limits 1 to 3), the byte-limit caveat (holds for limits below usize::MAX; the saturating sum can clamp at exactly usize::MAX), and the generation bounds (1 to 3 bumps, generations below u64::MAX - 3; saturation at u64::MAX leaves a captured generation looking current). Each matches the corresponding assume in the harnesses. Non-blocking nits from the previous review (no cover! on generation_counter_saturates_at_max; asymmetric overflow assertions in the walk harness) are unchanged. No 0370 reference present.
Generated by Claude Code
EffortlessSteven
left a comment
There was a problem hiding this comment.
REVIEW_READY — head 2c290d4
Delta since f882eca: merge-of-main only; PR-owned files byte-identical. Deferred claim boundaries: the author replied in the Devin threads that the narrowing/cover fixes go in "the follow-up PR" and resolved them. The replies are accurate, but no tracking issue exists (I searched open issues), so the deferral lives only in resolved threads. Condition, not a code blocker: file one issue listing the deferred items and link it from this PR before merge, so they cannot be dropped silently. (Items here: the item-limit walk commits zero bytes so the combined item+byte case is not verified; changelog states the limit.) 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.
Parked follow-ups
- The proof architecture is intentionally helper-level, so it does not establish equivalence of the surrounding String/BTreeMap/BTreeSet walk or mutex-guarded scheduler.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
- The packet contains no completed ordinary test receipt for the changed Rust behavior.
- Host-side verification is incomplete: ripr failed with exit code 2 and the scheduled cargo-test receipt is absent.
Requested by Steven · project thread
Governing issue or accepted claim: #12109 (Kani bounded model checking of ripr decision logic)
Acceptance delta (one sentence): LSP diagnostic-budget limits and refresh-generation currency are now checked by Kani bounded model checking (
cfg(kani)only; normal builds unaffected).Production refactor (behavior unchanged): budget rule extracted into scalar-only
BudgetCursor::decide/commit(called byevaluate_diagnostic_budget); generation rules extracted intobump_generation/generation_is_current(called by every scheduler transition).evaluate_diagnostic_budgetitself (Strings, BTreeMap/BTreeSet, sort) is not Kani-tractable, and the mutex-guardedRefreshSchedulerstate is not tractable either; the pure cores are proven instead.Run:
cargo kani -p ripr --default-unwind 6 --harness <name>.Non-vacuity: every harness has satisfied
kani::cover!s. Injected bugs (reverted): changingdocument_count >=to>madebudget_item_limits_hold_over_walkFAIL; changingnewest == generationto>=madestale_generation_never_current_after_bumpandonly_newest_generation_is_current_and_stop_blocks_allFAIL.Findings: (1) a
max_serialized_bytesof exactlyusize::MAXlets the saturating sum clamp so the true sum can exceed the limit (unreachable 18 EB budget; excluded by assumption, documented). (2) Atu64::MAXthe generation counter saturates, so a stale generation would look current (needs 2^64 requests; documented by a harness). Neither warrants an issue.Not run: full
cargo xtask precommitand the lib test binary (build OOM/disk-killed on this host);cargo check -p riprandcargo fmt --checkpass.unexpected cfg kaniwarnings are expected until check-cfg lands from the sibling lane.Generated by Claude Code