Files
Assistant/dev/tasks/DEV-000035-postgres-backup-recovery.json
m e9594306e5
CI / test (push) Successful in 10s
ops: add verified PostgreSQL backups
2026-08-16 17:53:40 +03:00

79 lines
3.4 KiB
JSON

{
"task_id": "DEV-000035",
"task_revision": 1,
"architecture_revision": "ADR-0004",
"base_repo_revision": "6303dfe6eb2215ae79ab63a2b92b86d7fafd312d",
"risk_tier": "E",
"intent": "Add production-only PostgreSQL backups with integrity manifests, scheduled execution, and isolated restore verification without touching canonical production data.",
"requirement_ids": ["CONSTITUTION-1.3.36", "INV-OWN-001", "USER-DOCKER-PROD-ONLY"],
"allowed_change_scope": {
"modules": [],
"paths": [
"deploy/backup-postgres.sh",
"deploy/verify-postgres-restore.sh",
"deploy/verify-latest-postgres-backup.sh",
"deploy/install-postgres-backup-cron.sh",
"deploy/cron/assistant-postgres-backup.crontab",
"docs/DEPLOYMENT.md",
"dev/ACTIVE_TASK.json",
"dev/tasks/DEV-000035-postgres-backup-recovery.json"
]
},
"forbidden_change_scope": {
"paths": [
"architecture/**",
"ci/**",
".gitea/**",
"cmd/**",
"contracts/**",
"modules/**",
"database/**",
"security/**"
]
},
"allowed_architecture_delta": {
"new_cross_module_dependencies": 0,
"new_canonical_owners": 0,
"new_privileges": 0
},
"contracts": {
"consume": ["PostgreSQL logical backup format"],
"may_change": []
},
"semantic_owner": "none; production recovery mechanism only",
"canonical_state": ["all PostgreSQL owner schemas are captured without mutation"],
"state_transitions": ["none"],
"side_effects_and_privileges": ["reads the production PostgreSQL cluster through its existing local superuser context", "writes mode-0600 backup artifacts on docker.cin.su", "creates and removes an isolated temporary restore-check container"],
"persistence_and_migrations": ["no migration", "daily logical dump plus role globals and SHA-256 manifest under /home/m/assistant-backups/postgres", "user crontab schedule survives host reboot without a persistent login session"],
"failure_retry_restart": ["backup is written to a partial directory and atomically renamed only after all checksums succeed", "a failed backup leaves no object named as complete", "restore verification always removes its isolated temporary container", "no automatic deletion or retention policy is introduced"],
"assumptions": [
"The production database container remains assistant-postgres-1 unless explicitly overridden",
"The production Docker host is docker.cin.su and docker-test is prohibited",
"The host has Docker, sha256sum, and cron"
],
"acceptance_scenarios": [
"a backup contains the application database dump, cluster roles, database and owner metadata, and verified hashes",
"backup artifacts and directories are private to the production SSH user",
"restore verification succeeds in a temporary PostgreSQL 18.6 container without mounting or writing the production volume",
"the production user crontab schedules one daily backup at 03:15 Europe/Moscow and persists across reboot",
"no backup retention deletion is performed",
"exact diff validation observes only declared paths"
],
"required_tests": [
"shell syntax",
"architecture preflight",
"exact diff scope",
"live production backup",
"SHA-256 verification",
"isolated live restore",
"cron schedule installation",
"production application health",
"CI"
],
"terminal_gap_states": [
"BLOCKED_BY_MISSING_CAPABILITY",
"BLOCKED_BY_CONFLICT",
"REQUIRES_MIGRATION_DECISION"
]
}