fix(update): refresh Homebrew tap before upgrade + add npm install channel (v3.2.17)#59
Merged
Conversation
…annel (v3.2.17) `onebrain update` on a Homebrew install now refreshes the onebrain-ai/onebrain tap before `brew upgrade`, so a freshly-released version applies in one command (no manual `brew update`) -- fixes the "may not have taken effect" false failure when the local formula was stale. Adds a dedicated npm channel (`npm install -g @onebrain-ai/cli@<version>`) so npm-installed binaries update without an in-place swap that would desync npm -- completing the "delegate to the package manager, swap only files we own" model across Homebrew, npm, and Direct download. - install.rs: refresh_onebrain_tap() (tap-scoped git pull, --ff-only, non-fatal) runs before brew_upgrade; new InstallChannel::Npm (detected by the @onebrain-ai node_modules scope) + npm_update via the pure npm_spec helper; corrected the inaccurate "brew upgrade refreshes the tap" doc. - mod.rs: default_install_binary dispatches the new Npm arm. - README: cross-platform "one command, same result on macOS/Linux/Windows" benefit bullet + rewritten 3-channel Self-update section + version-example bump. - +2 tests (npm classify incl. pnpm layout + unscoped-node_modules-stays-Direct negative case; npm_spec v-prefix stripping). 3-round parallel review (correctness/safety, npm-detection/design, then verify, then holistic sign-off). cargo fmt + clippy clean; 1296 workspace tests pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
onebrain updatecould fail with "Binary validation failed … the upgrade may not have taken effect" when run right after a release — becausebrew upgradedoes not fetch new formulae and the local tap was stale (it no-op'd "already installed"). Separately, an npm-installed binary fell through to the Direct (in-place swap) path, which desyncs npm's metadata.Changes
brew_upgradenow git-pulls only theonebrain-ai/onebraintap (brew --repository+git pull --ff-only --quiet, best-effort/non-fatal) beforebrew upgrade onebrain, so a freshly-published formula applies in oneonebrain update— no manualbrew update. (Also corrected an inaccurate doc that claimedbrew upgraderefreshes the tap.)InstallChannel::Npm(detected by the@onebrain-ainode_modulesscope) routes tonpm install -g @onebrain-ai/cli@<version>instead of swapping the file. Completes the "delegate to the package manager for managed installs, swap only files we own" model across Homebrew · npm · Direct download. (Bun globals canonicalize into this npm arm via theirnode_modulessymlink — documented; no silent swap.)Verification
cargo fmt+cargo clippy --workspace --all-targetsclean (0 warnings)cargo test --workspace— 1296 passed / 0 failed (+2 tests: npm classify incl. pnpm layout + unscoped-node_modules→Direct negative;npm_specv-prefix stripping)Version: patch 3.2.16 → 3.2.17 (a fix + an internal install channel — no new first-level command).
🤖 Generated with Claude Code