Skip to content

fix(pacquet): serialize same-name injected importer deps as plain file: refs - #12924

Merged
zkochan merged 4 commits into
mainfrom
fix/plain-file-refs-for-same-name-importer-deps
Jul 11, 2026
Merged

zkochan merged 4 commits into
mainfrom
fix/plain-file-refs-for-same-name-importer-deps

Conversation

@zkochan

@zkochan zkochan commented Jul 10, 2026 •

Copy link
Copy Markdown
Member

An injected workspace dep's dep path is <name>@file:<path>(peers). With real_name unset (directory resolutions learn their name from the fetched manifest), the peered shape missed the bare file: strip in importer_dep_version and fell through to the <name>@<ref> alias form. pnpm v11 reserves that form for renamed deps and writes the plain file:<path>(peers) ref when the alias equals the package name.

The self-aliased form double-prefixes every consumer that composes alias@version into a snapshot key — Bit's lockfile-to-graph converter crashed on it (Cannot read properties of undefined), which is the remaining BIT_FEATURES=deps-graph e2e failure cluster on teambit/bit#10293 after @pnpm/napi 12.0.0-alpha.6.

  • Renamed (npm-alias) deps keep the <name>@<ref> form; a unit test pins both shapes.
  • Verified against Bit's deps-graph e2e with a locally built binding: the bit tag crash is gone and the suite proceeds. (Its later assertions then reach pacquet's missing lockfile-resolution-reuse — the pre-existing gap tracked in plans/LOCKFILE_RESOLUTION_REUSE.md — which is unrelated to this serialization fix.)

Written by an agent (Claude Code, claude-fable-5).

Summary by CodeRabbit

  • Bug Fixes

    • Improved lockfile generation for injected workspace dependencies: when the dependency alias matches the package name, lockfile entries now use a plain file:<pkg> reference instead of an alias-prefixed form.
    • Preserved the previous alias-based lockfile behavior when the alias differs from the package name.
  • Tests

    • Added unit test coverage for both the matching-alias and differing-alias scenarios.
    • Updated end-to-end assertions to reflect the new expected lockfile output for injected workspace dependencies.

…e: refs

An injected workspace dep's dep path is <name>@file:<path>(peers).
With real_name unset (directory resolutions learn their name from the
manifest), the peered shape missed the bare file: strip in
importer_dep_version and fell through to the <name>@<ref> alias form —
which pnpm v11 reserves for renamed deps, writing the plain
file:<path>(peers) ref when the alias equals the package name.

