Keep Today and Later reads available during planning writes #699

Closed
opened 2026-08-13 02:19:43 +00:00 by timmy · 0 comments
Owner

Product problem

Today and Later are core mobile planning flows, but every nominal read repeats SQLite WAL setup, DDL, schema inspection, migration DML, and a commit. Under an unrelated writer transaction, the plain WAL snapshot remains readable while these GET paths wait and can return 503.

Evidence

  • src/today_store.py _connect() performs PRAGMA journal_mode=WAL, table/index creation, schema migration checks, backfill UPDATE, and commit on every connection.
  • src/later_store.py does the equivalent work on every connection.
  • Baseline focused suite: 19 passing tests.
  • Historical issue-title and recent-commit review found no prior work separating Today/Later initialization from read connections; #373/#375/#381 cover convergence, batching, and receipt retention instead.

Acceptance

  • Initialize/migrate each database idempotently and safely before ordinary operations.
  • Once initialized, Today and Later reads execute only SELECT work and remain available during an independent BEGIN IMMEDIATE writer.
  • Existing legacy-schema migration, bounded receipts, write semantics, and API behavior remain intact.
  • Add behavioral lock-contention and SQL-trace tests, then pass the full suite.
## Product problem Today and Later are core mobile planning flows, but every nominal read repeats SQLite WAL setup, DDL, schema inspection, migration DML, and a commit. Under an unrelated writer transaction, the plain WAL snapshot remains readable while these GET paths wait and can return 503. ## Evidence - `src/today_store.py` `_connect()` performs `PRAGMA journal_mode=WAL`, table/index creation, schema migration checks, backfill UPDATE, and commit on every connection. - `src/later_store.py` does the equivalent work on every connection. - Baseline focused suite: 19 passing tests. - Historical issue-title and recent-commit review found no prior work separating Today/Later initialization from read connections; #373/#375/#381 cover convergence, batching, and receipt retention instead. ## Acceptance - Initialize/migrate each database idempotently and safely before ordinary operations. - Once initialized, Today and Later reads execute only SELECT work and remain available during an independent `BEGIN IMMEDIATE` writer. - Existing legacy-schema migration, bounded receipts, write semantics, and API behavior remain intact. - Add behavioral lock-contention and SQL-trace tests, then pass the full suite.
timmy self-assigned this 2026-08-13 02:19:43 +00:00
timmy closed this issue 2026-08-13 02:24:46 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: stackchain/stackchain-dashboard#699
No description provided.