topos.mcp.cache¶
LRU caches for the Topos MCP server.
Two caches:
dep_graph_for: parsedModuleDependencyGraph, keyed by (gitnexus_dir, target_file, mtime). mtime invalidates automatically when gitnexus re-runs.baseline_result_for:ClassificationResultfor a file’s current on-disk state, keyed by (filepath, content sha256, priority, gitnexus_mtime). Letstopos_assess_improvementskip re-evaluating the baseline across a loop of proposed variants.
Both caches are process-local; stdio servers are single-process so no cross-process coordination is needed.
- topos.mcp.cache.dep_graph_for(gitnexus_dir, target_file)[source]
Return a cached
ModuleDependencyGraphfor the given gitnexus dir + file.
- topos.mcp.cache.baseline_key(filepath, priority, gitnexus_dir)[source]
Cache key for a file’s current on-disk baseline evaluation.
- topos.mcp.cache.clear_caches()[source]
Clear all caches. Primarily for tests.