You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PullStore: per-URI forget so closing one document doesn't clear every memo #52
PullStore::clear() (crates/lspkit-server/src/pull.rs:255, released in 0.5.0) is the only way to release diagnostic memos, and it drops the whole database.
A consumer that closes a single document has two bad choices:
call clear() and throw away every other open document's memos (all of them re-pull cold), or
keep the closed document's memos and inputs alive until the next solution switch (memory grows with every file opened in a session).
SharpLsp currently calls clear() on every didClose, so closing one tab invalidates diagnostics for every open tab.
Ask
A per-document eviction, e.g. PullStore::forget(&self, uri: &Uri) -> Result<(), PullError>, that:
removes the URI's input and the memos derived only from it,
leaves every other URI's memos warm (a following pull of another URI hits the cache),
makes a later pull of the forgotten URI recompute from scratch.
If Salsa can't delete inputs, an acceptable shape is a tombstone input (set the URI's text to an empty sentinel + drop it from the store's key map) plus a heap-leak test like outbound_heap_leak.rs proving open/forget cycles don't grow allocated bytes.
Acceptance tests
open A, B → pull both → forget A → pull B is a cache hit, pull A recomputes
1000 open/forget cycles of distinct URIs → heap bytes bounded (allocated == freed within tolerance)
Landing in v0.6.0 via PR #51 (not after it): d2a22c4, 029e583 (Windows agent), 950c04c, 1f05b40. PullStore::forget(uri) keeps every other document warm: same result_id and no recompute. The forgotten URI recomputes, and a close never runs the compiler. A close frees its report at once when idle, a close during an in-flight pull is freed as that pull finishes, and repeated closes queue one entry. Tests: tests/pull_forget.rs and tests/pull_forget_heap.rs (1000 distinct open/forget cycles free exactly what they allocate; closing 32 idle 64 KiB documents frees every byte). Mutants of each fix line are killed, including the two SharpLsp1 found. The reference server now calls forget on didClose. Evidence: docs/plans/issue-fix-evidence-21-26-48-49.md.
✅ Released in v0.6.0 and verified against the published crates
Release:https://github.com/Nimblesite/lspkit/releases/tag/v0.6.0 (run 44186953235, tag at 8e39446). It contains lspkit, lspkit-server, lsp-profiler and lsp-profiler-dotnet 0.6.0 on crates.io, plus @nimblesite/lsp-profiler-ui@0.6.0 on npm (with provenance), the .NET engine for 6 runtime ids, the consumer kit, an SBOM, and SHA256SUMS signed with cosign.
Method: a worktree at v0.6.0, with crates/lspkit/src and crates/lspkit-server/src replaced by the sources unpacked from the crates.io 0.6.0 downloads. The published source is byte-identical to the tag. Results against the released code:
#21 sidecar_disconnect_session: test result: ok. 2 passed; 0 failed
#26 cancel_during_a_scan: test result: ok. 1 passed; 0 failed
#48 outbound: test result: ok. 3 passed; 0 failed
#48 outbound_heap_leak: test result: ok. 1 passed; 0 failed
#48 sidecar_correlator: test result: ok. 12 passed; 0 failed
#49 uri: test result: ok. 17 passed; 0 failed
#49 uri_authority: test result: ok. 1 passed; 0 failed
#49 style_tests: test result: ok. 5 passed; 0 failed
#52 pull_forget: test result: ok. 5 passed; 0 failed
#52 pull_forget_heap: test result: ok. 1 passed; 0 failed
#53 jsonrpc: test result: ok. 21 passed; 0 failed
#53 jsonrpc_frame_heap: test result: ok. 1 passed; 0 failed
Breaking: the lspkit-server/mcp feature is removed. lsp_profiler::session::rfc3339_now is now lsp_profiler::clock::rfc3339_now. A lone %, or an encoded separator, in a file URI is now an error. Consumers on didClose should call PullStore::forget(uri) instead of clear().
Artifact: the crates published on crates.io, lspkit = "=0.10.1" and lspkit-server = { version = "=0.10.1", features = ["pull"] }. The scratch package has no path or git dependencies. Cargo.lock gives source = "registry+https://github.com/rust-lang/crates.io-index" for both, with checksums lspkit 5784a8d3…6608bc and lspkit-server 2c64b5bd…6d76f4. The release's .crate assets are byte-identical to these downloads.
Steps
cargo new a scratch package depending only on the published crates above.
Copy the regression tests from the repo's crates/*/tests. Every assert*/expect/matches! line was diffed against the repo and is identical; only imports and helper paths changed.
This issue's regressions (all pass against 0.10.1):
forgetting_one_document_keeps_every_other_memo_warm: PullStore::forget(uri) recomputes only the forgotten URI; every other document keeps its result_id with no recompute.
Activity
PullStore::forget: evict one closed document and keep every other mem…
forget frees the closed document's diagnostics before it returns; the…
PullStore::forget: a pull retires closes queued during it; queued clo…
Test that forget never runs the compiler on the closed document (#52)
MelbourneDeveloper commentedon Nov 17, 2026
Landing in v0.6.0 via PR #51 (not after it):
d2a22c4,029e583(Windows agent),950c04c,1f05b40.PullStore::forget(uri)keeps every other document warm: sameresult_idand no recompute. The forgotten URI recomputes, and a close never runs the compiler. A close frees its report at once when idle, a close during an in-flight pull is freed as that pull finishes, and repeated closes queue one entry. Tests:tests/pull_forget.rsandtests/pull_forget_heap.rs(1000 distinct open/forget cycles free exactly what they allocate; closing 32 idle 64 KiB documents frees every byte). Mutants of each fix line are killed, including the two SharpLsp1 found. The reference server now callsforgetondidClose. Evidence:docs/plans/issue-fix-evidence-21-26-48-49.md.Evidence: the Windows section for #49, #52, #42 and the Windows-only …
Fix Windows URIs, sidecar truncation, cancellation results; add serve…
MelbourneDeveloper commentedon Nov 17, 2026
✅ Released in v0.6.0 and verified against the published crates
Release: https://github.com/Nimblesite/lspkit/releases/tag/v0.6.0 (run 44186953235, tag at
8e39446). It contains lspkit, lspkit-server, lsp-profiler and lsp-profiler-dotnet 0.6.0 on crates.io, plus@nimblesite/lsp-profiler-ui@0.6.0on npm (with provenance), the .NET engine for 6 runtime ids, the consumer kit, an SBOM, and SHA256SUMS signed with cosign.Method: a worktree at
v0.6.0, withcrates/lspkit/srcandcrates/lspkit-server/srcreplaced by the sources unpacked from the crates.io 0.6.0 downloads. The published source is byte-identical to the tag. Results against the released code:Breaking: the
lspkit-server/mcpfeature is removed.lsp_profiler::session::rfc3339_nowis nowlsp_profiler::clock::rfc3339_now. A lone%, or an encoded separator, in a file URI is now an error. Consumers on didClose should callPullStore::forget(uri)instead ofclear().MelbourneDeveloper commentedon Nov 20, 2026
✅ Verified against the published v0.10.1 crates
Artifact: the crates published on crates.io,
lspkit = "=0.10.1"andlspkit-server = { version = "=0.10.1", features = ["pull"] }. The scratch package has no path or git dependencies.Cargo.lockgivessource = "registry+https://github.com/rust-lang/crates.io-index"for both, with checksums lspkit5784a8d3…6608bcand lspkit-server2c64b5bd…6d76f4. The release's.crateassets are byte-identical to these downloads.Steps
cargo newa scratch package depending only on the published crates above.crates/*/tests. Everyassert*/expect/matches!line was diffed against the repo and is identical; only imports and helper paths changed.cargo test --features pullResults (whole run): jsonrpc 22/22, jsonrpc_frame_heap 1/1, outbound 3/3, outbound_heap_leak 1/1, pull_forget 5/5, pull_forget_heap 1/1, sidecar_correlator 12/12. 45 passed, 0 failed.
This issue's regressions (all pass against 0.10.1):
forgetting_one_document_keeps_every_other_memo_warm:PullStore::forget(uri)recomputes only the forgotten URI; every other document keeps itsresult_idwith no recompute.forget_is_idempotent_and_a_recycled_input_never_replays_old_truthforget_frees_the_closed_documents_diagnostics_before_it_returnsforget_returns_while_a_compiler_query_runs_and_the_next_pull_applies_itopen_forget_cycles_of_distinct_uris_release_their_heap(pull_forget_heap, exact allocator bytes): open/forget cycles of distinct URIs leave no retained heap.