focus-flow/Codex Documentation/Completed Plans/Persistence Plan 1 - SQLite Runtime Persistence
2026-07-01 19:40:56 -07:00
..
PERSISTENCE_PLAN_1_BLOCK_01_REPO_AND_SCOPE_GUARDRAILS.md feat: complete sqlite runtime persistence plan 2026-07-01 19:40:56 -07:00
PERSISTENCE_PLAN_1_BLOCK_02_SQLITE_SCHEMA_APP_RECORDS.md feat: complete sqlite runtime persistence plan 2026-07-01 19:40:56 -07:00
PERSISTENCE_PLAN_1_BLOCK_03_SQLITE_APPLICATION_UNIT_OF_WORK.md feat: complete sqlite runtime persistence plan 2026-07-01 19:40:56 -07:00
PERSISTENCE_PLAN_1_BLOCK_04_FLUTTER_RUNTIME_COMPOSITION.md feat: complete sqlite runtime persistence plan 2026-07-01 19:40:56 -07:00
PERSISTENCE_PLAN_1_BLOCK_05_RETIRE_DEMO_SEED_AND_WIRE_COMMANDS.md feat: complete sqlite runtime persistence plan 2026-07-01 19:40:56 -07:00
PERSISTENCE_PLAN_1_BLOCK_06_LIFECYCLE_VALIDATION_HANDOFF.md feat: complete sqlite runtime persistence plan 2026-07-01 19:40:56 -07:00
PERSISTENCE_PLAN_1_EXECUTION_ORDER.md feat: complete sqlite runtime persistence plan 2026-07-01 19:40:56 -07:00
PERSISTENCE_PLAN_1_SUMMARY.md feat: complete sqlite runtime persistence plan 2026-07-01 19:40:56 -07:00
README.md feat: complete sqlite runtime persistence plan 2026-07-01 19:40:56 -07:00

Persistence Plan 1 - SQLite Runtime Persistence

Status: Complete on 2026-07-02.

Start with PERSISTENCE_PLAN_1_SUMMARY.md, then execute the block files in PERSISTENCE_PLAN_1_EXECUTION_ORDER.md order.

This plan replaces the current seeded/in-memory Flutter runtime with a real SQLite-backed runtime slice. The target user-visible proof is narrow:

  1. Start the desktop app.
  2. Add/capture a task.
  3. Optionally schedule it into Today.
  4. Mark it done or not done.
  5. Close the app.
  6. Reopen the app against the same SQLite file.
  7. See the task, placement, and completion state exactly as persisted.

The plan does not redesign the UI, add sync, add week/month views, add Shield/Recovery surfaces, or move scheduling rules into Flutter widgets.

Completion Handoff

Changed:

  • Added Drift schema version 2 app-layer tables for application operations, task activities, project statistics, and notice acknowledgements.
  • Added SqliteApplicationUnitOfWork and SqliteApplicationRuntime in packages/scheduler_persistence_sqlite.
  • Switched normal Flutter startup to PersistentSchedulerComposition.
  • Kept DemoSchedulerComposition for deterministic widget and visual tests.
  • Updated boundary tests so only the persistent composition root can import the SQLite adapter and dart:io.

Now persists:

  • tasks captured through current command flows,
  • planned schedule placement,
  • completed and reopened/not-done state,
  • owner settings and default Home project bootstrap,
  • operation, activity, and project statistics records needed by current commands.

Validation recorded during implementation:

  • cd packages/scheduler_persistence_sqlite && dart analyze: passed.
  • cd packages/scheduler_persistence_sqlite && dart test: passed.
  • cd apps/focus_flow_flutter && flutter pub get: passed.
  • cd apps/focus_flow_flutter && flutter analyze: passed.
  • cd apps/focus_flow_flutter && flutter test: passed.

Not in scope:

  • full task editor,
  • visible Backlog navigation in the compact shell,
  • backup/restore UI,
  • export/import UI,
  • sync/calendar/notifications,
  • week/month views,
  • Shield/Recovery UX.