Repository navigation
fix(deps-restorer): shim publicly hoisted workspace-package bins on a headless install - #13644
Conversation
…ll paths Both install paths decided what may land on disk the same way — detect the installability host, compute the skip set, fold in `--no-optional` and `--no-runtime`, close it over reachability, then derive the engine name — but only the fresh path had it factored out. The frozen path carried the same sequence inline, so the two were kept in step by hand. That is worth removing rather than tidying: the skip set decides what `node_modules` contains, so the paths diverging here would be a correctness bug, not a style difference. `pacquet-deps-restorer::materialization_plan` now owns it, and both paths call it. The crate is below `package-manager`, which is where the helpers it builds on (`compute_skipped_snapshots`, `add_direct_runtime_skips`, `extend_skipped_with_dependency_closure`) already live. Three things the paths genuinely disagree on stay with the callers, because each has a reason the shared code cannot express: - The skip-set seed. The frozen path seeds from the previous install's `.modules.yaml.skipped`; the fresh path has just re-resolved the graph and cannot assume those verdicts still hold. - The `--no-optional` gate. The fresh path additionally requires `is_full_install`, since a partial run narrows its dependency groups for reasons of its own and must keep transitive optionals. - Whether the host is needed at all. The frozen path also requires non-empty snapshots. That guard is load-bearing: `any_installability_constraint` short-circuits on `packages` before reading snapshots, so without it a lockfile with constrained metadata and no snapshots would pay for a `node --version` it has nothing to check — and the resulting `host_node` would change engine-name derivation. No behaviour change on either path. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
PR Summary by QodoDeduplicate install materialization planning across fresh and frozen paths
AI Description
Diagram
High-Level Assessment
Files changed (4)
|
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Reviews (8): Last reviewed commit: "style(deps-restorer): satisfy the perfec..." | Re-trigger Greptile |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe PR moves materialization planning and link-phase orchestration into ChangesMaterialization planning and link phase
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant InstallFlow as FreshOrFrozenInstall
participant MaterializationPlan as materialization_plan
participant LinkPhase as run_link_phase
participant HoistedLinker as HoistedLinker
InstallFlow->>MaterializationPlan: Detect host and compute skipped snapshots
MaterializationPlan-->>InstallFlow: Skip set and engine name
InstallFlow->>LinkPhase: LinkPhaseInputs and skipped snapshots
LinkPhase->>HoistedLinker: Materialize hoisted layout when configured
HoistedLinker-->>LinkPhase: Hoisted locations and package roots
LinkPhase-->>InstallFlow: LinkPhaseOutput
Possibly related issues
Possibly related PRs
Suggested reviewers: ✨ 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 |
Code Review by Qodo
1.
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Micro-Benchmark ResultsLinux |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (6)
pnpm/crates/package-manager/src/install_with_fresh_lockfile.rs (1)
1251-1252: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueImport
materialization_planinstead of repeating the full path.The three calls spell out
pacquet_deps_restorer::materialization_plan::in full. That forces thecompute_skip_setcall at lines 1294-1318 into deep indentation. Add one explicit module import and shorten the three call sites.♻️ Proposed change
Add the import alongside the other
pacquet_deps_restorerimports:use pacquet_deps_restorer::materialization_plan;Then shorten each call site:
- let installability_host = - pacquet_deps_restorer::materialization_plan::detect_installability_host( - needs_installability_check, - config.engine_strict, - node_version, - supported_architectures, - ) - .await; + let installability_host = materialization_plan::detect_installability_host( + needs_installability_check, + config.engine_strict, + node_version, + supported_architectures, + ) + .await;As per path instructions: "prefer borrowed parameters where they avoid copies, descriptive names, explicit imports".
Also applies to: 1294-1296
🤖 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/package-manager/src/install_with_fresh_lockfile.rs` around lines 1251 - 1252, Add an explicit materialization_plan import alongside the existing pacquet_deps_restorer imports, then update the three calls to detect_installability_host, compute_skip_set, and the other materialization_plan API to use the imported module path. Preserve all existing arguments and behavior while reducing unnecessary path repetition and indentation.Source: Path instructions
pnpm/crates/deps-restorer/src/install_frozen_lockfile.rs (3)
710-716: 🚀 Performance & Scalability | 🔵 Trivial | 💤 Low valueThe non-empty-snapshots guard here has no counterpart in the fresh path.
This predicate requires
!snaps.is_empty()before it callsany_installability_constraint. The comment at lines 706-709 states the reason:any_installability_constraintshort-circuits onpackagesalone, so a lockfile with constrained metadata and no snapshots would pay for anode --versionprobe it has nothing to check.The fresh path builds the same predicate at
pnpm/crates/package-manager/src/install_with_fresh_lockfile.rslines 1245-1250 without that guard. The PR objectives list this as an intentional caller-specific difference. The stated reason for the guard applies to both callers.Confirm whether the fresh path needs the probe in the empty-snapshots case. If it does not, add the same guard there.
🤖 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/deps-restorer/src/install_frozen_lockfile.rs` around lines 710 - 716, Update the fresh-lockfile predicate near the installability-check construction to require non-empty snapshots before calling any_installability_constraint, matching the guarded logic in the frozen-lockfile path. Preserve the existing !config.force condition and return false when snapshots or packages are absent or snapshots are empty.
793-799: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueTrim the preceding comment now that
resolve_engine_nameowns the logic.The call now delegates to
resolve_engine_name. The comment block above it restates that function's rustdoc: the two consumer sites, the three detection paths, the synthetic-host rule, and the runtime-pin rationale all appear inmaterialization_plan.rslines 176-191.Keep only what is local to this caller, such as why the deferred handle is awaited before
BuildModules. Point the rest at the shared function.As per coding guidelines: "Do not write comments that merely restate code, repeat callee documentation, describe removed implementation history, or narrate the function body".
🤖 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/deps-restorer/src/install_frozen_lockfile.rs` around lines 793 - 799, Remove the comment block preceding the resolve_engine_name call that restates the function's documentation (the two consumer sites, three detection paths, synthetic-host rule, and runtime-pin rationale, which are documented in materialization_plan.rs lines 176-191). Retain only comment text that is local to this call site and specific to how the deferred_engine_handle is used before BuildModules, and direct readers to the resolve_engine_name function documentation for the shared logic details.Source: Coding guidelines
748-752: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueReuse one
IncludedDependenciesvalue.This block builds an
IncludedDependenciesfromdependency_groups. Line 1222 in the same function builds an identical value from the same three group checks. Bind it once above this call and pass it to both sites.♻️ Proposed change
+ let included = pacquet_modules_yaml::IncludedDependencies { + dependencies: dependency_groups.contains(&DependencyGroup::Prod), + dev_dependencies: dependency_groups.contains(&DependencyGroup::Dev), + optional_dependencies: include_optional, + };Then pass
includedat this call site and reuse the same binding at line 1222.As per path instructions: report "missed reuse or duplication across the monorepo".
🤖 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/deps-restorer/src/install_frozen_lockfile.rs` around lines 748 - 752, The function contains two identical constructions of pacquet_modules_yaml::IncludedDependencies built from the same dependency_groups checks (dependencies, dev_dependencies, optional_dependencies via include_optional), one near this call and a duplicate later in the same function. Bind the IncludedDependencies value once as a local variable (e.g. included) before the first usage, and reuse that same binding at both call sites instead of reconstructing it twice.Source: Path instructions
pnpm/crates/deps-restorer/src/materialization_plan.rs (2)
72-73: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd a struct-level rustdoc for
SkipSetInputs.
SkipSetInputsis a public type of the newmaterialization_planAPI. Every other public item in this module carries rustdoc. This struct has none, so the field docs stand without a statement of the type's contract.Document what the struct represents and link the consumer with an intra-doc link.
📝 Proposed rustdoc
+/// Inputs to [`compute_skip_set`]. +/// +/// Every field is read exactly once. The three fields the two install +/// paths set differently are [`Self::seed`], [`Self::exclude_optional`], +/// and [`Self::snapshots`] / [`Self::packages`] under a filtered install. pub struct SkipSetInputs<'a> { pub requester: &'a str,As per path instructions: "For the new public materialization_plan API, document contracts with rustdoc and link public identifiers using intra-doc links".
🤖 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/deps-restorer/src/materialization_plan.rs` around lines 72 - 73, Add a struct-level rustdoc comment above the SkipSetInputs struct definition that documents the purpose and contract of this public type. Include a description of what the struct represents and incorporate an intra-doc link to identify its consumer or related context, following the documentation style established by other public items in the materialization_plan module.Source: Path instructions
12-16: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winMove
find_runtime_node_majorandparse_major_from_versionout ofinstall_frozen_lockfile.The shared module imports two helpers from
install_frozen_lockfile, which is one of its two callers. Both helpers are now used only byresolve_engine_name. The dependency direction points from the shared layer back into a caller layer.Move both helpers into
materialization_plan.rsso the shared layer owns the logic it needs. The frozen path already routes throughresolve_engine_name, so no caller keeps a direct use.♻️ Proposed import change after the move
use crate::{ InstallabilityHost, SkippedSnapshots, add_direct_runtime_skips, compute_skipped_snapshots, extend_skipped_with_dependency_closure, - install_frozen_lockfile::{find_runtime_node_major, parse_major_from_version}, };Verify that neither helper has a remaining caller outside this module before moving it:
#!/bin/bash # Description: Find every reference to the two engine-name helpers. rg -nP --type=rust -C3 '\b(find_runtime_node_major|parse_major_from_version)\b'As per path instructions: "shared materialization-plan logic should remain in the owning deps-restorer layer".
🤖 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/deps-restorer/src/materialization_plan.rs` around lines 12 - 16, The import in materialization_plan.rs pulls find_runtime_node_major and parse_major_from_version from install_frozen_lockfile, creating a reverse dependency from the shared layer back into a caller. Move both function definitions out of install_frozen_lockfile and into materialization_plan.rs itself, then remove the now-unneeded import line referencing install_frozen_lockfile::{find_runtime_node_major, parse_major_from_version}. Update resolve_engine_name (and any other in-module callers) to use the locally-defined helpers. Before finalizing, confirm neither helper is still referenced from install_frozen_lockfile or any other caller outside materialization_plan.rs.
🤖 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/package-manager/src/install_with_fresh_lockfile.rs`:
- Around line 1265-1271: Update the resolve_engine_name call in the
fresh-lockfile install flow to pass built_lockfile.snapshots.as_ref() instead of
initial_materialization_lockfile.snapshots.as_ref(). Ensure engine resolution
always sees the complete wanted lockfile snapshot map, including the
node@runtime: pin, regardless of selected_importer_ids filtering.
---
Nitpick comments:
In `@pnpm/crates/deps-restorer/src/install_frozen_lockfile.rs`:
- Around line 710-716: Update the fresh-lockfile predicate near the
installability-check construction to require non-empty snapshots before calling
any_installability_constraint, matching the guarded logic in the frozen-lockfile
path. Preserve the existing !config.force condition and return false when
snapshots or packages are absent or snapshots are empty.
- Around line 793-799: Remove the comment block preceding the
resolve_engine_name call that restates the function's documentation (the two
consumer sites, three detection paths, synthetic-host rule, and runtime-pin
rationale, which are documented in materialization_plan.rs lines 176-191).
Retain only comment text that is local to this call site and specific to how the
deferred_engine_handle is used before BuildModules, and direct readers to the
resolve_engine_name function documentation for the shared logic details.
- Around line 748-752: The function contains two identical constructions of
pacquet_modules_yaml::IncludedDependencies built from the same dependency_groups
checks (dependencies, dev_dependencies, optional_dependencies via
include_optional), one near this call and a duplicate later in the same
function. Bind the IncludedDependencies value once as a local variable (e.g.
included) before the first usage, and reuse that same binding at both call sites
instead of reconstructing it twice.
In `@pnpm/crates/deps-restorer/src/materialization_plan.rs`:
- Around line 72-73: Add a struct-level rustdoc comment above the SkipSetInputs
struct definition that documents the purpose and contract of this public type.
Include a description of what the struct represents and incorporate an intra-doc
link to identify its consumer or related context, following the documentation
style established by other public items in the materialization_plan module.
- Around line 12-16: The import in materialization_plan.rs pulls
find_runtime_node_major and parse_major_from_version from
install_frozen_lockfile, creating a reverse dependency from the shared layer
back into a caller. Move both function definitions out of
install_frozen_lockfile and into materialization_plan.rs itself, then remove the
now-unneeded import line referencing
install_frozen_lockfile::{find_runtime_node_major, parse_major_from_version}.
Update resolve_engine_name (and any other in-module callers) to use the
locally-defined helpers. Before finalizing, confirm neither helper is still
referenced from install_frozen_lockfile or any other caller outside
materialization_plan.rs.
In `@pnpm/crates/package-manager/src/install_with_fresh_lockfile.rs`:
- Around line 1251-1252: Add an explicit materialization_plan import alongside
the existing pacquet_deps_restorer imports, then update the three calls to
detect_installability_host, compute_skip_set, and the other materialization_plan
API to use the imported module path. Preserve all existing arguments and
behavior while reducing unnecessary path repetition and indentation.
🪄 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: c0539695-3b7d-40c7-80ed-ccc406610750
📒 Files selected for processing (5)
pnpm/crates/deps-restorer/src/install_frozen_lockfile.rspnpm/crates/deps-restorer/src/lib.rspnpm/crates/deps-restorer/src/materialization_plan.rspnpm/crates/package-manager/src/install_with_fresh_lockfile.rspnpm/crates/package-manager/src/install_with_fresh_lockfile/materialization_plan.rs
💤 Files with no reviewable changes (1)
- pnpm/crates/package-manager/src/install_with_fresh_lockfile/materialization_plan.rs
`InstallFrozenLockfile::run` carried its whole link phase inline — hoist plan, pre-link reconciliation, importer symlinks, root-component cross-links, per-slot bins, the hoisted-linker arm, the on-disk hoist pass, and the module-resolution sidecars. That is a phase, not a step, and it kept `run` at 770 lines. Move it to `install_frozen_lockfile::linking`, shaped like the fresh path's `install_with_fresh_lockfile::linking`: the same `LinkPhaseInputs` / `LinkPhaseOutput` pair and the same `run_link_phase` entry point. `run` drops to 485 lines. Deliberately a pure move, so the diff stays checkable against the original. The two link phases are now adjacent in shape but not yet merged: they still differ in five places (the `is_hoisted` argument to `compute_hoist_plan`, how trusted importer ids are derived, whether the anchor is `workspace_root` or `modules_dir.parent()`, whether the sidecars filter the lockfile first, and the hoist/bin ordering). Sharing them means parameterising those, which is its own change. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
Code review by qodo was updated up to the latest commit 2b8f7ae |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
pnpm/crates/deps-restorer/src/install_frozen_lockfile/linking.rs (1)
133-133: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueOptional: merge the two identical guards.
Line 133 and line 157 evaluate the same condition
!is_hoisted && !config.virtual_store_only. The reconciliation block and the linking block run back to back, so one block keeps the same order and the same reporter emission point. Keep them separate if the split documents the two intents on purpose.Also applies to: 157-157
🤖 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/deps-restorer/src/install_frozen_lockfile/linking.rs` at line 133, Optionally merge the adjacent reconciliation and linking blocks guarded by `!is_hoisted && !config.virtual_store_only` into one block, preserving their existing order and reporter emission point. If the separate guards intentionally document distinct purposes, leave them unchanged.
🤖 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.
Nitpick comments:
In `@pnpm/crates/deps-restorer/src/install_frozen_lockfile/linking.rs`:
- Line 133: Optionally merge the adjacent reconciliation and linking blocks
guarded by `!is_hoisted && !config.virtual_store_only` into one block,
preserving their existing order and reporter emission point. If the separate
guards intentionally document distinct purposes, leave them unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 25108b9e-2cfe-4e2d-9366-5816f50bca23
📒 Files selected for processing (2)
pnpm/crates/deps-restorer/src/install_frozen_lockfile.rspnpm/crates/deps-restorer/src/install_frozen_lockfile/linking.rs
|
Code review by qodo was updated up to the latest commit d8ce328 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #13644 +/- ##
==========================================
- Coverage 88.11% 88.07% -0.04%
==========================================
Files 582 582
Lines 98821 98620 -201
==========================================
- Hits 87076 86864 -212
- Misses 11745 11756 +11 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Both paths ran the same link sequence — hoist plan, pre-link reconciliation, importer symlinks, root-component cross-links, per-slot bins, the hoisted-linker arm, the on-disk hoist pass, and the module-resolution sidecars — from two copies. `SymlinkDirectDependencies` was constructed field-for-field identically in each. `pacquet-deps-restorer::linking` now owns it and both paths call it, with `LinkPhaseError` wrapped transparently by each path's error enum so the surfaced `ERR_PNPM_*` codes are unchanged. Four differences are ordinary inputs rather than merged behaviour: the link anchor (`workspace_root` vs `modules_dir.parent()`), the trusted importer-id set, the root-component importer set, and the lockfile the sidecars describe (the frozen path filters to the current install first). A fifth is a real behavioural flag, `relink_importer_bins`. The fresh path re-walks each importer's `node_modules` after hoisting to shim publicly-hoisted aliases; the frozen path leaves those to the post-build top-level link. Both are preserved as they were. Two earlier suspicions turned out not to be differences at all: `compute_hoist_plan`'s `is_hoisted` argument and the hoist/bin ordering. The fresh path passes `false` only because it reaches that call inside its isolated branch, where the flag is already known. No behaviour change on either path. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
Code review by qodo was updated up to the latest commit 2df883d |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
pnpm/crates/package-manager/src/install_with_fresh_lockfile.rs (1)
1267-1273: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick winResolve the engine name from the complete lockfile.
When a filtered isolated install omits
node@runtime:frominitial_materialization_lockfile, this call loses the configured runtime pin.resolve_engine_namethen uses the host Node version. A full install reads the pin frombuilt_lockfile, so GVS slot hashes and side-effects-cache prefixes diverge for the same workspace.Pass
built_lockfile.snapshots.as_ref()here. Add a filtered-install regression test with a runtime pin outside the selected closure.Proposed fix
pacquet_deps_restorer::materialization_plan::resolve_engine_name( config.enable_global_virtual_store, - initial_materialization_lockfile.snapshots.as_ref(), + built_lockfile.snapshots.as_ref(), host_node.as_ref(), )As per path instructions, preserve frozen/fresh parity and shared install behavior.
🤖 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/package-manager/src/install_with_fresh_lockfile.rs` around lines 1267 - 1273, Update the resolve_engine_name call in the fresh-lockfile install flow to use built_lockfile.snapshots.as_ref() instead of initial_materialization_lockfile.snapshots.as_ref(), preserving the configured runtime pin for filtered isolated installs and keeping frozen/fresh and shared-install behavior consistent. Add a regression test covering a filtered install whose runtime pin is outside the selected dependency closure.Source: Path instructions
🧹 Nitpick comments (1)
pnpm/crates/deps-restorer/src/linking.rs (1)
10-11: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy liftMove hoisted-linking contracts into a shared module.
linking.rsimportsHoistPlanandHoistedLinker*frominstall_frozen_lockfile, while that module invokesrun_link_phase. This makes the shared layer depend on a caller-specific module. Move these contracts and the hoisted linker intolinking.rsor a neutral hoisted-linking module.As per path instructions, shared link logic must live in its owning pacquet layer without unnecessary abstraction.
Also applies to: 319-341
🤖 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/deps-restorer/src/linking.rs` around lines 10 - 11, Move HoistPlan, HoistedLinkerError, HoistedLinkerInputs, HoistedLinkerOutput, and the hoisted linker implementation (including run_link_phase) out of install_frozen_lockfile into linking.rs or a neutral hoisted-linking module. Update all imports and call sites so install_frozen_lockfile depends on the shared linking layer rather than the reverse, while preserving existing behavior and avoiding extra abstraction.Source: Path instructions
🤖 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/deps-restorer/src/linking.rs`:
- Around line 32-35: Correct the LinkPhaseError rustdoc to distinguish variants
with explicit diagnostic codes from transparent wrapped errors. Add
contract-focused rustdoc to LinkPhaseInputs, LinkPhaseOutput, and run_link_phase
describing required materialization preconditions, how skipped is mutated, and
which downstream consumers use the output; document any non-obvious invariants
without changing behavior.
---
Duplicate comments:
In `@pnpm/crates/package-manager/src/install_with_fresh_lockfile.rs`:
- Around line 1267-1273: Update the resolve_engine_name call in the
fresh-lockfile install flow to use built_lockfile.snapshots.as_ref() instead of
initial_materialization_lockfile.snapshots.as_ref(), preserving the configured
runtime pin for filtered isolated installs and keeping frozen/fresh and
shared-install behavior consistent. Add a regression test covering a filtered
install whose runtime pin is outside the selected dependency closure.
---
Nitpick comments:
In `@pnpm/crates/deps-restorer/src/linking.rs`:
- Around line 10-11: Move HoistPlan, HoistedLinkerError, HoistedLinkerInputs,
HoistedLinkerOutput, and the hoisted linker implementation (including
run_link_phase) out of install_frozen_lockfile into linking.rs or a neutral
hoisted-linking module. Update all imports and call sites so
install_frozen_lockfile depends on the shared linking layer rather than the
reverse, while preserving existing behavior and avoiding extra abstraction.
🪄 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: 73807ed7-99ab-41a3-8823-3ae7927beb40
📒 Files selected for processing (5)
pnpm/crates/deps-restorer/src/install_frozen_lockfile.rspnpm/crates/deps-restorer/src/lib.rspnpm/crates/deps-restorer/src/linking.rspnpm/crates/package-manager/src/install_with_fresh_lockfile.rspnpm/crates/package-manager/src/install_with_fresh_lockfile/linking.rs
💤 Files with no reviewable changes (1)
- pnpm/crates/package-manager/src/install_with_fresh_lockfile/linking.rs
🚧 Files skipped from review as they are similar to previous changes (1)
- pnpm/crates/deps-restorer/src/lib.rs
|
Code review by qodo was updated up to the latest commit d7b3ce2 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Four violations across the link-phase share and its tests: a multi-line `matches!` and a multi-line `assert!` missing trailing commas, two `use crate::` statements that must collapse into one, and an escaped string literal that reads better as a raw string. These reached CI because dylint never ran locally. The lint library is built per worktree, and this one had none, so the pre-push hook skipped the step with a warning rather than failing. Built it here and ran `cargo dylint --all` directly, which also caught the three violations CI had not reached — it stops at the first crate that fails. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
Code review by qodo was updated up to the latest commit 7852815 |
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.56067287468,
"stddev": 0.12406660204944915,
"median": 2.50964317768,
"user": 1.8813114399999997,
"system": 1.5522394800000001,
"min": 2.4619123161800003,
"max": 2.87153105518,
"times": [
2.4796651561800003,
2.87153105518,
2.5071935031800003,
2.4661755281800004,
2.6339795141800004,
2.4619123161800003,
2.49728223818,
2.5120928521800003,
2.57265280318,
2.60424378018
]
},
{
"command": "pacquet@main",
"mean": 2.5784687769800003,
"stddev": 0.14922677277258994,
"median": 2.5886763201800003,
"user": 2.02473994,
"system": 1.5755993799999999,
"min": 2.37629005618,
"max": 2.8993001671800003,
"times": [
2.5182579141800003,
2.8993001671800003,
2.58391124318,
2.59871576518,
2.52313311218,
2.39402534518,
2.70049482418,
2.37629005618,
2.5971179451800004,
2.5934413971800003
]
},
{
"command": "pnpr@HEAD",
"mean": 1.59145459438,
"stddev": 0.1353237742360014,
"median": 1.5807367321799999,
"user": 1.38343044,
"system": 1.4391019799999998,
"min": 1.41631221618,
"max": 1.8604809091799999,
"times": [
1.5734069521799998,
1.64731440818,
1.49510436018,
1.58806651218,
1.7014342541799998,
1.8604809091799999,
1.52371726318,
1.43272986418,
1.6759792041800001,
1.41631221618
]
},
{
"command": "pnpr@main",
"mean": 1.7010308771799998,
"stddev": 0.15741182246413288,
"median": 1.68308796618,
"user": 1.64406644,
"system": 1.7675772799999998,
"min": 1.44396076918,
"max": 1.91206917718,
"times": [
1.69243643518,
1.67373949718,
1.44396076918,
1.60735742318,
1.5107933491799999,
1.64777661118,
1.78296905118,
1.85918069718,
1.91206917718,
1.88002576118
]
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.3434327072,
"stddev": 0.022767114168209632,
"median": 0.3444937805,
"user": 0.30993634,
"system": 0.6421333199999999,
"min": 0.3125671935,
"max": 0.3842169615,
"times": [
0.34914798150000004,
0.3479849875,
0.32565491550000003,
0.3125671935,
0.3260521115,
0.3410025735,
0.35396611250000004,
0.3717374505,
0.3842169615,
0.3219967845
]
},
{
"command": "pacquet@main",
"mean": 0.34953160520000004,
"stddev": 0.056132624839460674,
"median": 0.3422704435,
"user": 0.29276973999999995,
"system": 0.6930931199999999,
"min": 0.28162304050000003,
"max": 0.4444836795,
"times": [
0.40680688150000005,
0.3896230955,
0.4444836795,
0.3888309365,
0.35791167150000003,
0.31183770250000004,
0.3266292155,
0.2879887975,
0.29958103150000004,
0.28162304050000003
]
},
{
"command": "pnpr@HEAD",
"mean": 0.36823932880000004,
"stddev": 0.06403645032309298,
"median": 0.33313141300000004,
"user": 0.32032474,
"system": 0.6527779199999999,
"min": 0.3061346105,
"max": 0.45856126950000003,
"times": [
0.4573623285,
0.4191208905,
0.3185867505,
0.3224624495,
0.32268199150000004,
0.3073214805,
0.3061346105,
0.34358083450000004,
0.45856126950000003,
0.42658068250000003
]
},
{
"command": "pnpr@main",
"mean": 0.3134284204,
"stddev": 0.0169024152169478,
"median": 0.3089268355,
"user": 0.24717434,
"system": 0.5821497199999999,
"min": 0.2891479645,
"max": 0.3490264625,
"times": [
0.3490264625,
0.2891479645,
0.3041726255,
0.30771088150000003,
0.3023537985,
0.3321354375,
0.3049321225,
0.3195738535,
0.3101427895,
0.31508826850000005
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.7849717054600003,
"stddev": 0.04379302443818641,
"median": 2.77295794806,
"user": 2.0121758599999997,
"system": 1.6041876,
"min": 2.72685866556,
"max": 2.88054586356,
"times": [
2.77669935056,
2.75862807856,
2.76921654556,
2.88054586356,
2.7824491705599996,
2.72685866556,
2.75686996556,
2.8260627285599997,
2.7611859015599998,
2.81120078456
]
},
{
"command": "pacquet@main",
"mean": 2.8086733138599995,
"stddev": 0.1404159068824714,
"median": 2.75909969856,
"user": 2.0765840599999996,
"system": 1.6802913,
"min": 2.6953382115599998,
"max": 3.19101674556,
"times": [
2.78952331656,
3.19101674556,
2.8389163215599997,
2.75835327156,
2.7598461255599998,
2.73359106156,
2.75043747356,
2.8169285135599997,
2.75278209756,
2.6953382115599998
]
},
{
"command": "pnpr@HEAD",
"mean": 1.67471963466,
"stddev": 0.0856865633996584,
"median": 1.69218046606,
"user": 1.2993749600000002,
"system": 1.3900029000000003,
"min": 1.5520816665600001,
"max": 1.8229958785600002,
"times": [
1.8229958785600002,
1.61376907256,
1.72288128556,
1.55605768456,
1.70758790056,
1.5520816665600001,
1.71047499356,
1.63770557156,
1.67677303156,
1.74686926156
]
},
{
"command": "pnpr@main",
"mean": 1.6280875437600002,
"stddev": 0.09949501056572639,
"median": 1.6134891470600001,
"user": 1.30658596,
"system": 1.4110723,
"min": 1.50722696656,
"max": 1.85552285456,
"times": [
1.6370610515600001,
1.7173577205600001,
1.6193912435600002,
1.5287876025600002,
1.59806528656,
1.5704414715600001,
1.60758705056,
1.50722696656,
1.85552285456,
1.63943418956
]
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.57362851166,
"stddev": 0.051325156063792496,
"median": 0.57244456166,
"user": 0.80489824,
"system": 0.85979154,
"min": 0.50150544316,
"max": 0.69469387516,
"times": [
0.54711327716,
0.50150544316,
0.5299553501600001,
0.58351608316,
0.57949271516,
0.56539640816,
0.55465903116,
0.59849732116,
0.5814556121600001,
0.69469387516
]
},
{
"command": "pacquet@main",
"mean": 0.54617064726,
"stddev": 0.06512929136000854,
"median": 0.53773796366,
"user": 0.7681067399999999,
"system": 0.85872034,
"min": 0.46870718916000004,
"max": 0.66208855316,
"times": [
0.63556181916,
0.66208855316,
0.58665787416,
0.51345755216,
0.5431472081600001,
0.53232871916,
0.55032249516,
0.47314643816,
0.49628862416,
0.46870718916000004
]
},
{
"command": "pnpr@HEAD",
"mean": 0.46827016936000004,
"stddev": 0.06873024914484686,
"median": 0.44858755916000004,
"user": 0.35312864,
"system": 0.7284537399999998,
"min": 0.39289440116,
"max": 0.56605134916,
"times": [
0.47135764716,
0.5182888571600001,
0.53297008316,
0.56605134916,
0.41934099616000003,
0.55348713916,
0.39312263016000004,
0.39289440116,
0.40937111916,
0.42581747116
]
},
{
"command": "pnpr@main",
"mean": 0.35900121546,
"stddev": 0.019807000337196092,
"median": 0.35531057866000004,
"user": 0.25090483999999996,
"system": 0.59903694,
"min": 0.32791967116000004,
"max": 0.39468136816000005,
"times": [
0.38408503516000003,
0.34026474816,
0.34886937016,
0.35597308316000004,
0.35464807416,
0.39468136816000005,
0.35075416916,
0.32791967116000004,
0.36762253316000004,
0.36519410216000003
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.8310121738200003,
"stddev": 0.049318261916001686,
"median": 1.82108726732,
"user": 0.9265923999999999,
"system": 0.83632848,
"min": 1.77865548332,
"max": 1.9047281923200001,
"times": [
1.9047281923200001,
1.77865548332,
1.78012018332,
1.80973680232,
1.82514618632,
1.81702834832,
1.77874051332,
1.8939988603200002,
1.8921807863200002,
1.82978638232
]
},
{
"command": "pacquet@main",
"mean": 1.9018700997200004,
"stddev": 0.08335785344461637,
"median": 1.88346376732,
"user": 1.0255701,
"system": 0.9316442799999999,
"min": 1.77415397832,
"max": 2.05115468332,
"times": [
1.8850415653200001,
1.97296707432,
1.88188596932,
1.87814257832,
1.77415397832,
1.8226103423200002,
1.88896074732,
2.05115468332,
2.0004039183200004,
1.86338014032
]
},
{
"command": "pnpr@HEAD",
"mean": 0.37488045112,
"stddev": 0.037920711654483616,
"median": 0.36131264681999997,
"user": 0.25812979999999996,
"system": 0.6238129799999999,
"min": 0.33428631332000003,
"max": 0.44614427432000003,
"times": [
0.44614427432000003,
0.41952943432,
0.34945028632,
0.37147327232,
0.36700258432,
0.34368023932,
0.41311043732,
0.34850496032,
0.33428631332000003,
0.35562270932
]
},
{
"command": "pnpr@main",
"mean": 0.3825498506200001,
"stddev": 0.0516711548272263,
"median": 0.35837297582,
"user": 0.2702508,
"system": 0.6305348799999998,
"min": 0.34406484132,
"max": 0.50320160432,
"times": [
0.36025001132,
0.34406484132,
0.40591760732,
0.35649594032,
0.36079652832000003,
0.35242887132,
0.35190830332,
0.35262178332,
0.43781301532,
0.50320160432
]
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.2416588141123077,
"stddev": 0.028837743437908993,
"median": 0.23975544542,
"user": 0.23182937076923074,
"system": 0.08135385692307692,
"min": 0.19342965242000001,
"max": 0.29396298142000005,
"times": [
0.20976659642,
0.19342965242000001,
0.21695489942,
0.24948193342,
0.25352878342,
0.21867968742,
0.25975051042,
0.23517397842,
0.28626052442000005,
0.23249397642,
0.25232561442,
0.29396298142000005,
0.23975544542
]
},
{
"command": "pacquet@main",
"mean": 0.22110315592,
"stddev": 0.026104993087491635,
"median": 0.21862065642,
"user": 0.20493522333333333,
"system": 0.08340178,
"min": 0.18914524442,
"max": 0.27169024642000006,
"times": [
0.23206062142,
0.23504096842,
0.19214259442,
0.20340233342,
0.21880953142,
0.23754583342,
0.18914524442,
0.27169024642000006,
0.25611571342000006,
0.19869811842000001,
0.21843178142,
0.20015488442
]
},
{
"command": "pnpr@HEAD",
"mean": 0.09598648764580643,
"stddev": 0.0045236084868383614,
"median": 0.09476908942000001,
"user": 0.02679662387096774,
"system": 0.011306948387096775,
"min": 0.08691077942000001,
"max": 0.10524299542000001,
"times": [
0.09122808842,
0.08996006642000001,
0.09471354542,
0.09270513242,
0.09422484742000001,
0.09245257842000001,
0.08691077942000001,
0.09329910842000001,
0.09544202442000001,
0.09557326942000001,
0.10524299542000001,
0.09778679742000002,
0.09517609542000001,
0.09191409742000001,
0.09476908942000001,
0.09409946142,
0.10511246642000001,
0.09568069042,
0.09980290342,
0.10118321642000001,
0.10477781942000002,
0.09863731642000001,
0.09460205742000001,
0.09152044842000001,
0.09296643642,
0.09371816642000001,
0.09286956342000001,
0.09991510342000001,
0.10131584742000001,
0.09690550042000001,
0.10107560442
]
},
{
"command": "pnpr@main",
"mean": 0.10507458583379313,
"stddev": 0.010800142157290287,
"median": 0.10466765142000001,
"user": 0.03127934689655172,
"system": 0.014547607586206893,
"min": 0.09022654842000001,
"max": 0.13749903842,
"times": [
0.09776060842,
0.09717537942000001,
0.09022654842000001,
0.09543223442000001,
0.11751640642000001,
0.10085903742,
0.09770810942000001,
0.09901658842000001,
0.09707030142,
0.09743816342000002,
0.10466765142000001,
0.13749903842,
0.11175917142000001,
0.09750114142,
0.11371767042000001,
0.10618969042000001,
0.10638210142000001,
0.09422037942000001,
0.10553872742,
0.11120509042000001,
0.10195956542000001,
0.10504543142000002,
0.10496011142000002,
0.13105201942,
0.12061750942,
0.10538331642000001,
0.10514999742000002,
0.09918839042000001,
0.09492260842000001
]
}
]
}Scenario: Isolated linker: peer-heavy resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.7891559502777777,
"stddev": 0.2500333259351278,
"median": 0.6790334175,
"user": 0.7239753288888888,
"system": 0.14580681333333334,
"min": 0.5645322815,
"max": 1.3299020005,
"times": [
0.8364230985000001,
0.6585555635,
0.5645322815,
1.0362513825,
0.6262094595000001,
1.3299020005,
0.5939343275,
0.7775620215,
0.6790334175
]
},
{
"command": "pacquet@main",
"mean": 0.8091098870555555,
"stddev": 0.2247784130732295,
"median": 0.7674868575,
"user": 0.7541916622222221,
"system": 0.14037448,
"min": 0.5471073125,
"max": 1.2108873775,
"times": [
0.5830168915,
1.0715197565,
1.2108873775,
0.7618624035,
0.8647157605,
0.7674868575,
0.8735244845000001,
0.5471073125,
0.6018681395000001
]
},
{
"command": "pnpm@HEAD",
"mean": 3.3955670313888895,
"stddev": 0.10900375425150413,
"median": 3.3733407405,
"user": 5.202397662222222,
"system": 0.30590625777777775,
"min": 3.2150818655,
"max": 3.5934851625000004,
"times": [
3.5051928755,
3.3315398555000004,
3.3733407405,
3.3535669385,
3.3439315505000002,
3.5934851625000004,
3.4011134445000004,
3.2150818655,
3.4428508495
]
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.661178826359999,
"stddev": 0.12353508670917368,
"median": 4.61987872256,
"user": 2.21703626,
"system": 1.676296,
"min": 4.54433953856,
"max": 4.954066768560001,
"times": [
4.62913757356,
4.60876349456,
4.554100693560001,
4.61061987156,
4.54433953856,
4.7162016945600005,
4.954066768560001,
4.55986735556,
4.7334173255600005,
4.70127394756
]
},
{
"command": "pacquet@main",
"mean": 4.51077470306,
"stddev": 0.08769257260344253,
"median": 4.4791431930600005,
"user": 1.8790939599999998,
"system": 1.4432173,
"min": 4.43074671656,
"max": 4.65376845556,
"times": [
4.489812708560001,
4.43827314256,
4.44248660256,
4.44614870556,
4.65376845556,
4.63203642656,
4.4775497175600005,
4.616187886560001,
4.43074671656,
4.4807366685600005
]
},
{
"command": "pnpr@HEAD",
"mean": 3.5707179947600003,
"stddev": 0.11659610912170044,
"median": 3.52531899956,
"user": 1.32429676,
"system": 1.2882203999999997,
"min": 3.46847070056,
"max": 3.7989546895600004,
"times": [
3.51003494456,
3.52274047756,
3.7989546895600004,
3.52789752156,
3.4776095385600003,
3.57470880856,
3.46847070056,
3.49330254456,
3.7638707135600002,
3.56959000856
]
},
{
"command": "pnpr@main",
"mean": 3.58848369306,
"stddev": 0.14219328055730723,
"median": 3.52790790956,
"user": 1.3532964599999997,
"system": 1.3345492999999997,
"min": 3.46822113856,
"max": 3.9077661485600004,
"times": [
3.9077661485600004,
3.46822113856,
3.4868130115600002,
3.7068294995600004,
3.54962846456,
3.71308151656,
3.53801863156,
3.5123790775600003,
3.5177971875600003,
3.48430225456
]
}
]
} |
|
| Project | pnpm's project |
| Branch | pr/13644 |
| 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,552.08 ms |
| isolated-linker.fresh-install.cold-cache.hot-store | 📈 view plot | 334.29 ms |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot | 392.89 ms |
| isolated-linker.fresh-resolve.hot-cache.offline | 📈 view plot | 86.91 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot | 1,416.31 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr | 📈 view plot | 3,468.47 ms |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 306.13 ms |
Picks up the store-index helper sharing (#13647) and the headless-install bin shim for publicly hoisted workspace packages (#13644), which moves the linking and materialization-plan modules from `package-manager` into `deps-restorer`. Neither touches the mtime helpers or the workspace-state clock seam this branch changes, so the merge is clean.
Summary
Both install paths ran the same two phases from two copies. Sharing them turned up a real headless-install bug that the duplication had been hiding, plus an older one next to it.
Refactor. The materialization plan (installability host → skip set →
--no-optional/--no-runtime→ reachability closure → engine name) and the link phase (hoist plan, pre-link reconciliation, importer symlinks, root-component cross-links, per-slot bins, the hoisted-linker arm, the on-disk hoist pass, module-resolution sidecars) now live once inpacquet-deps-restorer.InstallFrozenLockfile::rundrops 875 → 485. Net −190 lines.Fix 1 — headless installs missed publicly hoisted workspace-package bins. A workspace package matching
publicHoistPatternis hoisted into the rootnode_modules, but the hoist result records it inhoisted_workspace_aliases, notpublicly_hoisted_aliases_with_bins— only the snapshot loop'sHoistKind::Publicbranch fills that. The post-build top-level bin link reads only the latter, so such a package's bin reached the root.binsolely through the link phase's re-walk ofnode_modules, which only a non-frozen install performed.pnpm install --frozen-lockfiletherefore left the shim missing until the next normal install. pnpm's own headless path re-walks (linkBinsOfImporter→linkBins), so this was pacquet diverging rather than shared behaviour, and no TypeScript change is needed.Fix 2 — a stray file in
node_modulesfailed the install.link_bins::read_packageskipped a missingpackage.jsonbut treated every other error as fatal, so a user file next to the dependencies died onNotADirectoryreading<file>/package.json. This affected normal installs too and was simply unexercised. A non-directory entry now means "not a package", like a missing manifest.How the fixes surfaced
Sharing the link phase left one behavioural flag,
relink_importer_bins, that no test pinned — flipping it left 163 tests green. Rather than guess whether it was dead, I traced what the re-walk uniquely contributes, predicted the divergence from the hoist result's shape, and wrote a test for it. It failed exactly as predicted: passing on the fresh path, failing on the headless one.Both paths now re-walk, which fixes the gap and removes the flag — the shared link phase has no path-specific behaviour left. Turning it on for the headless path then failed an existing test on a user file in
node_modules, which is fix 2.Differences kept as parameters
Merging behaviour would have been wrong in seven places; each is a caller-side input with its reason recorded:
.modules.yaml.skipped--no-optionalgate!include_optionalis_full_installworkspace_rootmodules_dir.parent()project_manifestsproject_anchor_importer_idsproject_manifestsimporter_manifestsTwo suspected differences were not differences.
compute_hoist_plan'sis_hoistedargument and the hoist/bin ordering: the fresh path passesfalseonly because it reaches that call inside its isolated branch, where the flag is already known.One nearly cost a behaviour change.
any_installability_constraintshort-circuits onpackages.values().any(...)before reading snapshots, so it returnstruefor a lockfile with constrained metadata and no snapshots. Folding the frozen path's non-empty guard into the shared function looks redundant and is not: without it, that lockfile pays for anode --versionit has nothing to check, and the resultinghost_nodeflips engine-name derivation.Tests
Two new, each verified to fail without its fix:
publicly_hoisted_workspace_package_bins_reach_the_root_bin_dir— covers fix 1 on both paths.hoist_patterns_are_inert_under_the_hoisted_linker—nodeLinker: hoistedcombined with a hoist pattern was previously untested, and is exactly whatcompute_hoist_plan'sis_hoistedcontrols.Fix 2 is covered by the existing
included_drift_keeps_user_node_modules_entry_while_layout_drift_wipes_it, which failed the moment the headless path started re-walking.Verification
pacquet-package-manager+pacquet-deps-restorer+pacquet-cmd-shim— 935 passed.pacquet-clisuite — 2417 passed.cargo clippy --workspace --all-targets -- -D warnings;cargo docwithRUSTDOCFLAGS=-D warnings --document-private-items.Note for review
The refactor and the two fixes are independently backportable. Happy to split the fixes into their own PR if that is easier to land — say the word.
Squash Commit Body
Checklist
pnpm/port, or the description notes what still needs porting.pnpm changeset) if this PR changes any publishedpackage.
Written by an agent (Claude Code, claude-opus-5).