Skip to content

fix(update): respect overrides during no-save updates - #15261

Merged
zkochan merged 5 commits into
pnpm:mainfrom
waltuov:fix/no-save-selector-overrides
Sep 22, 2026
Merged

zkochan merged 5 commits into
pnpm:mainfrom
waltuov:fix/no-save-selector-overrides

Conversation

@waltuov

@waltuov waltuov commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Versioned pnpm update --no-save requests now respect the override that applies to the original dependency declaration. A request excluded by the effective range is skipped; an override-owned declaration is preserved, including overrides that remove a dependency.

For the reproduction in #14923, an override pins semver to 7.5.0, but requesting 7.6.0 produced a lockfile with specifier 7.5.0 and version 7.6.0. This change keeps both at 7.5.0, and the subsequent frozen install succeeds.

Closes #14923.

Two existing validation issues are also corrected: a public rustdoc link to a private filesystem helper, and engine-check fixtures that probed Node with a different working directory or shim configuration than the command under test. They blocked the required documentation and coverage checks respectively.

Validation

  • GitHub's Rust test jobs pass on Linux, macOS and Windows. The coverage run passes all 12,356 tests, including the corrected engine fixture; Dylint also passes in CI.
  • Reproduced the reported failure with released pnpm 12.5.1 on Windows. The same example passes with pnpm 11.27.0 and with the patched binary.
  • Four regression assertions fail against the original production code and pass with the fix; the accompanying control test passes in both runs.
  • Final update-area run: 182 tests passed (pnpm test:rust -p pnpm-cli -p pnpm-package-manager -E 'test(update::)').
  • Engine-check fixture run: all 8 install_root_engine tests passed.
  • Workspace Rust check and Clippy, pinned Rust formatting, all-features rustdoc, spelling, TypeScript compilation and lint pass. Dylint was not run locally (tool not installed).
  • Full affected-crate run: 4,653 passed, 10 failed, 26 skipped. Four failures were missing echo/true executables in the local test PATH and pass after correcting it. The remaining six also fail with the original production files restored: five symlink-related tests on this non-elevated Windows environment and the concurrent global-store junction test. No tests were disabled or changed to tolerate these failures.

Squash Commit Body

Determine override ownership and effective dependency specifiers before
planning a no-save update, using the existing override parser and
VersionsOverrider. Keep the original declaration unchanged so a
range-scoped override remains applicable during resolution.

Reject concrete versions excluded by the effective range, keep removed
dependencies out of the update, and avoid recording preferred-version
seeds for skipped requests. Other override-owned requests retain the
override's specifier, matching the current v11 read-only handling.

Add CLI regressions for pinned and removal overrides, and unit coverage
for preserved declarations and empty seeds after a skipped request.

Make the engine-check fixtures probe Node with the same working directory
and shim configuration as the command under test.

Closes pnpm/pnpm#14923.

Checklist

  • I checked the referenced issue and verified that none of the PRs already linked to it solves it.
  • New features are implemented only in the Rust pnpm v12 CLI. Bug fixes are implemented in every affected version.
  • Added a changeset for the published pacquet package.
  • Added or updated tests.

Written by an agent (Codex, GPT-6 Astra).

Summary by CodeRabbit

  • Bug Fixes

    • Fixed pnpm update --no-save to respect version-scoped overrides in dependency selectors.
    • Prevented updates from bypassing effective override ranges or restoring dependencies removed by overrides.
    • Kept manifests and lockfiles unchanged when requested updates conflict with configured overrides.
    • Preserved compatibility with subsequent pnpm install --frozen-lockfile operations.
  • Tests

    • Added coverage for overridden, removed, and incompatible dependencies during no-save updates.

@coderabbitai

coderabbitai Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: pnpm/pnpm/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 7b12a1bb-b93a-4da8-b85d-2a04cd5e4ccd

📥 Commits

Reviewing files that changed from the base of the PR and between 1b27e33 and 0fd83b6.

📒 Files selected for processing (1)
  • pnpm/crates/cli/tests/suite/install_root_engine.rs

Included review availability: Your plan provides up to 10 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

The update pipeline detects direct dependencies affected by selector overrides. No-save rewrites preserve effective override specifiers, skip incompatible or removed requests, and avoid conflicting lockfile changes. Unit and CLI tests cover these behaviors.

Changes

Override-aware update flow

Layer / File(s) Summary
Track overridden direct dependencies
pnpm/crates/package-manager/src/update/prepare.rs, pnpm/crates/package-manager/src/update/seed_policy.rs
Update preparation collects affected direct dependencies and stores their effective specifiers in UpdateScope.
Preserve overrides during no-save rewrites
pnpm/crates/package-manager/src/update/rewrite.rs, .changeset/fix-no-save-selector-overrides.md
No-save updates evaluate effective override specifiers, skip removed or incompatible requests, and avoid conflicting preferred-version seeds.
Validate update behavior in isolated tests
pnpm/crates/package-manager/src/update/tests.rs, pnpm/crates/cli/tests/suite/update.rs, pnpm/crates/cli/tests/suite/update/overrides.rs, pnpm/crates/cli/tests/suite/install_root_engine.rs, pnpm/crates/fs/src/test_support.rs
Tests verify unchanged manifests and lockfiles, removal overrides, frozen-lockfile installation, and isolated command environments.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Bug fix · Severity of issue fixed: Medium

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant UpdateCommand
  participant UpdateScope
  participant Rewrite
  participant Lockfile
  User->>UpdateCommand: run update --no-save
  UpdateCommand->>UpdateScope: collect overridden direct dependencies
  UpdateScope-->>Rewrite: provide effective specifiers
  Rewrite->>Lockfile: preserve compatible importer and version state
  Lockfile-->>User: frozen-lockfile remains valid
Loading

Assessment against linked issues

