packages/os/usb-installer/HANDOFF.md
Last updated: 2026-05-20
elizaOS/eliza/home/nubs/Git/iqlabs/elizaos-usb-prod-e2enubs/messylinux-cloud-e2e-hardeningorigin/develop@51196656219dce9e8e6a13216c7c0e994bd40651origin/develop: 51196656219dce9e8e6a13216c7c0e994bd406516ab4cf964ba2d3b24addc2e21e6c10938ab467ab
(final handoff-only amend may change the commit hash without changing code)packages/os/usb-installer is the desktop installer used to prepare a bootable
elizaOS USB drive from the normal desktop app stack. It is an Electrobun/Vite
microapp with a browser renderer and a local backend server. The renderer must
never open raw disks directly; all drive enumeration and destructive writes stay
behind the backend contract and future signed/elevated helpers.
packages/os/usb-installer..github/workflows/elizaos-os-release.yml.github/workflows/release-usb-installer.ymlorigin/develop listed above.src/backend/write-safety.ts shared live-write guard;WritePlan.planId and WriteRequest.expectedDrive;127.0.0.1 backend binding;ELIZAOS_USB_ENABLE_RAW_WRITE=1 live-write feature gate;src/__tests__/linux-fake-media-e2e.test.ts creates a tiny fake ISO and a
fake USB target file under /tmp;/plan and /execute with the Linux backend;planId, execute-time
revalidation, checksum validation, Linux backend write flow, real dd,
sync, SSE completion events, and final byte-for-byte/hash verification;src/__tests__/linux-virtual-block-device-e2e.test.ts is opt-in through
bun run --cwd packages/os/usb-installer test:linux-virtual-usb;sudo -n, and kernel scsi_debug;ELIZAUSBTEST and refuses to run if scsi_debug is already loaded;lsblk, the local HTTP handler, server-owned planId,
execute-time revalidation, checksum validation, Linux backend write flow,
sudo -n dd, sync, SSE completion events, and readback SHA-256
verification from the virtual block device;scsi_debug in cleanup.d3eb80c11e after the fake-media,
browser, virtual block-device, and latest-develop merge proofs:
bun install --frozen-lockfile passed with no package/lockfile changes;bun run --cwd plugins/plugin-local-inference build passed through the
current bun run build.ts path;bun run build:core passed: 38 tasks successful, including
@elizaos/plugin-local-inference;bun run --cwd packages/os/usb-installer test passed: 9 files, 76 tests,
with the opt-in virtual block-device test skipped by default;bun run --cwd packages/os/usb-installer typecheck passed;bun run --cwd packages/os/usb-installer build passed;bun run --cwd packages/os/usb-installer lint passed across src,
tests, server.ts, and config files;bun run --cwd packages/os/usb-installer test:e2e passed: 6 Playwright
tests covering desktop/mobile render and guarded wizard success flow;bun run --cwd packages/os/usb-installer test:linux-virtual-usb passed
against scsi_debug: wrote with sudo -n dd, read back, SHA-256 matched,
and module cleanup was verified;git diff --check passed.bun run verify:cloud passed;bun run test:cloud passed: 266 tests across 28 files;bun run --cwd packages/os/usb-installer test passed: 9 files, 76 tests,
with the opt-in virtual block-device test skipped by default;bun run --cwd packages/os/usb-installer typecheck passed;bun run --cwd packages/os/usb-installer lint passed;bun run --cwd packages/os/usb-installer build passed;bun run --cwd packages/os/usb-installer test:e2e passed: 6 Playwright
tests covering desktop/mobile render and guarded wizard success flow;bun run --cwd packages/os/usb-installer test:linux-virtual-usb passed
against scsi_debug, and cleanup left scsi_debug unloaded;git diff --check passed.lsblk for MOUNTPOINTS and blocks
removable media mounted as /, /boot, /boot/efi,
/run/live/medium, /run/live/persistence, or /live/medium, preventing
a live-boot USB from overwriting itself;planIds expire after five minutes by default
(ELIZAOS_USB_PLAN_TTL_MS);ELIZAOS_USB_ALLOWED_ORIGINS for explicit additions;scsi_debug virtual block-device proof when the runner
kernel provides that module./proc/self/mountinfo and resolves
/dev/* mount sources through sysfs block-device ancestry, so a current
root/live USB disk is blocked even when lsblk does not attach the system
mountpoint to the candidate disk tree;Finalize media instead of overclaiming readback
verification on platforms that currently flush/eject/finalize only;packages/;container-control-plane sidecar and a guarded in-memory sandbox provider
that only activates under NODE_ENV=test or CLOUD_E2E=1;duplex: "half";origin/develop@c73f1768b6:
bun run verify:cloud passed;bun run test:cloud passed: 266 tests across 28 files;bun run --cwd packages/os/usb-installer test passed: 9 files, 80 tests,
with the opt-in virtual block-device test skipped by default;bun run --cwd packages/os/usb-installer typecheck passed;bun run --cwd packages/os/usb-installer lint passed;bun run --cwd packages/os/usb-installer build passed;bun run --cwd packages/os/usb-installer test:e2e passed: 6 Playwright
tests;bun run --cwd packages/os/usb-installer test:linux-virtual-usb passed
with scsi_debug cleanup verified;git diff --check passed.bun run --cwd packages/cloud-shared typecheck passed;bun run --cwd packages/cloud-api typecheck passed;bun run --cwd packages/cloud-api lint passed;bun test packages/cloud-api/webhooks/bluebubbles/route.test.ts passed:
10 tests;bun run --cwd packages/cloud-services/container-control-plane typecheck
passed;bun run --cwd packages/test/cloud-e2e typecheck passed;bun run --cwd packages/cloud-shared lint passed;bun run cloud:e2e passed: 4 Playwright tests covering onboarding,
provision, deprovision, and stuck cleanup against PGlite, cloud-api,
cloud-frontend, the real control-plane sidecar, and the guarded memory
sandbox provider;bun run --cwd packages/cloud-api test -- --runInBand passed: 44 tests;bun run --cwd packages/os/usb-installer typecheck passed;bun run --cwd packages/os/usb-installer test passed: 9 files, 80 tests,
with the opt-in virtual block-device test skipped by default;bun run --cwd packages/os/usb-installer lint passed;bun run --cwd packages/os/usb-installer build passed;bun run --cwd packages/os/usb-installer test:e2e passed: 6 Playwright
tests;bun run --cwd packages/os/usb-installer test:linux-virtual-usb passed
against scsi_debug;git diff --check passed.origin/develop@f6f16699fc:
bun run --cwd packages/cloud-shared typecheck passed;bun run --cwd packages/cloud-shared lint passed;bun run --cwd packages/cloud-api typecheck passed;bun run --cwd packages/test/cloud-e2e typecheck passed;bun run cloud:e2e passed: 4 Playwright tests covering onboarding,
provision, deprovision, and stuck cleanup against PGlite, cloud-api,
cloud-frontend, the real control-plane sidecar, and the guarded memory
sandbox provider;bun run test:cloud passed: 279 tests across 30 files;bun run --cwd packages/os/usb-installer typecheck passed;bun run --cwd packages/os/usb-installer test passed: 9 files, 80 tests,
with the opt-in virtual block-device test skipped by default;bun run --cwd packages/os/usb-installer lint passed;bun run --cwd packages/os/usb-installer build passed;bun run --cwd packages/os/usb-installer test:e2e passed: 6 Playwright
tests;bun run --cwd packages/os/usb-installer test:linux-virtual-usb passed
against scsi_debug;git diff --check passed.bun run --cwd packages/os/usb-installer typecheck passed;bun run --cwd packages/os/usb-installer test passed: 9 files passed, 1
skipped, 81 tests passed, 1 skipped;bun run --cwd packages/os/usb-installer lint passed;bun run --cwd packages/os/usb-installer build passed;bun run --cwd packages/os/usb-installer test:e2e passed: 6 Playwright
tests;bun run --cwd packages/os/usb-installer test:linux-virtual-usb passed
against scsi_debug;git diff --check passed.origin/develop@5119665621:
bun install --frozen-lockfile passed;bun run --cwd packages/cloud-shared typecheck passed;bun run --cwd packages/cloud-shared lint passed;bun run --cwd packages/cloud-api typecheck passed;bun run --cwd packages/test/cloud-e2e typecheck passed;bun run test:cloud passed: 279 tests across 30 files;bun run cloud:e2e passed: 4 Playwright tests covering onboarding,
provision, deprovision, and stuck cleanup.dist/;/tmp/eliza-pr7803 temp checkout after confirming no
process referenced it;The old mental model "USB installer is dry-run only" is stale. The package has platform backend files for Linux, macOS, and Windows:
src/backend/linux-backend.tssrc/backend/macos-backend.tssrc/backend/windows-backend.tsHowever, the README and tests still mostly describe/test the dry-run backend, so the package needs hardening before we call it production-ready.
lsblk, unmount mounted partitions, pkexec/sudo/doas + dd.diskutil, /dev/rdiskN, osascript administrator prompt.\\.\PhysicalDriveN
write path.HttpUsbInstallerBackend.executeWritePlan now handles fragmented SSE chunks,
but cancel/abort support is still missing.From repo root:
bun run --cwd packages/os/usb-installer test
bun run --cwd packages/os/usb-installer typecheck
bun run --cwd packages/os/usb-installer build
bun run --cwd packages/os/usb-installer lint
bun run --cwd packages/os/usb-installer test:e2e
bun run --cwd packages/os/usb-installer test:linux-virtual-usb
Run the dev app locally:
bun run --cwd packages/os/usb-installer start
Do not claim physical USB readiness from code review alone. "Code-ready" means tests/build/docs pass and the safety model is sound. "USB-proven" means a final ISO was written to a real removable drive and boot-tested, or each platform was tested in the appropriate VM/hardware environment.