fix(review): preserve cached AI gate findings#1492
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1492 +/- ##
==========================================
+ Coverage 95.43% 95.44% +0.01%
==========================================
Files 202 202
Lines 21751 21754 +3
Branches 7860 7861 +1
==========================================
+ Hits 20757 20764 +7
+ Misses 416 414 -2
+ Partials 578 576 -2
🚀 New features to boost your workflow:
|
6ab074f to
318b459
Compare
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review — held for maintainer review
⏸️ Held for maintainer review Review summary Nits (5)
Nits — 2 non-blocking
Review context
Contributor next steps
Signal definitions
Review detailsGenerated from public PR metadata and the diff. Advisory only; deterministic signals remain authoritative. The PR correctly addresses a security-relevant cache bug where block-mode gate findings (ai_consensus_defect, ai_review_split, ai_review_inconclusive) were not persisted, allowing cached hits to skip replaying blockers and letting block-mode PRs pass incorrectly. The local-accumulator pattern in runAiReviewForAdvisory is a clean refactor: findings are collected, bulk-pushed to advisory.findings (preserving the original side-effect), and returned for cache storage. The migration is backward-compatible (NOT NULL DEFAULT '[]'), and replay is correctly sequenced before gate evaluation in maybePublishPrPublicSurface. Nits (5)
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
gittensory-ui | 0abbdee | Commit Preview URL Branch Preview URL |
Jun 27 2026, 01:25 AM |
Motivation
notesandreviewerCount, which allowed cached hits to skip re-applying gate-relevant findings (ai_consensus_defect,ai_review_split,ai_review_inconclusive) and could let block-mode PRs pass incorrectly.Description
findingswith cached reviews by adding afindings_jsoncolumn and wiring it intoputCachedAiReview/getCachedAiReviewinsrc/db/repositories.tsand a new migrationmigrations/0075_ai_review_cache_findings.sql.runAiReviewForAdvisoryand include them in the returned cache payload (notes,reviewerCount,findings).findingsintoadvisory.findingsbefore the deterministic gate evaluation so cached blockers are not lost (src/queue/processors.ts).findingsand the block-mode re-gate sweep behavior (test/unit/ai-review-cache.test.ts,test/unit/queue.test.ts).Testing
npm run typecheckand it succeeded.npm run db:migrations:checkand the new migration is contiguous and accepted.vitest(test/unit/ai-review-cache.test.tsand the re-gate-related tests intest/unit/queue.test.ts) and they passed.Codex Task