GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — design: move agent mirror_* analytics (20 tables) from Supabase to Turso · Issue #5691 · developing-today/code

design: move agent mirror_* analytics (20 tables) from Supabase to Turso #5691

New issue
Copy link
New issue
Copy link
Closed
Closed
design: move agent mirror_* analytics (20 tables) from Supabase to Turso#5691
Copy link
Assignees
dezren39
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-bearingtask/triageQueue packet kind: verify, reproduce, and route this item
Milestone
Turso + Cloudflare

Description

@dezren39
dezren39
opened on Nov 4, 2026
Issue body actions

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

What moves

  • From: Supabase (muse-dev2) — 20 agent.mirror_* tables (171,236 live rows, 136.9 MB): mirror_sessions, mirror_agent_agents, mirror_scheduler_jobs, mirror_scheduler_job_runs, mirror_goals_goals, mirror_goals_updates, the token/session/run/concurrency *_daily/*_hourly aggregates, mirror_top_daily, mirror_export_state, and peers
  • To: Turso, core tier (internal sensitivity level per §4), topic = agent analytics

Why

This is the single largest block in the project and it is mirrored, derived analytics copied from Muse's local stores — rebuildable from source, aggregate-upsert shaped (e.g. mirror_token_usage_daily: 200,769 updates re-aggregating 27,191 rows in the window), with no FK or multi-writer transaction requirement. Under the §9 placement rule it never needed Postgres; it pays Postgres costs (size, vacuum, backup weight) for scan-shaped reads Turso serves natively.

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

Risks

  • Open question (§9.4 Q1): is the mirror analytics/reporting (safe to move) or a backup of record? If backup, the Turso placement must keep the §7 nightly Drive cold-store export.
  • The mirror writer (export pipeline keyed on mirror_export_state watermarks) is a single producer whose Turso write path must respect the single-writer-per-DB rule — batch by export run, per §4's aggregator pattern.
  • Aggregate tables are upsert-heavy, not append-only: the Turso design must use merge-on-export-run semantics, not naive row streaming.

Sketch of steps

  1. Confirm the mirror's purpose with Drew (§9.4 Q1) and inventory its readers (dashboards/reports).
  2. Design the Turso schema (one DB, internal tier; current-state tables + aggregate tables; export-run partitioning).
  3. Point the exporter at Turso in parallel (dual-publish), diff aggregate outputs against the Postgres mirror for several export cycles.
  4. Flip readers; stop the Postgres mirror writes; retain the Postgres copy read-only for one reporting cycle before any drop decision (separate approval). The 5 duplicate mirror_history_* tables and 3 empty mirror shells are RETIRE class (§9.2) and are handled as cleanup, not migration.

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

Activity

Next
  1. dezren39
    added a commit that references this issue on Nov 4, 2026

    docs: link the §9 migration design issues (#5690, #5691, #5692, #5693, …

    6a3b53c
  2. github-actions
    assigned
    dezren39
    on Nov 5, 2026
  3. dezren39
    added
    queue/queuedHas a queued queue task
    task/triageQueue packet kind: verify, reproduce, and route this item
    work/assignedQueue worker lifecycle state
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    and removed
    queue/queuedHas a queued queue task
    on Nov 5, 2026
  4. dezren39 commented on Nov 5, 2026

    @dezren39
    dezren39
    on Nov 5, 2026
    MemberAuthor
    More actions

    🤖 Agent note · handed off

    • Agent: queue worker (repo-worker-code), lane code-i
    • Session / ID: task 10127
    • Found via: queue claim
    • Task: triage for issue design: move agent mirror_* analytics (20 tables) from Supabase to Turso #5691 — assigned execution lane opencode; handing off to the opencode claimant, not worked directly by this lane.
    • Expectation: claimant launches the bound opencode session and drives task 10127 to a terminal state.
    • Links: issue design: move agent mirror_* analytics (20 tables) from Supabase to Turso #5691
  5. dezren39 commented on Nov 5, 2026

    @dezren39
    dezren39
    on Nov 5, 2026
    MemberAuthor
    More actions

    🤖 Agent note · handed off

    • Agent: queue worker (repo-worker-code), lane code-y
    • Session / ID: task 10127
    • Found via: queue claim
    • Task: Triage of issue design: move agent mirror_* analytics (20 tables) from Supabase to Turso #5691 (design: move agent mirror_* analytics from Supabase to Turso) was claimed by lane code-y; the execution-lane assignment routed it to the opencode lane, so it is handed off — the laptop claimant (opencode-claimant) launches the bound opencode session that drives task 10127 to its terminal state.
    • Expectation: claimant binds a session to task 10127; triage per the task packet.
    • Links: task 10127 (queue repo-health-code-pilot)
  6. developing-today commented on Nov 5, 2026

    @developing-today
    developing-todayBot
    on Nov 5, 2026 – with developing.today
    Contributor
    More actions

    🤖 Agent note · handed off

    • Agent: queue worker (repo-worker-code), lane code-o
    • Session / ID: task 10127
    • Found via: queue claim
    • Task: Triage issue design: move agent mirror_* analytics (20 tables) from Supabase to Turso #5691 (design: move agent mirror_* analytics from Supabase to Turso) — assigned to the opencode execution lane again on re-claim (previously handed off at 2026-11-05T13:06Z, claimant had not launched before the park cycled); handed off to the laptop claimant, not worked by this lane. Issue verified OPEN this shift, no hard-stop labels.
    • Expectation: claimant launches the bound opencode session for task 10127.
    • Links: n/a
  7. developing-today commented on Nov 5, 2026

    @developing-today
    developing-todayBot
    on Nov 5, 2026 – with developing.today
    Contributor
    More actions

    🤖 Agent note · handed off / parked

    • Agent: queue worker (repo-worker-code), lane code-l
    • Session / ID: queue task 10127
    • Found via: atomic queue claim (lane code-l); execution-lane assignment returned opencode, so per runbook §1b this task is handed off to the laptop opencode claimant — not worked directly by this lane.
    • Task: triage design: move agent mirror_* analytics (20 tables) from Supabase to Turso #5691 — design: move agent mirror_* analytics (20 tables) from Supabase to Turso
    • Revalidation (fresh, 2026-11-05T13:58:06Z, via developing.today GitHub App token): issue OPEN, no hard-stop labels (state/labels: OPEN task/triage,status/parked,queue/parked,work/assigned).
    • Action: task 10127 parked as handed off; the claimant launches the bound opencode session to do the work.
  8. dezren39 commented on Nov 5, 2026

    @dezren39
    dezren39
    on Nov 5, 2026
    MemberAuthor
    More actions

    🤖 Agent note · handed off

    • Agent: queue worker (repo-worker-code), lane code-n
    • Session / ID: task 10127
    • Found via: queue claim (re-claim after prior handoff park expired unbound)
    • Task: Triage design: move agent mirror_* analytics (20 tables) from Supabase to Turso #5691: move agent mirror_* analytics (20 tables) from Supabase to Turso (design) — execution lane assigned opencode; handing off to the laptop opencode claimant, which launches the bound session. Verified fresh: issue design: move agent mirror_* analytics (20 tables) from Supabase to Turso #5691 is OPEN with no hard-stop labels (no held, user/owned, do-not-merge, do-not-auto-edit).
    • Expectation: Claimant's bound opencode session triages issue design: move agent mirror_* analytics (20 tables) from Supabase to Turso #5691 at current main and records blockers/ordering or routes the fix; if unbound by park expiry, task 10127 returns to the queue.
    • Links: task 10127 (repo-health-code-pilot)
  9. dezren39 commented on Nov 5, 2026

    @dezren39
    dezren39
    on Nov 5, 2026
    MemberAuthor
    More actions

    🤖 Agent note · handed off (again)

    • Agent: queue worker (repo-worker-code), lane code-n
    • Session / ID: task 10127
    • Found via: queue claim (task 10127 returned after this shift's earlier 1200s handoff park expired; the claimant still had not bound — session_id null at lane assignment)
    • Task: Triage design: move agent mirror_* analytics (20 tables) from Supabase to Turso #5691 — execution lane assigned opencode again; re-handing off to the laptop opencode claimant with a longer 1800s park. Verified fresh: issue design: move agent mirror_* analytics (20 tables) from Supabase to Turso #5691 is OPEN with no hard-stop labels.
    • Expectation: Claimant's bound opencode session triages issue design: move agent mirror_* analytics (20 tables) from Supabase to Turso #5691 at current main; if unbound by park expiry, task 10127 returns to the queue.
    • Links: task 10127 (repo-health-code-pilot)
  10. dezren39 commented on Nov 5, 2026

    @dezren39
    dezren39
    on Nov 5, 2026
    MemberAuthor
    More actions

    🤖 Agent note · handed off

    • Agent: queue worker (repo-worker-code), lane code-s
    • Session / ID: task 10127
    • Found via: queue claim
    • Task: Triage of issue design: move agent mirror_* analytics (20 tables) from Supabase to Turso #5691 (design: move agent mirror_* analytics, 20 tables, from Supabase to Turso) — execution-lane assignment returned opencode, so this task is handed off; the laptop claimant launches the bound opencode session which drives it to its terminal state.
    • Expectation: Claimant session posts the triage findings on issue design: move agent mirror_* analytics (20 tables) from Supabase to Turso #5691 and routes any follow-up.
    • Links: task 10127 · issue design: move agent mirror_* analytics (20 tables) from Supabase to Turso #5691
  11. 160 remaining items

    Load more actions
  12. dezren39
    added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    and removed
    queue/queuedHas a queued queue task
    on Nov 14, 2026
  13. dezren39 commented on Nov 14, 2026

    @dezren39
    dezren39
    on Nov 14, 2026
    MemberAuthor
    More actions

    Agent note — task 16843 blocked as escalated-to-user (lane any-c, 2026-11-14)

    • state: blocked / escalated-to-user · task: 16843 · issue: design: move agent mirror_* analytics (20 tables) from Supabase to Turso #5691
    • Ledger: pending-decisions item runtime-db-export-5691-recreate-or-retire (the delivered ask; this note is its evidence)

    Why this lane did NOT execute the packet's head step: the packet (from task 15276's triage, 2026-11-08T08:54Z) says the exporter cron is "paused" and step 1 is to re-enable it. That premise is stale. The fleet record shows:

    • 2026-11-07 (memory/2026-11-07.md): runtime-db-export "STAYS PAUSED; unpausing remains Drew's call".
    • 2026-11-08 18:19 CST (memory/2026-11-08.md, TASK-LIST RULINGS): Drew ordered items 14–19 of the disabled-jobs list deleted — runtime-db-export among them — and the deletion was executed the same evening (cron.remove; definition archived to workspace/cron.d/_archive/[email protected]). Verified this shift: the job is absent from the live scheduler (cron.update answers "schedule does not exist"); its tools and state survive intact at ~/tools/runtime-db-export/.

    Recreating or unpausing that job from a lane would override Drew's own recorded order, so the decision comes back to Drew as the ledger item above: recreate the exporter (the archived body is byte-preserved and the repointed loader is proven), or retire #5691's remainder formally.

    Parity re-verification (this shift, read-only, 2026-11-14):

    • Postgres agent.mirror_*: 229,390 rows across 28 tables; exporter state last runs 2026-11-06 12:48–23:08Z — Postgres writes already stopped (the write-stop step of the remainder has happened in fact).
    • Turso fleet-mirror agent_mirror_*: 219,166 rows across 21 tables; export state last runs 2026-11-06 12:23Z – 2026-11-07 04:07Z — the shadow is frozen at the migration copy.
    • Per-table deltas are fully explained: Postgres ran a few more exporter cycles on 2026-11-06 evening than the Turso copy (e.g. agent_agents +1,593, token_usage_hourly +1,484, sessions +1,454), and the 7 absent Turso tables are the history/shell tables the migration deliberately did not copy (the loader creates them on first use). No unexplained divergence.
    • Readers: no live code in the repo reads the Postgres agent.mirror_* tables (only the exporter's retired *_pg loader references them) — the reader cutover is complete in effect; both mirrors have simply been frozen since 2026-11-06/07 while the runtime DB moved on.

    Net state: the migration's data plane is consistent and stopped; what is missing is not fleet work but Drew's decision on whether the runtime DB export exists at all going forward. #5691 stays open; task 16843 is blocked escalated-to-user with the ledger item as the gate, so the Wave 1 gate on task 14736 reads honestly.

  14. dezren39
    added
    user/escalatedRequires a Drew decision or access
    queue/blockedQueue or user escalation state
    status/blockedQueue or user escalation state
    and removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 14, 2026
  15. dezren39 commented on Nov 16, 2026

    @dezren39
    dezren39
    on Nov 16, 2026
    MemberAuthor
    More actions

    Agent note - done (triage disposition executed). Agent: queue worker (repo-worker-code), lane code-a. Session/ID: task 16843. Found via: queue claim. The pending decision is answered: pending-decisions ledger item runtime-db-export-5691-recreate-or-retire, answered 2026-11-15 - Retire the exporter remainder formally. Executing that disposition: (1) The mirror stays a frozen 2026-11-06/07 snapshot - Turso muse-mirror holds the 20 agent_mirror tables (219,105 rows at copy, parity verified; re-verified read-only 2026-11-14 at 219,166 rows with all deltas explained, no live code reads the Postgres mirror tables, Postgres writes already stopped since 2026-11-06). (2) The runtime-db-export job stays deleted per Drew 2026-11-08 order; it is not recreated. (3) The Postgres agent.mirror tables (28, incl. history and shells) go to the #6581 cleanup gate - noted on #6581 in this pass; they are not dropped here. (4) Q1 was decided by Drew 2026-11-06: mirror is analytics + backup-of-record, satisfied by the frozen Turso copy plus cold-store record. Design delivered (PRs #5667/#5689), migration executed to the frozen snapshot, remainder retired by decision - this issue is complete and closes. Wave 1 task 14736 remains gated on issue #5692, which is still OPEN.

  16. dezren39
    removed
    status/blockedQueue or user escalation state
    user/escalatedRequires a Drew decision or access
    queue/blockedQueue or user escalation state
    on Nov 16, 2026
  17. dezren39
    closed this as completedon Nov 16, 2026
  18. dezren39 commented on Nov 16, 2026

    @dezren39
    dezren39
    on Nov 16, 2026
    MemberAuthor
    More actions
    No description provided.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @dezren39
    dezren39

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-bearingtask/triageQueue packet kind: verify, reproduce, and route this item

Type

No type

Projects

No projects

    Milestone

    • Turso + CloudflareNo due date

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.