Decisions

  • Pending: Which backup targets (GitHub, cloud storage, external drive)?
  • Pending: Backup frequency and retention policy?
  • Pending: Automated or manual trigger?

User Tasks


FR-052: Backup & Disaster Recovery

Summary

Implement a backup strategy for the Opus vault and codebase with automated off-site copies and documented recovery procedures.

Problem / Motivation

Git is version control, not backup. Current risks:

  • A misfiring hook or script could delete or corrupt vault files
  • Local disk failure loses everything not pushed to remote
  • Force-push or branch deletion could lose git history
  • The personal vault (My Life Lab) has no backup strategy either
  • No documented procedure to restore Opus to a working state on a new machine

As the system grows and automates more actions, the blast radius of mistakes increases.

Proposed Solution

Multi-layer backup: GitHub as primary remote (already partly done via FR-023), plus a secondary off-site backup for vault content. Automated daily backup script with verification.

Backup Layers

LayerWhatWhereFrequency
Git pushCode + vault (tracked files)GitHubEvery commit
Vault snapshotFull vault directory (including untracked)Cloud storage / secondary locationDaily
Config snapshot.claude/, .mcp.json, .env.exampleIncluded in gitEvery commit
Recovery docStep-by-step restore procedurevault/00_system/docs/Updated per change

Open Questions

1. Off-site Backup Target

Question: Where to store the secondary vault backup?

OptionDescription
A) Cloud storage (e.g. rclone to Backblaze/S3)Cheap, automated, off-site
B) Second GitHub repo (private)Simple but limited to tracked files
C) External drive scriptManual, not off-site

Recommendation: Option A — rclone supports many backends, can be scheduled.


Phase Overview

PhaseDescriptionStatus
Phase 1Recovery documentation + git push automation
Phase 2Automated vault backup script
Phase 3Verification and monitoring

Phase 1: Recovery Doc + Git Basics —

Goal: Document how to restore Opus from scratch; ensure git push happens reliably.

File / FeatureDetailsOwnerStatus
vault/00_system/docs/disaster-recovery.mdFull restore procedureopus
Git push verificationConfirm remote is up to date after sessionsopus
.env.exampleDocument all required env vars for new setupopus

Phase 2: Automated Backup Script —

Goal: Daily automated backup of vault to off-site storage.

File / FeatureDetailsOwnerStatus
src/backup/vault_backup.pyScript to snapshot and upload vaultopus
Backup configTarget, schedule, retention in .envopus
Cron/scheduled taskDaily triggeropus

Phase 3: Verification —

Goal: Ensure backups are valid and restorable.

File / FeatureDetailsOwnerStatus
Backup integrity checkVerify backup completeness after each runmv
Restore testPeriodic test restore to temp directorymv
AlertingNotify on backup failureopus

Test

Manual tests

TestExpectedActualLast
Restore from backup to temp dirAll files present and intactpending-
Simulate file deletion + recoveryFiles restored from backuppending-

AI-verified tests

ScenarioExpected behaviorVerification method

E2E tests

ScenarioAssertion

Integration tests

ComponentCoverage

Unit tests

ComponentTestsCoverage

History

DateEventDetails
2026-03-12CreatedIdentified as critical gap — no backup strategy exists

References

  • FR-023 (GitHub Integration) — git push is the first backup layer
  • FR-040 (VPS Deployment) — VPS needs its own backup consideration