mirror of
https://github.com/DeusData/codebase-memory-mcp.git
synced 2026-10-26 06:43:15 +08:00
cbm_resolve_cache_dir() returns a pointer to a static thread-local buffer. The cache prune called it for every directory the walk visited, so it rewrote a buffer other code was entitled to still be holding — an aliasing bug, not a cosmetic inefficiency. The Windows guards job caught it as two REDs: a daemon cold-storm regression and a following "index did not run" setup failure. Both are consistent with the cache path being rewritten underneath a live reader during indexing. Resolve once at the discovery entry point into a thread-local copy and compare against that, so the prune costs one resolver call per walk rather than one per directory, and holds no pointer into shared storage. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>