Skip to content

fix(update): refresh Homebrew tap before upgrade + add npm install channel (v3.2.17)#59

Merged
kengio merged 1 commit into
mainfrom
fix-update-tap-refresh
May 29, 2026
Merged

fix(update): refresh Homebrew tap before upgrade + add npm install channel (v3.2.17)#59
kengio merged 1 commit into
mainfrom
fix-update-tap-refresh

Conversation

@kengio
Copy link
Copy Markdown
Contributor

@kengio kengio commented May 29, 2026

What

onebrain update could fail with "Binary validation failed … the upgrade may not have taken effect" when run right after a release — because brew upgrade does 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

  • Homebrew: refresh the tap before upgrading. brew_upgrade now git-pulls only the onebrain-ai/onebrain tap (brew --repository + git pull --ff-only --quiet, best-effort/non-fatal) before brew upgrade onebrain, so a freshly-published formula applies in one onebrain update — no manual brew update. (Also corrected an inaccurate doc that claimed brew upgrade refreshes the tap.)
  • New npm channel. InstallChannel::Npm (detected by the @onebrain-ai node_modules scope) routes to npm 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 their node_modules symlink — documented; no silent swap.)
  • README: cross-platform "one command, same result on macOS/Linux/Windows" benefit bullet + rewritten 3-channel Self-update section + version-example bump.

Verification

  • cargo fmt + cargo clippy --workspace --all-targets clean (0 warnings)
  • cargo test --workspace1296 passed / 0 failed (+2 tests: npm classify incl. pnpm layout + unscoped-node_modules→Direct negative; npm_spec v-prefix stripping)
  • 3-round review — R1 (correctness/safety · npm-detection/design) raised fixture/test/doc + a Bun edge → fixed; R2 verified ALL-RESOLVED (independently confirmed the Bun-canonicalize→Npm claim, so no silent swap); R3 holistic GO. Post-install version guard validates every channel.

Version: patch 3.2.16 → 3.2.17 (a fix + an internal install channel — no new first-level command).

🤖 Generated with Claude Code

…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.
@kengio kengio merged commit 702b9a6 into main May 29, 2026
6 checks passed
@kengio kengio deleted the fix-update-tap-refresh branch May 29, 2026 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant