Skip to content

fix(verify-deps): compare dedupePeers in the pre-run lockfile check - #17328

Merged
zkochan merged 1 commit into
pnpm:mainfrom
lazerg:fix/issue-17322-run-gate-dedupe-peers
Oct 25, 2026
Merged

zkochan merged 1 commit into
pnpm:mainfrom
lazerg:fix/issue-17322-run-gate-dedupe-peers

Conversation

@lazerg

@lazerg lazerg commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Closes #17322.

The verifyDepsBeforeRun lockfile check compared the lockfile's dedupePeers against false instead of the configured value, so with dedupePeers: true any lockfile change made the check fail. In pnpm v12 with a pnpmfile active this turned into an install before every pnpm run/pnpm exec, since the install that followed found nothing to do and the gate never recorded the tree as proven. pnpm v11 has the same gap (assertLockfileSettingsUpToDate never passed dedupePeers): it reports settings.dedupePeers as outdated after a lockfile change and runs one extra install.

Both now pass the configured dedupePeers. With the fix, the issue's repro runs the script directly on every run, and switching dedupePeers off still triggers an install. The existing v12 e2e test pinned the old behavior (a frozen verifier install after a relaid lockfile), so it now expects the script to run without an install.

Squash Commit Body

The verifyDepsBeforeRun lockfile check compared the lockfile's
dedupePeers with false instead of the configured value. With
dedupePeers: true, every lockfile change failed the check. In v12 with
an active pnpmfile the gate then installed before every run, because
the frozen install had nothing to do and the gate never recorded the
tree as proven. v11 reported settings.dedupePeers as outdated and ran
one extra install.

Both now pass the configured dedupePeers to the lockfile settings
check, the same way the install gate does.

Closes pnpm/pnpm#17322

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 (pnpm changeset) if this PR changes any published
    package. Keep it short and written for pnpm users — it becomes a release note.
  • Added or updated tests.

Written by an agent (Claude Code, claude-opus-5-5).


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed pnpm run and pnpm exec incorrectly reporting dependencies as outdated after a lockfile change when peer dependency deduplication is enabled.
    • Lockfile rewrites that preserve content, including adding a trailing newline, no longer trigger an unnecessary install.
    • Dependency freshness checks now account for peer dependency deduplication settings when comparing the current configuration with the lockfile. This helps avoid unnecessary installs when those settings match.

@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: pnpm/pnpm
  • Branch: main
  • File: .coderabbit.yaml
  • Commit: 34277fa
  • Layers: Repository YAML
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 56da4677-2e04-4148-95a3-44080013e850
Commits

Reviewing files that changed from the base of the PR and between a32abc0 and e625340.

Files selected for processing: 3
  • pnpm/crates/package-manager/src/optimistic_repeat_install/deps_status.rs
  • pnpm11/deps/status/src/assertWantedLockfileUpToDate.ts
  • pnpm11/deps/status/test/checkDepsStatus.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

Walkthrough

The freshness checks now use the configured dedupePeers value. Tests verify that matching lockfile settings are treated as up to date and that a script run after a lockfile rewrite does not trigger another install.

Changes: dedupePeers freshness

Layer / File(s) Summary
Configure freshness checks
pnpm11/deps/status/src/types.ts, pnpm11/deps/status/src/assertWantedLockfileUpToDate.ts, pnpm/crates/package-manager/src/optimistic_repeat_install/deps_status.rs
The status options include dedupePeers. The TypeScript lockfile check and Rust pre-run freshness check use the configured value.
Verify repeated-run behavior
pnpm11/deps/status/test/checkDepsStatus.test.ts, pnpm/crates/cli/tests/suite/verify_deps_before_run.rs, .changeset/verify-deps-before-run-dedupe-peers.md
Tests cover matching dedupePeers settings and confirm that a script runs without an additional install after a lockfile rewrite. The changeset records patch releases.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Assessment against linked issues

