Skip to content

fix(pnpr): preserve workspace project metadata - #13016

Closed
YESHYUNGSEOK wants to merge 1 commit into
pnpm:mainfrom
YESHYUNGSEOK:fix/pnpr-workspace-metadata
Closed

YESHYUNGSEOK wants to merge 1 commit into
pnpm:mainfrom
YESHYUNGSEOK:fix/pnpr-workspace-metadata

Conversation

@YESHYUNGSEOK

@YESHYUNGSEOK YESHYUNGSEOK commented Jul 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Important

This branch must incorporate #13066 before this PR can merge. The intended sequence is to merge #13066 into main, then rebase or update this branch onto the latest main so the zizmor security check runs with the shared fix.

Preserve workspace project names and versions when TypeScript pnpm delegates resolution to pnpr.

The TypeScript installer and pnpr client now include each project's identity in the resolve request. The Rust server uses that identity when building temporary manifests, frozen-lockfile input, and resolution cache keys, while retaining the existing synthetic fallbacks for older clients.

Regression tests cover the single-project and workspace request shapes, workspace: name/version matching, compatibility fallbacks, frozen resolution, and cache separation.

Pacquet does not yet support workspace installs, so it has no equivalent multi-project pnpr request to update in this PR. Its current single-project Rust pnpr client remains unchanged; workspace identity forwarding will need to be added when Pacquet workspace support lands.

Squash Commit Body

Forward project names and versions from the TypeScript installer through the pnpr protocol. Use the forwarded identity in temporary manifests, frozen-lockfile resolution, and cache keys so workspace protocol dependencies resolve against the real project metadata.

Keep backward-compatible synthetic name and version fallbacks for clients that omit the new optional fields. Add TypeScript and Rust regression coverage for request encoding, workspace matching, frozen resolution, and cache identity.

Checklist

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

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

Summary by CodeRabbit

  • Bug Fixes
    • Fixed workspace dependency resolution to preserve project names and versions.
    • Improved handling of workspace: dependencies across multi-project workspaces.
    • Prevented resolution cache collisions when projects differ by name or version.
    • Maintained compatibility for projects without identity metadata.

@coderabbitai

coderabbitai Bot commented Jul 15, 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: 6c17d9de-ee2e-48ee-b934-7ad1c5daa5b2

📥 Commits

Reviewing files that changed from the base of the PR and between 566864e and 2e0afc6.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml, !pnpm-lock.yaml
📒 Files selected for processing (11)
  • .changeset/pnpr-workspace-identity.md
  • pnpm11/installing/deps-installer/src/install/index.ts
  • pnpm11/installing/deps-installer/test/install/pnprWorkspaceMetadata.ts
  • pnpr/client/package.json
  • pnpr/client/src/resolveViaPnprServer.ts
  • pnpr/client/test/resolveViaPnprServer.test.ts
  • pnpr/crates/pnpr/src/resolver.rs
  • pnpr/crates/pnpr/src/resolver/protocol.rs
  • pnpr/crates/pnpr/src/resolver/resolve.rs
  • pnpr/crates/pnpr/src/resolver/resolve/tests.rs
  • pnpr/crates/pnpr/src/resolver/tests.rs

📝 Walkthrough

Walkthrough

pnpm now forwards workspace project names and versions through the pnpr client and resolver. Resolver manifests and cache keys incorporate this identity, with TypeScript and Rust tests covering serialization, workspace links, fallback behavior, and cache separation.

Changes

pnpr workspace identity

