Skip to content

atlas: provenance registry (chunk occurrences), content-addressed extracts, multi-DB vector resolution #3125

Open

Description

@dezren39

Direction (Drew, 2026-10-31)

Atlas moves from a single canonical DB + one Turso publish to provenance-first, scalable infrastructure. Design doc: hatch-personal workspace/turso-atlas/docs/atlas-provenance-and-scale-design-2026-10-31.md.

Rules:

  1. Keep ALL data — nothing stripped from atlas.db or publishes to save space; only byte-identical dupes are cleaned, backups kept.
  2. Backups AND plain extracts for every corpus.
  3. Every chunk records EVERY place it was found: chunk_occurrences (chunk → array of source locators with spans, observed_at). Today dedup silently drops occurrences (~127K at first ingest); 6,344 canonical sessions own zero chunks for exactly this reason and their occurrences are unrecorded.
  4. Every import is interned content-addressed (laptop extracts CAS / R2, registry maps CA hash → normal paths) or pinned as repo@commit:path. Registry also holds line numbers / dates / spans for extracts.
  5. Retrieval: vector/FTS search across multiple Turso shard DBs (collection × month) returns IDs; a catalog/registry resolves an ID to a file, a chunk, or a start–end section — including a member of a tar in R2 (sidecar index, range fetch) or a local file.

Verified state feeding this (2026-10-31): canonical 18,325 sessions / 122,124 messages / 107,639 chunks; local-only = 6,941 chunks of personal-client TEXT held back from Turso by policy (not missing embeddings); Turso atlas 1.0 GB / 100,698 chunks; laptop ~/atlas 12 GB contains NO consequential byte-identical duplicates (hash-verified) — it is distinct versions/working sets, so no cleanup windfall exists.

Phases

  1. Add chunk_occurrences + cas_registry to canonical atlas.db; ingest writes occurrences from now on (no re-embed, no republish).
  2. Laptop extracts dir + CAS; atlas-backup covers it; backfill extracts for sources still on disk.
  3. Occurrence backfill from CAS extracts; document the local-only publish predicate in the publish script.
  4. Catalog DB + shard layout at next publish growth (or full message-archive ingest); resolution as MCP tools (search → ids → resolve → fetch span).

Acceptance criteria

  • A chunk_occurrences provenance registry exists: every chunk records every source locator it was found at (with spans and observed_at), including occurrences previously dropped by dedup.
  • Backups AND plain extracts exist for every corpus; imports are interned content-addressed (CAS hash → path registry) or pinned as repo@commit:path, with line numbers / dates / spans recorded for extracts.
  • Retrieval works across multiple Turso shard DBs (collection × month): vector/FTS search returns IDs and the catalog/registry resolves an ID to a file, chunk, or start–end section (including a tar member in R2 via sidecar index + range fetch, or a local file).
  • No data is stripped to save space; only byte-identical duplicates are cleaned, with backups kept.

