Repository navigation
fix(lsp): refresh diagnostics when the gap ledger or checked-out branch changes (#4896) - #4904
Conversation
…ch changes (#4896) Watch the root gap decision ledger and root .git/HEAD (root-anchored RelativePattern when the client supports it) and schedule one watched_input refresh that bypasses input-identity dedup, without reloading config or invalidating the workspace graph. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014WDSj54AyARNwy6oUuYXnx
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (7)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. Summary by CodeRabbit
Walkthrough
ChangesRoot-Scoped Diagnostic Refresh
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Bug fix · Severity of issue fixed: Medium Sequence Diagram(s)sequenceDiagram
participant LSPClient
participant Backend
participant RefreshScheduler
Backend->>LSPClient: Register root diagnostic file watchers
LSPClient->>Backend: Send watched-file event
Backend->>RefreshScheduler: Schedule WatchedInput refresh
RefreshScheduler->>RefreshScheduler: Resolve Git inputs freshly and bypass deduplication
Merge Risk: ⚪ Minimal · up to The root-scoped watchers and fresh diagnostics flow are mergeable after normal checks. Registration failures retain manual refresh, and mixed file-change batches still refresh against current repository inputs. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to Root-scoped refreshes preserve existing access boundaries and stale-result guards. No new privilege or cross-workspace access was identified. Remaining uncertainty concerns missed automatic updates and resource use during frequent notifications. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 4 | ❓ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 58.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 36 functions across 3 files. (4 skipped: 3 unsupported, 1 too large.) ✨ Finishing Touches 💡 2📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
🛠️ Fix failing CI checks 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. I’m a rabbit; I watch the root, Comment |
EffortlessSteven
left a comment
There was a problem hiding this comment.
Exact-head review of 114ca6f. Disposition: no blocking findings; merge waits on required CI and bot reviews.
What I inspected (5 files):
workspace_input_kind: classifies only the exact root ledger and the root.git/HEADasDiagnosticsInput. Nested and outside paths are rejected (tested).did_change_watched_files: a graph change still wins, because its refresh re-reads both inputs. Otherwise it runs oneWatchedInputrefresh.- The scheduler:
resolves_freshcovers explicit and watched-input refreshes.- Git inputs bypass the episode cache.
- Dedup is skipped.
- Negative experiment: narrowing the predicate fails
watched_input_refresh_bypasses_dedup_of_an_unchanged_input_identity.
- Watcher registration:
- with
relativePatternSupport:{baseUri, pattern}; - without it: bare root-relative strings with no
**. - The client-profile parse fails closed.
- with
- Feedback-loop check: the LSP reads the ledger (
backend.rsreceipt and gap artifact paths) and never writes it, so a refresh cannot trigger itself.
Local results after rebasing on main 3ebe6f3 (CHANGELOG conflict only):
lsp::tests: 784 passed.cargo clippy -p ripr --all-targets --locked -D warnings: 0.cargo xtask precommit: 0.
External reviews are not in yet. CodeRabbit (rate-limited) and droid-review are recorded as missing, not clean.
Generated by Claude Code
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 114ca6fe74
ℹ️ 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".
|
The failing The fix is #4903 (issue #4902). I'll port its two test-only commits into this branch with the review fixes now in progress, so the next push runs the VS Code lane against the fixed smoke. Generated by Claude Code |
…4896) Register the root gap ledger and root .git/HEAD watchers under their own registration and resync it after every workspace-root transition, so a root switch unregisters the old-root watchers and anchors new ones. Without relativePatternSupport, register absolute string globs instead of bare relative strings, skipping roots with glob metacharacters. Disclose watched_files_relative_pattern_support in the client-feature status projection and trace the new tests under RIPR-SPEC-0143. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014WDSj54AyARNwy6oUuYXnx
#4709 made ripr lsp withhold a gap ledger whose source_subject is missing or stale. The smoke wrote an unstamped ledger and then edited pricing.ts, so the preview diagnostic never appeared. Write the ledger after the save, stamped with the digests of the files its record names. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014WDSj54AyARNwy6oUuYXnx
…#4902 review) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014WDSj54AyARNwy6oUuYXnx
…-2rk3d2-lsp-watch # Conflicts: # CHANGELOG.md
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
# Conflicts: # CHANGELOG.md
Import union only: main's #4904 dynamic Unregistration import beside the PR's PositionEncodingKind; no semantic overlap in the touched regions.
Summary
ripr checkin a terminal, or.git/HEADcan move ongit checkout, without touching an open buffer. In both casesripr lspkept publishing the old diagnostics until the next save.watched_inputrefresh when either changes. That refresh resolves Git inputs fresh and skips input-identity dedup, because neither the ledger contents nor the branch is part of the identity.When the client advertises
relativePatternSupport, the watchers register asRelativePatterns anchored at the root URI. VS Code matches a bare string glob against the absolute path, so a bare.git/HEADwould never fire there. Nested ledgers and.git/HEADfiles belong to other checkouts and are ignored.Fixes #4896.
Swarm / Source Boundary
ripr-swarmSource-of-truth Links
Governing issue or accepted claim: #4896
Acceptance delta (one sentence): a rewritten root gap ledger or a moved root
.git/HEADtriggers exactly one diagnostics refresh that is not deduplicated away.Candidate Relationships
Candidate branch:
claude/project-thread-2rk3d2-lsp-watchStack parent or prerequisite PR: none. Related: #4709 made the LSP validate the ledger's source stamp; this PR makes it notice a new ledger.
Scope Classification
Production delta:
WorkspaceInputKind::DiagnosticsInputfor the root ledger and the root.git/HEAD.RefreshReason::WatchedInput(watched_input), which resolves fresh.relativePatternSupportin the client profile.Evidence/support delta: unit tests in
backend.rs,client_features.rs,refresh_scheduler.rsandlsp/tests.rs.Non-goals:
.gitfiles.Support-tier Impact
Policy Impact
Proof
Negative experiment: with
resolves_freshnarrowed back toExplicitRefresh,watched_input_refresh_bypasses_dedup_of_an_unchanged_input_identityfails.Claim Boundary
Claims that the refresh is triggered and not deduplicated. It makes no claim that every editor sends the watch events. Editors without dynamic watcher registration still refresh on save.
Rollback
Revert the commit. Diagnostics go back to refreshing on save and on explicit refresh only.
CI Economics
n/a
Engineering Check
panic,unwrap,expect,todo, orunimplementedin production code.panic,unwrap,expect,todo, orunimplementedin tests.Gates
cargo xtask precommit🤖 Generated with Claude Code
https://claude.ai/code/session_014WDSj54AyARNwy6oUuYXnx
Generated by Claude Code