Repository navigation
fix(pacquet): close the Resolution / verification install-parity gaps - #13172
Conversation
…nge bounds Port npm-semver's `includePrerelease: true` semantics instead of approximating them with a strip-the-prerelease fallback. A fully specified comparator (`>=9.0.0`, `<9.0.0`, a bare exact, or a `^`/`~` spec that itself carries a prerelease) keeps pure semver ordering, so `9.0.0-alpha.1` no longer satisfies `>=9.0.0` while still satisfying `9`, `>=9`, `^9.0.0`, and now also `<9.0.0`. For prerelease versions the range is evaluated per `||` alternative: the strict check first, then either a pure-ordering interval check (when a comparator pins the version's own base triple) or the stripped-prerelease fallback. Release versions keep the byte-for-byte strict path. Converts the `known_failures` boundary `pnpm_is_a_prerelease_version_strict_ge_full_version_does_not_satisfy` into a real unit test (upstream `checkEngine.ts:34`) and pins the newly exact behaviors with sibling tests.
…lback The resolver-side fallback (highest mature pick, else lowest match regardless of maturity) and the non-strict proceed path already exist; the known-failure boundary predated them. Replace the stub with the real port of `minimumReleaseAge.ts:68`: under a cutoff that makes every version immature, a non-strict `pnpm add @pnpm.e2e/[email protected]` completes and pins the lowest matching version (1.0.0), which normal resolution would never pick.
Port pnpm's `cleanupUnusedCatalogs`: when the setting is enabled, `add`, `update`, and `remove` run an unused-catalog cleanup pass in the same workspace-manifest write that persists updated catalog entries. The writer drops default-catalog entries no importer references with `catalog:`, named-catalog entries referenced by neither `catalog:<name>` nor `catalog:`, entries referenced only through removed dependencies, and whole blocks (or the file) once they empty — while keeping entries referenced by `catalog:`-valued `overrides:`. The setting is read from `pnpm-workspace.yaml` only, mirroring the TypeScript CLI (it is not part of pnpm's npmrc types). The writer-level port covers the `removeCatalogs.test.ts` suite; the CLI flow replaces the `cleanup_unused_catalogs` known-failure stub.
…oviders Two peer-resolution parity gaps: - merge_ranges now reduces distinct compatible wanted ranges to their semver intersection through node-semver's Range::intersect (the upstream mergePkgsDeps / safeIntersect policy), falling back to the or-join only under autoInstallPeersFromHighestMatch and dropping the peer only when no intersection exists. - resolve_peers carries the upstream lockedPeerContext / resolvedPeerProviderPaths machinery: tree nodes gained previous_dep_path, locked_peer_context, and dependency_names_whose_current_provider_must_win; the options gained resolved_peer_provider_paths plus the must-win guard inputs; results expose paths_by_node_id. A second pass re-pins a locked provider when it is still reachable, resolved to the same path, unsuffixed, inside the current peer range, and not overridden by a current provider that must win. The install-path wiring (capturing the locked context from the wanted lockfile and running the second pass) is a follow-up. Converts the three pacquet-cli peer_resolution known-failure stubs into real ports: the resolvePeers.ts intersection case and the two locked-peer-provider preference cases.
Port hoist.ts:320 (should hoist correctly peer dependencies) and hoist.ts:327 (should uninstall correctly peer dependencies): local [email protected] and [email protected] fixtures give the registry mock upstream's peer-variant shape, and REGISTRY_MOCK_LOCAL_PATTERNS now claims both names so the proxy no longer forwards them to npm. The peer-variant private hoist itself already worked; the stubs only recorded the fixture gap. Both tests pin enableGlobalVirtualStore off because write_workspace_yaml drops the harness default.
Installability now classifies each snapshot by its inbound edges over the lockfile graph instead of the propagated snapshot-level optional flag, mirroring pnpm's resolve-time packageIsInstallable dispatch (#13143): - an incompatible snapshot whose every inbound edge is an optionalDependencies edge, or comes from a skipped parent, is skipped as before; - an incompatible snapshot with at least one regular edge from an installed importer or non-skipped snapshot fails the install under engineStrict — and without engineStrict warns and materializes instead of being silently skipped — even when it is also optionally reachable; - unreachable snapshots keep the propagated-flag dispatch. Converts the edge_aware_engine_strict known-failure stub into the real port of optionalDependencies.ts:552 (fail on unsupported dependency of optional dependency) and adds edge-aware unit coverage for the fail, skip, and multi-edge shapes.
|
Warning Review limit reached
Next review available in: 7 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughChangesWorkspace catalog cleanup
Installability and engine checks
Peer resolution and hoisting
Estimated code review effort: 5 (Critical) | ~120 minutes Possibly related issues
Possibly related PRs
Suggested labels: Suggested reviewers: ✨ Finishing Touches🧪 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 |
PR Summary by Qodofix(pacquet): close Resolution/verification install-parity gaps with pnpm
AI Description
Diagram
High-Level Assessment
Files changed (42)
|
Micro-Benchmark ResultsLinux |
Code Review by Qodo
1. Catalog refs over-allocated
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #13172 +/- ##
==========================================
+ Coverage 86.44% 86.46% +0.02%
==========================================
Files 508 509 +1
Lines 85078 85644 +566
==========================================
+ Hits 73542 74056 +514
- Misses 11536 11588 +52 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
PR Code Suggestions ✨Warning
|
|||||||||
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
pnpm/crates/resolving-deps-resolver/src/resolve_importer.rs (1)
651-666: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick winPrefer iterator checks over heap allocation for uniqueness.
Collecting the ranges into a
BTreeSetjust to check if they are all identical incurs an unnecessary heap allocation and tree traversal. You can achieve the exact same fast-path validation using iterators with zero allocations.♻️ Proposed refactor
fn merge_ranges(ranges: &[&str], auto_install_peers_from_highest_match: bool) -> Option<String> { - if ranges.len() == 1 { - return Some(ranges[0].to_string()); - } - let unique: BTreeSet<&&str> = ranges.iter().collect(); - if unique.len() == 1 { - return Some(ranges[0].to_string()); + let first = ranges.first()?; + if ranges.iter().all(|r| r == first) { + return Some(first.to_string()); } if let Some(intersection) = intersect_ranges(ranges) {🤖 Prompt for 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. In `@pnpm/crates/resolving-deps-resolver/src/resolve_importer.rs` around lines 651 - 666, Update merge_ranges to replace the BTreeSet allocation and uniqueness check with an iterator-based all-equal validation against the first range, preserving the existing single-range and subsequent intersection/fallback behavior.
🤖 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/workspace-manifest-writer/src/edit.rs`:
- Around line 271-304: Guard the partial named-catalog removal in
remove_unused_named_catalogs with has_line_entries(manifest.text(), &[BLOCK])
before calling remove_mapping_entries or mutating manifest.catalogs. If the
top-level catalogs mapping has no line entries, skip the removal and leave the
decoded model unchanged; preserve the existing full-block removal and line-style
partial-removal behavior.
---
Nitpick comments:
In `@pnpm/crates/resolving-deps-resolver/src/resolve_importer.rs`:
- Around line 651-666: Update merge_ranges to replace the BTreeSet allocation
and uniqueness check with an iterator-based all-equal validation against the
first range, preserving the existing single-range and subsequent
intersection/fallback behavior.
🪄 Autofix (Beta)
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: ef0217f5-b7fc-4778-bfdd-309483559364
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock,!Cargo.lock
📒 Files selected for processing (41)
.changeset/pacquet-auto-install-peer-intersection.md.changeset/pacquet-cleanup-unused-catalogs.md.changeset/pacquet-edge-aware-engine-strict.md.changeset/pacquet-engine-prerelease-bounds.mdpnpm/crates/cli/tests/catalog.rspnpm/crates/cli/tests/hoist.rspnpm/crates/cli/tests/lockfile_verification.rspnpm/crates/cli/tests/optional_dependencies.rspnpm/crates/cli/tests/peer_resolution.rspnpm/crates/config/src/lib.rspnpm/crates/config/src/tests.rspnpm/crates/config/src/workspace_yaml.rspnpm/crates/package-is-installable/src/check_engine.rspnpm/crates/package-is-installable/src/tests/check_engine.rspnpm/crates/package-is-installable/tests/known_failures.rspnpm/crates/package-manager/src/add.rspnpm/crates/package-manager/src/catalog_cleanup.rspnpm/crates/package-manager/src/dependencies_graph_to_lockfile/tests.rspnpm/crates/package-manager/src/install_frozen_lockfile.rspnpm/crates/package-manager/src/install_package_from_registry/tests.rspnpm/crates/package-manager/src/install_with_fresh_lockfile.rspnpm/crates/package-manager/src/installability.rspnpm/crates/package-manager/src/installability/tests.rspnpm/crates/package-manager/src/lib.rspnpm/crates/package-manager/src/remove.rspnpm/crates/package-manager/src/update.rspnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rspnpm/crates/resolving-deps-resolver/src/resolve_importer.rspnpm/crates/resolving-deps-resolver/src/resolve_importer/tests.rspnpm/crates/resolving-deps-resolver/src/resolve_peers.rspnpm/crates/resolving-deps-resolver/src/resolve_peers/tests.rspnpm/crates/resolving-deps-resolver/src/resolve_workspace.rspnpm/crates/resolving-deps-resolver/src/resolved_tree.rspnpm/crates/workspace-manifest-writer/Cargo.tomlpnpm/crates/workspace-manifest-writer/src/edit.rspnpm/crates/workspace-manifest-writer/src/lib.rspnpm/crates/workspace-manifest-writer/src/tests.rspnpm/plans/TEST_PORTING.mdpnpr/.fixtures/packages/ajv-keywords/1.5.0/package.jsonpnpr/.fixtures/packages/ajv/4.10.4/package.jsonpnpr/crates/pnpr/src/config.rs
💤 Files with no reviewable changes (2)
- pnpm/crates/cli/tests/peer_resolution.rs
- pnpm/crates/package-is-installable/tests/known_failures.rs
Confidence Score: 5/5Safe to merge; all six ported behaviors have unit tests, the graph-walk edge classification is correct, and the follow-up gaps are clearly documented with TODO markers. Each of the six changes faithfully replicates the upstream TypeScript logic: the semver rewrite handles all edge cases tested by the ported suite, the installability graph walk correctly classifies required vs. optional-only snapshots, and the catalog cleanup pass correctly bifurcates partial vs. full catalog removal. No data-loss or incorrect-skipping paths were found. No files require special attention; the TODO-marked incomplete paths in resolved_tree.rs fields and importer_provider_sources are correctly inert until the follow-up install-path wiring lands. Reviews (2): Last reviewed commit: "fix(pacquet): address automated review f..." | Re-trigger Greptile |
Integrated-Benchmark Report (Linux)Commit: Each scenario reports direct installs and pnpr installs. 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.5053254963200002,
"stddev": 0.14046047364723224,
"median": 2.4466754346200004,
"user": 1.6099251400000003,
"system": 1.2890645799999998,
"min": 2.39469560162,
"max": 2.7941786206200003,
"times": [
2.5540549186200003,
2.39797358862,
2.44051286562,
2.4130796506200003,
2.4855178166200003,
2.7941786206200003,
2.71203756362,
2.45283800362,
2.39469560162,
2.40836633362
]
},
{
"command": "pacquet@main",
"mean": 2.4577474004200006,
"stddev": 0.1431331203377652,
"median": 2.3836612541200006,
"user": 1.58790824,
"system": 1.32887418,
"min": 2.3539670316200003,
"max": 2.71728407362,
"times": [
2.54165053962,
2.35796997562,
2.3771907926200004,
2.4073678986200004,
2.70012441162,
2.3614915996200003,
2.3539670316200003,
2.3702959656200004,
2.3901317156200004,
2.71728407362
]
},
{
"command": "pnpr@HEAD",
"mean": 1.53453219742,
"stddev": 0.13507729760460405,
"median": 1.49899908862,
"user": 1.08669914,
"system": 1.1741667799999997,
"min": 1.37259052862,
"max": 1.77109269562,
"times": [
1.4653026876200002,
1.46480918262,
1.67250537962,
1.48704684562,
1.53156529962,
1.51095133162,
1.3758005766199999,
1.77109269562,
1.37259052862,
1.69365744662
]
},
{
"command": "pnpr@main",
"mean": 1.5403046237200002,
"stddev": 0.173178533229495,
"median": 1.5418067046200001,
"user": 1.08001094,
"system": 1.1714841799999998,
"min": 1.34633700562,
"max": 1.7916276956200001,
"times": [
1.36892793062,
1.5674100936200002,
1.51620331562,
1.7319137736199999,
1.7459022796199999,
1.58919259562,
1.34633700562,
1.7916276956200001,
1.3943520736200001,
1.35117947362
]
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.26521059188,
"stddev": 0.02200857789254783,
"median": 0.25604557658000004,
"user": 0.20890734000000002,
"system": 0.5330733,
"min": 0.24632326508000002,
"max": 0.31524855708000005,
"times": [
0.29039116408000004,
0.27328361008,
0.31524855708000005,
0.24632326508000002,
0.25206306508000004,
0.24972788808000002,
0.26227265708,
0.25611822708000004,
0.25070455908,
0.25597292608
]
},
{
"command": "pacquet@main",
"mean": 0.25991954588,
"stddev": 0.006569763323414971,
"median": 0.26047632408,
"user": 0.21323264000000003,
"system": 0.5256284,
"min": 0.24886367708,
"max": 0.27394119308000003,
"times": [
0.26125911708,
0.27394119308000003,
0.25560480508,
0.24886367708,
0.26021171308,
0.25860137408,
0.26366242108000004,
0.25451693508,
0.26074093508,
0.26179328808
]
},
{
"command": "pnpr@HEAD",
"mean": 0.27565409948,
"stddev": 0.005797638291701841,
"median": 0.27565960458000005,
"user": 0.21708794,
"system": 0.5441265000000001,
"min": 0.26680715708,
"max": 0.28403153108,
"times": [
0.27178689408,
0.27904071408000003,
0.27349077908,
0.26680715708,
0.27387858508,
0.28249953908000003,
0.27744062408000003,
0.26818124408,
0.27938392708000004,
0.28403153108
]
},
{
"command": "pnpr@main",
"mean": 0.26571780378000004,
"stddev": 0.012548829077037558,
"median": 0.26325736758000007,
"user": 0.21008683999999994,
"system": 0.515796,
"min": 0.24758129308000001,
"max": 0.28458688108,
"times": [
0.27995548808000004,
0.28458688108,
0.26145887108000004,
0.25559611008,
0.27865504108,
0.27174106908,
0.24758129308000001,
0.25991460608,
0.26505586408000004,
0.25263281408
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.7851395274600006,
"stddev": 0.012334942373460361,
"median": 2.7843258310600003,
"user": 1.76014208,
"system": 1.3545740399999997,
"min": 2.76744687056,
"max": 2.8017377475600003,
"times": [
2.7868508915600003,
2.76744687056,
2.7807365665600003,
2.8009143345600003,
2.7892775375600003,
2.77692347656,
2.76865069756,
2.79705638156,
2.7818007705600003,
2.8017377475600003
]
},
{
"command": "pacquet@main",
"mean": 2.7322622332599997,
"stddev": 0.016074552301182158,
"median": 2.73209181256,
"user": 1.7056403799999997,
"system": 1.3335892399999998,
"min": 2.7016454695600003,
"max": 2.75436939256,
"times": [
2.7488622785600003,
2.75436939256,
2.73211518156,
2.7255727655600004,
2.7186144905600003,
2.72196959056,
2.74724399356,
2.7320684435600002,
2.74016072656,
2.7016454695600003
]
},
{
"command": "pnpr@HEAD",
"mean": 1.58622702366,
"stddev": 0.12718196243451307,
"median": 1.55855291056,
"user": 1.05359518,
"system": 1.24968664,
"min": 1.44517604456,
"max": 1.83355951656,
"times": [
1.44517604456,
1.56323641956,
1.83355951656,
1.57735074756,
1.48437711756,
1.54327751756,
1.78068714556,
1.5538694015599999,
1.60600077256,
1.47473555356
]
},
{
"command": "pnpr@main",
"mean": 1.6245479511599998,
"stddev": 0.15529839333636197,
"median": 1.5965582985599998,
"user": 1.08844368,
"system": 1.18997904,
"min": 1.4299687885599999,
"max": 1.8312804945599999,
"times": [
1.8312804945599999,
1.49429761356,
1.4299687885599999,
1.52761217156,
1.72047706056,
1.43918696756,
1.59829811456,
1.5948184825599998,
1.8060614605599998,
1.80347835756
]
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.63400493254,
"stddev": 0.01814903995285125,
"median": 0.63037099754,
"user": 0.7622448599999999,
"system": 0.7191572799999999,
"min": 0.6118396660400001,
"max": 0.66939445304,
"times": [
0.63640619604,
0.6118396660400001,
0.61499777504,
0.64495547204,
0.63125468904,
0.65484839504,
0.61854127804,
0.66939445304,
0.62832409504,
0.62948730604
]
},
{
"command": "pacquet@main",
"mean": 0.57084907274,
"stddev": 0.025450474546728812,
"median": 0.57867774804,
"user": 0.70497316,
"system": 0.66269198,
"min": 0.52686150204,
"max": 0.61361359104,
"times": [
0.58681484604,
0.61361359104,
0.58804915004,
0.54655961704,
0.55770426704,
0.57778757504,
0.57956792104,
0.52686150204,
0.54878844404,
0.58274381404
]
},
{
"command": "pnpr@HEAD",
"mean": 0.32031521343999997,
"stddev": 0.0103347297538154,
"median": 0.31892390954,
"user": 0.19592595999999998,
"system": 0.5781951800000001,
"min": 0.30499430804,
"max": 0.33790804604,
"times": [
0.31593937404,
0.31965857704,
0.31101298004,
0.30499430804,
0.33258348404,
0.33790804604,
0.32470469604,
0.32725278204,
0.31090864504,
0.31818924204
]
},
{
"command": "pnpr@main",
"mean": 0.30705467214000004,
"stddev": 0.007937634548867548,
"median": 0.30457269304,
"user": 0.20037026,
"system": 0.52767648,
"min": 0.30102277304,
"max": 0.32688360904,
"times": [
0.30240275004,
0.30139721504,
0.30103173004,
0.30655276004,
0.31173357004,
0.30259262604000003,
0.30102277304,
0.32688360904,
0.30933942304,
0.30759026504000003
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.9349341828799997,
"stddev": 0.027334596183386885,
"median": 1.93919189698,
"user": 0.99066118,
"system": 0.7497235599999998,
"min": 1.89850159348,
"max": 1.9959207964799999,
"times": [
1.9959207964799999,
1.94261544548,
1.94912537748,
1.94255195548,
1.93839182748,
1.9399919664799998,
1.91629744048,
1.91073424248,
1.89850159348,
1.91521118348
]
},
{
"command": "pacquet@main",
"mean": 1.84270291248,
"stddev": 0.024027722822130265,
"median": 1.83252717498,
"user": 0.8890826800000001,
"system": 0.7194135599999999,
"min": 1.81576277048,
"max": 1.89285173648,
"times": [
1.8580502104799999,
1.86881695548,
1.89285173648,
1.84739222848,
1.82815016448,
1.81576277048,
1.83270219848,
1.82418648348,
1.83235215148,
1.82676422548
]
},
{
"command": "pnpr@HEAD",
"mean": 0.31438962068000004,
"stddev": 0.010402414959622965,
"median": 0.31116023648,
"user": 0.19746117999999996,
"system": 0.56405856,
"min": 0.30311598448000004,
"max": 0.33007687148000003,
"times": [
0.32983094048000006,
0.33007687148000003,
0.30726976248000004,
0.30864892748,
0.30311598448000004,
0.30376009248,
0.32172791848000004,
0.32020518248,
0.31367154548000004,
0.30558898148
]
},
{
"command": "pnpr@main",
"mean": 0.29733772758,
"stddev": 0.008579911831761348,
"median": 0.29700565898000003,
"user": 0.19176058,
"system": 0.5191104599999999,
"min": 0.28425743948000004,
"max": 0.30855839848000005,
"times": [
0.29834429848000005,
0.28600952248,
0.28425743948000004,
0.29144946248000003,
0.30346807448,
0.30855839848000005,
0.30440611348,
0.29566701948,
0.29390797148000003,
0.30730897548
]
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.36823350574,
"stddev": 0.012271540415186757,
"median": 0.36272046994,
"user": 0.35696118,
"system": 0.06080054,
"min": 0.35717225794,
"max": 0.39651828294,
"times": [
0.39651828294,
0.36246253594,
0.35871009194000003,
0.37813217394,
0.37709648194,
0.35717225794,
0.36109907094,
0.36297840394,
0.36096603994,
0.36719971794
]
},
{
"command": "pacquet@main",
"mean": 0.32808558694,
"stddev": 0.009212260976996949,
"median": 0.32724783144,
"user": 0.32178527999999995,
"system": 0.053748340000000006,
"min": 0.31525691594,
"max": 0.33920897094,
"times": [
0.33829284394000003,
0.33920897094,
0.32966541894,
0.32310455794,
0.32483024394,
0.33575563694,
0.31525691594,
0.32060921894,
0.31665952594,
0.33747253594
]
},
{
"command": "pnpr@HEAD",
"mean": 0.08639251103375001,
"stddev": 0.0016840019617023947,
"median": 0.08640324794000001,
"user": 0.019746898750000002,
"system": 0.009597614375,
"min": 0.08187363094,
"max": 0.08953978294,
"times": [
0.08931768694,
0.08815618894,
0.08582501994,
0.08561931294,
0.08429947894,
0.08745280094,
0.08614132194,
0.08748120494,
0.08601474394,
0.08187363094,
0.08601958394,
0.08705726894,
0.08634511394000001,
0.08510157294000001,
0.08886995794000001,
0.08763604394,
0.08606650194,
0.08776050794000001,
0.08586473294000001,
0.08362705894,
0.08953978294,
0.08707946194,
0.08706888094000001,
0.08539272794,
0.08796779594000001,
0.08554086694,
0.08702096994,
0.08646138194,
0.08325540194,
0.08701214494000001,
0.08682183694000001,
0.08486936694
]
},
{
"command": "pnpr@main",
"mean": 0.08601747184625,
"stddev": 0.0021399324502387146,
"median": 0.08666178844,
"user": 0.0192082425,
"system": 0.009469040000000001,
"min": 0.08130186994000001,
"max": 0.08872722094,
"times": [
0.08847463694,
0.08562656694000001,
0.08765636194,
0.08722499294000001,
0.08748776694,
0.08640901294,
0.08743932494000001,
0.08662725394000001,
0.08130186994000001,
0.08240709094,
0.08352862394,
0.08157161494000001,
0.08341048194,
0.08838975794000001,
0.08567357594,
0.08758648194,
0.08725504094,
0.08623353494000001,
0.08791619894000001,
0.08731530394,
0.08597421794,
0.08209722994,
0.08348236794,
0.08782132194,
0.08654054994,
0.08770780894,
0.08872722094,
0.08787745694,
0.08669632294,
0.08463932594000001,
0.08465696894000001,
0.08680281294
]
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.520630444460001,
"stddev": 0.12258248408751303,
"median": 4.487543478859999,
"user": 1.7190954400000003,
"system": 1.39275874,
"min": 4.43082612536,
"max": 4.84255186536,
"times": [
4.44050623336,
4.55344200436,
4.84255186536,
4.54508854336,
4.50128792636,
4.5361222443599996,
4.43082612536,
4.47379903136,
4.44700154136,
4.43567892936
]
},
{
"command": "pacquet@main",
"mean": 4.55677380296,
"stddev": 0.15196931347573414,
"median": 4.490592170359999,
"user": 1.7115894400000002,
"system": 1.4151326400000002,
"min": 4.42322456636,
"max": 4.89499366236,
"times": [
4.4762544773599995,
4.89499366236,
4.60009743336,
4.72049839436,
4.4384009423599995,
4.43282294336,
4.47617520836,
4.42322456636,
4.50492986336,
4.60034053836
]
},
{
"command": "pnpr@HEAD",
"mean": 3.57772353056,
"stddev": 0.10880817562308834,
"median": 3.55582356736,
"user": 1.20816174,
"system": 1.22958424,
"min": 3.4432621603599998,
"max": 3.81280753636,
"times": [
3.51685159936,
3.45076288336,
3.55800013336,
3.55364700136,
3.53729313736,
3.62201411936,
3.66047829936,
3.81280753636,
3.4432621603599998,
3.62211843536
]
},
{
"command": "pnpr@main",
"mean": 3.55535641126,
"stddev": 0.09413260996359371,
"median": 3.55505384936,
"user": 1.2127647400000001,
"system": 1.2412066400000001,
"min": 3.45042028736,
"max": 3.69225378836,
"times": [
3.51562472936,
3.59546192436,
3.59448296936,
3.65181902636,
3.69225378836,
3.45471775536,
3.47816731336,
3.65990166936,
3.46071464936,
3.45042028736
]
}
]
} |
|
| Branch | pr/13172 |
| 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,445.18 ms |
| isolated-linker.fresh-install.cold-cache.hot-store | 📈 view plot | 303.12 ms |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot | 304.99 ms |
| isolated-linker.fresh-resolve.hot-cache.offline | 📈 view plot | 81.87 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot | 1,372.59 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr | 📈 view plot | 3,443.26 ms |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 266.81 ms |
- workspace-manifest-writer: guard the partial named-catalog drop with the same block-style check the other removal splices use, so a flow-style catalogs mapping is left untouched instead of desyncing the decoded model while claiming a change (CodeRabbit); regression test added. - resolving-deps-resolver: pin locked peer providers with occurrence 0, matching the fresh ref upstream's toPkgByName builds (Greptile), and gate the paths_by_node_id build behind an explicit collect_paths_by_node_id option so the hoist loop's hot path skips the extra per-node pass (Qodo); drop a history-restating doc sentence (Qodo). - package-manager: short-circuit the lockfile edge walk for nodes whose classification is already final, avoiding repeated candidate checks on many-inbound-edge graphs (Qodo).
|
Addressed the Qodo findings in 7b86dfa:
Written by an agent (Claude Code, claude-fable-5). |
Summary
Closes every item in the Resolution / verification section of #13167 (related to that tracking issue; the other sections remain open). All six items are pacquet-side parity work — the TypeScript CLI already implements these behaviors, so no TS changes are needed.
pacquet-package-is-installablenow implements npm-semver'sincludePrerelease: truesemantics exactly instead of a strip-the-prerelease approximation: a fully specified comparator keeps pure semver ordering, so9.0.0-alpha.1no longer satisfies>=9.0.0(upstreamcheckEngine.ts:34) while still satisfying9,>=9,^9.0.0, and now also<9.0.0. Theknown_failuresboundary became a real unit test plus sibling pins.minimumReleaseAgenon-strict fallback — the resolver fallback (highest mature pick, else lowest match regardless of maturity) and the non-strict proceed path already existed; the stub predated them. It is now the real port ofminimumReleaseAge.ts:68: a non-strictpnpm add @pnpm.e2e/[email protected]under an all-immature cutoff completes and pins the lowest matching version.cleanupUnusedCatalogs: a new (workspace-yaml-only, defaultfalse) setting; the workspace-manifest writer drops catalog entries no importer references (default catalog via barecatalog:, named catalogs viacatalog:<name>or barecatalog:,catalog:-valuedoverrides:count as references, emptied blocks and files are removed);add,update, andremoverun the pass in the same write that persists updated catalog entries. TheremoveCatalogs.test.tssuite is ported at the writer level and the CLI stub became an end-to-end test.engineStrictper-edge optionality (pacquet: engineStrict does not fail on an incompatible regular dependency inside an optional subtree #13143) — installability now dispatches per inbound lockfile edge instead of the propagated snapshot-leveloptionalflag: an incompatible package with a regular edge from an installed parent fails underengineStrict(warns and materializes without it) even when it is also optionally reachable; packages reachable only through optional edges or skipped parents are still skipped. PortsoptionalDependencies.ts:552.2+^2.2.0→>=2.2.0 <3.0.0-0, the upstreammergePkgsDeps/safeIntersectpolicy); (b)resolve_peerscarries the upstreamlockedPeerContext/resolvedPeerProviderPathsmachinery (tree-node fields,resolved_peer_provider_pathsoption,paths_by_node_idoutput, the full reuse guard chain including must-win), ported with the two-pass unit tests fromresolvePeers.ts's locked-provider suite. All threepacquet-cli::peer_resolutionstubs are converted; that file is gone.[email protected]+[email protected]fixtures to the registry mock (and claimed both names inREGISTRY_MOCK_LOCAL_PATTERNSso they stop proxying to npm), then portedhoist.ts:320and:327. The peer-variant private hoist itself already worked — the stubs only recorded the fixture gap.Still needs porting (follow-ups called out in code and
TEST_PORTING.md)lockedPeerContext/previousDepPathfrom the wanted lockfile, computingdependencyNamesWhoseCurrentProviderMustWinfrom the lockfile-vs-resolved child diff, and running the gated secondresolve_peerspass. The must-win sibling cases from upstream's locked-provider suite port together with that wiring.engineStrictthe compute pass errors first, but a non-strict hoisted install still skips rather than materializes a required-incompatible package.Squash Commit Body
Checklist
pnpm/port, or the description notes what still needs porting. (Pacquet-side parity work; the TypeScript CLI already implements all six behaviors. Remaining pacquet follow-ups are listed above.)pnpm changeset) if this PR changes any publishedpackage. Keep it short and written for pnpm users — it becomes a release note. (Four changesets, all targeting
pacquet.)cleanupUnusedCatalogsand the other behaviors are already documented on pnpm.io.)Written by an agent (Claude Code, claude-fable-5).
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.Summary by CodeRabbit
New Features
Bug Fixes