os.mjs: retry initramfs + detect pre-Phase-2 OTA mismatch
Two OTA robustness improvements for shipped os.mjs (bronze-swallow-root
and forward):
1. Retry initramfs download once on failure. Most "initramfs download
failed" reports in MongoDB are transient network hiccups — a 326 MB
fetch over flaky wifi + a strict curl --max-time gives plenty of
opportunity for a single-packet TCP reset. Second attempt almost
always succeeds.
2. Recognize the Phase-2 OTA mismatch. Pre-Phase-2 installs have a
runtime that only fetches + flashes the kernel (13 MB). When the OTA
target is a Phase-2 build, the C flash verify fails because the
expected payload includes initramfs. The old error "flash verify
failed" was accurate but unhelpful — the real fix is a USB install.
Now: if verify fails AND initramfsDownloaded=false, error becomes
"needs USB install (pre-Phase-2 OTA)" with telemetry hints
explaining the boot-USB + `w` path.
Also adds elapsed-seconds to initramfs progress telemetry — useful for
MongoDB forensic analysis of timeout-vs-flaky-network failures.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>