Skip to content

[codex] Add durable MEMFS snapshotting for SQLite sync#3834

Draft
ashfame wants to merge 3 commits into
trunkfrom
durable-memfs-snapshotting
Draft

[codex] Add durable MEMFS snapshotting for SQLite sync#3834
ashfame wants to merge 3 commits into
trunkfrom
durable-memfs-snapshotting

Conversation

@ashfame

@ashfame ashfame commented Jun 26, 2026

Copy link
Copy Markdown
Member

🚧 Don't review yet

Branch note

This branch has been rebuilt directly on top of trunk. It intentionally does not include the opfs_sqlite_flush_risk branch stack or the old VACUUM INTO snapshot path.

What changed

  • Added durable byte-level filesystem snapshot, diff, and restore primitives for MEMFS.
  • Added snapshot publishing helpers for OPFS and S3-compatible object storage.
  • Integrated MEMFS snapshots into OPFS SQLite flushing so .ht.sqlite plus journal/WAL sidecars can be persisted from live bytes.
  • Exposed snapshot and restore methods through PHPWorker for client-side remote publishing flows.

Why

This creates a correctness-oriented snapshot substrate for SQLite sync, including journal and WAL mode sidecar files, and gives callers a direct path to publish snapshots to S3-compatible storage without relying on OPFS as an intermediate.

Validation

  • npm exec nx test php-wasm-universal -- --runInBand
  • npm exec nx test playground-storage -- --runInBand
  • npm exec nx test php-wasm-web -- --runInBand
  • npm exec nx test playground-remote -- --runInBand
  • npm exec nx lint php-wasm-universal
  • npm exec nx lint playground-storage
  • npm exec nx lint php-wasm-web
  • npm exec nx lint playground-remote
  • npm exec nx run php-wasm-universal:typecheck
  • npm exec nx run php-wasm-web:typecheck
  • npm exec nx run playground-remote:typecheck
  • npm exec -- tsc -p packages/playground/storage/tsconfig.lib.json --noEmit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant