mirror of
https://github.com/DeusData/codebase-memory-mcp.git
synced 2026-11-06 08:35:21 +08:00
Every index_repository call copied the whole existing database into a stage (sqlite3 backup) before routing, and the exact no-op then sealed that copy and renamed it back over the live file. On the Linux kernel index the copy alone was a 19 GB write per unchanged re-index. The copy is now deferred until routing needs it. The exact no-op is decided read-only on the live generation with the same checks the staged route applies to its copy (shallow integrity, format version, current coverage metadata and doc-link layer, byte-identical semantic manifest); the run then publishes nothing and only refreshes the artifact from the live database. Any other outcome copies and routes exactly as before, so every change -- including a same-size edit that keeps the original mtime -- still rebuilds from content hashes. cbm_pipeline_new no longer resolves the Git context the run start always re-resolved (seven git subprocesses per call). No-op index_repository, macOS, median of three runs of n=3: django 840.8 -> 539.0 ms, redis 450.7 -> 310.5 ms, Linux kernel 18449.5 -> 2405.0 ms. Responses and graphs are byte-identical to the baseline for the no-op and for modify/add/delete/rename edits. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>