Skip to content

impl(backups): mesh leg — laptop-local DBs → Turso backup homes (inventory + appropriateness line) #13459

Open

Description

@dezren39

Parent: #9093 (backup mesh) · Program: #8983 · Design: doc/2026-11-23T16-34-18Z_design_backup_mesh/note.md (landed with the #9093 design PR).
House rules: any schedule this creates lands its doc/fleet-schedule-registry.md row in the same PR; secrets by name only (Bitwarden at runtime, repo-archive pattern); builds/tests run via remote dispatch, never on the laptop or sandbox.

Scope

Laptop-local databases that hold real state and are not already covered by an existing leg land in the mesh via a Turso backup home, per the design's appropriateness line (§6): a local DB qualifies when it is SQL-shaped, modest in size, and has no other off-laptop copy. Candidates to disposition by name at implementation time: the pm-aggregator's local stores not covered by dashboard-backup, local atlas working DBs not covered by atlas-backup, and any SQLite state under the fleet tools' state dirs. Explicitly NOT this leg: the OpenCode session DB (own leg, gated on research #9094) and anything already covered by repo-archive / laptop-state / dashboard / atlas backups (no double coverage).

Terms (from the design)

  • Each qualifying DB gets a Turso home (laptop-backup-<name>); a scheduled export/import replaces the home's contents wholesale, weekly, staggered with the D1 leg.
  • The inventory is the deliverable's first half: every laptop-local DB found is listed as qualifying, already-covered (naming the covering leg), or excluded-with-reason. An unlisted DB is a finding, not a silent skip.

Acceptance

  • The laptop-local DB inventory is posted on this issue with a per-DB disposition (qualifying / already-covered-by / excluded-because).
  • Each qualifying DB's Turso home exists and receives its weekly import; one import record per DB posted.
  • Restore verification: one qualifying DB restored from its Turso home to a scratch path and opened successfully (integrity check + row counts vs source manifest). Recorded on this issue.
  • Schedule registry row updated in the implementation PR.

