df7bf2fcf8
Adds a crash-recovery preamble that restores `final` from `.old` when a prior swap was interrupted after rename(final, old) but before rename(tmp, final), and always drops stale `.old`/`.importing` orphans. Also guards the swap: if nothing new was staged into tmp (empty/missing staging) and `final` already exists, leave it untouched instead of swapping in an empty copy. This is required beyond the literal preamble because the pre-existing swap logic unconditionally replaced `final` with `tmp` regardless of whether anything was actually imported, which would otherwise destroy a just-recovered (or any existing) copy whenever staging is empty.