Full-snapshot bundle support (SFM side). Adds the DB-snapshot, recent-waveform,
and gated-restore endpoints Terra-View drives to pull a complete prod→dev refresh
— the seismo_relay.db plus the waveform files behind recent events — in one
pass. Pairs with Terra-View v0.17.0's "Create full snapshot (incl. SFM)"
control on Settings → Database. New logic lives in sfm/db_snapshot.py, kept
out of server.py so it's unit-testable without HTTP.
Added
GET /db/snapshot — streams a WAL-safe point-in-time copy of seismo_relay.db, taken through the SQLite online backup API (not a raw
file grab), so the download stays consistent even while the ACH server is
writing under WAL.
GET /db/waveforms/recent.zip?n=… — zips the on-disk files (event file
its .h5 / sidecar siblings) for the n most-recent events, arcname <serial>/<filename>, so a dev box can restore chart-openable events without
hauling the entire waveform store. Events with no resolvable files on disk
are skipped.
POST /db/restore — gated by SFM_DB_RESTORE_ENABLED (dormant → 404
unless explicitly enabled; dev-only). Validates the uploaded DB first, takes
a WAL-safe .pre-restore-<ts> safety backup of the current DB, then swaps in
the restored DB + waveforms. Zip entries are path-traversal-guarded before
extraction.
Fixed
Restore no longer blocks the event loop./db/restore runs its
synchronous DB/file work in a threadpool instead of async def, so a large
restore can't stall inbound ACH connections or other API requests.
## v0.22.0 — 2026-07-03
Full-snapshot bundle support (SFM side). Adds the DB-snapshot, recent-waveform,
and gated-restore endpoints Terra-View drives to pull a complete prod→dev refresh
— the `seismo_relay.db` plus the waveform files behind recent events — in one
pass. Pairs with **Terra-View v0.17.0**'s "Create full snapshot (incl. SFM)"
control on Settings → Database. New logic lives in `sfm/db_snapshot.py`, kept
out of `server.py` so it's unit-testable without HTTP.
### Added
- **`GET /db/snapshot`** — streams a WAL-safe point-in-time copy of
`seismo_relay.db`, taken through the SQLite online backup API (not a raw
file grab), so the download stays consistent even while the ACH server is
writing under WAL.
- **`GET /db/waveforms/recent.zip?n=…`** — zips the on-disk files (event file
+ its `.h5` / sidecar siblings) for the *n* most-recent events, arcname
`<serial>/<filename>`, so a dev box can restore chart-openable events without
hauling the entire waveform store. Events with no resolvable files on disk
are skipped.
- **`POST /db/restore`** — gated by `SFM_DB_RESTORE_ENABLED` (dormant → 404
unless explicitly enabled; dev-only). Validates the uploaded DB first, takes
a WAL-safe `.pre-restore-<ts>` safety backup of the current DB, then swaps in
the restored DB + waveforms. Zip entries are path-traversal-guarded before
extraction.
### Fixed
- **Restore no longer blocks the event loop.** `/db/restore` runs its
synchronous DB/file work in a threadpool instead of `async def`, so a large
restore can't stall inbound ACH connections or other API requests.
Full-snapshot bundle (SFM side): document the /db/snapshot,
/db/waveforms/recent.zip and gated /db/restore endpoints. Bump package
version 0.21.1 -> 0.22.0 (pyproject), README version badge + history, and
CHANGELOG. TOOL_VERSION (codec/output provenance) left at 0.21.1 on purpose
— the event codec is unchanged, so existing sidecars must not be flagged
stale for re-backfill.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WyT5m9xppYmoVGmCCVVV6X
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
v0.22.0 — 2026-07-03
Full-snapshot bundle support (SFM side). Adds the DB-snapshot, recent-waveform,
and gated-restore endpoints Terra-View drives to pull a complete prod→dev refresh
— the
seismo_relay.dbplus the waveform files behind recent events — in onepass. Pairs with Terra-View v0.17.0's "Create full snapshot (incl. SFM)"
control on Settings → Database. New logic lives in
sfm/db_snapshot.py, keptout of
server.pyso it's unit-testable without HTTP.Added
GET /db/snapshot— streams a WAL-safe point-in-time copy ofseismo_relay.db, taken through the SQLite online backup API (not a rawfile grab), so the download stays consistent even while the ACH server is
writing under WAL.
GET /db/waveforms/recent.zip?n=…— zips the on-disk files (event file.h5/ sidecar siblings) for the n most-recent events, arcname<serial>/<filename>, so a dev box can restore chart-openable events withouthauling the entire waveform store. Events with no resolvable files on disk
are skipped.
POST /db/restore— gated bySFM_DB_RESTORE_ENABLED(dormant → 404unless explicitly enabled; dev-only). Validates the uploaded DB first, takes
a WAL-safe
.pre-restore-<ts>safety backup of the current DB, then swaps inthe restored DB + waveforms. Zip entries are path-traversal-guarded before
extraction.
Fixed
/db/restoreruns itssynchronous DB/file work in a threadpool instead of
async def, so a largerestore can't stall inbound ACH connections or other API requests.