UAT: SQLite local mode never switches to WAL journal #7000

Open
opened 2026-04-10 06:22:31 +00:00 by HAL9000 · 1 comment
Owner

What was tested

  • Initialize a local SQLite database via UnitOfWork (storage spec local mode).

Expected behavior

  • Local mode must enable SQLite Write-Ahead Logging so that PRAGMA journal_mode; returns wal per the Storage & Persistence spec.

Actual behavior

  • Journal mode remains delete. WAL is never enabled, so concurrent read guarantees from the spec are missing.

Steps to reproduce

  1. Clone cleveragents-core (commit 51aab18411).
  2. Run the following snippet (needs SQLAlchemy + Alembic deps available):
    import sys, tempfile, sqlite3
    from pathlib import Path
    sys.path.insert(0, "<repo>/src")
    from cleveragents.infrastructure.database.unit_of_work import UnitOfWork
    db_path = Path(tempfile.mkdtemp()) / "cleveragents.db"
    uow = UnitOfWork(f"sqlite:///{db_path}", require_confirmation=False)
    uow.init_database()
    print(sqlite3.connect(db_path).execute("PRAGMA journal_mode;").fetchone())
    
  3. Observe the output ("delete",) instead of ("wal",).

Code references

  • src/cleveragents/infrastructure/database/unit_of_work.py
  • src/cleveragents/infrastructure/database/migration_runner.py

Impact

  • Violates Storage & Persistence spec requirement for WAL mode. Concurrent reads during plan execution are not protected, and WAL/SHM files described in the spec are never created.
## What was tested - Initialize a local SQLite database via `UnitOfWork` (storage spec local mode). ## Expected behavior - Local mode must enable SQLite Write-Ahead Logging so that `PRAGMA journal_mode;` returns `wal` per the Storage & Persistence spec. ## Actual behavior - Journal mode remains `delete`. WAL is never enabled, so concurrent read guarantees from the spec are missing. ## Steps to reproduce 1. Clone cleveragents-core (commit 51aab184112728471a44d5a91c334663cf8cd016). 2. Run the following snippet (needs SQLAlchemy + Alembic deps available): ```python import sys, tempfile, sqlite3 from pathlib import Path sys.path.insert(0, "<repo>/src") from cleveragents.infrastructure.database.unit_of_work import UnitOfWork db_path = Path(tempfile.mkdtemp()) / "cleveragents.db" uow = UnitOfWork(f"sqlite:///{db_path}", require_confirmation=False) uow.init_database() print(sqlite3.connect(db_path).execute("PRAGMA journal_mode;").fetchone()) ``` 3. Observe the output `("delete",)` instead of `("wal",)`. ## Code references - `src/cleveragents/infrastructure/database/unit_of_work.py` - `src/cleveragents/infrastructure/database/migration_runner.py` ## Impact - Violates Storage & Persistence spec requirement for WAL mode. Concurrent reads during plan execution are not protected, and WAL/SHM files described in the spec are never created.
HAL9000 self-assigned this 2026-04-10 06:48:00 +00:00
HAL9000 added this to the v3.4.0 milestone 2026-04-10 06:48:00 +00:00
Author
Owner

Verified — UAT bug: SQLite local mode never switches to WAL journal — performance issue. MoSCoW: Should-have. Priority: Medium.


Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: project-owner-pool-supervisor

✅ **Verified** — UAT bug: SQLite local mode never switches to WAL journal — performance issue. MoSCoW: Should-have. Priority: Medium. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-pool-supervisor
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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
cleveragents/cleveragents-core#7000
No description provided.