Layer / File(s) Summary
Client project identity contract
pnpr/client/src/resolveViaPnprServer.ts, pnpr/client/test/*, pnpr/client/package.json
The client accepts and serializes optional project names and versions, while tests cover single-project compatibility, explicit project arrays, and omitted identity fields.
Installer workspace metadata propagation
pnpm11/installing/deps-installer/src/install/index.ts, pnpm11/installing/deps-installer/test/install/pnprWorkspaceMetadata.ts
Install paths forward project identity for single projects and workspace project lists; tests verify names, versions, dependency fields, and relative directories.
Resolver protocol and manifest identity
pnpr/crates/pnpr/src/resolver/protocol.rs, pnpr/crates/pnpr/src/resolver/resolve.rs, pnpr/crates/pnpr/src/resolver.rs, .changeset/pnpr-workspace-identity.md
Resolver request types, generated manifests, and resolution cache keys preserve project names and versions, with fallback values for legacy requests.
Workspace resolution validation
pnpr/crates/pnpr/src/resolver/resolve/tests.rs, pnpr/crates/pnpr/src/resolver/tests.rs
Rust tests cover workspace specifiers, identity fallbacks, legacy projects, workspace links, and cache-key changes.

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

Sequence Diagram(s)

sequenceDiagram
  participant DepsInstaller
  participant PnprClient
  participant PnprResolver
  participant ResolutionCache

  DepsInstaller->>PnprClient: Send project dir, name, version, and dependencies
  PnprClient->>PnprResolver: Serialize resolve request with project identity
  PnprResolver->>ResolutionCache: Build cache key from dir, name, and version
  PnprResolver-->>PnprClient: Return resolved lockfile
  PnprClient-->>DepsInstaller: Return workspace resolution
Loading

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

Suggested reviewers: zkochan, zkochan

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

@github-actions

github-actions Bot commented Jul 15, 2026 •

Copy link
Copy Markdown
Contributor

Integrated-Benchmark Report (Linux)

Commit: 2e0afc615831

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 2.659 ± 0.188 2.418 2.867 1.55 ± 0.19
pacquet@main 2.736 ± 0.225 2.401 3.064 1.59 ± 0.20
pnpr@HEAD 1.720 ± 0.166 1.504 1.938 1.00
pnpr@main 1.825 ± 0.151 1.667 2.145 1.06 ± 0.14
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.6591753696999993,
      "stddev": 0.18765354394855358,
      "median": 2.7496874789,
      "user": 1.93840344,
      "system": 1.4600180600000001,
      "min": 2.4181900804,
      "max": 2.8669142364,
      "times": [
        2.8430962874,
        2.4207415214,
        2.4372671664,
        2.4181900804,
        2.7281973784,
        2.8669142364,
        2.7711775793999998,
        2.7872785384,
        2.5144361934,
        2.8044547154
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.7362221233,
      "stddev": 0.2246414944613712,
      "median": 2.7088911294,
      "user": 2.4639045399999997,
      "system": 1.9203777600000003,
      "min": 2.4011323264,
      "max": 3.0641471613999998,
      "times": [
        2.4011323264,
        2.6079838104,
        2.7176124564,
        2.4749452634,
        2.6021177064,
        2.8785568754,
        2.8816847474,
        3.0641471613999998,
        2.7001698024,
        3.0338710834
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.7202424388000002,
      "stddev": 0.16634341733622038,
      "median": 1.7332852209,
      "user": 1.70928784,
      "system": 1.8706679599999998,
      "min": 1.5042960694,
      "max": 1.9382888764000001,
      "times": [
        1.7498964774,
        1.5162674174,
        1.5288758034,
        1.8133093904000002,
        1.6486891484,
        1.5042960694,
        1.9382888764000001,
        1.7166739644,
        1.9263754953999999,
        1.8597517454
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.8245355650999997,
      "stddev": 0.15112648866069261,
      "median": 1.7844939674,
      "user": 1.9224468399999999,
      "system": 2.1633449600000003,
      "min": 1.6672362444,
      "max": 2.1449060554,
      "times": [
        1.9983922634,
        2.1449060554,
        1.7612517194000001,
        1.8562182003999999,
        1.6672362444,
        1.7209512573999999,
        1.8773607494,
        1.7264906784,
        1.8077362154,
        1.6848122674
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 298.0 ± 37.6 237.3 335.1 1.23 ± 0.17
pacquet@main 246.7 ± 17.8 220.2 277.4 1.01 ± 0.09
pnpr@HEAD 270.0 ± 38.8 231.9 323.0 1.11 ± 0.17
pnpr@main 243.1 ± 14.3 224.3 275.0 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.29800271951999996,
      "stddev": 0.03762272916975763,
      "median": 0.29989565462,
      "user": 0.29544916000000004,
      "system": 0.7409567599999999,
      "min": 0.23729606012,
      "max": 0.33508782612,
      "times": [
        0.28235062012,
        0.28579075012,
        0.31231495412,
        0.33146798912000003,
        0.33320412912,
        0.33437002812,
        0.33508782612,
        0.28747635512,
        0.24066848312,
        0.23729606012
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.24670683602,
      "stddev": 0.017783526550028482,
      "median": 0.24332427962,
      "user": 0.24441796,
      "system": 0.61864406,
      "min": 0.22016610512,
      "max": 0.27741553312,
      "times": [
        0.27741553312,
        0.23009090012,
        0.22016610512,
        0.23909047912,
        0.25338614312,
        0.23529552312,
        0.24082852412,
        0.24582003512,
        0.25364117312,
        0.27133394412
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.26999911962000006,
      "stddev": 0.03878854167870503,
      "median": 0.26872982862,
      "user": 0.25734956000000003,
      "system": 0.65538706,
      "min": 0.23187745512,
      "max": 0.32298361812,
      "times": [
        0.31193799712000003,
        0.29884856912,
        0.29791922312,
        0.29862955812,
        0.32298361812,
        0.23282885312,
        0.23187745512,
        0.23954043412,
        0.23257471512,
        0.23285077312
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.24312488191999998,
      "stddev": 0.01429362583570139,
      "median": 0.24136910762,
      "user": 0.22146675999999998,
      "system": 0.5862584599999999,
      "min": 0.22427826712,
      "max": 0.27495774812,
      "times": [
        0.25061282612,
        0.23658650712,
        0.23461769012,
        0.22427826712,
        0.23016636212,
        0.24304890212,
        0.24219370612,
        0.24054450912,
        0.25424230112,
        0.27495774812
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.855 ± 0.158 2.689 3.223 1.68 ± 0.20
pacquet@main 3.225 ± 0.244 2.767 3.620 1.89 ± 0.24
pnpr@HEAD 1.709 ± 0.173 1.480 1.990 1.00 ± 0.15
pnpr@main 1.704 ± 0.176 1.480 1.876 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.8549073512600005,
      "stddev": 0.1582272494502399,
      "median": 2.8063050467600004,
      "user": 2.02509844,
      "system": 1.54106274,
      "min": 2.68929957926,
      "max": 3.22304104826,
      "times": [
        2.68929957926,
        2.74172919626,
        2.76416683826,
        2.8254718312600002,
        2.91392484826,
        2.73044886226,
        3.22304104826,
        2.97842896226,
        2.89542408426,
        2.78713826226
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 3.2253469228599996,
      "stddev": 0.24380061380494664,
      "median": 3.24345267576,
      "user": 2.7528604399999996,
      "system": 2.03460024,
      "min": 2.76714109726,
      "max": 3.62029428426,
      "times": [
        2.76714109726,
        3.01388304326,
        3.28361911026,
        3.22259166526,
        3.53802389626,
        3.62029428426,
        3.27850826226,
        3.16045230126,
        3.26431368626,
        3.10464188226
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.7092884860599997,
      "stddev": 0.17316769028072992,
      "median": 1.73814606226,
      "user": 1.3765046399999998,
      "system": 1.5228197399999999,
      "min": 1.47959267526,
      "max": 1.9897811972600001,
      "times": [
        1.82728592026,
        1.55517269026,
        1.9897811972600001,
        1.8134999812600001,
        1.82233927026,
        1.8450926492600002,
        1.47959267526,
        1.49903302226,
        1.59829531126,
        1.66279214326
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.70387748546,
      "stddev": 0.17629263677106033,
      "median": 1.7462462782600001,
      "user": 1.44830564,
      "system": 1.6259692399999999,
      "min": 1.47986219126,
      "max": 1.87564781126,
      "times": [
        1.65355459426,
        1.47986219126,
        1.87564781126,
        1.83893796226,
        1.86105011626,
        1.49428631826,
        1.87486943026,
        1.50586428126,
        1.87064977526,
        1.5840523742600001
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 614.9 ± 53.9 553.6 732.1 2.37 ± 0.23
pacquet@main 591.8 ± 16.5 563.9 613.4 2.28 ± 0.11
pnpr@HEAD 259.7 ± 10.0 242.3 272.8 1.00
pnpr@main 288.6 ± 27.0 255.6 334.1 1.11 ± 0.11
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.61486115698,
      "stddev": 0.05387941732715115,
      "median": 0.6046144088800001,
      "user": 0.75232374,
      "system": 0.6888458399999999,
      "min": 0.55356395138,
      "max": 0.73213902438,
      "times": [
        0.61625119238,
        0.59347221638,
        0.6803957433800001,
        0.5862923733800001,
        0.60474874138,
        0.73213902438,
        0.60448007638,
        0.6156467183800001,
        0.55356395138,
        0.56162153238
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.59180369448,
      "stddev": 0.016513897680037352,
      "median": 0.59677797938,
      "user": 0.7365571399999999,
      "system": 0.66349334,
      "min": 0.56391902638,
      "max": 0.6134129433800001,
      "times": [
        0.5888253293800001,
        0.5767317793800001,
        0.6134129433800001,
        0.59734574038,
        0.5992014143800001,
        0.6029270803800001,
        0.59621021838,
        0.57053981038,
        0.56391902638,
        0.6089236023800001
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.25973900557999996,
      "stddev": 0.010031545590294077,
      "median": 0.26019136588,
      "user": 0.18432473999999996,
      "system": 0.5636994399999999,
      "min": 0.24227334738000003,
      "max": 0.27279801138000004,
      "times": [
        0.26819639938,
        0.27279801138000004,
        0.24227334738000003,
        0.27171443538,
        0.26438033338,
        0.25434842338,
        0.25811600738,
        0.25515642038,
        0.26226672438000004,
        0.24813995338000003
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.28859014988000004,
      "stddev": 0.02695571200985863,
      "median": 0.28715919938,
      "user": 0.23366014000000002,
      "system": 0.57005714,
      "min": 0.25563099038000003,
      "max": 0.33408751838,
      "times": [
        0.32674631138000004,
        0.29228984538,
        0.30308782238000004,
        0.25824360738,
        0.25563099038000003,
        0.26400069038,
        0.28212474538000004,
        0.27749631438,
        0.29219365338000003,
        0.33408751838
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.078 ± 0.058 2.006 2.192 5.35 ± 0.40
pacquet@main 2.180 ± 0.117 2.040 2.338 5.61 ± 0.49
pnpr@HEAD 0.388 ± 0.027 0.340 0.424 1.00
pnpr@main 0.472 ± 0.027 0.438 0.513 1.22 ± 0.11
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.07784183818,
      "stddev": 0.05815780332547547,
      "median": 2.07035841798,
      "user": 1.2559789,
      "system": 0.8830497599999999,
      "min": 2.00646570198,
      "max": 2.19199054498,
      "times": [
        2.09551875798,
        2.07494750598,
        2.12552253198,
        2.06576932998,
        2.00646570198,
        2.19199054498,
        2.12729186498,
        2.03529537298,
        2.01527350598,
        2.04034326498
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.1801745928800003,
      "stddev": 0.11697009564900342,
      "median": 2.15004177148,
      "user": 1.4452814,
      "system": 0.9736807599999999,
      "min": 2.03963613598,
      "max": 2.3375265669800003,
      "times": [
        2.15096155898,
        2.04696411098,
        2.07152646598,
        2.14912198398,
        2.03963613598,
        2.11574113498,
        2.30660294198,
        2.32491901598,
        2.25874601298,
        2.3375265669800003
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.38843368728000005,
      "stddev": 0.02684774204403946,
      "median": 0.39842896648000004,
      "user": 0.35375070000000003,
      "system": 0.76057576,
      "min": 0.34007282098,
      "max": 0.42430738998,
      "times": [
        0.39695244798,
        0.39990548498,
        0.40864390798000005,
        0.38278046898,
        0.40464008798,
        0.37943567598000005,
        0.34007282098,
        0.34692003198000004,
        0.40067855598,
        0.42430738998
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.47211588698000007,
      "stddev": 0.02748140499599661,
      "median": 0.46913348548,
      "user": 0.4116987,
      "system": 0.8351259599999998,
      "min": 0.43827488398000003,
      "max": 0.51344675998,
      "times": [
        0.47824052098000003,
        0.50186450598,
        0.51344675998,
        0.48904897398,
        0.44210046098000005,
        0.45542521698000005,
        0.43827488398000003,
        0.49789466798000004,
        0.46002644998000003,
        0.44483642898000003
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 462.1 ± 25.6 419.2 509.7 5.19 ± 0.45
pacquet@main 435.7 ± 34.6 406.6 513.4 4.90 ± 0.51
pnpr@HEAD 92.5 ± 4.8 84.6 100.8 1.04 ± 0.09
pnpr@main 89.0 ± 5.9 82.9 107.6 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.46205824732,
      "stddev": 0.02559041717460413,
      "median": 0.45700007132,
      "user": 0.45254436,
      "system": 0.07656199999999999,
      "min": 0.41923522782,
      "max": 0.50971752082,
      "times": [
        0.48633022182,
        0.44388117082,
        0.46044818782,
        0.45402950182,
        0.45997064082,
        0.41923522782,
        0.48537743282,
        0.45046942482,
        0.45112314382,
        0.50971752082
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.4356536956200001,
      "stddev": 0.03461414912660445,
      "median": 0.41767591832,
      "user": 0.41978155999999994,
      "system": 0.0774361,
      "min": 0.40658158982000003,
      "max": 0.51342275182,
      "times": [
        0.51342275182,
        0.41589893082,
        0.40999031282000004,
        0.40658158982000003,
        0.41411557182000003,
        0.40807716882,
        0.41945290582,
        0.44942796882,
        0.45980465982,
        0.45976509582
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.09251886418363635,
      "stddev": 0.0047813865759120805,
      "median": 0.09104046582,
      "user": 0.020845026666666665,
      "system": 0.012675784848484849,
      "min": 0.08461129082,
      "max": 0.10077294682,
      "times": [
        0.08522366982,
        0.09062189882,
        0.08992002182,
        0.08959560182000001,
        0.09104046582,
        0.08886501882,
        0.08607840682000001,
        0.08966925982,
        0.09009011082,
        0.08948719882,
        0.09130129582,
        0.08461129082,
        0.08756183182,
        0.09047248982,
        0.08628822082,
        0.09098358982,
        0.09552050182,
        0.09435805782000001,
        0.09805987082,
        0.09969857882000001,
        0.09988866582,
        0.09581296082,
        0.10051932982,
        0.09316623882000001,
        0.09455414482,
        0.09961143482000001,
        0.09507009382,
        0.08901021282,
        0.09233494782,
        0.10077294682,
        0.09855115382,
        0.09682892982,
        0.08755407682
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.08898073664758623,
      "stddev": 0.005900277909581446,
      "median": 0.08685595682000001,
      "user": 0.017843980689655165,
      "system": 0.013221644827586202,
      "min": 0.08291096682,
      "max": 0.10764859182,
      "times": [
        0.09450126682,
        0.10764859182,
        0.09655799982,
        0.09661930482,
        0.10304091582000001,
        0.09706667482,
        0.08792496382000001,
        0.08872050882,
        0.08848183982,
        0.08368711382,
        0.08763530982,
        0.08457342982,
        0.08793057582000001,
        0.08641696182,
        0.08529645682,
        0.08577298182000001,
        0.08505356182,
        0.08773461682,
        0.08797297482000001,
        0.08602035582,
        0.08291096682,
        0.08465534282,
        0.08624354582,
        0.08746714482000001,
        0.08575868482,
        0.08647763582000001,
        0.08551988682,
        0.08589579282,
        0.08685595682000001
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.813 ± 0.220 4.517 5.155 1.34 ± 0.08
pacquet@main 4.657 ± 0.141 4.529 4.945 1.29 ± 0.06
pnpr@HEAD 3.601 ± 0.124 3.484 3.899 1.00
pnpr@main 3.627 ± 0.114 3.498 3.902 1.01 ± 0.05
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.81308066946,
      "stddev": 0.2200144836670498,
      "median": 4.786311792659999,
      "user": 2.57236306,
      "system": 1.8284743399999996,
      "min": 4.51736989766,
      "max": 5.15454950166,
      "times": [
        5.15454950166,
        4.96829617966,
        4.66989854666,
        4.8546375486599995,
        4.71798603666,
        5.04364120066,
        4.6483926026599995,
        4.99424598566,
        4.56178919466,
        4.51736989766
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 4.65727387606,
      "stddev": 0.14071804168235827,
      "median": 4.6141909521599995,
      "user": 2.30366876,
      "system": 1.8754211399999998,
      "min": 4.52892335766,
      "max": 4.94480698866,
      "times": [
        4.63378724666,
        4.94480698866,
        4.59962640866,
        4.546588101659999,
        4.55799187266,
        4.60798174366,
        4.52892335766,
        4.879258688659999,
        4.65337419166,
        4.62040016066
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.6008066323600003,
      "stddev": 0.12436671954591887,
      "median": 3.5728419361600006,
      "user": 1.4570716599999998,
      "system": 1.4781303400000003,
      "min": 3.48365178366,
      "max": 3.89850859566,
      "times": [
        3.6326747336600005,
        3.60496906966,
        3.7006113976600004,
        3.89850859566,
        3.6000597566600003,
        3.48365178366,
        3.5246891056600003,
        3.50484521066,
        3.51243255466,
        3.5456241156600004
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 3.6272521625600005,
      "stddev": 0.1141662726109732,
      "median": 3.6123794196600003,
      "user": 1.3328607599999998,
      "system": 1.46533724,
      "min": 3.49755627766,
      "max": 3.90164743566,
      "times": [
        3.90164743566,
        3.5024071296600003,
        3.6224200306600003,
        3.70862583366,
        3.5913933466600003,
        3.59333392066,
        3.6303788116600004,
        3.49755627766,
        3.60638479866,
        3.6183740406600005
      ]
    }
  ]
}

@github-actions

github-actions Bot commented Jul 15, 2026 •

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Branchpr/13016
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,854.91 ms
(-24.76%)Baseline: 3,794.41 ms
4,553.29 ms
(62.70%)
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
🚷 view threshold
2,077.84 ms
(-22.50%)Baseline: 2,681.07 ms
3,217.28 ms
(64.58%)
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
🚷 view threshold
614.86 ms
(-46.15%)Baseline: 1,141.75 ms
1,370.10 ms
(44.88%)
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
🚷 view threshold
462.06 ms
(-16.11%)Baseline: 550.80 ms
660.95 ms
(69.91%)
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
🚷 view threshold
2,659.18 ms
(-22.75%)Baseline: 3,442.32 ms
4,130.79 ms
(64.37%)
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
🚷 view threshold
4,813.08 ms
(-23.53%)Baseline: 6,293.71 ms
7,552.45 ms
(63.73%)
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
🚷 view threshold
298.00 ms
(-42.96%)Baseline: 522.41 ms
626.89 ms
(47.54%)
🐰 View full continuous benchmarking report in Bencher

@github-actions

github-actions Bot commented Jul 15, 2026 •

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Branchpr/13016
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,709.29 ms
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
388.43 ms
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
259.74 ms
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
⚠️ NO THRESHOLD
92.52 ms
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
1,720.24 ms
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
⚠️ NO THRESHOLD
3,600.81 ms
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
270.00 ms
🐰 View full continuous benchmarking report in Bencher

@YESHYUNGSEOK
YESHYUNGSEOK force-pushed the fix/pnpr-workspace-metadata branch from 0486a02 to b6a46fe Compare July 15, 2026 23:45
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.33333% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.57%. Comparing base (e114fcb) to head (b6a46fe).
⚠️ Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
pnpr/crates/pnpr/src/resolver/resolve.rs 66.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13016      +/-   ##
==========================================
+ Coverage   85.55%   85.57%   +0.01%     
==========================================
  Files         498      498              
  Lines       79648    79656       +8     
==========================================
+ Hits        68142    68164      +22     
+ Misses      11506    11492      -14     

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

@YESHYUNGSEOK
YESHYUNGSEOK force-pushed the fix/pnpr-workspace-metadata branch from b6a46fe to 2e0afc6 Compare July 16, 2026 00:38
@YESHYUNGSEOK
YESHYUNGSEOK marked this pull request as ready for review July 16, 2026 01:35
@YESHYUNGSEOK
YESHYUNGSEOK requested a review from zkochan as a code owner July 16, 2026 01:35
@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 →

@greptile-apps

greptile-apps Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Confidence Score: 4/5

The production code changes are straightforward and well-guarded by backward-compat fallbacks; the two concerns are both in the new test infrastructure.

The core fix — using forwarded name/version in temp manifests and cache keys — is correct. The two flagged items are both in test scaffolding: a $NODE_OPTIONS expansion that silently breaks on Windows, and a preparePackages call that may create package directories at a path different from the rootDir values passed to mutateModules. Neither affects the shipped production behaviour, but they could silently mask a regression if the workspace test doesn't actually exercise the paths it claims to.

pnpm11/installing/deps-installer/test/install/pnprWorkspaceMetadata.ts (workspace test directory setup) and pnpr/client/package.json (test-script cross-platform variable expansion).

Reviews (1): Last reviewed commit: "fix(pnpr): preserve workspace project me..." | Re-trigger Greptile

Comment thread pnpr/client/package.json
@@ -25,8 +25,9 @@
],
"scripts": {
"start": "tsgo --watch",

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.

P2 $NODE_OPTIONS won't expand on Windows

cross-env sets environment variables before running a command — it does not perform shell-variable expansion. On Windows, $NODE_OPTIONS is not a valid expansion syntax and will be passed as the literal string "$NODE_OPTIONS", so any existing value (e.g., coverage flags from a parent process) will be silently overwritten rather than appended. On Unix the shell expands $NODE_OPTIONS before cross-env sees it, so the behaviour differs between platforms. Consider passing --experimental-vm-modules directly in the Jest config or through testEnvironmentOptions, or appending via a cross-platform helper rather than embedding the variable reference inside the cross-env argument.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for flagging this. cross-env does perform its own $VAR/${VAR} expansion on the env-setter values via its varValueConvert helper (src/variable.js), independent of the OS shell. So on Windows $NODE_OPTIONS is replaced with process.env.NODE_OPTIONS (empty string if unset) rather than passed as a literal, while on Unix the shell expands it before cross-env sees it. Both platforms end up with any inherited NODE_OPTIONS (e.g. coverage flags) prepended, not overwritten, so the behavior is cross-platform-consistent and I'll leave this as-is.

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.

You're correct. Looking at cross-env's src/variable.ts, the resolveEnvVars function uses /(\\*)(\$(\w+)|\${(\w+)})/g to match $VAR/${VAR} patterns and replaces them with process.env[varName] || '' in Node.js — not via the OS shell — so the expansion is identical on Windows and Unix. $NODE_OPTIONS gets replaced with the current process.env.NODE_OPTIONS value (empty string if unset) before the variable is set, so any inherited value is prepended rather than overwritten.

My original comment was wrong. Thanks for the correction and the detailed explanation — leaving this as-is is the right call.

Comment on lines +72 to +76

const appRootDir = path.join(workspaceRoot, 'packages/app') as ProjectRootDir
const libRootDir = path.join(workspaceRoot, 'packages/lib') as ProjectRootDir
const allProjects = [
{ buildIndex: 0, manifest: appManifest, rootDir: appRootDir },

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.

P2 preparePackages writes packages to a different path than the test uses

prepareEmpty() changes the CWD to workspaceRoot, then preparePackages with tempDir: path.join(workspaceRoot, '.fixture-anchor') creates the package directories under workspaceRoot/.fixture-anchor/packages/app and workspaceRoot/.fixture-anchor/packages/lib. But appRootDir and libRootDir are set to workspaceRoot/packages/app and workspaceRoot/packages/lib — paths that were never created. If mutateModules accesses the rootDir paths on disk (e.g. to read or verify manifests), the test will fail with an ENOENT. The tempDir option here looks like a leftover from scaffolding; dropping it (or aligning the rootDir values with where preparePackages actually writes) would make the intent explicit. Does preparePackages with tempDir here create the packages under workspaceRoot/.fixture-anchor/packages/{app,lib} rather than under workspaceRoot/packages/{app,lib}? If so, appRootDir/libRootDir point to non-existent directories. Does the test pass locally?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good question, but this is intentional. preparePackages (pnpm11/utils/prepare/src/index.ts) uses dirname = path.dirname(opts.tempDir) as its base, not opts.tempDir itself. So path.dirname(workspaceRoot/.fixture-anchor) resolves to workspaceRoot, and each package is created via prepare({ tempDir: path.join(dirname, location) }) (which mkdirs recursively), landing at workspaceRoot/packages/app and workspaceRoot/packages/lib — exactly where appRootDir/libRootDir point. The .fixture-anchor segment is a throwaway anchor whose only purpose is to be stripped by dirname so the fixtures land inside workspaceRoot (without tempDir they'd go to an unrelated temp dir). No ENOENT, so I'll leave it as-is.

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

@zkochan zkochan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Pacquet does not yet support workspace installs

That's false.

zkochan added a commit that referenced this pull request Jul 18, 2026
Pacquet's recursive command pipeline previously dispatched selected projects independently or lost the selection before package-manager execution. This could overwrite earlier manifest mutations, truncate workspace lockfile state, or materialize projects outside the requested filter.

Thread one workspace selection through command dispatch and package-manager execution, batch manifest mutations into a single install, retain the complete wanted lockfile, and derive current-lockfile and node_modules state from the selected dependency closure. Apply the same workspace root and selection semantics to query, state, global, deploy, and pnpr-backed paths.

Keep full-workspace recursive installs on the ordinary unfiltered fast and frozen paths, and add regression coverage for filtering, lockfile preservation, dependency closure materialization, pnpr multi-importer responses, and TypeScript parity edge cases.

Depends on #13016.

---------

Co-authored-by: Zoltan Kochan <[email protected]>
@YESHYUNGSEOK

Copy link
Copy Markdown
Contributor Author

Closing this PR: its entire diff has since landed on main, so there is nothing left to merge from this branch.

  • fix(pacquet): honor workspace install filters #13030 (fix(pacquet): honor workspace install filters) declared "Depends on fix(pnpr): preserve workspace project metadata #13016" and landed this PR's full content. The @pnpm/pnpr.client name/version forwarding (PnprProject), the deps-installer forwarding and its pnprWorkspaceMetadata test, the pnpr resolver protocol/server handling, the client test, and the pnpr-workspace-identity changeset are all on main today, byte-identical to this branch.
  • The only files where this branch still differs from main are ones where main has since moved further — Box::pin in resolver.rs, the exclusive-create importer-collision guard and root-manifest handling in resolve.rs, the extended sanitized_importer_dir tests — so merging this branch now would regress them.

Re: the review — correct, the description's claim that "Pacquet does not yet support workspace installs" was false. Pacquet forwards per-project workspace identity to pnpr on main: the fields live in pnpm/crates/pnpr-client/src/lib.rs, are populated from the manifest in pnpm/crates/cli/src/cli_args/install.rs and deploy.rs, and are covered by pnpm/crates/package-manager/src/install/tests.rs. With this PR superseded, nothing user-visible remains unmirrored.


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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product: pnpm@11 product: pnpr reviewed: coderabbit CodeRabbit submitted an approving review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants