Repository navigation
fix(lsp): compose diagnostic budget bounds without saturation holes - #14521
Conversation
|
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 16 minutes. View limit details
|
There was a problem hiding this comment.
Code Review
This pull request updates the diagnostic delivery budgeting logic to prevent machine-sum overflow by replacing saturating addition with checked addition when evaluating serialized byte limits. This ensures that overflows are correctly refused even when the budget limit is set to usize::MAX. Additionally, the PR introduces a comprehensive suite of unit tests in budget_composition_tests.rs, updates the Kani verification proofs in kani_proofs.rs to cover the maximum byte limit boundary, and updates the corresponding specification documentation. There are no review comments to address, and I have no additional feedback to provide.
|
Exact-source continuation: remote head Pinned-native-tool discovery is now exhausted on available executors: cloud Kani0.68 driver is available but its matching nightly Rust driver library is absent. Native Windows has other Rust toolchains but neither Kani nor nightly2026-08-21; WSL inspection was denied and not bypassed. No new nightly installation occurred. The existing Kani workflow has no harness-selection input and a 90-minute whole-job allowance; this pass did not use it to evade the assigned bounded local proof limits. Current state remains Draft / REVIEW_INCOMPLETE. Next native transition needs an already-admitted matching Kani executor or specific authority for the pinned task-local nightly setup, followed by actual production-library integration and current hosted qualification. Current source/extracted-core evidence remains valid at the exact tree; no native or aggregate pass is claimed. |
…-composed-assurance
|
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
Head: 627121e
Independent exact-head review after merging current main. Net change is six files, +318/-32, all in the diagnostic-budget boundary.
Inspected: BudgetCursor::decide now uses checked_add with is_none_or, with reason precedence and the lone-first-item rule unchanged; commit still saturates safely; the Kani walk harness uses independent u128 expectations; budget_composition_tests.rs cases traced by hand (usize::MAX first item, document and byte pressure, oversized first item, 73,728-case walk). Reverting to saturating_add changes the first composition case and the walk result. SPEC-0126 text matches the code.
Local proof: cargo fmt. Native Kani is not run here. Hosted qualification is requested by the label.
Generated by Claude Code
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YVdGzVD7jnRWsX2VUqRAeJ
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY
Head: 673d294
Independent exact-head review after merging current main. Net change is six files, +318/-32, all in the diagnostic-budget boundary.
Inspected: BudgetCursor::decide now uses checked_add with is_none_or, with reason precedence and the lone-first-item rule unchanged; commit still saturates safely; the Kani walk harness uses independent u128 expectations; budget_composition_tests.rs cases traced by hand (usize::MAX first item, document and byte pressure, oversized first item, 73,728-case walk). Reverting to saturating_add changes the first composition case and the walk result. SPEC-0126 text matches the code.
Follow-up commit 673d294 turns the duplicate traceability entry in .ripr/traceability.d/12109-composed-diagnostic-budget.toml into an [[extend]] of the existing behavior id (the hosted traceability check reported the duplicate id on the old head).
Local proof: cargo fmt; cargo xtask check-traceability passes on this head (rc 0). Native Kani is not run here. Hosted qualification is requested by the label.
Generated by Claude Code
Summary
Compose diagnostic count, byte and inline-detail constraints in the same bounded walk, and close the admitted arithmetic-boundary hole where saturating addition hid a sum above
usize::MAX.Swarm / Source Boundary
ripr-swarmSource-of-truth Links
Proposal: #12109's budget/identity/lifecycle composition obligation and #11877's explicitly deferred combined count-plus-byte claim.
Spec: RIPR-SPEC-0126; native-result interpretation remains governed by RIPR-SPEC-0371.
ADR: none; reuse the existing scalar production budget owner.
Plan item: #12109 execution plan, priority obligation 6.
Governing issue or accepted claim: #12109, bounded diagnostic-budget composition only.
Acceptance delta (one sentence): Actual selected payloads drive combined count/byte/detail checks, including maximum admitted byte limits, with independent widened-arithmetic expectations and ordinary evaluator parity.
Candidate Relationships
Candidate branch (GitHub PR head is authoritative after publication): fix/diagnostic-budget-composed-assurance.
Stack parent or prerequisite PR (if any): none; base 55e5868.
Proposed replacement of PR (if any; not yet accepted): none.
Acceptance retained from a replaced candidate (if any): none; preserve #11877's existing scalar harness names and other claims.
Accepted winner and losing candidate disposition (when decided): single bounded candidate; no predecessor is superseded.
Scope
Production:
BudgetCursor::decideuses checked addition. Mathematical overflow exceeds every admitted byte limit. Count-reason precedence, exact fits, inline-detail flags and the lone oversized first-item exception are unchanged.Evidence: the existing four-step/two-document Kani walk commits real payload bytes and checks exact selection, typed omission priority, counts, total bytes and detail flags. New covers require combined document/byte and workspace/byte pressure and a maximum-limit byte refusal. The byte-only harness no longer excludes
usize::MAX. Four ordinary tests exercise 73,728 representative scalar walks and actual evaluator outputs. Spec, traceability and changelog retain the finite scope.Scope Classification
Single acceptance criterion: Diagnostic delivery budget arithmetic and count/byte composition agree with the independent widened arithmetic contract, without relaxing admitted boundaries or refusing legitimate exact fits.
Non-goals: no queue/CI redesign, workflow/check/protection changes, Kani runner/result-registry changes, physical policy package split, releases, host-limit changes, source inference or user-facing formal-assurance claim.
Support-tier Impact
Policy Impact
Existing spec and additive traceability only. No new process/network/lint/architecture allowance.
Proof actually observed
Base 55e5868: a standalone Rust test compiled the actual contiguous production evaluator/core, removing only unused external imports. A maximum admitted budget followed by payloads
usize::MAXand1fails the expected byte-refusal assertion: baseline incorrectly selects the latter. This is arithmetic-domain hardening, not a claim that a real editor allocates exabytes.Candidate local execution subject
aaeacb7786673a72d7dc63d5c43c6e8f9bee4514, exact full treeb403a9352632499eca1fd4cbac3da7320689ce95; connector-published headff53fa51359f5d861656d2a454d8fa43d86ce4b7has that identical tree. Six remote blobs and full tree were verified against the local committed Git objects.rustc --edition=2024 -D warnings --test: 4/4 tests pass; 73,728 finite four-step walks execute.git diff --checkpasses.These executions compile the actual extracted contiguous production core and real ordinary test module, not a hand-written decision surrogate. They do not compile the complete library, Kani harness module, LSP transport or workspace. Repository pins remain unchanged at Rust 1.95.0.
Missing evidence and continuation
Draft / REVIEW_INCOMPLETE. Native Kani compilation/execution and complete cover results are not established. The official pinned Kani 0.68 driver runs in the local task, but its compiler cannot load the required nightly-2026-08-21 Rust driver library. No new nightly installation, full Kani dispatch or required CI request was made in this pass.
Full-library integration, repository policy/traceability execution, check-fast, Clippy and required hosted qualification are not run. Source inspection and extracted-core tests do not promote those dimensions. The owning session retains this candidate and will reuse an already-admitted Kani executor or obtain the appropriate setup authority, verify the native harnesses and full integration, inspect current findings, then request the installed protected qualification route. No merge-ready, auto-merge or protection change is requested by this Draft.
Claim Boundary
May claim: actual production-core arithmetic controls and finite ordinary walks passed; compiled wrong implementations were rejected; combined Kani properties are authored and reviewed.
Must not claim: current native formal proof, full-library/whole-suite pass, transport correctness, formal verification of sorting/maps/serialization/allocator behavior, or completion of #12109/#12904.
Rollback
Revert this coherent six-file candidate. Preserve native runner, proof inventory and other lifecycle owners.
Changelog
changelog.d/12109-composed-diagnostic-budget.md: canonical Fixed marker, bullet and #12109 reference. Describes harness/test additions without promoting native proof.CI Economics
No workflow or required-lane change. Four ordinary tests add about 0.03 seconds in the extracted-core run. Two existing Kani harnesses become stronger without adding harness count; solver-cost change remains unmeasured until native execution. Do not infer a CI speedup from these results.
Source review: REVIEW_READY 673d294
Generated by Claude Code