Skip to content

impl(backups): mesh leg — Turso platform DBs (fleet-queue, fleet-platform, atlas) → R2 restic deltas #13455

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

The pilot leg of the mesh: per-database restic backups of the fleet platform Turso databases — fleet-queue, fleet-platform, and the canonical atlas DB — as compressed deltas (stream-zstd) into the R2 restic repository, on the design's class-A terms. Reuses the proven export path (pkgs/cold-store-reaper/scripts/export-turso.sh, with its libsql /dump repair filter) and the repo-archive/laptop-state restic pattern (same password key, dedicated repository restic-turso-mesh in the R2 supabase-backups bucket).

Terms (from the design)

  • Cadence: weekly per DB for class A (inside the 14-day mesh cadence, doubled frequency for the platform class), staggered across the week.
  • Retention in the R2 repo: keep-daily 7 / keep-weekly 8 / keep-monthly 12 (design §5).
  • The nightly cold-store full-export leg keeps running until this leg's restore verification has passed twice; then it is the delta leg that carries these DBs (the design's replacement path for the full-export leg, per DB class).

Acceptance

  • Restic snapshots for all three DBs land in the R2 repo on the staggered weekly schedule; snapshot listing recorded on this issue.
  • Delta efficiency measured and recorded: second-cycle snapshot data-added vs full dump size, per DB.
  • Restore verification: one snapshot per DB restored to a scratch libSQL/SQLite target; row counts per table match the export manifest; the restored fleet-queue copy answers a read-only queue query. Recorded on this issue.
  • Watchdog: the leg's job is visible to the laptop-backups: durable run record for pm-dashboard-backup + a freshness watchdog that names a stopped backup (design #1024, phase 3) #1841 laptop-backups watchdog (freshness + completion evidence), or the gap is filed as its own issue.
  • Schedule registry row updated in the implementation PR.

Activity

  1. added
    kind/feature
    task/small-fix
    epic/atlas-program
    on Nov 23, 2026
  2. developing-today commented on Nov 23, 2026

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

    @dezren39
    MemberAuthor

    Triage of #13455 complete (task 21371, lane oc-code-04).

    The scope is class A: weekly staggered restic snapshots of fleet-queue, fleet-platform, and atlas into the new R2 repo restic-turso-mesh, per-DB tags, keep-daily 7 / keep-weekly 8 / keep-monthly 12, reusing the proven export-turso path and the repo-archive restic pattern. The design's acceptance remains the staggered snapshot record, delta-efficiency measurement, per-DB restore verification, watchdog visibility, and the schedule-registry row in the implementation PR.

    Verdict: live and ungated. No gate blocks the first step: the export path (export-turso.sh with the libsql repair filter), the shared restic password key, and the supabase-backups R2 bucket all exist; the #9094 research gate constrains only the class-F leg (#13462); replication into the other stores is owned separately by #13457, which consumes this leg's repo. Composes with the sibling class-B slice (task 21384, cohort planner): that slice assigns the general inventory, this leg's planner assigns the three platform DBs to staggered weekdays and defines the manifest contract.

    First implementation step: a pure, testable class-A stagger planner and export-manifest builder. It assigns the three class-A databases to distinct weekdays deterministically and builds the per-database export manifest (per-table row counts and content hashes plus dump sha256) that restore verification will check against, proven with property-based tests against fixtures. No live Turso export, R2 write, or credential access in this slice.

    Enqueued as feature-slice task 21387 in repo-health-code-pilot: class-A stagger planner and export-manifest builder. It owns the planner, the manifest builder, and targeted tests; the backup script, systemd timer, schedule-registry row, watchdog integration, and restore drills remain subsequent slices under #13455 / #13463.

    Design source: merged PR #13467 (design doc/2026-11-23T16-34-18Z_design_backup_mesh/note.md), sections 2, 3, 4, and 9. No implementation or live backup operation was performed by this triage.

  4. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    🤖 Slice 1 done — class-A stagger planner + export-manifest builder

    • Agent: fleet queue worker, lane oc-code-08 (repo-worker-code), task 21387
    • PR: feat(cold-store-reaper): class-A stagger planner and export-manifest builder (#13455 slice 1) #13476 (branch `lane-oc-code-08/13455-class-a-slice1`) — `turso-mesh-class-a.py` planner/manifest + property and CLI example tests; oracle `python3 -m pytest pkgs/cold-store-reaper/tests/test_turso_mesh_class_a.py` → 15 passed; full cold-store-reaper suite 229 OK.
    • Scope kept: no live export, no restic/R2, no credentials, no schedule — later slices.
  5. added a commit that references this issue on Nov 24, 2026
  6. dezren39 commented on Nov 24, 2026

    @dezren39
    MemberAuthor

    Triage verdict (oc-code-03, 2026-11-24): still open, partially implemented. Merged: slice 1 — class-A stagger planner and export-manifest builder (#13476), class-B cohort planner (#13505), watchdog per-leg restore-verification reporting (#13671). Not on main: the restic execution leg (R2 restic-turso-mesh repo, stream-zstd deltas per DB), delta-efficiency measurement, restore verification to a scratch libSQL target with row-count match against the manifest, and the schedule registry row. Remaining work is a scoped follow-on: slice 2 = restic backup runner for fleet-queue / fleet-platform / atlas with the registry row, slice 3 = restore verification and recorded evidence. Routing as feature-slice follow-on packets. Tracking: #14158.

  7. dezren39 commented on Nov 24, 2026

    @dezren39
    MemberAuthor

    Triage verdict (lane any-n, 2026-11-24 ~08:30Z): concur with the record above. Still open and partially implemented (slices 1 merged: #13476, #13505, #13671). The restic execution leg, delta measurement, restore verification and schedule row are not on main. Slice 2 (restic runner for fleet-queue/fleet-platform) is the routed follow-on; no duplicate packet created.

  8. dezren39 commented on Nov 24, 2026

    @dezren39
    MemberAuthor

    Triage record (task 22703, lane felix, 2026-11-24): still open — partially done. Concurs with the two 2026-11-24 triage records above; this pass re-verified against current main and converted the remaining work into filed slice issues.

    Done-check (evidence)

    Done and on main:

    Not done (nothing on main, no open PR):

    • No restic execution leg: no runner script, no restic-turso-mesh repo init, no systemd units, and no schedule-registry row for this leg (registry grep confirms).
    • No snapshots, so no delta-efficiency measurement and no restore verification yet.

    Remaining slices (filed this pass)

    If a queue packet for slice 2 already exists from the earlier triage routing, it should point at #14247 rather than duplicate it.

    Blockers

    No implementation or live backup operation was performed by this triage.

  9. added
    queue/claimed
    work/assigned
    on Nov 24, 2026
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-programkind/featurequeue/claimedstatus:in-reviewtask/small-fixwork/assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions