mycobackup-restore-async-reliabilitylisted
Install: claude install-skill goondocks-co/myco
# Backup/Restore Async Architecture and Reliability
The Myco backup/restore subsystem handles SQLite dumps that can reach 800 MB+. These operations must never block the daemon's single main thread. This skill covers the full domain: restore UX design, async job execution, preview correctness, and concurrency safety.
## Prerequisites
- The daemon runs in a single-threaded event loop; any blocking call in a request handler wedges all other endpoints.
- Backup files are SQLite dump format with per-table header comments (`-- Table: X (N rows)`).
- Key files: `packages/myco/src/backup/restore-runner.ts`, `packages/myco/src/backup/restore-jobs.ts`, and the daemon HTTP handlers for `/api/restore` and `/api/restore/preview` (`packages/myco/src/daemon/api/backup.ts`).
## Procedure A: Restore UX — Modal-Based Guided Flow
**Problem shape:** Showing a long backup list (22+ items: ~14 daily + ~8 weekly) inline in Settings causes the preview to render off-screen with no visual feedback. The confirmation step is bolted on after the fact rather than built into the flow.
**Design principle:** Separate two distinct user intents with distinct UI surfaces.
| Surface | User intent | Contents |
|---|---|---|
| Settings → Backup (inline) | "Are my backups healthy?" | Last backup timestamp, total count, "Backup Now" button — **no list** |
| "Restore" button → Modal | "I need to restore" | Guided flow: (1) pick a backup, (2) preview its contents, (3) confirm and restore with progress |
**Why