Snapshot apply handshake

Snapshot apply handshake A sequence diagram generated by Archify. make snapshot-restore locate dirs + _schema DDL sqlite/ + duckdb/ + DDL restore_sqlite_from_parquet builds research.db.restore-tmp; overwrite refused without --force (snapshot_db.py:1034) apply DDL · load *.parquet rows rebuild note_search from shadow index rebuilt FK check ✓ · atomic replace PRAGMA foreign_key_check hard-fails the restore (snapshot_db.py:976) restore_duckdb_from_parquet ordered DDL + views · read_parquet CHECKPOINT ✓ · atomic replace ✓ live DBs rebuilt make snapshot-check verify_parquet_snapshot row counts + schema match Guard + locate SQLite restore DuckDB restore Verify round-trip Operator · human · make · Sequence participant Operator human · make snapshot_db.py · --restore --force · Sequence participant snapshot_db.py --restore --force snapshots/ · git-tracked · zstd · Sequence participant snapshots/ git-tracked · zstd research.db · tmp build → atomic swap · Sequence participant research.db tmp build → atomic swap note_search FTS5 · vault-notes index · Sequence participant note_search FTS5 vault-notes index graph cache · views + analytics · Sequence participant graph cache views + analytics Legend request return security default message

Apply order

  • • Guard first: --restore refuses to clobber live DBs without --force
  • • SQLite tmp-build: DDL → parquet rows → FTS5 rebuild → FK check → atomic replace
  • • DuckDB: creation-ordered DDL + views, read_parquet bulk load, CHECKPOINT

Trust + bounds

  • • Vault notes are never mutated — only the note_search index is rebuilt from the exported shadow
  • • foreign_key_check hard-fails a bad SQLite restore (helpers/maintenance/snapshot_db.py:976)
  • • Restore: _cmd_restore :1034 · sqlite :935 · duckdb :989 · verify_parquet_snapshot :867 · Makefile snapshot-restore :128 — all pinned origin/main 56926513