[Task] Integrate coordinated backup evidence and restore drills into deployment flow #35

Closed
opened 2026-08-01 01:49:31 +02:00 by zemion · 2 comments
Owner

Objective

Turn the deployment journal's explicit migration boundary into an operator-verifiable production backup gate. Parent: #13.

Acceptance criteria

  • Define a provider-neutral backup-evidence contract for PostgreSQL, object storage, and encryption-key references at one recovery point; never copy key material into evidence.
  • Record artifact identity, scope, timestamp, encryption/protection, expiry, provider, database LSN/snapshot identity where available, object-store version/manifest identity, and restore-test evidence.
  • Require fresh verified evidence before a forward-only or destructive migration; annotations alone are not sufficient.
  • Exercise restore into an isolated target, apply the matching immutable release, verify migration heads and representative object hashes, and retain the drill result.
  • Make failures, stale evidence, partial backup sets, and key mismatch fail closed with an explicit forward-recovery/manual-intervention state.
  • Support Compose and exported orchestrator profiles without giving the application API host or orchestrator control-plane access.
  • Document RPO/RTO ownership, retention, disposal, and provider-specific runbooks.

Current baseline

govoplan-deploy records a checksum-verified applied bundle and hash-chained operation journal. It permits bounded pre-migration configuration restore and switches permanently to forward recovery after migration starts. Core can reference a verified backup in a snapshot_restore recovery plan, but no production backup provider currently creates or validates that evidence.

## Objective Turn the deployment journal's explicit migration boundary into an operator-verifiable production backup gate. Parent: #13. ## Acceptance criteria - [ ] Define a provider-neutral backup-evidence contract for PostgreSQL, object storage, and encryption-key references at one recovery point; never copy key material into evidence. - [ ] Record artifact identity, scope, timestamp, encryption/protection, expiry, provider, database LSN/snapshot identity where available, object-store version/manifest identity, and restore-test evidence. - [ ] Require fresh verified evidence before a forward-only or destructive migration; annotations alone are not sufficient. - [ ] Exercise restore into an isolated target, apply the matching immutable release, verify migration heads and representative object hashes, and retain the drill result. - [ ] Make failures, stale evidence, partial backup sets, and key mismatch fail closed with an explicit forward-recovery/manual-intervention state. - [ ] Support Compose and exported orchestrator profiles without giving the application API host or orchestrator control-plane access. - [ ] Document RPO/RTO ownership, retention, disposal, and provider-specific runbooks. ## Current baseline `govoplan-deploy` records a checksum-verified applied bundle and hash-chained operation journal. It permits bounded pre-migration configuration restore and switches permanently to forward recovery after migration starts. Core can reference a verified backup in a `snapshot_restore` recovery plan, but no production backup provider currently creates or validates that evidence.
Author
Owner

Codex State: progress

Summary

  • Reference-readiness validation now requires a signed, expiring recovery claim bound to the exact release, deployment profile, controls, and evidence artifact hashes.

Verification

  • python -m unittest tests.test_capability_fit_evidence: 40 passed; tools/checks/check-focused.sh: passed.

Next / Blocked

  • Keep this issue open until deployment tooling actually executes coordinated backup/restore drills and supplies the resulting signed evidence.

Suggested status label: status/in-progress

## Codex State: progress ### Summary - Reference-readiness validation now requires a signed, expiring recovery claim bound to the exact release, deployment profile, controls, and evidence artifact hashes. ### Verification - `python -m unittest tests.test_capability_fit_evidence: 40 passed; tools/checks/check-focused.sh: passed.` ### Next / Blocked - Keep this issue open until deployment tooling actually executes coordinated backup/restore drills and supplies the resulting signed evidence. Suggested status label: `status/in-progress`
Author
Owner

Implemented and pushed.

Evidence:

  • cbbe08d defines strict signed provider-neutral schemas for coordinated PostgreSQL, object, protected-configuration, and key-custody recovery points, with no key material.
  • The evidence is bound to the installation/profile and exact immutable release, enforces component coordination, write-fence identity, expiry/revocation, isolated restore chronology, migration-head/object-manifest hashes, semantic checks, and measured RPO/RTO.
  • govoplan-deploy verify-backup --adopt requires an independently supplied SHA-256 and an explicit Ed25519 trust keyring; stored bytes are canonicalized, rehashed, and reverified without a second-open swap window.
  • Compose blocks release-changing migrations and re-verifies after runtime quiescing immediately before the migration boundary. Rejections are hash-chained in the deployment journal.
  • Kubernetes export fails closed for a release-changing migration and annotates the Job with only sanitized evidence identifiers/digest.
  • 0105fd4 projects expiry-aware sanitized status through Ops without exposing artifact, provider, credential, or key-custody references.
  • Provider signing utility, operator/provider runbooks, retention/disposal and RPO/RTO ownership are documented in docs/BACKUP_AND_RESTORE_EVIDENCE.md.

Validation:

  • Full meta suite: 373 tests passed.
  • Ops: 10 tests passed plus Ruff.
  • Zipapp build/help and both JSON schemas validated.
  • Tamper, stale, partial, wrong release, wrong key purpose, component skew, dishonest RTO, canonical signing, adoption, and next-release gate paths are covered.

A real production restore and signed target receipt cannot be manufactured from source tests; that target-environment acceptance remains explicitly tracked by #37.

Implemented and pushed. Evidence: - `cbbe08d` defines strict signed provider-neutral schemas for coordinated PostgreSQL, object, protected-configuration, and key-custody recovery points, with no key material. - The evidence is bound to the installation/profile and exact immutable release, enforces component coordination, write-fence identity, expiry/revocation, isolated restore chronology, migration-head/object-manifest hashes, semantic checks, and measured RPO/RTO. - `govoplan-deploy verify-backup --adopt` requires an independently supplied SHA-256 and an explicit Ed25519 trust keyring; stored bytes are canonicalized, rehashed, and reverified without a second-open swap window. - Compose blocks release-changing migrations and re-verifies after runtime quiescing immediately before the migration boundary. Rejections are hash-chained in the deployment journal. - Kubernetes export fails closed for a release-changing migration and annotates the Job with only sanitized evidence identifiers/digest. - `0105fd4` projects expiry-aware sanitized status through Ops without exposing artifact, provider, credential, or key-custody references. - Provider signing utility, operator/provider runbooks, retention/disposal and RPO/RTO ownership are documented in `docs/BACKUP_AND_RESTORE_EVIDENCE.md`. Validation: - Full meta suite: 373 tests passed. - Ops: 10 tests passed plus Ruff. - Zipapp build/help and both JSON schemas validated. - Tamper, stale, partial, wrong release, wrong key purpose, component skew, dishonest RTO, canonical signing, adoption, and next-release gate paths are covered. A real production restore and signed target receipt cannot be manufactured from source tests; that target-environment acceptance remains explicitly tracked by #37.
zemion removed the codex/ready
status
ready
labels 2026-08-03 02:04:57 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: GovOPlaN/govoplan#35