- Hourly PASSIVE WAL checkpoint prevents unbounded WAL growth and
ensures all writes are merged into the main .db file regularly.
Previously the WAL was never checkpointed — all data was accumulating
in stories.db-wal with no protection if that file was lost.
- Daily backup using better-sqlite3 .backup() writes a safe online
snapshot to data/backups/stories-YYYY-MM-DD.db on startup and
every 24 h; keeps last 7 days, pruning older ones automatically.
- busy_timeout = 5000 so concurrent requests wait briefly rather
than failing with SQLITE_BUSY.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>