Skip to content

fix(lsp): a branch checkout or a regenerated gap ledger does not refresh editor diagnostics #4896

Closed

Description

@EffortlessSteven

Finding

ripr lsp publishes gap diagnostics from <root>/target/ripr/reports/gap-decision-ledger.json (lsp/diagnostics.rs load_gap_ledger_records) and from the analysis diff against the current checkout. It asks the client to watch only configuration and workspace-graph inputs (lsp/backend.rs workspace_input_watchers: ripr.toml, Cargo.toml, Cargo.lock and the Python markers). The VS Code client's static synchronize.fileEvents watches only **/{Cargo.toml,ripr.toml}.

As a result, nothing triggers a refresh in two common cases:

  1. git checkout / git switch with no open buffer changing. The diagnostics published for the old branch stay in the Problems panel until the user edits, saves or opens a file.
  2. ripr check, ripr reports gap-ledger or ripr pilot run in a terminal rewriting the ledger. The editor keeps projecting the previous ledger. New gaps don't appear and fixed gaps don't clear until an unrelated edit.

#4709 (#4544) made a refresh withhold gaps whose named files changed. This issue is about the missing trigger for that refresh.

Direction

  • Watch the root gap ledger (target/ripr/reports/gap-decision-ledger.json) and the root .git/HEAD, root-scoped like the existing Python watchers.
  • Classify those events as a diagnostics input, not a workspace-graph or config change. They schedule one ordinary interactive refresh, and repeated events coalesce through the existing scheduler.
  • Leave the VS Code static watcher alone if dynamic registration already covers it, or add the two paths there.

Found in the 0.11 shared-state hunt (CLI run alongside ripr lsp).

Activity

  1. EffortlessSteven commented on Oct 1, 2026

    @EffortlessSteven
    MemberAuthor

    Landed via #4904 (squash merge a96d87e; sync of candidate 38c2c7b with origin/main 1eb54ee as merge head 9af7213).

    Acceptance evidence on merge head 9af7213:

    • Root gap-decision-ledger rewrite or root .git/HEAD move triggers exactly one WatchedInput refresh that resolves fresh and bypasses input-identity dedup: lsp:: suite passes on the merged tree — cargo test -p ripr --lib -- lsp:: = 801 passed / 0 failed (includes the watched-input, RelativePattern registration, and re-anchor tests in backend.rs / client_features.rs / refresh_scheduler.rs / lsp/tests.rs).
    • Local gates on 9af7213: cargo fmt --check, clippy --workspace --all-targets -D warnings, goldens check — all pass. Hosted 'Ripr Rust Small Result' green (run 36848810538; hosted Rust gates 39m11s; Rust-only feature lane pass).
    • Merge repair within scope: root CHANGELOG.md union (PR's fix(lsp): a branch checkout or a regenerated gap ledger does not refresh editor diagnostics #4896 entry atop main's Fixed entries).
    • Advisory notes (not on required path; required = Ripr Rust Small Result per branch protection): rust-coverage lane red on 9af7213, codecov/patch red, droid-review timed out after 24h queued — left for the owning lanes.

    Issue closed by the PR's closing reference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions