Skip to content

fix(pacquet): keep workspace-internal links out of the excludeLinksFromLockfile remap - #13563

Merged
zkochan merged 5 commits into
mainfrom
fix-13556
Aug 1, 2026
Merged

zkochan merged 5 commits into
mainfrom
fix-13556

Conversation

@zkochan

@zkochan zkochan commented Aug 1, 2026 •

Copy link
Copy Markdown
Member

Summary

With excludeLinksFromLockfile enabled, pacquet remapped workspace-internal link: dependencies, even though the setting exists only to keep the machine-dependent path of an external link out of the lockfile. Closes #13556.

remap_link_node_id compared lockfile_dir with the link's directory verbatim, but a workspace link records that directory relative to the importer that declares it (resolve_from_workspace.rs), and pacquet_fs::is_subdir is purely lexical. is_subdir("/ws", "../lib") is false, so the guard never fired and the internal link was remapped to link:<modules_dir>/<alias>.

The user-visible effect is confirmed end-to-end (new pnpm/crates/cli/tests/exclude_links_from_lockfile.rs): an internal link resolving a peer dependency was written as

'@pnpm.e2e/[email protected](@pnpm.e2e/peer-a@[email protected]+peer-a)(...)':
  dependencies:
    '@pnpm.e2e/peer-a': link:node_modules/@pnpm.e2e/peer-a

instead of (@pnpm.e2e/peer-a@packages+peer-a) / link:packages/peer-a. The remapped ref is relative to the lockfile root while the symlink lives under the importer, so the recorded target does not exist.

Parity. The TypeScript CLI has the same remap (installing/deps-resolver/src/index.ts), and it is correct there because its directory resolutions for links are absolute (resolveFromLocalPackage keeps localPackageDir; the local resolver resolves the target). So this is a pacquet-only fix, and I added the matching TS test so the shared expectation is pinned on both sides.

Second bug from the same check. Injected (file:) workspace deps were remapped too — their directory is relative to the lockfile dir, so the containment check missed them as well. Upstream only remaps linked dependencies (isLocal, i.e. a non-file: directory resolution), so the remap is now gated on a link: id.

Squash Commit Body

`remap_link_node_id` compared `lockfile_dir` against the link's
`directory` verbatim, but a workspace link records that directory
relative to the importer that declares it, so the lexical containment
check never matched and every internal link was remapped to
`link:<modules_dir>/<alias>` — feeding peer resolution a node id that
should only stand in for links living outside the workspace. The
lockfile then recorded the peer as `link:node_modules/<alias>`, a path
relative to the lockfile root rather than to the importer that holds
the symlink.

Resolve the target against `project_dir` before the containment check,
and thread each importer's root into `ResolvePeersOptions::project_dir`
in the multi-importer walk (it already threads `modules_dir`).

The same check also caught injected (`file:`) workspace dependencies,
whose directory is relative to the lockfile dir. Upstream only remaps
linked dependencies (`isLocal`, i.e. a non-`file:` directory
resolution), so gate the remap on a `link:` id.

The TypeScript CLI is unaffected — its directory resolutions for links
are absolute — so it only gains the mirror test.

Closes pnpm/pnpm#13556

Checklist

  • I checked the referenced issue and verified that none of the PRs
    already linked to it solves it.
  • 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.

Written by an agent (Claude Code, claude-opus-5[1m]).


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

    • Fixed lockfile handling so workspace-internal link: dependencies retain their original paths and peer suffixes when link entries are excluded.
    • Preserved injected workspace file: dependencies instead of remapping them.
    • Continued remapping external links appropriately relative to the importing project.
    • Ensured lockfiles remain consistent regardless of whether link exclusion is enabled.
  • Tests

    • Added regression and end-to-end coverage for workspace links, peer dependencies, and injected file dependencies.

zkochan and others added 2 commits August 1, 2026 17:19
…inksFromLockfile remap

`remap_link_node_id` compared `lockfile_dir` against the link's
`directory` verbatim, but a workspace link records that directory
relative to the importer that declares it, so the lexical containment
check never matched and every internal link was remapped to
`link:<modules_dir>/<alias>` — feeding peer resolution a node id that
should only stand in for links living outside the workspace. The
lockfile then recorded the peer as `link:node_modules/<alias>`, a path
relative to the lockfile root rather than to the importer that holds
the symlink.

Resolve the target against `project_dir` before the containment check,
and thread each importer's root into `ResolvePeersOptions::project_dir`
in the multi-importer walk (it already threads `modules_dir`).

The same check also caught injected (`file:`) workspace dependencies,
whose directory is relative to the lockfile dir. Upstream only remaps
linked dependencies (`isLocal`, i.e. a non-`file:` directory
resolution), so gate the remap on a `link:` id.

Closes #13556

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
The TypeScript CLI already keeps a workspace-internal `link:` out of the
`excludeLinksFromLockfile` remap — its directory resolutions are
absolute, so the containment check compares like with like — but nothing
pinned that, and the counterpart pacquet check was comparing an
importer-relative path with the lockfile root. This is the mirror of the
Rust regression test that ships with that fix.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings August 1, 2026 15:31
@coderabbitai

coderabbitai Bot commented Aug 1, 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: 6d56a6d7-52a4-496d-9b0b-90a054c594fc

📥 Commits

Reviewing files that changed from the base of the PR and between 400bc93 and 979284d.

📒 Files selected for processing (1)
  • pnpm/crates/cli/tests/exclude_links_from_lockfile.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • pnpm/crates/cli/tests/exclude_links_from_lockfile.rs

📝 Walkthrough

Walkthrough

The resolver preserves workspace-internal link: and injected file: dependency identities when excludeLinksFromLockfile is enabled. Importer-relative targets are resolved against each importer directory. Resolver and end-to-end tests cover the behavior.

Changes

Workspace link resolution

Layer / File(s) Summary
Resolver remapping and importer paths
pnpm/crates/resolving-deps-resolver/src/resolve_peers.rs, pnpm/crates/resolving-deps-resolver/src/resolve_peers/context.rs
remap_link_node_id handles only link: resolutions and resolves relative targets against project_dir. Workspace peer resolution sets importer-specific project and modules directories.
Resolver regression coverage
pnpm/crates/resolving-deps-resolver/src/resolve_peers/context/tests.rs, pnpm/crates/resolving-deps-resolver/src/resolve_peers/tests.rs
Tests cover internal links, external links, injected workspace file dependencies, and peer suffix rendering.
Integration validation and release note
pnpm/crates/cli/tests/exclude_links_from_lockfile.rs, pnpm11/installing/deps-installer/test/install/excludeLinksFromLockfile.ts, .changeset/exclude-links-keeps-workspace-internal-links.md
End-to-end tests verify stable lockfile link paths and snapshots. A patch changeset documents the correction.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Assessment against linked issues