Objective Addressed Explanation
Stop repeated pre-run installs when dedupePeers is true and a lockfile changes [#17322] ✅

Possibly related PRs

  • pnpm/pnpm#17259: Both PRs change lockfile conditions used in freshness decisions.
  • pnpm/pnpm#17264: Both PRs modify settings used by pre-run freshness checks.

Suggested labels: product: pnpm@11, product: pacquet

Merge Risk: Minimal · up to e6253

The freshness checks now use the configured setting, with no identified issue requiring a fix before merge.

Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration.

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 Oct 25, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.59%. Comparing base (6761624) to head (e625340).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #17328   +/-   ##
=======================================
  Coverage   92.59%   92.59%           
=======================================
  Files        1882     1882           
  Lines      243454   243451    -3     
=======================================
+ Hits       225416   225420    +4     
+ Misses      18038    18031    -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 Oct 25, 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 2606.83 ms 2456.93 ms -5.8% 130.34 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store pnpr 1657.54 ms 1545.64 ms -6.8% 82.88 ms Within tolerance
isolated-fresh-restore-hot-cache-hot-store pacquet 237.97 ms 216.74 ms -8.9% 11.90 ms Within tolerance
isolated-fresh-restore-hot-cache-hot-store pnpr 244.78 ms 242.21 ms -1.0% 12.24 ms Within tolerance
isolated-repeat-install-hot-cache-hot-store pacquet 12.20 ms 11.76 ms -3.6% 2.00 ms Within tolerance
isolated-repeat-install-hot-cache-hot-store pnpr 11.06 ms 11.60 ms 4.8% 2.00 ms Within tolerance
isolated-repeat-install-cold-cache-hot-store pacquet 7.74 ms 7.89 ms 2.0% 2.00 ms Within tolerance
isolated-repeat-install-cold-cache-hot-store pnpr 7.71 ms 7.79 ms 1.1% 2.00 ms Within tolerance
isolated-fresh-install-cold-cache-cold-store pacquet 2464.35 ms 2457.88 ms -0.3% 123.22 ms Within tolerance
isolated-fresh-install-cold-cache-cold-store pnpr 1497.86 ms 1654.23 ms 10.4% 74.89 ms Inconclusive (overlapping samples)
isolated-fresh-install-hot-cache-hot-store pacquet 604.48 ms 624.58 ms 3.3% 30.22 ms Within tolerance
isolated-fresh-install-hot-cache-hot-store pnpr 446.23 ms 432.58 ms -3.1% 22.31 ms Within tolerance
isolated-fresh-install-cold-cache-hot-store pacquet 1614.06 ms 1599.49 ms -0.9% 80.70 ms Within tolerance
isolated-fresh-install-cold-cache-hot-store pnpr 269.76 ms 267.81 ms -0.7% 13.49 ms Within tolerance
isolated-fresh-resolve-hot-cache-offline pacquet 218.89 ms 217.48 ms -0.6% 10.94 ms Within tolerance
isolated-fresh-resolve-hot-cache-offline pnpr 87.86 ms 88.00 ms 0.2% 4.39 ms Within tolerance
isolated-peer-heavy-resolve-hot-cache-offline pacquet 208.99 ms 218.95 ms 4.8% 10.45 ms Within tolerance
isolated-linked-workspace-resolve-hot-cache-offline pacquet 89.00 ms 89.32 ms 0.4% 4.45 ms Within tolerance
isolated-injected-workspace-repeat-install-hot-cache-hot-store pacquet 102.62 ms 114.48 ms 11.6% 5.13 ms Inconclusive (overlapping samples)
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pacquet 4369.30 ms 4411.07 ms 1.0% 218.46 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pnpr 3478.75 ms 3459.33 ms -0.6% 173.94 ms Within tolerance
gvs-fresh-restore-hot-cache-hot-store pacquet 186.37 ms 191.61 ms 2.8% 9.32 ms Within tolerance
gvs-fresh-restore-hot-cache-hot-store pnpr 192.24 ms 192.09 ms -0.1% 9.61 ms Within tolerance
store-only-unlocked-direct-deps-cold-cache-hot-store pacquet 1256.54 ms 1251.46 ms -0.4% 62.83 ms Within tolerance
cargo-repeat-install-hot-cache-hot-store pacquet 34.11 ms 37.15 ms 8.9% 2.00 ms Inconclusive (overlapping samples)

Integrated-Benchmark Report (Linux)

Commit: e625340b269b

Regular scenarios report direct and pnpr installs. The peer-heavy resolver scenario compares current Rust, main Rust, and TypeScript pnpm; the linked, injected, and Cargo workspace scenarios compare 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.485 ± 0.130 2.344 2.676 1.60 ± 0.14
pacquet@main 2.611 ± 0.158 2.386 2.822 1.68 ± 0.15
pnpr@HEAD 1.554 ± 0.106 1.396 1.725 1.00
pnpr@main 1.649 ± 0.114 1.473 1.809 1.06 ± 0.10
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.48464155112,
      "stddev": 0.12953231021814454,
      "median": 2.45692996442,
      "user": 2.4272288800000004,
      "system": 1.9090999,
      "min": 2.34428687542,
      "max": 2.67556304442
    },
    {
      "command": "pacquet@main",
      "mean": 2.61144580512,
      "stddev": 0.15846026052477993,
      "median": 2.60683210942,
      "user": 2.45506058,
      "system": 2.005364,
      "min": 2.38583643942,
      "max": 2.82201803242
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.5535053854200003,
      "stddev": 0.10622762331217805,
      "median": 1.54563884442,
      "user": 2.31432148,
      "system": 1.8080496999999998,
      "min": 1.3962173314200002,
      "max": 1.7248797584200002
    },
    {
      "command": "pnpr@main",
      "mean": 1.6492872387200002,
      "stddev": 0.11362868411013681,
      "median": 1.6575425794200003,
      "user": 2.45582028,
      "system": 2.0444044000000003,
      "min": 1.4726768014200002,
      "max": 1.8093567224200002
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 222.5 ± 18.4 208.3 269.0 1.00
pacquet@main 238.9 ± 18.2 216.7 279.2 1.07 ± 0.12
pnpr@HEAD 245.8 ± 14.1 223.1 267.8 1.10 ± 0.11
pnpr@main 249.1 ± 14.6 232.0 273.5 1.12 ± 0.11
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.22249643958000004,
      "stddev": 0.01841473528530664,
      "median": 0.21673917898,
      "user": 0.24811158,
      "system": 0.5278852399999999,
      "min": 0.20825124498,
      "max": 0.26904943398000003
    },
    {
      "command": "pacquet@main",
      "mean": 0.23889412727999998,
      "stddev": 0.01817376393922544,
      "median": 0.23796758548000002,
      "user": 0.26704188,
      "system": 0.57036094,
      "min": 0.21669995998000002,
      "max": 0.27918143598000006
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.24578829257999998,
      "stddev": 0.014063549936473655,
      "median": 0.24221073348,
      "user": 0.27263028,
      "system": 0.55030164,
      "min": 0.22314003498,
      "max": 0.26775453898000007
    },
    {
      "command": "pnpr@main",
      "mean": 0.24908348188,
      "stddev": 0.014591194621536397,
      "median": 0.24477670648000002,
      "user": 0.24796487999999997,
      "system": 0.56693404,
      "min": 0.23199683298,
      "max": 0.27349884398
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 12.0 ± 1.8 8.6 18.9 1.08 ± 0.19
pacquet@main 12.5 ± 1.9 8.8 20.0 1.12 ± 0.20
pnpr@HEAD 11.7 ± 1.2 9.2 14.6 1.05 ± 0.15
pnpr@main 11.1 ± 1.1 8.8 14.9 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.012034614907859923,
      "stddev": 0.0018012229134412479,
      "median": 0.01175907676,
      "user": 0.006835823501945525,
      "system": 0.00621882178988327,
      "min": 0.00855067976,
      "max": 0.018893108760000003
    },
    {
      "command": "pacquet@main",
      "mean": 0.012461794002009129,
      "stddev": 0.0018624028252659274,
      "median": 0.01219761076,
      "user": 0.007304122739726026,
      "system": 0.006243480365296806,
      "min": 0.00882261176,
      "max": 0.01997703476
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.011702592991617647,
      "stddev": 0.0011732218218673497,
      "median": 0.011598037759999999,
      "user": 0.006745369264705877,
      "system": 0.005994438970588232,
      "min": 0.00918320776,
      "max": 0.014614998760000001
    },
    {
      "command": "pnpr@main",
      "mean": 0.011139750323981049,
      "stddev": 0.0010941408008041872,
      "median": 0.01106416776,
      "user": 0.006496652701421801,
      "system": 0.005672715639810427,
      "min": 0.00875924576,
      "max": 0.01491436176
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 8.0 ± 0.8 7.0 14.4 1.04 ± 0.11
pacquet@main 7.8 ± 0.4 7.1 10.6 1.01 ± 0.06
pnpr@HEAD 7.8 ± 0.4 7.1 10.3 1.02 ± 0.07
pnpr@main 7.7 ± 0.3 7.1 9.2 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.008011193327539268,
      "stddev": 0.0008079055725281095,
      "median": 0.00789404916,
      "user": 0.004887634869109949,
      "system": 0.003812051937172773,
      "min": 0.00699157316,
      "max": 0.014388068160000001
    },
    {
      "command": "pacquet@main",
      "mean": 0.007773671034576272,
      "stddev": 0.00039524573994764695,
      "median": 0.0077393791600000005,
      "user": 0.004688632881355931,
      "system": 0.0037485597288135623,
      "min": 0.007125635160000001,
      "max": 0.01058312016
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.007849131306258509,
      "stddev": 0.0004334293622686988,
      "median": 0.00779108166,
      "user": 0.004444560680272113,
      "system": 0.004054808095238095,
      "min": 0.007130605160000001,
      "max": 0.01025706516
    },
    {
      "command": "pnpr@main",
      "mean": 0.007709222362166062,
      "stddev": 0.00029968212989858636,
      "median": 0.007706016160000001,
      "user": 0.004588961083032493,
      "system": 0.0037618390613718402,
      "min": 0.00712035416,
      "max": 0.00917174416
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.467 ± 0.031 2.427 2.514 1.62 ± 0.13
pacquet@main 2.465 ± 0.022 2.442 2.509 1.62 ± 0.13
pnpr@HEAD 1.600 ± 0.132 1.379 1.739 1.05 ± 0.12
pnpr@main 1.523 ± 0.121 1.380 1.747 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.4669934325200003,
      "stddev": 0.03148827364689721,
      "median": 2.4578838215200003,
      "user": 2.24549904,
      "system": 1.45776606,
      "min": 2.42656338802,
      "max": 2.51400764202
    },
    {
      "command": "pacquet@main",
      "mean": 2.46506413242,
      "stddev": 0.02208247834686893,
      "median": 2.46435169852,
      "user": 2.3002831399999994,
      "system": 1.43315006,
      "min": 2.44154808702,
      "max": 2.50859700802
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.5996354094199998,
      "stddev": 0.13163665695738286,
      "median": 1.6542274020199998,
      "user": 1.7590526399999997,
      "system": 1.26320506,
      "min": 1.37927183502,
      "max": 1.73882287802
    },
    {
      "command": "pnpr@main",
      "mean": 1.5225285816199996,
      "stddev": 0.12093825084104669,
      "median": 1.4978582665199998,
      "user": 1.76487774,
      "system": 1.2549442599999998,
      "min": 1.3799763050199998,
      "max": 1.74670910302
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 626.5 ± 29.4 586.4 677.2 1.45 ± 0.14
pacquet@main 626.5 ± 79.4 574.1 845.1 1.45 ± 0.22
pnpr@HEAD 431.0 ± 36.0 384.0 488.6 1.00
pnpr@main 443.2 ± 64.8 347.7 537.3 1.03 ± 0.17
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.6264533417000001,
      "stddev": 0.029404946168618426,
      "median": 0.6245776361,
      "user": 0.8878539599999999,
      "system": 0.9462595400000001,
      "min": 0.5864003211000001,
      "max": 0.6772400861000001
    },
    {
      "command": "pacquet@main",
      "mean": 0.6265333110000001,
      "stddev": 0.07940441290417505,
      "median": 0.6044820156,
      "user": 0.8987642599999999,
      "system": 0.9665666399999999,
      "min": 0.5741353701,
      "max": 0.8450527221
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.4310403378000001,
      "stddev": 0.03604146562400511,
      "median": 0.4325773746,
      "user": 0.41567856000000003,
      "system": 0.7964099399999999,
      "min": 0.38397342510000004,
      "max": 0.48857563410000004
    },
    {
      "command": "pnpr@main",
      "mean": 0.4431821813,
      "stddev": 0.0648037124154457,
      "median": 0.4462304561,
      "user": 0.41996686000000005,
      "system": 0.7787173399999999,
      "min": 0.34765558710000005,
      "max": 0.5373058051
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.602 ± 0.011 1.590 1.621 5.99 ± 0.12
pacquet@main 1.614 ± 0.015 1.593 1.646 6.04 ± 0.13
pnpr@HEAD 0.267 ± 0.005 0.257 0.275 1.00
pnpr@main 0.273 ± 0.013 0.259 0.297 1.02 ± 0.05
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.60204220484,
      "stddev": 0.01103700094651709,
      "median": 1.59948900234,
      "user": 0.83030038,
      "system": 0.8005119,
      "min": 1.5895858758399999,
      "max": 1.62054150184
    },
    {
      "command": "pacquet@main",
      "mean": 1.61417485004,
      "stddev": 0.015124105029375823,
      "median": 1.61405526734,
      "user": 0.8366515799999998,
      "system": 0.7764287000000001,
      "min": 1.59340456984,
      "max": 1.64592948584
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.2672349151400001,
      "stddev": 0.005245043120881657,
      "median": 0.26781112434,
      "user": 0.23469968,
      "system": 0.5025701,
      "min": 0.25671649384,
      "max": 0.27506168784
    },
    {
      "command": "pnpr@main",
      "mean": 0.27319927714000003,
      "stddev": 0.012939910379132618,
      "median": 0.26975674834,
      "user": 0.24696928,
      "system": 0.5013452,
      "min": 0.25893170884000005,
      "max": 0.29736774984000003
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 217.9 ± 16.3 198.0 253.1 2.47 ± 0.19
pacquet@main 220.6 ± 11.7 206.9 250.1 2.50 ± 0.14
pnpr@HEAD 88.7 ± 2.0 86.6 96.0 1.00 ± 0.03
pnpr@main 88.3 ± 1.7 86.4 93.6 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.2178847610418182,
      "stddev": 0.016301245587329455,
      "median": 0.21747670286,
      "user": 0.19456470363636366,
      "system": 0.07142263454545456,
      "min": 0.19796062786000002,
      "max": 0.25310582986
    },
    {
      "command": "pacquet@main",
      "mean": 0.22058789501384618,
      "stddev": 0.011667998263789735,
      "median": 0.21889404486,
      "user": 0.1919394169230769,
      "system": 0.07342133384615383,
      "min": 0.20688694286,
      "max": 0.25010567486
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.0887100830475,
      "stddev": 0.001962577489483474,
      "median": 0.08799892436000001,
      "user": 0.031764683749999995,
      "system": 0.011736538125000001,
      "min": 0.08662942286,
      "max": 0.09603958986
    },
    {
      "command": "pnpr@main",
      "mean": 0.08832240248499999,
      "stddev": 0.0016738124238212307,
      "median": 0.08785974636,
      "user": 0.028256871249999992,
      "system": 0.014322179999999999,
      "min": 0.08643613786,
      "max": 0.09357533486
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 214.8 ± 13.0 196.4 233.7 1.00 ± 0.09
pacquet@main 213.8 ± 13.4 201.2 240.8 1.00
pnpm@HEAD 3171.5 ± 48.5 3087.8 3225.4 14.83 ± 0.96
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.21482196681333335,
      "stddev": 0.012969140031723747,
      "median": 0.21894870948,
      "user": 0.21158759111111108,
      "system": 0.04595932444444444,
      "min": 0.19644923048000001,
      "max": 0.23367638748
    },
    {
      "command": "pacquet@main",
      "mean": 0.21383485192444449,
      "stddev": 0.013432391829997219,
      "median": 0.20898589748000002,
      "user": 0.21156914666666662,
      "system": 0.046321546666666664,
      "min": 0.20120856448,
      "max": 0.24084806648
    },
    {
      "command": "pnpm@HEAD",
      "mean": 3.1714693958133333,
      "stddev": 0.04854444165703852,
      "median": 3.19046995148,
      "user": 4.685671368888887,
      "system": 0.3388075466666667,
      "min": 3.08781238448,
      "max": 3.22535189248
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 89.6 ± 3.3 85.2 100.5 1.00
pacquet@main 90.1 ± 4.8 85.0 104.5 1.01 ± 0.06
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.08962297975212122,
      "stddev": 0.00327159084218408,
      "median": 0.08932076854000001,
      "user": 0.07659053757575758,
      "system": 0.04889998787878786,
      "min": 0.08515296254,
      "max": 0.10049621754000002
    },
    {
      "command": "pacquet@main",
      "mean": 0.09009965654000002,
      "stddev": 0.004771937147697826,
      "median": 0.08899994504,
      "user": 0.07762868624999998,
      "system": 0.047918012499999996,
      "min": 0.08501034854,
      "max": 0.10454218154000001
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 114.7 ± 11.3 100.9 141.0 1.11 ± 0.12
pacquet@main 103.3 ± 5.1 96.5 117.1 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.11469647908000001,
      "stddev": 0.011262965471612811,
      "median": 0.11448384172,
      "user": 0.0465999,
      "system": 0.07669621999999998,
      "min": 0.10090409272,
      "max": 0.14097532072000002
    },
    {
      "command": "pacquet@main",
      "mean": 0.10327086803034483,
      "stddev": 0.005114051510459256,
      "median": 0.10262317072,
      "user": 0.04199359517241377,
      "system": 0.06912398965517243,
      "min": 0.09645057572,
      "max": 0.11713570672000001
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.478 ± 0.168 4.318 4.838 1.28 ± 0.07
pacquet@main 4.469 ± 0.209 4.318 4.879 1.28 ± 0.07
pnpr@HEAD 3.501 ± 0.122 3.400 3.812 1.00
pnpr@main 3.518 ± 0.158 3.394 3.925 1.00 ± 0.06
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.4781814432800005,
      "stddev": 0.1684094401691245,
      "median": 4.41107087568,
      "user": 1.8996446800000002,
      "system": 1.40746606,
      "min": 4.318089559680001,
      "max": 4.837635785680001
    },
    {
      "command": "pacquet@main",
      "mean": 4.46891638628,
      "stddev": 0.20936250043952967,
      "median": 4.36929850768,
      "user": 1.8482878799999996,
      "system": 1.4230499599999997,
      "min": 4.31810003968,
      "max": 4.87890990368
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.50100813138,
      "stddev": 0.12236383242624223,
      "median": 3.4593257606799996,
      "user": 1.81900628,
      "system": 1.36730356,
      "min": 3.4003351986799997,
      "max": 3.81217830768
    },
    {
      "command": "pnpr@main",
      "mean": 3.51822066488,
      "stddev": 0.15759356454083814,
      "median": 3.4787471966799997,
      "user": 1.9470184799999999,
      "system": 1.4721024600000001,
      "min": 3.3936028826799998,
      "max": 3.92495106968
    }
  ]
}

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 193.8 ± 10.4 181.0 211.9 1.04 ± 0.10
pacquet@main 187.2 ± 14.4 165.0 225.3 1.00
pnpr@HEAD 190.5 ± 8.8 175.3 203.4 1.02 ± 0.09
pnpr@main 195.0 ± 13.6 176.6 230.1 1.04 ± 0.11
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.19381661673714284,
      "stddev": 0.010419797487941062,
      "median": 0.19161062538,
      "user": 0.24040160571428568,
      "system": 0.17527628285714286,
      "min": 0.18096212288,
      "max": 0.21191128488
    },
    {
      "command": "pacquet@main",
      "mean": 0.18718876680857144,
      "stddev": 0.01442862311163269,
      "median": 0.18637263188,
      "user": 0.22678646285714285,
      "system": 0.16664642571428573,
      "min": 0.16499957788,
      "max": 0.22533058888
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.19052981841846156,
      "stddev": 0.008814834575846331,
      "median": 0.19208599188,
      "user": 0.22647558923076927,
      "system": 0.15853606307692306,
      "min": 0.17533465088,
      "max": 0.20344355088
    },
    {
      "command": "pnpr@main",
      "mean": 0.1950260682646154,
      "stddev": 0.01363913864474017,
      "median": 0.19223900088,
      "user": 0.21978228153846155,
      "system": 0.17064106307692306,
      "min": 0.17661256188,
      "max": 0.23011904288
    }
  ]
}

Scenario: Store only: unlocked direct deps, cold cache + hot store

Store-only install (enableModulesDir: false, per-file store index, trusted lockfile) against a lockfile missing the direct dependencies that have peers, with the metadata cache wiped per iteration: the install resolves those from the registry, reuses their subtrees from the lockfile and checks the store, linking nothing. Direct installs only.

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.266 ± 0.034 1.223 1.319 1.00 ± 0.03
pacquet@main 1.263 ± 0.022 1.237 1.306 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.2661681802199998,
      "stddev": 0.03394621481735659,
      "median": 1.25145804332,
      "user": 0.6532588999999999,
      "system": 0.27379951999999996,
      "min": 1.22320331282,
      "max": 1.31928887182
    },
    {
      "command": "pacquet@main",
      "mean": 1.2626635093199998,
      "stddev": 0.022207469943424006,
      "median": 1.25653685832,
      "user": 0.6497852,
      "system": 0.23965322000000003,
      "min": 1.2368225848199998,
      "max": 1.3055055708199998
    }
  ]
}

Scenario: Cargo: repeat install, hot cache + hot store

Frozen repeat install of a Cargo workspace (cargo.enabled: true) whose crates are already materialized in <storeDir>/v11/crates/ and linked into .pnpm/crates/crates-io. Direct installs only.

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 38.2 ± 4.7 31.3 52.9 1.08 ± 0.17
pacquet@main 35.4 ± 3.7 30.8 50.3 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.03820938228231882,
      "stddev": 0.004662282671656418,
      "median": 0.03714839292,
      "user": 0.027996487536231886,
      "system": 0.019805573623188404,
      "min": 0.03129166792,
      "max": 0.05287949292
    },
    {
      "command": "pacquet@main",
      "mean": 0.03537278366074074,
      "stddev": 0.0037328758746894663,
      "median": 0.03410897192,
      "user": 0.02414242419753086,
      "system": 0.019745999259259267,
      "min": 0.03078525692,
      "max": 0.05029126692
    }
  ]
}

@garnet-runtime-review

garnet-runtime-review Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Execution Profiles recorded for 1 job, triggered by e625340

1 job unchanged · compared with a32abc0
recorded at the kernel by Garnet · 2026-10-25 10:15 UTC

TS CI / test ↗ · 26 destinations
@@ a32abc0 (previous) vs e625340 (current) @@
  systemd
  ├─ bash
  │  └─ bash
  │     └─ bash
  │        └─ bash
  │           └─ bash
  │              └─ bash
  │                 ├─ bash
  │                 │  ├─ bash
  │                 │  │  └─ pn (step: "Validate test chunk inputs")
  │                 │  │     ├─ dash
  │                 │  │     │  └─ node
  │                 │  │     │     └─ pn
  │                 │  │     │        └─ node
  │                 │  │     │           ├─ node
  │                 │  │     │           │  ├─ ○ 192.168.127.1
  │                 │  │     │           │  └─ ○ github[.]com
  │                 │  │     │           ├─ ○ codeload.github[.]com
  │                 │  │     │           ├─ ○ npm.jsr[.]io
  │                 │  │     │           └─ ○ registry.npmjs[.]org
  │                 │  │     └─ ○ nodejs[.]org
  │                 │  └─ gh (step: "Wait for prebuilt pnpr binaries")
  │                 │     └─ ○ api.github[.]com
  │                 └─ node (runner background · +1 −1)
- │                    ├─ ○ productionresultssa0.blob.core.windows[.]net
+ │                    └─ ○ productionresultssa13.blob.core[.]windows
  ├─ chronyd (runner background · +4 −4)
- │  ├─ ○ 139.177.202.26
+ │  ├─ ○ 144.202.41.38
  │  ├─ ○ 169.254.169.123
  │  ├─ ○ 185.125.190.56
  │  ├─ ○ 185.125.190.57
  │  ├─ ○ 185.125.190.58
+ │  ├─ ○ 24.63.87.46
- │  ├─ ○ 38.124.183.194
+ │  ├─ ○ 64.79.100.197
+ │  ├─ ○ 69.89.207.99
- │  ├─ ○ 72.46.53.234
- │  ├─ ○ 73.185.182.209
  │  └─ ○ 91.189.91.157
  ├─ nginx (runner background · +1 −1)
  │  └─ nginx
  │     ├─ ○ 140.82.113.21
  │     ├─ ○ 140.82.113.22 (github infra · rotated from 140.82.112.22)
+ │     ├─ ○ 140.82.114.21
  │     ├─ ○ 8.8.8.8
- │     └─ ○ glb-db52c2cf8be544.github[.]com
- ├─ systemd-resolve (runner background · −1)
- │  └─ ○ 8.8.4.4
  └─ snapd
     └─ ○ api.snapcraft[.]io
 
  Runner.Worker
  ├─ MainThread
  │  ├─ pnpm
  │  │  └─ ○ unofficial-builds.nodejs[.]org
  │  └─ ○ blacksmith.blob.core.windows[.]net
  └─ bash
     └─ rustup (step: "Initialize Rust before dependenc…tion ($/.github/actions/rustup)")
        ├─ ○ dualstack.k.sni.global.fastly[.]net
        └─ ○ localhost (dns resolver)

