feat: add dashboard model persistence #16

Merged
vince merged 1 commit from codex/issue-4-dashboard-persistence into main 2026-06-18 18:18:03 +02:00
Owner

Summary

Add SQLite-backed persistence for validated dashboard documents with revision history, rollback, and startup seeding.

Why

Issue #4 needs a server-side storage layer so the dashboard can move from static fixtures to a persisted active model before UI rendering and agent configuration work.

Changes

  • Add Drizzle SQLite schema, config, and checked-in initial migration.
  • Add Bun SQLite connection setup using DATABASE_URL with default file:./data/dimensionlab.sqlite.
  • Add dashboard store helpers for active reads, revision reads/history, validated commits, seed-if-empty, and rollback.
  • Add model-version migration boundary for future dashboard schema upgrades.
  • Wire the SvelteKit page load through the SQLite-backed seed/read path while keeping placeholder rendering.
  • Document persistence setup, migration scripts, runtime note, and Postgres replacement boundary.

Testing

  • bun run test
  • bun run check
  • bun run build
  • bun run db:check
  • bun run db:generate
  • git diff --check
  • Smoke: DATABASE_URL=file:/tmp/dimensionlab-smoke-f4V1p4/dashboard.sqlite bun run dev -- --port 4176, then curl http://127.0.0.1:4176/ and confirmed the temp SQLite file was created.

Notes

  • Uses Drizzle with bun:sqlite because better-sqlite3 does not install cleanly in the current Bun workflow. The persistence boundary is isolated so a future Postgres driver can replace SQLite without changing model or renderer code.

Closes #4

## Summary Add SQLite-backed persistence for validated dashboard documents with revision history, rollback, and startup seeding. ## Why Issue #4 needs a server-side storage layer so the dashboard can move from static fixtures to a persisted active model before UI rendering and agent configuration work. ## Changes - Add Drizzle SQLite schema, config, and checked-in initial migration. - Add Bun SQLite connection setup using DATABASE_URL with default file:./data/dimensionlab.sqlite. - Add dashboard store helpers for active reads, revision reads/history, validated commits, seed-if-empty, and rollback. - Add model-version migration boundary for future dashboard schema upgrades. - Wire the SvelteKit page load through the SQLite-backed seed/read path while keeping placeholder rendering. - Document persistence setup, migration scripts, runtime note, and Postgres replacement boundary. ## Testing - bun run test - bun run check - bun run build - bun run db:check - bun run db:generate - git diff --check - Smoke: DATABASE_URL=file:/tmp/dimensionlab-smoke-f4V1p4/dashboard.sqlite bun run dev -- --port 4176, then curl http://127.0.0.1:4176/ and confirmed the temp SQLite file was created. ## Notes - Uses Drizzle with bun:sqlite because better-sqlite3 does not install cleanly in the current Bun workflow. The persistence boundary is isolated so a future Postgres driver can replace SQLite without changing model or renderer code. Closes #4
vince added 1 commit 2026-06-18 18:09:40 +02:00
vince force-pushed codex/issue-4-dashboard-persistence from c26ebb0f27 to d377756988 2026-06-18 18:11:15 +02:00 Compare
vince force-pushed codex/issue-4-dashboard-persistence from d377756988 to 5e42ee8869 2026-06-18 18:16:23 +02:00 Compare
vince merged commit 171cb05305 into main 2026-06-18 18:18:03 +02:00
Sign in to join this conversation.
No description provided.