Repository navigation
Todo
Labels
area/infraInfrastructure, deployment, and operationsdesign/supabase-turso-migrationDesign: supabase-turso-migration - all issues of this effort carry iteffort/mMedium: expected under 1 day of workepic/turso-cloudflareEpic: epic/turso-cloudflare (fleet reprioritization 2026-11-12)kind/designA design proposal (design-architect): multi-step, phased, decision-bearingpriority/normalOrdinary priority (the default)status/blockedQueue or user escalation statetask/triageQueue packet kind: verify, reproduce, and route this item
Milestone
Description
Design scope only — no data moves in this issue's first pass.
What moves
- From: Supabase (
muse-dev2)agent.events(158,802 live rows, 65.5 MB) andagent.quota_records(8,163 live rows, 3.9 MB) - To: Turso, staging tier (per §4 of the design doc), partitioned by day/work unit
Why
Both are append-only ledgers: in the stats window since 2026-10-29, agent.events shows 159,546 inserts / 0 updates / 3 deletes and quota_records is insert-only periodic plan/quota snapshots with a jsonb payload. The Scaler-era revision (§7 Phase A, §9.2) names exactly this shape — high-write append ledgers — as Turso staging-tier natives. Neither needs cross-row transactions or FK integrity.
Design doc: §9 of doc/2026-11-04T21-27-34Z_design_atlas_scaler_revision/ (PR #5667, addendum PR #5689).
Risks
agent.eventsis the heaviest-read table in the project (54M cumulative index scans since 2026-10-29) — its consumers are NOT yet audited; a blind move breaks whatever reads it (queue observability is the suspected reader).- Writers are live fleet systems (queue-broker path); dual-write cutover must not lose or reorder events.
quota_records.payloadis jsonb — Turso side needs a JSON-column convention consistent with the staging schema versioning rule (§4.1).
Sketch of steps
- Consumer audit: enumerate every reader/writer of both tables (code search + pg_stat_statements).
- Define the staging-tier tables under the versioned staging schema; decide retention (events are a ledger — propose a rolling window with cold export).
- Dual-write from the producers, backfill, compare counts/checksums per day partition.
- Flip readers, observe one full fleet cycle, then stop the Postgres writes; keep the Postgres tables read-only for one retention window before any drop decision (separate approval).
Links: design doc PR #5667 · addendum PR #5689 · tracking dezren39/hatch-personal#21
Acceptance criteria
- A design record (on this issue or a linked doc/PR) specifies the Turso staging-tier shape for agent.events and agent.quota_records: partitioning by day/work unit, writer path, and reader migration.
- All consumers of agent.events (the heaviest-read table in the project) are inventoried in the design, with a migration or compatibility plan for each — queue observability explicitly included.
- Cutover, dual-write/verification, and rollback steps are specified; no data moves under this design issue itself.
- Follow-on implementation issues are filed and linked.
Metadata
Metadata
Assignees
Labels
area/infraInfrastructure, deployment, and operationsdesign/supabase-turso-migrationDesign: supabase-turso-migration - all issues of this effort carry iteffort/mMedium: expected under 1 day of workepic/turso-cloudflareEpic: epic/turso-cloudflare (fleet reprioritization 2026-11-12)kind/designA design proposal (design-architect): multi-step, phased, decision-bearingpriority/normalOrdinary priority (the default)status/blockedQueue or user escalation statetask/triageQueue packet kind: verify, reproduce, and route this item
Activity
docs: link the §9 migration design issues (#5690, #5691, #5692, #5693, …
dezren39 commentedon Nov 5, 2026
🤖 Agent note · handed off
dezren39 commentedon Nov 5, 2026
Task 10126 (lane code-s) claimed and assigned to the opencode execution lane. Handed off to the opencode claimant — the bound session drives this task to its terminal state. Parked by this lane per the handoff protocol.
dezren39 commentedon Nov 5, 2026
🤖 Agent note · handed off
dezren39 commentedon Nov 5, 2026
🤖 Agent note · handed off
205 remaining items
dezren39 commentedon Nov 17, 2026
🤖 Agent note · triage — already satisfied; remainder is Drew-gated
agent.eventsandagent.quota_recordsto Turso staging landed — PR fleet-queue: agent.events Turso sink verbs + health terminal counters (#5690) #6762 (agent.events Turso sink) and PR gather-quota: cut quota_records sink from Supabase to Turso (Wave 3, #5690) #6655 (quota_records Turso sink), with related merges external-comms: repoint ledger writer from Supabase PG to Turso fleet-platform #6910, github-ci Worker: webhook receiver re-home (#5693) #6921, github-ci: public broker route for the events sink (#6925) #6984 — and the 2026-11-08 triage note records that the remaining scope is gated on Postgres recovery and a Drew decision.already_done(duplicate triage); the gated remainder belongs to the Drew decision the earlier triage named, not to a new worker packet.dezren39 commentedon Nov 17, 2026
Agent note — state: triaged · task 19876, lane any-g
dezren39 commentedon Nov 24, 2026
Design deliverable for queue task 21669: nine-point agent append-stream Turso design. It records the event/quota boundaries, alternatives, migration slices, rollback and evidence gates; it authorizes no production cutover. Proposed in PR #14109, commit
472da08ec4ad6db17ae3456c1c385148e44171d3.dezren39 commentedon Nov 24, 2026
🤖 Agent note · done (second pass, remainder routed)
developing-today-fleet commentedon Nov 27, 2026
🤖 Agent note (lane code-j, 2026-11-26, triage task 25342): design and sinks landed; production decommission remains gated — no packet.
developing-today-fleet commentedon Nov 27, 2026
Triage recheck — code-f, 2026-11-27 (queue task 25740)
Sinks landed; sole remainder is PG decommission, gated — no packet. Fresh reads concur with tasks 21835 / 25342:
Remaining wave work stays under the merged-wave tracker #6581.
dezren39 commentedon Nov 29, 2026
🤖 Census note — 2026-11-29 (lane CEN-C04, full-census pass)
Verdict: blocked — design done, remainder is a Drew-gated decommission. Rechecked firsthand. Landed: agent.events sink (PR #6762), quota_records sink (PR #6655), nine-point design (PR #14109 merged 2026-11-24); doc/fleet/agent-events-turso.md on main. Sole remainder: step 4, Postgres decommission — gated per the design on a green PG window / C4 verification and then Drew's decommission decision. Not queue-actionable until that gate is taken. Blocker: Drew's step-4 decision.
Census actions: added labels
priority/normal,status/blocked.developing-today-fleet commentedon Nov 29, 2026
Census 2026-11-29 (Felix):
doc/fleet/agent-events-turso.mdon main. The body's placement argument (§9: append-only ledgers are Turso staging natives) is evidence-backed with live row counts.developing-today-fleet commentedon Nov 29, 2026
Issue census — 2026-11-29
Gaps found: no effort/* and no app//area/ label; no acceptance criteria section (the body has What moves / Why / Risks / Sketch of steps).
Strengths: the move is quantified (agent.events 158,802 rows / 65.5 MB, quota_records 8,163 rows), the append-only evidence is cited from the stats window, and the key risk is named honestly — agent.events is the heaviest-read table in the project and its consumers are not yet audited. Design source linked (§9, PR #5667 / #5689).
Actions: added labels effort/m and area/infra; appended a
## Acceptance criteriasection derived from the body's own scope (original text untouched). Priority unchanged (normal). The blocked label stands: consumer inventory is the gating work before any move.