Skip to content

impl(backups): mesh coverage — embedding/shard stores restore without a re-embed pass #13461

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 embedding stores ride the mesh: the Atlas vector tables / shard databases (the embedding corpora under the atlas-search shard layout) are snapshotted by the same Turso→R2 restic legs as their parent databases, and — the point of this issue — a restore is proven to rebuild search without a re-embed pass. Embeddings are the most expensive data in the fleet to recompute; a backup that restores rows but loses or invalidates the embedding store fails the mesh's purpose.

Terms (from the design)

  • No separate embedding backup system: shard DBs are class-B (or class-A where the design names them) members of the rotation like any other Turso DB. This issue owns the verification that they are in fact enumerated (the rotation enumerates from turso db list, so any shard DB living outside Turso is a named exception handled here).
  • Any embedding data living outside a Turso DB (local shard files, hosted vector stores) is inventoried by name and given a leg (restic file backup into the mesh repos) or an exclusion with reason.

Acceptance

  • Inventory posted on this issue: every embedding/vector store, its home (Turso DB / local files / hosted), and its mesh coverage path.
  • Restore verification (the acceptance that matters): one corpus restored from mesh snapshots to a scratch environment; a fixed probe query set returns the same top-k results (ids + order) as against the live store, with zero re-embedding performed. Recorded on this issue.
  • Any store found uncovered gets its own follow-on issue filed from this one, linked here.

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

    Claim — lane felix, 2026-11-23: triaging this issue (read-only verification of scope state, gates, and first slice). No implementation in this pass.

  4. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    Picked up by felix — working this now. (Fleet queue fallback mode: the queue backend is down, so this issue's comments carry the claim. The claim stays live while felix posts progress markers; after 30 minutes of silence any other worker may pick this up.)

  5. added
    queue/claimed
    work/assigned
    on Nov 23, 2026
  6. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    Triage — lane felix, 2026-11-23 (read-only; verified fresh against origin/main 28d20a7 and live issue states today).

    Verdict: not done in any part; implementation-shaped and ungated for its first slice; the restore-proof leg has one soft dependency, named below. Not blocked on #9094.

    1. Already done? No.

    2. Where the embedding stores actually live (first inventory evidence, from current main):

    • The Atlas aggregator writes shards as local SQLite files: pkgs/atlas-search/crates/atlas-core/src/aggregate.rs builds shard_dir.join(format!("{shard_name}.db")) and refuses to overwrite an existing shard file. Hosted Turso shard creation is explicitly out of scope there ("later atlas staging tier: versioned schema, registry, aggregator with merge-on-close promotion into three-level core #5669 slices").
    • A hot copy is published to Turso: pkgs/atlas-search/atlas_search.py describes querying "a hot copy" published to a Turso DB (--backend turso, libSQL HTTPS pipeline). Vector search itself runs over vector tables (VectorBackend::Scan, exact vector_distance_cos by default) in crates/atlas-core/src/lib.rs.
    • So the inventory's central question is real and open: for each corpus, which copy is the restore source of truth — the local shard files (which no filed mesh leg yet covers as files) or the published Turso copy (which rides its DB's class leg)?

    3. Gates:

    4. Smallest correct first slice: the inventory (acceptance 1) — enumerate every embedding/vector store with its home (Turso DB by name / local shard files / hosted) and its mesh coverage path, and post it here. It decides which leg the restore proof depends on and whether a follow-on file-leg issue must be filed for the local shard files. Owner: the next implementation lane drawn for this issue (filed task/small-fix under the atlas program); no other issue's completion is required first.

    Resume condition for the restore-proof leg: the covering leg for the inventoried corpus's home has produced its first snapshot (#13455/#13456 for a Turso home; the file leg or its follow-on for a local-file home).

  7. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    Released by felix (outcome: free). Triaged 2026-11-23 (record comment 7107509376): nothing done yet; inventory leg unblocked today and is the smallest first slice; restore-proof leg resumes when the covering leg for the inventoried corpus's home has produced its first snapshot (#13455/#13456 for a Turso home, or the file leg/follow-on for local shard files). Not gated on #9094.

  8. added
    queue/queued
    and removed
    queue/claimed
    work/assigned
    on Nov 23, 2026
  9. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    Triage — lane oc-code-03, 2026-11-23 (confirming felix's 16:40Z triage; no state change since).

  10. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    Follow-on filed: #13824 (inventory leg — enumerate stores and mesh coverage, ungated). The restore-proof leg will be filed separately once the inventory names the corpus home.

  11. dezren39 commented on Nov 24, 2026

    @dezren39
    MemberAuthor

    Embedding / vector store inventory (from #13824)

    Inventory leg done — verified against origin/main fc438864a by code + doc evidence. Durable record: doc/backups/embedding-store-inventory.md (PR incoming from branch xaltha/13824-backup-inventory), kept honest by pkgs/cold-store-reaper/tests/test_embedding_store_inventory.py (every vec_<model>_<dims>_f32 table the code uses must stay named; every row must carry a coverage disposition).

    Store Vectors Home Mesh coverage path Status
    Canonical Turso DB atlas — vec_snowflake_m_v2_768_f32 Production vectors, 107,639 chunks at the 2026-10-31 census; Snowflake arctic-embed-m-v2.0 rev 95c27414, 768d Turso DB atlas Class A rotation leg #13455 (slice 1 PR #13476 in review). Today: cold-store-nightly → Drive + PITR 30d + Delete Protection; local source ~/atlas/turso-atlas/data/atlas.db covered daily by atlas-backup Covered by existing legs; mesh leg pending #13455
    Canonical DB — vec_bge_small_384_f32 Dormant legacy fallback, BAAI/bge-small-en-v1.5, 384d; no Rust code names it Same DB / file as above Rides the canonical row’s legs Covered (dormant)
    Scan shards atlas-core-<tier>-<topic>-<nn> — vec_snowflake_m_v2_768_f32 per shard Per-shard vectors; 29 topic shards at the 2026-10-31 census (28 internal / 1 secret / 0 public) Turso DB per shard (if ATLAS_SHARDS=turso[:org]) or local .db file (if dir:<path>) Turso-homed: class B rotation #13456 + today cold-store-nightly + PITR. Local-file: no leg — follow-on #14032 Partially covered — local-file home uncovered, follow-on #14032
    Content stores atlas-core-<tier>-content No vectors (messages/sessions for hydration only) Turso DB per tier Out of scope — no vectors; the DBs ride the class B rotation Out of scope (no vectors)
    Local side-store vector files (ATLAS_VEC_DB) Vectors joined to the local publish by content_hash Local files (path via env; not set in any shipped config) No leg today — follow-on #14032 Uncovered — follow-on #14032
    Query-embedding cache DB (ATLAS_EMBED_CACHE_TURSO_URL, table query_embedding_cache) Cached query vectors (pure function of query text + model) Turso DB, only when the env var is set; not set in any shipped config — existence unverified If present: class B rotation #13456 via enumeration — covered by design. Verify with turso db list (#14032) Covered-by-design if present; existence unverified
    In-memory query-embedding cache (~10,000 entries) Cached query vectors, ephemeral Process memory Exclusion — not durable, regenerable on miss Excluded with reason
    Worker Durable Object QueryCache entries (entry.embedding_json) Per-key query embedding + result, retained indefinitely Cloudflare Durable Object SQLite (hosted) Exclusion — regenerable cache, re-embed on miss; no export path named Excluded with reason
    D1 hot cache atlas-hot-cache No vectors (opaque cached payloads; storage layer only, not wired in) Cloudflare D1 Out of scope — no vectors; D1 itself is class D (#13458) Out of scope (no vectors)
    OpenClaw memory-lancedb store Agent-memory vectors, Qwen3-Embedding-0.6B, 1024d — incomparable with the Atlas space; Atlas re-embeds at promotion Local files under ~/.openclaw Existing leg: openclaw-backup daily tar.zst → local + R2 + Drive, 30-day retention Covered by existing leg
    Staging DBs / registry DB / gate records No vectors by design Local SQLite/libSQL files Out of scope — no vectors; working state, rebuilt from sources Out of scope (no vectors)
    Feedback JSONL + query traces (~/.local/state/atlas-search/) No vectors (votes, timings) Local files Out of scope — no vectors Out of scope (no vectors)

    Uncovered → follow-on filed

    Also checked, no vector store

    fleet-search embeds queries but stores no vectors; the embedding hits outside atlas-search are HTML/text embedding; no qdrant/pgvector/Chroma/Weaviate/Pinecone/Milvus/FAISS/sqlite-vec in the tree. The ONNX model snapshot is weights, not a store.

    This satisfies #13824’s acceptance (inventory posted here; uncovered stores have their follow-on). The restore-proof leg stays deferred per #13824 — gated on the covering leg for the inventoried corpus’s home producing its first snapshot.

  12. dezren39 commented on Nov 24, 2026

    @dezren39
    MemberAuthor

    #14032 result (lane oc-code-06, task 21637, 2026-11-24): live homes verified, exclusions recorded — no file leg warranted.

    Inventory updated in PR #14067 (stacked on #14047; closes #14032). No new schedule, so no schedule-registry row. The restore-proof leg stays gated as designed.

  13. dezren39 commented on Nov 24, 2026

    @dezren39
    MemberAuthor

    Triage — lane oc-code-08, 2026-11-24 (fresh check; task 22318).

    Verdict: still open, partially implemented; inventory leg done, restore-proof leg gated. No new implementation in this pass.

  14. dezren39 commented on Nov 24, 2026

    @dezren39
    MemberAuthor

    Follow-on filed: task 22736 (Fix #13461: embedding store restore-proof without re-embed pass) in repo-health-code-pilot — gated on the covering leg first snapshot (#13455 for atlas / #13456 for shards). Triage task 22318 complete.

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/queuedtask/small-fix

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions