fix(server): reconcile historical V2 migration manifests - #9900
Open
saphid wants to merge 3 commits into
Open
Conversation
Contributor
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — The PR changes the production startup migration path, including transactional manifest renumbering and replay of previously skipped schema/data migrations for historical databases. That stateful database-upgrade behavior has material operational impact beyond the test-only additions and warrants human review. No code changes detected at You can add or adjust custom eligibility rules. Learn more. |
juliusmarminge
force-pushed
the
t3code/codex-turn-mapping
branch
2 times, most recently
from
September 5, 2026 04:56
b82facd to
2ac9bfe
Compare
saphid
force-pushed
the
fix/v2-historical-migrations-20260905
branch
from
September 5, 2026 05:07
bd245a3 to
c45eb66
Compare
…apping' into landing/pr-9900
Contributor
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |
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.
What Changed
Older Orchestrator V2 databases recorded the same migrations under IDs starting at 44 or 45. Startup now validates the complete recorded prefix, shifts those V2 records to their current IDs while preserving timestamps, applies the missing main migrations, and then continues with pending migrations.
Reconciliation and normal migration run in one transaction. An unknown or partial historical manifest, an invalid migration ceiling, or a later migration failure rolls back both the schema and migration-history changes.
Why
Without reconciliation, startup can replay DDL that an older V2 build already applied or skip main migrations inserted before the current V2 sequence.
Validation
No live historical user database was exercised.
Stack
Targets the Orchestrator V2 branch in #2829. That architecture is not present on current
main.Implemented by GPT-6 and reviewed by a Codex worker in Codex/T3.
Current-base verification
Updated to exact V2 base
415ed0f73b97f1655b6282492f81d0b2bba3a9ccat718bc3f8cfa995cf64709ef8c53b53a9fdfeb25b. The historical-ledger reconciliation remains absent from that base and its stable patch ID is unchanged. The focused migration suite passed 10/10 tests; server typecheck, targeted lint, andgit diff --checkpassed. Typecheck emitted only existing advisory Effect suggestions outside this contribution.The #10051 bridge has already absorbed this repair for its own integration, but the repair is still required independently by the declared V2 base; this PR should remain open. No live historical user database was exercised. Fresh independent Claude review remains unavailable because its OAuth credentials are expired. Refreshed by GPT-6 in Codex/T3.