Skip to content

fix(pacquet): resolve versionless workspace packages - #12940

Merged
zkochan merged 3 commits into
pnpm:mainfrom
sensei-woo:codex/fix-versionless-workspace-packages
Jul 13, 2026
Merged

zkochan merged 3 commits into
pnpm:mainfrom
sensei-woo:codex/fix-versionless-workspace-packages

Conversation

@sensei-woo

@sensei-woo sensei-woo commented Jul 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

pnpm 12's Rust workspace map currently drops every named workspace project whose package.json has no version. A dependency such as sa: workspace:* then fails with a misleading "no package named sa" error.

pnpm 11 intentionally treats a named, versionless workspace package as version 0.0.0 (see #2648 and #2678). This PR restores that behavior in the Rust implementation and covers both workspace:* and workspace:0.0.0 while injectWorkspacePackages is enabled. Malformed non-string versions remain excluded instead of being coerced to 0.0.0.

Squash Commit Body

Index named workspace projects without a version under 0.0.0 instead of dropping them from the workspace package map. This restores pnpm 11 behavior for private/versionless workspace packages and allows workspace:* and workspace:0.0.0 dependencies to resolve in injected workspaces.

Related to #2648 and #2678.

Verification

  • Regression reproduced with published [email protected]
  • Focused positive CLI E2E fails before the fix and passed afterward
  • Added a source-reviewed negative E2E proving a malformed non-string version is not treated as 0.0.0
  • Targeted E2E: passed
  • Targeted Clippy with warnings denied on the pinned Rust 1.95 toolchain: passed
  • Formatting, typos, and git diff --check: passed
  • pnpm 11.11 and the fixed Rust implementation produce matching injected lockfile shapes
  • A post-review cold rebuild stopped on local disk exhaustion before the two E2Es ran; CI will rerun them from scratch

Checklist

  • No TypeScript change is needed; the pnpm 11 engine already uses 0.0.0 for versionless workspace packages.
  • No changeset is included because this is a pacquet-only PR.
  • Added regression coverage.
  • No documentation change is needed.

Summary by CodeRabbit

  • Bug Fixes

    • Workspace packages missing a version, or explicitly set to null, are now recognized during installation.
    • Workspace dependency specs for private packages now resolve reliably when versions are omitted.
    • If a workspace package has a malformed (non-string) version, installation fails safely with a clear error message instead of proceeding with incorrect resolution.
  • Tests

    • Added integration coverage for workspace dependency resolution and for failing on invalid version declarations.

@sensei-woo
sensei-woo requested a review from zkochan as a code owner July 11, 2026 10:49
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@coderabbitai

coderabbitai Bot commented Jul 11, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@zkochan, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 5 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 3d5b5e9f-719b-4797-b338-a2b05368f927

📥 Commits

Reviewing files that changed from the base of the PR and between 2c15d0c and 61d435f.

📒 Files selected for processing (3)
  • .changeset/pacquet-versionless-workspace-packages.md
  • pnpm/crates/cli/tests/workspace_install.rs
  • pnpm/crates/package-manager/src/install.rs
📝 Walkthrough

Walkthrough

Workspace package indexing now defaults omitted or null versions to 0.0.0 while rejecting malformed non-string versions. New integration tests cover private package resolution and invalid workspace version handling.

Changes

Workspace version handling

Layer / File(s) Summary
Workspace package indexing
pnpm/crates/package-manager/src/install.rs
Workspace projects with missing or null versions are indexed as 0.0.0; projects with missing names or malformed non-string versions are skipped.
Workspace resolution integration tests
pnpm/crates/cli/tests/workspace_install.rs
Tests verify workspace:* and workspace:0.0.0 resolve a private versionless package, and that a non-string version produces the expected installation error.

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

Suggested labels: product: pacquet

Suggested reviewers: zkochan, qodo-code-review

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

❤️ Share

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

@greptile-apps

greptile-apps Bot commented Jul 11, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

Safe to merge. The change is a focused three-arm match replacing the previous two-field destructure, with no side effects beyond correctly populating the workspace map for versionless packages.

The fix is minimal and surgical. The new behavior (index missing/null versions as 0.0.0, skip non-string versions) is consistent with documented pnpm 11 behavior, covered by two integration tests targeting both the happy path and the negative/malformed case, and the doc comment is updated to match.

No files require special attention.

Reviews (4): Last reviewed commit: "chore(pacquet): add changeset for versio..." | Re-trigger Greptile

@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 (2)
pnpm/crates/package-manager/src/install.rs (1)

2494-2501: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Simplify the version match by treating null as the default case.

The two 0.0.0 arms (None and Some(value) if value.is_null()) can be collapsed into a single default arm, reducing duplication.

♻️ Suggested refactor
-        let version = match project.manifest.value().get("version") {
-            None => "0.0.0".to_string(),
-            Some(value) if value.is_null() => "0.0.0".to_string(),
-            Some(value) => {
-                let Some(version) = value.as_str() else { continue };
-                version.to_string()
-            }
-        };
+        let version = match project.manifest.value().get("version") {
+            Some(value) if !value.is_null() => {
+                let Some(version) = value.as_str() else { continue };
+                version.to_string()
+            }
+            _ => "0.0.0".to_string(),
+        };
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pnpm/crates/package-manager/src/install.rs` around lines 2494 - 2501, Update
the version extraction match in the manifest processing flow to combine the None
and null-value cases into one default arm returning "0.0.0". Preserve the
existing string conversion for non-null values and continue behavior for
non-string versions.
pnpm/crates/cli/tests/workspace_install.rs (1)

238-309: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Consider adding a test for the null version case.

The implementation handles Some(value) if value.is_null() => "0.0.0" (line 2496 in install.rs) as a distinct branch from missing version (None). The current tests cover missing version and non-string version, but not an explicit "version": null in package.json. A quick additional fixture or variant would close that gap.

🤖 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/workspace_install.rs` around lines 238 - 309, Extend
workspace_specs_resolve_a_versionless_private_package to explicitly set
"version": null in the private package fixture, or add a focused variant
covering that input. Keep the existing assertions for workspace:* and
workspace:0.0.0 resolution, ensuring the null-version path resolves to the same
expected file dependency.
🤖 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/workspace_install.rs`:
- Around line 238-309: Extend
workspace_specs_resolve_a_versionless_private_package to explicitly set
"version": null in the private package fixture, or add a focused variant
covering that input. Keep the existing assertions for workspace:* and
workspace:0.0.0 resolution, ensuring the null-version path resolves to the same
expected file dependency.

In `@pnpm/crates/package-manager/src/install.rs`:
- Around line 2494-2501: Update the version extraction match in the manifest
processing flow to combine the None and null-value cases into one default arm
returning "0.0.0". Preserve the existing string conversion for non-null values
and continue behavior for non-string versions.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: ddabf1d0-9920-4f87-81a2-9c02eff4464e

📥 Commits

Reviewing files that changed from the base of the PR and between 98722fa and 9427e55.

📒 Files selected for processing (2)
  • pnpm/crates/cli/tests/workspace_install.rs
  • pnpm/crates/package-manager/src/install.rs

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

github-actions Bot commented Jul 11, 2026 •

Copy link
Copy Markdown
Contributor

Integrated-Benchmark Report (Linux)

Commit: 2c15d0c7cb16

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.110 ± 0.128 3.940 4.390 1.87 ± 0.11
pacquet@main 4.070 ± 0.100 3.962 4.298 1.85 ± 0.10
pnpr@HEAD 2.230 ± 0.114 2.036 2.382 1.02 ± 0.07
pnpr@main 2.194 ± 0.110 2.064 2.361 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.10973275008,
      "stddev": 0.1284221516723707,
      "median": 4.089070940979999,
      "user": 3.9223883799999997,
      "system": 3.5713270799999997,
      "min": 3.94024339348,
      "max": 4.38957875148,
      "times": [
        4.14962596848,
        4.13719698248,
        4.07199928648,
        4.10614259548,
        4.38957875148,
        3.94024339348,
        3.97228288148,
        4.06257415248,
        4.22138736548,
        4.0462961234799995
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 4.07045333498,
      "stddev": 0.09984979469918978,
      "median": 4.039401122479999,
      "user": 3.87340458,
      "system": 3.570415079999999,
      "min": 3.96246173048,
      "max": 4.29756281448,
      "times": [
        4.01376299248,
        4.08300168848,
        3.99045570048,
        4.04681606548,
        4.03198617948,
        4.29756281448,
        3.96246173048,
        4.07995002048,
        4.17966971148,
        4.01886644648
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 2.2304006531799994,
      "stddev": 0.11375655881452792,
      "median": 2.22716711248,
      "user": 2.69903198,
      "system": 3.0786231799999997,
      "min": 2.03637254148,
      "max": 2.3815016604799997,
      "times": [
        2.03637254148,
        2.14681722448,
        2.34829207648,
        2.3516276434799996,
        2.18587008448,
        2.3815016604799997,
        2.28291810148,
        2.17961891448,
        2.26846414048,
        2.12252414448
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 2.19440697298,
      "stddev": 0.10954280790397321,
      "median": 2.15480688698,
      "user": 2.69782788,
      "system": 3.07064358,
      "min": 2.06432070948,
      "max": 2.36050783348,
      "times": [
        2.36050783348,
        2.2716332914799997,
        2.16631748948,
        2.31383944848,
        2.0726797644799997,
        2.10607996748,
        2.06432070948,
        2.31111548148,
        2.14329628448,
        2.13427945948
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 679.8 ± 11.2 657.5 692.8 1.00
pacquet@main 704.0 ± 96.1 650.7 973.8 1.04 ± 0.14
pnpr@HEAD 742.6 ± 72.8 697.4 943.3 1.09 ± 0.11
pnpr@main 740.0 ± 34.6 695.7 818.3 1.09 ± 0.05
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.6797985200400001,
      "stddev": 0.011199221043502391,
      "median": 0.68008740184,
      "user": 0.39375263999999993,
      "system": 1.37039954,
      "min": 0.65751867584,
      "max": 0.6928100838400001,
      "times": [
        0.6899228178400001,
        0.6784847498400001,
        0.6928100838400001,
        0.6809661318400001,
        0.67325625984,
        0.6873835338400001,
        0.6905344358400001,
        0.67920867184,
        0.65751867584,
        0.66789983984
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.70399534794,
      "stddev": 0.09612257341293248,
      "median": 0.67499578234,
      "user": 0.41712914,
      "system": 1.3612085399999998,
      "min": 0.65065124584,
      "max": 0.97384341484,
      "times": [
        0.69147891784,
        0.6567449038400001,
        0.67468496584,
        0.67530659884,
        0.65065124584,
        0.7002753378400001,
        0.67172261984,
        0.6867137358400001,
        0.65853173884,
        0.97384341484
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.74256983644,
      "stddev": 0.07276937600401122,
      "median": 0.7181485053400001,
      "user": 0.42040254,
      "system": 1.3717475399999999,
      "min": 0.6974289168400001,
      "max": 0.9433262468400001,
      "times": [
        0.70776524484,
        0.71714794784,
        0.7371148858400001,
        0.7158673548400001,
        0.7216272398400001,
        0.70527842484,
        0.71914906284,
        0.6974289168400001,
        0.9433262468400001,
        0.76099303984
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.7399997866400001,
      "stddev": 0.0346105561646211,
      "median": 0.7285930683400001,
      "user": 0.42297183999999993,
      "system": 1.3901311399999998,
      "min": 0.6957315538400001,
      "max": 0.8183106748400001,
      "times": [
        0.6957315538400001,
        0.77314108784,
        0.7295882518400001,
        0.7275978848400001,
        0.7353237908400001,
        0.7267270708400001,
        0.8183106748400001,
        0.71395260484,
        0.7548396968400001,
        0.72478524984
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.389 ± 0.048 4.321 4.461 1.95 ± 0.13
pacquet@main 4.289 ± 0.059 4.237 4.445 1.91 ± 0.12
pnpr@HEAD 2.247 ± 0.144 2.102 2.466 1.00
pnpr@main 2.258 ± 0.147 2.037 2.453 1.00 ± 0.09
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.38893368868,
      "stddev": 0.048485509964765056,
      "median": 4.38435589218,
      "user": 3.9119828399999994,
      "system": 3.4724752199999998,
      "min": 4.32115453918,
      "max": 4.46075489918,
      "times": [
        4.3712678151799995,
        4.41026241018,
        4.39744396918,
        4.32115453918,
        4.42540182118,
        4.46075489918,
        4.37071191818,
        4.44927183018,
        4.36115195318,
        4.32191573118
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 4.28878262238,
      "stddev": 0.05870749517920017,
      "median": 4.27479236768,
      "user": 3.7760527399999995,
      "system": 3.4323676199999995,
      "min": 4.23673810118,
      "max": 4.44458482118,
      "times": [
        4.26996927218,
        4.29034338118,
        4.25430956018,
        4.44458482118,
        4.31106790118,
        4.28496012618,
        4.26090988618,
        4.27961546318,
        4.23673810118,
        4.25532771118
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 2.2467001100799995,
      "stddev": 0.14353248276366753,
      "median": 2.18110439818,
      "user": 2.57977694,
      "system": 2.97517812,
      "min": 2.10201578518,
      "max": 2.4657714191799998,
      "times": [
        2.14448391218,
        2.41932471218,
        2.1555650861799998,
        2.4657714191799998,
        2.1404258071799998,
        2.10201578518,
        2.46338723118,
        2.18038593718,
        2.18182285918,
        2.21381835118
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 2.25789624428,
      "stddev": 0.14737354876603412,
      "median": 2.2626091321799997,
      "user": 2.52469244,
      "system": 2.9782043199999997,
      "min": 2.0372483941799997,
      "max": 2.45258763418,
      "times": [
        2.03981821918,
        2.31639929318,
        2.45258763418,
        2.27063395518,
        2.19204381118,
        2.2545843091799997,
        2.3831159781799998,
        2.44055572518,
        2.0372483941799997,
        2.1919751231799998
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.400 ± 0.013 1.390 1.428 2.06 ± 0.14
pacquet@main 1.432 ± 0.063 1.388 1.607 2.10 ± 0.17
pnpr@HEAD 0.681 ± 0.046 0.651 0.805 1.00
pnpr@main 0.700 ± 0.080 0.665 0.926 1.03 ± 0.14
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.39955400606,
      "stddev": 0.012601704002875214,
      "median": 1.3934365356599998,
      "user": 1.3426578,
      "system": 1.7408768,
      "min": 1.3896122661599999,
      "max": 1.42847922416,
      "times": [
        1.39286255416,
        1.39401051716,
        1.39152361016,
        1.39024835016,
        1.40231532216,
        1.40119727016,
        1.39174381616,
        1.3896122661599999,
        1.41354713016,
        1.42847922416
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 1.43180207196,
      "stddev": 0.06251383390793025,
      "median": 1.41231525116,
      "user": 1.3967096999999997,
      "system": 1.7484042,
      "min": 1.38774677616,
      "max": 1.60695342016,
      "times": [
        1.38774677616,
        1.4103877361600001,
        1.60695342016,
        1.41135728116,
        1.43238343316,
        1.41242166916,
        1.41381816816,
        1.41021322316,
        1.41220883316,
        1.42053017916
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.68053193586,
      "stddev": 0.045626473438601815,
      "median": 0.66608892516,
      "user": 0.3509895,
      "system": 1.2905517999999998,
      "min": 0.65071980216,
      "max": 0.80525349716,
      "times": [
        0.65558428216,
        0.65981107516,
        0.66596659416,
        0.6932582701600001,
        0.68006912616,
        0.80525349716,
        0.66621125616,
        0.6722420691600001,
        0.65071980216,
        0.6562033861600001
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.6997306700599999,
      "stddev": 0.08000173092994516,
      "median": 0.67097667666,
      "user": 0.36283220000000005,
      "system": 1.2971238999999999,
      "min": 0.66454363116,
      "max": 0.92585196116,
      "times": [
        0.66663902416,
        0.6701017111600001,
        0.67044648716,
        0.67150686616,
        0.66454363116,
        0.66716840416,
        0.6933247731600001,
        0.6830026181600001,
        0.92585196116,
        0.68472122416
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 3.047 ± 0.025 3.004 3.079 4.54 ± 0.07
pacquet@main 3.077 ± 0.030 3.038 3.144 4.58 ± 0.07
pnpr@HEAD 0.671 ± 0.008 0.658 0.687 1.00
pnpr@main 0.685 ± 0.029 0.660 0.762 1.02 ± 0.04
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 3.0466021697400003,
      "stddev": 0.025041008296342718,
      "median": 3.05505085954,
      "user": 1.7770822799999997,
      "system": 1.98398784,
      "min": 3.00408901654,
      "max": 3.07894724954,
      "times": [
        3.06614586154,
        3.02837152954,
        3.05345909554,
        3.05664262354,
        3.06928952554,
        3.06181076254,
        3.03158835454,
        3.01567767854,
        3.07894724954,
        3.00408901654
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 3.0765684390400003,
      "stddev": 0.029929695616183586,
      "median": 3.07595194854,
      "user": 1.81187998,
      "system": 2.00748324,
      "min": 3.03807266854,
      "max": 3.14394658854,
      "times": [
        3.14394658854,
        3.0681683945400002,
        3.09922946254,
        3.08318522754,
        3.07781435154,
        3.04478115654,
        3.07408954554,
        3.07947315354,
        3.03807266854,
        3.05692384154
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.6713576022400001,
      "stddev": 0.008024564569384846,
      "median": 0.6720368675400001,
      "user": 0.33853558,
      "system": 1.2965292400000001,
      "min": 0.6584870525400001,
      "max": 0.6874612935400001,
      "times": [
        0.6874612935400001,
        0.66620335454,
        0.66317136054,
        0.6705327765400001,
        0.67475467454,
        0.67529753954,
        0.67576990554,
        0.6584870525400001,
        0.66835710654,
        0.6735409585400001
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.68521305054,
      "stddev": 0.02897051930390544,
      "median": 0.6798399510400001,
      "user": 0.35562108000000003,
      "system": 1.29997084,
      "min": 0.65966626354,
      "max": 0.7623199685400001,
      "times": [
        0.6835570145400001,
        0.67526941454,
        0.66570357654,
        0.66712529054,
        0.65966626354,
        0.6840818325400001,
        0.69309894254,
        0.67612288754,
        0.6851853145400001,
        0.7623199685400001
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 675.7 ± 13.4 659.2 699.6 6.18 ± 0.16
pacquet@main 683.9 ± 10.3 666.1 700.7 6.26 ± 0.14
pnpr@HEAD 109.3 ± 1.8 107.3 112.3 1.00
pnpr@main 109.4 ± 2.0 107.4 114.0 1.00 ± 0.02
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.6757128720000001,
      "stddev": 0.013435208016425905,
      "median": 0.6773858074000001,
      "user": 0.6454428999999999,
      "system": 0.1523387,
      "min": 0.6592016629,
      "max": 0.6995820069,
      "times": [
        0.6776340309000001,
        0.6683046899,
        0.6787435359,
        0.6610187309000001,
        0.6995820069,
        0.6778359229,
        0.6942053299000001,
        0.6634652259,
        0.6592016629,
        0.6771375839
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.6839061035000001,
      "stddev": 0.010260275520062156,
      "median": 0.6822093359000001,
      "user": 0.6495654999999999,
      "system": 0.1564232,
      "min": 0.6660585179,
      "max": 0.7007442839,
      "times": [
        0.6830128049,
        0.6837447889,
        0.6778971439,
        0.6765449319000001,
        0.6660585179,
        0.6808274079000001,
        0.7007442839,
        0.6814058669,
        0.6914313819000001,
        0.6973939069
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.10932115319166667,
      "stddev": 0.0017957049137443761,
      "median": 0.10850513640000001,
      "user": 0.02971335,
      "system": 0.019556324999999996,
      "min": 0.1072742339,
      "max": 0.1122847119,
      "times": [
        0.1115762909,
        0.1119317439,
        0.1072742339,
        0.1088025589,
        0.1080511619,
        0.1121613109,
        0.1079980939,
        0.1080072959,
        0.1072804609,
        0.1100619519,
        0.1114698319,
        0.1079072139,
        0.1122847119,
        0.1080632099,
        0.1078231819,
        0.1077494959,
        0.1088108839,
        0.11117717690000001,
        0.1114330639,
        0.1082077139,
        0.1078270189,
        0.1073886029,
        0.1094079079,
        0.1110125599
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.10941246510833336,
      "stddev": 0.0020400414170334232,
      "median": 0.10845424240000001,
      "user": 0.027625849999999997,
      "system": 0.021175866666666668,
      "min": 0.1073647209,
      "max": 0.1139782199,
      "times": [
        0.1139782199,
        0.1106511859,
        0.1115164289,
        0.1094523299,
        0.1111883329,
        0.1076911819,
        0.1080980349,
        0.1074567389,
        0.1074948109,
        0.1099577929,
        0.1128664119,
        0.1100623179,
        0.1079897469,
        0.1081631059,
        0.1091049159,
        0.1128956709,
        0.1121422769,
        0.1075089199,
        0.1084186099,
        0.1073647209,
        0.1084898749,
        0.1077483299,
        0.1075011129,
        0.1081580909
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 6.953 ± 0.086 6.765 7.059 1.38 ± 0.03
pacquet@main 6.961 ± 0.201 6.762 7.408 1.38 ± 0.05
pnpr@HEAD 5.056 ± 0.104 4.931 5.279 1.00
pnpr@main 5.130 ± 0.079 5.032 5.262 1.01 ± 0.03
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 6.952768914960001,
      "stddev": 0.08648901120716877,
      "median": 6.9455712297600005,
      "user": 4.127502,
      "system": 3.8388779,
      "min": 6.76461602126,
      "max": 7.05871306126,
      "times": [
        6.90464356826,
        7.00973048826,
        7.05871306126,
        6.91862094326,
        6.9449875072600005,
        7.04053154226,
        6.94615495226,
        7.02267033226,
        6.91702073326,
        6.76461602126
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 6.961493303759999,
      "stddev": 0.2005588647795507,
      "median": 6.92347643776,
      "user": 4.0611833,
      "system": 3.8318871000000003,
      "min": 6.76237863126,
      "max": 7.40753995026,
      "times": [
        6.76237863126,
        7.40753995026,
        6.78387261826,
        6.78543735426,
        6.9906498282600005,
        6.94472350926,
        6.83315506726,
        6.90222936626,
        7.10189947726,
        7.10304723526
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 5.0562675847600005,
      "stddev": 0.10363128173547266,
      "median": 5.03326270226,
      "user": 2.8475995999999997,
      "system": 3.2958641999999996,
      "min": 4.93138290126,
      "max": 5.27922203326,
      "times": [
        5.01400252826,
        5.07880272226,
        5.27922203326,
        4.93138290126,
        4.97535832326,
        5.04996101726,
        5.14572439726,
        5.11346738126,
        4.95819015626,
        5.01656438726
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 5.130466223060001,
      "stddev": 0.07857535353165762,
      "median": 5.10769450776,
      "user": 2.8083993,
      "system": 3.3343291,
      "min": 5.03193474826,
      "max": 5.2623405532600005,
      "times": [
        5.07094928726,
        5.19122176926,
        5.03193474826,
        5.23387246726,
        5.07114134626,
        5.06177915526,
        5.16603388826,
        5.10859357326,
        5.2623405532600005,
        5.10679544226
      ]
    }
  ]
}

@github-actions

github-actions Bot commented Jul 11, 2026 •

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Branchpr/12940
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,388.93 ms
(+2.27%)Baseline: 4,291.72 ms
5,150.06 ms
(85.22%)
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
🚷 view threshold
3,046.60 ms
(+0.86%)Baseline: 3,020.75 ms
3,624.90 ms
(84.05%)
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
🚷 view threshold
1,399.55 ms
(+2.97%)Baseline: 1,359.12 ms
1,630.95 ms
(85.81%)
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
🚷 view threshold
675.71 ms
(+5.71%)Baseline: 639.21 ms
767.05 ms
(88.09%)
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
🚷 view threshold
4,109.73 ms
(-0.71%)Baseline: 4,138.96 ms
4,966.75 ms
(82.74%)
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
🚷 view threshold
6,952.77 ms
(-5.46%)Baseline: 7,354.09 ms
8,824.91 ms
(78.79%)
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
🚷 view threshold
679.80 ms
(+4.64%)Baseline: 649.67 ms
779.60 ms
(87.20%)
🐰 View full continuous benchmarking report in Bencher

@github-actions

github-actions Bot commented Jul 11, 2026 •

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Branchpr/12940
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,246.70 ms
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
671.36 ms
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
680.53 ms
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
⚠️ NO THRESHOLD
109.32 ms
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
2,230.40 ms
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
⚠️ NO THRESHOLD
5,056.27 ms
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
742.57 ms
🐰 View full continuous benchmarking report in Bencher

@sensei-woo

Copy link
Copy Markdown
Contributor Author

CI fixes in 2c15d0c: the negative test's stderr assertion now flattens miette's line wrapping before matching (the Windows runner's longer temp path shifted the wrap point into the matched substring — Linux only passed by path-length luck), and the raw string satisfies dylint's avoidable-string-escapes.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.45%. Comparing base (4658133) to head (2c15d0c).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #12940   +/-   ##
=======================================
  Coverage   85.45%   85.45%           
=======================================
  Files         474      474           
  Lines       74561    74565    +4     
=======================================
+ Hits        63714    63721    +7     
+ Misses      10847    10844    -3     

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

The Windows runner's longer temp path shifts miette's wrap point into the
matched substring; flatten the decorated output before matching. The raw
string also satisfies dylint's avoidable-string-escapes lint.
@zkochan
zkochan force-pushed the codex/fix-versionless-workspace-packages branch from 2c15d0c to 0a3c047 Compare July 13, 2026 13:11
@qodo-code-review

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

Copy link
Copy Markdown

Code Review by Qodo

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

Context used
✅ Compliance rules (platform): 18 rules

Grey Divider


Action required

1. Changeset missing pnpm entry 📘 Rule violation § Compliance ⭐ New
Description
The new changeset front-matter lists only pacquet and does not declare a bump for the pnpm
package, which violates the changeset requirement in the compliance checklist. This can lead to
incorrect or incomplete release metadata for pnpm when processing changesets.
Code

.changeset/pacquet-versionless-workspace-packages.md[R1-3]

+---
+"pacquet": patch
+---
Evidence
Compliance ID 713436 requires that newly added/modified changeset files explicitly include a pnpm
entry with a valid bump type. The added changeset front-matter includes only pacquet and therefore
does not meet that requirement.

Rule 713436: Explicitly declare pnpm package and correct bump type in changesets
.changeset/pacquet-versionless-workspace-packages.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 file does not include a `pnpm` entry in its front-matter, but the compliance checklist requires changesets to explicitly declare `pnpm` with a valid bump type.

## Issue Context
This PR adds `.changeset/pacquet-versionless-workspace-packages.md` with only `"pacquet": patch` in the front-matter.

## Fix Focus Areas
- .changeset/pacquet-versionless-workspace-packages.md[1-3]

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



Remediation recommended

2. Silent workspace package overwrite 🐞 Bug ☼ Reliability
Description
build_workspace_packages_map now coerces missing/null versions to "0.0.0" and inserts into a nested
BTreeMap keyed by (name, version), so duplicate (name, "0.0.0") entries overwrite earlier ones
silently and can make workspace:* / workspace:0.0.0 resolve to the wrong project. This ambiguity is
deterministic (workspace projects are sorted by rootDir) but currently undetected, making incorrect
installs hard to diagnose when duplicate names exist or when an explicit "0.0.0" collides with a
versionless project.
Code

pnpm/crates/package-manager/src/install.rs[R2507-2518]

+        let Some(name) = manifest_string_field(&project.manifest, "name") else { continue };
+        let version = match project.manifest.value().get("version") {
+            None => "0.0.0".to_string(),
+            Some(value) if value.is_null() => "0.0.0".to_string(),
+            Some(value) => {
+                let Some(version) = value.as_str() else { continue };
+                version.to_string()
+            }
+        };
        map.entry(name).or_default().insert(
            version,
            pacquet_resolving_resolver_base::WorkspacePackage {
Evidence
The workspace index uses nested BTreeMaps keyed by version string, so inserting the same (name,
version) replaces the prior package. Since workspace discovery sorts projects by rootDir, the
“winner” is deterministic but depends on filesystem layout rather than an explicit rule.

pnpm/crates/package-manager/src/install.rs[2490-2524]
pnpm/crates/resolving-resolver-base/src/resolve.rs[206-216]
pnpm/crates/workspace/src/projects.rs[188-230]
pnpm/crates/resolving-npm-resolver/src/resolve_from_workspace.rs[153-193]

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

## Issue description
`build_workspace_packages_map` indexes versionless/null-version workspace projects under `0.0.0` and inserts them into `WorkspacePackages` (`BTreeMap<name, BTreeMap<version, WorkspacePackage>>`). If two projects share the same `name` and both land on the same effective version key (commonly `0.0.0` after this change), `BTreeMap::insert` will overwrite the earlier entry without warning/error, causing `workspace:*` / `workspace:0.0.0` to resolve to an unintended project.

## Issue Context
Workspace projects are discovered and then sorted lexicographically by their `rootDir` before being returned, so overwrite behavior is deterministic but still silent and surprising.

## Fix Focus Areas
- pnpm/crates/package-manager/src/install.rs[2500-2523]

## Suggested fix
- When inserting `(name, version)` into the nested map, check whether an entry already exists.
 - Preferably: surface a diagnostic error that explains the duplicate workspace identity (name + version) and lists both project root dirs.
 - If changing the function signature to return `Result` is too invasive for this PR, at minimum avoid overwriting (keep-first) and emit a warning via the install reporter (or plumb a warning channel) so the ambiguity is visible.
- Ensure the duplicate check applies to both cases:
 - two versionless projects (both become `0.0.0`)
 - one explicit `"version": "0.0.0"` and one versionless/null project

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


Grey Divider

Previous review results

Review updated until commit 61d435f

Results up to commit 0a3c047


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


Remediation recommended
1. Silent workspace package overwrite 🐞 Bug ☼ Reliability
Description
build_workspace_packages_map now coerces missing/null versions to "0.0.0" and inserts into a nested
BTreeMap keyed by (name, version), so duplicate (name, "0.0.0") entries overwrite earlier ones
silently and can make workspace:* / workspace:0.0.0 resolve to the wrong project. This ambiguity is
deterministic (workspace projects are sorted by rootDir) but currently undetected, making incorrect
installs hard to diagnose when duplicate names exist or when an explicit "0.0.0" collides with a
versionless project.
Code

pnpm/crates/package-manager/src/install.rs[R2507-2518]

+        let Some(name) = manifest_string_field(&project.manifest, "name") else { continue };
+        let version = match project.manifest.value().get("version") {
+            None => "0.0.0".to_string(),
+            Some(value) if value.is_null() => "0.0.0".to_string(),
+            Some(value) => {
+                let Some(version) = value.as_str() else { continue };
+                version.to_string()
+            }
+        };
        map.entry(name).or_default().insert(
            version,
            pacquet_resolving_resolver_base::WorkspacePackage {
Evidence
The workspace index uses nested BTreeMaps keyed by version string, so inserting the same (name,
version) replaces the prior package. Since workspace discovery sorts projects by rootDir, the
“winner” is deterministic but depends on filesystem layout rather than an explicit rule.

pnpm/crates/package-manager/src/install.rs[2490-2524]
pnpm/crates/resolving-resolver-base/src/resolve.rs[206-216]
pnpm/crates/workspace/src/projects.rs[188-230]
pnpm/crates/resolving-npm-resolver/src/resolve_from_workspace.rs[153-193]

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

## Issue description
`build_workspace_packages_map` indexes versionless/null-version workspace projects under `0.0.0` and inserts them into `WorkspacePackages` (`BTreeMap<name, BTreeMap<version, WorkspacePackage>>`). If two projects share the same `name` and both land on the same effective version key (commonly `0.0.0` after this change), `BTreeMap::insert` will overwrite the earlier entry without warning/error, causing `workspace:*` / `workspace:0.0.0` to resolve to an unintended project.

## Issue Context
Workspace projects are discovered and then sorted lexicographically by their `rootDir` before being returned, so overwrite behavior is deterministic but still silent and surprising.

## Fix Focus Areas
- pnpm/crates/package-manager/src/install.rs[2500-2523]

## Suggested fix
- When inserting `(name, version)` into the nested map, check whether an entry already exists.
 - Preferably: surface a diagnostic error that explains the duplicate workspace identity (name + version) and lists both project root dirs.
 - If changing the function signature to return `Result` is too invasive for this PR, at minimum avoid overwriting (keep-first) and emit a warning via the install reporter (or plumb a warning channel) so the ambiguity is visible.
- Ensure the duplicate check applies to both cases:
 - two versionless projects (both become `0.0.0`)
 - one explicit `"version": "0.0.0"` and one versionless/null project

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

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

Comment on lines +1 to +3
---
"pacquet": patch
---

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

1. Changeset missing pnpm entry 📘 Rule violation § Compliance

The new changeset front-matter lists only pacquet and does not declare a bump for the pnpm
package, which violates the changeset requirement in the compliance checklist. This can lead to
incorrect or incomplete release metadata for pnpm when processing changesets.
Agent Prompt
## Issue description
The changeset file does not include a `pnpm` entry in its front-matter, but the compliance checklist requires changesets to explicitly declare `pnpm` with a valid bump type.

## Issue Context
This PR adds `.changeset/pacquet-versionless-workspace-packages.md` with only `"pacquet": patch` in the front-matter.

## Fix Focus Areas
- .changeset/pacquet-versionless-workspace-packages.md[1-3]

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

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 61d435f

@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

@zkochan
zkochan merged commit 73ba110 into pnpm:main Jul 13, 2026
35 of 39 checks passed
@qodo-code-review qodo-code-review Bot mentioned this pull request Nov 5, 2026
5 tasks done
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