Objective Addressed Explanation
Ensure update --no-save respects selector overrides and skips requests that do not satisfy the effective override, preserving frozen-lockfile compatibility [#14923] ✅

Suggested labels: product: pacquet

Suggested reviewers: ayush442842q

Merge Risk: ⚪ Minimal · up to 0fd83

This change preserves selector overrides during no-save updates, preventing incompatible lockfiles and maintaining frozen-install compatibility. No actionable merge-blocking risk is identified.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov-commenter

codecov-commenter commented Sep 22, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.34711% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.53%. Comparing base (16b6898) to head (0fd83b6).

Files with missing lines Patch % Lines
pnpm/crates/package-manager/src/update/prepare.rs 98.14% 1 Missing ⚠️
pnpm/crates/package-manager/src/update/rewrite.rs 98.50% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             main   #15261    +/-   ##
========================================
  Coverage   91.52%   91.53%            
========================================
  Files        1381     1381            
  Lines      185685   185800   +115     
========================================
+ Hits       169942   170064   +122     
+ Misses      15743    15736     -7     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Same-run regression check

HEAD and main are measured on the same runner. The tolerance is 5% of the main median or 2 ms, whichever is larger. A regression requires both the median slowdown and the gap between the fastest retained HEAD sample and slowest retained main sample to exceed this tolerance, after trimming up to 10% from each tail. Suspected regressions are rerun once with target order reversed and only fail if reproduced. This conservative noise guard is not a statistical confidence interval.

Inconclusive rows do not fail the check. They remain visible for performance review. Bencher retains absolute minimum timings for historical tracking; historical alerts do not gate this PR. Sequential measurements can still be affected by runner drift.

Scenario Engine main median HEAD median Change Tolerance Result
isolated-fresh-restore-cold-cache-cold-store pacquet 2399.52 ms 2384.25 ms -0.6% 119.98 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store pnpr 1380.16 ms 1303.33 ms -5.6% 69.01 ms Within tolerance
isolated-fresh-restore-hot-cache-hot-store pacquet 273.37 ms 361.65 ms 32.3% 13.67 ms Inconclusive (not reproduced)
isolated-fresh-restore-hot-cache-hot-store pnpr 303.83 ms 284.25 ms -6.4% 15.19 ms Within tolerance
isolated-repeat-install-hot-cache-hot-store pacquet 11.39 ms 11.55 ms 1.3% 2.00 ms Within tolerance
isolated-repeat-install-hot-cache-hot-store pnpr 9.68 ms 9.51 ms -1.8% 2.00 ms Within tolerance
isolated-repeat-install-cold-cache-hot-store pacquet 10.66 ms 10.62 ms -0.4% 2.00 ms Within tolerance
isolated-repeat-install-cold-cache-hot-store pnpr 11.12 ms 10.58 ms -4.8% 2.00 ms Within tolerance
isolated-fresh-install-cold-cache-cold-store pacquet 2575.76 ms 2566.47 ms -0.4% 128.79 ms Within tolerance
isolated-fresh-install-cold-cache-cold-store pnpr 1597.84 ms 1585.99 ms -0.7% 79.89 ms Within tolerance
isolated-fresh-install-hot-cache-hot-store pacquet 467.62 ms 474.32 ms 1.4% 23.38 ms Within tolerance
isolated-fresh-install-hot-cache-hot-store pnpr 336.59 ms 325.46 ms -3.3% 16.83 ms Within tolerance
isolated-fresh-install-cold-cache-hot-store pacquet 1852.13 ms 1634.59 ms -11.7% 92.61 ms Within tolerance
isolated-fresh-install-cold-cache-hot-store pnpr 350.03 ms 289.35 ms -17.3% 17.50 ms Within tolerance
isolated-fresh-resolve-hot-cache-offline pacquet 240.79 ms 236.75 ms -1.7% 12.04 ms Within tolerance
isolated-fresh-resolve-hot-cache-offline pnpr 94.11 ms 94.13 ms 0.0% 4.71 ms Within tolerance
isolated-peer-heavy-resolve-hot-cache-offline pacquet 735.56 ms 870.83 ms 18.4% 36.78 ms Inconclusive (overlapping samples)
isolated-linked-workspace-resolve-hot-cache-offline pacquet 172.63 ms 189.15 ms 9.6% 8.63 ms Inconclusive (overlapping samples)
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pacquet 4449.14 ms 4589.27 ms 3.1% 222.46 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pnpr 3523.96 ms 3483.63 ms -1.1% 176.20 ms Within tolerance
gvs-fresh-restore-hot-cache-hot-store pacquet 151.60 ms 130.44 ms -14.0% 7.58 ms Within tolerance
gvs-fresh-restore-hot-cache-hot-store pnpr 151.34 ms 158.49 ms 4.7% 7.57 ms Within tolerance

Integrated-Benchmark Report (Linux)

Commit: 0fd83b65b902

Regular scenarios report direct and pnpr installs. The peer-heavy resolver scenario compares current Rust, main Rust, and TypeScript pnpm; the linked-workspace scenario compares current Rust against main Rust. Bencher consumes pacquet@HEAD and pnpr@HEAD.

The tables below show mean ± σ. Bencher tracks absolute minimum latency; PR regression checks compare HEAD and main samples from the same runner. Historical timing alerts do not gate PRs.

Scenario: Isolated linker: fresh restore, cold cache + cold store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.398 ± 0.104 2.291 2.615 1.75 ± 0.18
pacquet@main 2.406 ± 0.133 2.236 2.626 1.75 ± 0.19
pnpr@HEAD 1.373 ± 0.124 1.276 1.585 1.00
pnpr@main 1.427 ± 0.112 1.296 1.585 1.04 ± 0.12
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.3977796739999997,
      "stddev": 0.10379273945987152,
      "median": 2.3842450611,
      "user": 1.41996286,
      "system": 1.5674743,
      "min": 2.2907924206,
      "max": 2.6148688016
    },
    {
      "command": "pacquet@main",
      "mean": 2.4061106763,
      "stddev": 0.13304236977166173,
      "median": 2.3995158991,
      "user": 1.35023926,
      "system": 1.4529155000000002,
      "min": 2.2363072766,
      "max": 2.6262963336
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.3725102417,
      "stddev": 0.12435244474954153,
      "median": 1.3033296441,
      "user": 1.15283916,
      "system": 1.2504974000000002,
      "min": 1.2755345586,
      "max": 1.5854454626
    },
    {
      "command": "pnpr@main",
      "mean": 1.4271792455,
      "stddev": 0.11237191217987479,
      "median": 1.3801625291000001,
      "user": 1.2557491600000001,
      "system": 1.3756881,
      "min": 1.2959892746,
      "max": 1.5850649566000001
    }
  ]
}

Scenario: Isolated linker: fresh restore, hot cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 371.7 ± 45.8 313.5 435.2 1.37 ± 0.17
pacquet@main 272.1 ± 7.3 260.3 283.4 1.00
pnpr@HEAD 292.4 ± 27.5 258.7 345.4 1.07 ± 0.10
pnpr@main 308.1 ± 28.4 286.6 381.3 1.13 ± 0.11

Confirmation (reversed target order)

Command Mean [ms] Min [ms] Max [ms] Relative
pnpr@main 336.9 ± 34.9 296.5 407.1 1.25 ± 0.15
pnpr@HEAD 351.3 ± 40.2 303.1 426.5 1.30 ± 0.17
pacquet@main 269.7 ± 17.1 244.1 296.8 1.00
pacquet@HEAD 284.3 ± 34.1 255.2 371.5 1.05 ± 0.14
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.37171491320000005,
      "stddev": 0.0457714481334078,
      "median": 0.3616490714,
      "user": 0.42569742,
      "system": 0.76672828,
      "min": 0.3135363504,
      "max": 0.43516635740000004
    },
    {
      "command": "pacquet@main",
      "mean": 0.2721459951,
      "stddev": 0.007275320101011821,
      "median": 0.2733658249,
      "user": 0.29971952,
      "system": 0.64791808,
      "min": 0.26031180740000004,
      "max": 0.2833666564
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.2924185322,
      "stddev": 0.02746539245354286,
      "median": 0.2842493139,
      "user": 0.29277152,
      "system": 0.6371622799999999,
      "min": 0.2586983974,
      "max": 0.3454106364
    },
    {
      "command": "pnpr@main",
      "mean": 0.308133987,
      "stddev": 0.028390135649087846,
      "median": 0.30382556790000004,
      "user": 0.33004322,
      "system": 0.64594318,
      "min": 0.2866216914,
      "max": 0.3812715324
    }
  ],
  "confirmation": {
    "results": [
      {
        "command": "pnpr@main",
        "mean": 0.33689343528000004,
        "stddev": 0.03488100892153916,
        "median": 0.32596021158,
        "user": 0.35432698,
        "system": 0.7003951199999999,
        "min": 0.29653697008,
        "max": 0.40712877808000003
      },
      {
        "command": "pnpr@HEAD",
        "mean": 0.35134915368,
        "stddev": 0.04021297535369648,
        "median": 0.35005297058,
        "user": 0.38039728,
        "system": 0.7066474199999999,
        "min": 0.30311692108,
        "max": 0.42648112108
      },
      {
        "command": "pacquet@main",
        "mean": 0.26966388678,
        "stddev": 0.017052725220064277,
        "median": 0.27261360458,
        "user": 0.30382198,
        "system": 0.61805702,
        "min": 0.24413867808,
        "max": 0.29677880508
      },
      {
        "command": "pacquet@HEAD",
        "mean": 0.28431565318,
        "stddev": 0.0341305861832141,
        "median": 0.27184636058,
        "user": 0.30819488,
        "system": 0.65754052,
        "min": 0.25516585308,
        "max": 0.37148488808
      }
    ]
  }
}

Scenario: Isolated linker: repeat install, hot cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 13.1 ± 3.7 7.8 23.9 1.33 ± 0.43
pacquet@main 11.9 ± 2.6 7.5 24.1 1.21 ± 0.33
pnpr@HEAD 9.8 ± 1.6 7.2 16.7 1.00
pnpr@main 10.1 ± 2.0 7.2 18.0 1.03 ± 0.26
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.013109931126451622,
      "stddev": 0.003688197106481353,
      "median": 0.011548138820000001,
      "user": 0.00793392946236559,
      "system": 0.005999704623655913,
      "min": 0.007775366319999999,
      "max": 0.02389346032
    },
    {
      "command": "pacquet@main",
      "mean": 0.011939159597566536,
      "stddev": 0.0025536524458549007,
      "median": 0.01139466532,
      "user": 0.0070491674524714824,
      "system": 0.005724501977186309,
      "min": 0.00752698932,
      "max": 0.024072916320000002
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.009838080329554138,
      "stddev": 0.00160559929748447,
      "median": 0.00950808032,
      "user": 0.005890787006369429,
      "system": 0.004640447070063697,
      "min": 0.007171019319999999,
      "max": 0.01674234532
    },
    {
      "command": "pnpr@main",
      "mean": 0.010134871687346938,
      "stddev": 0.0020053141611557426,
      "median": 0.00967963832,
      "user": 0.005859094344023322,
      "system": 0.004991911253644314,
      "min": 0.00722173532,
      "max": 0.017956790320000002
    }
  ]
}

Scenario: Isolated linker: repeat install, cold cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 10.7 ± 1.1 8.0 13.5 1.00 ± 0.14
pacquet@main 10.8 ± 1.1 8.6 14.2 1.02 ± 0.14
pnpr@HEAD 10.7 ± 1.0 7.9 13.8 1.00
pnpr@main 11.3 ± 1.1 9.1 15.0 1.06 ± 0.14
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.010699414856190474,
      "stddev": 0.0011244287061683502,
      "median": 0.010620602780000002,
      "user": 0.006189540952380947,
      "system": 0.005220237333333332,
      "min": 0.00796563278,
      "max": 0.013473392780000001
    },
    {
      "command": "pacquet@main",
      "mean": 0.010835484153786414,
      "stddev": 0.0011357865366366491,
      "median": 0.010661302780000001,
      "user": 0.006043559999999998,
      "system": 0.005538155339805826,
      "min": 0.008631511780000002,
      "max": 0.014198895780000002
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.01066034680904565,
      "stddev": 0.0009775459505244046,
      "median": 0.010582817780000002,
      "user": 0.006368804813278008,
      "system": 0.005012381078838177,
      "min": 0.007928162780000001,
      "max": 0.013769661780000001
    },
    {
      "command": "pnpr@main",
      "mean": 0.011271952087692303,
      "stddev": 0.001135892532662362,
      "median": 0.011116781780000001,
      "user": 0.006625873186813186,
      "system": 0.00542097164835165,
      "min": 0.009108581780000001,
      "max": 0.014976550780000002
    }
  ]
}

Scenario: Isolated linker: fresh install, cold cache + cold store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.578 ± 0.049 2.539 2.712 1.63 ± 0.12
pacquet@main 2.581 ± 0.021 2.552 2.609 1.63 ± 0.12
pnpr@HEAD 1.585 ± 0.112 1.462 1.731 1.00
pnpr@main 1.598 ± 0.140 1.438 1.805 1.01 ± 0.11
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.5781191676599997,
      "stddev": 0.04923201445484999,
      "median": 2.56647007846,
      "user": 2.1371938399999997,
      "system": 2.06913126,
      "min": 2.5385271714599997,
      "max": 2.71239872746
    },
    {
      "command": "pacquet@main",
      "mean": 2.58103782346,
      "stddev": 0.021029662223301823,
      "median": 2.57576051996,
      "user": 2.14578094,
      "system": 2.06102556,
      "min": 2.55178337746,
      "max": 2.60877843646
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.58451849176,
      "stddev": 0.11246863795515526,
      "median": 1.58599310696,
      "user": 1.3967293399999998,
      "system": 1.76329946,
      "min": 1.46150648946,
      "max": 1.7309592034599999
    },
    {
      "command": "pnpr@main",
      "mean": 1.5984435750600001,
      "stddev": 0.13967968279803183,
      "median": 1.5978361319599999,
      "user": 1.3949278400000003,
      "system": 1.81413066,
      "min": 1.43803333846,
      "max": 1.8053166644599998
    }
  ]
}

Scenario: Isolated linker: fresh install, hot cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 467.2 ± 33.4 410.5 507.2 1.42 ± 0.14
pacquet@main 481.0 ± 66.6 400.9 649.0 1.46 ± 0.23
pnpr@HEAD 330.1 ± 22.8 300.7 376.6 1.00
pnpr@main 343.2 ± 32.2 318.3 429.9 1.04 ± 0.12
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.46717030664000003,
      "stddev": 0.033384218594417654,
      "median": 0.4743173284400001,
      "user": 0.7562785200000001,
      "system": 0.9823892800000001,
      "min": 0.41046734744,
      "max": 0.50715632844
    },
    {
      "command": "pacquet@main",
      "mean": 0.48097973874000005,
      "stddev": 0.06664594445470576,
      "median": 0.46762462694000007,
      "user": 0.79155312,
      "system": 1.00501438,
      "min": 0.40092790744,
      "max": 0.6490053984399999
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.33008241594,
      "stddev": 0.022832793928318853,
      "median": 0.32545617994,
      "user": 0.26792982000000004,
      "system": 0.6188970800000001,
      "min": 0.30069759644000005,
      "max": 0.37658665244
    },
    {
      "command": "pnpr@main",
      "mean": 0.34315459884,
      "stddev": 0.0321511378115904,
      "median": 0.33659022894,
      "user": 0.28739082,
      "system": 0.6212038800000002,
      "min": 0.31833675144,
      "max": 0.42991400744
    }
  ]
}

Scenario: Isolated linker: fresh install, cold cache + hot store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.737 ± 0.182 1.595 2.061 5.97 ± 0.76
pacquet@main 1.893 ± 0.157 1.711 2.182 6.51 ± 0.71
pnpr@HEAD 0.291 ± 0.021 0.267 0.337 1.00
pnpr@main 0.362 ± 0.027 0.331 0.415 1.24 ± 0.13
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.7365949932600002,
      "stddev": 0.18159101430688843,
      "median": 1.6345864897600002,
      "user": 1.13014886,
      "system": 1.1126393,
      "min": 1.59503030776,
      "max": 2.0610755037599997
    },
    {
      "command": "pacquet@main",
      "mean": 1.8933582788600003,
      "stddev": 0.15718401602848048,
      "median": 1.8521296832600003,
      "user": 1.4490295599999998,
      "system": 1.3196697000000002,
      "min": 1.7111424807600002,
      "max": 2.1820038027599997
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.29101133956,
      "stddev": 0.02083251441728373,
      "median": 0.28935429476,
      "user": 0.24249685999999998,
      "system": 0.5292512,
      "min": 0.26661280576,
      "max": 0.33709793476000005
    },
    {
      "command": "pnpr@main",
      "mean": 0.36210179366000006,
      "stddev": 0.02681631966418704,
      "median": 0.35002753626000005,
      "user": 0.32996195999999994,
      "system": 0.6693577999999999,
      "min": 0.33081305876000006,
      "max": 0.41491966576000006
    }
  ]
}

Scenario: Isolated linker: fresh resolve, hot cache, offline

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 234.3 ± 11.8 212.4 249.7 2.47 ± 0.15
pacquet@main 237.8 ± 7.9 222.6 247.2 2.51 ± 0.12
pnpr@HEAD 94.9 ± 3.4 88.9 102.4 1.00
pnpr@main 95.9 ± 4.2 90.7 104.0 1.01 ± 0.06
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.2343253411733334,
      "stddev": 0.01181328956025196,
      "median": 0.23675148134000001,
      "user": 0.2518090966666666,
      "system": 0.08725402333333332,
      "min": 0.21244213134,
      "max": 0.24968502834000003
    },
    {
      "command": "pacquet@main",
      "mean": 0.23783213597636366,
      "stddev": 0.00794674259673204,
      "median": 0.24079478034000001,
      "user": 0.26707963454545447,
      "system": 0.07393189454545455,
      "min": 0.22263604034,
      "max": 0.24719386634
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.09490401148285717,
      "stddev": 0.0034373541685352796,
      "median": 0.09412751534,
      "user": 0.03696214428571428,
      "system": 0.013613011428571426,
      "min": 0.08890366434000001,
      "max": 0.10240580634
    },
    {
      "command": "pnpr@main",
      "mean": 0.09588731140451612,
      "stddev": 0.004238599447973438,
      "median": 0.09411128534,
      "user": 0.0377034058064516,
      "system": 0.014689171612903227,
      "min": 0.09068025534,
      "max": 0.10400740634000001
    }
  ]
}

Scenario: Isolated linker: peer-heavy resolve, hot cache, offline

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 802.9 ± 135.8 624.4 971.2 1.11 ± 0.29
pacquet@main 726.3 ± 145.2 465.9 874.0 1.00
pnpm@HEAD 3348.3 ± 108.8 3183.4 3503.8 4.61 ± 0.93
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.8028847160200001,
      "stddev": 0.1358056987440454,
      "median": 0.8708310990200001,
      "user": 0.8084152488888887,
      "system": 0.25333212222222223,
      "min": 0.62439950602,
      "max": 0.9711821100200001
    },
    {
      "command": "pacquet@main",
      "mean": 0.7262564485755556,
      "stddev": 0.14521466059726237,
      "median": 0.7355560820200001,
      "user": 0.7417680266666665,
      "system": 0.19681034444444445,
      "min": 0.46590543402000006,
      "max": 0.8740212420200001
    },
    {
      "command": "pnpm@HEAD",
      "mean": 3.348318643242222,
      "stddev": 0.10884384184732335,
      "median": 3.36896363302,
      "user": 4.874501137777778,
      "system": 0.3053326777777778,
      "min": 3.18341623902,
      "max": 3.50377494402
    }
  ]
}

