Files
codebase-memory-mcp/scripts
Andrew Hundt 2ba57f5333 fix(benchmarks): normalize project roots in graph fingerprints
The stable graph fingerprint added in 5cb6e2eb reused raw canonical qualified names and node properties. Independent benchmark roots therefore produced different hashes even when retained logs showed identical source hashes, node/edge counts, semantic edge counts, similarity edge counts, and judged scores.

Add path-normalized SQL projections that strip only the exact project prefix from qualified names. Hash structural node identity, structural edge identity, source path/content/size, and semantic score/jaccard rows as separate components. Exclude arbitrary node properties and file mtimes from cross-run identity.

Keep compare_canonical_graph() on the original full canonical rows, including properties and mtimes, so incremental-versus-fresh correctness remains strict. Stable experiment identity no longer short-circuits or weakens that gate.

Verification: RED SQLite fixture produced unequal hashes for identical relative graphs under random-root-a and random-root-b; GREEN makes them equal and still detects a semantic score change from 0.873 to 0.811. Full benchmark/campaign/report suite: 119 passed; Ruff; scripts/check-source-safety.sh; git diff --check.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
2026-07-16 16:53:42 -04:00
..