State lives in PostgreSQL (DATABASE_URL=postgres://…). Treat the database and your secret store as the recovery unit. Schema and pool details: database.md.
| Target | Contents |
|---|---|
| Postgres volume / managed instance | Full database (reviews, jobs, sessions, learning, config) |
CODASAURUS_DATA_DIR / Docker /data |
Non-DB artifacts only (if any) |
| Secrets store / vault | GITHUB_APP_*, webhook secret, LLM keys, OIDC_*, admin password |
In that DB: repos, reviews, findings, dismissals, learned rules, sessions, job queue, agent_events, and dashboard config keys.
pg_dump "$DATABASE_URL" -Fc -f "codasaurus-$(date +%Y%m%d).dump"
# restore (example with Compose)
docker compose stop codasaurus
pg_restore -d "$DATABASE_URL" --clean --if-exists codasaurus-YYYYMMDD.dump
docker compose start codasaurusPostgres is the HA path: FOR UPDATE SKIP LOCKED on the job queue plus SHA leases for review ownership. Point every replica at the same DATABASE_URL.
docker compose up -dcurl -sf http://localhost:3000/health
curl -sf http://localhost:3000/metrics | head/health JSON includes status, db, data_dir, version, egress_profile (full · byok-only · offline), and network flags for LLM / registries / OSV.
Docker healthcheck runs codasaurus health --ready (liveness/readiness against the running process).
- Restore Postgres from last known-good backup.
- Restore secrets (App PEM + webhook secret must match the GitHub App).
- Confirm
PUBLIC_URL/ reverse proxy still match webhook URLs. curl /health→ open a test PR → confirm a walkthrough comment lands.