You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* fix(review): cache impact-map's per-file vector query results
computeImpactMap issues one retrieveContextWithMetrics call per changed-
symbol file (up to MAX_IMPACT_MAP_INPUT_FILES=20), each a real embedding
call plus a live vector-index query with no result cache -- only a
60-second cold-index existence check is memoized. Impact-map is a dynamic
feature (bypasses the durable ai_review cache), so only the 30-minute
non-cacheable retry cooldown throttled repeat computation; once that
lapsed, the full up-to-20x embed+query loop re-fired for an unchanged PR.
Adds impact_map_query_cache, keyed by (project, repo, fingerprint) where
the fingerprint hashes every input that affects the result (queryText,
excludePaths, topK, minScore, reranker) -- excludePaths in particular
varies per changed file, since each excludes itself. Unlike the grounding
file-content cache, this needs a TTL: the underlying vector index can
change as new commits get embedded, so an identical query issued later
could legitimately have a different correct answer. Matches the same
30-minute cooldown that already throttles how often this computation is
re-attempted.
Closes#4500.
* fix(review): close impact-map query-cache coverage gaps
Restructure the cache-hit branch to a proper if/else (a braceless
single-statement if with no else was mis-instrumented by v8's coverage
collector) and add a fail-safe test for a throwing cache read.
.prepare("SELECT context, metrics_json AS metricsJson, fetched_at AS fetchedAt FROM impact_map_query_cache WHERE project = ? AND repo = ? AND query_fingerprint = ?")
it("REGRESSION (#4500, impact-map-refetch incident): repeated cooldown-driven computeImpactMap calls on an unchanged head only embed/query once per file, not once per call",async()=>{
it("a genuinely different query (different changed symbols) still triggers a fresh embed+query, never masked by another file's cached entry",async()=>{
0 commit comments