Skip to content

fix(pacquet): align hoisted dependency metadata - #13455

Merged
zkochan merged 3 commits into
mainfrom
fix-13449
Jul 28, 2026
Merged

zkochan merged 3 commits into
mainfrom
fix-13449

Conversation

@zkochan

@zkochan zkochan commented Jul 27, 2026 •

Copy link
Copy Markdown
Member

Summary

Fixes #13449.

Pacquet now produces the same hoistedDependencies contents and ordering as the TypeScript CLI. The hoist pass now:

  • preserves insertion order when serializing .modules.yaml;
  • follows pnpm's graph-walker ownership semantics;
  • orders equal-depth packages by their virtual-store directory names; and
  • applies pnpm's importer and dependency-group ordering.

The TypeScript CLI already has the expected behavior, so this PR changes only the Rust implementation. No documentation update is needed because this corrects an existing on-disk compatibility contract.

The issue's n8n reproduction at commit fd5bc7da2801e4bf8cad6937e7e059accf5e9407 now matches exactly: all 2,807 hoistedDependencies entries, including key order, are identical between the TypeScript and Rust CLIs.

Squash Commit Body

Pacquet serialized hoisted dependencies through sorted maps and traversed
the dependency graph with breadth-first ownership semantics. Both choices
could select or order entries differently from the TypeScript CLI.

Preserve insertion order through the modules manifest, mirror pnpm's
graph-walker ownership and direct-dependency ordering, and use virtual-store
directory names as the equal-depth sort key.

Fixes pnpm/pnpm#13449.

Checklist

  • The change is implemented in both the TypeScript CLI and the Rust
    pnpm/ port, or the description notes what still needs porting.
  • Added a changeset (pnpm changeset) if this PR changes any published
    package. Keep it short and written for pnpm users — it becomes a release note.
  • Added or updated tests.
  • Updated the documentation if needed.

Written by an agent (Codex, GPT-5).


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

Summary by CodeRabbit

  • Bug Fixes
    • Improved dependency hoisting consistency by preserving hoistedDependencies ordering in node_modules/.modules.yaml.
    • Ensured hoist planning and graph traversal produce deterministic, stable results across installations and importers.
    • Updated hoist-workspace-packages handling to align ordering expectations with the manifest.
  • Tests
    • Added/updated tests to validate ordering preservation, traversal behavior, and alias-collision hoisting.
    • Refreshed fixtures to use deterministic map ordering for hoisted dependency structures.

Copilot AI review requested due to automatic review settings July 27, 2026 23:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Align pacquet hoistedDependencies ordering with pnpm CLI

🐞 Bug fix 🧪 Tests 🕐 40+ Minutes

Grey Divider

AI Description

• Preserve insertion order for hoistedDependencies in node_modules/.modules.yaml.
• Mirror pnpm graph-walker traversal and direct-dependency ordering in Rust hoisting.
• Add regression tests to lock ordering and ownership semantics to pnpm-compatible output.
Diagram

graph TD
  A[("Lockfile")]
  B["Build hoist graph"]
  C["Traversal + ordering"]
  D[(".modules.yaml")]
  E["Link hoisted deps"]
  F["Create bins"]
  G["Workspace hoist map"]

  A --> B --> C --> D --> E --> F
  G --> C
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Keep BTreeMap + custom ordered serialization
  • ➕ Avoids switching map types across the codebase
  • ➕ Maintains deterministic sorted output for human readability
  • ➖ Does not satisfy pnpm’s insertion-order compatibility contract
  • ➖ Still requires carrying explicit order metadata alongside sorted maps
  • ➖ Higher risk of diverging again from pnpm behavior over time
2. Store explicit order vectors and keep HashMap for lookup
  • ➕ Can preserve pnpm order while keeping O(1) lookups in hot paths
  • ➕ Decouples ordering concerns from data structure choice
  • ➖ More moving parts (map + order list) and more invariants to maintain
  • ➖ Easy to introduce mismatches between order vectors and map contents
  • ➖ More complex serialization/deserialization logic

Recommendation: The PR’s approach (IndexMap end-to-end + pnpm-aligned traversal/ordering keys) is the most robust way to meet the on-disk compatibility requirement. It makes ordering an explicit, structural property of the data model, and the added regression tests reduce the risk of future drift.

Files changed (8) +260 / -193

Bug fix (4) +154 / -171
lib.rsPreserve hoistedDependencies insertion order in Modules manifest +2/-2

Preserve hoistedDependencies insertion order in Modules manifest

• Switches 'Modules.hoisted_dependencies' from 'BTreeMap' to 'IndexMap' (nested) so YAML serialization preserves insertion order. This aligns '.modules.yaml' output semantics with pnpm.

pnpm/crates/modules-yaml/src/lib.rs

hoist.rsRework hoist traversal to match pnpm graph-walker ordering +132/-152

Rework hoist traversal to match pnpm graph-walker ordering

• Changes hoist metadata to insertion-ordered 'IndexMap' and reimplements traversal to follow pnpm’s graph-walker ownership semantics. Adds a per-node virtual-store 'sort_key', applies pnpm importer/dependency-group ordering, and threads 'virtual_store_dir_max_length' into graph construction for stable ordering ties.

pnpm/crates/package-manager/src/hoist.rs

install_frozen_lockfile.rsIntegrate pnpm-aligned hoist plan into frozen-lockfile installs +18/-15

Integrate pnpm-aligned hoist plan into frozen-lockfile installs

• Updates workspace hoist maps to 'IndexMap' and switches hoist graph creation to the max-length-aware builder using config 'virtual_store_dir_max_length'. Keeps the single-traversal plan reuse but aligns terminology and types with the new ordering contract.

pnpm/crates/package-manager/src/install_frozen_lockfile.rs

install_with_fresh_lockfile.rsUse ordered workspace map for fresh-lockfile hoist planning +2/-2

Use ordered workspace map for fresh-lockfile hoist planning

• Updates workspace package collection to build an 'IndexMap', ensuring deterministic ordering consistent with the frozen-lockfile path. Adjusts comments to reflect traversal semantics (not BFS-specific).

pnpm/crates/package-manager/src/install_with_fresh_lockfile.rs

Tests (3) +101 / -22
index.rsUpdate modules-yaml tests for IndexMap and ordering contract +44/-9

Update modules-yaml tests for IndexMap and ordering contract

• Updates fixtures/assertions to use 'IndexMap' instead of 'BTreeMap'. Adds a regression test ensuring write/read preserves both outer and inner 'hoistedDependencies' key order.

pnpm/crates/modules-yaml/tests/index.rs

tests.rsExpand hoist test coverage for pnpm traversal semantics +51/-7

Expand hoist test coverage for pnpm traversal semantics

• Updates test helpers and fixtures to 'IndexMap'-based types and adds a focused regression test asserting pnpm-like ownership selection in traversal. Adjusts existing tests to include required 'sort_key' fields.

pnpm/crates/package-manager/src/hoist/tests.rs

