altimate-code
altimate-code copied to clipboard
upgrade() depends on semver — if import fails, users are permanently locked on old versions
Description
The upgrade() function in cli/upgrade.ts imports semver for version comparison. If this import fails at runtime in the compiled binary (e.g., bundling issue, missing dependency), the entire upgrade path throws an error that is silently swallowed by .catch(() => {}) in worker.ts:289.
This means users on the broken version can never auto-update or even see an upgrade notification — they're permanently locked out.
Root Cause
semveris a 14KB external package imported for a singlegte()call- The caller
worker.ts:289does.catch(() => {})— any throw is invisible - No smoke test verifies that
upgrade()can even be imported
Fix
- Replace
semverwith inlinecompareVersions()(25 lines, zero dependencies) - Replace
.catch(() => {})with error logging - Add 73 tests including module import smoke tests and parity checks