Repository navigation
fix(lsp): preserve diagnostic budget evidence - #1858
Conversation
|
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 reached
Next review available in: 5 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
WalkthroughThe LSP diagnostic budget bridge now derives deterministic identities and producer-defined actionability. Workspace status exposes serialized budget details with explicit availability state, while tests, specification text, and traceability metadata cover the updated contract. ChangesDiagnostic budget projection
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant LSPWorkspaceStatus
participant DiagnosticBudgetBridge
participant BudgetSerializer
LSPWorkspaceStatus->>DiagnosticBudgetBridge: Evaluate diagnostics with complete-evidence and profile identities
DiagnosticBudgetBridge->>DiagnosticBudgetBridge: Derive canonical IDs, payload bytes, and eligibility
DiagnosticBudgetBridge-->>LSPWorkspaceStatus: DiagnosticBudgetResult
LSPWorkspaceStatus->>BudgetSerializer: Serialize result and reason variants
BudgetSerializer-->>LSPWorkspaceStatus: diagnostic_budget payload
LSPWorkspaceStatus-->>LSPWorkspaceStatus: Emit diagnostic_budget_state
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0e807cb7c1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.ripr/traceability.toml (1)
6840-6853: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick winRegister all new material contract tests.
The traceability entry omits coverage for seam/preview eligibility, serialized reason variants, and complete-evidence identity changes:
"crates/ripr/src/lsp/diagnostic_budget.rs::tests::diagnostic_bridge_preserves_identity_and_actionability", + "crates/ripr/src/lsp/diagnostic_budget.rs::tests::diagnostic_bridge_uses_explicit_seam_and_preview_eligibility", + "crates/ripr/src/lsp/backend.rs::diagnostic_budget_projection_tests::workspace_status_budget_json_preserves_all_reason_variants", "crates/ripr/src/lsp/tests.rs::execute_command_collect_workspace_status_no_snapshot_returns_no_snapshot_status", "crates/ripr/src/lsp/tests.rs::execute_command_collect_workspace_status_with_snapshot_returns_diagnostics_counts", + "crates/ripr/src/lsp/tests.rs::workspace_status_budget_identity_changes_with_diagnostic_snapshot",As per coding guidelines, every material behavior change must preserve
spec -> test or fixture -> code -> output contract -> metric.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.ripr/traceability.toml around lines 6840 - 6853, Update the traceability entry containing the diagnostic budget and workspace status tests to register the missing material contract tests covering seam/preview eligibility, serialized reason variants, and complete-evidence identity changes. Add each relevant test symbol to tests and include any corresponding fixture or code symbols needed to preserve the spec-to-test-to-code-to-output-to-metric chain.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/ripr/src/lsp/backend.rs`:
- Around line 2199-2212: Update the error-result branches in the surrounding LSP
request handling to emit stable machine-readable reason codes: use
serialization_failure for serialization errors and evaluation_failure for
evaluation errors instead of error.to_string(). Preserve the unavailable status
and, if diagnostic context is needed, expose the original error separately as an
optional detail field.
In `@crates/ripr/src/lsp/diagnostic_budget.rs`:
- Around line 311-314: Update the diagnostic identity generation around
diagnostic_canonical_id so fallback identities do not depend on the
discovery-order index. Derive them from stable diagnostic content, or sort
stable fallback keys before assigning duplicate ordinals, while preserving
deterministic IDs for reordered legacy diagnostics and aligning duplicates by
identity.
- Around line 367-392: Update diagnostic_is_actionable so the gap-specific
predicate runs only when the diagnostic data identifies the gap decision ledger
producer, such as through source == "gap_decision_ledger", rather than merely
when canonical_gap_id exists. Allow finding diagnostics with canonical_gap_id
but without that producer identity to continue to the existing
preview_actionability.repair_packet_ready evaluation, preserving the shared
validator as authoritative.
---
Outside diff comments:
In @.ripr/traceability.toml:
- Around line 6840-6853: Update the traceability entry containing the diagnostic
budget and workspace status tests to register the missing material contract
tests covering seam/preview eligibility, serialized reason variants, and
complete-evidence identity changes. Add each relevant test symbol to tests and
include any corresponding fixture or code symbols needed to preserve the
spec-to-test-to-code-to-output-to-metric chain.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: e3c7d136-5fef-4c23-9925-0eac1f037049
📒 Files selected for processing (5)
.ripr/traceability.tomlcrates/ripr/src/lsp/backend.rscrates/ripr/src/lsp/diagnostic_budget.rscrates/ripr/src/lsp/tests.rsdocs/specs/RIPR-SPEC-0126-lsp-diagnostic-delivery-budget.md
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
EffortlessMetrics/ripr(auto-detected)EffortlessMetrics/unsafe-review(auto-detected)EffortlessMetrics/perl-lsp(auto-detected)EffortlessMetrics/ub-review(auto-detected)
|
Independent coverage pass before the latest remote advancement measured the LSP slice with cargo-llvm-cov. The remaining uncovered areas were the budget bridge's no-producer fallback identity and the workspace-status unavailable projection branches (serialization/evaluation failures), plus the root-lock fallback response. Equivalent focused tests should be added on the current remote head before merge; re-run Codecov after the latest remote commits. I did not force-push when this branch advanced. |
Convergence disposition — diagnostic-budget status/evidence winnerThis PR is the current owner for repairing the workspace-status evidence bridge. It is not the bounded-delivery PR. Before merge, close the remaining producer-eligibility finding:
Required current-head proof should include the focused budget bridge, workspace-status output contract, deterministic reorder/duplicate cases, full LSP library tests, and the required routed result. After merge, update #1764/#1582/#1694 as partial. Remaining work is bounded push publication, pull parity/result IDs, continuation retrieval, and client overflow/retrieval presentation. #1862/#1863 own the convergence and issue-state reconciliation. |
…ct-1837-current # Conflicts: # crates/ripr/src/lsp/tests.rs
What this does
Preserves diagnostic-budget evidence when projecting workspace status through the agent-facing LSP interface.
o_snapshot, serialization_failure, evaluation_failure) with optional detail;
This is a current-main replacement for #1855, with the Rust 1.95 Clippy fixture repair included and no force-push.
Verification
The full workspace/release gate is intentionally not claimed here.
Claim boundary
This lane makes workspace-status budget evidence producer-aware and snapshot-bound. It does not implement push suppression, pull parity, continuation paging, client UI, or gate-policy changes.