tests.rsUpdate install tests to new ordered hoistedDependencies shape +6/-6

Update install tests to new ordered hoistedDependencies shape

• Replaces 'BTreeMap' constructions in modules metadata test fixtures with 'IndexMap' equivalents. Keeps behavioral expectations while matching the new manifest/hoist data types.

pnpm/crates/package-manager/src/install/tests.rs

Documentation (1) +5 / -0
quiet-ravens-hoist.mdAdd pacquet patch changeset for hoist metadata alignment +5/-0

Add pacquet patch changeset for hoist metadata alignment

• Introduces a changeset documenting that pacquet now matches pnpm’s 'hoistedDependencies' contents and ordering. This will publish as a patch release note.

.changeset/quiet-ravens-hoist.md

@coderabbitai

coderabbitai Bot commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: bcde707c-9ab5-4698-ad4a-2561e35d4d61

📥 Commits

Reviewing files that changed from the base of the PR and between e1ed810 and 020e375.

📒 Files selected for processing (2)
  • pnpm/crates/package-manager/src/hoist.rs
  • pnpm/crates/package-manager/src/hoist/tests.rs
🚧 Files skipped from review as they are similar to previous changes (2)
  • pnpm/crates/package-manager/src/hoist/tests.rs
  • pnpm/crates/package-manager/src/hoist.rs

📝 Walkthrough

Walkthrough

Pacquet changes hoisting and .modules.yaml handling to preserve insertion order using IndexMap, refactors graph traversal ordering, updates installation wiring, and adds serialization and traversal tests.

Changes

Ordered hoisting output

Layer / File(s) Summary
Manifest ordering contract
pnpm/crates/modules-yaml/..., .changeset/quiet-ravens-hoist.md
hoistedDependencies uses nested IndexMap values, with tests verifying top-level and nested key order during manifest round trips.
Ordered hoist traversal
pnpm/crates/package-manager/src/hoist.rs, pnpm/crates/package-manager/src/hoist/tests.rs
Hoist graph nodes, direct dependencies, traversal entries, and hoisted results use deterministic insertion ordering; new tests cover ownership and alias-collision traversal behavior.
Install wiring and validation
pnpm/crates/package-manager/src/install_*.rs
Frozen and fresh lockfile installation paths pass ordered workspace package maps into hoist planning, and installer fixtures adopt the updated manifest type.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant InstallFrozenLockfile
  participant HoistGraph
  participant HoistTraversal
  participant ModulesManifest
  InstallFrozenLockfile->>HoistGraph: Build graph with configured virtual-store length
  HoistGraph->>HoistTraversal: Supply ordered graph nodes and direct dependencies
  HoistTraversal->>ModulesManifest: Write ordered hoistedDependencies
Loading

Assessment against linked issues

