Repository navigation
feat(migrations): declared forward fix for a dependency whose verification failed - #78
Merged
Merged
Conversation
…ation failed On production, rule migration.dependencies-verified asked for a break-glass grant as soon as a dependency's latest verification failed. Break-glass activation is refused while OD-21 is open, so the forward fix that failure-and-recovery.md E2 prescribes could not be planned at all. A plan may now declare forwardFixFor (CLI: migration plan --forward-fix-for). The planner accepts the claim only for a migration the target applied through ExponetDB, not reverted, whose latest verification failed and which a planned migration names directly in dependsOn; anything else is VALIDATION_FAILED. The rule (version 3) then passes for exactly those dependencies and names them; approval, staging evidence and the other requirements stay. The repaired migration keeps its failed verification until migration.verify passes again. Owner decision of 2026-11-17. Developed by @davdxpx
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.
Why
On production,
migration.dependencies-verifiedrequires a break-glass grant once a dependency's latest verification has failed. Break-glass activation is refused while OD-21 is open. So the forward fix thatfailure-and-recovery.mdE2 names as the preferred remedy cannot be planned: the fix depends on the failed migration, and the rule blocks it.Observed on REOSA production (2026-11-14). Bundle
01M76JKS9J8RSPSP0861X70T1Pwas applied, but its verification failed: service_role received UPDATE from the owner's default privileges. Its forward fix01M7D3F0E372H8X02M2QX1BFEKis verified on staging, yet the production plan requiresbreak_glassformigration.dependencies-verified. Eleven more bundles are blocked behind the same dependency.What
Request:
MigrationPlanRequest.forwardFixFor(1 to 10 migration ids), CLIexponetdb migration plan … --forward-fix-for <id,…>.Planner (
forwardFixProblems): each id must meet all of the following, or the plan is refused withVALIDATION_FAILED:failed;dependsOn.The error codes are
not_a_direct_dependency,not_applied,not_failedandbaseline.dependenciesVerified()skips exactly the accepted ids, and the plan facts carryforwardFixFor.Rule
migration.dependencies-verifiedversion 3: it passes for a declared forward fix and names it, so the approval shows it. Production approval, staging evidence and verify digest, and re-authentication stay unchanged.Not changed:
migration.verifypasses, so its other dependents stay blocked until then.Docs: failure-and-recovery.md (E2, new §3.1), verification.md, staging-production-policy.md, policy-engine.md, 15-cli/reference.md (regenerated).
Tests
packages/migrations-engine/test/baseline-chain.test.ts: the exception applies only to the named dependency; direct dependencies only; passed, never verified, not applied, reverted and baseline are refused. 15 tests pass.packages/policy/test/migration-rules.test.ts: the rule passes and names the fix; without the declaration it still fails; a malformed fact is denied (fail closed). 25 tests pass.apps/cli: 231 tests pass, including the generated reference.generate --check,golden:checkand biome on the changed files pass.bun run verifywith integration and e2e tests against real PostgreSQL. The change involves no PostgreSQL behavior; the planner path is covered by the pure functions.Rollout
The server has to be deployed for this. The production server currently reports 0.2.0. After the deploy, for REOSA:
exponetdb migration plan 01M7D3F0E372H8X02M2QX1BFEK --stored --target reosa/platform/production --forward-fix-for 01M76JKS9J8RSPSP0861X70T1P, then approve.exponetdb migration verify 01M76JKS9J8RSPSP0861X70T1P --target reosa/platform/production.Developed by @davdxpx