Activity

  1. added
    kind/featureNew feature or capability request
    task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
    epic/atlas-programReprioritization program epic (2026-11-12)
    on Nov 23, 2026
  2. developing-today commented on Nov 23, 2026

    @developing-today
    Contributor
  3. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · triaged — task 21375 (lane agent-next-25-local)

    Fresh check: #13459 is open, has no hold label, and has no earlier triage verdict. The backup-mesh design is on origin/main; its §4 and §6 make the Class E inventory the first dependency. The OpenCode research gate applies to #13462, not this laptop-local DB leg.

    First implementation step: enumerate every in-scope laptop-local database and post a per-DB disposition on this issue: qualifying, already-covered-by (name the leg), or excluded-because (state the reason), applying all four §6 appropriateness criteria. Do not create Turso homes or schedules in this step.

    Packet: queue task 21383, “Step 1 of #13459: inventory laptop-local databases and apply the appropriateness line,” enqueued in repo-health-code-pilot. It carries the inventory acceptance and explicitly excludes home/schedule implementation.

    The full #13459 acceptance remains in force for subsequent work, including weekly Turso imports and restore verification from a Turso home to a scratch path with integrity and row-count checks against the source manifest.

  4. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    Step 1 inventory: laptop-local databases (task 21383, lane code-j)

    Read-only inventory against nixos/home/laptop-backups.nix. Sizes from ls -la on 2026-11-23.

    DB Size Disposition Reason
    ~/.local/state/pm-projector/projector.db 284 MB qualifies Not in any backup leg. Verify whether pm-stack-db-backup.sh dumps it before creating a home.
    ~/.opencode-mem/data/user-prompts.db 17 MB qualifies Active prompt history outside ~/.local/state/opencode, so not covered by laptop-state.
    ~/.local/state/fleet/metadata.db 0.2 MB qualifies Fleet state; no leg covers it.
    ~/.local/share/t3code/userdata/statev2.sqlite 2.2 MB qualifies App state; no leg covers it.
    ~/.local/share/ready-for-agent/ready-for-agent.db 0.3 MB qualifies Small, no leg covers it.
    ~/.local/state/mcpx/logs/index.db 47 MB excluded Log index, regenerable from logs.
    ~/.local/state/pm-aggregator/pm-metadata.sqlite 0.05 MB already-covered-by pm-dashboard-backup (verify) PM_AGG_STORE_BACKEND=turso export rides the dashboard job.
    ~/.local/share/opencode/opencode.db ~32 GB already-covered-by opencode-db-backup Excluded from this step (#13462, gated on #9094).

    Not yet dispositioned: Muse per-session cron DBs (treated as excluded unless real state; to confirm).

    Not done in this step: no Turso homes (laptop-backup-<name>), no schedules, no restore verification. Those are the next steps of this issue.

  5. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    Step 1 supplementary inventory: closing the open item + corrections (task 21383, lane oc-code-02)

    Re-ran read-only discovery over the fleet/tool state dirs on 2026-11-23. Scope: the dirs named in this issue and design §6 (~/.local/state/pm-*, ~/.local/state/fleet, ~/.local/state/mcpx, ~/.opencode-mem, ~/.local/share/t3code, ~/.local/share/ready-for-agent, ~/.openclaw, ~/atlas, ~/.local/share/opencode, ~/.local/share/claude) plus a no-DB finding under ~/tools. Sidecars (-wal/-shm/-journal), scratch (opencode/tmp/*, backup-dir copies, .bak), browser caches and desktop-app states (atuin/mcfly/kilo/lootbox/activitywatch/evolution/nautilus/fff/furtherance) are outside the fleet/tool scope and recorded here as such — not silent skips.

    Corrections to the first inventory table

    DB Change
    ~/.local/state/pm-projector/projector.db (284 MB) already-covered-by pm-dashboard-backup (was: qualifies). pm-dashboard-backup.sh carries a pmp_links-only export — the only non-rebuildable table — as a conditionally-required manifest member; the rest of the DB is a rebuildable projection, never archived. No Turso home needed.
    ~/.local/share/opencode/opencode-local.db (14 MB) already-covered-by opencode-db-backup (was: unlisted). opencode-db-backup.sh: opencode-local.db rides along when present.

    New dispositions (were unlisted or undispositioned)

    DB Size Disposition Reason
    ~/.opencode-mem/data/ai-sessions.db + user-profiles.db + metadata.db + skills.db <0.1 MB total qualifies Same app dir as user-prompts.db; tiny active companion state, no leg covers them. Step 2 decides one home vs per-DB homes.
    ~/.local/share/t3code/userdata/state.sqlite (+ server-owner.sqlite, 0 B) 0.3 MB qualifies Same app as statev2.sqlite; no leg covers it.
    ~/.openclaw/acpx/codex-home/*.sqlite (queue/logs/state/goals/memories) + agents/*/openclaw-agent.sqlite varies already-covered-by openclaw-backup The openclaw-backup dataset is all of ~/.openclaw except scratch tmp/; per-session cron DBs ride it. This closes the undispositioned item.
    ~/atlas/** staging/scratch copies various already-covered-by atlas-backup / excluded Canonical atlas.db rides atlas-backup; staging/scratch copies are regenerable.
    ~/.local/share/claude/session-index.db (598 MB) + session-names.db 598 MB excluded-because regenerable index Index over the laptop's own sessions/ dir, like the mcpx log index. Verify regenerability at implementation; if verification fails this becomes qualifying.

    Unchanged (confirmed)

    user-prompts.db, fleet/metadata.db, statev2.sqlite, ready-for-agent.db qualify; mcpx/logs/index.db excluded (regenerable); pm-metadata.sqlite already-covered by pm-dashboard-backup (verify at implementation); opencode.db already-covered by opencode-db-backup, out of this leg (#13462, gated on #9094).

    Step-1 acceptance check

    • Every in-scope laptop-local DB enumerated with exactly one disposition above (plus the first table as corrected).
    • §6 appropriateness line applied per row (SQL-shaped + modest + no off-laptop copy + wholesale-replace OK = qualifies).
    • No Turso homes, schedules, or restore runs created in this step.

    Follow-up for steps 2–5 remains #13474.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    epic/atlas-programReprioritization program epic (2026-11-12)kind/featureNew feature or capability requesttask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions