Skip to content

Backups: twice-daily backup of HAPI state (handoff to server-setup) #7

@heavygee

Description

@heavygee

Problem

HAPI has accumulated weeks of session state (~78 sessions, the entire dogfood/peer-handoff history, operator manifest, voice config). A single bad migration or disk failure wipes all of it. Currently no backups.

Proposal

Handoff: server-setup agent at session 8b052d61 owns backup infrastructure. This issue specifies what to back up and the cadence.

What needs backing up (operator-only knowledge):

Path Purpose Frequency Sensitivity
~/.hapi/hapi.db Primary SQLite store (sessions, messages, runners, fcm_devices) twice daily high (private messages)
~/.hapi/hapi.db-wal + -shm WAL companions -- need them consistent with hapi.db high
~/.hapi/hub.env API keys (DASHSCOPE, GEMINI, ELEVENLABS, JWT secret, access token) twice daily secrets
~/.config/hapi/driver-manifest.yaml Operator soup manifest (which feature layers ship in the daily) twice daily low
~/.hapi/driver-status.json Driver-stack coordination state twice daily low
~/coding/hapi/docs/plans/*.md (untracked) Operator-local plans and peer handoffs twice daily medium
~/voice-test-output/ Voice harness artefacts (WAVs + results.json) weekly low

Method:

  • Use SQLite online backup API (.backup command or VACUUM INTO) for hapi.db -- copying the file directly while WAL is active risks corruption.
  • Encrypt hub.env at rest (it contains live API keys).
  • Backups should land somewhere off-box -- ideally the operator's Proxmox or a Tailscale-attached storage host.

Cadence: twice daily for now (06:00 and 18:00 local).

Acceptance

  • Backup runs twice daily without operator intervention
  • One verified restore drill (restore hapi.db to a scratch path, open with sqlite3, check session count matches)
  • Backup destination is off the source disk
  • Retention policy: keep 14 daily snapshots minimum
  • hub.env backups are encrypted (e.g. age, gpg, or vault)

Handoff

  • Server-setup agent: session 8b052d61
  • Operator-knowledge owner: this hub operator

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions