docs(rfc-001): flag mcp_server cache/reconnect for §10 cleanup

#757 landed mtime/inode cache invalidation and mempalace_reconnect
in mcp_server._get_client(). Both are Chroma-specific (stat of
chroma.sqlite3). They should migrate into ChromaBackend.get_collection
and ChromaBackend.close_palace during the §10 cleanup so the freshness
contract lives inside the backend, not in the caller.
This commit is contained in:
Igor Lins e Silva 2026-04-13 01:54:29 -03:00
parent bd3ea6bde4
commit 96715514b1
1 changed files with 2 additions and 0 deletions

View File

@ -550,6 +550,8 @@ The #413 seam is incomplete. Seven files in `mempalace/` still import `chromadb`
These must be routed through `BaseCollection` before the spec can be enforced. Combined with the dict-to-typed-result migration from §1.3, this is substantial enough to be its own PR, landing before any new backend implementation merges.
One implementation detail worth flagging for the cleanup PR: `mcp_server._get_client()` caches a `PersistentClient` at module scope and invalidates it on `chroma.sqlite3` inode or mtime changes (merged via [#757](https://github.com/MemPalace/mempalace/pull/757)). Both the cache and the stat-based freshness check are Chroma-specific. They should migrate into `ChromaBackend.get_collection()` (§2.5, handle caching) and `ChromaBackend.close_palace()` (§2.6, explicit flush) during cleanup — other backends do not have a single on-disk SQLite file to stat. The `mempalace_reconnect` MCP tool then becomes a thin wrapper around `backend.close_palace(palace_ref)`.
---
## 11. Impact on in-flight PRs