Repository navigation
Conversation
…space link A frozen install rejected a freshly generated lockfile when an injected workspace package declared a peer dependency that the consuming project provides from the workspace. The lockfile snapshot records that peer as `link:<dir>`, and the freshness check re-tested every resolved peer against the declared range, which never matches a `link:` ref. The same test also failed for an unmet peer, which pnpm only warns about. The resolved peers are the parent's choice, so they do not indicate a stale lockfile. The check now compares only the declared peer ranges and `peerDependenciesMeta` with the ones recorded in the lockfile, which still catches every edit to the injected package's peers. pnpm v11 is not affected. Closes #16332 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
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 configurationConfiguration used: Repository: pnpm/pnpm/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughThe local peer dependency freshness check no longer compares declared peer specs with resolved snapshot dependencies. New regression tests cover frozen installs with workspace and mismatched peer-provider specs. ChangesInjected peer freshness
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Assessment against linked issues
Suggested labels: Merge Risk: ⚪ Minimal · up to The frozen-install fix is mergeable after normal checks; no actionable risk remains in the supplied evidence. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The change fixes rejection of freshly generated lockfiles while retaining checks for edits to an injected package’s declared peers. No security exploit is established. Validation of unexpected peer references in an existing lockfile remains uncertain. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Hardening Proposals
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Micro-Benchmark ResultsLinux |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #16346 +/- ##
==========================================
- Coverage 92.13% 92.12% -0.01%
==========================================
Files 1509 1509
Lines 203180 203159 -21
==========================================
- Hits 187197 187163 -34
- Misses 15983 15996 +13 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Same-run regression checkHEAD 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.
Integrated-Benchmark Report (Linux)Commit: 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
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.4662387041000007,
"stddev": 0.09566167823167793,
"median": 2.4800340193,
"user": 1.7303226200000001,
"system": 1.65683914,
"min": 2.3372315408000004,
"max": 2.5989012738
},
{
"command": "pacquet@main",
"mean": 2.5425675173,
"stddev": 0.1675388358518125,
"median": 2.5469518443,
"user": 1.9228369199999995,
"system": 1.8358925400000001,
"min": 2.3279390538,
"max": 2.8245666648000003
},
{
"command": "pnpr@HEAD",
"mean": 1.6719993753,
"stddev": 0.17701007662101093,
"median": 1.6066873563000001,
"user": 2.12406632,
"system": 2.14381854,
"min": 1.4261860088,
"max": 1.9292126327999999
},
{
"command": "pnpr@main",
"mean": 1.7984114112,
"stddev": 0.3598106697727547,
"median": 1.6844715898,
"user": 2.2127481199999997,
"system": 2.2256415400000003,
"min": 1.5337586388,
"max": 2.7401366798
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.42829763554000005,
"stddev": 0.03842173893499801,
"median": 0.43296753544,
"user": 0.46473205999999995,
"system": 0.87482136,
"min": 0.37374312844,
"max": 0.5041949544400001
},
{
"command": "pacquet@main",
"mean": 0.42948986874000006,
"stddev": 0.05555352203246832,
"median": 0.42008731744000005,
"user": 0.48073346,
"system": 0.8704574600000001,
"min": 0.36792841744000004,
"max": 0.5666889604400001
},
{
"command": "pnpr@HEAD",
"mean": 0.46070651664000006,
"stddev": 0.07817936999517561,
"median": 0.48522373744,
"user": 0.50389336,
"system": 0.8830365600000001,
"min": 0.34468287044,
"max": 0.5580445194400001
},
{
"command": "pnpr@main",
"mean": 0.44871614404000004,
"stddev": 0.03648507244000358,
"median": 0.43650360844,
"user": 0.48604585999999994,
"system": 0.8658211599999998,
"min": 0.41643702044,
"max": 0.5329316764400001
}
]
}Scenario: Isolated linker: repeat install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.011334191122857136,
"stddev": 0.0011637371168639625,
"median": 0.01125439638,
"user": 0.006688340000000001,
"system": 0.0054131616,
"min": 0.00921979338,
"max": 0.015836180380000002
},
{
"command": "pacquet@main",
"mean": 0.01173575320173913,
"stddev": 0.0011349014341088452,
"median": 0.01163213288,
"user": 0.007310893043478262,
"system": 0.005204973913043479,
"min": 0.00867406238,
"max": 0.01459774338
},
{
"command": "pnpr@HEAD",
"mean": 0.0115359042675,
"stddev": 0.0009441773544645617,
"median": 0.011409141880000001,
"user": 0.006403809166666672,
"system": 0.005902099833333331,
"min": 0.00930588938,
"max": 0.014274239380000001
},
{
"command": "pnpr@main",
"mean": 0.01160806507230769,
"stddev": 0.0016362768229974264,
"median": 0.011519100380000001,
"user": 0.006727766425339367,
"system": 0.005599416108597281,
"min": 0.008615083380000001,
"max": 0.018447992380000004
}
]
}Scenario: Isolated linker: repeat install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.01806312726204081,
"stddev": 0.003241067334042161,
"median": 0.01763185416,
"user": 0.010050197006802717,
"system": 0.008905032653061223,
"min": 0.01270784916,
"max": 0.031110287160000003
},
{
"command": "pacquet@main",
"mean": 0.017719515840000002,
"stddev": 0.0036633569882898085,
"median": 0.016965996160000003,
"user": 0.009682819999999996,
"system": 0.008882,
"min": 0.01202468216,
"max": 0.02936726116
},
{
"command": "pnpr@HEAD",
"mean": 0.01867724455751552,
"stddev": 0.004254467881599649,
"median": 0.01823138016,
"user": 0.010258785590062115,
"system": 0.009312609937888199,
"min": 0.012124576159999999,
"max": 0.034174970160000005
},
{
"command": "pnpr@main",
"mean": 0.018368255056825402,
"stddev": 0.0031419665297273713,
"median": 0.018479736660000003,
"user": 0.0104822673015873,
"system": 0.00886699206349206,
"min": 0.01138291516,
"max": 0.03194220316
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.7789034446,
"stddev": 0.21285426217335035,
"median": 2.7168530307000003,
"user": 2.6117077199999996,
"system": 2.1344730399999996,
"min": 2.5514306852,
"max": 3.1891087582
},
{
"command": "pacquet@main",
"mean": 2.9378393839999997,
"stddev": 0.22587182563801428,
"median": 2.8668629142000004,
"user": 3.22147362,
"system": 2.36162134,
"min": 2.7006240032,
"max": 3.3718190872
},
{
"command": "pnpr@HEAD",
"mean": 1.7772993438000004,
"stddev": 0.1032663268099541,
"median": 1.7893943022,
"user": 2.14588792,
"system": 2.1125063400000004,
"min": 1.6525984052,
"max": 1.9276534842000002
},
{
"command": "pnpr@main",
"mean": 1.6588324673,
"stddev": 0.11612883897089035,
"median": 1.6181137042000002,
"user": 1.78886152,
"system": 1.68261164,
"min": 1.5067756782000001,
"max": 1.9044561062
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.9323230547000001,
"stddev": 0.04672697063229213,
"median": 0.9145512703,
"user": 1.3192413200000002,
"system": 1.2273667999999998,
"min": 0.8663028538,
"max": 1.0002450718
},
{
"command": "pacquet@main",
"mean": 0.9233988346,
"stddev": 0.054144578568567525,
"median": 0.9075179843000001,
"user": 1.29171242,
"system": 1.2162205,
"min": 0.8546640718000001,
"max": 1.0180282788000001
},
{
"command": "pnpr@HEAD",
"mean": 0.5098527573,
"stddev": 0.04150615184577035,
"median": 0.5024463683,
"user": 0.48860512,
"system": 0.8370048999999999,
"min": 0.4523722328,
"max": 0.5960687438000001
},
{
"command": "pnpr@main",
"mean": 0.5157892343,
"stddev": 0.04664465997088341,
"median": 0.5190903403,
"user": 0.47397821999999995,
"system": 0.8497880999999999,
"min": 0.4346611168,
"max": 0.5782102888
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.7826071694000003,
"stddev": 0.11194823506434874,
"median": 1.7931507666000002,
"user": 1.23325448,
"system": 0.9788167399999999,
"min": 1.6463039811000002,
"max": 1.9289725121000003
},
{
"command": "pacquet@main",
"mean": 1.7844516340000003,
"stddev": 0.06949926932079262,
"median": 1.7628492986,
"user": 1.2030543799999998,
"system": 1.0219709399999999,
"min": 1.6986655871,
"max": 1.9000052111
},
{
"command": "pnpr@HEAD",
"mean": 0.3447385326,
"stddev": 0.021824653928846315,
"median": 0.3433249521,
"user": 0.29797167999999996,
"system": 0.6444254399999998,
"min": 0.3162027631,
"max": 0.3905128921
},
{
"command": "pnpr@main",
"mean": 0.3820335635,
"stddev": 0.07373214808655765,
"median": 0.3438456556,
"user": 0.33481658000000003,
"system": 0.67134504,
"min": 0.3166615101,
"max": 0.5089178581
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.4336319490999999,
"stddev": 0.028964721125613137,
"median": 0.4366833647,
"user": 0.4496816,
"system": 0.19609868,
"min": 0.3933700772,
"max": 0.4831423172
},
{
"command": "pacquet@main",
"mean": 0.4688237122,
"stddev": 0.03053206809798796,
"median": 0.4745406837,
"user": 0.4922205,
"system": 0.19320617999999995,
"min": 0.41725330320000004,
"max": 0.5079509782
},
{
"command": "pnpr@HEAD",
"mean": 0.13858866243809523,
"stddev": 0.006489242526929228,
"median": 0.14016074520000002,
"user": 0.0703415761904762,
"system": 0.03115938,
"min": 0.11850467120000001,
"max": 0.14660121520000002
},
{
"command": "pnpr@main",
"mean": 0.13929136956842106,
"stddev": 0.005285571452864647,
"median": 0.1390203922,
"user": 0.07788704736842104,
"system": 0.026759327368421057,
"min": 0.1285757552,
"max": 0.1480698822
}
]
}Scenario: Isolated linker: peer-heavy resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.7121453737777779,
"stddev": 0.4188198931566862,
"median": 1.5377433569999999,
"user": 1.8268164066666666,
"system": 0.5415852088888888,
"min": 1.367989768,
"max": 2.4915133860000003
},
{
"command": "pacquet@main",
"mean": 1.3901969652222224,
"stddev": 0.2490823386068339,
"median": 1.400620139,
"user": 1.4931315177777775,
"system": 0.43345631999999995,
"min": 0.9630094450000001,
"max": 1.786620085
},
{
"command": "pnpm@HEAD",
"mean": 4.143009208222222,
"stddev": 0.8471875644758053,
"median": 3.8803985460000003,
"user": 6.143189628888889,
"system": 0.3333375422222222,
"min": 3.288868347,
"max": 5.544149754
}
]
}Scenario: Isolated linker: linked-workspace resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.24800485648181822,
"stddev": 0.01492667640456565,
"median": 0.2447575693,
"user": 0.20345589272727274,
"system": 0.09793794363636361,
"min": 0.22902391830000002,
"max": 0.2764045763
},
{
"command": "pacquet@main",
"mean": 0.22552700713333337,
"stddev": 0.015064431858625426,
"median": 0.2291448158,
"user": 0.17994770333333332,
"system": 0.08812133,
"min": 0.2074135443,
"max": 0.2563545123
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.944737524720001,
"stddev": 0.19697702933521818,
"median": 4.908084666320001,
"user": 2.947003079999999,
"system": 2.7004772200000002,
"min": 4.72430055532,
"max": 5.375561068320001
},
{
"command": "pacquet@main",
"mean": 4.72961624062,
"stddev": 0.14328869639003247,
"median": 4.686320653320001,
"user": 2.6486134800000003,
"system": 2.47977512,
"min": 4.58751958932,
"max": 5.08518591632
},
{
"command": "pnpr@HEAD",
"mean": 3.6513557026200005,
"stddev": 0.13486861370080006,
"median": 3.59595026632,
"user": 2.3135367799999997,
"system": 2.14560752,
"min": 3.5311911293200002,
"max": 3.95198680332
},
{
"command": "pnpr@main",
"mean": 3.65430890632,
"stddev": 0.053298978037987464,
"median": 3.6362576838200003,
"user": 2.4564904800000003,
"system": 2.2344375199999997,
"min": 3.5896512633200004,
"max": 3.73398085932
}
]
}Scenario: GVS linker: fresh restore, hot cache + hot storeSame 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.
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.1937122208333333,
"stddev": 0.014359309829851232,
"median": 0.19360855500000002,
"user": 0.24203436999999997,
"system": 0.20739521333333333,
"min": 0.175206166,
"max": 0.218750753
},
{
"command": "pacquet@main",
"mean": 0.17371906313333332,
"stddev": 0.012721063034468048,
"median": 0.172659171,
"user": 0.21972448666666666,
"system": 0.17580274666666668,
"min": 0.151080061,
"max": 0.195467539
},
{
"command": "pnpr@HEAD",
"mean": 0.21429865424999997,
"stddev": 0.013875158703737718,
"median": 0.212070493,
"user": 0.2528600366666666,
"system": 0.21036563,
"min": 0.199773761,
"max": 0.241978803
},
{
"command": "pnpr@main",
"mean": 0.20489367633333333,
"stddev": 0.014581188774512092,
"median": 0.208669254,
"user": 0.24438045333333328,
"system": 0.19486204666666662,
"min": 0.177617361,
"max": 0.22724996
}
]
} |
PR Summary by QodoAccept fresh lockfiles with injected dependencies and workspace peers
AI Description
Diagram
High-Level Assessment
Files changed (3)
|
Code Review by Qodo
1.
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
|
On Qodo's summary item "Peer freshness lacks a focused unit test": not adding one. The validator reads the injected package's manifest and resolves workspace links on disk. The security finding is answered in its thread. Written by an agent (Claude Code, claude-opus-5-5). |
Summary
Closes #16332.
Since 12.7.0,
pnpm install --frozen-lockfilerejects the lockfile it just wrote when an injected workspace package declares a peer dependency that the consumer provides from the workspace (local dependency "lib" at "lib" is outdated).The freshness check for injected/directory dependencies (added in #15356) re-tested each resolved peer in the snapshot against the declared range. A workspace-provided peer is recorded as
link:<dir>, which never satisfies a range spec. An unmet peer (a version outside the range, which pnpm only warns about) failed the same way.The resolved peers are the parent's choice and say nothing about staleness, so the check now compares only the declared peer ranges and
peerDependenciesMetaagainst the ones recorded inpackages:. Those comparisons already existed and still catch every edit to the injected package's peers.pnpm v11 is not affected: the reporter's script and the unmet-peer variant both pass on 11.28.0, so this is a v12-only fix.
Squash Commit Body
Checklist
already linked to it solves it.
are implemented in every affected version.
pnpm changeset) if this PR changes any publishedpackage. Keep it short and written for pnpm users — it becomes a release note.
Written by an agent (Claude Code, claude-opus-5-5).
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit