You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The storage layer has two parallel backend paths that must stay in sync manually:
Async path: polylogue/storage/backends/async_sqlite.py, used by the facade, MCP server, and most runtime operations.
Sync path: polylogue/storage/backends/connection.py, used by CLI query paths, schema tools, validation, and the sync bridge (SyncPolylogue).
Both paths currently own similar behavior:
schema bootstrap and version checking;
connection profiling and SQLite tuning;
read/write connection policy;
schema extension application;
sqlite-vec loading.
The async path is the canonical runtime, but the sync path is also production code. Correctness changes can land in one path and lag in the other. Schema extension handling already showed this drift: one backend used shared logic while the other duplicated the decision inline.
Scope
Extract shared SQLite tuning into a single connection-profile contract that both backends consume.
Factor schema bootstrap/version/extension decisions into shared logic with backend-specific I/O adapters.
Keep sqlite-vec setup behavior consistent across sync and async paths.
Document why the sync path exists and where async remains primary.
Non-goals
Removing the sync path entirely.
Changing the public API surface.
Acceptance criteria
SQLite tuning constants are defined in one place.
Schema version checking and extension application share one decision function.
Adding a schema extension requires touching one schema/bootstrap module, not two backend implementations.
Inspect async/sync backend duplication around SQLite tuning, schema bootstrap/version checks, schema extension application, and sqlite-vec loading.
Land a scoped shared connection/profile module first so tuning constants stop drifting.
Factor schema/bootstrap decision logic only where the existing structure gives a clean seam; avoid a broad backend rewrite or sync-path removal in this slice.
Keep tests targeted to storage backend semantics, then run the full local baseline once before PR.
Activity
chore: clean mechanical mypy errors across 53 files
chore: restore mypy --strict CI gate and clean the mechanical tier (#205
Sinity commentedon Apr 22, 2026
Starting this after #196.
Tactic for the first PR:
chore: restore mypy --strict CI gate and clean the mechanical tier (#205
refactor: share sqlite backend connection semantics (#357)
chore: restore mypy --strict CI gate and clean the mechanical tier (#205
refactor: share sqlite backend connection semantics (#357)
chore: restore mypy --strict CI gate and clean the mechanical tier (#205
refactor: share sqlite backend connection semantics (#357)
chore: restore mypy --strict CI gate and clean the mechanical tier (#205
refactor: share sqlite backend connection semantics (#357)