Files
codebase-memory-mcp/tests
Andrew Hundt 8cd50efc61 perf(pagerank): defer incremental fallback refresh
Preserve whether a full publication was reached through an attempted incremental route and expose that provenance in index_repository responses. Map those safe replacement fallbacks to a distinct rank-refresh event without changing the canonical publish_kind=full contract.

Under the default stale_on_incremental policy, defer synchronous PageRank, LinkRank, and degree recomputation only when replacement metadata has already marked all rank views stale and no dependencies were reindexed. Eager and stale_on_exact policies still recompute; search, trace, and architecture surfaces omit stale rank values and emit freshness warnings until a later refresh.

This adds no background worker or retained resource. Pipeline provenance resets on every run, callers copy it before freeing the pipeline, and existing store/query lifecycle rules own stale-ledger cleanup and subsequent refresh.

Measured on the canonical route-handler self-dogfood scenario: rank refresh fell from 7,669 ms to 0.02 ms and the observed fresh-over-incremental speedup was 7.37x, with canonical graph equality, stale-warning oracles, and temporary worktree/database cleanup all green. End-to-end timing remains resource-sensitive.

Validation: signed product build; sanitizer test build; PageRank suite (59 passed); MCP suite (171 passed); pipeline suite (349 passed); C full-fallback canonical canaries (2 passed); source-safety check; route-handler canonical self-dogfood.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
2026-07-12 17:36:47 -04:00
..
2026-06-03 02:13:30 +02:00