View this job's Execution Profile in Garnet →


💡 How to read this
Runner.Worker          ← process on a path
└─ npm
   └─ node             ← process that acted
      └─ ○ npmjs[.]org ← observed action

follow a path downward to see what ran and what it did — each path to an observed action is an execution chain

names on the path = processes · ○ = observed action · (…) = context

+ only in the current record · − only in the previous record · runner background = the runner's infrastructure, not your workflow

@lazerg
lazerg marked this pull request as ready for review October 25, 2026 02:37
@lazerg
lazerg requested a review from zkochan as a code owner October 25, 2026 02:37
@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 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Oct 25, 2026
@zkochan
zkochan force-pushed the fix/issue-17322-run-gate-dedupe-peers branch from a32abc0 to e625340 Compare October 25, 2026 10:06

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

@qodo-code-review

qodo-code-review Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

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

Grey Divider


Remediation recommended

1. Peer deduplication can cause repeat installs 🐞 Bug ➹ Performance
Description
The new dedupePeers comparison uses the setting from the parent run or exec command, but
INSTALL_CLI_OPTION_NAMES does not forward --dedupe-peers to the implicit install. When that CLI
override is used and a changed lockfile requires reconciliation, the install uses the workspace
default instead; the recheck can remain outdated and subsequent commands can install again.
Code

pnpm11/deps/status/src/assertWantedLockfileUpToDate.ts[181]

+    dedupePeers: config.dedupePeers,
Relevance

●●● Strong

Accepted history supports propagating status-check settings; this omission can cause repeated
installs under the PR’s stated intent.

PR-#17148
PR-#15073

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The added comparison checks the effective command configuration. The pre-run gate invokes an
implicit install and then rechecks that same configuration, but its CLI-option allowlist omits
dedupe-peers; the install's own default is false.

pnpm11/deps/status/src/assertWantedLockfileUpToDate.ts[178-184]
pnpm11/exec/commands/src/runDepsStatusCheck.ts[56-77]
pnpm11/exec/commands/src/runDepsStatusCheck.ts[265-292]
pnpm11/exec/commands/src/runDepsStatusCheck.ts[342-442]
pnpm11/installing/deps-installer/src/install/extendInstallOptions.ts[390-398]

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 v11 pre-run status check now compares the CLI-provided `dedupePeers` value, but its implicit install does not receive the `--dedupe-peers` option. The install can therefore leave the status check outdated and repeat on later runs.

## Fix Focus Areas
- pnpm11/deps/status/src/assertWantedLockfileUpToDate.ts[178-184]
- pnpm11/exec/commands/src/runDepsStatusCheck.ts[342-411]
- pnpm11/exec/commands/src/runDepsStatusCheck.ts[414-442]

