Skip to content

design: move sheet-derived domain staging + curated rows (19 tables) from Supabase to Turso #5692

Open

Description

@dezren39

Design scope only — no data moves in this issue's first pass.

What moves

  • From: Supabase (muse-dev2) — the sheet-derived domain data, 19 tables (~97k live rows, ~56 MB):
    • Staging: sheet_rows + ingest_batches in ainventory (84,599 rows, 43.3 MB), automation, engineering, finance, home, research (staging total across domains incl. ainventory: 88,561 rows)
    • Curated: events in ainventory's sibling domains automation, engineering, finance, home, research, plus engineering.records and ideas.ideas (8,385 rows)
  • To: Turso — raw rows to the §4 staging tier (partitioned by ingest batch/work unit), curated rows to the core tier as a query/search corpus

Why

All of it is sheet-derived and rebuildable from the source sheets: raw sheet_rows are jsonb row blobs keyed by import_batch (textbook staging), and the curated events/records/ideas rows are dedupe-keyed, insert-mostly, read by scan. The domain schemas carry zero foreign keys (verified in the §9 audit) — there is no relational integrity for Postgres to protect. What stays in Postgres is only each domain's relational core where one exists (e.g. ainventory's models/measurement_events/benchmark_results core and its views stay KEEP, §9.2).

