Repository navigation
fix(cli): gate npm release on platform package availability - #506
Merged
Merged
Conversation
Ensure npm never moves a dist-tag to a wrapper package before all platform packages and tarballs are downloadable, harden launcher libc fallback and missing/stale diagnostics, and guard CLI upgrades on target platform archive readiness. - Split npm publish into platforms and wrappers phases with packument, version metadata, and tarball HEAD HTTP 200 polling, staging wrapper tarballs for live ARM64/x64 glibc smoke installs on GitHub Actions before publishing wrappers and creating the GitHub Release. - Remove cross-libc fallback on Linux in launcher.mjs and report exact missing/stale/incomplete platform packages with reinstall guidance. - Preflight target platform metadata and tarball availability in Updater.upgrade before running package managers, and verify POSIX prefix npm installs with --version. Closes #505
This was referenced Nov 19, 2026
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.
Summary
Gate npm
latestpromotion, harden Linux libc binary selection, and preflight platform package availability during CLI updates..github/workflows/publish.yml,packages/cli/script/pack.ts,publish-order.ts,npm-availability.ts):stage-npm(--phase=platforms) prepares/verifies distributions, packs wrapper.tgzartifacts (shuvcode-wrappers), publishes only the 17 platform packages, and polls each package's install packument, version metadata, andHEADtarball URL up to 45 minutes until all return HTTP200.smoke-npmmatrix runs clean globalnpm installchecks of the staged wrapper tarballs against the public registry onubuntu-22.04-arm(Linux ARM64 glibc) andubuntu-latest(Linux x64 glibc), verifying glibc platform binary selection,--version, andserve --help.publish(--phase=wrappers --wrappers-dir=...) re-verifies all 17 platform packages, publishes the staged wrappers to${Script.channel}, waits for wrapper packuments (dist-tags[channel]), version metadata, and tarballs to return200, and retries livenpm install -g shuvcode@<channel> shuvcode-node@<channel>verification before creating the GitHub Release and notifying Discord.isNpmVersionUploadedto returnfalseonly on404(throwing on 429/5xx), cleans upmkdtempdirectories infinally, tolerates CDN"cannot publish over"retries, and rejectsv-prefixedOPENCODE_VERSIONinputs up front.packages/cli/script/launcher.mjs):ldd --version+glibcVersionRuntimefallback) and removes cross-libc fallback so missing glibc packages never spawn incompatible-muslbinaries.<pkg>@<version>andReinstall <wrapper>@<version>.packages/cli/src/services/updater.ts):Updater.upgradeverifies the target<platform>@<version>version metadata (GET 200) and tarball archive (HEAD 200, cancelling response bodies cleanly) before acquiring the upgrade lock or running any package manager (npm,pnpm,bun,yarn).npminstalls now verify<npmBin>/<pkg> --versionafter installation via the sharedcheckVersionhelper.Closes #505
No feature flag: release pipeline, updater preflight, and launcher error-handling bug fix.
Verification
packages/cli:bun test test/npm-availability.test.ts test/publish-order.test.ts test/publish-ownership.test.ts test/launcher.test.ts test/updater-install.test.ts test/upgrade.test.ts— 77 pass, 4 skip (Windows-only), 0 fail (282 assertions)packages/cli:bun test test/npm-availability.test.ts test/publish-order.test.ts test/launcher.test.ts --rerun-each 10— 230 pass, 0 failpackages/cli:bun run typecheckandbun run typecheck:tsc— passedbun run check(40/40tasks),git diff --check,prettier --checkon all 10 changed files, andactionlint/shellcheckon.github/workflows/publish.yml(0 new warnings)Visual