Problem / intent
Several providers query live Apple SQLite databases directly. A live database can have committed state split across the main DB, WAL, and SHM files, and readers currently use duplicated blocking sqlite3 subprocess paths without a shared timeout or cleanup contract.
This v2 issue introduces one privacy-safe, consistent snapshot/query utility before incremental archives or native-provider fallbacks expand.
Acceptance criteria
- Copy the source DB and any present
-wal / -shm companions into a private temporary directory before querying.
- Preserve a consistent read-only view without modifying, checkpointing, locking, or vacuuming the Apple-owned source.
- Enforce query-only/read-only behavior, a busy timeout, a bounded process/query timeout, and deterministic cleanup.
- Return structured missing-store, permission-denied, unsupported-schema, locked-store, and timeout failures.
- Migrate Messages and Safari history first; document the remaining providers to migrate.
- Add synthetic tests for WAL-backed rows, a locked/busy store, missing companion files, cleanup, schema drift, and permission failures.
- Never log or retain copied private-store contents.
Validation
swift test
bash scripts/ci/run-fast-checks.sh
Dependencies
Related
Problem / intent
Several providers query live Apple SQLite databases directly. A live database can have committed state split across the main DB, WAL, and SHM files, and readers currently use duplicated blocking
sqlite3subprocess paths without a shared timeout or cleanup contract.This v2 issue introduces one privacy-safe, consistent snapshot/query utility before incremental archives or native-provider fallbacks expand.
Acceptance criteria
-wal/-shmcompanions into a private temporary directory before querying.Validation
swift test bash scripts/ci/run-fast-checks.shDependencies
Related