The self-aliased form double-prefixes every consumer that composes
alias@version into a snapshot key: Bit's lockfile-to-graph converter
crashed on it (teambit/bit#10293's remaining deps-graph e2e cluster),
and v11 readers would mis-key the same way.

Renamed aliases keep the alias form; a unit test pins both shapes.

Co-Authored-By: Claude Fable 5 <[email protected]>
Copilot AI review requested due to automatic review settings July 10, 2026 21:49

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.

@coderabbitai

coderabbitai Bot commented Jul 10, 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: 6aeb528f-eaf8-41bd-b952-a1aea5ae3e37

📥 Commits

Reviewing files that changed from the base of the PR and between 07e04c3 and 2190e49.

📒 Files selected for processing (1)
  • pnpm/crates/cli/tests/inject_workspace_packages.rs

📝 Walkthrough

Walkthrough

The dependency graph conversion now maps same-name injected workspace file: dependencies to plain file references while retaining aliases for renamed dependencies. Unit and end-to-end tests cover both serialization paths and updated lockfile output.

Changes

Injected workspace dependency lockfile mapping

Layer / File(s) Summary
DepPath mapping for injected workspace dependencies
pnpm/crates/package-manager/src/dependencies_graph_to_lockfile.rs
Adds VersionPart handling and maps matching file: dependency paths to ImporterDepVersion::File; other parsed paths remain aliases.
Alias preservation regression coverage
pnpm/crates/package-manager/src/dependencies_graph_to_lockfile/tests.rs
Tests plain file serialization for matching names and alias serialization for renamed dependencies.
Injected workspace lockfile output assertions
pnpm/crates/cli/tests/inject_workspace_packages.rs
Updates workspace and per-dependency override assertions to expect plain file: references in importer dependency versions.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • pnpm/pnpm#11905: Both changes modify importer_dep_version handling in dependency graph to lockfile conversion.
  • pnpm/pnpm#11944: Both changes map dependency dep_path shapes to ImporterDepVersion variants.
  • pnpm/pnpm#12021: Both changes affect injectWorkspacePackages lockfile output.

Suggested labels: product: pacquet

Suggested reviewers: qodo-code-review

✨ 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/plain-file-refs-for-same-name-importer-deps

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 lockfile serialization for same-name injected workspace file refs

🐞 Bug fix 🧪 Tests 🕐 20-40 Minutes

Grey Divider

AI Description

• Serialize injected workspace deps as plain file:(peers) when alias matches package name
• Preserve @ alias form for genuinely renamed (npm-alias) dependencies
• Add a unit test covering both same-name and renamed alias serialization paths
Diagram

graph TD
  A["DependenciesGraphNode dep_path"] --> B["importer_dep_version()"] --> C{"alias==name & file version?"}
  C -- "yes" --> D["ImporterDepVersion::File"] --> E[("pnpm lockfile")]
  C -- "no" --> F["ImporterDepVersion::Alias"] --> E
  subgraph Legend
    direction LR
    _p["Process"] ~~~ _d{"Decision"} ~~~ _s[("Data")]
  end
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Fix earlier `file:` stripping to handle peered suffixes
  • ➕ Keeps all file-ref normalization in a single pre-parse string handling stage
  • ➕ Avoids re-stringifying the parsed suffix just to strip file:
  • ➖ More fragile: relies on string patterns across multiple dep-path shapes
  • ➖ Harder to guarantee correctness for all (peers) suffix variants
2. Compare structured names (PkgName) instead of `to_string()`
  • ➕ Avoids any subtle formatting differences between stringified and canonical names
  • ➕ Makes intent explicit: name equality rather than display equality
  • ➖ Requires parsing alias into the same structured type (and handling parse failures)
  • ➖ Slightly more code for minimal practical gain if alias strings are already canonical

Recommendation: Current approach is appropriate: it uses the already-parsed PkgNameVerPeer to detect the special case (same-name + file version part) and only falls back to the alias form when the dependency is truly renamed. This aligns with pnpm v11 semantics and directly prevents downstream snapshot-key double-prefixing.

Files changed (2) +75 / -4

Bug fix (1) +20 / -4
dependencies_graph_to_lockfile.rsTreat same-name injected file deps as plain 'file:' importer refs +20/-4

Treat same-name injected file deps as plain 'file:' importer refs

• Refines 'importer_dep_version' to detect parsed dep paths where the alias equals the package name and the version part is 'file:' (including peered suffixes). In that case it serializes 'ImporterDepVersion::File' instead of falling back to the '<name>@<ref>' alias form, preserving alias serialization for renamed deps.

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

Tests (1) +55 / -0
tests.rsAdd regression test for same-name injected file ref serialization +55/-0

Add regression test for same-name injected file ref serialization

• Adds a unit test that constructs a 'DependenciesGraphNode' representing an injected workspace dep with peers and no structured 'name_ver'. Asserts that same-name aliases serialize to 'ImporterDepVersion::File' while renamed aliases continue to serialize as 'ImporterDepVersion::Alias'.

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

@qodo-code-review

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

Copy link
Copy Markdown

Code Review by Qodo

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

Context used
✅ Compliance rules (platform): 18 rules

Grey Divider


Remediation recommended

1. Avoidable suffix stringification 🐞 Bug ➹ Performance
Description
The new same-name injected-workspace branch in importer_dep_version() allocates
suffix.to_string() and then strip_prefix("file:") to build the ImporterDepVersion::File
payload, even though the structured VersionPart::File(path) plus peer() already contain the
needed parts. This adds avoidable allocation work in the direct-dependency lockfile build loop and
makes the logic depend on Display formatting rather than typed data.
Code

pnpm/crates/package-manager/src/dependencies_graph_to_lockfile.rs[R375-380]

+    if parsed.name.to_string() == alias && matches!(parsed.suffix.version(), VersionPart::File(_)) {
+        let suffix = parsed.suffix.to_string();
+        let payload = suffix
+            .strip_prefix("file:")
+            .expect("a File version part always displays with the file: scheme");
+        return ImporterDepVersion::File(payload.to_string());
Evidence
importer_dep_version() is called once per direct dependency while building each importer snapshot,
so extra allocations here scale with dependency count. VersionPart::File explicitly stores the
scheme-stripped path, and its Display implementation always re-adds file:, meaning the current
logic can be replaced with structured-field concatenation without relying on formatting/stripping.

pnpm/crates/package-manager/src/dependencies_graph_to_lockfile.rs[250-275]
pnpm/crates/package-manager/src/dependencies_graph_to_lockfile.rs[363-382]
pnpm/crates/lockfile/src/pkg_ver_peer.rs[6-31]

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

### Issue description
`importer_dep_version()` builds the `ImporterDepVersion::File` payload by stringifying `parsed.suffix` and stripping the `file:` prefix. This introduces avoidable allocations and couples correctness to `Display` output.

### Issue Context
`PkgVerPeer` already stores file deps as `VersionPart::File(String)` (path *without* the scheme), and keeps the peer suffix separately (`peer()`), so you can construct the payload without formatting/stripping.

### Fix Focus Areas
- pnpm/crates/package-manager/src/dependencies_graph_to_lockfile.rs[363-382]

### Suggested change
- Replace:
 - `let suffix = parsed.suffix.to_string();` + `strip_prefix("file:")`
- With typed extraction:
 - `if let VersionPart::File(path) = parsed.suffix.version() { let payload = format!("{path}{}", parsed.suffix.peer()); ... }`

(Optionally, if you want to remove the remaining `parsed.name.to_string()` allocation too, consider passing the already-parsed `PkgName` from `build_importer()` into `importer_dep_version()` and comparing `PkgName` values directly.)

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


2. Historical comment in importer_dep_version ✓ Resolved 📘 Rule violation ⚙ Maintainability
Description
Newly added inline and doc comments describe historical or counterfactual behavior (e.g., “would
fall through” / “used to fall through”) rather than documenting the current behavior and guarantees.
This violates the rule prohibiting historical-implementation commentary in source comments and
docstrings.
Code

pnpm/crates/package-manager/src/dependencies_graph_to_lockfile.rs[R366-374]

+    // An injected workspace dep's dep path is `<name>@file:<path>(peers)`
+    // — with `real_name` unset (directory resolutions learn their name
+    // from the manifest), the peered shape misses the bare `file:` strip
+    // above and would fall through to the `<name>@<ref>` alias form.
+    // pnpm v11 reserves that form for *renamed* deps and writes the
+    // plain `file:<path>(peers)` ref when the alias equals the package
+    // name; the aliased form double-prefixes every consumer that
+    // composes `alias@version` into a snapshot key (v11 readers, Bit's
+    // graph converter).
Evidence
In importer_dep_version, the added inline comment uses counterfactual/historical phrasing (“would
fall through”) to describe an alternate/prior implementation path instead of stating the current
invariant governing serialization decisions, and in the new test the doc comment explicitly says
“used to fall through,” which is direct historical language; both instances are disallowed by the
checklist rule requiring comments to describe current behavior/contract rather than past
implementations.

Rule 772199: Comments must describe current behavior, not historical implementations
pnpm/crates/package-manager/src/dependencies_graph_to_lockfile.rs[366-374]
pnpm/crates/package-manager/src/dependencies_graph_to_lockfile/tests.rs[1509-1515]

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

## Issue description
Rewrite the newly added inline comment and the test doc comment to remove historical/counterfactual phrasing (e.g., “would fall through”, “used to …”) and instead document the current behavior/contract (and, if helpful, rationale framed in terms of current constraints/invariants).

## Issue Context
This code path affects user-visible lockfile serialization; comments should describe the present decision rule/invariant for when `ImporterDepVersion::File` vs `ImporterDepVersion::Alias` is emitted without framing it in terms of what previously happened. The test comment can still explain intent/rationale, but it must do so without referencing prior implementations.

## Fix Focus Areas
- pnpm/crates/package-manager/src/dependencies_graph_to_lockfile.rs[366-374]
- pnpm/crates/package-manager/src/dependencies_graph_to_lockfile/tests.rs[1509-1515]

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


Grey Divider

Qodo Logo

@qodo-code-review

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

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

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

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
High-level
Generalize alias fix to all protocols

Extend the alias prefix stripping to apply to all non-registry dependencies
(such as git or tarballs) when the dependency name matches the alias. This
prevents the lockfile double-prefixing bug from affecting protocols other than
file:.

Examples:

pnpm/crates/package-manager/src/dependencies_graph_to_lockfile.rs [375-382]
    if parsed.name.to_string() == alias && matches!(parsed.suffix.version(), VersionPart::File(_)) {
        let suffix = parsed.suffix.to_string();
        let payload = suffix
            .strip_prefix("file:")
            .expect("a File version part always displays with the file: scheme");
        return ImporterDepVersion::File(payload.to_string());
    }
    ImporterDepVersion::Alias(parsed)

Solution Walkthrough:

Before:

if parsed.name.to_string() == alias && matches!(parsed.suffix.version(), VersionPart::File(_)) {
    let suffix = parsed.suffix.to_string();
    let payload = suffix
        .strip_prefix("file:")
        .expect("a File version part always displays with the file: scheme");
    return ImporterDepVersion::File(payload.to_string());
}
ImporterDepVersion::Alias(parsed)

After:

if parsed.name.to_string() == alias {
    if matches!(parsed.suffix.version(), VersionPart::File(_)) {
        let suffix = parsed.suffix.to_string();
        let payload = suffix
            .strip_prefix("file:")
            .expect("a File version part always displays with the file: scheme");
        return ImporterDepVersion::File(payload.to_string());
    }
    return ImporterDepVersion::Regular(parsed.suffix);
}
ImporterDepVersion::Alias(parsed)
Suggestion importance[1-10]: 9

__

Why: This suggestion accurately points out that the PR's fix is incomplete and should apply to all non-registry protocols (like git or tarball) to prevent the same lockfile double-prefixing bug.

High
General
Avoid unnecessary String allocation

Avoid unnecessary String allocation by using string slices for comparison.

pnpm/crates/package-manager/src/dependencies_graph_to_lockfile.rs [375]

-if parsed.name.to_string() == alias && matches!(parsed.suffix.version(), VersionPart::File(_)) {
+if parsed.name.as_str() == alias && matches!(parsed.suffix.version(), VersionPart::File(_)) {
  • Apply / Chat
Suggestion importance[1-10]: 6

__

Why: Avoiding the heap allocation from to_string() slightly improves performance during string comparisons.

Low
  • More

@github-actions

github-actions Bot commented Jul 10, 2026 •

Copy link
Copy Markdown
Contributor

Micro-Benchmark Results

Linux

group                          main                                   pr
-----                          ----                                   --
tarball/download_dependency    1.00      6.6±0.22ms   657.9 KB/sec    1.01      6.7±0.48ms   652.3 KB/sec

@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Jul 10, 2026
…ract

The comments on the same-name injected-dep branch narrated the fixed
bug ("used to fall through", "would fall through") — past
implementation shape the comments guideline routes to the commit
message. Rephrase both as statements of what the code guarantees now;
the test doc also stops re-narrating the implementation mechanics the
asserts already pin.

Co-Authored-By: Claude Fable 5 <[email protected]>
Copilot AI review requested due to automatic review settings July 10, 2026 22:07

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 07e04c3

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

Auto-approved notes - no code suggestions found
- 'approve_pr_on_self_review' flag enabled

@github-actions

Copy link
Copy Markdown
Contributor

Integrated-Benchmark Report (Linux)

Commit: 07e04c30252f

Each scenario reports direct installs and pnpr installs. Bencher consumes pacquet@HEAD and pnpr@HEAD.

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.235 ± 0.170 3.983 4.477 1.96 ± 0.15
pacquet@main 4.091 ± 0.057 3.995 4.190 1.89 ± 0.12
pnpr@HEAD 2.173 ± 0.111 2.013 2.390 1.00 ± 0.08
pnpr@main 2.165 ± 0.138 1.993 2.383 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.2347676432,
      "stddev": 0.1699426916269442,
      "median": 4.2470107948999996,
      "user": 3.8922328999999998,
      "system": 3.5936026199999995,
      "min": 3.9829022729,
      "max": 4.4773396409,
      "times": [
        4.2454078099,
        3.9829022729,
        4.3386027009,
        4.4069502219,
        4.4773396409,
        4.2486137799,
        4.0259204959,
        4.0349312349,
        4.2366615199,
        4.3503467549
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 4.0905397274999995,
      "stddev": 0.057211712863796435,
      "median": 4.0889209699,
      "user": 3.9224104000000004,
      "system": 3.55378802,
      "min": 3.9954099509,
      "max": 4.1898992729,
      "times": [
        4.1116851499000004,
        4.0978335359,
        4.1394582769,
        4.0800084039,
        4.1386506539,
        4.1898992729,
        4.0405687879,
        4.0687195599,
        3.9954099509,
        4.0431636829
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 2.1731786098,
      "stddev": 0.11139415192281543,
      "median": 2.1613515038999997,
      "user": 2.6918574000000004,
      "system": 3.10775442,
      "min": 2.0127361139,
      "max": 2.3902254109000003,
      "times": [
        2.1142464079,
        2.0715325269,
        2.1053925729,
        2.2084565999,
        2.2420008449,
        2.0127361139,
        2.2169982849,
        2.2633340559,
        2.3902254109000003,
        2.1068632799
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 2.1651490376,
      "stddev": 0.13818765087523632,
      "median": 2.1170781949000004,
      "user": 2.7003943,
      "system": 3.0952591200000006,
      "min": 1.9931631649000001,
      "max": 2.3832109049,
      "times": [
        2.3832109049,
        2.0766471769,
        1.9931631649000001,
        2.0888892219,
        2.0608952229,
        2.0474603639,
        2.1452671679,
        2.3327664569,
        2.1935143919,
        2.3296763039
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 691.4 ± 12.6 677.7 709.7 1.00
pacquet@main 706.7 ± 96.3 651.8 974.6 1.02 ± 0.14
pnpr@HEAD 744.3 ± 76.7 697.1 957.1 1.08 ± 0.11
pnpr@main 753.7 ± 38.1 701.7 833.4 1.09 ± 0.06
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.6914231568400001,
      "stddev": 0.012550912222701587,
      "median": 0.6869220873399999,
      "user": 0.41058669999999997,
      "system": 1.3787876799999998,
      "min": 0.67771629134,
      "max": 0.70972905134,
      "times": [
        0.6833961763399999,
        0.70234544334,
        0.68033929034,
        0.70534293734,
        0.69044799834,
        0.70972905134,
        0.70360346634,
        0.68322507734,
        0.67771629134,
        0.67808583634
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.70674143554,
      "stddev": 0.09628737442552901,
      "median": 0.6786946363399999,
      "user": 0.4126295,
      "system": 1.3660818799999999,
      "min": 0.65175048234,
      "max": 0.97460308834,
      "times": [
        0.71499507134,
        0.65175048234,
        0.69933673034,
        0.65491942134,
        0.66277322734,
        0.66974932234,
        0.68763995034,
        0.66397737534,
        0.68766968634,
        0.97460308834
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.7443174347400001,
      "stddev": 0.07667875615551838,
      "median": 0.72985172634,
      "user": 0.4319512,
      "system": 1.3838487800000001,
      "min": 0.69709628134,
      "max": 0.95708451734,
      "times": [
        0.74438923334,
        0.73020085534,
        0.69709628134,
        0.70395973734,
        0.71309264334,
        0.72950259734,
        0.69751141634,
        0.73090742034,
        0.95708451734,
        0.73942964534
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.7536533901400001,
      "stddev": 0.0380998671048713,
      "median": 0.73627200284,
      "user": 0.42478499999999997,
      "system": 1.38971768,
      "min": 0.70174982834,
      "max": 0.83340780634,
      "times": [
        0.76532883034,
        0.70174982834,
        0.73654703234,
        0.73539695034,
        0.73418978934,
        0.73190752234,
        0.73599697334,
        0.83340780634,
        0.76386148034,
        0.79814768834
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.340 ± 0.039 4.267 4.413 1.99 ± 0.12
pacquet@main 4.343 ± 0.040 4.272 4.413 2.00 ± 0.12
pnpr@HEAD 2.215 ± 0.096 2.062 2.382 1.02 ± 0.08
pnpr@main 2.177 ± 0.133 2.075 2.499 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.339633704820001,
      "stddev": 0.03855826532185596,
      "median": 4.34371196942,
      "user": 3.8671927599999996,
      "system": 3.48555398,
      "min": 4.2668053629200005,
      "max": 4.41304970792,
      "times": [
        4.32217714092,
        4.2668053629200005,
        4.41304970792,
        4.314881890920001,
        4.35158490392,
        4.35524019292,
        4.33583903492,
        4.36560576992,
        4.31739500892,
        4.35375803492
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 4.3425235120200005,
      "stddev": 0.039831978088414134,
      "median": 4.342217419920001,
      "user": 3.86792376,
      "system": 3.4478687800000003,
      "min": 4.27235210192,
      "max": 4.41290007292,
      "times": [
        4.35495919292,
        4.41290007292,
        4.353203890920001,
        4.32041140992,
        4.27235210192,
        4.32470539292,
        4.30974346992,
        4.3847819899200005,
        4.33123094892,
        4.360946649920001
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 2.21537623382,
      "stddev": 0.0955581200683984,
      "median": 2.2084268399199996,
      "user": 2.5296765599999995,
      "system": 2.99126768,
      "min": 2.06245819792,
      "max": 2.38180261492,
      "times": [
        2.14959655492,
        2.38180261492,
        2.21529779192,
        2.06245819792,
        2.3420392139199997,
        2.15902855492,
        2.2015558879199997,
        2.2527317559199997,
        2.24515996992,
        2.1440917959199997
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 2.1766260694199993,
      "stddev": 0.13257789030589667,
      "median": 2.12908695492,
      "user": 2.54093746,
      "system": 2.98180918,
      "min": 2.0751958729199997,
      "max": 2.49902483692,
      "times": [
        2.0751958729199997,
        2.0900109039199997,
        2.29580035392,
        2.08659195092,
        2.0832890419199996,
        2.49902483692,
        2.17331019392,
        2.12160053092,
        2.1365733789199997,
        2.2048636299199997
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.429 ± 0.012 1.402 1.445 2.06 ± 0.04
pacquet@main 1.477 ± 0.088 1.417 1.723 2.13 ± 0.13
pnpr@HEAD 0.694 ± 0.013 0.681 0.719 1.00
pnpr@main 0.694 ± 0.031 0.677 0.779 1.00 ± 0.05
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.4288119647800002,
      "stddev": 0.012422601133273042,
      "median": 1.43181182468,
      "user": 1.42779672,
      "system": 1.7297457799999996,
      "min": 1.4024989026799999,
      "max": 1.44476201168,
      "times": [
        1.41594801668,
        1.43242958868,
        1.43585497768,
        1.43119406068,
        1.4024989026799999,
        1.44095731168,
        1.44476201168,
        1.43328885168,
        1.42243185168,
        1.42875407468
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 1.47651304008,
      "stddev": 0.08807159060186222,
      "median": 1.4547356331799999,
      "user": 1.4321388199999996,
      "system": 1.7593058799999999,
      "min": 1.4167650866800001,
      "max": 1.72263385268,
      "times": [
        1.43765273768,
        1.4167650866800001,
        1.72263385268,
        1.47307559168,
        1.4514631736799999,
        1.44192738268,
        1.46661899668,
        1.46090184068,
        1.45800809268,
        1.43608364568
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.6939585959800001,
      "stddev": 0.012533040358059664,
      "median": 0.69078442218,
      "user": 0.37197572,
      "system": 1.3074740799999998,
      "min": 0.68054378668,
      "max": 0.71912541968,
      "times": [
        0.68054378668,
        0.69379979768,
        0.70873038168,
        0.68211571068,
        0.68638155268,
        0.71912541968,
        0.69241137468,
        0.68915746968,
        0.7025722656800001,
        0.6847482006800001
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.6940033342799999,
      "stddev": 0.03088367345014379,
      "median": 0.6854494546800001,
      "user": 0.37208791999999996,
      "system": 1.30816768,
      "min": 0.67660240468,
      "max": 0.7794077486800001,
      "times": [
        0.7002711206800001,
        0.6792374236800001,
        0.68496158768,
        0.67685424468,
        0.67853691468,
        0.6901677846800001,
        0.68593732168,
        0.67660240468,
        0.7794077486800001,
        0.68805679168
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 3.158 ± 0.051 3.113 3.270 4.56 ± 0.13
pacquet@main 3.148 ± 0.034 3.118 3.236 4.54 ± 0.12
pnpr@HEAD 0.709 ± 0.014 0.689 0.727 1.02 ± 0.03
pnpr@main 0.693 ± 0.016 0.681 0.736 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 3.1581018501600004,
      "stddev": 0.051346289508623785,
      "median": 3.14149092846,
      "user": 1.88621694,
      "system": 2.05629442,
      "min": 3.11260080046,
      "max": 3.27004834346,
      "times": [
        3.12425025646,
        3.2157617694600003,
        3.15711937446,
        3.12345290246,
        3.11260080046,
        3.12586248246,
        3.11329867946,
        3.27004834346,
        3.16049533846,
        3.17812855446
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 3.14832802486,
      "stddev": 0.033964469127597215,
      "median": 3.1395558764600002,
      "user": 1.8987634399999997,
      "system": 2.01569732,
      "min": 3.11805120546,
      "max": 3.23592475946,
      "times": [
        3.13936871846,
        3.13974303446,
        3.11805120546,
        3.15377156946,
        3.12880645546,
        3.13155335746,
        3.12659005546,
        3.23592475946,
        3.14074168646,
        3.1687294064600002
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.70883595636,
      "stddev": 0.013646436431616255,
      "median": 0.71271759296,
      "user": 0.36917874,
      "system": 1.32112352,
      "min": 0.6894711924600001,
      "max": 0.7268531514600001,
      "times": [
        0.6978287174600001,
        0.69147115146,
        0.71707321546,
        0.6894711924600001,
        0.7268531514600001,
        0.7111244294600001,
        0.6975121284600001,
        0.7143107564600001,
        0.7192535804600001,
        0.72346124046
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.6931774510600002,
      "stddev": 0.01593771618209017,
      "median": 0.6894502044600002,
      "user": 0.38032824,
      "system": 1.29878362,
      "min": 0.6808999914600001,
      "max": 0.7362494664600001,
      "times": [
        0.6808999914600001,
        0.68214254346,
        0.6925516904600001,
        0.69329542046,
        0.68295144346,
        0.68891207046,
        0.69587147546,
        0.7362494664600001,
        0.6891495674600001,
        0.6897508414600001
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 679.1 ± 7.4 660.6 686.3 6.29 ± 0.08
pacquet@main 678.5 ± 10.0 658.5 694.3 6.29 ± 0.10
pnpr@HEAD 108.1 ± 1.2 106.5 111.4 1.00 ± 0.01
pnpr@main 107.9 ± 0.8 106.4 110.1 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.6790669401,
      "stddev": 0.007420137439787416,
      "median": 0.6813912884,
      "user": 0.64890264,
      "system": 0.15138533999999998,
      "min": 0.6605827164,
      "max": 0.6863146574,
      "times": [
        0.6742780274,
        0.6850684894,
        0.6863146574,
        0.6829032544,
        0.6767905664,
        0.6795674214,
        0.6823816914,
        0.6809247514,
        0.6818578254000001,
        0.6605827164
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.6784590761,
      "stddev": 0.010029797237391381,
      "median": 0.6797293499,
      "user": 0.64430794,
      "system": 0.15691703999999998,
      "min": 0.6584990414,
      "max": 0.6943449874000001,
      "times": [
        0.6943449874000001,
        0.6584990414,
        0.6854094654,
        0.6757984774,
        0.6863579114,
        0.6822183574,
        0.6788529314,
        0.6739020004,
        0.6686018204,
        0.6806057684
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.10806345728,
      "stddev": 0.0012313631967808178,
      "median": 0.1078646624,
      "user": 0.028193219999999998,
      "system": 0.020033200000000004,
      "min": 0.10652775440000001,
      "max": 0.1113635994,
      "times": [
        0.1066076354,
        0.1078621874,
        0.10851607840000001,
        0.1082866754,
        0.1072984364,
        0.10789877540000001,
        0.1073319184,
        0.1080149654,
        0.10718170540000001,
        0.1078646624,
        0.1097979214,
        0.1068508524,
        0.1088680214,
        0.10652775440000001,
        0.1073557524,
        0.1073031554,
        0.1071958534,
        0.1082959334,
        0.1095325924,
        0.1113635994,
        0.1107019374,
        0.10673899640000001,
        0.1083613714,
        0.1073063644,
        0.1085232864
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.10788114676,
      "stddev": 0.0007806707485795407,
      "median": 0.1077956764,
      "user": 0.028050699999999994,
      "system": 0.01993496,
      "min": 0.1063768344,
      "max": 0.1101363134,
      "times": [
        0.1101363134,
        0.1063768344,
        0.1073032184,
        0.1085657664,
        0.1073882684,
        0.1067996704,
        0.10844560040000001,
        0.1076012704,
        0.1081429004,
        0.1076654684,
        0.1082121404,
        0.1082486094,
        0.1068037584,
        0.1086336374,
        0.1083481434,
        0.1076839284,
        0.1069518874,
        0.1077956764,
        0.1077791054,
        0.1083650484,
        0.1087069324,
        0.1074522294,
        0.1080418024,
        0.1074038454,
        0.1081766134
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 6.952 ± 0.192 6.796 7.402 1.39 ± 0.04
pacquet@main 6.946 ± 0.112 6.804 7.141 1.39 ± 0.03
pnpr@HEAD 5.064 ± 0.102 4.923 5.196 1.01 ± 0.03
pnpr@main 5.009 ± 0.075 4.911 5.141 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 6.952087890179999,
      "stddev": 0.19243113019760405,
      "median": 6.90518311698,
      "user": 4.092297479999999,
      "system": 3.8694227399999996,
      "min": 6.79647153298,
      "max": 7.4015597819800005,
      "times": [
        6.79819087798,
        6.84730494798,
        6.94305748998,
        6.87822962798,
        6.93213660598,
        7.16333102598,
        6.95611648698,
        7.4015597819800005,
        6.804480523980001,
        6.79647153298
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 6.946496826880001,
      "stddev": 0.11203245787895025,
      "median": 6.971124079480001,
      "user": 4.103005779999998,
      "system": 3.8745256399999994,
      "min": 6.80395187498,
      "max": 7.14099260598,
      "times": [
        7.14099260598,
        6.84673086698,
        7.04621520498,
        6.9541588689800005,
        6.9880892899800005,
        6.810922890980001,
        7.00883506298,
        7.00489588498,
        6.80395187498,
        6.86017571798
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 5.06384425378,
      "stddev": 0.10248320700197114,
      "median": 5.0865337874800005,
      "user": 2.8167762799999996,
      "system": 3.3121385399999994,
      "min": 4.92332257498,
      "max": 5.19555852698,
      "times": [
        5.159597803980001,
        4.96231718398,
        4.92332257498,
        5.09177175898,
        5.19555852698,
        4.93153608498,
        5.1228920569800005,
        4.99854308298,
        5.08129581598,
        5.17160764798
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 5.00885076048,
      "stddev": 0.07511937714335044,
      "median": 4.998401164980001,
      "user": 2.80652778,
      "system": 3.35515214,
      "min": 4.91117512698,
      "max": 5.14138882398,
      "times": [
        4.99578589498,
        5.13330035598,
        4.99018189498,
        5.14138882398,
        5.00101643498,
        5.00352431998,
        4.91117512698,
        4.9322595189800005,
        4.9675644099800005,
        5.01231082398
      ]
    }
  ]
}

@github-actions

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Branchpr/12924
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
4,339.63 ms
(+1.66%)Baseline: 4,268.93 ms
5,122.72 ms
(84.71%)
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
🚷 view threshold
3,158.10 ms
(+3.74%)Baseline: 3,044.19 ms
3,653.03 ms
(86.45%)
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
🚷 view threshold
1,428.81 ms
(+4.56%)Baseline: 1,366.52 ms
1,639.82 ms
(87.13%)
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
🚷 view threshold
679.07 ms
(+4.33%)Baseline: 650.88 ms
781.05 ms
(86.94%)
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
🚷 view threshold
4,234.77 ms
(+2.96%)Baseline: 4,113.02 ms
4,935.63 ms
(85.80%)
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
🚷 view threshold
6,952.09 ms
(-0.09%)Baseline: 6,958.41 ms
8,350.10 ms
(83.26%)
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
🚷 view threshold
691.42 ms
(+7.95%)Baseline: 640.53 ms
768.63 ms
(89.96%)
🐰 View full continuous benchmarking report in Bencher

@github-actions

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Branchpr/12924
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
2,215.38 ms
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
708.84 ms
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
693.96 ms
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
⚠️ NO THRESHOLD
108.06 ms
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
2,173.18 ms
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
⚠️ NO THRESHOLD
5,063.84 ms
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
744.32 ms
🐰 View full continuous benchmarking report in Bencher

…r deps

The inject_workspace_packages e2e tests pinned the importer-section
refs in the <name>@file:<path>(peers) alias form. That form is now
reserved for renamed deps; when the alias equals the package name the
lockfile records the plain file:<path>(peers) ref, matching pnpm v11.

Co-Authored-By: Claude Fable 5 <[email protected]>
Copilot AI review requested due to automatic review settings July 10, 2026 23:07

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 2190e49

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

Auto-approved notes - no code suggestions found
- 'approve_pr_on_self_review' flag enabled

Copilot AI review requested due to automatic review settings July 10, 2026 23:34

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 3b4b81d

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

Auto-approved notes - no code suggestions found
- 'approve_pr_on_self_review' flag enabled

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.45%. Comparing base (6a85968) to head (3b4b81d).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12924      +/-   ##
==========================================
+ Coverage   85.43%   85.45%   +0.01%     
==========================================
  Files         474      474              
  Lines       74546    74553       +7     
==========================================
+ Hits        63691    63706      +15     
+ Misses      10855    10847       -8     

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

@zkochan
zkochan merged commit 7da1dfc into main Jul 11, 2026
28 of 31 checks passed
@zkochan
zkochan deleted the fix/plain-file-refs-for-same-name-importer-deps branch July 11, 2026 00:18
zkochan added a commit to zkochan/bit that referenced this pull request Jul 11, 2026
Carries the plain file: importer-ref serialization fix (pnpm/pnpm#12924),
which resolves the bit tag crash in the lockfile-to-graph converter
(Cannot read properties of undefined) under BIT_FEATURES=deps-graph.

Co-Authored-By: Claude Fable 5 <[email protected]>
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.

3 participants