Objective Addressed Explanation
Align pacquet .modules.yaml hoistedDependencies contents and ordering with the TypeScript CLI [#13449] ✅

Possibly related issues

Possibly related PRs

  • pnpm/pnpm#13151 — Its stale-module pruning flow consumes the hoisted dependency data updated by this PR.

Suggested labels: product: pacquet

Suggested reviewers: copilot

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-13449

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains; the previously reported importer-root omission is fixed by collecting traversal roots from every importer's direct dependency map, and the regression test covers distinct versions behind the same alias.

Reviews (3): Last reviewed commit: "fix(package-manager): preserve direct de..." | Re-trigger Greptile

@github-actions

github-actions Bot commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

Micro-Benchmark Results

Linux

group                                            main                                   pr
-----                                            ----                                   --
lockfile/parse_pnpm_lock                         1.00     11.7±0.52ms    31.9 MB/sec    1.06     12.4±0.84ms    30.2 MB/sec
packument/parse                                  1.00     41.9±0.39µs  1584.0 MB/sec    1.01     42.4±2.93µs  1563.0 MB/sec
tarball/download_dependency                      1.18      2.8±0.39ms  1528.5 KB/sec    1.00      2.4±0.15ms  1809.0 KB/sec
tarball_batch/cold_store_many_medium_tarballs    1.00    206.6±8.38ms 77.4 KElem/sec    1.00    205.8±6.41ms 77.7 KElem/sec

@qodo-code-review

qodo-code-review Bot commented Jul 27, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (3) 📘 Rule violations (1) 📜 Skill insights (0)

Context used
✅ Compliance rules (platform): 24 rules

Grey Divider


Action required

1. Direct-dep precedence changed ✓ Resolved 🐞 Bug ≡ Correctness
Description
build_direct_deps_by_importer() now hard-codes dependency-group iteration order and overwrites
duplicate aliases, so later groups can win and caller-specified group precedence is ignored. This
can make the hoist traversal pick different direct deps/ownership than the symlink stage (which is
first-wins in caller-provided order), producing incorrect hoistedDependencies and inconsistent
install behavior.
Code

pnpm/crates/package-manager/src/hoist.rs[R149-165]

+        for group in [DependencyGroup::Dev, DependencyGroup::Prod, DependencyGroup::Optional] {
+            if !dependency_groups.contains(&group) {
                continue;
            }
            let Some(map) = project_snapshot.get_map_by_group(group) else { continue };
-            for (name, spec) in map {
+            let mut entries: Vec<_> = map.iter().collect();
+            entries.sort_by_cached_key(|entry| entry.0.to_string());
+            for (name, spec) in entries {
                // Skip `link:` workspace siblings — they don't live
                // in the snapshot graph and aren't candidates for the
-                // private/public hoist (they belong to the separate
-                // `hoistedWorkspacePackages` shape, which is
-                // out of scope for this issue per <https://github.com/pnpm/pacquet/issues/431>). For aliased
-                // deps, [`ImporterDepVersion::resolved_key`] returns
-                // the alias's own (name, suffix), matching the
-                // snapshot key under which the package lives.
+                // private/public hoist. For aliased deps,
+                // [`ImporterDepVersion::resolved_key`] returns the
+                // alias's own (name, suffix), matching the snapshot
+                // key under which the package lives.
                let Some(key) = spec.version.resolved_key(name) else { continue };
-                // First-wins per alias: same precedence as
-                // `SymlinkDirectDependencies` (Prod beats Dev beats
-                // Optional with the CLI's group order).
-                deps.entry(name.to_string()).or_insert(key);
+                deps.insert(name.to_string(), key);
            }
Relevance

⭐⭐ Medium

No clear historical acceptance/rejection for hoist direct-deps precedence; overwrite-related
concerns were rejected elsewhere (PR #12940).

PR-#12940
PR-#13306

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The PR changes direct-dep collection from caller-ordered, first-wins behavior to fixed group order
with overwrite-on-duplicate. The symlink stage still uses first-wins in caller-provided
dependency-group order, and install threads the same dependency_groups into both stages, so the
new hoist direct-deps map can diverge from what the install actually links.

pnpm/crates/package-manager/src/hoist.rs[134-168]
pnpm/crates/package-manager/src/symlink_direct_dependencies.rs[587-638]
pnpm/crates/package-manager/src/install_frozen_lockfile.rs[637-643]
pnpm/crates/package-manager/src/install_frozen_lockfile.rs[2021-2032]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`build_direct_deps_by_importer()` currently:
- iterates groups in a fixed `[Dev, Prod, Optional]` order (ignoring the caller-provided `dependency_groups` ordering), and
- uses `deps.insert(...)` which overwrites any previously seen alias.

This changes precedence semantics compared to the rest of the install pipeline, which treats dependency groups in the caller-provided order and uses first-wins semantics for duplicate aliases.

### Issue Context
`SymlinkDirectDependencies` resolves direct deps with a first-wins filter (`seen`) while iterating `dependency_groups` in the order passed by the caller. `compute_hoist_plan()` passes the same `dependency_groups` to both symlink linking and hoist planning, so hoist planning must match that ordering/precedence.

### Fix Focus Areas
- pnpm/crates/package-manager/src/hoist.rs[134-169]
- pnpm/crates/package-manager/src/symlink_direct_dependencies.rs[587-638]
- pnpm/crates/package-manager/src/install_frozen_lockfile.rs[637-643]
- pnpm/crates/package-manager/src/install_frozen_lockfile.rs[2021-2032]
- pnpm/crates/package-manager/src/hoist/tests.rs[551-570]

### Suggested fix
1. Iterate the *provided* `dependency_groups` in order (filtering out `Peer`).
2. For each group map, iterate entries deterministically (keep your stable ordering requirements), but insert with first-wins semantics:
  - `deps.entry(name.to_string()).or_insert(key)`
3. Add a regression test where the same alias exists in two included groups with different resolved keys, and assert the earlier group (by caller order) wins.

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



Remediation recommended

2. Link deps skew ordering 🐞 Bug ≡ Correctness ⭐ New
Description
In build_direct_deps_by_importer(), the ordering pass inserts aliases based only on alias presence
in the group map, without checking whether that group’s spec resolves (e.g. link: resolves to
None). If some other group resolved the alias, a link: entry can still claim the alias’
insertion position, changing deterministic ordering/ownership behavior.
Code

pnpm/crates/package-manager/src/hoist.rs[R170-173]

+            for (name, _) in entries {
+                let alias = name.to_string();
+                let Some(key) = resolved_by_alias.get(&alias) else { continue };
+                deps.entry(alias).or_insert_with(|| key.clone());
Relevance

⭐⭐⭐ High

Team prioritizes determinism/parity; similar ordering/resolution correctness fixes accepted (PRs
13368, 13384, 13424).

PR-#13368
PR-#13384
PR-#13424

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
resolved_key() returning None for link: means the first pass intentionally ignores link:
entries, but the second-pass ordering loop can still insert the alias when it appears in a map (even
if it’s link:) as long as another group populated resolved_by_alias, making ordering dependent
on link: presence rather than resolvable entries.

pnpm/crates/package-manager/src/hoist.rs[147-174]
pnpm/crates/lockfile/src/resolved_dependency.rs[148-170]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`build_direct_deps_by_importer()` builds `resolved_by_alias` by skipping `link:` specs (`resolved_key(...) == None`), but later, while establishing insertion order, it iterates the dependency maps and inserts an alias without verifying that the *current* group’s entry is resolvable. This allows a `link:` entry to influence insertion order (and therefore traversal/serialization order) if the alias was resolved from another group.

### Issue Context
- `ImporterDepVersion::resolved_key()` explicitly returns `None` for `link:` dependencies.
- The ordering loop currently ignores `spec` (`for (name, _) in entries`) and only checks `resolved_by_alias.get(&alias)`.

### Fix Focus Areas
- pnpm/crates/package-manager/src/hoist.rs[167-174]

### Suggested fix
In the ordering pass, keep `spec` and skip entries whose `spec.version.resolved_key(name)` is `None` (i.e. `link:`), so only resolvable entries can determine insertion position. For example:

```rust
for (name, spec) in entries {
   if spec.version.resolved_key(name).is_none() {
       continue;
   }
   let alias = name.to_string();
   let Some(key) = resolved_by_alias.get(&alias) else { continue };
   deps.entry(alias).or_insert_with(|| key.clone());
}
```

Optionally add a targeted regression test where the same alias appears in two groups, one being `link:` and the other regular, asserting the resulting direct-deps ordering matches the intended pnpm behavior.

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



Informational

3. Unconditional dbg! in test 🐞 Bug ⚙ Maintainability
Description
The new traversal test includes an unconditional dbg! call, which prints to stderr on every test
run and adds avoidable noise to CI output.
Code

pnpm/crates/package-manager/src/hoist/tests.rs[328]

+    dbg!(&hoisted_keys);
Relevance

⭐⭐⭐ High

Team removes unconditional debug prints in tests as CI noise (PR #13329, #13293); dbg! only for
failure context (PR #13177).

PR-#13329
PR-#13293
PR-#13177

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new test traversal_includes_alias_collisions_from_every_importer calls dbg!(&hoisted_keys);
unconditionally, so it will always emit output during test runs.

pnpm/crates/package-manager/src/hoist/tests.rs[301-331]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
A new unit test prints debug output unconditionally via `dbg!`, which adds noise to CI logs.

### Issue Context
`dbg!` is intended for temporary debugging and should not be committed unless the project explicitly allows it.

### Fix Focus Areas
- pnpm/crates/package-manager/src/hoist/tests.rs[327-330]

### Suggested fix
- Remove `dbg!(&hoisted_keys);`.
- If extra context is needed when the assertion fails, fold it into the assertion message instead (e.g., `assert!(..., "...: {hoisted_keys:?}")`).

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


4. pnpm missing from changeset 📘 Rule violation § Compliance
Description
The new changeset only declares a bump for pacquet and omits an explicit pnpm entry. This
violates the changeset requirement and may cause the pnpm package versioning/release notes to be
incomplete or inconsistent.
Code

.changeset/quiet-ravens-hoist.md[R1-3]

+---
+"pacquet": patch
+---
Relevance

⭐ Low

Similar “add pnpm entry to changeset front-matter” suggestions were repeatedly rejected (e.g., PRs
#13454, #13436).

PR-#13454
PR-#13436
PR-#13347

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 713436 requires that each newly added/modified changeset explicitly includes the
pnpm package with a valid bump type. The added changeset front-matter contains only `"pacquet":
patch and no pnpm` entry.

Rule 713436: Explicitly declare pnpm package and correct bump type in changesets
.changeset/quiet-ravens-hoist.md[1-3]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The changeset front-matter omits an entry for the `pnpm` package.

## Issue Context
Compliance requires changesets to explicitly include a `pnpm` bump type (`patch`/`minor`/`major`). This PR is a bug-fix style alignment change, so `patch` is likely appropriate unless maintainers intend otherwise.

## Fix Focus Areas
- .changeset/quiet-ravens-hoist.md[1-3]

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


5. Sort key allocates Strings 🐞 Bug ➹ Performance
Description
Hoist graph building and direct-deps collection sort entries via `sort_by_cached_key(|e|
e.0.to_string()), allocating one temporary String` per entry just for comparison. On hoist-enabled
installs with large lockfiles this adds avoidable CPU/alloc overhead; comparing the existing key
types directly preserves deterministic order without allocations.
Code

pnpm/crates/package-manager/src/hoist.rs[R79-82]

+                let mut dep_entries: Vec<_> =
+                    dependency_map.iter().flat_map(|map| map.iter()).collect();
+                dep_entries.sort_by_cached_key(|entry| entry.0.to_string());
+                for (alias, dep_ref) in dep_entries {
Relevance

⭐ Low

Team previously rejected “avoid to_string allocations for sort keys” performance suggestion in
similar code (PR #13368).

PR-#13368

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Both build_hoist_graph_with_max_length() and build_direct_deps_by_importer() introduced/contain
sorts that allocate temporary String keys via to_string() for comparisons. These run on the
install hoist-planning path and are avoidable since the key types can be compared directly.

pnpm/crates/package-manager/src/hoist.rs[65-102]
pnpm/crates/package-manager/src/hoist.rs[134-166]
pnpm/crates/package-manager/src/install_frozen_lockfile.rs[2021-2045]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
Two sorts use `sort_by_cached_key(|entry| entry.0.to_string())`, which allocates a new `String` per entry even though the keys already support ordering.

### Issue Context
These functions run during hoist planning (`compute_hoist_plan`) when hoisting is enabled; large projects can have thousands of snapshots and tens of thousands of dependency edges.

### Fix Focus Areas
- pnpm/crates/package-manager/src/hoist.rs[74-90]
- pnpm/crates/package-manager/src/hoist.rs[141-166]

### Suggested fix
- Replace allocation-based key generation with direct comparisons:
 - For `&String` keys: `dep_entries.sort_unstable_by(|a, b| a.0.cmp(b.0));`
 - For `&PkgName` keys: `entries.sort_unstable_by(|a, b| a.0.cmp(b.0));`
- Keep the same deterministic ordering requirements; this change should be behavior-preserving, just cheaper.

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


Grey Divider

Previous review results

Review updated until commit 020e375

Results up to commit eda75d0 ⚖️ Balanced


🐞 Bugs (1) 📘 Rule violations (1) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)


Action required
1. Direct-dep precedence changed ✓ Resolved 🐞 Bug ≡ Correctness
Description
build_direct_deps_by_importer() now hard-codes dependency-group iteration order and overwrites
duplicate aliases, so later groups can win and caller-specified group precedence is ignored. This
can make the hoist traversal pick different direct deps/ownership than the symlink stage (which is
first-wins in caller-provided order), producing incorrect hoistedDependencies and inconsistent
install behavior.
Code

pnpm/crates/package-manager/src/hoist.rs[R149-165]

+        for group in [DependencyGroup::Dev, DependencyGroup::Prod, DependencyGroup::Optional] {
+            if !dependency_groups.contains(&group) {
                continue;
            }
            let Some(map) = project_snapshot.get_map_by_group(group) else { continue };
-            for (name, spec) in map {
+            let mut entries: Vec<_> = map.iter().collect();
+            entries.sort_by_cached_key(|entry| entry.0.to_string());
+            for (name, spec) in entries {
                // Skip `link:` workspace siblings — they don't live
                // in the snapshot graph and aren't candidates for the
-                // private/public hoist (they belong to the separate
-                // `hoistedWorkspacePackages` shape, which is
-                // out of scope for this issue per <https://github.com/pnpm/pacquet/issues/431>). For aliased
-                // deps, [`ImporterDepVersion::resolved_key`] returns
-                // the alias's own (name, suffix), matching the
-                // snapshot key under which the package lives.
+                // private/public hoist. For aliased deps,
+                // [`ImporterDepVersion::resolved_key`] returns the
+                // alias's own (name, suffix), matching the snapshot
+                // key under which the package lives.
                let Some(key) = spec.version.resolved_key(name) else { continue };
-                // First-wins per alias: same precedence as
-                // `SymlinkDirectDependencies` (Prod beats Dev beats
-                // Optional with the CLI's group order).
-                deps.entry(name.to_string()).or_insert(key);
+                deps.insert(name.to_string(), key);
            }
Relevance

⭐⭐ Medium

No clear historical acceptance/rejection for hoist direct-deps precedence; overwrite-related
concerns were rejected elsewhere (PR #12940).

PR-#12940
PR-#13306

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The PR changes direct-dep collection from caller-ordered, first-wins behavior to fixed group order
with overwrite-on-duplicate. The symlink stage still uses first-wins in caller-provided
dependency-group order, and install threads the same dependency_groups into both stages, so the
new hoist direct-deps map can diverge from what the install actually links.

pnpm/crates/package-manager/src/hoist.rs[134-168]
pnpm/crates/package-manager/src/symlink_direct_dependencies.rs[587-638]
pnpm/crates/package-manager/src/install_frozen_lockfile.rs[637-643]
pnpm/crates/package-manager/src/install_frozen_lockfile.rs[2021-2032]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`build_direct_deps_by_importer()` currently:
- iterates groups in a fixed `[Dev, Prod, Optional]` order (ignoring the caller-provided `dependency_groups` ordering), and
- uses `deps.insert(...)` which overwrites any previously seen alias.

This changes precedence semantics compared to the rest of the install pipeline, which treats dependency groups in the caller-provided order and uses first-wins semantics for duplicate aliases.

### Issue Context
`SymlinkDirectDependencies` resolves direct deps with a first-wins filter (`seen`) while iterating `dependency_groups` in the order passed by the caller. `compute_hoist_plan()` passes the same `dependency_groups` to both symlink linking and hoist planning, so hoist planning must match that ordering/precedence.

### Fix Focus Areas
- pnpm/crates/package-manager/src/hoist.rs[134-169]
- pnpm/crates/package-manager/src/symlink_direct_dependencies.rs[587-638]
- pnpm/crates/package-manager/src/install_frozen_lockfile.rs[637-643]
- pnpm/crates/package-manager/src/install_frozen_lockfile.rs[2021-2032]
- pnpm/crates/package-manager/src/hoist/tests.rs[551-570]

### Suggested fix
1. Iterate the *provided* `dependency_groups` in order (filtering out `Peer`).
2. For each group map, iterate entries deterministically (keep your stable ordering requirements), but insert with first-wins semantics:
  - `deps.entry(name.to_string()).or_insert(key)`
3. Add a regression test where the same alias exists in two included groups with different resolved keys, and assert the earlier group (by caller order) wins.

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



Informational
2. pnpm missing from changeset 📘 Rule violation § Compliance
Description
The new changeset only declares a bump for pacquet and omits an explicit pnpm entry. This
violates the changeset requirement and may cause the pnpm package versioning/release notes to be
incomplete or inconsistent.
Code

.changeset/quiet-ravens-hoist.md[R1-3]

+---
+"pacquet": patch
+---
Relevance

⭐ Low

Similar “add pnpm entry to changeset front-matter” suggestions were repeatedly rejected (e.g., PRs
#13454, #13436).

PR-#13454
PR-#13436
PR-#13347

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 713436 requires that each newly added/modified changeset explicitly includes the
pnpm package with a valid bump type. The added changeset front-matter contains only `"pacquet":
patch and no pnpm` entry.

Rule 713436: Explicitly declare pnpm package and correct bump type in changesets
.changeset/quiet-ravens-hoist.md[1-3]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The changeset front-matter omits an entry for the `pnpm` package.

## Issue Context
Compliance requires changesets to explicitly include a `pnpm` bump type (`patch`/`minor`/`major`). This PR is a bug-fix style alignment change, so `patch` is likely appropriate unless maintainers intend otherwise.

## Fix Focus Areas
- .changeset/quiet-ravens-hoist.md[1-3]

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


3. Sort key allocates Strings 🐞 Bug ➹ Performance
Description
Hoist graph building and direct-deps collection sort entries via `sort_by_cached_key(|e|
e.0.to_string()), allocating one temporary String` per entry just for comparison. On hoist-enabled
installs with large lockfiles this adds avoidable CPU/alloc overhead; comparing the existing key
types directly preserves deterministic order without allocations.
Code

pnpm/crates/package-manager/src/hoist.rs[R79-82]

+                let mut dep_entries: Vec<_> =
+                    dependency_map.iter().flat_map(|map| map.iter()).collect();
+                dep_entries.sort_by_cached_key(|entry| entry.0.to_string());
+                for (alias, dep_ref) in dep_entries {
Relevance

⭐ Low

Team previously rejected “avoid to_string allocations for sort keys” performance suggestion in
similar code (PR #13368).

PR-#13368

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Both build_hoist_graph_with_max_length() and build_direct_deps_by_importer() introduced/contain
sorts that allocate temporary String keys via to_string() for comparisons. These run on the
install hoist-planning path and are avoidable since the key types can be compared directly.

pnpm/crates/package-manager/src/hoist.rs[65-102]
pnpm/crates/package-manager/src/hoist.rs[134-166]
pnpm/crates/package-manager/src/install_frozen_lockfile.rs[2021-2045]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
Two sorts use `sort_by_cached_key(|entry| entry.0.to_string())`, which allocates a new `String` per entry even though the keys already support ordering.

### Issue Context
These functions run during hoist planning (`compute_hoist_plan`) when hoisting is enabled; large projects can have thousands of snapshots and tens of thousands of dependency edges.

### Fix Focus Areas
- pnpm/crates/package-manager/src/hoist.rs[74-90]
- pnpm/crates/package-manager/src/hoist.rs[141-166]

### Suggested fix
- Replace allocation-based key generation with direct comparisons:
 - For `&String` keys: `dep_entries.sort_unstable_by(|a, b| a.0.cmp(b.0));`
 - For `&PkgName` keys: `entries.sort_unstable_by(|a, b| a.0.cmp(b.0));`
- Keep the same deterministic ordering requirements; this change should be behavior-preserving, just cheaper.

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


Results up to commit e1ed810 ⚖️ Balanced


🐞 Bugs (1) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)


Informational
1. Unconditional dbg! in test 🐞 Bug ⚙ Maintainability
Description
The new traversal test includes an unconditional dbg! call, which prints to stderr on every test
run and adds avoidable noise to CI output.
Code

pnpm/crates/package-manager/src/hoist/tests.rs[328]

+    dbg!(&hoisted_keys);
Relevance

⭐⭐⭐ High

Team removes unconditional debug prints in tests as CI noise (PR #13329, #13293); dbg! only for
failure context (PR #13177).

PR-#13329
PR-#13293
PR-#13177

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new test traversal_includes_alias_collisions_from_every_importer calls dbg!(&hoisted_keys);
unconditionally, so it will always emit output during test runs.

pnpm/crates/package-manager/src/hoist/tests.rs[301-331]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
A new unit test prints debug output unconditionally via `dbg!`, which adds noise to CI logs.

### Issue Context
`dbg!` is intended for temporary debugging and should not be committed unless the project explicitly allows it.

### Fix Focus Areas
- pnpm/crates/package-manager/src/hoist/tests.rs[327-330]

### Suggested fix
- Remove `dbg!(&hoisted_keys);`.
- If extra context is needed when the assertion fails, fold it into the assertion message instead (e.g., `assert!(..., "...: {hoisted_keys:?}")`).

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


Qodo Logo

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

@codecov-commenter

codecov-commenter commented Jul 27, 2026 •

Copy link
Copy Markdown

Codecov Report

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

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #13455   +/-   ##
=======================================
  Coverage   87.65%   87.66%           
=======================================
  Files         546      546           
  Lines       94206    94260   +54     
=======================================
+ Hits        82578    82630   +52     
- Misses      11628    11630    +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI review requested due to automatic review settings July 27, 2026 23:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit e1ed810

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
pnpm/crates/package-manager/src/install/tests.rs (1)

6743-6746: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

Merge path now affects .modules.yaml key order but is only asserted by membership.

merge_filtered_modules_metadata re-inserts retained entries into next.hoisted_dependencies, which is now an insertion-ordered IndexMap written straight to .modules.yaml. These contains_key assertions won't catch an ordering regression in that merge (e.g. retained entries appended after selected ones rather than in pnpm's order).

Consider adding a keys().collect::<Vec<_>>() assertion so the filtered-install path's ordering is pinned alongside the fresh-install path.

🤖 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/tests.rs` around lines 6743 - 6746,
Update the filtered-install assertions around merge_filtered_modules_metadata to
verify the exact ordered sequence of next.hoisted_dependencies keys, using
keys().collect::<Vec<_>>() and the expected pnpm ordering. Retain the existing
membership assertions only if needed, and ensure the expectation distinguishes
retained, selected, shared, and stale_selected entries.

Source: Path instructions

pnpm/crates/package-manager/src/hoist.rs (1)

79-81: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Skip the dependency-name allocation when sorting hoist entries.

entry.0 is a PkgName; compute the name once in Ord for PkgName instead of allocating in sort_by_cached_key for every snapshot, then sort with sort_by(|a, b| a.0.cmp(&b.0)).

🤖 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/hoist.rs` around lines 79 - 81, Update the
dependency-entry sorting in the hoisting flow to avoid converting each PkgName
to a String; rely on PkgName’s Ord implementation and sort dep_entries with
direct comparison of entry.0 values via sort_by. Remove the sort_by_cached_key
allocation while preserving the existing ordering.

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/package-manager/src/hoist.rs`:
- Around line 414-441: Update append_dependency_entries to use FIFO queue
traversal rather than the current LIFO steps stack, preserving child ordering so
visited nodes are recorded at their minimum depth. Add a
traversal_matches_pnpm_graph_walker_ownership case where a package is reachable
at depth 1 from a later-ordered parent and depth 2 from an earlier-ordered
parent, asserting the depth-1 owner wins.

---

Nitpick comments:
In `@pnpm/crates/package-manager/src/hoist.rs`:
- Around line 79-81: Update the dependency-entry sorting in the hoisting flow to
avoid converting each PkgName to a String; rely on PkgName’s Ord implementation
and sort dep_entries with direct comparison of entry.0 values via sort_by.
Remove the sort_by_cached_key allocation while preserving the existing ordering.

In `@pnpm/crates/package-manager/src/install/tests.rs`:
- Around line 6743-6746: Update the filtered-install assertions around
merge_filtered_modules_metadata to verify the exact ordered sequence of
next.hoisted_dependencies keys, using keys().collect::<Vec<_>>() and the
expected pnpm ordering. Retain the existing membership assertions only if
needed, and ensure the expectation distinguishes retained, selected, shared, and
stale_selected entries.
🪄 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: d68df886-dd96-4250-87e5-6866efd2b1a9

📥 Commits

Reviewing files that changed from the base of the PR and between ccd362f and e1ed810.

📒 Files selected for processing (8)
  • .changeset/quiet-ravens-hoist.md
  • pnpm/crates/modules-yaml/src/lib.rs
  • pnpm/crates/modules-yaml/tests/index.rs
  • pnpm/crates/package-manager/src/hoist.rs
  • pnpm/crates/package-manager/src/hoist/tests.rs
  • pnpm/crates/package-manager/src/install/tests.rs
  • pnpm/crates/package-manager/src/install_frozen_lockfile.rs
  • pnpm/crates/package-manager/src/install_with_fresh_lockfile.rs

Copilot AI review requested due to automatic review settings July 28, 2026 00:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Jul 28, 2026
@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 020e375

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

@github-actions

Copy link
Copy Markdown
Contributor

Integrated-Benchmark Report (Linux)

Commit: 020e375d4aef

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.453 ± 0.096 2.369 2.652 1.56 ± 0.15
pacquet@main 2.498 ± 0.143 2.352 2.742 1.59 ± 0.17
pnpr@HEAD 1.571 ± 0.142 1.398 1.809 1.00
pnpr@main 1.575 ± 0.152 1.406 1.826 1.00 ± 0.13
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.45265808256,
      "stddev": 0.09572768531620689,
      "median": 2.41676828486,
      "user": 1.70336176,
      "system": 1.4242489999999999,
      "min": 2.3693435368599998,
      "max": 2.65237627486,
      "times": [
        2.43123851586,
        2.45191970386,
        2.40229805386,
        2.65237627486,
        2.37512196886,
        2.39219421586,
        2.58431121886,
        2.4836134308599997,
        2.3693435368599998,
        2.38416390586
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.4978461460599997,
      "stddev": 0.1427575095922015,
      "median": 2.4220888888600003,
      "user": 1.6719280600000002,
      "system": 1.3743124000000002,
      "min": 2.35214923286,
      "max": 2.74169981686,
      "times": [
        2.74169981686,
        2.58036252186,
        2.7181731178599997,
        2.55766573886,
        2.42142666886,
        2.42275110886,
        2.37807692986,
        2.40107348786,
        2.35214923286,
        2.40508283686
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.5705039235600002,
      "stddev": 0.1417094267610207,
      "median": 1.5650654503599999,
      "user": 1.26655026,
      "system": 1.2645045,
      "min": 1.39840533386,
      "max": 1.80858194986,
      "times": [
        1.6637888158599998,
        1.39840533386,
        1.45074863686,
        1.5545311448599999,
        1.80858194986,
        1.4057997278599998,
        1.57559975586,
        1.70879120386,
        1.45791272686,
        1.68087993986
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.57475229126,
      "stddev": 0.15212226291816777,
      "median": 1.57535643636,
      "user": 1.23194716,
      "system": 1.265501,
      "min": 1.40558628686,
      "max": 1.8255418568600001,
      "times": [
        1.4243121158599998,
        1.40558628686,
        1.45252204186,
        1.68309893686,
        1.6150377328599999,
        1.41336354386,
        1.63003052786,
        1.53567513986,
        1.76235472986,
        1.8255418568600001
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 279.7 ± 8.7 263.7 289.1 1.00
pacquet@main 286.5 ± 9.0 274.0 301.5 1.02 ± 0.05
pnpr@HEAD 315.5 ± 12.2 301.3 332.5 1.13 ± 0.06
pnpr@main 323.2 ± 25.8 287.9 372.6 1.16 ± 0.10
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.27966092844,
      "stddev": 0.008680294565303384,
      "median": 0.28376265014,
      "user": 0.23207367999999998,
      "system": 0.5607056399999999,
      "min": 0.26372215964,
      "max": 0.28914606964,
      "times": [
        0.27457071264,
        0.28914606964,
        0.28619305763999997,
        0.28552230064,
        0.28200299964,
        0.26372215964,
        0.28577172264,
        0.26969507264,
        0.28665650064,
        0.27332868864
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.28648902434000006,
      "stddev": 0.00902819271082261,
      "median": 0.28502898014,
      "user": 0.23989748,
      "system": 0.57535364,
      "min": 0.27395295663999997,
      "max": 0.30146529864,
      "times": [
        0.28390062064,
        0.29882737064,
        0.29015612564,
        0.30146529864,
        0.28615733964,
        0.27395295663999997,
        0.28369710664,
        0.29020521864,
        0.28163580564,
        0.27489240064
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.31549849104,
      "stddev": 0.012245413004283882,
      "median": 0.31375062363999995,
      "user": 0.25802138,
      "system": 0.59775194,
      "min": 0.30126713464,
      "max": 0.33252727864,
      "times": [
        0.30786127964,
        0.30462783664,
        0.33252727864,
        0.30711836764,
        0.32364853264,
        0.32864246764,
        0.30153933764,
        0.30126713464,
        0.31963996763999997,
        0.32811270764
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.32319229354,
      "stddev": 0.025761388507268647,
      "median": 0.32086542514,
      "user": 0.28242087999999993,
      "system": 0.59726054,
      "min": 0.28786679464,
      "max": 0.37258957064,
      "times": [
        0.32568481564,
        0.31791947064,
        0.31138277463999997,
        0.28939336664,
        0.31759501764,
        0.32381137964,
        0.35192957464,
        0.33375017064,
        0.37258957064,
        0.28786679464
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 3.037 ± 0.110 2.906 3.229 1.85 ± 0.17
pacquet@main 2.908 ± 0.057 2.823 3.006 1.77 ± 0.16
pnpr@HEAD 1.645 ± 0.142 1.486 1.858 1.00
pnpr@main 1.684 ± 0.162 1.443 1.955 1.02 ± 0.13
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 3.03742301384,
      "stddev": 0.11041535515059595,
      "median": 3.01029190724,
      "user": 2.4208645,
      "system": 1.73661292,
      "min": 2.90618437424,
      "max": 3.22905530524,
      "times": [
        2.96770824024,
        3.05159698024,
        3.08133632524,
        2.96898683424,
        3.17960767324,
        2.93284554624,
        2.90618437424,
        3.10842537624,
        3.22905530524,
        2.94848348324
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.90810074874,
      "stddev": 0.0574669486725791,
      "median": 2.91492404024,
      "user": 2.1649944,
      "system": 1.56669962,
      "min": 2.82284562124,
      "max": 3.00558436224,
      "times": [
        2.91816789324,
        2.84986468924,
        2.82284562124,
        2.85857470924,
        2.91168018724,
        2.97126975324,
        3.00558436224,
        2.94812472624,
        2.92166470224,
        2.87323084324
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.64514122404,
      "stddev": 0.14221563037145987,
      "median": 1.5924016387400002,
      "user": 1.3582053999999997,
      "system": 1.4314107200000001,
      "min": 1.48587444224,
      "max": 1.85836806724,
      "times": [
        1.84769864924,
        1.5356246062399999,
        1.79661866524,
        1.48587444224,
        1.68056157724,
        1.85836806724,
        1.59702277624,
        1.49717359924,
        1.5877805012400001,
        1.5646893562400002
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.6840291994399998,
      "stddev": 0.16174537363424293,
      "median": 1.72357512524,
      "user": 1.2779307,
      "system": 1.32414662,
      "min": 1.44275773924,
      "max": 1.95487284124,
      "times": [
        1.5787820962399999,
        1.95487284124,
        1.79623356824,
        1.71420672124,
        1.78254035524,
        1.79758981524,
        1.73294352924,
        1.5378461032400002,
        1.44275773924,
        1.50251922524
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 737.6 ± 64.4 646.7 838.4 2.17 ± 0.24
pacquet@main 688.0 ± 53.7 611.3 768.1 2.02 ± 0.21
pnpr@HEAD 361.1 ± 13.2 346.8 385.8 1.06 ± 0.08
pnpr@main 340.3 ± 22.0 318.4 392.0 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.7375804102200001,
      "stddev": 0.06439403612995596,
      "median": 0.7358135651200001,
      "user": 0.89790968,
      "system": 0.80166024,
      "min": 0.64666829012,
      "max": 0.8384206221200001,
      "times": [
        0.7480894691200001,
        0.8384206221200001,
        0.7621916301200001,
        0.7996270791200001,
        0.7108358831200001,
        0.6522134581200001,
        0.64666829012,
        0.6926214181200001,
        0.8015985911200001,
        0.7235376611200001
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.68796708342,
      "stddev": 0.053674241714377395,
      "median": 0.6963320181200001,
      "user": 0.8569636799999998,
      "system": 0.7410333400000001,
      "min": 0.6112544681200001,
      "max": 0.76811925012,
      "times": [
        0.6112544681200001,
        0.6128881621200001,
        0.65007070312,
        0.6999960501200001,
        0.7222807681200001,
        0.76811925012,
        0.6926679861200001,
        0.7554519771200001,
        0.6660455501200001,
        0.70089591912
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.36114644832000004,
      "stddev": 0.013164920212921335,
      "median": 0.36137336312,
      "user": 0.24841118,
      "system": 0.6153701399999999,
      "min": 0.34678434212000003,
      "max": 0.38575832612,
      "times": [
        0.34678434212000003,
        0.34863971612,
        0.38081993412000004,
        0.36116661312000004,
        0.35427087612,
        0.36161132312,
        0.36158011312,
        0.34867061512,
        0.36216262412,
        0.38575832612
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.34028781331999997,
      "stddev": 0.022049689652259227,
      "median": 0.33382528412,
      "user": 0.24067128,
      "system": 0.5807567399999999,
      "min": 0.31840709412,
      "max": 0.39203818112,
      "times": [
        0.33850127612,
        0.39203818112,
        0.32527162212,
        0.32637162912,
        0.35586168912,
        0.32914929212,
        0.33970213412,
        0.35336564712,
        0.32420956812,
        0.31840709412
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.016 ± 0.047 1.975 2.115 5.69 ± 0.35
pacquet@main 2.081 ± 0.087 1.983 2.237 5.88 ± 0.42
pnpr@HEAD 0.354 ± 0.020 0.317 0.391 1.00
pnpr@main 0.355 ± 0.027 0.317 0.402 1.00 ± 0.10
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.0162603389399996,
      "stddev": 0.04732239902991484,
      "median": 1.9994925988399999,
      "user": 1.1366269199999999,
      "system": 0.8429553999999999,
      "min": 1.9752281493400001,
      "max": 2.1154765943399996,
      "times": [
        1.9752281493400001,
        2.0026447843399997,
        1.98435719234,
        1.9902758963400002,
        2.00748383934,
        2.1154765943399996,
        2.0290547013399998,
        1.97755894934,
        2.0841828693399997,
        1.9963404133400002
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.0806199257399998,
      "stddev": 0.0868367930678795,
      "median": 2.06340325634,
      "user": 1.23377932,
      "system": 0.8753270000000001,
      "min": 1.9828075173400002,
      "max": 2.2369968343399997,
      "times": [
        2.15291408634,
        2.2369968343399997,
        2.01887168734,
        1.9828075173400002,
        1.99877700334,
        2.0086081113399996,
        2.1021208403399996,
        2.02468567234,
        2.10682604434,
        2.17359146034
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.35412160554000005,
      "stddev": 0.020440697381983463,
      "median": 0.35228489334,
      "user": 0.24883851999999998,
      "system": 0.6247258,
      "min": 0.31714389734000004,
      "max": 0.39051646434000004,
      "times": [
        0.33373728734,
        0.36910525634,
        0.34730049534,
        0.37232585534,
        0.35326505334,
        0.34876676234000004,
        0.39051646434000004,
        0.35775025034,
        0.31714389734000004,
        0.35130473334
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.35476911344,
      "stddev": 0.026895740677420135,
      "median": 0.35028195784000005,
      "user": 0.24616802,
      "system": 0.6057962,
      "min": 0.31721324834000003,
      "max": 0.40220352734000003,
      "times": [
        0.36591724734000003,
        0.40220352734000003,
        0.34370667034,
        0.38772685834000004,
        0.32244025534000004,
        0.31721324834000003,
        0.34670367734,
        0.33973390134000003,
        0.35386023834,
        0.36818551034
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 407.2 ± 15.7 380.8 435.3 4.47 ± 0.21
pacquet@main 404.8 ± 24.9 374.6 434.3 4.44 ± 0.30
pnpr@HEAD 95.5 ± 3.2 90.1 102.1 1.05 ± 0.04
pnpr@main 91.1 ± 2.4 86.3 97.4 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.40720323664,
      "stddev": 0.015698580476121965,
      "median": 0.40377747454,
      "user": 0.39537136,
      "system": 0.06756474,
      "min": 0.38077178104000003,
      "max": 0.43526319504000005,
      "times": [
        0.42471002504000005,
        0.43526319504000005,
        0.39818861904,
        0.38077178104000003,
        0.40493716804,
        0.40261778104,
        0.41201545204,
        0.40112772804,
        0.39488588504000005,
        0.41751473204000006
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.40482412434,
      "stddev": 0.024876796606373347,
      "median": 0.40947304654000005,
      "user": 0.39312396,
      "system": 0.06568423999999999,
      "min": 0.37463381404,
      "max": 0.43434908004000006,
      "times": [
        0.38339493204,
        0.37782193204000003,
        0.42569839004000004,
        0.41222299304000004,
        0.43101157004,
        0.42757403204000005,
        0.43434908004000006,
        0.40672310004,
        0.37481140004,
        0.37463381404
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.09546538130666668,
      "stddev": 0.0032117602883343236,
      "median": 0.09580373704,
      "user": 0.022739393333333333,
      "system": 0.01357234,
      "min": 0.09006871104,
      "max": 0.10206880404,
      "times": [
        0.09344134804,
        0.10206880404,
        0.09757942904,
        0.09426748704,
        0.09094103704,
        0.09874497904,
        0.09975068804000001,
        0.09006871104,
        0.09631657504,
        0.09683668704000001,
        0.09706300504,
        0.09976541604,
        0.09307259104,
        0.09258667404,
        0.09146098904,
        0.09479816804,
        0.09170318604,
        0.09688697204,
        0.09797010604,
        0.09529089904,
        0.10053777304,
        0.09684394004,
        0.09527923604,
        0.09830351604,
        0.09676371904,
        0.09492358604000001,
        0.09651519104,
        0.09034034404,
        0.09196724504,
        0.09187313704
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.09107982932125,
      "stddev": 0.0023681746770887226,
      "median": 0.09094146404,
      "user": 0.02245394125,
      "system": 0.0111988775,
      "min": 0.08626933904,
      "max": 0.09738397004,
      "times": [
        0.08925917304,
        0.09314232304,
        0.09468616804,
        0.09391876804,
        0.09151374804,
        0.09314403704,
        0.09087281904,
        0.09002362604,
        0.09128756204,
        0.09154611004,
        0.09072317704,
        0.08795225504,
        0.09005058604,
        0.08786231604,
        0.09096536304,
        0.08803484104,
        0.09738397004,
        0.09117610104,
        0.09094852304,
        0.08842807404,
        0.09273198804,
        0.09076263104,
        0.09231309704,
        0.09093440504,
        0.08626933904,
        0.08876372804,
        0.09145016804,
        0.09619902304,
        0.08973750604,
        0.09021943504,
        0.09142693504,
        0.09082674204
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.624 ± 0.120 4.505 4.847 1.29 ± 0.04
pacquet@main 4.601 ± 0.165 4.443 4.894 1.28 ± 0.05
pnpr@HEAD 3.598 ± 0.080 3.515 3.774 1.00
pnpr@main 3.668 ± 0.134 3.520 3.904 1.02 ± 0.04
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.624253498460001,
      "stddev": 0.11956455975586583,
      "median": 4.5648907662600005,
      "user": 2.07678592,
      "system": 1.5472301800000001,
      "min": 4.504736542260001,
      "max": 4.847096184260001,
      "times": [
        4.55427331326,
        4.509967616260001,
        4.847096184260001,
        4.551731295260001,
        4.5755082192600005,
        4.54664933126,
        4.504736542260001,
        4.777750178260001,
        4.715362116260001,
        4.659460188260001
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 4.60123665316,
      "stddev": 0.1646230007792461,
      "median": 4.55188175626,
      "user": 1.88370602,
      "system": 1.4643230800000002,
      "min": 4.44323044426,
      "max": 4.89403037726,
      "times": [
        4.72673300126,
        4.83977747926,
        4.89403037726,
        4.569253944260001,
        4.606431024260001,
        4.471980594260001,
        4.474372730260001,
        4.534509568260001,
        4.452047368260001,
        4.44323044426
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.59751335236,
      "stddev": 0.08012584879547657,
      "median": 3.5719560907599996,
      "user": 1.51678592,
      "system": 1.47853638,
      "min": 3.51455254126,
      "max": 3.77420549226,
      "times": [
        3.61841857726,
        3.68636113926,
        3.52013173226,
        3.60935200226,
        3.56932507426,
        3.5745871072599997,
        3.5621648982600003,
        3.51455254126,
        3.54603495926,
        3.77420549226
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 3.6676649661599994,
      "stddev": 0.1336500640706346,
      "median": 3.6306002142600002,
      "user": 1.54282012,
      "system": 1.57444268,
      "min": 3.52037022226,
      "max": 3.9042259282600003,
      "times": [
        3.75565616626,
        3.9042259282600003,
        3.86018999226,
        3.56586159526,
        3.52037022226,
        3.68915360026,
        3.65638783326,
        3.54981410826,
        3.57017762026,
        3.60481259526
      ]
    }
  ]
}

@github-actions

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/13455
Testbedpacquet
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
milliseconds (ms)
(Result Δ%)
Upper Boundary
milliseconds (ms)
(Limit %)
isolated-linker.fresh-install.cold-cache.cold-store📈 view plot
🚷 view threshold
2,906.18 ms
(+3.55%)Baseline: 2,806.58 ms
3,367.90 ms
(86.29%)
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
🚷 view threshold
1,975.23 ms
(+0.14%)Baseline: 1,972.51 ms
2,367.02 ms
(83.45%)
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
🚷 view threshold
646.67 ms
(+0.57%)Baseline: 642.99 ms
771.58 ms
(83.81%)
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
🚷 view threshold
380.77 ms
(-4.05%)Baseline: 396.82 ms
476.19 ms
(79.96%)
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
🚷 view threshold
2,369.34 ms
(-1.90%)Baseline: 2,415.35 ms
2,898.42 ms
(81.75%)
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
🚷 view threshold
4,504.74 ms
(+0.05%)Baseline: 4,502.53 ms
5,403.04 ms
(83.37%)
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
🚷 view threshold
263.72 ms
(-4.86%)Baseline: 277.21 ms
332.65 ms
(79.28%)
🐰 View full continuous benchmarking report in Bencher

@github-actions

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/13455
Testbedpnpr

⚠️ 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-thresholds flag.

Click to view all benchmark results
BenchmarkLatencymilliseconds (ms)
isolated-linker.fresh-install.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
1,485.87 ms
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
317.14 ms
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
346.78 ms
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
⚠️ NO THRESHOLD
90.07 ms
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
1,398.41 ms
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
⚠️ NO THRESHOLD
3,514.55 ms
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
301.27 ms
🐰 View full continuous benchmarking report in Bencher

@zkochan
zkochan merged commit 43e6a4a into main Jul 28, 2026
37 checks passed
@zkochan
zkochan deleted the fix-13449 branch July 28, 2026 00:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product: pacquet reviewed: coderabbit CodeRabbit submitted an approving review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pacquet: align .modules.yaml output with the TypeScript CLI on n8n

3 participants