v3.25.2
ruvnet/ruflov3.25.2Jul 6, 2026by ruvnet
AI Summary
Enhances AgentDB durability with atomic writes and introduces automatic backup restoration for corrupted databases to prevent data loss.
Key Highlights
- Atomic DB writes implemented using temp → fsync → rename strategy to prevent malformed images.
- Backup auto-restore feature activates when in-place rebuild fails, restoring the newest valid snapshot.
- Fixes 'database disk image is malformed' errors caused by torn or concurrent full-image flushes.
- Includes test coverage for torn image recovery scenarios.
New Features
- Atomic DB writes
- Backup auto-restore
Full Release Notes
## ruflo 3.25.2 — AgentDB durability: atomic flushes + backup auto-restore Fixes [#2584](https://github.com/ruvnet/ruflo/issues/2584) — AgentDB (sql.js) `database disk image is malformed` under torn/concurrent full-image flushes. - **Atomic DB writes.** Every full-image flush now goes temp → `fsync` → `rename` (new `writeFileAtomic`, and `writeFileRestricted` routed through it), plus the decay-path flush and `metrics-db.mjs`. A kill/OOM mid-write or a concurrent writer can no longer leave a half-written, malformed image. - **Backup auto-restore.** On a malformed open, when the in-place rebuild can't salvage the image (the reported case where `sqlite3 .recover` recovered 0 rows), recovery now **restores the newest `integrity_check=ok` snapshot** from `.swarm/backups/` and parks the corrupt original — turning total loss into automatic recovery. (Rotating periodic backups already existed.) - **Test:** a synthesized torn image (integrity_check fails, rebuild salvages nothing) that must recover via backup-restore — 6/6 pass. Additive · fail-closed · zero-regression. `npx ruflo@latest`. 🤖 Generated with [RuFlo](https://github.com/ruvnet/ruflo)