## Recommended Fix
Add `dedupe-peers` to the implicit install's forwarded CLI options. Test a run or exec with a CLI-only peer-deduplication override that requires an install, and verify that the recheck becomes up to date.

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

Dismiss ↗ | View ↗


Grey Divider

Context sources
⚠️ Tickets: not configured — No jira, linear integration is connected for the linked tickets
✅ Compliance rules (platform): 61 rules
✅ Cross-repo context — repo relationships
Review mode: Auto: ⚖️ Balanced: Cross-version runtime behavior change affects install gates and lockfile correctness.

Grey Divider

Tip of the day
💡 Did you know, you can enable the Remediation agent and Qodo fixes findings in a dedicated fix PR

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

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.

@zkochan

zkochan commented Oct 25, 2026

Copy link
Copy Markdown
Member

Rebased onto main (e625340). The only conflict was in pnpm11/deps/status/test/checkDepsStatus.test.ts, where #17259 added registryPrefixes tests to the same describe block; the new dedupePeers test now follows them. No other change was needed.

Review of the change

  • Both gates now pass the configured dedupePeers to the lockfile settings check, which treats a missing value as false. The Rust install gate already did this, so the run gate matches it.
  • The v11 unit test is a real regression test: with the dedupePeers line removed from assertLockfileSettingsUpToDate, it fails with Setting settings.dedupePeers of lockfile in /project is outdated.
  • Ran locally: the verify_deps_before_run e2e module (48 tests pass) and the settings change detection block of the deps.status unit tests.

Qodo finding declined (--dedupe-peers not forwarded to the implicit install): pnpm run and pnpm exec only accept the options in INSTALL_CLI_OPTION_NAMES, so a bare --dedupe-peers is rejected as an unknown option before the gate runs. A --config.dedupe-peers=... override lands in rawCliConfig, which createCliConfigArgs forwards to the install in full. dedupe-peers is otherwise a workspace setting that both the gate and the spawned install read from pnpm-workspace.yaml. The sibling settings the same check compares (autoInstallPeers, excludeLinksFromLockfile, peersSuffixMaxLength, injectWorkspacePackages) are forwarded the same way.

Status: all 71 checks pass on e625340, CodeRabbit approved it with no actionable comments, and nothing remains within the PR's scope.


Written by an agent (Claude Code, claude-fable-5-1).

@zkochan
zkochan merged commit 0131bcc into pnpm:main Oct 25, 2026
73 checks passed
zkochan added a commit that referenced this pull request Oct 26, 2026
…the repeat-install fast path (#17383)

A contract test reads the fields of `Config` from its source and requires
each to be classified: recorded in the workspace state, ruling the fast
path out, reaching it through another input, not an install input, or a
known gap. A recorded field is proven by changing it and asserting the
install gate reports its setting key, and a blocking field by asserting
the fast path is ruled out. A new `Config` field fails the test until it
is classified.

The gaps the classification found were checked with the CLI: changing
`virtualStoreDirMaxLength`, `globalVirtualStoreDir`, or turning on
`dangerouslyAllowAllBuilds`, or turning off `skipRuntimes` leaves the fast path reporting the tree up
to date while a full install changes it.

Also drop the `dedupe_peers` value every freshness caller passed through
from the config (`GatePolicy`, `CheckLockfileSettingsDriftOptions` and
the content checks). The checks now read it from the config, so no gate
can compare the lockfile against a hard-coded value again, the bug fixed
by #17328.

Part of pnpm/tasks#219.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

verifyDepsBeforeRun reinstalls before every run when dedupePeers is true and a pnpmfile is active (12.15.0 regression)

3 participants