mirror of
https://github.com/DeusData/codebase-memory-mcp.git
synced 2026-10-26 06:43:15 +08:00
scripts/benchmark-incremental-speed.py previously loaded complete canonical graph row lists and mismatch sets, requiring O(nodes + edges) Python memory. Supervisor worker logs remained inside disposable work roots, so successful automatic cleanup removed the raw phase and peak-memory evidence. Hash ordered query rows as length-delimited SHA-256 streams and diagnose mismatches with a two-cursor merge, both using O(1) Python auxiliary memory. Record initial, incremental, and fresh node/edge/source-content fingerprints; exclude volatile mtimes from cross-run identity while retaining the existing mtime-sensitive freshness comparison. Reuse node and edge component hashes during incremental-versus-fresh equality checks to avoid duplicate large-table scans. Stream discovered worker logs into content-addressed gzip files with mtime=0 under each durable campaign attempt. Record raw and compressed hashes and byte counts in index results, and independently inventory every artifact path, size, and SHA-256 in attempt.json before disposable worktree cleanup. Verification: 117 benchmark/campaign/report unit tests; Ruff check on all four changed files; scripts/check-source-safety.sh; git diff --check. RED coverage observed missing stream_query_fingerprint/archive_measurement_log symbols and a campaign child without CBM_BENCHMARK_ARTIFACT_DIR before the implementation. Signed-off-by: Andrew Hundt <ATHundt@gmail.com>