Repository navigation
Backlog
Labels
Description
Programme tracking for the Turso-to-D1 migration audit (2026-11-23). Full audit + design record lands as a dated doc record (linked from this issue once merged). Research/design only so far — no migrations have been made.
What the audit found (measured, Turso API, current billing period)
- 50 Turso databases. Estate totals: ~65.8M rows written, ~7.47B rows read, ~10.0 GB storage this period.
- fleet-platform is 87% of all writes (57.4M rows written, 465 MB) — PM-stack/dashboard state owned end-to-end by Cloudflare Workers in pm-stack/.
- fleet-queue is 81% of all reads (6.08B) — broker/poller scanning; a query-shape problem, not a store-location problem.
- atlas is 73% of storage (7.28 GB) and is a native libSQL vector store (107,639 chunks + vec tables) across 33 sharded databases.
- The compile coordinator's tables (fleet placement: central coordinator for compile dispatch — atomic slots, true load view, global budgets, cross-seat queueing #13765: placement_owner_state / placement_claims / placement_budgets) live in the same single fleet-queue database as the rest of the broker store (not yet landed; build is queue task 21517).
Groups
- G1 MOVE-CLEAN — fleet-platform telemetry mirror & aggregates (agent_mirror_, agent_quota_records, agg_). Derived/rebuildable data, Worker-only access. Recommended first slice.
- G2 MOVE-CLEAN — fleet-platform ingest families (ainventory/automation/research/engineering/finance/home *_sheet_rows + *_events + *_sources).
- G3 MOVE-CLEAN — fleet-platform operational ledgers (alerts_, decision_set_events, ci_events, ideas_, orch_*). Completes the fleet-platform evacuation: all 57.4M writes/month off Turso.
- G4 STAY-TURSO — fleet-queue broker core (tasks, events, leases, placement_, coordinator tables, actions_exec_). Rust broker on the laptop; transactional claim path; D1 has no local/embedded access path. Separate fix filed by the audit: index/cursor the pollers (the real read win).
- G5 MOVE-WITH-BRIDGE — fleet-queue read-side mirrors (github_mirror_*, agent_events_pg_history). D1-first reads, Turso fallback, watermark sync (pattern per design(atlas): D1 tenant hot cache — admission, invalidation, Turso-hop skip #9134's D1 hot cache).
- G6 MOVE-WITH-BRIDGE (low priority) — muse-meta coord_events + small tables; coord_tasks/leases stay.
- G7 STAY-TURSO — Atlas (atlas + 32 shards). Vector search is libSQL-native; D1 has no vector index. Drew's sketch holds here: Turso remains the sharded embedding store.
- G8 MOVE-CLEAN (opportunistic) — small stores (notes-submissions, bedside-and-away, voice-line-ledger, fleet-dispatch-jobs). Exception: great-star-lord stays (standing keep + third-party app DB).
Honest constraints
- Moving G1–G3 alone does NOT permit a Turso plan downgrade: remaining reads (~6.9B, queue-dominated) exceed Developer-plan inclusion, and remaining storage (~9.5 GB) sits at its line. Downgrade needs the G4 read-shape fix too.
- D1 walls respected in the design: 10 GB per database (one D1 DB per family), single-writer sequential processing (sync writers must batch), Workers/HTTP-API access only.
- Housekeeping decision needed: 8 frozen staging/recovery copies from the 2026-11-17/18 Supabase recovery (~480 MB) should be exported to object storage and deleted — never migrated.
First slice (recommended)
G1: agent_mirror_* + agent_quota_records + agg_* from fleet-platform into one D1 database, dual-write cutover behind the pm-stack workers. Biggest write win (presumed majority of fleet-platform's 57.4M writes/month; per-table attribution is inference — the Turso API reports per-database only) at the lowest risk (derived data, rebuildable, Worker-only consumers). Side effect: fleet-mirror's duplicate copy of the same dataset can be retired after a parity check.
{
"direct_parent": null,
"links": [],
"lineage": {
"design": null,
"roadmap_item": null,
"priority": null
},
"pm_meta": 1,
"provenance": {
"queue_id": null,
"scheduled_start": null,
"picked_up_at": null,
"work_started_at": null,
"created_at": "2026-11-23T23:16:16Z",
"session_id": null,
"lane": null,
"host": "htch-runtime",
"worktree": null,
"model": null,
"lane_start_issues": [],
"workspace_ref": null,
"auth_subject": "archer",
"stamped_by": "fleet 0.1.0 (native)"
}
}
Activity
developing-today commentedon Nov 23, 2026
CODE-5080
Merge pull request #13845 from developing-today/lane/turso-d1-audit
dezren39 commentedon Nov 23, 2026
Audit record landed: PR #13845 merged — doc/2026-11-23T23-15-07Z_design_turso-d1-migration-audit/ (plus the doc/README.md index line).
Headline results:
dezren39 commentedon Nov 24, 2026
AUDIT-7 Lane 5 (DESIGN-REVIEW, #13876) — verdict on doc/2026-11-23T23-15-07Z_design_turso-d1-migration-audit: sound.
dezren39 commentedon Nov 24, 2026
Direction correction (Drew, 2026-11-23)
Recording Drew's ruling: the aim for Turso is to scale it, not to downgrade it. The audit's Scaler→Developer downgrade framing — including the "downgrade enabler" language for the slice-3 read-shape fix — is superseded.
Housekeeping decision also recorded here: export + delete of the 8 frozen 2026-11-17/18 staging/recovery copies is approved (Drew, 2026-11-23). Execution evidence will be posted on this issue.