Activity

  1. dezren39 commented on Oct 31, 2026

    @dezren39
    MemberAuthor

    Update — privacy model changed (Drew, 2026-10-31)

    The local-only publish gate is lifted: everything in canonical publishes to Turso, including the six personal clients (6,941 chunks). Privacy moves to query-time classification filters: scheme-1.0 labels (already complete for all 18,325 sessions in classification-full-v1.json: personal 16,009 / local-only 2,226 / secret-bearing 90) ship inside the publish with a denormalized sensitivity column on chunks + sessions for pre-filtering, and Turso access stays restricted to trusted workers (per-DB tokens). secret-bearing is deny-by-default for any caller not explicitly granted that tier.

    Publish v2 build is in flight on the laptop: all 18,325 sessions / 122,124 messages / 107,639 chunks + labels + FTS + bge-small vectors for the previously held-back 6,941 chunks. It stops before the live Turso replacement, which waits on Drew's go with the v2 size + secret-bearing footprint reported. Design doc updated: hatch-personal workspace/turso-atlas/docs/atlas-provenance-and-scale-design-2026-10-31.md.

  2. added
    source/humanFiled directly by a human
    priority/highImportant and time-sensitive
    effort/lLarge: multi-day or open-ended; expect staged check-ins
    area/infraInfrastructure, deployment, and operations
    meta/enrichedIntake review done: acceptance criteria, links, and normalized labels added
    on Oct 31, 2026
  3. dezren39 commented on Oct 31, 2026

    @dezren39
    MemberAuthor

    Intake review

    Fleet monitor intake pass (2026-10-31).

    Related: design doc referenced in the body (hatch-personal workspace/turso-atlas/docs/atlas-provenance-and-scale-design-2026-10-31.md). No merged PR or commit found that implements this — verified live, not already solved.

    Notes: This is a Drew-directed design/epic, not a single fix: the five rules in the body are the spec. It arrived with no labels and no acceptance criteria; both are now set (criteria derived from the body's own rules).

    Risks: Scope is large (registry schema, CAS interning, multi-DB retrieval) — a single queue task should not try to land it whole. Backfill of ~127K dropped occurrences touches the canonical atlas data; rule 1 (keep all data, backups kept) must gate any migration.

    Suggested approach: Split into implementation phases under this issue (registry + occurrence backfill first, then CAS interning, then multi-shard retrieval), each routed as its own task; keep this issue as the tracking epic (consider meta/epic).

  4. dezren39 commented on Oct 31, 2026

    @dezren39
    MemberAuthor

    atlas-search CLI shipped (hatch-personal PR https://github.com/dezren39/hatch-personal/pull/9, merged 2026-10-31): hybrid FTS+vector search + get-chunk over the live v2 publish, turso and local backends, sensitivity ceiling default personal. Verified on both backends with programmatic asserts (gold-chunk paraphrase rank 1, filter correctness, sensitivity gate, provenance).

    Findings for the v3 (fused-rerank) publish, from building against the live DB:

    1. vector_top_k does not work on the current plain-BLOB vec table (no libsql vector index) — the CLI uses ORDER BY vector_distance_cos(vec, vector32(?)) (~4s unfiltered full scan). If v3 wants indexed search, publish the vec column with a libsql vector index (diskann) and the CLI can switch.
    2. The publish schema has NO secondary indexes: any chunk->message->session join chain costs 20-60s over Turso. The CLI works around it (denormalized chunks.sensitivity + IN-subquery, ~3-15s), but v3 should add an index on messages(session_id) and denormalize session_id onto chunks.
    3. The CLI is already stage-1-ready for fused rerank: --model/--vec-table/--embedder/--trunc configurable (Snowflake ST path with prompt_name='query' smoke-tested against vec-snowflake.db), results carry rank_sources + stage-1 scores for the future RRF rerank step.
  5. added
    task/triageQueue packet kind: verify, reproduce, and route this item
    on Nov 3, 2026
  6. developing-today commented on Nov 3, 2026

    @developing-today
    Contributor

    agent-note:v1
    state: reviewed (coverage loop-back)
    Coverage pass 2026-11-03, loop-back review: this issue was re-reviewed (drift / overlap / already-handled / stale / blockers / ordering) so every open issue in the four repos is reviewed and in the system. Verdict: still live; in the system as task 7378 (triage, queued, priority 50) in repo-health-code-pilot. Labels audited and synced. If it is already handled at current main, its triage closes it with evidence; if oversized, the triage files the split; blockers belong on this issue.
    Found via: coverage loop-back 2026-11-03

  7. 58 remaining items

  8. dezren39 commented on Nov 14, 2026

    @dezren39
    MemberAuthor

    Released to the queue under Drew's 2026-11-13 unblock-all order (main chat, 23:53 CT). Task(s) 15270 moved from blocked/parked to queued in the fleet unblock-all pass (worker main-unblock-all-2026-11-13). Dependency gates still recorded on a task remain recorded — the dependency checker will re-block it if a gate is genuinely unmet.

  9. dezren39 commented on Nov 14, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · triaged — phases tracked in hatch-personal; phase-1 PR awaiting merge

  10. dezren39 commented on Nov 14, 2026

    @dezren39
    MemberAuthor

    Agent note — task 16831 blocker re-triage: disposition already recorded by task 15270 (lane any-b)

  11. added 2 commits that reference this issue on Nov 14, 2026
  12. dezren39 commented on Nov 17, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    state: triaged (queue task 18248, openchamber scheduled lane code-f)
    Fresh check 2026-11-17: issue open, unheld, priority/high. Earlier triage (tasks 15270, 16831, 2026-11-14) recorded the phased plan, with phase 1 (chunk_occurrences) awaiting merge. No new routing is needed; this pass enqueues no follow-up.
    Found via: queue triage task 18248

  13. dezren39 commented on Nov 17, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · triaged (program tracker — phase 1 PR #29 open in hatch-personal; phases 2–4 tracked)

  14. removed their assignment
    on Nov 20, 2026
  15. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    Lane CI — phase 1 LANDED (2026-11-22). #3125 stays open; phases 2-4 remain.

    Premise check (fresh, this pass): #3125 open, unheld, no live claim. The phase-1 implementation had been sitting since 2026-11-08 in dezren39/hatch-personal#29, but that PR was unmergeable — its branch had absorbed an old origin/main merge plus weeks of autocommit divergence (GitHub: 41,843 changed files, ~5.0M additions, mergeable_state=dirty). That stale PR is why every triage since Nov 14 recorded "phase-1 PR awaiting merge" with no movement.

    What landed:

    • The two original phase-1 commits (ef92bffca, e8c1f8fd9) cherry-picked onto current hatch-personal main in a sparse laptop worktree — clean apply, diff exactly 3 files +311/-17: atlas-ingest.py (source_roots / chunk_occurrences / cas_registry + occurrence-aware ingest), tests/test_atlas_ingest.py (new, 178 lines), README.
    • New PR dezren39/hatch-personal#58, mergeable_state=clean, MERGED: merge commit c3a063e290f91a2e795b046fbe80309ffeed4fcd (2026-11-23T03:16:43Z). Verified on main: test file present (8,623 B via contents API).
    • Tests on current main: python3 -m unittest discover -s workspace/turso-atlas/tests -v — 4 passed (additive schema preserves canonical rows; duplicate chunks record distinct idempotent occurrences; repo/hash/path fields independently filterable; spans preserve old chunk boundaries).
    • fix(deps): update rust crate bacon to 2.14.0 #29 closed as superseded (explanation posted there); hatch-personal#23 (phase-1 tracker) closed as completed.

    Acceptance mapping: criterion 1's registry now exists in code (schema + occurrence-aware ingest writes occurrences from now on); the occurrence BACKFILL for previously dropped occurrences is phase 3, not yet done — the criterion is not fully met until then.

    Next concrete slice: phase 2 — laptop extracts dir + CAS, atlas-backup coverage, backfill extracts for sources still on disk.

  16. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    Lane HD — phase 2 tooling slice in PR (2026-11-23).

    Premise check (fresh, this pass): #3125 open, unheld, no live claim; phase 1 landed 2026-11-22 (Lane CI). Phase 2's tracker is dezren39/hatch-personal#24; its first slice is now open as dezren39/hatch-personal#60: scripts/atlas-extracts.py establishes the design §2 extracts-store layout (cas/<ab>/<cd>/<sha256> + manifests/<source>-<date>.json), interns source files content-addressed with the phase-2 acceptance fields in every manifest entry (source, extraction time, hash, byte count, destination), optionally registers cas_registry rows, and adds a verify subcommand that re-hashes every manifest-referenced object — the backup/restore recoverability proof, tested against a copied store and a flipped CAS byte. Suite: 26 passed (7 new).

    Remaining phase-2 slices (named on hatch-personal#24): backfill interning of the sources still on disk, and atlas-backup coverage of the extracts store. #3125 stays open.

  17. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    Lane HD — phase 2 slice 1 LANDED (2026-11-23). #3125 stays open.

    dezren39/hatch-personal#60 merged (8180fce7d7): the extracts-store tooling described in the progress note above is on hatch-personal main, verified (both files present; suite 26 passed on the merged head). Phase-2 remainder is recorded on dezren39/hatch-personal#24: (1) backfill interning of the sources still on disk, (2) atlas-backup coverage of the extracts store with verify as the leg verdict. Phases 3–4 unchanged.

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

    area/infraInfrastructure, deployment, and operationseffort/lLarge: multi-day or open-ended; expect staged check-insepic/atlasEpic: atlas - all issues of this effort carry itepic/atlas-programReprioritization program epic (2026-11-12)kind/enhancementmeta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/highImportant and time-sensitivesource/humanFiled directly by a humantask/triageQueue packet kind: verify, reproduce, and route this item

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions