fix(db): renumber colliding migration 0181 to 0182 - #9090
Merged
Conversation
Two PRs merged within 18 minutes of each other and both grabbed migration number 0181 (0181_alert_dedup_claims.sql from #8985, 0181_decision_replay_inputs.sql from #9014), breaking db:migrations:check on main for every subsequent PR. Renumbers the later-merged file (decision_replay_inputs) to 0182, the next free number. No code or test references either file by name/number, so this is a pure rename.
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
❌ 1 Tests Failed:
View the top 1 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
JSONbored
added a commit
that referenced
this pull request
Jul 26, 2026
…stale migration-number comment loopover_ai_review_verdict_flip_escalated_total was emitted (processors.ts) with no DEFAULT_METRIC_META entry, failing the completeness drift guard. Also corrects verdict-flip-store.ts's header comment, which still said "migration 0182" -- the ai_review_verdict_flips migration was bumped to 0183 after this branch rebased past #9090's 0181->0182 renumbering, but the comment was never updated.
JSONbored
added a commit
that referenced
this pull request
Jul 26, 2026
…ickiness + flip-count escalation (#9094) * fix(review): stop AI-review verdict-shopping — content-fingerprint stickiness + flip-count escalation The AI reviewer is non-deterministic, and the review cache keys purely on head SHA, so a contributor could force fresh re-rolls (a no-op recommit invalidating the cache key, or a same-head retry once the 30-minute non-cacheable cooldown lapses) until a lucky clean roll auto-merged a PR another roll had flagged as blocked. Two independent defenses: 1. getCachedAiReviewAcrossHeads (src/db/repositories.ts): a fallback used only when the exact-head lookup misses. The input fingerprint already hashes the actual per-file patch content, not just the head SHA, so an identical fingerprint under a different head means the reviewed content is genuinely unchanged -- reuse the prior verdict instead of spending an independently-random fresh roll on it. 2. A per-PR verdict-flip counter (migration 0183, src/review/ verdict-flip-guard.ts + verdict-flip-store.ts): every FRESH (non-cache-hit) verdict in block mode is compared against the PR's last fresh verdict; a flip is a change in whether the verdict had a blocking AI defect. Once flips clear a threshold, the gate holds for a human instead of trusting the newest roll, regardless of what it says. Fixed a pre-existing test (#ops-review-burst) whose fixture returned identical patch content across two different head SHAs -- exactly the no-op-recommit case fix #1 is designed to reuse, which made its own aiCalls assertion test the wrong thing; it now varies real content between heads and stays a valid regression for the ORIGINAL concern (a genuinely new commit is never suppressed). * fix(selfhost): register the verdict-flip-escalation metric and fix a stale migration-number comment loopover_ai_review_verdict_flip_escalated_total was emitted (processors.ts) with no DEFAULT_METRIC_META entry, failing the completeness drift guard. Also corrects verdict-flip-store.ts's header comment, which still said "migration 0182" -- the ai_review_verdict_flips migration was bumped to 0183 after this branch rebased past #9090's 0181->0182 renumbering, but the comment was never updated.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
db:migrations:checkis currently failing onmain:Two PRs merged 18 minutes apart and both picked migration number 0181:
0181_alert_dedup_claims.sql— fix(db): give the anomaly-alert dedup claims their own alert_dedup_claims table #8985, merged 2026-07-26T15:51:09Z0181_decision_replay_inputs.sql— feat(orb): deterministic decision replay — re-derive any gate decision from its recorded inputs #9014, merged 2026-07-26T16:09:23Z (later)This blocks CI for every subsequent PR against
main.Fix
Renumber the later-merged file to the next free number, 0182. Verified no code or test references either migration by filename or number (only
test/unit/alerts.test.tsreferences0181_alert_dedup_claims.sql, which keeps its number).