Repository navigation
Conversation
`resolutionMode: lowest-direct` and `time-based` were ignored whenever a release-age cutoff was in effect, which the built-in `minimumReleaseAge` default means is almost always. The picker branched on `publishedBy` rather than composing the two: the maturity branch always took the highest mature version and never read `pickLowestVersion`, so the mode only took effect when `minimumReleaseAge: 0` was set explicitly. The two settings answer different questions. `minimumReleaseAge` narrows which versions are on offer; `resolutionMode` picks an end of what is left. So the maturity branch now picks by `pickLowestVersion` over the matured view. The fallback is unchanged: when no mature version satisfies the range it still takes the lowest regardless of maturity, so the resolver reports the violation inline instead of throwing. Both stacks had the same shape, and pacquet documented the interaction as deliberate on `PickerOpts::pick_lowest_version` — that comment was describing the bug, and is corrected. Closes #13752. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (4)
📝 WalkthroughWalkthroughThe npm resolvers now honor lowest-version selection when minimum release age filters package versions. Rust and TypeScript tests cover ChangesResolution mode and maturity filtering
Estimated code review effort: 3 (Moderate) | ~20 minutes Assessment against linked issues
Sequence Diagram(s)sequenceDiagram
participant Install as Install tests
participant Resolver as npm resolver
participant Registry as Package metadata
Install->>Resolver: Resolve with resolutionMode and minimumReleaseAge
Resolver->>Registry: Read available package versions
Registry-->>Resolver: Return versions and publication times
Resolver-->>Install: Select the lowest mature version
Suggested labels: ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
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. Comment |
PR Summary by QodoFix resolver: apply resolutionMode even when minimumReleaseAge is active
AI Description
Diagram
High-Level Assessment
Files changed (5)
|
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Reviews (2): Last reviewed commit: "test(resolver): pin time-based against a..." | Re-trigger Greptile |
| // When minimumReleaseAge is active: pick from the mature versions by the | ||
| // caller's `pickLowestVersion` preference, since maturity narrows which | ||
| // versions are on offer and `resolutionMode` decides which end of what is | ||
| // left to take. If no mature version satisfies the range, fall back to the | ||
| // lowest version regardless of maturity so the resolver can report the | ||
| // violation inline and let the install layer (or other caller) decide what to | ||
| // do — never throw at this layer. |
There was a problem hiding this comment.
Remove duplicated picker narration
This comment narrates the branch, selection preference, and fallback implemented directly below, with the same explanation duplicated in the Rust implementation and tests. Keeping the behavior in code and focused tests avoids prose drifting as the two implementations evolve.
Context Used: Comments and docs in code are suspicious. Is test ... (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
There was a problem hiding this comment.
Trimmed in d9346f1, in both stacks. The comment is down to the two things the code cannot state: that minimumReleaseAge and resolutionMode compose (one narrows what is on offer, the other picks an end of the remainder) rather than being alternatives — which is exactly the assumption the bug was built on — and that the fallback drops the maturity filter deliberately, so the install layer reports the violation instead of this layer throwing. The narration of the branch and the fallback order is gone, and I removed a second copy of the fallback rationale that sat inside the Rust function body.
Written by an agent (Claude Code, claude-opus-5).
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pnpm/crates/cli/tests/suite/install.rs`:
- Around line 1503-1534: Add synchronized minimumReleaseAge coverage for
resolutionMode time-based in pnpm/crates/cli/tests/suite/install.rs:1503-1534
and pnpm11/installing/deps-installer/test/install/resolutionMode.ts:98-114.
Reuse the existing fixtures with fixed publish times, configure a nonzero
release age, and assert that the mature version is selected while the immature
candidate is excluded; update the corresponding Rust and TypeScript tests
consistently.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: f5e402c0-415f-4a58-919d-79d9a4e15c2f
📒 Files selected for processing (5)
.changeset/lowest-direct-under-minimum-release-age.mdpnpm/crates/cli/tests/suite/install.rspnpm/crates/resolving-npm-resolver/src/pick_package.rspnpm11/installing/deps-installer/test/install/resolutionMode.tspnpm11/resolving/npm-resolver/src/pickPackage.ts
Micro-Benchmark ResultsLinux |
Code Review by Qodo
1. Wildcard lowest pick sorts
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #13831 +/- ##
=======================================
Coverage 88.23% 88.24%
=======================================
Files 625 625
Lines 102801 102803 +2
=======================================
+ Hits 90710 90716 +6
+ Misses 12091 12087 -4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Review findings on #13831: - `time-based` sets the same lowest-direct preference the fix restores, but only `lowest-direct` was pinned. Cover it in both stacks; both new tests were confirmed to fail without the fix. - Trim the picker comments to the two things the code cannot say: that the release age and the resolution mode compose rather than compete, and that the fallback drops the maturity filter on purpose so the install layer reports the violation instead of this layer throwing. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
Code review by qodo was updated up to the latest commit d9346f1 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
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. Bencher consumes pacquet@HEAD and pnpr@HEAD. The tables below show mean ± σ; Bencher thresholds on the minimum latency, which is far less perturbed by shared-runner contention (noise only adds time). Scenario: Isolated linker: fresh restore, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.6434002444,
"stddev": 0.14694933474575142,
"median": 2.5964380249000003,
"user": 2.10143878,
"system": 1.6305715399999996,
"min": 2.4851972649,
"max": 2.9011479849,
"times": [
2.5339338239,
2.5457881029,
2.6178040739,
2.5357084549000004,
2.7459065489000003,
2.5848760639,
2.6079999859000003,
2.8756401399000002,
2.9011479849,
2.4851972649
]
},
{
"command": "pacquet@main",
"mean": 2.6577243441,
"stddev": 0.1423120182016773,
"median": 2.6003166539,
"user": 2.3494629799999998,
"system": 1.6801769399999997,
"min": 2.5165620369000004,
"max": 2.9354296039000003,
"times": [
2.8482817979,
2.9354296039000003,
2.6422099509000003,
2.5881032049,
2.5495139879,
2.5574184339,
2.5165620369000004,
2.7634600359,
2.5637342859000003,
2.6125301029
]
},
{
"command": "pnpr@HEAD",
"mean": 1.5858710411,
"stddev": 0.13000460931985378,
"median": 1.5769829494,
"user": 1.45885388,
"system": 1.4400598400000002,
"min": 1.3943026429,
"max": 1.8319618459,
"times": [
1.6376018409000002,
1.3943026429,
1.5163640579000002,
1.8319618459,
1.6536339999000003,
1.4641146869000001,
1.5015345149000001,
1.6595427039000001,
1.5132296529000002,
1.6864244649000002
]
},
{
"command": "pnpr@main",
"mean": 1.5797749846,
"stddev": 0.1551236207329595,
"median": 1.5873319699000001,
"user": 1.3634516799999998,
"system": 1.3623795399999996,
"min": 1.3977329869000001,
"max": 1.8068299799000003,
"times": [
1.4529026909000002,
1.6222823049000001,
1.6932019169,
1.8068299799000003,
1.8044436139000002,
1.4293757499000002,
1.3977329869000001,
1.5630534029,
1.6116105369000002,
1.4163166629000001
]
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.30899892704000004,
"stddev": 0.012542422367444196,
"median": 0.31037037244000004,
"user": 0.2737313,
"system": 0.61238514,
"min": 0.29180754494000005,
"max": 0.33097603894000005,
"times": [
0.31608481894,
0.29180754494000005,
0.31152612994000006,
0.31190974294,
0.29320234394000005,
0.29938774794000006,
0.30296053994000005,
0.30921461494,
0.32291974794000006,
0.33097603894000005
]
},
{
"command": "pacquet@main",
"mean": 0.29041494254000005,
"stddev": 0.041045873110450985,
"median": 0.27218264594,
"user": 0.255524,
"system": 0.55327684,
"min": 0.25225819694,
"max": 0.36698559594,
"times": [
0.28316387194000003,
0.26261502294000005,
0.35051026194,
0.36698559594,
0.32132674294,
0.27772871194000004,
0.25225819694,
0.26639169894000003,
0.25653274194000003,
0.26663657994
]
},
{
"command": "pnpr@HEAD",
"mean": 0.31801818154,
"stddev": 0.017776212499410176,
"median": 0.31743702194,
"user": 0.2687104,
"system": 0.57990644,
"min": 0.29473462494,
"max": 0.34652807794,
"times": [
0.33119587794000005,
0.31565593594,
0.34652807794,
0.31921810794000005,
0.32103533194000006,
0.31519616094,
0.34014931894000006,
0.30128924594000006,
0.29517913294000003,
0.29473462494
]
},
{
"command": "pnpr@main",
"mean": 0.30576765023999997,
"stddev": 0.010349300164496368,
"median": 0.30954492194000005,
"user": 0.2421407,
"system": 0.59614424,
"min": 0.28241879894000005,
"max": 0.31733796594,
"times": [
0.30942636894000003,
0.31241247494,
0.31127644494000006,
0.31733796594,
0.29547475894,
0.30094773194,
0.30569232194,
0.31302616094,
0.30966347494,
0.28241879894000005
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.7384569304,
"stddev": 0.07650637645084582,
"median": 2.7225661693000003,
"user": 1.9231994000000001,
"system": 1.56650714,
"min": 2.6477463648,
"max": 2.8977216768000003,
"times": [
2.7171364948,
2.8177375348000004,
2.8977216768000003,
2.7901403958000004,
2.6816657278,
2.6477463648,
2.7075182928,
2.6654248368,
2.7314821358000003,
2.7279958438
]
},
{
"command": "pacquet@main",
"mean": 2.7323606342000004,
"stddev": 0.07156649142071828,
"median": 2.7064486288000005,
"user": 1.9210378000000001,
"system": 1.54539674,
"min": 2.6693533768,
"max": 2.9041583628,
"times": [
2.6837319098,
2.7901176818000004,
2.9041583628,
2.7712167228,
2.7073916508000004,
2.7003696398000003,
2.6693533768,
2.7055056068,
2.6822530218000002,
2.7095083688000003
]
},
{
"command": "pnpr@HEAD",
"mean": 1.6955394164000002,
"stddev": 0.142181215273995,
"median": 1.7059062998,
"user": 1.3016252000000001,
"system": 1.37615054,
"min": 1.4995849968,
"max": 1.8905829288,
"times": [
1.7623635598,
1.8212971958,
1.4995849968,
1.8905829288,
1.6334494428,
1.8378851118,
1.5246438538,
1.7869440918,
1.5491939428,
1.6494490398
]
},
{
"command": "pnpr@main",
"mean": 1.7163955650999998,
"stddev": 0.17141628893331579,
"median": 1.6720717588,
"user": 1.4111523,
"system": 1.5173628399999999,
"min": 1.5156188328,
"max": 1.9612419258,
"times": [
1.5372996728,
1.8069966248,
1.9115706858,
1.9265188108,
1.9612419258,
1.5642883648,
1.6812272438,
1.5156188328,
1.6629162737999998,
1.5962772158
]
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.5004845076400001,
"stddev": 0.041089195902333446,
"median": 0.50831987674,
"user": 0.6913461599999999,
"system": 0.7655297,
"min": 0.44083077724,
"max": 0.55735945524,
"times": [
0.51793353024,
0.52829568324,
0.54068468624,
0.55735945524,
0.49870622324,
0.53368566024,
0.45805614224,
0.45384807324000004,
0.44083077724,
0.47544484524
]
},
{
"command": "pacquet@main",
"mean": 0.4915871054400001,
"stddev": 0.012705331541890078,
"median": 0.49352895824000004,
"user": 0.69275836,
"system": 0.7750645,
"min": 0.47068605924000007,
"max": 0.50860050524,
"times": [
0.49142699824,
0.47068605924000007,
0.48682525724000003,
0.50270215224,
0.49563091824000005,
0.49815234924000007,
0.50443327324,
0.4752434252400001,
0.50860050524,
0.48217011624000006
]
},
{
"command": "pnpr@HEAD",
"mean": 0.3549073944400001,
"stddev": 0.02157411456077325,
"median": 0.35010483524,
"user": 0.25883156,
"system": 0.5981614,
"min": 0.32625863424,
"max": 0.39663302124000005,
"times": [
0.39663302124000005,
0.38294852724000006,
0.35470851424000005,
0.35415646324000005,
0.36626795124000006,
0.33686102924000005,
0.34119872124000006,
0.34605320724000005,
0.34398787524,
0.32625863424
]
},
{
"command": "pnpr@main",
"mean": 0.3403674732400001,
"stddev": 0.01253586986346432,
"median": 0.34229162524,
"user": 0.27420266,
"system": 0.5472857,
"min": 0.32304746424,
"max": 0.36488320324000006,
"times": [
0.33632213324000004,
0.34509572324000004,
0.34608832424,
0.33992214624000006,
0.34466110424,
0.32304746424,
0.36488320324000006,
0.32473057524000004,
0.33005210124000006,
0.34887195724000003
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.8499798311399995,
"stddev": 0.06652923141203178,
"median": 1.83185659354,
"user": 1.0118482400000002,
"system": 0.9158299599999999,
"min": 1.77296562254,
"max": 1.96184963854,
"times": [
1.77296562254,
1.8159919145399999,
1.80580500154,
1.7855521165400001,
1.79396953354,
1.84772127254,
1.90976230754,
1.93287304754,
1.96184963854,
1.87330785654
]
},
{
"command": "pacquet@main",
"mean": 1.8005121616400004,
"stddev": 0.0462353578124795,
"median": 1.79561172804,
"user": 0.9330438400000001,
"system": 0.8374510599999999,
"min": 1.75129753054,
"max": 1.87995614254,
"times": [
1.80715085754,
1.75129753054,
1.75429730154,
1.87995614254,
1.78407259854,
1.76618889554,
1.81051095754,
1.84291358554,
1.85411696454,
1.75461678254
]
},
{
"command": "pnpr@HEAD",
"mean": 0.33434859644,
"stddev": 0.021214672786452227,
"median": 0.32792691754000003,
"user": 0.24903253999999997,
"system": 0.54642846,
"min": 0.31348244754,
"max": 0.36920780154,
"times": [
0.35252813754,
0.36920780154,
0.34234060054,
0.31517650754,
0.31348244754,
0.32501271354,
0.31795808754,
0.31360972754,
0.33084112154,
0.36332881954
]
},
{
"command": "pnpr@main",
"mean": 0.34711089334,
"stddev": 0.01297973449523024,
"median": 0.34384743804,
"user": 0.25943193999999997,
"system": 0.58650996,
"min": 0.33304355954000003,
"max": 0.37165285754,
"times": [
0.35236636254000003,
0.33304355954000003,
0.33512028154,
0.34323917254,
0.33579110454,
0.34445570354,
0.37165285754,
0.36302382454000004,
0.33785221554,
0.35456385154000003
]
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.24719263681333334,
"stddev": 0.01495525345644938,
"median": 0.24607659148000002,
"user": 0.21791474666666666,
"system": 0.07115942,
"min": 0.21927198148000002,
"max": 0.26598822848000003,
"times": [
0.24388316548000002,
0.24528891348000004,
0.26014249848000004,
0.26518038748,
0.24838704848000004,
0.24529832048000003,
0.24685486248000002,
0.23657295748000004,
0.26331552448,
0.21927198148000002,
0.26598822848000003,
0.22612775348000003
]
},
{
"command": "pacquet@main",
"mean": 0.23105940681333337,
"stddev": 0.031649095610652794,
"median": 0.22967100798000004,
"user": 0.20774574666666668,
"system": 0.06741942,
"min": 0.18754483448000003,
"max": 0.29118060748,
"times": [
0.24172536148000004,
0.19467450348000004,
0.19957917148,
0.22155264748000003,
0.18754483448000003,
0.23539866548000002,
0.26272842948,
0.22584515248000003,
0.20954264748000004,
0.29118060748,
0.23349686348000004,
0.26944399748000003
]
},
{
"command": "pnpr@HEAD",
"mean": 0.10156605137285715,
"stddev": 0.006179146437977134,
"median": 0.10054582348,
"user": 0.02776922285714286,
"system": 0.014720277142857138,
"min": 0.09063774748,
"max": 0.11385453448,
"times": [
0.09955063348000001,
0.09897135248000001,
0.10659897848000001,
0.11385453448,
0.10220614548000001,
0.10738516048,
0.10246855048,
0.10075487148000001,
0.09620556348,
0.09342984548000001,
0.10033677548,
0.10995985948,
0.09806466448000001,
0.11382074148,
0.10357450248000001,
0.10231061248000001,
0.10017680348,
0.09456853048000001,
0.09355209648,
0.09486790348,
0.10728906948,
0.09635435348,
0.10985325848000001,
0.10739011048000001,
0.09687423348,
0.10364506548,
0.09063774748,
0.09914747448000001
]
},
{
"command": "pnpr@main",
"mean": 0.09407530708714285,
"stddev": 0.004895022343142594,
"median": 0.09316474648,
"user": 0.024615579999999995,
"system": 0.011464422857142859,
"min": 0.08616438148000001,
"max": 0.10746096248,
"times": [
0.09830261348000001,
0.09368947448,
0.09535912948,
0.09598137148000001,
0.09371534348,
0.10136166548,
0.10016909948000001,
0.10272724748,
0.09211068148,
0.09158628348,
0.09615147248,
0.10746096248,
0.09833341148000001,
0.09578033348000001,
0.09006584048,
0.08902119348000001,
0.09264001848,
0.09038343848000001,
0.08918399948,
0.08731052148,
0.08616438148000001,
0.08848592448,
0.09602231748000001,
0.09263328548000001,
0.09211729348,
0.09113433248000001,
0.09429562648,
0.09192133548
]
}
]
}Scenario: Isolated linker: peer-heavy resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.959264057,
"stddev": 0.21915835666765882,
"median": 0.973194051,
"user": 0.9216126222222221,
"system": 0.1450306933333333,
"min": 0.652224692,
"max": 1.4308113290000002,
"times": [
0.9642738820000001,
0.807747086,
0.772631413,
1.043696658,
0.996276342,
0.973194051,
1.4308113290000002,
0.652224692,
0.9925210600000001
]
},
{
"command": "pacquet@main",
"mean": 0.9491955052222223,
"stddev": 0.2345662587637668,
"median": 0.9175590440000001,
"user": 0.9255999555555555,
"system": 0.1463246933333333,
"min": 0.7257958280000001,
"max": 1.4042393860000002,
"times": [
0.7257958280000001,
1.219607541,
1.4042393860000002,
0.939048455,
0.812646614,
0.9175590440000001,
1.032475687,
0.728893682,
0.7624933100000001
]
},
{
"command": "pnpm@HEAD",
"mean": 3.597877960111111,
"stddev": 0.2010214975763174,
"median": 3.564747445,
"user": 5.4755706222222225,
"system": 0.32916569333333334,
"min": 3.254196968,
"max": 3.8939047560000004,
"times": [
3.50883737,
3.591076901,
3.671169017,
3.4682709320000003,
3.564747445,
3.542366694,
3.8939047560000004,
3.886331558,
3.254196968
]
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.6073373149200005,
"stddev": 0.1179709622536068,
"median": 4.571492236319999,
"user": 2.1584021,
"system": 1.5692745,
"min": 4.51352638932,
"max": 4.88789764032,
"times": [
4.55210249532,
4.88789764032,
4.61561910632,
4.63212533032,
4.51659795432,
4.71553363032,
4.51800169732,
4.53108692832,
4.51352638932,
4.59088197732
]
},
{
"command": "pacquet@main",
"mean": 4.653266760719999,
"stddev": 0.14210364824609983,
"median": 4.63239062282,
"user": 2.2909795,
"system": 1.7071833999999995,
"min": 4.49202963432,
"max": 4.92559724332,
"times": [
4.61735673832,
4.66690141832,
4.54853869032,
4.52278206132,
4.92559724332,
4.49202963432,
4.65062617632,
4.64742450732,
4.87226018232,
4.58915095532
]
},
{
"command": "pnpr@HEAD",
"mean": 3.66371434862,
"stddev": 0.13230135140417634,
"median": 3.61664772732,
"user": 1.6446975000000001,
"system": 1.5828830000000003,
"min": 3.55486340532,
"max": 3.96912213332,
"times": [
3.68619494932,
3.62718293132,
3.63219998332,
3.6051264083200003,
3.56017706732,
3.57613011332,
3.55486340532,
3.96912213332,
3.82003397132,
3.60611252332
]
},
{
"command": "pnpr@main",
"mean": 3.63803062212,
"stddev": 0.06165452168816154,
"median": 3.62530923782,
"user": 1.7438645999999995,
"system": 1.6693893999999996,
"min": 3.56735893032,
"max": 3.75009150132,
"times": [
3.7205351543200003,
3.66430109532,
3.59853254132,
3.60470079632,
3.64591767932,
3.58203251032,
3.75009150132,
3.58556150632,
3.56735893032,
3.66127450632
]
}
]
} |
|
| Project | pnpm's project |
| Branch | pr/13831 |
| Testbed | pnpr |
⚠️ WARNING: No Threshold found!Without a Threshold, no Alerts will ever be generated.
Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the--ci-only-thresholdsflag.
Click to view all benchmark results
| Benchmark | Latency | milliseconds (ms) |
|---|---|---|
| isolated-linker.fresh-install.cold-cache.cold-store | 📈 view plot | 1,499.58 ms |
| isolated-linker.fresh-install.cold-cache.hot-store | 📈 view plot | 313.48 ms |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot | 326.26 ms |
| isolated-linker.fresh-resolve.hot-cache.offline | 📈 view plot | 90.64 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot | 1,394.30 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr | 📈 view plot | 3,554.86 ms |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 294.73 ms |
…13877) An auto-installed (hoisted) peer of a transitive dependency was resolved with the importer-level pick options, so under resolutionMode: lowest-direct / time-based it landed on the lowest version satisfying the peer range. A hoisted peer is not a dependency the user declared: the TypeScript CLI resolves it like a transitive dep, to the highest satisfying version under the subdep publish-date cutoff. pacquet now switches the importer ctx's depth-0 pick options to the subdep options once the manifest-declared direct deps have seeded — everything extend_tree walks after that point is a hoist arm. The bug was latent (any active release-age cutoff disabled resolutionMode entirely, masking it) and was unmasked by #13831. It surfaced in #13871, where clipanion's typanion "*" peer resolved to [email protected] - whose published manifest ships its build tooling as runtime dependencies - adding ~136 spurious packages to the lockfile. The TypeScript CLI already behaves this way; it gains a pinning test for the same scenario.
`allowBuilds` keys are not always bare package names: builds ignored for git/tarball dependencies are keyed by their dep path (`name@<non-semver source>`). Matching raw keys against the resolved name index would wrongly delete undecided entries for still-installed git dependencies. - Extract the package name from the key before pruning, and keep entries whose key yields no provable name (hashless git-repo keys, malformed shapes): `packageNameFromAllowBuildKey` in `@pnpm/building.policy`, and its Rust mirror `allow_build_key_package_name` in the workspace-manifest-writer crate. - Bail out of the Rust prune when the block re-parse fails instead of deleting the whole block, and stop mutating the decoded view before the flow-style bail. - Share the undecided-placeholder literal via `UNDECIDED_ALLOW_BUILD`. - Drop the stray resolution-mode changeset that duplicated the release note of pnpm#13831, already released in 11.22.0. Co-Authored-By: Claude Fable 5 <[email protected]>
Summary
Closes #13752.
resolutionMode: lowest-directandtime-basedwere ignored whenever a release-age cutoff was in effect. SinceminimumReleaseAgehas a non-zero built-in default, that is almost always — which is why the reporter found the setting worked only with an explicitminimumReleaseAge: 0, and why an invalidresolutionModevalue produced no visible effect either.The two settings answer different questions, and the picker was treating them as alternatives.
pickMatchingVersionFastbranches on whetherpublishedByis set: with it,pickRespectingMinReleaseAgetook the highest mature version and never readpickLowestVersion; without it,pickIgnoringReleaseAgehonoured the mode. ButminimumReleaseAgenarrows which versions are on offer —pickPackageFromMetaapplies the maturity filter tometabefore picking — andresolutionModedecides which end of what is left to take. They compose. The maturity branch now picks bypickLowestVersionover the matured view.The fallback is deliberately unchanged: when no mature version satisfies the range it still takes the lowest regardless of maturity, so the resolver reports the violation inline rather than throwing at that layer.
Both stacks had the same shape. pacquet's
PickerOpts::pick_lowest_versioneven documented the interaction as intended — "Forced tofalsewhenpublished_byis active" — but nothing else justified it, and the surrounding comments only explain the fallback. That doc comment was describing the bug, so it is corrected rather than preserved.Why the existing tests missed it. Both stacks'
lowest-directtests disable the interaction: the TypeScript one runs throughtestDefaults, which sets nominimumReleaseAge, and pacquet'sresolution_mode_lowest_direct_picks_lowest_direct_versionwritesminimumReleaseAge: 0intopnpm-workspace.yaml— the issue's own workaround. The new tests keep a release age configured, and both were confirmed to fail before the change.Squash Commit Body
Checklist
already linked to it solves it.
pnpm/port, or the description notes what still needs porting.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).
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit
Bug Fixes
minimumReleaseAgeis configured withlowest-directortime-basedresolution.Tests