Repository navigation
Description
Task
T-128· Milestone M10 — Evaluation · Size S · Priority P1 · Epic #10Implements NFR-REL-001
Branch
ci/t-128-backup-restore-pg-dump-artefacts— one task = one branch = one PR (doc 32 §6)
Summary
Implement doc 29 §7: scripts/backup.sh (pg_dump custom format + artefact root tar with checksums, timestamped) and scripts/restore.sh; CI test restoring into a fresh stack and comparing row counts + artefact hashes.
Context / motivation
Long experiments represent days of compute; losing them is unacceptable.
Scope
In scope
- Retention count configurable.
Implementation guidance
scripts/backup.sh [--out DIR]:pg_dump -Fcviadocker compose exec -T db, tar+zstd of the artefact root with aSHA256SUMSmanifest, timestamped folderbackup-YYYYmmddTHHMMSS; keeps the lastBACKUP_RETENTION(default 7).scripts/restore.sh <backup-dir>: refuses a non-empty target DB unless--forceis given explicitly, verifies checksums, runspg_restore --clean --if-exists --no-owner, restores artefacts, thenroboprobe db upgradeandroboprobe artifacts verify.- CI job: seed the small dataset → backup → fresh stack → restore → compare row counts per table and artefact hashes.
make backup/make restore BACKUP=…; update doc 29 §7 with the exact commands.- Standards: respect the layering contracts (doc 16 §2) and conventions in doc 34; no hard-coded tunables — thresholds/defaults come from typed settings (doc 27); no magic numbers (ruff
PLR2004); public APIs typed (mypy strict) and documented.
Configuration keys
From the configuration reference (doc 27). Keys marked (new) must be added to the typed settings models and appear in the generated reference (T-003c).
BACKUP_DIRBACKUP_RETENTION
Acceptance criteria
- Restore test green in CI.
- Restore into a non-empty DB without
--forceaborts with a clear message. - CI restore comparison green.
- Tests listed below added and green in CI; coverage of new code meets the gate in doc 18 §3.
- Docs, config reference and CHANGELOG
Unreleasedupdated where behaviour, keys or interfaces changed. - Definition of Done (doc 32 §3) satisfied.
Tests required
tests/integration/test_backup_restore.shjob.
Dependencies
Blocked by: #66 (T-013a), #27 (T-005b)
Blocks: no other task (leaf)
Parallelization notes
Files / paths owned by this task — avoid editing other paths; shared files (pyproject.toml entry points, cli/main.py, api/routers/__init__.py, router.tsx, docker/compose.yaml, ci.yml) are append-only:
scripts/backup.shscripts/restore.sh- Makefile (targets)
Independent.
Definition of Done
Per doc 32 §3 and AGENTS.md §5: lint, format, mypy strict and import-linter green; tests added and passing; docs updated; PR template completed with Closes #<this issue>; Conventional Commit messages referencing T-128 (doc 16 §6); commits authored only by the repository owner identity (AGENTS.md §4); CI green; reviewer checklist (doc 32 §5.1) satisfied.
References
Design docs: doc 29 §7 · doc 29 §8 · doc 30 §3
Requirements: NFR-REL-001 (traceability: doc 28)
External:
Metadata
Metadata
Assignees
Labels
Projects
- StatusShow more project fieldsBacklog
Activity
coreprofile: Postgres 17 with secrets, migrate placeholder, make up/down/db-up #27Add backup and restore for Postgres and artefacts (CodewithJha#283)