Skip to content

fix: plan acceptance meets a backup requirement through the backup catalog (P6) - #71

Merged
davdxpx merged 1 commit into
mainfrom
fix/backup-requirement-at-acceptance
Nov 4, 2026
Merged

davdxpx merged 1 commit into
mainfrom
fix/backup-requirement-at-acceptance

Conversation

@davdxpx

@davdxpx davdxpx commented Nov 4, 2026

Copy link
Copy Markdown
Owner

Summary

  • Defect. registryAcceptDependencies (packages/registry/src/apply.ts) could meet only break_glass and reauth requirements. The backup requirement of migration.destructive-backup was therefore never met. A destructive, data-rewriting or unclassified production migration needed break-glass even with a fresh verified backup. This was P6 of the REOSA production session (owner decision: prove it, then fix it in a separate small PR).
  • Fix. Plan acceptance asks the composition through the new optional backupMet on RegistryAcceptContext, for the plan's cluster (subject.clusterId). The registry still does not depend on the backup engine.
  • What counts as met (backupRequirementMet → verifiedBackupWithin in @exponetdb/backups): a succeeded backup that the engine still lists, whose verification passed, in a live off-host repository that is not external and whose catalog was reconciled within 10 minutes (as 09-backups-and-restore/architecture.md §5 says), finished within the rule's age (ISO 8601, PT24H) and not in the future.
  • Fails closed on a stale catalog, a posix, retired or unreconciled repository, a plan without a cluster, an unreadable age, a system actor, or a missing wiring.
  • Docs. The P6 row in open-decisions.md and a note under the gap matrix row of migration.destructive-backup.

Order: independent of other open PRs. Live only after a redeploy on the owner's word (W10-D10).

Test plan

  • packages/backups/test/protection.test.ts: the duration parser and every met and unmet case of verifiedBackupWithin (20 tests in the file).
  • packages/registry/test/accept-backup.test.ts: acceptance asks the read for the plan's cluster and age, and is unmet for no, no cluster, not wired, or system.
  • Unit suites of registry, backups, operations, application and server; typecheck, biome check ., verify:generated, boundaries.
  • Integration suites on PostgreSQL 16, 17 and 18:
    • backups 27/27, operations 50/50.
    • registry 55/56: credential-db-owner (PostgreSQL 17) failed once in the full run and passes alone, both on this branch and on main (3/3). It is load-sensitive and unrelated to acceptance.
  • Owner review and merge.

Developed by @davdxpx

…talog (P6)

registryAcceptDependencies met only break_glass and reauth, so the backup
requirement of migration.destructive-backup could never be met: a destructive
production migration needed break-glass even with a fresh verified backup.
Acceptance now asks the composition (backupMet) for the plan's cluster; the
server reads the mirrored catalog: a succeeded, listed, verified backup in a
live off-host repository reconciled within 10 minutes, finished within the
rule's age. Everything it cannot establish fails closed.

Developed by @davdxpx
@davdxpx
davdxpx merged commit cce2ee0 into main Nov 4, 2026
15 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant