Skip to content

v2: Snapshot live SQLite stores consistently before querying #90

Description

@jmcte

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

Metadata

Metadata

Assignees

Labels

area:dataData, schema, storage, privacy, or migration surface.area:securitySecurity, auth, secret, permission, or policy surface.autonomy:review-gatedClass 2; autonomous work allowed, review/gate required.kind:featureFeature/product behavior work.lane:hermesHermes macOS/native lane.review:architectureNeeds architecture review.review:securityNeeds security review.risk:securitySecurity-sensitive change.state:needs-reviewPR needs review.

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions