Skip to content

fix(install): support npm packageManager pins and compatible local npm (UPT-119) - #257

Merged
lucasbraum merged 1 commit into
mainfrom
fix/upt-119-npm-pin
Oct 19, 2026
Merged

lucasbraum merged 1 commit into
mainfrom
fix/upt-119-npm-pin

Conversation

@lucasbraum

Copy link
Copy Markdown
Collaborator

What and why

Fixes UPT-119. A repository pinning npm 10.9.0 previously stopped before installation on a machine with npm 11.21.0, even when the local npm could install its v3 lockfile unchanged.

Use the pinned npm through Corepack for frozen installs and upgrade resolution. If Corepack cannot run the pin, allow local npm 9+ with a v3 lockfile and carry the fallback note into the JSON report and review body. Frozen installs reject and restore any rewritten lockfile; upgrade installs retain the existing scope and verification guards. Other lockfile formats do not receive this fallback.

How it was verified

  • Reproduced the exact PACKAGE_MANAGER_VERSION refusal on uptide-bench/dekkerglen--CubeCobra at 486571bf with npm 11.21.0.
  • On that fork, the fixed install selected corepack npm 10.9.0 and completed with no tracked changes. With only the Corepack availability probe simulated as unavailable, real npm 11.21.0 also completed ci --ignore-scripts --no-audit --no-fund, preserving the lockfile byte-for-byte. No assisted migration or LLM run was needed for this install failure.
  • Added regression tests that failed before the fix, plus coverage for Corepack upgrade command routing, fallback reporting, unavailable pins, incompatible lockfile formats, and unchanged/rewritten package-lock and shrinkwrap files.
  • pnpm lint, pnpm typecheck, and pnpm test pass. Lint retains existing repository warnings.

Checklist

  • Tests for the change (a bug fix starts with a failing test)
  • pnpm lint && pnpm typecheck && pnpm test pass
  • README and docs updated if behavior changed
  • Changeset added if a user would notice (pnpm changeset)
  • No new dependency, or it was agreed in an issue
  • No private code, names or paths in fixtures, tests or docs
  • The rules in CONTRIBUTING.md ("Rules that do not bend") still hold

@luxor-code-review

luxor-code-review Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Review complete. No blocking issues — approved ✅; 1 nitpick below.

🧹 Nitpicks (1) — 🟢 1 low
  • 🟢 Lockfile guard masks failed-install diagnostics (versions.ts:319) — The new lockfile-unchanged check runs before the result.code check in install, so an install that fails (or times out) after rewriting the lockfile throws LOCKFILE_OUT_OF_SCOPE and result.output is discarded entirely (packages/core/src/fix/versions.ts:319).

The change introduces a pinned-npm install strategy: the manager probes Corepack for the pinned npm, falls back to the local npm when the probe fails, and verifies frozen installs leave the lockfile byte-identical with a rollback on rewrite.

Files Change
packages/core/src/fix/managers/availability.ts, manager.ts Add availability probing and fallback selection for Corepack vs local npm, including lockfileVersion detection.
packages/core/src/fix/versions.ts Implement pinned install with lockfile snapshot/restore and a frozen-install equality guard.
packages/core/src/fix/run.ts, managers/upgrade.ts Wire the new fallback path into fix runs and upgrades, including note propagation.
packages/core/src/fix/managers/npm-pin.test.ts, availability.test.ts, fix.test.ts Add tests covering the fallback decision order, lockfileVersion branches, and frozen-install verification.
README.md, .changeset/tidy-npm-pin.md Document the new pinning fallback behavior and release the change.

Reviewed commit: 4226212

@lucasbraum
lucasbraum merged commit 7b9ed7f into main Oct 19, 2026
13 checks passed
@lucasbraum
lucasbraum deleted the fix/upt-119-npm-pin branch October 19, 2026 16:20
@uptide-release uptide-release Bot mentioned this pull request Oct 19, 2026
lucasbraum pushed a commit that referenced this pull request Oct 19, 2026
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and publish to npm
yourself or [setup this action to publish
automatically](https://github.com/changesets/action#with-publishing). If
you're not ready to do a release yet, that's fine, whenever you add more
changesets to main, this PR will be updated.


# Releases
## [email protected]

### Minor Changes

- [#261](#261)
[`93f029e`](93f029e)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - Sentry 10 → 11:
report every `Sentry.init` whose data collection widens because
`dataCollection` is unset, citing the migration guide, and give the
agent the guide's exact v10 baseline. After a fix, a site counts as kept
only when every category is at least that restrictive, so a partial edit
such as a cookie deny list stays open in the PR instead of being
reported as kept. The agent now keeps privacy settings at their most
restrictive value, or leaves them as a decision, when no cited edit
exists.

- [#253](#253)
[`e48373d`](e48373d)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - Find Stripe's
clover billing-mode default change at subscription creation sites,
across the six affected APIs. Respect request API-version pins, preserve
classic billing at documented parameter paths, and report unresolved
parameters or semantics as decisions. Verify quoted sources against
full-page hashes at pack-build time without vendoring Stripe pages.
Score the dms-saas silent billing change in UpgradeBench.

### Patch Changes

- [#260](#260)
[`8ea1a87`](8ea1a87)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - A build that
fails the same way before and after the upgrade (same command, status
and output; only durations and clock times may differ) no longer fails
verification. Builds are now compared to the baseline the same way tests
are. The PR says `⚠️ build: failing at baseline, not checked`, and the
verdict reads `no new errors`, not `verification passed`. A build that
passed at baseline and fails after the upgrade still fails, and so does
one that fails differently. Without a pack, a run like this still does
not publish, because its build cannot verify the bump.

- [#259](#259)
[`0db73c8`](0db73c8)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - Let the agent add
a property the upgraded types made required to a test fixture: only to
the object the compiler's TS2739, TS2740 or TS2741 error points at, and
only with a literal value. Every other test input change is still
rejected. Each such property is listed under "Tests changed: review" in
the PR body and in report.json (file, line, property and the value the
agent chose). Name a test that asserts a dependency default the upgrade
changed (Sentry's `dataCollection` and `attachStacktrace`) under
"Decisions for you", instead of leaving it to fail unexplained.

- [#251](#251)
[`773dbbe`](773dbbe)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - Calibrate the SDK
pre-run cost estimate from recorded migrations, accounting for shared
rule knowledge instead of charging a full session allowance per site.
Keep the configured spending limit and per-call budget enforcement
unchanged.

- [#258](#258)
[`3a4898f`](3a4898f)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - Discover
independent nested projects when fixing a dependency absent from the
root project. Run installation, migration and verification in the
selected project's directory, preserving its lockfile and package
manager. When several projects declare the dependency, name their
manifests and require an explicit directory.

- [#257](#257)
[`7b9ed7f`](7b9ed7f)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - Run pinned npm
through Corepack when local npm differs. When the pin is unavailable,
allow local npm with a compatible v3 lockfile, record the fallback in
the report, and reject frozen installs that rewrite the lockfile.

Co-authored-by: uptide-release[bot] <338861287+uptide-release[bot]@users.noreply.github.com>
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