Compare before/after counts directly (captured pre-run) instead of via the
v1→v2-only .pre-v2.bak, so the dry-run passes on an already-migrated DB (steady
state) AND on a fresh v1→v3 jump. Backup check is now conditional on an actual
version bump. Verified on the real live .10 DB: 0→3, 13/12 devices/shares + 16
chunks preserved, 3 legacy heads backfilled (snap 13→16), orphans=0.
Reusable safety gate: copies the live hub DB (all 3 WAL files — copying
only .db migrates an EMPTY db and false-passes), runs the new binary's
migration in isolation, and asserts version advanced, backup made, and
counts preserved (devices/shares/chunks equal, snapshots may grow from
backfill, no orphan heads). Live hub never touched. Re-run before every
hub upgrade; adjust the INVARIANTS block per migration. Already green on
the real .10 data: 13 dev / 12 share / 16 chunk preserved, 3 heads repaired.