Skip to content

parity(#211): revalidate cached MCP indexes on query (evict stale local-path caches) #74

Description

@amondnet

Summary

Upstream semble #211 (41c36f7) added on-query revalidation of cached MCP indexes for local paths. csp's MCP session cache does not revalidate on query, so a changed local repo can return stale results.

Upstream behavior (src/semble/mcp.py)

  • _IndexCache._evict_if_stale(source, cache_key) runs on each query for local paths (git URLs skipped) and evicts the cached entry when the on-disk cache no longer matches the files.
  • Gated by a cooldown: _revalidate_after[cache_key] = finished + (finished - start) * _MIN_REVALIDATE_FACTOR (_MIN_REVALIDATE_FACTOR = 3) so slow-to-build repos aren't rechecked too often.
  • Uses semble.cache.get_validated_cache.

csp status

  • crates/csp/src/mcp.rs has an LRU session cache + manual evict(), but no on-query staleness check / revalidate cooldown. A local path indexed once is served from the session cache even after its files change.

Proposed work

  • Port _evict_if_stale + revalidation cooldown to mcp.rs (local paths only; skip git URLs).
  • Reuse the existing manifest validation (content hash / chunk_size) as the staleness signal.

Refs

Metadata

Metadata

Assignees

Labels

p1Priority 1 - Hightype:bugSomething isn't working

Type

Fields

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions