Skip to content

fix(pacquet): keep filtered workspace links shallow - #13634

Merged
zkochan merged 4 commits into
pnpm:mainfrom
YESHYUNGSEOK:fix/pacquet-filtered-link-scope
Aug 10, 2026
Merged

zkochan merged 4 commits into
pnpm:mainfrom
YESHYUNGSEOK:fix/pacquet-filtered-link-scope

Conversation

@YESHYUNGSEOK

@YESHYUNGSEOK YESHYUNGSEOK commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Pacquet's filtered isolated install followed importer-level workspace links into projects outside the selected scope, materializing their dependency graphs unlike the TypeScript CLI.

  • Keep the direct workspace link in the selected importer without enqueueing the linked importer.
  • Retain deep traversal for links reached through package snapshots.
  • Cover shallow importer links and the deep snapshot-link counterexample.

The TypeScript implementation already has the intended shallow behavior, so this PR brings the Rust implementation back into parity without a TypeScript code change.

Squash Commit Body

Stop importer-level workspace links from expanding a filtered install into unselected projects. The selected importer still receives its direct workspace link, but the linked importer's dependency graph is not materialized.

Keep snapshot-level workspace-link traversal unchanged because those links are part of the selected dependency graph. Update the porting notes and regression coverage to document the boundary.

Checklist

  • The Rust pnpm/ port now matches the existing TypeScript CLI behavior.
  • Added a changeset (pnpm changeset) for pacquet.
  • Added or updated tests.
  • Updated the documentation if needed.

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


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

Summary by CodeRabbit

  • Bug Fixes

    • Filtered isolated installs now preserve selected workspace links without installing unselected linked projects or their dependencies.
    • Production-only filtered installs retain direct workspace links while avoiding unnecessary transitive installation.
    • Existing installation data is preserved more reliably for workspace-linked projects during filtered installs.
  • Tests

    • Expanded coverage for shallow workspace-link behavior, workspace protocol installs, and filtered installation scenarios.
    • Updated workspace porting documentation to reflect the completed behavior.

@YESHYUNGSEOK
YESHYUNGSEOK requested a review from zkochan as a code owner August 4, 2026 07:14
@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 Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Reviews (4): Last reviewed commit: "test(cli): pin the shallow link scope in..." | Re-trigger Greptile

@coderabbitai

coderabbitai Bot commented Aug 4, 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: a3cdf928-3ef8-4a35-86ec-2c5872e08e2b

📥 Commits

Reviewing files that changed from the base of the PR and between 44de764 and 940a71d.

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

📝 Walkthrough

Walkthrough

Filtered installs now traverse workspace link: targets shallowly at the importer level. Snapshot links remain traversable. Tests verify that unselected linked projects and their dependency slots are not materialized.

Changes

Workspace link materialization

Layer / File(s) Summary
Shallow importer-link closure
pnpm/crates/deps-restorer/src/current_lockfile.rs, pnpm/crates/deps-restorer/src/current_lockfile/tests.rs
Importer-level workspace links are excluded from dependency closure traversal. Snapshot-level links remain traversable. Merge tests preserve existing data for shallow link targets.
Filtered install validation
pnpm/crates/cli/tests/suite/install_filters.rs, pnpm/crates/cli/tests/suite/multiple_importers.rs, pnpm/crates/cli/tests/suite/pnpr_install.rs, pnpm/plans/TEST_PORTING.md, .changeset/shallow-pacquet-links.md
Filtered-install tests verify direct links without transitive materialization, dependency slots, or pending builds for unselected targets. Porting records and the changeset document the updated behavior.

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

Possibly related PRs

  • pnpm/pnpm#13030: Modifies filtered workspace-install dependency traversal and importer-level link: closure handling.
  • pnpm/pnpm#13152: Overlaps with the filtered-install tests and workspace-link behavior updated here.
  • pnpm/pnpm#13637: Modifies the same lockfile traversal implementation and tests.

Suggested labels: product: pacquet

Suggested reviewers: zkochan

Sequence Diagram(s)

sequenceDiagram
  participant FilteredInstall
  participant CurrentLockfile
  participant Materializer
  FilteredInstall->>CurrentLockfile: Collect reachable lockfile entries
  CurrentLockfile->>CurrentLockfile: Skip importer-level workspace links
  CurrentLockfile-->>FilteredInstall: Return selected importer and snapshot closure
  FilteredInstall->>Materializer: Materialize selected project and direct link
  Materializer-->>FilteredInstall: Omit unselected link-target dependencies
Loading
✨ 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 added the reviewed: coderabbit CodeRabbit submitted an approving review label Aug 4, 2026
@github-actions

github-actions Bot commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

Integrated-Benchmark Report (Linux)

Commit: 940a71d10796

Regular scenarios report direct and pnpr installs. The peer-heavy resolver scenario compares current Rust, main Rust, and TypeScript pnpm. Bencher consumes pacquet@HEAD and pnpr@HEAD.

The tables below show mean ± σ; Bencher thresholds on the minimum latency, which is far less perturbed by shared-runner contention (noise only adds time).

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.720 ± 0.194 2.483 3.129 1.65 ± 0.18
pacquet@main 2.748 ± 0.225 2.560 3.314 1.67 ± 0.20
pnpr@HEAD 1.676 ± 0.146 1.517 1.871 1.02 ± 0.12
pnpr@main 1.645 ± 0.139 1.493 1.935 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.71996992694,
      "stddev": 0.19387401651646563,
      "median": 2.68788944754,
      "user": 2.48153826,
      "system": 1.93177014,
      "min": 2.48338894104,
      "max": 3.12903291604,
      "times": [
        2.74527229604,
        3.12903291604,
        2.48338894104,
        2.6385365360399997,
        2.6756354990399998,
        2.75523882904,
        2.70014339604,
        2.95086035604,
        2.56865131404,
        2.55293918604
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.7476556403399996,
      "stddev": 0.22504873482392537,
      "median": 2.70738607704,
      "user": 2.5154429599999997,
      "system": 1.8459480399999997,
      "min": 2.56016913804,
      "max": 3.31419216704,
      "times": [
        2.6157108610399997,
        2.90704166804,
        2.60439727604,
        2.73729499004,
        2.70765602904,
        2.56016913804,
        2.5661707530399998,
        3.31419216704,
        2.7568073960399997,
        2.7071161250399998
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.67619374414,
      "stddev": 0.1463818724202199,
      "median": 1.6570937650400002,
      "user": 1.73492516,
      "system": 1.7443064399999997,
      "min": 1.5169335600400002,
      "max": 1.8708061730400003,
      "times": [
        1.5844513210400002,
        1.5185577510400001,
        1.80960857704,
        1.7974972340400002,
        1.8708061730400003,
        1.5478734230400002,
        1.5169335600400002,
        1.84142131004,
        1.5450518830400002,
        1.7297362090400001
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.6451599451400003,
      "stddev": 0.13922566192615482,
      "median": 1.62485318704,
      "user": 1.71210326,
      "system": 1.73433134,
      "min": 1.4926701390400001,
      "max": 1.9354807190400003,
      "times": [
        1.58059660604,
        1.66910976804,
        1.4926701390400001,
        1.7933593310400002,
        1.67348706004,
        1.9354807190400003,
        1.6932468410400001,
        1.5089213180400003,
        1.52675406904,
        1.5779736000400002
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 324.2 ± 18.6 297.9 358.2 1.00
pacquet@main 347.4 ± 18.0 323.2 376.7 1.07 ± 0.08
pnpr@HEAD 360.7 ± 40.7 315.7 448.1 1.11 ± 0.14
pnpr@main 366.9 ± 55.8 302.4 456.0 1.13 ± 0.18
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.3241987459400001,
      "stddev": 0.018561758719066967,
      "median": 0.32025374984000005,
      "user": 0.3114521999999999,
      "system": 0.63266834,
      "min": 0.29788675234000006,
      "max": 0.35819687334000005,
      "times": [
        0.31285639434000007,
        0.30358975534000004,
        0.31991264934,
        0.32059485034000007,
        0.29788675234000006,
        0.33126722334,
        0.35819687334000005,
        0.32988332334000003,
        0.31980338734,
        0.34799625034000004
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.34744760844000006,
      "stddev": 0.01798600512073841,
      "median": 0.34376040784000006,
      "user": 0.33214659999999996,
      "system": 0.6565604399999999,
      "min": 0.32320182134000003,
      "max": 0.37669055634000004,
      "times": [
        0.33580713134000006,
        0.33728168134000003,
        0.36916014934,
        0.34576644134000006,
        0.32634868234000003,
        0.32320182134000003,
        0.37669055634000004,
        0.35921091734000005,
        0.35925432934000007,
        0.34175437434000006
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.36069426564000007,
      "stddev": 0.040687923659254215,
      "median": 0.35644820284000006,
      "user": 0.320127,
      "system": 0.65802474,
      "min": 0.31572734934,
      "max": 0.44805203534000004,
      "times": [
        0.31727254234,
        0.31572734934,
        0.32802813834000005,
        0.34163995934,
        0.35570581334000007,
        0.38743048134,
        0.36087138734000007,
        0.35719059234000006,
        0.3950243573400001,
        0.44805203534000004
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.3669361514400001,
      "stddev": 0.055787380255753895,
      "median": 0.35330123634000005,
      "user": 0.33796610000000005,
      "system": 0.66723044,
      "min": 0.30237584734000006,
      "max": 0.45598837434000006,
      "times": [
        0.44934898134000006,
        0.45598837434000006,
        0.37861965834000005,
        0.40900210534000003,
        0.36864147434000005,
        0.33796099834000004,
        0.32414867034000006,
        0.30686109234000003,
        0.33641431234,
        0.30237584734000006
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.875 ± 0.043 2.790 2.923 1.68 ± 0.17
pacquet@main 2.904 ± 0.042 2.837 2.975 1.70 ± 0.17
pnpr@HEAD 1.711 ± 0.171 1.527 1.973 1.00
pnpr@main 1.757 ± 0.098 1.594 1.883 1.03 ± 0.12
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.87491814784,
      "stddev": 0.04338032352206904,
      "median": 2.89673547614,
      "user": 2.37229124,
      "system": 1.8719456200000004,
      "min": 2.7897482941400003,
      "max": 2.9225374311400003,
      "times": [
        2.85695694114,
        2.7897482941400003,
        2.82987721914,
        2.84020696514,
        2.9017515731400003,
        2.9225374311400003,
        2.90074224414,
        2.8959251691400003,
        2.89754578314,
        2.91388985814
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.9037286038400003,
      "stddev": 0.0423614268176801,
      "median": 2.9002271461399998,
      "user": 2.40310774,
      "system": 1.9525564199999998,
      "min": 2.83688996414,
      "max": 2.9750331721400003,
      "times": [
        2.90338334014,
        2.94164990814,
        2.9461659031400003,
        2.89707095214,
        2.9136197201400003,
        2.8551132791400002,
        2.9750331721400003,
        2.8908764751400002,
        2.83688996414,
        2.87748332414
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.7113378021400003,
      "stddev": 0.1710480670444403,
      "median": 1.6595647421400002,
      "user": 1.51331654,
      "system": 1.58841942,
      "min": 1.5268093401400002,
      "max": 1.9734570481400002,
      "times": [
        1.7780871741400002,
        1.56818953714,
        1.5854469891400003,
        1.87939469314,
        1.72507347214,
        1.5467960571400001,
        1.9734570481400002,
        1.5268093401400002,
        1.5940560121400003,
        1.93606769814
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.75660109254,
      "stddev": 0.09782621984881582,
      "median": 1.7608978426400002,
      "user": 1.35810874,
      "system": 1.48461812,
      "min": 1.59448458614,
      "max": 1.8829636971400001,
      "times": [
        1.7353136691400002,
        1.6732018261400001,
        1.7025968771400002,
        1.6600844331400002,
        1.8636438321400002,
        1.83716267414,
        1.59448458614,
        1.8300773141400002,
        1.8829636971400001,
        1.7864820161400001
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 479.2 ± 21.4 459.0 521.7 1.31 ± 0.09
pacquet@main 489.3 ± 32.2 451.0 535.0 1.34 ± 0.11
pnpr@HEAD 365.9 ± 17.3 335.0 387.1 1.00
pnpr@main 375.7 ± 11.4 356.0 391.0 1.03 ± 0.06
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.47917466896,
      "stddev": 0.021367344107246552,
      "median": 0.47432467646,
      "user": 0.66668084,
      "system": 0.7431884799999999,
      "min": 0.45895083546000004,
      "max": 0.52166431946,
      "times": [
        0.46025461446000004,
        0.45895083546000004,
        0.46535717046,
        0.46206305146000004,
        0.50963631446,
        0.47811102946,
        0.52166431946,
        0.47703862446,
        0.48706000146,
        0.47161072846
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.4893337797600001,
      "stddev": 0.03224785208233599,
      "median": 0.48429491746000003,
      "user": 0.70625034,
      "system": 0.73726458,
      "min": 0.45102163946,
      "max": 0.5349597084600001,
      "times": [
        0.46032222146,
        0.46289863146000004,
        0.48421126046,
        0.45616733646,
        0.48437857446000004,
        0.5349597084600001,
        0.5183588504600001,
        0.5333964814600001,
        0.50762309346,
        0.45102163946
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.36586972526,
      "stddev": 0.017302948016715707,
      "median": 0.36981773696000003,
      "user": 0.26817224,
      "system": 0.63078488,
      "min": 0.33504662546,
      "max": 0.38707825346,
      "times": [
        0.35336502846,
        0.37831496046,
        0.35350698446,
        0.38654132446,
        0.38707825346,
        0.37038122546,
        0.36925424846000005,
        0.34937318946,
        0.33504662546,
        0.37583541246
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.37565872906000003,
      "stddev": 0.011402148859306781,
      "median": 0.37629786096,
      "user": 0.28271044,
      "system": 0.62699178,
      "min": 0.35595360146000005,
      "max": 0.39102980746000005,
      "times": [
        0.37677847446,
        0.39102980746000005,
        0.36056775946,
        0.38977561046000003,
        0.37581724746,
        0.37839844646000004,
        0.38455982146,
        0.37272433746,
        0.37098218446000003,
        0.35595360146000005
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.940 ± 0.026 1.896 1.971 5.26 ± 0.16
pacquet@main 1.922 ± 0.042 1.875 1.983 5.21 ± 0.18
pnpr@HEAD 0.387 ± 0.027 0.350 0.442 1.05 ± 0.08
pnpr@main 0.369 ± 0.010 0.352 0.386 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.93968055194,
      "stddev": 0.025815918437543883,
      "median": 1.94228804804,
      "user": 1.2233696200000002,
      "system": 1.0322510799999998,
      "min": 1.89601023404,
      "max": 1.97083020404,
      "times": [
        1.9594016730400001,
        1.97083020404,
        1.91277979804,
        1.95398391504,
        1.96312486904,
        1.93059218104,
        1.91911234504,
        1.9639367840400002,
        1.92703351604,
        1.89601023404
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 1.92188594334,
      "stddev": 0.04248557165723716,
      "median": 1.90691254054,
      "user": 1.1703139200000001,
      "system": 0.9754723799999999,
      "min": 1.87457873204,
      "max": 1.98291316304,
      "times": [
        1.91654794704,
        1.98291316304,
        1.97358427804,
        1.92451503404,
        1.87457873204,
        1.88629847004,
        1.88494591904,
        1.89582372404,
        1.89727713404,
        1.98237503204
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.38718701004,
      "stddev": 0.027009505683256517,
      "median": 0.38981089004,
      "user": 0.32125452,
      "system": 0.6191422799999999,
      "min": 0.34955871704,
      "max": 0.44156482204,
      "times": [
        0.39362982904,
        0.39676265504,
        0.37464788004,
        0.38599195104,
        0.40512127804000003,
        0.39812168804000003,
        0.44156482204,
        0.35073797104,
        0.37573330904,
        0.34955871704
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.36880890904,
      "stddev": 0.010051289265724178,
      "median": 0.36757564804000004,
      "user": 0.2710680200000001,
      "system": 0.63118858,
      "min": 0.35153570004,
      "max": 0.38582378404,
      "times": [
        0.35961543804,
        0.36511945904000004,
        0.37470055904,
        0.38582378404,
        0.35153570004,
        0.38084577304,
        0.37178563304,
        0.36621723104000004,
        0.36351144804,
        0.36893406504000004
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 261.5 ± 18.4 240.5 298.9 2.64 ± 0.25
pacquet@main 265.6 ± 24.7 234.3 322.6 2.68 ± 0.30
pnpr@HEAD 99.2 ± 6.3 94.0 119.3 1.00
pnpr@main 102.1 ± 4.7 95.2 113.2 1.03 ± 0.08
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.26150504805999997,
      "stddev": 0.018444726550088223,
      "median": 0.25717394336,
      "user": 0.2363949,
      "system": 0.07815185999999999,
      "min": 0.24052840186000002,
      "max": 0.29893588986,
      "times": [
        0.28195858586,
        0.24052840186000002,
        0.24912100486000002,
        0.25688759486,
        0.24854670586000002,
        0.25746029186,
        0.29893588986,
        0.24340065786,
        0.26881881986,
        0.26939252786
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.26557276056,
      "stddev": 0.024670399830770854,
      "median": 0.26482168536,
      "user": 0.248164,
      "system": 0.07871705999999999,
      "min": 0.23428092586000002,
      "max": 0.32257366586,
      "times": [
        0.28011652386,
        0.32257366586,
        0.26561033186,
        0.25145078086,
        0.26403303886,
        0.24448480586000002,
        0.27187691486000004,
        0.27296182286000004,
        0.23428092586000002,
        0.24833879486000002
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.0991701882048276,
      "stddev": 0.006340797888731383,
      "median": 0.09650768986000001,
      "user": 0.025261765517241384,
      "system": 0.014880401379310343,
      "min": 0.09396222586,
      "max": 0.11934759186,
      "times": [
        0.09569296886,
        0.09615544886,
        0.09851425886000001,
        0.09648241286,
        0.09520889986,
        0.10121082586,
        0.09797139986,
        0.09650768986000001,
        0.09450569686,
        0.09601080586,
        0.09545528186,
        0.09585389086,
        0.09834414886000001,
        0.09558940386,
        0.09399157086,
        0.09512552186,
        0.09396222586,
        0.09495744686,
        0.09950532186000001,
        0.09591803086,
        0.10290586086,
        0.09814054786000001,
        0.09800901986,
        0.09890034486,
        0.09763110886000001,
        0.10699349986000001,
        0.11934759186,
        0.11294202686,
        0.11410220586
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.10210871971714286,
      "stddev": 0.004686786678022094,
      "median": 0.10009089636,
      "user": 0.030059300000000004,
      "system": 0.013724332857142859,
      "min": 0.09518457286,
      "max": 0.11317594686,
      "times": [
        0.09940590386,
        0.10843604086,
        0.10405203386,
        0.09994921586000001,
        0.09877521886,
        0.10009103186,
        0.09923499286000001,
        0.09833287886,
        0.10188796786,
        0.11125744186,
        0.10812386286,
        0.09518457286,
        0.09960307586,
        0.10188666586,
        0.10339096186,
        0.11317594686,
        0.09905128786,
        0.10165875686,
        0.09876450886,
        0.09609784886,
        0.09988795986,
        0.10706672886,
        0.10009076086,
        0.10168259186,
        0.10231192386,
        0.09809675486000001,
        0.11158917486,
        0.09995804186
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.464 ± 0.243 1.156 2.015 1.04 ± 0.38
pacquet@main 1.409 ± 0.457 0.920 2.153 1.00
pnpm@HEAD 3.400 ± 0.218 3.076 3.697 2.41 ± 0.80
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.4635485257133334,
      "stddev": 0.24333723829227233,
      "median": 1.40662604138,
      "user": 1.457611693333333,
      "system": 0.2429046311111111,
      "min": 1.15553370138,
      "max": 2.01489326138,
      "times": [
        1.15553370138,
        2.01489326138,
        1.5556708813800002,
        1.53431042838,
        1.35103451538,
        1.38919021238,
        1.26671572338,
        1.4979619663800001,
        1.40662604138
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 1.408763767491111,
      "stddev": 0.45655342016769584,
      "median": 1.23099120238,
      "user": 1.4138406933333334,
      "system": 0.22913740888888887,
      "min": 0.9197058903800001,
      "max": 2.15260579138,
      "times": [
        0.9887251663800001,
        1.23099120238,
        1.11285729938,
        2.00359076638,
        2.15260579138,
        1.10783861038,
        1.38691528838,
        1.7756438923800002,
        0.9197058903800001
      ]
    },
    {
      "command": "pnpm@HEAD",
      "mean": 3.40044144438,
      "stddev": 0.2183052635186706,
      "median": 3.40216007238,
      "user": 5.141214026666668,
      "system": 0.33174518666666664,
      "min": 3.07559781738,
      "max": 3.69731306538,
      "times": [
        3.69731306538,
        3.67536317338,
        3.40216007238,
        3.4813499773800003,
        3.24622253238,
        3.29061311438,
        3.18399556838,
        3.55135767838,
        3.07559781738
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.565 ± 0.125 4.462 4.800 1.27 ± 0.05
pacquet@main 4.668 ± 0.088 4.521 4.770 1.30 ± 0.05
pnpr@HEAD 3.597 ± 0.117 3.497 3.901 1.00
pnpr@main 3.668 ± 0.114 3.517 3.922 1.02 ± 0.05
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.5651938445199995,
      "stddev": 0.12524500744201283,
      "median": 4.52485945682,
      "user": 2.1280705399999995,
      "system": 1.60304076,
      "min": 4.46164034082,
      "max": 4.79985680082,
      "times": [
        4.49266235682,
        4.5638775558199995,
        4.78813742282,
        4.46164034082,
        4.48548689182,
        4.54598245682,
        4.46457570582,
        4.79985680082,
        4.53751599982,
        4.5122029138199995
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 4.66766040002,
      "stddev": 0.08767231756296437,
      "median": 4.68069403432,
      "user": 2.53884224,
      "system": 1.71206846,
      "min": 4.52116862782,
      "max": 4.77008716182,
      "times": [
        4.77008716182,
        4.62246361582,
        4.65430911382,
        4.70262603882,
        4.76832572282,
        4.68119890282,
        4.68018916582,
        4.74195408782,
        4.52116862782,
        4.53428156282
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.5970734346200004,
      "stddev": 0.11731853646297433,
      "median": 3.54984866082,
      "user": 1.55465324,
      "system": 1.52965216,
      "min": 3.49704041082,
      "max": 3.90066375382,
      "times": [
        3.90066375382,
        3.61042673182,
        3.53478342682,
        3.53007131482,
        3.49704041082,
        3.5272239068199998,
        3.56453365882,
        3.53516366282,
        3.62056698682,
        3.6502604928199998
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 3.6683133388200004,
      "stddev": 0.11383905785030905,
      "median": 3.64590889532,
      "user": 1.5519673399999996,
      "system": 1.53919016,
      "min": 3.5171818408199997,
      "max": 3.92185995082,
      "times": [
        3.62878502782,
        3.53925004582,
        3.5171818408199997,
        3.65466092682,
        3.63715686382,
        3.70200010982,
        3.92185995082,
        3.70829535082,
        3.74485430382,
        3.62908896782
      ]
    }
  ]
}

@github-actions

github-actions Bot commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/13634
Testbedpacquet

🚨 1 Alert

BenchmarkMeasure
Units
ViewBenchmark Result
(Result Δ%)
Upper Boundary
(Limit %)
isolated-linker.peer-heavy-resolve.hot-cache.offlineLatency
milliseconds (ms)
📈 plot
🚷 threshold
🚨 alert (🔔)
1,155.53 ms
(+73.41%)Baseline: 666.37 ms
799.64 ms
(144.51%)

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,789.75 ms
(+5.92%)Baseline: 2,633.84 ms
3,160.60 ms
(88.27%)
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
🚷 view threshold
1,896.01 ms
(+7.69%)Baseline: 1,760.62 ms
2,112.74 ms
(89.74%)
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
🚷 view threshold
458.95 ms
(+6.39%)Baseline: 431.40 ms
517.68 ms
(88.66%)
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
🚷 view threshold
240.53 ms
(+11.68%)Baseline: 215.37 ms
258.44 ms
(93.07%)
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
🚷 view threshold
2,483.39 ms
(+3.19%)Baseline: 2,406.65 ms
2,887.98 ms
(85.99%)
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
🚷 view threshold
4,461.64 ms
(-0.87%)Baseline: 4,500.80 ms
5,400.96 ms
(82.61%)
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
🚷 view threshold
297.89 ms
(+7.66%)Baseline: 276.69 ms
332.03 ms
(89.72%)
isolated-linker.peer-heavy-resolve.hot-cache.offline📈 view plot
🚷 view threshold
🚨 view alert (🔔)
1,155.53 ms
(+73.41%)Baseline: 666.37 ms
799.64 ms
(144.51%)

🐰 View full continuous benchmarking report in Bencher

@github-actions

github-actions Bot commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/13634
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,452.76 ms
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
326.42 ms
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
303.54 ms
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
⚠️ NO THRESHOLD
85.69 ms
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
1,533.75 ms
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
⚠️ NO THRESHOLD
3,572.21 ms
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
309.72 ms
🐰 View full continuous benchmarking report in Bencher

@zkochan
zkochan force-pushed the fix/pacquet-filtered-link-scope branch from e0771ec to 2bb2665 Compare August 7, 2026 14:07
@qodo-code-review

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

Copy link
Copy Markdown

Code Review by Qodo

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

Grey Divider


Remediation recommended

1. False-green link absence check 🐞 Bug ☼ Reliability ⭐ New
Description
The new negative assertions can pass when filesystem metadata lookups fail (e.g., PermissionDenied),
because workspace_has_link converts errors into false and Path::exists() also returns false
on metadata errors. This weakens the regression test by treating “could not check” as “definitely
absent.”
Code

pnpm/crates/cli/tests/suite/pnpr_install.rs[R604-605]

+    assert!(!workspace_has_link(&workspace, "lib", WORKSPACE_HELLO));
+    assert!(!workspace_slot(&workspace, WORKSPACE_HELLO, "1.0.0").exists());
Relevance

●●● Strong

Recent reviews accepted hardening tests: avoid .exists()/swallowed I/O errors causing false-green
absence assertions.

PR-#13707
PR-#13780

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
workspace_has_link intentionally swallows errors by returning false on Err, and the test uses
.exists() for absence; both patterns can hide unexpected filesystem failures and still satisfy a
negative assertion.

pnpm/crates/cli/tests/suite/pnpr_install.rs[603-605]
pnpm/crates/cli/tests/suite/pnpr_install.rs[353-362]
PR-#13707

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

### Issue description
The test asserts absence via helpers that mask I/O/metadata errors as `false`, so the test can incorrectly pass when the filesystem cannot be inspected.

### Issue Context
This was introduced when the assertions were flipped to negative checks.

### Fix Focus Areas
- pnpm/crates/cli/tests/suite/pnpr_install.rs[604-605]
- pnpm/crates/cli/tests/suite/pnpr_install.rs[353-362]

### Suggested fix
- For the link assertion, avoid `unwrap_or(false)` in `workspace_has_link` (or bypass the helper in this test) so unexpected errors fail the test:
 - e.g. `let r = is_symlink_or_junction(&path); assert!(matches!(r, Ok(false) | Err(e) if e.kind()==ErrorKind::NotFound), ...)` (depending on how `is_symlink_or_junction` reports missing paths), and `panic!/assert!` on other error kinds.
- For the virtual store slot, replace `.exists()` with `std::fs::symlink_metadata(...)` (or `try_exists()` if available) and assert specifically on `Err(ErrorKind::NotFound)`; treat any other `Err` as a test failure.

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



Informational

2. Eager importer map build 🐞 Bug ➹ Performance
Description
After importer-level workspace-link traversal was removed, collect_reachable() still eagerly
constructs and normalizes known_importers for every call even though it’s now only needed when
traversing snapshot-level Link edges. This adds avoidable O(#importers) allocations and path
normalization work per closure walk on common installs where no snapshot-level workspace links are
encountered.
Code

pnpm/crates/deps-restorer/src/current_lockfile.rs[R454-457]

+                    if let Some(key) = spec.version.resolved_key(name)
                        && !should_skip(&key)
                        && snapshots.is_some_and(|snapshots| snapshots.contains_key(&key))
                    {
Relevance

● Weak

Similar collect_reachable performance optimizations were previously rejected as unnecessary
overhead/complexity.

PR-#13141

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The map of normalized importer paths is built unconditionally at the top of collect_reachable(),
but after the PR it is only used when a snapshot dependency is a workspace link
(dep_ref.as_link_target()), making it frequently unused on installs without snapshot-level
workspace links.

pnpm/crates/deps-restorer/src/current_lockfile.rs[421-429]
pnpm/crates/deps-restorer/src/current_lockfile.rs[471-489]

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

## Issue description
`collect_reachable()` always builds `known_importers` (collect/sort importer IDs + `lexical_normalize` + `HashMap` allocation). After this PR, importer-level `link:` dependencies no longer use `known_importers`, so the map is only needed if a traversed snapshot dependency is a workspace link (`SnapshotDepRef::Link` / `dep_ref.as_link_target()`). On closure walks without such snapshot-level links, this work is wasted and can be significant for large workspaces.

## Issue Context
- Importer-level link traversal was removed in the importer dependency loop.
- Snapshot-level link traversal still exists and needs importer-ID lookup by path.

## Fix Focus Areas
- pnpm/crates/deps-restorer/src/current_lockfile.rs[421-496]

## Suggested approach
- Make `known_importers` lazily initialized (e.g., `Option<HashMap<PathBuf, String>>`) and only build it the first time a snapshot dependency resolves to `as_link_target()`.
- Alternatively, split `collect_reachable` into two phases: traverse importers/snapshots first; if no `Link` edges were seen, skip building the map entirely; if seen, build and reprocess only link edges.
- Keep behavior identical for snapshot-level links; only reduce unnecessary precomputation.

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


3. Changeset missing pnpm bump 📘 Rule violation § Compliance
Description
The new changeset only declares a pacquet bump and omits the required pnpm entry in its
front-matter. This can cause release automation to miss or mis-handle the pnpm package versioning
expectations.
Code

.changeset/shallow-pacquet-links.md[R1-3]

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

● Weak

Multiple recent PRs rejected adding a mandatory pnpm entry to pacquet-only changesets.

PR-#13686
PR-#13594
PR-#13406

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 713436 requires each new/modified changeset to include an entry for the pnpm
package with a valid bump type. The added changeset front-matter contains only pacquet: patch and
no pnpm entry.

Rule 713436: Explicitly declare pnpm package and correct bump type in changesets
.changeset/shallow-pacquet-links.md[1-3]

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

## Issue description
The changeset front-matter omits a `pnpm` entry, which violates the requirement that changesets explicitly declare the `pnpm` package bump type.

## Issue Context
A new changeset was added for this PR, but it only lists `pacquet`.

## Fix Focus Areas
- .changeset/shallow-pacquet-links.md[1-3]

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


Grey Divider

Context used
✅ Compliance rules (platform): 26 rules

Grey Divider

Tip of the day
💡 Did you know, you can reply 'qodo' on any finding to push back, ask questions, or dig deeper

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Previous review results

Review updated until commit 940a71d ⚖️ Balanced

Results up to commit 2bb2665 ⚖️ Balanced


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


Informational
1. Changeset missing pnpm bump 📘 Rule violation § Compliance
Description
The new changeset only declares a pacquet bump and omits the required pnpm entry in its
front-matter. This can cause release automation to miss or mis-handle the pnpm package versioning
expectations.
Code

.changeset/shallow-pacquet-links.md[R1-3]

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

● Weak

Multiple recent PRs rejected adding a mandatory pnpm entry to pacquet-only changesets.

PR-#13686
PR-#13594
PR-#13406

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 713436 requires each new/modified changeset to include an entry for the pnpm
package with a valid bump type. The added changeset front-matter contains only pacquet: patch and
no pnpm entry.

Rule 713436: Explicitly declare pnpm package and correct bump type in changesets
.changeset/shallow-pacquet-links.md[1-3]

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

## Issue description
The changeset front-matter omits a `pnpm` entry, which violates the requirement that changesets explicitly declare the `pnpm` package bump type.

## Issue Context
A new changeset was added for this PR, but it only lists `pacquet`.

## Fix Focus Areas
- .changeset/shallow-pacquet-links.md[1-3]

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


2. Eager importer map build 🐞 Bug ➹ Performance
Description
After importer-level workspace-link traversal was removed, collect_reachable() still eagerly
constructs and normalizes known_importers for every call even though it’s now only needed when
traversing snapshot-level Link edges. This adds avoidable O(#importers) allocations and path
normalization work per closure walk on common installs where no snapshot-level workspace links are
encountered.
Code

pnpm/crates/deps-restorer/src/current_lockfile.rs[R454-457]

+                    if let Some(key) = spec.version.resolved_key(name)
                        && !should_skip(&key)
                        && snapshots.is_some_and(|snapshots| snapshots.contains_key(&key))
                    {
Relevance

● Weak

Similar collect_reachable performance optimizations were previously rejected as unnecessary
overhead/complexity.

PR-#13141

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The map of normalized importer paths is built unconditionally at the top of collect_reachable(),
but after the PR it is only used when a snapshot dependency is a workspace link
(dep_ref.as_link_target()), making it frequently unused on installs without snapshot-level
workspace links.

pnpm/crates/deps-restorer/src/current_lockfile.rs[421-429]
pnpm/crates/deps-restorer/src/current_lockfile.rs[471-489]

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

## Issue description
`collect_reachable()` always builds `known_importers` (collect/sort importer IDs + `lexical_normalize` + `HashMap` allocation). After this PR, importer-level `link:` dependencies no longer use `known_importers`, so the map is only needed if a traversed snapshot dependency is a workspace link (`SnapshotDepRef::Link` / `dep_ref.as_link_target()`). On closure walks without such snapshot-level links, this work is wasted and can be significant for large workspaces.

## Issue Context
- Importer-level link traversal was removed in the importer dependency loop.
- Snapshot-level link traversal still exists and needs importer-ID lookup by path.

## Fix Focus Areas
- pnpm/crates/deps-restorer/src/current_lockfile.rs[421-496]

## Suggested approach
- Make `known_importers` lazily initialized (e.g., `Option<HashMap<PathBuf, String>>`) and only build it the first time a snapshot dependency resolves to `as_link_target()`.
- Alternatively, split `collect_reachable` into two phases: traverse importers/snapshots first; if no `Link` edges were seen, skip building the map entirely; if seen, build and reprocess only link edges.
- Keep behavior identical for snapshot-level links; only reduce unnecessary precomputation.

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


Results up to commit 44de764 ⚖️ Balanced


No changes from previous review

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.

YESHYUNGSEOK and others added 3 commits August 10, 2026 22:02
…assertion

The multi-line `assert!` added for the shallow workspace-link coverage
lacked the trailing comma `perfectionist::macro-trailing-comma` requires,
so `cargo dylint` failed the lint gate.

Co-Authored-By: Claude Fable 5 <[email protected]>
@zkochan
zkochan force-pushed the fix/pacquet-filtered-link-scope branch from 2bb2665 to 44de764 Compare August 10, 2026 20:04
@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

greptile-apps[bot]
greptile-apps Bot previously approved these changes Aug 10, 2026
@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 44de764

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

…test

The test asserted that a filtered install materializes the unselected
`workspace:*` target's own dependencies, which is the deep-closure
behavior this branch removes. The TypeScript CLI creates no
`node_modules` for the link target at all under `--filter`, so the
assertions are inverted to match.

Co-Authored-By: Claude Fable 5 <[email protected]>
@greptile-apps
greptile-apps Bot dismissed their stale review August 10, 2026 20:46

Dismissed because a newer commit was pushed; Greptile will re-review the current head.

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 940a71d

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

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

No code suggestions found for the PR.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.15%. Comparing base (996297c) to head (940a71d).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13634      +/-   ##
==========================================
- Coverage   88.16%   88.15%   -0.01%     
==========================================
  Files         623      623              
  Lines      101537   101540       +3     
==========================================
- Hits        89520    89513       -7     
- Misses      12017    12027      +10     

☔ 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 e33e400 into pnpm:main Aug 10, 2026
33 of 34 checks passed
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