Scenario: Isolated linker: linked-workspace resolve, hot cache, offline

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 192.3 ± 14.4 178.3 223.5 1.11 ± 0.09
pacquet@main 173.1 ± 4.0 167.9 184.4 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.19232727118000004,
      "stddev": 0.014385277596804295,
      "median": 0.18915313418000002,
      "user": 0.141367375,
      "system": 0.09442143,
      "min": 0.17829685268000003,
      "max": 0.22346198468000003
    },
    {
      "command": "pacquet@main",
      "mean": 0.17311651618000004,
      "stddev": 0.003996198349019695,
      "median": 0.17263044418,
      "user": 0.1332556875,
      "system": 0.07274105499999999,
      "min": 0.16794777268000002,
      "max": 0.18439997468000002
    }
  ]
}

Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.563 ± 0.156 4.380 4.854 1.29 ± 0.06
pacquet@main 4.523 ± 0.179 4.337 4.805 1.28 ± 0.06
pnpr@HEAD 3.524 ± 0.101 3.438 3.733 1.00
pnpr@main 3.564 ± 0.120 3.427 3.820 1.01 ± 0.04
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.56276775368,
      "stddev": 0.15600607594349625,
      "median": 4.589265317480001,
      "user": 1.8417445799999996,
      "system": 2.11476448,
      "min": 4.38024713598,
      "max": 4.85448574098
    },
    {
      "command": "pacquet@main",
      "mean": 4.52334023588,
      "stddev": 0.17920408381916,
      "median": 4.44914279448,
      "user": 1.6957489799999999,
      "system": 2.0109357799999996,
      "min": 4.33694842798,
      "max": 4.8045003169800005
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.52436293428,
      "stddev": 0.10094837117387194,
      "median": 3.4836335534800003,
      "user": 1.6270432799999999,
      "system": 1.8943490800000002,
      "min": 3.43806434698,
      "max": 3.7330040399800004
    },
    {
      "command": "pnpr@main",
      "mean": 3.56399470518,
      "stddev": 0.11985149508222226,
      "median": 3.52395539948,
      "user": 1.7090054799999996,
      "system": 1.9952865799999997,
      "min": 3.42714162198,
      "max": 3.8195656279800003
    }
  ]
}

Scenario: GVS linker: fresh restore, hot cache + hot store

Same install as the isolated fresh-restore hot/hot scenario, into the shared virtual store, the layout pnpm 12 installs into by default. Scenarios run on separate machines, so compare main and branch within each table.

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 129.8 ± 5.7 119.7 140.3 1.00
pacquet@main 154.6 ± 19.1 122.2 200.9 1.19 ± 0.16
pnpr@HEAD 161.3 ± 16.6 136.0 193.1 1.24 ± 0.14
pnpr@main 150.0 ± 11.0 130.1 166.4 1.16 ± 0.10
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.1298058331,
      "stddev": 0.00573318609979615,
      "median": 0.1304381645,
      "user": 0.14888758000000002,
      "system": 0.14431049,
      "min": 0.11967722150000001,
      "max": 0.14034141049999999
    },
    {
      "command": "pacquet@main",
      "mean": 0.1545818602692308,
      "stddev": 0.019052316548820634,
      "median": 0.1515955765,
      "user": 0.18955300307692308,
      "system": 0.15546557846153847,
      "min": 0.12220498850000001,
      "max": 0.2008587925
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.16129079621428571,
      "stddev": 0.016579466567162915,
      "median": 0.158489124,
      "user": 0.19250765142857137,
      "system": 0.14664282571428575,
      "min": 0.1359946825,
      "max": 0.1930929125
    },
    {
      "command": "pnpr@main",
      "mean": 0.1499575453125,
      "stddev": 0.01103828342863286,
      "median": 0.151337052,
      "user": 0.1743147675,
      "system": 0.14994703999999998,
      "min": 0.1301436875,
      "max": 0.16640410249999998
    }
  ]
}

@waltuov
waltuov marked this pull request as ready for review September 22, 2026 11:22
@waltuov
waltuov requested a review from zkochan as a code owner September 22, 2026 11:22
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@greptile-apps

greptile-apps Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge; no actionable new failures remain, and both previous findings are resolved.

Reviews (4) · Last reviewed commit: "test(cli): drop redundant narration comm..."

@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Sep 22, 2026
@zkochan
zkochan force-pushed the fix/no-save-selector-overrides branch from 6266bc5 to ec9e45c Compare September 22, 2026 12:56
@qodo-code-review

qodo-code-review Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (3) 📘 Rule violations (2) 🔗 Cross-repo conflicts (0) 📜 Skill insights (1)

Grey Divider


Remediation recommended

1. Repositories can forge terminal warnings 🐞 Bug ⛨ Security ⭐ New
Description
override_owned_rewrite formats the manifest-derived package name and effective override specifier
directly into a warning without sanitizing control characters. A crafted workspace override reaches
the default reporter unchanged during a matching no-save update, allowing embedded terminal escapes
or newlines to alter the displayed output.
Code

pnpm/crates/package-manager/src/update/rewrite.rs[R164-167]