Design doc: §9 of doc/2026-11-04T21-27-34Z_design_atlas_scaler_revision/ (PR #5667, addendum PR #5689).

Risks

  • ainventory's Postgres views (v_latest_import_batch) touch staging tables — view consumers must be mapped before staging moves; the ainventory KEEP core's views over its own tables are unaffected.
  • Ingest writers are scheduled fleet jobs; cutover must be per-domain so a failure in one domain's ingest does not stall the others.
  • Dedupe semantics (dedupe_key upserts) must be preserved exactly in the Turso staging schema, or re-ingests will duplicate curated rows.

Sketch of steps

  1. Per-domain consumer/writer inventory (ingest jobs, views, report readers).
  2. Define the shared staging schema (versioned, §4.1) once for all domains: sheet_rows/ingest_batches shape + curated-row shape with dedupe_key.
  3. Pilot with the smallest domain (home: 63 live rows), then finance, research, engineering, automation, and ainventory staging last (largest).
  4. Per domain: dual-ingest → count/dedupe diff → flip readers → stop Postgres ingest. Postgres copies stay read-only for one ingest cycle before any drop decision (separate approval).

Links: design doc PR #5667 · addendum PR #5689 · tracking dezren39/hatch-personal#21

Activity

  1. added
    task/triageQueue packet kind: verify, reproduce, and route this item
    on Nov 5, 2026
  2. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    Triage outcome — task 10128 (2026-11-05, lane code-p)

    Verdict: CONFIRMED as scoped — design basis verified on current main; first pass (steps 1–2) routed as a follow-up task. No data moves in this pass.

    Fresh verification (2026-11-05): issue #5692 OPEN, labels task/triage + queue/queued only — no held / user/owned / do-not-merge / do-not-auto-edit labels, no prior comments. It is the sole tracking issue for this migration: searches for the move return only #5692, and no PR for Turso staging exists. Nothing has started.

    Design basis checks out: design PR #5667 (Scaler-era Atlas/Turso revision) and addendum PR #5689 (§9 Supabase placement audit) are both MERGED (2026-11-05T01:52Z / 01:48Z), and §9 is present on current main 04f78696ab at doc/2026-11-04T21-27-34Z_design_atlas_scaler_revision/ — including the placement rule (§9.1) and the per-table move table (ainventory staging sheet_rows/ingest_batches 84,599 rows → Turso; the five sheet domains' staging 3,962 rows → Turso), matching this issue's numbers.

    One tension the inventory step must resolve: this issue states the domain schemas carry zero foreign keys, and §9's summary says the sheet-derived domain schemas have none — but §9's own audit totals record FKs in engineering (2) and ideas (1), the two domains whose curated tables (engineering.records, ideas.ideas) are in this move's scope. The FKs presumably sit in those domains' relational cores, not the sheet-derived tables — but step 1 must name exactly which tables they touch before the shared staging/curated schema is fixed, because a curated table carrying an FK changes its move design.

    Ordering / blockers (recorded per the issue's own sketch):

    • First pass = step 1 (per-domain consumer/writer inventory: ingest jobs, views incl. ainventory's v_latest_import_batch, report readers; plus the FK mapping above) + step 2 (one shared versioned staging schema per §4.1, dedupe_key upsert semantics preserved exactly). Design deliverables only.
    • Pilot order stands: home (63 rows) → finance → research → engineering → automation → ainventory staging last.
    • The eventual Postgres drop decision is a separate approval (the issue states Postgres copies stay read-only for one ingest cycle first) — nothing in the follow-up task authorizes data moves or drops.

    Routing: follow-up task enqueued for steps 1–2 as a design deliverable (inventory + shared staging schema note). Per-domain pilots are separate later tasks, spawned from that note.

    agent-note:v1
    {"kind": "triage", "task": 10128, "issue": 5692, "state": "done", "outcome": "confirmed_scoped_first_pass_routed", "evidence": "PR #5667/#5689 MERGED; section 9 on main 04f7869; sole tracking issue; FK tension in engineering/ideas flagged for step 1"}

  3. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed on Nov 5, 2026
  4. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

  5. added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    and removed
    queue/claimedQueue worker lifecycle state
    on Nov 5, 2026
  6. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

  7. 264 remaining items

  8. dezren39 commented on Nov 14, 2026

    @dezren39
    MemberAuthor

    Agent note — fallback triage of #5692 (lane any-b, queue backend down)

  9. dezren39 commented on Nov 14, 2026

    @dezren39
    MemberAuthor

    Progress from repo-worker-any-b: triaged (concurrence with tasks 15206/any-o): design discharged, remainder tracked by #6581 Wave 1; releasing free

  10. dezren39 commented on Nov 14, 2026

    @dezren39
    MemberAuthor

    Released by repo-worker-any-b (outcome: free). Triaged 2026-11-14 (concurring with today's task 15206 verdict): #5692 design discharged (PRs #5667/#5689 merged; Wave 1 shadow copy at exact parity per #6581). Remainder is Wave 1's per-table parity/cutover record + consumer cutover under #6581/task 14736; #5692 closes on that record.

  11. added and removed
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 14, 2026
  12. dezren39 commented on Nov 14, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · triaged — follow-on duplicate; design discharged, remainder under #6581 Wave 1

  13. dezren39 commented on Nov 17, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · triaged — design discharged (standing verdict); execution vehicle blocked, one dependency now cleared

    Finding: the standing disposition from 2026-11-14 (tasks 15206/16836, lanes any-b/any-o/code-b concurring) is unchanged: this issue's design is discharged — PRs #5667/#5689 merged, the Wave 1 shadow copy at exact parity per #6581 — and the remainder (Wave 1 per-table parity/cutover record plus consumer cutover) is owned by execution issue #6581 / task 14736. No duplicate design or migration work belongs here.

    Fresh state of the execution vehicle (2026-11-17): #6581 is OPEN but labelled status/blocked / queue/blocked: task 14736 was dep-blocked on #5692 and #5691 (broker-tracked, per its 2026-11-11 note). One of those two dependencies cleared on 2026-11-16 — #5691 closes under the answered ledger decision runtime-db-export-5691-recreate-or-retire (gate update from task 16843). The remaining dep is this issue's own open state, while this issue's recorded closure condition is #6581's cutover record — an apparent cycle. The recorded Nov 14 disposition was to close #5692 on that record, so this triage does not overturn it; but if the broker dep is literal, closing #5692 as design-discharged is the move that releases Wave 1 execution, and that call belongs to the migration owner/Drew. Flagging it here so it is a decision, not a discovery made later.

    Task 18346 completes as triaged.

  14. dezren39 commented on Nov 17, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · blocked (dependency) — design discharged; remainder is #6581 Wave 1, and the #5692 ↔ task 14736 dep cycle is now ledgered for Drew

    • Agent: repo-worker-code
    • Session / ID: queue task 19880 · lane code-e
    • Found via: repo-health-code-pilot atomic claim (small_fix packet; triage follow-on of task 18346)

    Fresh verification (2026-11-17, this run, before this note): issue #5692 OPEN, labels task/triage + kind/design + design/supabase-turso-migration + epic/turso-cloudflare, no hard-stop labels (held / user/owned / do-not-merge / do-not-auto-edit absent). Design PRs #5667 and #5689 both MERGED (2026-11-05). Issue #5691 CLOSED (COMPLETED). Issue #6581 OPEN, status/blocked + queue/blocked, priority/high.

    Verdict (concurring with tasks 15206 / 16836 / 18346): this issue's design scope is discharged — the merged design (§9 of the atlas scaler revision + addendum) is the deliverable, and the Wave 1 shadow copy sits at exact parity per #6581. No duplicate design or migration work is started here. The remainder — Wave 1 per-table parity/cutover record plus consumer cutover — is owned by execution issue #6581 / task 14736, and #5692's recorded closure condition is that cutover record.

    The cycle, made a delivered decision: task 14736 is dep-blocked on issue #5692 closing, while #5692's closure condition is #6581's cutover record — the cycle task 18346 flagged on 2026-11-17 but never ledgered. This run ledgers it: pending-questions item wave1-5692-6581-cycle-2026-11-17 asks Drew to pick (a) close #5692 now as design-discharged, releasing Wave 1, (b) keep #5692 open and lift task 14736's dep on it, or (c) leave both until task 14736's dep TTL expires and it re-enters the pool.

    Terminal for this task: task 19880 is dep-blocked on issue #6581 (broker-tracked, §5b) — it returns to the pool when #6581 closes, at which point the claiming lane verifies the cutover record and closes #5692. No new follow-on packet is enqueued (task 14736 already exists).

  15. added
    queue/blockedQueue or user escalation state
    status/blockedQueue or user escalation state
    work/assignedQueue worker lifecycle state
    and removed on Nov 17, 2026
  16. removed their assignment
    on Nov 20, 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

    design/supabase-turso-migrationDesign: supabase-turso-migration - all issues of this effort carry itepic/turso-cloudflareEpic: epic/turso-cloudflare (fleet reprioritization 2026-11-12)kind/designA design proposal (design-architect): multi-step, phased, decision-bearingqueue/blockedQueue or user escalation statestatus/blockedQueue or user escalation statetask/triageQueue packet kind: verify, reproduce, and route this itemwork/assignedQueue worker lifecycle state

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions