Let routed CI cache researched reviews too, from one shared policy - #74
Conversation
#71 removed the offline index and dropped the research gate from `cacheAllowed` — but only from runLegacyCi. runRoutedCi, which handles every repo that has adopted routing.jsonc, kept `!rootConfig.research.enabled` and so has been running a fresh review for every researched PR, for a reason that stopped existing when the index did. Both gates were added by the same commit (#61) for the same index reason, so this was a missed half, not a separate constraint. Caught by the reviewer on the roadmap PR (#72), which claimed the fix had already landed. Rather than qualify that claim, make it true. The duplication is the actual defect: one policy written out twice will drift, and did. `reviewCacheAllowed` in review-cache.ts is now the single definition and both paths call it, with a unit test pinning each flag and recording that research is deliberately not among them.
🤖 AI code reviewDecision: Approve Overall PR risk: Medium. This change modifies existing behavior by consolidating the cache-allow policy from two separate implementations into one shared function. Both the legacy and routed CI paths now have identical logic, which is correct: the reason for blocking cache reuse (the offline index artifact) was removed in #71 for the legacy path but missed in the routed path. The behavior is now consistent across both code paths. What might break: routed repositories with research enabled will now reuse cached reviews when the input hash matches; the hash covers scoped files, content, scope config, PR metadata, agents, and route, but does not cover live documentation content, so reused reviews could carry stale citations and skip fresh MCP calls. Blast radius is limited to routed CI runs only, and rollback is straightforward (add the research flag back to
No findings. This review is advisory — it never blocks a merge and never auto-approves. |
Caught by the reviewer on the roadmap PR (#72). It flagged the roadmap for claiming researched reviews are cacheable again — and it was right, because the fix only half-landed.
The miss
#71 removed the offline index and dropped the research gate from
cacheAllowedinrunLegacyCi.runRoutedCi— the path taken by every repo that has adoptedrouting.jsonc— still had it:git log -Sconfirms both gates were added by the same commit (#61) for the same reason: the offline index was an artifact whose contents the cache key could not represent. With the index gone that reason is gone, so this was a missed half rather than an independent constraint. Effect: routed repos have been running a fresh review for every researched PR unnecessarily.The fix is the deduplication
Correcting the second copy would leave the actual defect in place — one policy written out twice will drift, and this one already did.
reviewCacheAllowedinreview-cache.tsis now the single definition, and both paths call it.A unit test pins each flag and records explicitly that research is not among them, so the next person to wonder doesn't have to re-derive it from two call sites.
Note on the roadmap PR
I fixed the code rather than qualifying the prose, so #72's text ("removing the offline index let
ci.tsdrop!config.research.enabledfromcacheAllowed, so researched reviews are cacheable again") is accurate once this merges. No change needed there.Verification
tscclean ·oxlintclean ·oxfmtclean ·ref-check0 errors · 709 tests pass (+1).🤖 Generated with Claude Code