+        Reporter::emit(&LogEvent::Pnpm(PnpmLog {
+            level: LogLevel::Warn,
+            message: format!(
+                r#"Ignoring "{name}@{requested}": "{name}" is controlled by an override, so its specifier "{effective_specifier}" was used instead."#,
Relevance

●●● Strong

Recent precedents accept sanitizing untrusted warning fields, including terminal control-character
injection and override-related output.

PR-#11384
PR-#13202
PR-#14078

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The changed warning embeds name, requested, and effective_specifier directly. Override parsing
preserves non-catalog replacement strings, while the default reporter forwards warning messages to
its frame without sanitization; the repository already provides sanitize_inline specifically for
single-line terminal fields.

pnpm/crates/package-manager/src/update/rewrite.rs[163-170]
pnpm/crates/config-parse-overrides/src/lib.rs[245-264]
pnpm/crates/default-reporter/src/state/notices.rs[164-177]
pnpm/crates/text-sanitize/src/lib.rs[29-43]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new no-save override warnings interpolate repository-controlled package names and override specifiers directly into terminal output, allowing control characters to manipulate the displayed warning.

## Fix Focus Areas
- pnpm/crates/package-manager/src/update/rewrite.rs[143-170]

## Recommended Fix
Sanitize every dynamic package name, requested selector, and effective override specifier with the repository's inline text sanitizer before constructing both warnings. Add regression coverage using newline, ANSI escape, and bidirectional-formatting characters to verify each warning remains a single inert line.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Alias overrides update excluded requests 🐞 Bug ≡ Correctness
Description
override_owned_rewrite passes the full effective npm: or jsr: alias to
judge_against_kept_range, so a concrete version outside the alias's embedded range is classified
as undecided rather than excluded. With a same-name override such as foo -> npm:^2 and `foo@3
--no-save, the result becomes Target(None), adds foo` to the unrestricted drop targets, and
re-resolves it instead of skipping the request.
Code

pnpm/crates/package-manager/src/update/rewrite.rs[R155-159]

+    if let Some(requested) = requested
+        && matches!(
+            judge_against_kept_range(requested, effective_specifier),
+            KeptRangeVerdict::Excluded,
+        )
Relevance

●●● Strong

A closely matching precedent accepted preserving protocol and range semantics during version
rewrites.

PR-#14756

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The existing alias parser recognizes bare npm:<range> and jsr:<range> forms, but the new
override path sends the unsplit value to semver parsing. An undecided result returns a target, after
which update-target insertion and resolver coverage force the matching package out of lockfile
reuse.

pnpm/crates/package-manager/src/update/rewrite.rs[137-172]
pnpm/crates/package-manager/src/update/rewrite.rs[41-54]
pnpm/crates/package-manager/src/manifest_spec_bumps.rs[393-421]
pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree/update_scope.rs[61-91]
pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree/reuse.rs[288-309]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
No-save override validation parses the complete `npm:` or `jsr:` effective specifier as semver. Registry aliases with embedded ranges are therefore treated as undecidable, allowing an excluded concrete request to become an unrestricted update target.

## Fix Focus Areas
- pnpm/crates/package-manager/src/update/rewrite.rs[155-162]
- pnpm/crates/package-manager/src/manifest_spec_bumps.rs[393-421]

## Recommended Fix
Use the existing registry-alias splitter to extract the effective range before calling `judge_against_kept_range`. Add regression coverage showing that a concrete version outside `npm:^2` or `jsr:^2` is skipped and does not create a drop target.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Release note merges old and new behavior 📘 Rule violation ⚙ Maintainability
Description
fix-no-save-selector-overrides.md uses the single clause Fixed ... bypassing ... to mention the
former defect and its correction together. This bug-fix entry therefore lacks a standalone
past-tense sentence for the prior override behavior, while the following sentence only states
lockfile compatibility.
Code

.changeset/fix-no-save-selector-overrides.md[5]

+Fixed `pnpm update --no-save` bypassing version-scoped overrides when a dependency selector specifies a version. The generated lockfile remains compatible with `pnpm install --frozen-lockfile` [pnpm/pnpm#14923](https://github.com/pnpm/pnpm/issues/14923).
Relevance

●●● Strong

Recent changeset reviews accepted separating prior buggy behavior into its own past-tense sentence.

PR-#14179
PR-#14642
PR-#15190

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Compliance rule 3058498 requires previous buggy behavior to appear in its own past-tense sentence.
The changeset's first sentence instead embeds that behavior in the gerund phrase `bypassing
version-scoped overrides`.

Rule 3058498: Describe previous buggy behavior in a separate past-tense sentence
.changeset/fix-no-save-selector-overrides.md[5-5]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The changeset combines the prior buggy behavior and its correction instead of describing the former behavior in a separate past-tense sentence.

## Fix Focus Areas
- .changeset/fix-no-save-selector-overrides.md[5-5]

## Recommended Fix
State the current behavior first, such as that versioned `pnpm update --no-save` requests now respect matching version-scoped overrides. Follow it with a separate sentence beginning with `Previously` that describes how the override could be bypassed.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View medium (2)
4. Large updates become quadratic 🐞 Bug ➹ Performance
Description
collect_overridden_direct scans an effective dependency group for every overridden direct
dependency, and no_save_direct_rewrite then linearly searches the collected vector for every
matched dependency. A project with D direct dependencies governed by broad overrides therefore
performs O(D²) work on each versioned no-save update, multiplied across every selected workspace
project.
Code

pnpm/crates/package-manager/src/update/prepare.rs[R279-282]

+        .map(|(name, group)| OverriddenDirect {
+            effective_specifier: effective
+                .dependencies([group])
+                .find_map(|(alias, specifier)| (alias == name).then(|| specifier.to_string())),
Relevance

●● Moderate

Potential quadratic behavior is substantive, but historical evidence does not establish team
acceptance for this pattern.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Each matched override currently calls dependencies([group]).find_map, which scans that group, and
each dependency subsequently calls .iter().find over the full overridden list. Selector planning
invokes this rewrite once per matched direct dependency and repeats preparation for every selected
workspace project.

pnpm/crates/package-manager/src/update/prepare.rs[261-286]
pnpm/crates/package-manager/src/update/rewrite.rs[108-134]
pnpm/crates/package-manager/src/update/seed_policy.rs[239-280]
pnpm/crates/package-manager/src/update/prepare.rs[401-413]
pnpm/crates/package-manifest/src/lib.rs[192-210]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The newly collected overridden dependencies are repeatedly scanned during both effective-specifier collection and rewrite planning. Large manifests and recursive workspace updates therefore incur quadratic work in the number of direct dependencies.

## Fix Focus Areas
- pnpm/crates/package-manager/src/update/prepare.rs[261-286]
- pnpm/crates/package-manager/src/update/rewrite.rs[116-119]
- pnpm/crates/package-manager/src/update/seed_policy.rs[42-46]

## Recommended Fix
Store overridden dependency state in a map keyed by dependency name and group. Populate effective values through direct dependency-map lookups after applying overrides, then use constant-time keyed lookups from `no_save_direct_rewrite`.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


5. Large updates repeat override parsing 📜 Skill insight ➹ Performance
Description
overridden_direct calls parse_config_overrides, discovers the lockfile root, and constructs a
new VersionsOverrider from every decide_update invocation. A recursive versioned `update
--no-save` with overrides repeats that metadata setup once per selected project before resolution
parses the overrides again, so its preparation cost scales with workspace size.
Code

pnpm/crates/package-manager/src/update/prepare.rs[R251-253]

+    let parsed = crate::install::parse_config_overrides(update.config, catalogs)
+        .map_err(|error| UpdateError::Install(error.into()))?
+        .unwrap_or_default();
Relevance

●● Moderate

Performance concern is plausible, but no closely matching historical acceptance or rejection
precedent was found.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Compliance rule 3365220 requires already available resolution metadata to be carried through rather
than repeatedly parsed. The new helper reconstructs override metadata inside the per-manifest
preparation path, while the install resolution path subsequently builds equivalent shared override
metadata again.

pnpm/crates/package-manager/src/update/prepare.rs[193-195]
pnpm/crates/package-manager/src/update/prepare.rs[237-258]
pnpm/crates/package-manager/src/update/prepare.rs[399-414]
pnpm/crates/package-manager/src/install_with_fresh_lockfile/manifest_transforms.rs[47-60]
Skill: review-code

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Recursive no-save updates repeatedly parse the same override configuration and reconstruct override metadata for each selected project.

## Fix Focus Areas
- pnpm/crates/package-manager/src/update/prepare.rs[193-195]
- pnpm/crates/package-manager/src/update/prepare.rs[237-258]

## Recommended Fix
Prepare and cache the parsed overrides and overrider by effective catalog context and lockfile root. Reuse that context across selected manifests, while retaining separate entries where catalogs or project-specific lockfile roots differ.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Informational

6. Unrelated fixes broaden the bug patch 📘 Rule violation ⚙ Maintainability
Description
install_root_engine.rs changes unrelated engine-test working-directory and shim setup, while
test_support.rs separately rewrites filesystem-test documentation. These changes address
validation problems outside the no-save override path and touch neither its implementation nor
regression scenario, so later changes cannot isolate the patch's intent.
Code

pnpm/crates/cli/tests/suite/install_root_engine.rs[140]

+    let node_version = node_version_at(&workspace);
Relevance

● Weak

Recent reviews rejected unrelated test hardening and fixture changes in bug-fix PRs.

PR-#15082
PR-#15135

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Compliance rule 2255067 requires bug-fix changes to remain directly connected to the defect or its
tests. The cited files instead modify engine-check fixtures and filesystem-test documentation, which
the PR description identifies as separate validation issues.

Rule 2255067: Bug fix changes must not include unrelated refactors or reformatting
pnpm/crates/cli/tests/suite/install_root_engine.rs[137-169]
pnpm/crates/fs/src/test_support.rs[1-1]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The no-save override bug fix includes independent engine-fixture corrections and a filesystem documentation correction that are unrelated to the affected update path.

## Fix Focus Areas
- pnpm/crates/cli/tests/suite/install_root_engine.rs[3-169]
- pnpm/crates/fs/src/test_support.rs[1-1]

## Recommended Fix
Move the engine-fixture and filesystem documentation corrections into separate pull requests or commits intended for independent review. Keep this bug-fix change limited to the no-save override implementation and its regression tests.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
✅ Compliance rules (platform): 64 rules
✅ Skills: review-code
✅ Cross-repo context — repo relationships
  Explored: repo: pnpm/update (sha: fcaa952e)
Review mode: 🧠 Deep: The latest push combines substantive override-resolution logic with cross-cutting reporter/configuration behavior across many independent CLI paths, creating a high density of subtle defects that benefits from redundant review.

Grey Divider

Tip of the day
💡 Did you know, you can route each action level your way: inline, summary, both, or drop

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Previous reviews

Review updated until commit 0fd83b6

Results up to commit ec9e45c ⚖️ Balanced


🐞 Bugs (2) 📘 Rule violations (2) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (1)


Remediation recommended
1. Alias overrides update excluded requests 🐞 Bug ≡ Correctness
Description
override_owned_rewrite passes the full effective npm: or jsr: alias to
judge_against_kept_range, so a concrete version outside the alias's embedded range is classified
as undecided rather than excluded. With a same-name override such as foo -> npm:^2 and `foo@3
--no-save, the result becomes Target(None), adds foo` to the unrestricted drop targets, and
re-resolves it instead of skipping the request.
Code

pnpm/crates/package-manager/src/update/rewrite.rs[R155-159]

+    if let Some(requested) = requested
+        && matches!(
+            judge_against_kept_range(requested, effective_specifier),
+            KeptRangeVerdict::Excluded,
+        )
Relevance

●●● Strong

A closely matching precedent accepted preserving protocol and range semantics during version
rewrites.

PR-#14756

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The existing alias parser recognizes bare npm:<range> and jsr:<range> forms, but the new
override path sends the unsplit value to semver parsing. An undecided result returns a target, after
which update-target insertion and resolver coverage force the matching package out of lockfile
reuse.

pnpm/crates/package-manager/src/update/rewrite.rs[137-172]
pnpm/crates/package-manager/src/update/rewrite.rs[41-54]
pnpm/crates/package-manager/src/manifest_spec_bumps.rs[393-421]
pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree/update_scope.rs[61-91]
pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree/reuse.rs[288-309]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
No-save override validation parses the complete `npm:` or `jsr:` effective specifier as semver. Registry aliases with embedded ranges are therefore treated as undecidable, allowing an excluded concrete request to become an unrestricted update target.

## Fix Focus Areas
- pnpm/crates/package-manager/src/update/rewrite.rs[155-162]
- pnpm/crates/package-manager/src/manifest_spec_bumps.rs[393-421]

## Recommended Fix
Use the existing registry-alias splitter to extract the effective range before calling `judge_against_kept_range`. Add regression coverage showing that a concrete version outside `npm:^2` or `jsr:^2` is skipped and does not create a drop target.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Release note merges old and new behavior 📘 Rule violation ⚙ Maintainability
Description
fix-no-save-selector-overrides.md uses the single clause Fixed ... bypassing ... to mention the
former defect and its correction together. This bug-fix entry therefore lacks a standalone
past-tense sentence for the prior override behavior, while the following sentence only states
lockfile compatibility.
Code

.changeset/fix-no-save-selector-overrides.md[5]

+Fixed `pnpm update --no-save` bypassing version-scoped overrides when a dependency selector specifies a version. The generated lockfile remains compatible with `pnpm install --frozen-lockfile` [pnpm/pnpm#14923](https://github.com/pnpm/pnpm/issues/14923).
Relevance

●●● Strong

Recent changeset reviews accepted separating prior buggy behavior into its own past-tense sentence.

PR-#14179
PR-#14642
PR-#15190

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Compliance rule 3058498 requires previous buggy behavior to appear in its own past-tense sentence.
The changeset's first sentence instead embeds that behavior in the gerund phrase `bypassing
version-scoped overrides`.

Rule 3058498: Describe previous buggy behavior in a separate past-tense sentence
.changeset/fix-no-save-selector-overrides.md[5-5]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The changeset combines the prior buggy behavior and its correction instead of describing the former behavior in a separate past-tense sentence.

## Fix Focus Areas
- .changeset/fix-no-save-selector-overrides.md[5-5]

## Recommended Fix
State the current behavior first, such as that versioned `pnpm update --no-save` requests now respect matching version-scoped overrides. Follow it with a separate sentence beginning with `Previously` that describes how the override could be bypassed.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Large updates become quadratic 🐞 Bug ➹ Performance
Description
collect_overridden_direct scans an effective dependency group for every overridden direct
dependency, and no_save_direct_rewrite then linearly searches the collected vector for every
matched dependency. A project with D direct dependencies governed by broad overrides therefore
performs O(D²) work on each versioned no-save update, multiplied across every selected workspace
project.
Code

pnpm/crates/package-manager/src/update/prepare.rs[R279-282]

+        .map(|(name, group)| OverriddenDirect {
+            effective_specifier: effective
+                .dependencies([group])
+                .find_map(|(alias, specifier)| (alias == name).then(|| specifier.to_string())),
Relevance

●● Moderate

Potential quadratic behavior is substantive, but historical evidence does not establish team
acceptance for this pattern.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Each matched override currently calls dependencies([group]).find_map, which scans that group, and
each dependency subsequently calls .iter().find over the full overridden list. Selector planning
invokes this rewrite once per matched direct dependency and repeats preparation for every selected
workspace project.

pnpm/crates/package-manager/src/update/prepare.rs[261-286]
pnpm/crates/package-manager/src/update/rewrite.rs[108-134]
pnpm/crates/package-manager/src/update/seed_policy.rs[239-280]
pnpm/crates/package-manager/src/update/prepare.rs[401-413]
pnpm/crates/package-manifest/src/lib.rs[192-210]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The newly collected overridden dependencies are repeatedly scanned during both effective-specifier collection and rewrite planning. Large manifests and recursive workspace updates therefore incur quadratic work in the number of direct dependencies.

## Fix Focus Areas
- pnpm/crates/package-manager/src/update/prepare.rs[261-286]
- pnpm/crates/package-manager/src/update/rewrite.rs[116-119]
- pnpm/crates/package-manager/src/update/seed_policy.rs[42-46]

## Recommended Fix
Store overridden dependency state in a map keyed by dependency name and group. Populate effective values through direct dependency-map lookups after applying overrides, then use constant-time keyed lookups from `no_save_direct_rewrite`.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View medium (1)
4. Large updates repeat override parsing 📜 Skill insight ➹ Performance
Description
overridden_direct calls parse_config_overrides, discovers the lockfile root, and constructs a
new VersionsOverrider from every decide_update invocation. A recursive versioned `update
--no-save` with overrides repeats that metadata setup once per selected project before resolution
parses the overrides again, so its preparation cost scales with workspace size.
Code

pnpm/crates/package-manager/src/update/prepare.rs[R251-253]

+    let parsed = crate::install::parse_config_overrides(update.config, catalogs)
+        .map_err(|error| UpdateError::Install(error.into()))?
+        .unwrap_or_default();
Relevance

●● Moderate

Performance concern is plausible, but no closely matching historical acceptance or rejection
precedent was found.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Compliance rule 3365220 requires already available resolution metadata to be carried through rather
than repeatedly parsed. The new helper reconstructs override metadata inside the per-manifest
preparation path, while the install resolution path subsequently builds equivalent shared override
metadata again.

pnpm/crates/package-manager/src/update/prepare.rs[193-195]
pnpm/crates/package-manager/src/update/prepare.rs[237-258]
pnpm/crates/package-manager/src/update/prepare.rs[399-414]
pnpm/crates/package-manager/src/install_with_fresh_lockfile/manifest_transforms.rs[47-60]
Skill: review-code

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Recursive no-save updates repeatedly parse the same override configuration and reconstruct override metadata for each selected project.

## Fix Focus Areas
- pnpm/crates/package-manager/src/update/prepare.rs[193-195]
- pnpm/crates/package-manager/src/update/prepare.rs[237-258]

## Recommended Fix
Prepare and cache the parsed overrides and overrider by effective catalog context and lockfile root. Reuse that context across selected manifests, while retaining separate entries where catalogs or project-specific lockfile roots differ.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Informational
5. Unrelated fixes broaden the bug patch 📘 Rule violation ⚙ Maintainability
Description
install_root_engine.rs changes unrelated engine-test working-directory and shim setup, while
test_support.rs separately rewrites filesystem-test documentation. These changes address
validation problems outside the no-save override path and touch neither its implementation nor
regression scenario, so later changes cannot isolate the patch's intent.
Code

pnpm/crates/cli/tests/suite/install_root_engine.rs[140]

+    let node_version = node_version_at(&workspace);
Relevance

● Weak

Recent reviews rejected unrelated test hardening and fixture changes in bug-fix PRs.

PR-#15082
PR-#15135

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Compliance rule 2255067 requires bug-fix changes to remain directly connected to the defect or its
tests. The cited files instead modify engine-check fixtures and filesystem-test documentation, which
the PR description identifies as separate validation issues.

Rule 2255067: Bug fix changes must not include unrelated refactors or reformatting
pnpm/crates/cli/tests/suite/install_root_engine.rs[137-169]
pnpm/crates/fs/src/test_support.rs[1-1]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The no-save override bug fix includes independent engine-fixture corrections and a filesystem documentation correction that are unrelated to the affected update path.

## Fix Focus Areas
- pnpm/crates/cli/tests/suite/install_root_engine.rs[3-169]
- pnpm/crates/fs/src/test_support.rs[1-1]

## Recommended Fix
Move the engine-fixture and filesystem documentation corrections into separate pull requests or commits intended for independent review. Keep this bug-fix change limited to the no-save override implementation and its regression tests.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

1 similar comment
@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

greptile-apps[bot]
greptile-apps Bot previously approved these changes Sep 22, 2026
waltuov and others added 5 commits September 22, 2026 15:28
Plan versioned no-save updates against effective override specifiers while
preserving the original declarations used to match range-scoped overrides.
Skip excluded or removed dependencies without recording preferred versions.

Add CLI and unit regressions for override ownership, dependency removal,
and skipped update seeds.

Closes pnpm#14923.
@zkochan
zkochan force-pushed the fix/no-save-selector-overrides branch from 1b27e33 to 0fd83b6 Compare September 22, 2026 13:37
@greptile-apps
greptile-apps Bot dismissed their stale review September 22, 2026 13:37

Dismissed because a newer commit was pushed; Greptile will re-review the current head.

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 0fd83b6

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

@zkochan
zkochan merged commit 4d088cb into pnpm:main Sep 22, 2026
52 checks passed
@welcome

welcome Bot commented Sep 22, 2026

Copy link
Copy Markdown

Congrats on merging your first pull request! 🎉🎉🎉

@waltuov
waltuov deleted the fix/no-save-selector-overrides branch September 24, 2026 10:28
u9g pushed a commit to u9g/pnpm that referenced this pull request Sep 25, 2026
Determine override ownership and effective dependency specifiers before
planning a no-save update, using the existing override parser and
VersionsOverrider. Keep the original declaration unchanged so a
range-scoped override remains applicable during resolution.

Reject concrete versions excluded by the effective range, keep removed
dependencies out of the update, and avoid recording preferred-version
seeds for skipped requests. Other override-owned requests retain the
override's specifier, matching the current v11 read-only handling.

Add CLI regressions for pinned and removal overrides, and unit coverage
for preserved declarations and empty seeds after a skipped request.

Make the engine-check fixtures probe Node with the same working directory
and shim configuration as the command under test.

Closes pnpm#14923.

---------

Co-authored-by: waltu <[email protected]>
Co-authored-by: Zoltan Kochan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product: pacquet reviewed: coderabbit CodeRabbit submitted an approving review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pnpm 12: update --no-save ignores a selector override on the package being updated, so --frozen-lockfile fails (pnpm 11 skips it with a warning)

3 participants