ReviewOS

home-lang/home

Activate native bun upgrade self-update dispatch

#190
Closed chris opened this 9 days ago ·
9 days ago

Context

Home now mirrors the untouched cli/install/bun-upgrade.test.ts corpus at 7 passed / 0 failed / 0 unsupported / 0 TODO, including package-name rejection, help behavior, and cleanup of an existing $BUN_TMPDIR/<version> staging tree after a failed stable archive extraction.

The public CLI still needs to activate the copied native Bun self-upgrade implementation rather than treating upgrade as the package-manager update command.

Parent tracker: #66

Acceptance criteria

  • Dispatch bun upgrade to Home's copied native upgrade command.
  • Preserve bun update package dependency behavior as a distinct command.
  • Support stable/canary/profile selection and platform/architecture resolution.
  • Download, validate, stage, and atomically replace the executable with cleanup on every failure path.
  • Preserve the exact 7/7 corpus result and add native CLI integration coverage where self-replacement can be safely isolated.
  • Keep diagnostics actionable and retain the causal error chain for download, extraction, validation, and replacement failures.
9 days ago

Corpus-facing upgrade behavior landed on main in 4b1c17e.

Verified untouched cli/install/bun-upgrade.test.ts:

  • 7 passed
  • 0 failed
  • 0 unsupported
  • 0 TODO

The failed stable-extraction path now removes an existing $BUN_TMPDIR/9.9.9 staging tree and retains a versioned causal diagnostic. This issue stays open for the remaining native CLI dispatch and executable replacement work.

9 days ago

Completed on main in 485523036.

The public CLI now dispatches upgrade to Home's copied native Bun upgrader while keeping update on package dependency updates. The port restores the real upgrade_test_helpers lazy binding; preserves stable, canary, profile, platform, and architecture selection; validates release tag directory names; recreates staging with POSIX mode 0700; uses Zig 0.17 I/O with a real threaded allocator for extraction and verification subprocesses; and retains cleanup plus atomic executable replacement.

Fresh validation against pinned Bun 4982b91e3:

  • ReleaseFast build: 46/46 steps
  • Unchanged cli/install/bun-upgrade.test.ts: 7/7 tests, 16 assertions, 0 failures
  • Three invalid-argument CLI forms: exact status/stdout/stderr parity
  • upgrade --help: immediate status 0 with empty stderr in both runtimes
  • Isolated local TLS release probe: downloaded a valid archive, verified the staged executable, atomically replaced a copied Home binary, exited 0, and the replacement reported 9.9.9
  • Success timing uses the initialized native CLI context (110 ms in the acceptance probe)

No corpus assertion, workload, timeout, skip, or expected outcome was changed.

Sign in to comment on this issue.