Objective Addressed Explanation
Prevent remapping of workspace-internal relative link: dependencies when excludeLinksFromLockfile is enabled [#13556] ✅
Resolve relative link targets against project_dir before the lockfile containment check [#13556] ✅
Preserve external link remapping and exclude injected file: dependencies from link remapping [#13556] ✅

Sequence Diagram(s)

sequenceDiagram
  participant WorkspacePeerResolver
  participant remap_link_node_id
  participant Lockfile
  WorkspacePeerResolver->>remap_link_node_id: Set importer project_dir and modules_dir
  remap_link_node_id->>remap_link_node_id: Resolve link target against project_dir
  remap_link_node_id->>Lockfile: Preserve internal link or remap external link
  Lockfile-->>WorkspacePeerResolver: Return peer graph identity
Loading

Possibly related PRs

  • pnpm/pnpm#13551: Modifies the same remap_link_node_id and importer-relative link handling.
  • pnpm/pnpm#13561: Extends the related remapping fix to preserve workspace-internal link: and injected file: dependencies.
  • pnpm/pnpm#13545: Modifies importer-specific peer-resolution and link-remapping logic.

Suggested labels: product: pacquet, product: pnpm@11

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-13556

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.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Fix excludeLinksFromLockfile remap for workspace-internal link: deps

🐞 Bug fix 🧪 Tests 📝 Documentation 🕐 40+ Minutes

Grey Divider

AI Description

• Prevent excludeLinksFromLockfile from remapping workspace-internal link: dependencies.
• Resolve link targets against each importer root before workspace containment checks.
• Add Rust + TS regression tests covering peer-resolution snapshot stability.
Diagram

graph TD
A["Importer walk"] --> B["Set opts.project_dir + modules_dir"] --> C["resolve_node / peer resolution"] --> D{excludeLinksFromLockfile?} --> E["remap_link_node_id"] --> F["Resolve directory vs project_dir"] --> G{Under lockfile_dir?} --> H["No remap (workspace/internal)"]
G --> I["Remap to modules_dir/alias (external)"]
J["Rust + TS tests"] --> C
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Canonicalize paths before containment check
  • ➕ More robust against .. segments and symlink indirections
  • ➕ Less dependent on how inputs are recorded (relative vs absolute)
  • ➖ Requires filesystem access; can be slow and flaky in tests/sandboxes
  • ➖ Symlink resolution may change semantics vs lockfile’s intended lexical stability
2. Store absolute link targets for workspace links earlier in resolution
  • ➕ Avoids per-call joining logic; consistent directory representation
  • ➕ Could simplify future checks/normalization
  • ➖ Broader behavioral change and potential lockfile churn
  • ➖ Pushes importer-specific absolutes deeper into the graph unless carefully contained
3. Gate remap using resolution kind (link vs file) only (no path logic)
  • ➕ Simple rule aligns with upstream intent: only link: is remapped
  • ➕ Avoids accidental remaps of injected (file:) workspace deps
  • ➖ Still needs correct internal-vs-external discrimination for link: targets
  • ➖ Doesn’t address the relative-directory containment bug alone

Recommendation: Current approach is the best tradeoff: it preserves the existing lexical is_subdir semantics (no filesystem canonicalization), fixes the core bug by resolving importer-relative directories against the importer root, and matches upstream behavior by explicitly gating remaps to link: (avoiding injected file: remaps). The added unit + E2E tests in both Rust and TS make the contract hard to regress.

Files changed (7) +310 / -13

Bug fix (2) +33 / -9
resolve_peers.rsThread importer root into peer-resolution options +15/-5

Thread importer root into peer-resolution options

• Extends the multi-importer walk to set 'ResolvePeersOptions::project_dir' per importer, alongside 'modules_dir'. Ensures link target resolution and remap behavior is scoped to the importer that declares the dependency.

pnpm/crates/resolving-deps-resolver/src/resolve_peers.rs

context.rsFix link remap containment check for relative workspace targets +18/-4

Fix link remap containment check for relative workspace targets

• Updates 'remap_link_node_id' to only consider remapping for 'link:' node ids (excluding injected 'file:' deps). Resolves the recorded directory against 'project_dir' before checking containment under 'lockfile_dir', preventing remaps of workspace-internal links.

pnpm/crates/resolving-deps-resolver/src/resolve_peers/context.rs

Tests (4) +272 / -4
exclude_links_from_lockfile.rsAdd Rust E2E test for internal link peer stability +100/-0

Add Rust E2E test for internal link peer stability

• Introduces an end-to-end workspace scenario to verify that enabling 'excludeLinksFromLockfile' does not change peer suffixes or lockfile snapshot keys for workspace-internal links. Asserts that only the setting value differs between the two generated lockfiles.

pnpm/crates/cli/tests/exclude_links_from_lockfile.rs

tests.rsAdd unit tests for internal/external link remap logic +54/-4

Add unit tests for internal/external link remap logic

• Adds focused tests validating that internal workspace links are not remapped, external links are remapped to the importer’s 'node_modules', and injected ('file:') workspace deps are not remapped. Introduces a helper 'exclude_links_opts()' to exercise the remap behavior with realistic dirs.

pnpm/crates/resolving-deps-resolver/src/resolve_peers/context/tests.rs

tests.rsAdd workspace peer-resolution regression for internal links +67/-0

Add workspace peer-resolution regression for internal links

• Adds a multi-importer test ensuring 'excludeLinksFromLockfile' keeps the node id for a workspace-internal peer provider link. Verifies the resulting dep-path peer suffix and graph edge remain 'link:packages/peer' rather than being rewritten to an importer-local node_modules path.

pnpm/crates/resolving-deps-resolver/src/resolve_peers/tests.rs

excludeLinksFromLockfile.tsPin TypeScript behavior for internal link peer case +51/-0

Pin TypeScript behavior for internal link peer case

• Adds a TS integration test asserting that when an internal workspace link resolves a peer dependency, the lockfile snapshot key is produced and the dependency remains a workspace-relative 'link:' reference (not rewritten to 'link:node_modules/...'). This aligns the shared contract between the TS CLI and pacquet.

pnpm11/installing/deps-installer/test/install/excludeLinksFromLockfile.ts

Documentation (1) +5 / -0
exclude-links-keeps-workspace-internal-links.mdAdd changeset for internal link remap fix +5/-0

Add changeset for internal link remap fix

• Documents the behavioral fix for 'excludeLinksFromLockfile' with workspace-internal 'link:' deps and injected 'file:' workspace deps. References the upstream issue for traceability.

.changeset/exclude-links-keeps-workspace-internal-links.md

@greptile-apps

greptile-apps Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Reviews (4): Last reviewed commit: "test(pacquet): compare the two lockfiles..." | Re-trigger Greptile

Copilot AI previously approved these changes Aug 1, 2026

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.

🟢 Ready to approve

The fix is narrowly scoped, aligns with the stated root cause, and is covered by new unit and end-to-end regression tests plus an appropriate changeset for pacquet.

This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.

Pull request overview

Fixes pacquet’s excludeLinksFromLockfile behavior so workspace-internal link: deps (and injected file: workspace deps) are not incorrectly remapped during peer resolution, preventing invalid lockfile link: targets. The PR also adds regression tests on both the Rust (pacquet) and TypeScript sides to pin the shared expectation.

Changes:

  • Update pacquet’s link-node-id remap logic to (a) only apply to link: ids and (b) resolve importer-relative link targets against the current importer root before workspace-containment checks.
  • Thread each importer’s root_dir into ResolvePeersOptions::project_dir during the multi-importer peer-resolution walk.
  • Add targeted unit + e2e tests (Rust) and a mirrored TS test to prevent regressions; include a patch changeset for pacquet.
File summaries
File Description
pnpm11/installing/deps-installer/test/install/excludeLinksFromLockfile.ts Adds a TS regression test asserting workspace-internal link: deps keep stable lockfile refs under excludeLinksFromLockfile.
pnpm/crates/resolving-deps-resolver/src/resolve_peers/tests.rs Adds a Rust regression test ensuring internal workspace links aren’t remapped during peer resolution in multi-importer mode.
pnpm/crates/resolving-deps-resolver/src/resolve_peers/context/tests.rs Adds focused unit tests for internal vs external link remapping and ensures injected (file:) workspace deps aren’t remapped.
pnpm/crates/resolving-deps-resolver/src/resolve_peers/context.rs Fixes remap_link_node_id to gate on link: ids and resolve importer-relative directories via project_dir before containment checks.
pnpm/crates/resolving-deps-resolver/src/resolve_peers.rs Threads per-importer root_dir into ResolvePeersOptions::project_dir during workspace peer resolution.
pnpm/crates/cli/tests/exclude_links_from_lockfile.rs Adds an end-to-end pacquet test asserting lockfile output is identical (modulo the setting line) for internal links with/without excludeLinksFromLockfile.
.changeset/exclude-links-keeps-workspace-internal-links.md Adds a pacquet patch changeset describing the user-visible fix.
Review details
  • Files reviewed: 7/7 changed files
  • Comments generated: 0
  • Review effort level: Lite

We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.

@qodo-code-review

qodo-code-review Bot commented Aug 1, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

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

Context used
✅ Compliance rules (platform): 24 rules

Grey Divider


Remediation recommended

1. Brittle lockfile string compare ✓ Resolved 🐞 Bug ☼ Reliability ⭐ New
Description
The test normalizes the lockfile by raw string replacement and then asserts full-string equality,
which couples the test to YAML formatting/key ordering and may fail after unrelated serialization
changes. A structured comparison (parse YAML, adjust the one setting field, then compare) would test
the intended invariant without depending on byte-for-byte output stability.
Code

pnpm/crates/cli/tests/exclude_links_from_lockfile.rs[R38-45]

+    let with_setting_normalized =
+        with_setting.replace("excludeLinksFromLockfile: true", "excludeLinksFromLockfile: false");
+    eprintln!("WITH SETTING:\n{with_setting_normalized}\n");
+    eprintln!("WITHOUT SETTING:\n{without_setting}\n");
+    assert_eq!(
+        with_setting_normalized, without_setting,
+        "only the recorded setting itself may differ",
+    );
Relevance

●●● Strong

Team previously accepted replacing brittle lockfile string ops with structured YAML/lockfile parsing
in CLI tests.

PR-#13152
PR-#13372

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new test asserts full lockfile equality after a single string replacement, making it dependent
on exact serialized output. Nearby CLI tests demonstrate the established approach of parsing
lockfile YAML into a typed structure for comparisons.

pnpm/crates/cli/tests/exclude_links_from_lockfile.rs[38-45]
pnpm/crates/cli/tests/current_lockfile.rs[148-157]

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 test currently does a textual `.replace(...)` and then `assert_eq!` on the entire lockfile string. This is sensitive to unrelated YAML serialization differences (formatting, ordering, quoting), creating spurious failures.

### Issue Context
Other CLI tests already parse `pnpm-lock.yaml` using `serde_saphyr::from_str` before comparing lockfiles structurally.

### Fix Focus Areas
- pnpm/crates/cli/tests/exclude_links_from_lockfile.rs[38-45]

### Suggested fix
Parse both lockfiles as structured data and compare after normalizing only `settings.excludeLinksFromLockfile`.

One low-coupling approach is to deserialize into a generic value, mutate the field, and compare:

```rust
let mut with_val: serde_json::Value = serde_saphyr::from_str(&with_setting).unwrap();
let mut without_val: serde_json::Value = serde_saphyr::from_str(&without_setting).unwrap();
with_val["settings"]["excludeLinksFromLockfile"] = serde_json::Value::Bool(false);
// Ensure the other side is explicitly false as well (or remove the field on both).
without_val["settings"]["excludeLinksFromLockfile"] = serde_json::Value::Bool(false);
assert_eq!(with_val, without_val, "only the recorded setting itself may differ");
```

Or deserialize into the lockfile struct type used elsewhere in the CLI tests and compare that.

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


2. Workspace YAML key duplication ✓ Resolved 🐞 Bug ☼ Reliability
Description
The new E2E test unconditionally appends packages: and excludeLinksFromLockfile: to the existing
harness pnpm-workspace.yaml, which can create duplicate/conflicting top-level keys as the harness
evolves and lead to ambiguous configuration or failing YAML parses. The repo already has a helper
meant to make such edits newline-safe and guarded against duplicate keys, but it is not used here.
Code

pnpm/crates/cli/tests/exclude_links_from_lockfile.rs[R56-65]

+    let workspace_yaml_path = workspace.join("pnpm-workspace.yaml");
+    let mut workspace_yaml =
+        fs::read_to_string(&workspace_yaml_path).expect("read pnpm-workspace.yaml");
+    if !workspace_yaml.ends_with('\n') {
+        workspace_yaml.push('\n');
+    }
+    workspace_yaml.push_str("packages:\n  - 'packages/*'\n");
+    writeln!(workspace_yaml, "excludeLinksFromLockfile: {exclude_links_from_lockfile}")
+        .expect("append the setting to pnpm-workspace.yaml");
+    fs::write(&workspace_yaml_path, workspace_yaml).expect("write pnpm-workspace.yaml");
Relevance

●●● Strong

Team has accepted switching tests to workspace-yaml helper/guards to avoid duplicate keys and
brittle YAML edits (e.g., #13511).

PR-#13511
PR-#13386
PR-#13407

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The test mutates pnpm-workspace.yaml via unconditional string appends, while the test harness
already provides a dedicated helper that asserts a key is not already present before appending
(preventing duplicate/conflicting top-level keys).

pnpm/crates/cli/tests/exclude_links_from_lockfile.rs[56-65]
pnpm/crates/cli/tests/_utils/mod.rs[79-96]

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

### Issue description
`pnpm/crates/cli/tests/exclude_links_from_lockfile.rs` appends new top-level YAML keys to `pnpm-workspace.yaml` via raw string concatenation. This is brittle: if the harness template ever starts including `packages:` or `excludeLinksFromLockfile:` (or if another helper adds them earlier), the test will generate duplicate/conflicting keys and may fail parsing or silently override settings.

### Issue Context
The test suite already contains `append_workspace_yaml_key()` which (a) ensures trailing-newline safety, and (b) asserts the key does not already exist to prevent duplicate-key brittleness.

### Fix Focus Areas
- pnpm/crates/cli/tests/exclude_links_from_lockfile.rs[56-65]
- pnpm/crates/cli/tests/_utils/mod.rs[79-96]

### Suggested fix
- Replace the manual `read_to_string` + `push_str` + `writeln!` YAML edits with the existing helper(s):
 - Use `append_workspace_yaml_key(&workspace, "excludeLinksFromLockfile", exclude_links_from_lockfile)`.
 - For `packages`, either:
   - use `append_workspace_yaml_key(&workspace, "packages", "['packages/*']")`, or
   - add a small guarded helper that appends a `packages:` block only if missing (mirroring the duplicate-key assert pattern in `append_workspace_yaml_key`).
- Keep the newline-safety behavior (the helper already handles this).

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



Informational

3. Noisy stderr in passing test 🐞 Bug ➹ Performance ⭐ New
Description
The test unconditionally prints both lockfiles to stderr, even when the assertions pass, which adds
avoidable I/O overhead and bloats CI logs. If a lockfile ever contains path-like data in this
scenario (or future extensions), it will also be unnecessarily exposed in logs.
Code

pnpm/crates/cli/tests/exclude_links_from_lockfile.rs[R40-41]

+    eprintln!("WITH SETTING:\n{with_setting_normalized}\n");
+    eprintln!("WITHOUT SETTING:\n{without_setting}\n");
Relevance

●●● Strong

Repo has removed unconditional debug/stderr prints from passing tests to reduce CI noise.

PR-#13293
PR-#13382

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The two eprintln! calls execute unconditionally before the final assert_eq!, so they run on
every successful test execution.

pnpm/crates/cli/tests/exclude_links_from_lockfile.rs[38-45]

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 test prints full lockfile contents unconditionally via `eprintln!`, causing noisy CI logs and extra I/O on the hot path of running tests.

### Issue Context
These prints are primarily useful for debugging failures.

### Fix Focus Areas
- pnpm/crates/cli/tests/exclude_links_from_lockfile.rs[38-45]

### Suggested fix
Wrap the `eprintln!` calls in a conditional so they only execute when the final equality check would fail, e.g.:

```rust
if with_setting_normalized != without_setting {
   eprintln!("WITH SETTING:\n{with_setting_normalized}\n");
   eprintln!("WITHOUT SETTING:\n{without_setting}\n");
}
assert_eq!(with_setting_normalized, without_setting, "only the recorded setting itself may differ");
```

Alternatively, remove the prints and rely on assertion messages/diffs.

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


4. Changeset missing pnpm bump 📘 Rule violation § Compliance
Description
The new changeset only bumps pacquet and does not include a pnpm entry. This violates the
requirement that changesets explicitly declare a pnpm bump type (patch/minor/major).
Code

.changeset/exclude-links-keeps-workspace-internal-links.md[R1-3]

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

● Weak

Same “add pnpm entry to changeset” suggestion repeatedly rejected in many merged PRs (e.g., #13502,
#13491).

PR-#13502
PR-#13491
PR-#13350

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 713436 requires changesets to include an explicit pnpm entry with a valid bump
type. The added changeset front-matter lists only pacquet: patch, omitting pnpm.

Rule 713436: Explicitly declare pnpm package and correct bump type in changesets
.changeset/exclude-links-keeps-workspace-internal-links.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 does not include a `pnpm` entry.

## Issue Context
Per the compliance rule, changesets must explicitly declare the `pnpm` package and a valid bump type (`patch`/`minor`/`major`).

## Fix Focus Areas
- .changeset/exclude-links-keeps-workspace-internal-links.md[1-3]

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


Grey Divider

To customize comments, go to the Qodo configuration screen, or learn more in the docs.

Previous review results

Review updated until commit 979284d

Results up to commit 40cccf4 ⚖️ Balanced


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


Remediation recommended
1. Workspace YAML key duplication ✓ Resolved 🐞 Bug ☼ Reliability
Description
The new E2E test unconditionally appends packages: and excludeLinksFromLockfile: to the existing
harness pnpm-workspace.yaml, which can create duplicate/conflicting top-level keys as the harness
evolves and lead to ambiguous configuration or failing YAML parses. The repo already has a helper
meant to make such edits newline-safe and guarded against duplicate keys, but it is not used here.
Code

pnpm/crates/cli/tests/exclude_links_from_lockfile.rs[R56-65]

+    let workspace_yaml_path = workspace.join("pnpm-workspace.yaml");
+    let mut workspace_yaml =
+        fs::read_to_string(&workspace_yaml_path).expect("read pnpm-workspace.yaml");
+    if !workspace_yaml.ends_with('\n') {
+        workspace_yaml.push('\n');
+    }
+    workspace_yaml.push_str("packages:\n  - 'packages/*'\n");
+    writeln!(workspace_yaml, "excludeLinksFromLockfile: {exclude_links_from_lockfile}")
+        .expect("append the setting to pnpm-workspace.yaml");
+    fs::write(&workspace_yaml_path, workspace_yaml).expect("write pnpm-workspace.yaml");
Relevance

●●● Strong

Team has accepted switching tests to workspace-yaml helper/guards to avoid duplicate keys and
brittle YAML edits (e.g., #13511).

PR-#13511
PR-#13386
PR-#13407

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The test mutates pnpm-workspace.yaml via unconditional string appends, while the test harness
already provides a dedicated helper that asserts a key is not already present before appending
(preventing duplicate/conflicting top-level keys).

pnpm/crates/cli/tests/exclude_links_from_lockfile.rs[56-65]
pnpm/crates/cli/tests/_utils/mod.rs[79-96]

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

### Issue description
`pnpm/crates/cli/tests/exclude_links_from_lockfile.rs` appends new top-level YAML keys to `pnpm-workspace.yaml` via raw string concatenation. This is brittle: if the harness template ever starts including `packages:` or `excludeLinksFromLockfile:` (or if another helper adds them earlier), the test will generate duplicate/conflicting keys and may fail parsing or silently override settings.

### Issue Context
The test suite already contains `append_workspace_yaml_key()` which (a) ensures trailing-newline safety, and (b) asserts the key does not already exist to prevent duplicate-key brittleness.

### Fix Focus Areas
- pnpm/crates/cli/tests/exclude_links_from_lockfile.rs[56-65]
- pnpm/crates/cli/tests/_utils/mod.rs[79-96]

### Suggested fix
- Replace the manual `read_to_string` + `push_str` + `writeln!` YAML edits with the existing helper(s):
 - Use `append_workspace_yaml_key(&workspace, "excludeLinksFromLockfile", exclude_links_from_lockfile)`.
 - For `packages`, either:
   - use `append_workspace_yaml_key(&workspace, "packages", "['packages/*']")`, or
   - add a small guarded helper that appends a `packages:` block only if missing (mirroring the duplicate-key assert pattern in `append_workspace_yaml_key`).
- Keep the newline-safety behavior (the helper already handles this).

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



Informational
2. Changeset missing pnpm bump 📘 Rule violation § Compliance
Description
The new changeset only bumps pacquet and does not include a pnpm entry. This violates the
requirement that changesets explicitly declare a pnpm bump type (patch/minor/major).
Code

.changeset/exclude-links-keeps-workspace-internal-links.md[R1-3]

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

● Weak

Same “add pnpm entry to changeset” suggestion repeatedly rejected in many merged PRs (e.g., #13502,
#13491).

PR-#13502
PR-#13491
PR-#13350

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 713436 requires changesets to include an explicit pnpm entry with a valid bump
type. The added changeset front-matter lists only pacquet: patch, omitting pnpm.

Rule 713436: Explicitly declare pnpm package and correct bump type in changesets
.changeset/exclude-links-keeps-workspace-internal-links.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 does not include a `pnpm` entry.

## Issue Context
Per the compliance rule, changesets must explicitly declare the `pnpm` package and a valid bump type (`patch`/`minor`/`major`).

## Fix Focus Areas
- .changeset/exclude-links-keeps-workspace-internal-links.md[1-3]

ⓘ 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.

@github-actions

github-actions Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

Micro-Benchmark Results

Linux

group                                            main                                   pr
-----                                            ----                                   --
lockfile/parse_pnpm_lock                         1.01     11.4±0.02ms    32.8 MB/sec    1.00     11.3±0.02ms    33.1 MB/sec
packument/parse                                  1.00     38.7±0.09µs  1713.6 MB/sec    1.00     38.9±0.09µs  1706.1 MB/sec
tarball/download_dependency                      1.08      2.3±0.07ms  1875.2 KB/sec    1.00      2.1±0.03ms  2019.0 KB/sec
tarball_batch/cold_store_many_medium_tarballs    1.00    173.4±2.70ms 92.3 KElem/sec    1.00    172.9±2.24ms 92.6 KElem/sec

`append_workspace_yaml_key` asserts the key is absent before appending,
so the test fails loudly if the harness template ever grows a `packages:`
or `excludeLinksFromLockfile:` key of its own instead of silently writing
a duplicate top-level mapping key.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings August 1, 2026 15:37
@zkochan

zkochan commented Aug 1, 2026

Copy link
Copy Markdown
Member Author

Thanks — responses to the two Qodo findings:

1. Workspace YAML key duplication — fixed in 4f285e4. The e2e test now uses append_workspace_yaml_key for both packages and excludeLinksFromLockfile, so the duplicate-key guard fires if the harness template ever writes either key itself.

2. Changeset missing pnpm bump — not applicable here. This PR's implementation is Rust-only; in changesets pnpm names the TypeScript CLI package, and AGENTS.md states a Rust-only changeset must target pacquet and omit "pnpm". The TypeScript side of this PR is a test only, so it needs no bump at all. (Qodo itself rates this one ● Weak and notes the same suggestion has been rejected on #13502 and #13491.)


Written by an agent (Claude Code, claude-opus-5[1m]).

@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.

🧹 Nitpick comments (1)
pnpm/crates/cli/tests/exclude_links_from_lockfile.rs (1)

35-39: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Log both lockfiles before comparing them with assert_eq!.

with_setting.replace(...) and without_setting are full pnpm-lock.yaml contents, which can span many lines. On failure, assert_eq! output for two long multi-line strings is hard to read.

Add an eprintln! of both rendered values before the assert_eq!, matching the established convention for multi-line string assertions in this codebase.

🔧 Proposed fix
+    let with_setting_normalized =
+        with_setting.replace("excludeLinksFromLockfile: true", "excludeLinksFromLockfile: false");
+    eprintln!("WITH_SETTING (normalized):\n{with_setting_normalized}\n");
+    eprintln!("WITHOUT_SETTING:\n{without_setting}\n");
     assert_eq!(
-        with_setting.replace("excludeLinksFromLockfile: true", "excludeLinksFromLockfile: false"),
+        with_setting_normalized,
         without_setting,
         "only the recorded setting itself may differ",
     );

Based on learnings, when a test uses assert_eq! to compare string values that could span many lines, log the rendered values before the assertion using eprintln! so reviewers can see the full multi-line difference in the test output.

🤖 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/cli/tests/exclude_links_from_lockfile.rs` around lines 35 - 39,
In the test comparing the normalized lockfile contents, add eprintln! statements
immediately before the assert_eq! to print both with_setting.replace(...) and
without_setting. Preserve the existing assertion and message while logging each
full multi-line rendered value for easier failure diagnosis.

Source: Learnings

🤖 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/cli/tests/exclude_links_from_lockfile.rs`:
- Around line 35-39: In the test comparing the normalized lockfile contents, add
eprintln! statements immediately before the assert_eq! to print both
with_setting.replace(...) and without_setting. Preserve the existing assertion
and message while logging each full multi-line rendered value for easier failure
diagnosis.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: a37a0f6b-f3fe-40e4-b17e-93a77e400d76

📥 Commits

Reviewing files that changed from the base of the PR and between fa8d383 and 40cccf4.

📒 Files selected for processing (7)
  • .changeset/exclude-links-keeps-workspace-internal-links.md
  • pnpm/crates/cli/tests/exclude_links_from_lockfile.rs
  • pnpm/crates/resolving-deps-resolver/src/resolve_peers.rs
  • pnpm/crates/resolving-deps-resolver/src/resolve_peers/context.rs
  • pnpm/crates/resolving-deps-resolver/src/resolve_peers/context/tests.rs
  • pnpm/crates/resolving-deps-resolver/src/resolve_peers/tests.rs
  • pnpm11/installing/deps-installer/test/install/excludeLinksFromLockfile.ts

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 4f285e4

@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.

CODE_STYLE_GUIDE requires multi-line strings compared with `assert_eq!`
to be logged with `eprintln!` first — a raw diff of two whole
`pnpm-lock.yaml` files is unreadable in the failure output.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

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.

🟡 Not ready to approve

The new “external link” unit test currently uses a relative path that still normalizes under lockfile_dir, so it does not actually validate the intended external-link remap behavior and should be corrected.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.

Review details

Suppressed comments (1)

pnpm/crates/resolving-deps-resolver/src/resolve_peers/context/tests.rs:102

  • The “external link” test case uses a relative directory of ../../../outside/lib, which (from project_dir = /ws/packages/app and lockfile_dir = /ws) still normalizes under /ws and is therefore workspace-internal. This makes the test assert a remap for a path that is not actually outside lockfile_dir.
    for directory in ["../../../outside/lib", "/outside/lib"] {
        let dep = linked_package("lib", "link:../../../outside/lib", directory);
  • Files reviewed: 7/7 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.

Copilot AI review requested due to automatic review settings August 1, 2026 15:42
@zkochan

zkochan commented Aug 1, 2026

Copy link
Copy Markdown
Member Author

@copilot-pull-request-reviewer the "external link" case is correct — ../../../outside/lib does not normalize under /ws.

From project_dir = /ws/packages/app, three .. hops land on /, not on /ws:

/ws/packages/app -> /ws/packages -> /ws -> /

so the joined target normalizes to /outside/lib. Verified against the real helper:

normalized="/outside/lib"
is_subdir("/ws", …) = false

The test is also self-checking on this point: it asserts the target is remapped (Some(link:packages/app/node_modules/lib)). If the path resolved inside /ws as the review suggests, the fixed remap_link_node_id would return None and the test would fail. It passes, and its sibling workspace_internal_link_is_not_remapped covers the genuinely-internal ../lib case (/ws/packages/lib).

No change made.


Written by an agent (Claude Code, claude-opus-5[1m]).

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 400bc93

@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.

Parse both `pnpm-lock.yaml` files into `Lockfile` and assert on the
snapshot key and the peer's `SnapshotDepRef` instead of substring
matching, then flip `settings.excludeLinksFromLockfile` on the parsed
value before the equality check. The invariant is that the setting
changes nothing else — not that the two files serialize byte-for-byte —
so an unrelated formatting or key-ordering change should not fail this
test. Logging follows the guide's rule for complex structures (`dbg!`).

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Copilot AI dismissed their stale review, a newer Copilot review was requested August 1, 2026 15:46
Copilot AI previously approved these changes Aug 1, 2026

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.

🟢 Ready to approve

The fix is narrowly scoped, uses the existing lexical-normalized subdir check correctly, and is covered by targeted unit + end-to-end regression tests (with a mirrored TS expectation).

This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.

Review details
  • Files reviewed: 7/7 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.

Copilot AI review requested due to automatic review settings August 1, 2026 15:47
@zkochan

zkochan commented Aug 1, 2026

Copy link
Copy Markdown
Member Author

Responses to the second round of Qodo findings:

1. Brittle lockfile string compare — fixed in 979284d. Both lockfiles are now parsed into pacquet_lockfile::Lockfile with serde_saphyr; the test asserts on the snapshot key and the peer's SnapshotDepRef::Link instead of substring matching, and flips settings.excludeLinksFromLockfile on the parsed value before the equality check. The invariant under test is that the setting changes nothing else, not that the two files serialize byte-for-byte. Re-verified that the test still fails against the unfixed resolver.

3. Noisy stderr in passing test — not applying. CODE_STYLE_GUIDE.md mandates this logging rather than discouraging it:

If the values being compared with assert_eq! are strings that may have many lines, they should be logged with eprintln! and {} format.
If the values being compared with assert_eq! have complex structures (such as a struct or an array), they should be logged with dbg!.

CodeRabbit raised the opposite nitpick on the same lines. The structural rewrite moves this to dbg! of the parsed lockfiles, which is what the guide prescribes for complex structures; current_lockfile.rs does exactly the same unconditionally.

2. Changeset missing pnpm bump — unchanged, see my earlier reply.


Written by an agent (Claude Code, claude-opus-5[1m]).

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 979284d

@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.

Copilot AI dismissed their stale review, a newer Copilot review was requested August 1, 2026 15:52

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.

🟢 Ready to approve

The remap fix is narrowly scoped, matches the documented root cause, and is backed by targeted unit tests plus an end-to-end regression test (with an appropriate pacquet changeset).

This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.

Review details
  • Files reviewed: 7/7 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.95%. Comparing base (fa8d383) to head (979284d).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #13563   +/-   ##
=======================================
  Coverage   87.94%   87.95%           
=======================================
  Files         556      556           
  Lines       97218    97225    +7     
=======================================
+ Hits        85502    85511    +9     
+ Misses      11716    11714    -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.

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Integrated-Benchmark Report (Linux)

Commit: 979284d77985

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.584 ± 0.140 2.369 2.734 1.69 ± 0.21
pacquet@main 2.544 ± 0.145 2.361 2.738 1.67 ± 0.21
pnpr@HEAD 1.611 ± 0.159 1.381 1.782 1.06 ± 0.16
pnpr@main 1.525 ± 0.172 1.351 1.821 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.58443673844,
      "stddev": 0.13986941051946333,
      "median": 2.6357710598399997,
      "user": 1.5263607399999999,
      "system": 1.30030836,
      "min": 2.3691922543399997,
      "max": 2.73415510234,
      "times": [
        2.65442083034,
        2.3691922543399997,
        2.73067192234,
        2.6290178323399997,
        2.4784488263399997,
        2.44198889134,
        2.73054052634,
        2.73415510234,
        2.64252428734,
        2.43340691134
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.5438864411399997,
      "stddev": 0.14522218612534166,
      "median": 2.54561781484,
      "user": 1.53084924,
      "system": 1.2473683599999998,
      "min": 2.3606872593399997,
      "max": 2.73771268934,
      "times": [
        2.42854793134,
        2.3606872593399997,
        2.41438774034,
        2.5246510773399997,
        2.7040125913399997,
        2.36812188534,
        2.5665845523399997,
        2.73771268934,
        2.6467058093399998,
        2.68745287534
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.61093884014,
      "stddev": 0.15891405881246634,
      "median": 1.6635431238400002,
      "user": 1.03146764,
      "system": 1.1744644599999998,
      "min": 1.38092619534,
      "max": 1.7823164313400002,
      "times": [
        1.7823164313400002,
        1.62435465734,
        1.7027315903400002,
        1.42289454434,
        1.74686835034,
        1.38092619534,
        1.75281621534,
        1.57298102434,
        1.39418702734,
        1.72931236534
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.5251469397400004,
      "stddev": 0.17227604758729959,
      "median": 1.48943181134,
      "user": 1.0748082399999999,
      "system": 1.1096627599999997,
      "min": 1.35076044034,
      "max": 1.82148077634,
      "times": [
        1.44902246934,
        1.82148077634,
        1.76628796134,
        1.3930875493400001,
        1.52984115334,
        1.3633659713400001,
        1.35076044034,
        1.5844614863400002,
        1.3621227283400001,
        1.6310388613400002
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 263.1 ± 7.1 248.8 271.3 1.04 ± 0.04
pacquet@main 253.2 ± 5.7 240.1 257.9 1.00
pnpr@HEAD 270.5 ± 7.2 261.7 286.4 1.07 ± 0.04
pnpr@main 274.3 ± 5.7 268.6 284.0 1.08 ± 0.03
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.26313557992000003,
      "stddev": 0.007050761370687851,
      "median": 0.26638120872000004,
      "user": 0.21556704,
      "system": 0.53050172,
      "min": 0.24878245122,
      "max": 0.27134678422,
      "times": [
        0.25766980322,
        0.26001042622000003,
        0.26701309022,
        0.24878245122,
        0.26620674622,
        0.26655567122,
        0.25688480822000004,
        0.26726663522,
        0.27134678422,
        0.26961938322
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.25318635342,
      "stddev": 0.005690136496642353,
      "median": 0.25545201522000005,
      "user": 0.20369864,
      "system": 0.51732912,
      "min": 0.24012540222,
      "max": 0.25786154222,
      "times": [
        0.24649474822,
        0.24012540222,
        0.25714617922,
        0.25216512022000004,
        0.25686187722000003,
        0.25549425922,
        0.25342854122,
        0.25786154222,
        0.25540977122,
        0.25687609322
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.27048357162,
      "stddev": 0.007184374525446858,
      "median": 0.26877788772,
      "user": 0.21529133999999997,
      "system": 0.5298949199999999,
      "min": 0.26165767822,
      "max": 0.28636290022,
      "times": [
        0.26646172422000003,
        0.26865020322,
        0.27295367122,
        0.27727906022000004,
        0.26165767822,
        0.26574083322000003,
        0.26459726622,
        0.26890557222,
        0.27222680722000003,
        0.28636290022
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.27425318262000004,
      "stddev": 0.005701299491719553,
      "median": 0.27273703372,
      "user": 0.22173414,
      "system": 0.54971232,
      "min": 0.26858626322,
      "max": 0.28400145722000003,
      "times": [
        0.28400145722000003,
        0.26863852222,
        0.27140093622,
        0.27844177122,
        0.27407313122,
        0.28052350822,
        0.26875978822,
        0.26966063022000003,
        0.26858626322,
        0.27844581822000003
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.625 ± 0.022 2.592 2.656 1.63 ± 0.15
pacquet@main 2.616 ± 0.025 2.574 2.656 1.62 ± 0.15
pnpr@HEAD 1.611 ± 0.145 1.443 1.812 1.00
pnpr@main 1.666 ± 0.147 1.436 1.836 1.03 ± 0.13
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.6253005933,
      "stddev": 0.022498454957921268,
      "median": 2.6267214275999997,
      "user": 1.5211347,
      "system": 1.29867422,
      "min": 2.5923855061,
      "max": 2.6564965200999997,
      "times": [
        2.5982872260999996,
        2.6540963041,
        2.6232796681,
        2.6107004591,
        2.6306158071,
        2.6301631871,
        2.6465270281,
        2.6564965200999997,
        2.6104542271,
        2.5923855061
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.6156697129,
      "stddev": 0.025066766259403996,
      "median": 2.6155696520999996,
      "user": 1.5333435999999998,
      "system": 1.30242112,
      "min": 2.5738630241,
      "max": 2.6557442371,
      "times": [
        2.6297979621,
        2.6105719571,
        2.6059425501,
        2.5916413401,
        2.6557442371,
        2.5957782541,
        2.6205673470999997,
        2.6443006800999997,
        2.6284897771,
        2.5738630241
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.6114334018,
      "stddev": 0.14516569828063486,
      "median": 1.6480558641000003,
      "user": 1.0457153,
      "system": 1.1423242200000001,
      "min": 1.4426625791,
      "max": 1.8124997461,
      "times": [
        1.7184783371,
        1.4585139301,
        1.6621701591000002,
        1.8124997461,
        1.4426625791,
        1.6884668021,
        1.4545056061,
        1.6339415691,
        1.7828820201,
        1.4602132691
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.6659912355,
      "stddev": 0.14722824872914472,
      "median": 1.6857155086,
      "user": 1.0448252,
      "system": 1.14310752,
      "min": 1.4356406511000002,
      "max": 1.8357993751,
      "times": [
        1.7879050271,
        1.6888928621000001,
        1.6268560110999999,
        1.7678546971,
        1.6825381551,
        1.4356406511000002,
        1.8254362851000001,
        1.5678792251,
        1.8357993751,
        1.4411100661
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 409.7 ± 8.4 395.8 422.7 1.34 ± 0.04
pacquet@main 405.8 ± 4.7 398.1 414.6 1.33 ± 0.03
pnpr@HEAD 306.8 ± 5.3 298.6 313.4 1.01 ± 0.03
pnpr@main 305.2 ± 6.8 295.3 315.1 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.40973433408000004,
      "stddev": 0.008377966322058486,
      "median": 0.4113915690800001,
      "user": 0.51428278,
      "system": 0.7136506399999998,
      "min": 0.39580794958000004,
      "max": 0.42268017558000004,
      "times": [
        0.40387280758000005,
        0.40715798358000005,
        0.41186645058000004,
        0.41965954558,
        0.41091668758000005,
        0.41356704058000004,
        0.41226124058,
        0.42268017558000004,
        0.39580794958000004,
        0.39955345958000005
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.40581224298000007,
      "stddev": 0.00469084251407146,
      "median": 0.4058074810800001,
      "user": 0.50228098,
      "system": 0.7245004399999999,
      "min": 0.39814077758000005,
      "max": 0.41459173158000007,
      "times": [
        0.40750200558000005,
        0.40620010258000006,
        0.40541485958000006,
        0.40039202258000006,
        0.40294006558000006,
        0.41459173158000007,
        0.40515413958,
        0.39814077758000005,
        0.40986642358,
        0.40792030158000003
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.30679001508000003,
      "stddev": 0.005285184848541561,
      "median": 0.30656860408000003,
      "user": 0.21196158,
      "system": 0.5347809399999999,
      "min": 0.29864504858,
      "max": 0.31336633458,
      "times": [
        0.30766140958000004,
        0.29944578158,
        0.31084384158000006,
        0.30520438858000004,
        0.30340047258,
        0.31336633458,
        0.29864504858,
        0.31089404558000006,
        0.31296302958000005,
        0.30547579858
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.30521076888000004,
      "stddev": 0.006751730223004779,
      "median": 0.30518588308000005,
      "user": 0.20754067999999998,
      "system": 0.5141010399999999,
      "min": 0.29525751158,
      "max": 0.31507239658,
      "times": [
        0.31007577958000004,
        0.29909893958000006,
        0.29714084558000003,
        0.29525751158,
        0.30224232958,
        0.30519713458000003,
        0.31047955758,
        0.31236856258,
        0.31507239658,
        0.30517463158
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.747 ± 0.009 1.735 1.769 5.66 ± 0.11
pacquet@main 1.734 ± 0.010 1.724 1.757 5.62 ± 0.11
pnpr@HEAD 0.313 ± 0.007 0.303 0.323 1.01 ± 0.03
pnpr@main 0.308 ± 0.006 0.298 0.316 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.7469075889399999,
      "stddev": 0.009378942275070475,
      "median": 1.7441984967400002,
      "user": 0.74852248,
      "system": 0.76973608,
      "min": 1.73544345624,
      "max": 1.76896957424,
      "times": [
        1.7471512992400002,
        1.74226959624,
        1.76896957424,
        1.74572981024,
        1.7435018302400003,
        1.74448122724,
        1.74391576624,
        1.75645243324,
        1.73544345624,
        1.74116089624
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 1.7342026632400003,
      "stddev": 0.01035797492546845,
      "median": 1.7299727147400001,
      "user": 0.7486567799999999,
      "system": 0.73457418,
      "min": 1.7241763732400002,
      "max": 1.7568563512400002,
      "times": [
        1.7245785362400001,
        1.7293007792400001,
        1.74250342624,
        1.7306446502400001,
        1.7434318582400001,
        1.72765624324,
        1.7337142112400001,
        1.72916420324,
        1.7241763732400002,
        1.7568563512400002
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.31254488014000004,
      "stddev": 0.006928108127270687,
      "median": 0.31004249974000003,
      "user": 0.20940867999999999,
      "system": 0.54092548,
      "min": 0.30251681224000004,
      "max": 0.32349170524000004,
      "times": [
        0.30802735324,
        0.31001417124,
        0.31007082824000004,
        0.32260714524000006,
        0.30880628524000003,
        0.31291067724000005,
        0.30251681224000004,
        0.32349170524000004,
        0.31904572124,
        0.30795810224000003
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.30849236154000004,
      "stddev": 0.005816699225586987,
      "median": 0.31125146874000004,
      "user": 0.20206397999999998,
      "system": 0.5426111799999999,
      "min": 0.29827935824,
      "max": 0.31619706524,
      "times": [
        0.31194842124000005,
        0.30242424724000005,
        0.31219680724000004,
        0.30210549024000005,
        0.31277312924000006,
        0.29827935824,
        0.31135507824,
        0.30649615924,
        0.31619706524,
        0.31114785924000005
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 181.2 ± 11.9 172.6 217.9 2.10 ± 0.15
pacquet@main 183.3 ± 6.1 175.6 192.7 2.13 ± 0.09
pnpr@HEAD 87.0 ± 1.4 83.0 88.8 1.01 ± 0.03
pnpr@main 86.2 ± 2.1 82.4 88.5 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.18122471955846153,
      "stddev": 0.011921067072177367,
      "median": 0.17874026702,
      "user": 0.16770552307692307,
      "system": 0.06353951846153845,
      "min": 0.17256104102,
      "max": 0.21793549202,
      "times": [
        0.21793549202,
        0.17874026702,
        0.17903302502000001,
        0.17598310102,
        0.18106203302,
        0.17256104102,
        0.17458580902,
        0.17307129702000001,
        0.17764432002,
        0.18007387002,
        0.17492975502,
        0.18020219002,
        0.19009915402
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.18327091764500003,
      "stddev": 0.0060802530629187794,
      "median": 0.18156772202,
      "user": 0.1668259125,
      "system": 0.0693911675,
      "min": 0.17556842402,
      "max": 0.19273135302,
      "times": [
        0.18031522202,
        0.17567151702,
        0.17569204602,
        0.18142543502,
        0.17884987202,
        0.17556842402,
        0.17899513502,
        0.17864956602,
        0.18171000902,
        0.18656250602,
        0.19170007802,
        0.19149660602000002,
        0.18678794902,
        0.19273135302,
        0.19013967902,
        0.18603928502
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.08700558753515153,
      "stddev": 0.001360083639773651,
      "median": 0.08740495102000001,
      "user": 0.01928320606060606,
      "system": 0.009150616363636366,
      "min": 0.08295692402000002,
      "max": 0.08878854702000001,
      "times": [
        0.08548408602000002,
        0.08790164202000002,
        0.08776570802000001,
        0.08671339302000002,
        0.08878854702000001,
        0.08794325102000002,
        0.08702854502000001,
        0.08790272502000002,
        0.08615090802000001,
        0.08800209102,
        0.08691938002,
        0.08756290702000001,
        0.08303025102000001,
        0.08752147002,
        0.08740495102000001,
        0.08713384202,
        0.08295692402000002,
        0.08666242702000002,
        0.08423276802000002,
        0.08631358302000001,
        0.08767543802000001,
        0.08824812402000001,
        0.08677484802000002,
        0.08799829402,
        0.08751997802000001,
        0.08786057602000001,
        0.08734985802000002,
        0.08843156802000002,
        0.08750653102000001,
        0.08661767302000001,
        0.08783771302000001,
        0.08657771802000001,
        0.08736667002000001
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.08623985695939394,
      "stddev": 0.002063824239202962,
      "median": 0.08707705602000002,
      "user": 0.019288781818181815,
      "system": 0.008950223636363637,
      "min": 0.08236647602000001,
      "max": 0.08852863002000001,
      "times": [
        0.08648340202000002,
        0.08281490802000001,
        0.08757458902000001,
        0.08787515402000001,
        0.08684980002,
        0.08775125002,
        0.08760619902000001,
        0.08806450802000002,
        0.08606856302000002,
        0.08296366702,
        0.08751474602,
        0.08253078402000001,
        0.08792668002000001,
        0.08684748402000002,
        0.08265023802000002,
        0.08850842102,
        0.08686991702,
        0.08730785902000002,
        0.08762387102000001,
        0.08745726002000001,
        0.08703004802000001,
        0.08761712802000002,
        0.08236647602000001,
        0.08852863002000001,
        0.08638264302000001,
        0.08281172202,
        0.08728524602000001,
        0.08292185802000002,
        0.08748796602000002,
        0.08707705602000002,
        0.08685147202000001,
        0.08311367702000001,
        0.08715205702
      ]
    }
  ]
}

Scenario: Isolated linker: peer-heavy resolve, hot cache, offline

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.713 ± 0.442 0.909 2.407 1.00
pacquet@main 2.036 ± 0.649 1.422 3.256 1.19 ± 0.49
pnpm@HEAD 3.064 ± 0.079 2.960 3.231 1.79 ± 0.46
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.7133512909088888,
      "stddev": 0.44157248843857555,
      "median": 1.7660121970200002,
      "user": 1.6022429244444443,
      "system": 0.2078058022222222,
      "min": 0.9090747170200001,
      "max": 2.40728241502,
      "times": [
        0.9090747170200001,
        1.40674985102,
        2.40728241502,
        1.7660121970200002,
        1.62384100502,
        2.03808595402,
        1.37916272402,
        1.9786232320200001,
        1.91132952302
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.0362516226866667,
      "stddev": 0.649128888044029,
      "median": 1.76189229402,
      "user": 1.914259702222222,
      "system": 0.23691735777777778,
      "min": 1.4216704450200002,
      "max": 3.25635674702,
      "times": [
        1.46137974202,
        1.4216704450200002,
        1.76189229402,
        1.6277597300200002,
        2.11591973502,
        1.49094376902,
        2.55349338902,
        2.63684875302,
        3.25635674702
      ]
    },
    {
      "command": "pnpm@HEAD",
      "mean": 3.0639517023533336,
      "stddev": 0.07948560687509616,
      "median": 3.04086051602,
      "user": 4.69895748,
      "system": 0.25359435777777783,
      "min": 2.95977960102,
      "max": 3.2314554920200003,
      "times": [
        3.07431171802,
        3.0065254550200002,
        3.02694807502,
        3.01735340702,
        3.04086051602,
        2.95977960102,
        3.10338664702,
        3.2314554920200003,
        3.11494441002
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.581 ± 0.158 4.438 4.856 1.29 ± 0.05
pacquet@main 4.493 ± 0.064 4.440 4.658 1.27 ± 0.04
pnpr@HEAD 3.546 ± 0.088 3.441 3.706 1.00
pnpr@main 3.602 ± 0.151 3.457 3.838 1.02 ± 0.05
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.58127262444,
      "stddev": 0.15846586042067837,
      "median": 4.49575656634,
      "user": 1.6937790200000002,
      "system": 1.3722616200000002,
      "min": 4.43807913084,
      "max": 4.85556153884,
      "times": [
        4.52085338584,
        4.85556153884,
        4.73838409584,
        4.46194545584,
        4.44995154684,
        4.67182280184,
        4.75940211984,
        4.47065974684,
        4.43807913084,
        4.44606642184
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 4.493258895239999,
      "stddev": 0.06411873081689047,
      "median": 4.47073047584,
      "user": 1.74161182,
      "system": 1.34537562,
      "min": 4.44038244584,
      "max": 4.65814424884,
      "times": [
        4.46672489284,
        4.52390711284,
        4.44038244584,
        4.4849495068400005,
        4.4747360588400005,
        4.65814424884,
        4.45777079784,
        4.51663845084,
        4.44524085184,
        4.46409458584
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.54579071244,
      "stddev": 0.08751745544260137,
      "median": 3.52782540784,
      "user": 1.19320472,
      "system": 1.26422582,
      "min": 3.44054668384,
      "max": 3.70584297984,
      "times": [
        3.49469198384,
        3.52255519684,
        3.54268501684,
        3.44872882984,
        3.67222028884,
        3.44054668384,
        3.53309561884,
        3.50696279384,
        3.59057773184,
        3.70584297984
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 3.6016930999400003,
      "stddev": 0.1505283057763875,
      "median": 3.5125838848399997,
      "user": 1.17966832,
      "system": 1.2394752199999999,
      "min": 3.45703369884,
      "max": 3.83778882284,
      "times": [
        3.76181653284,
        3.4693807958400003,
        3.67752673684,
        3.48465286384,
        3.51204537384,
        3.83778882284,
        3.51312239584,
        3.45703369884,
        3.50385128084,
        3.79971249784
      ]
    }
  ]
}

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/13563
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,592.39 ms
(-3.30%)Baseline: 2,680.82 ms
3,216.98 ms
(80.58%)
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
🚷 view threshold
1,735.44 ms
(-4.62%)Baseline: 1,819.57 ms
2,183.48 ms
(79.48%)
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
🚷 view threshold
395.81 ms
(-16.28%)Baseline: 472.75 ms
567.30 ms
(69.77%)
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
🚷 view threshold
172.56 ms
(-21.74%)Baseline: 220.51 ms
264.61 ms
(65.21%)
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
🚷 view threshold
2,369.19 ms
(-2.57%)Baseline: 2,431.78 ms
2,918.13 ms
(81.19%)
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
🚷 view threshold
4,438.08 ms
(-1.93%)Baseline: 4,525.34 ms
5,430.41 ms
(81.73%)
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
🚷 view threshold
248.78 ms
(-12.27%)Baseline: 283.59 ms
340.31 ms
(73.10%)
isolated-linker.peer-heavy-resolve.hot-cache.offline📈 view plot
🚷 view threshold
909.07 ms
🐰 View full continuous benchmarking report in Bencher

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/13563
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,442.66 ms
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
302.52 ms
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
298.65 ms
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
⚠️ NO THRESHOLD
82.96 ms
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
1,380.93 ms
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
⚠️ NO THRESHOLD
3,440.55 ms
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
261.66 ms
🐰 View full continuous benchmarking report in Bencher

@zkochan
zkochan merged commit 4c02bbe into main Aug 1, 2026
38 checks passed
@zkochan
zkochan deleted the fix-13556 branch August 1, 2026 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

excludeLinksFromLockfile remaps workspace-internal link: deps because the containment check compares a relative path

3 participants