Skip to content

fix(install): sync only the package files into injected copies with dedicated lockfiles - #16684

Merged
zkochan merged 3 commits into
pnpm:mainfrom
lazerg:fix/issue-16683-injected-files-field
Oct 7, 2026
Merged

zkochan merged 3 commits into
pnpm:mainfrom
lazerg:fix/issue-16683-injected-files-field

Conversation

@lazerg

@lazerg lazerg commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Summary

With sharedWorkspaceLockfile: false, an injected workspace package got every file of its project directory (tsconfig.json, its own pnpm-lock.yaml) when the package was installed in the same run as its dependent. With only the dependent selected, the copy held just the files that files selects.

#15685 added a sync that runs after a split-lockfile install and patches the injected copies of every selected project from its source directory. The sync read the source with all files, while the install builds the copy from the package files unless deployAllFiles is set. So the sync added every file the install had left out. Both pnpm v11 and v12 have the bug, so both are fixed.

The sync now reads the source with the same file selection as the install (!deployAllFiles). The target is still read in full, so files that an earlier sync added are removed. The sync after a project's own scripts with a shared lockfile is unchanged.

With this change the issue's script prints index.js package.json for both --filter runs. With deployAllFiles: true the copy still holds every file.

Fixes #16683

Squash Commit Body

The split-lockfile sync added in pnpm/pnpm#15685 patches each injected
copy from its source project after all selected projects are installed.
It read the source directory with every file, while the install builds
the copy from the package files only (the files field and .npmignore)
unless deployAllFiles is set. So when the injected project was part of
the same run, the copy picked up files such as tsconfig.json and the
project's own pnpm-lock.yaml.

The sync now reads the source with includeOnlyPackageFiles set to
!deployAllFiles, as the install's directory fetch does. The target is
still read in full, so files that an earlier sync added are removed.
The sync after a project's own scripts with a shared lockfile keeps
reading every file.

Fixes https://github.com/pnpm/pnpm/issues/16683

Checklist

  • I checked the referenced issue and verified that none of the PRs
    already linked to it solves it.
  • New features are implemented only in the Rust pnpm v12 CLI. Bug fixes
    are implemented in every affected version.
  • Added a changeset (pnpm changeset) if this PR changes any published
    package. Keep it short and written for pnpm users — it becomes a release note.
  • Added or updated tests.

Written by an agent (Claude Code, claude-opus-5-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
    • Injected workspace packages using dedicated lockfiles now contain only files selected by their package’s files field when installed alongside a dependent.
    • Other project files, such as tsconfig.json and lockfiles, are excluded from the installed copy in this mode.
    • When deployAllFiles is enabled, all files continue to be included.

@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: pnpm/pnpm/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a79eca0c-3137-49c0-ae64-5bc7c8e0d937
📥 Commits

Reviewing files that changed from the base of the PR and between ebadd4c and 808d75b.

📒 Files selected for processing (1)
  • .changeset/injected-copy-files-field-dedicated-lockfiles.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • .changeset/injected-copy-files-field-dedicated-lockfiles.md

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

Injected dependency synchronization now filters source files to those selected by package-file rules when deploy-all-files mode is off. The PR updates Rust and TypeScript sync paths and adds tests for injected copies with dedicated lockfiles.

Changes

Injected workspace package file filtering

Layer / File(s) Summary
Source file filtering
pnpm/crates/injected-deps-syncer/src/dir_patcher.rs, pnpm/crates/injected-deps-syncer/src/lib.rs, pnpm11/workspace/injected-deps-syncer/src/DirPatcher.ts, pnpm11/workspace/injected-deps-syncer/src/index.ts
Both syncers accept a package-file filtering option and apply it when loading source maps. Target maps remain unfiltered.
Install sync wiring
pnpm/crates/cli/src/cli_args/pipelines.rs, pnpm/crates/injected-deps-syncer/src/lib.rs, pnpm11/installing/commands/src/recursive/installEachProject.ts
Install paths pass the inverse of the deploy-all-files setting to injected dependency synchronization. Post-script sync passes false.
Regression coverage and release note
pnpm/crates/injected-deps-syncer/src/dir_patcher/tests.rs, pnpm/crates/injected-deps-syncer/src/tests.rs, pnpm/crates/cli/tests/suite/injected_deps_with_dedicated_lockfiles.rs, pnpm11/pnpm/test/monorepo/index.ts, .changeset/injected-copy-files-field-dedicated-lockfiles.md
Tests check that injected copies include package-selected files and exclude unlisted files. The changeset records patch releases and the file-selection behavior.

Priority: ➖ Normal

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

Change: Bug fix · Severity of issue fixed: Medium

Sequence Diagram(s)

sequenceDiagram
  participant CLI as sync_dedicated_injected_deps
  participant Sync as sync_injected_deps_of_modules_dir
  participant Patcher as DirPatcher
  participant Fetcher as DirectoryFetcher
  CLI->>Sync: Pass include_only_package_files
  Sync->>Patcher: Pass filter to patch_targets
  Patcher->>Fetcher: Load source map with package-file filter
  Patcher->>Fetcher: Load target maps without package-file filter
Loading

Assessment against linked issues

Objective Addressed Explanation
[#16683] Keep files outside the package files selection out of the injected copy when the injected package is installed in the same run. ✅

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

Merge Risk: ⚪ Minimal · up to 808d7

No specific issue in the supplied changes requires resolution before merge; proceed with normal checks.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@codecov-commenter

codecov-commenter commented Oct 7, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.45455% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 92.36%. Comparing base (ab1e504) to head (808d75b).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pnpm/crates/cli/src/cli_args/pipelines.rs 83.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #16684      +/-   ##
==========================================
- Coverage   92.36%   92.36%   -0.01%     
==========================================
  Files        1593     1593              
  Lines      210358   210369      +11     
==========================================
+ Hits       194297   194306       +9     
- Misses      16061    16063       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Same-run regression check

HEAD and main are measured on the same runner. The tolerance is 5% of the main median or 2 ms, whichever is larger. A regression requires both the median slowdown and the gap between the fastest retained HEAD sample and slowest retained main sample to exceed this tolerance, after trimming up to 10% from each tail. Suspected regressions are rerun once with target order reversed and only fail if reproduced. This conservative noise guard is not a statistical confidence interval.

Inconclusive rows do not fail the check. They remain visible for performance review. Bencher retains absolute minimum timings for historical tracking; historical alerts do not gate this PR. Sequential measurements can still be affected by runner drift.

Scenario Engine main median HEAD median Change Tolerance Result
isolated-fresh-restore-cold-cache-cold-store pacquet 2318.74 ms 2388.29 ms 3.0% 115.94 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store pnpr 1427.67 ms 1541.58 ms 8.0% 71.38 ms Inconclusive (overlapping samples)
isolated-fresh-restore-hot-cache-hot-store pacquet 306.35 ms 335.45 ms 9.5% 15.32 ms Inconclusive (overlapping samples)
isolated-fresh-restore-hot-cache-hot-store pnpr 332.02 ms 289.97 ms -12.7% 16.60 ms Within tolerance
isolated-repeat-install-hot-cache-hot-store pacquet 10.92 ms 12.05 ms 10.3% 2.00 ms Within tolerance
isolated-repeat-install-hot-cache-hot-store pnpr 10.62 ms 10.92 ms 2.8% 2.00 ms Within tolerance
isolated-repeat-install-cold-cache-hot-store pacquet 10.00 ms 9.30 ms -7.0% 2.00 ms Within tolerance
isolated-repeat-install-cold-cache-hot-store pnpr 8.29 ms 8.62 ms 4.0% 2.00 ms Within tolerance
isolated-fresh-install-cold-cache-cold-store pacquet 2709.86 ms 2611.48 ms -3.6% 135.49 ms Within tolerance
isolated-fresh-install-cold-cache-cold-store pnpr 1503.28 ms 1568.48 ms 4.3% 75.16 ms Within tolerance
isolated-fresh-install-hot-cache-hot-store pacquet 446.68 ms 491.82 ms 10.1% 22.33 ms Inconclusive (overlapping samples)
isolated-fresh-install-hot-cache-hot-store pnpr 301.74 ms 301.18 ms -0.2% 15.09 ms Within tolerance
isolated-fresh-install-cold-cache-hot-store pacquet 1791.13 ms 1770.79 ms -1.1% 89.56 ms Within tolerance
isolated-fresh-install-cold-cache-hot-store pnpr 369.60 ms 381.48 ms 3.2% 18.48 ms Within tolerance
isolated-fresh-resolve-hot-cache-offline pacquet 284.79 ms 286.24 ms 0.5% 14.24 ms Within tolerance
isolated-fresh-resolve-hot-cache-offline pnpr 101.05 ms 99.77 ms -1.3% 5.05 ms Within tolerance
isolated-peer-heavy-resolve-hot-cache-offline pacquet 231.47 ms 305.12 ms 31.8% 11.57 ms Inconclusive (not reproduced)
isolated-linked-workspace-resolve-hot-cache-offline pacquet 227.51 ms 247.26 ms 8.7% 11.38 ms Inconclusive (overlapping samples)
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pacquet 4479.61 ms 4439.55 ms -0.9% 223.98 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pnpr 3658.84 ms 3504.60 ms -4.2% 182.94 ms Within tolerance
gvs-fresh-restore-hot-cache-hot-store pacquet 276.62 ms 293.85 ms 6.2% 13.83 ms Inconclusive (overlapping samples)
gvs-fresh-restore-hot-cache-hot-store pnpr 195.78 ms 179.92 ms -8.1% 9.79 ms Within tolerance

Integrated-Benchmark Report (Linux)

Commit: 808d75b5bbe7

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

The tables below show mean ± σ. Bencher tracks absolute minimum latency; PR regression checks compare HEAD and main samples from the same runner. Historical timing alerts do not gate PRs.

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.381 ± 0.077 2.280 2.521 1.66 ± 0.14
pacquet@main 2.398 ± 0.140 2.274 2.613 1.67 ± 0.16
pnpr@HEAD 1.513 ± 0.126 1.289 1.639 1.05 ± 0.12
pnpr@main 1.435 ± 0.110 1.309 1.621 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.38145986266,
      "stddev": 0.07714623415811661,
      "median": 2.38829406086,
      "user": 1.37756942,
      "system": 1.4340892399999998,
      "min": 2.27950766086,
      "max": 2.52110077086
    },
    {
      "command": "pacquet@main",
      "mean": 2.39830453156,
      "stddev": 0.1399352998170476,
      "median": 2.31873508136,
      "user": 1.3450759199999995,
      "system": 1.3868682399999996,
      "min": 2.27405070386,
      "max": 2.61312823986
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.51315246496,
      "stddev": 0.12648288777157307,
      "median": 1.54157505986,
      "user": 1.1711951199999997,
      "system": 1.2274645400000002,
      "min": 1.28905259486,
      "max": 1.63860787086
    },
    {
      "command": "pnpr@main",
      "mean": 1.43453381556,
      "stddev": 0.1095980984786393,
      "median": 1.42767040286,
      "user": 1.32202902,
      "system": 1.3602980400000002,
      "min": 1.30906162886,
      "max": 1.62128878686
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 327.8 ± 37.9 261.9 377.5 1.12 ± 0.14
pacquet@main 303.6 ± 34.7 258.2 363.4 1.04 ± 0.13
pnpr@HEAD 291.4 ± 12.1 268.4 309.5 1.00
pnpr@main 324.2 ± 23.9 288.6 357.8 1.11 ± 0.09
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.32778667928000005,
      "stddev": 0.037930705895472906,
      "median": 0.33545153208,
      "user": 0.38161666,
      "system": 0.7370034799999998,
      "min": 0.26194865358,
      "max": 0.37754378458000004
    },
    {
      "command": "pacquet@main",
      "mean": 0.30363392948,
      "stddev": 0.03472073655187404,
      "median": 0.30635409958000004,
      "user": 0.36364005999999993,
      "system": 0.6662960800000001,
      "min": 0.25816024758,
      "max": 0.36338846358000004
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.29139101318,
      "stddev": 0.012081279834945276,
      "median": 0.28997166008,
      "user": 0.30958275999999996,
      "system": 0.6370437799999998,
      "min": 0.26835643258,
      "max": 0.30949728758
    },
    {
      "command": "pnpr@main",
      "mean": 0.32417802728000006,
      "stddev": 0.023941076227217896,
      "median": 0.33201967558,
      "user": 0.36392196,
      "system": 0.6977988799999998,
      "min": 0.28861983158000004,
      "max": 0.35778356258000005
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 12.3 ± 1.0 10.4 15.0 1.13 ± 0.14
pacquet@main 11.1 ± 1.1 9.0 14.0 1.02 ± 0.13
pnpr@HEAD 11.1 ± 0.9 9.3 14.1 1.02 ± 0.12
pnpr@main 10.9 ± 0.9 9.5 14.4 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.01227115791425925,
      "stddev": 0.001006618610495806,
      "median": 0.012046899279999999,
      "user": 0.006895017407407402,
      "system": 0.006793030925925926,
      "min": 0.01042473778,
      "max": 0.01502427278
    },
    {
      "command": "pacquet@main",
      "mean": 0.011127702000472446,
      "stddev": 0.0010669622578446288,
      "median": 0.01091783778,
      "user": 0.00625429700787402,
      "system": 0.006148007322834643,
      "min": 0.00896341478,
      "max": 0.01399428178
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.011106139987070711,
      "stddev": 0.0008757198224033669,
      "median": 0.010919532780000001,
      "user": 0.006157339797979799,
      "system": 0.006202031212121211,
      "min": 0.009283374779999999,
      "max": 0.01405783278
    },
    {
      "command": "pnpr@main",
      "mean": 0.010857845522616033,
      "stddev": 0.0009491372698233519,
      "median": 0.010617427779999999,
      "user": 0.006622265063291136,
      "system": 0.0054561661603375515,
      "min": 0.009510819779999999,
      "max": 0.01439136278
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 9.6 ± 0.9 8.2 14.3 1.07 ± 0.16
pacquet@main 10.2 ± 1.4 7.8 14.0 1.15 ± 0.20
pnpr@HEAD 8.9 ± 1.0 7.4 13.7 1.00
pnpr@main 9.1 ± 1.8 7.1 18.4 1.02 ± 0.23
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.009558760526919835,
      "stddev": 0.000890233975300477,
      "median": 0.00929750424,
      "user": 0.005790023375527426,
      "system": 0.004589406329113924,
      "min": 0.008187981240000001,
      "max": 0.014252352240000002
    },
    {
      "command": "pacquet@main",
      "mean": 0.010208201671818193,
      "stddev": 0.0013649769376304383,
      "median": 0.009998080240000002,
      "user": 0.006381060151515148,
      "system": 0.0047196837121212115,
      "min": 0.00783081924,
      "max": 0.014048179240000002
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.008913085945263157,
      "stddev": 0.000985719036938413,
      "median": 0.00862030224,
      "user": 0.005536704210526321,
      "system": 0.004200835438596492,
      "min": 0.007410580240000001,
      "max": 0.013716135240000002
    },
    {
      "command": "pnpr@main",
      "mean": 0.009066413030123456,
      "stddev": 0.0018241685231135084,
      "median": 0.008288339240000001,
      "user": 0.005635362386831272,
      "system": 0.004211860905349793,
      "min": 0.00709629924,
      "max": 0.018376309240000003
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.632 ± 0.078 2.501 2.761 1.70 ± 0.12
pacquet@main 2.749 ± 0.174 2.514 3.083 1.78 ± 0.16
pnpr@HEAD 1.592 ± 0.125 1.443 1.884 1.03 ± 0.11
pnpr@main 1.547 ± 0.101 1.455 1.763 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.6316973561,
      "stddev": 0.0782192046367472,
      "median": 2.6114794692,
      "user": 2.5374372800000002,
      "system": 1.9639965599999996,
      "min": 2.5011580927,
      "max": 2.7614317007
    },
    {
      "command": "pacquet@main",
      "mean": 2.7494631584,
      "stddev": 0.1741743457153126,
      "median": 2.7098636681999997,
      "user": 2.9320444800000005,
      "system": 2.12385186,
      "min": 2.5135033907,
      "max": 3.0828402887
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.5915976314000002,
      "stddev": 0.12506405003985116,
      "median": 1.5684795036999999,
      "user": 1.7788061799999997,
      "system": 1.65207156,
      "min": 1.4432219997,
      "max": 1.8844237107000001
    },
    {
      "command": "pnpr@main",
      "mean": 1.5469300062999998,
      "stddev": 0.1014292597974726,
      "median": 1.5032806001999999,
      "user": 1.7154865799999997,
      "system": 1.66612126,
      "min": 1.4546545887,
      "max": 1.7633341177
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 492.6 ± 40.5 428.8 556.3 1.66 ± 0.15
pacquet@main 454.3 ± 34.2 409.1 527.6 1.53 ± 0.13
pnpr@HEAD 297.3 ± 12.4 278.4 310.6 1.00
pnpr@main 303.5 ± 19.5 264.1 330.1 1.02 ± 0.08
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.4925962115,
      "stddev": 0.04052842399713888,
      "median": 0.4918173048000001,
      "user": 0.6745326199999999,
      "system": 0.7826715399999999,
      "min": 0.4287970618,
      "max": 0.5562758188000001
    },
    {
      "command": "pacquet@main",
      "mean": 0.45425673290000007,
      "stddev": 0.03417642641100993,
      "median": 0.44668203930000006,
      "user": 0.6202849199999999,
      "system": 0.70353994,
      "min": 0.40905137680000003,
      "max": 0.5275945138000001
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.2972857546,
      "stddev": 0.012418930777229293,
      "median": 0.3011762638,
      "user": 0.27558481999999995,
      "system": 0.5573462399999999,
      "min": 0.2784122698,
      "max": 0.3105805258
    },
    {
      "command": "pnpr@main",
      "mean": 0.30348753070000006,
      "stddev": 0.019460160282128353,
      "median": 0.3017366213,
      "user": 0.27954912,
      "system": 0.5628865399999998,
      "min": 0.2641207268,
      "max": 0.33013302580000004
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.771 ± 0.030 1.726 1.811 4.85 ± 0.40
pacquet@main 1.802 ± 0.059 1.743 1.953 4.93 ± 0.43
pnpr@HEAD 0.382 ± 0.022 0.355 0.422 1.05 ± 0.10
pnpr@main 0.365 ± 0.030 0.299 0.399 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.7706123231600004,
      "stddev": 0.02973392914514313,
      "median": 1.7707916510600001,
      "user": 1.19451256,
      "system": 1.0244188200000002,
      "min": 1.7259348645600001,
      "max": 1.8109221315600001
    },
    {
      "command": "pacquet@main",
      "mean": 1.8018644169600002,
      "stddev": 0.05932325853540027,
      "median": 1.7911286670600002,
      "user": 1.2800739599999997,
      "system": 1.06741972,
      "min": 1.74287341256,
      "max": 1.9528582895600002
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.38227521186,
      "stddev": 0.021567675506940536,
      "median": 0.38147943556,
      "user": 0.3805249599999999,
      "system": 0.7130470199999999,
      "min": 0.35507995956,
      "max": 0.42231705756
    },
    {
      "command": "pnpr@main",
      "mean": 0.36538968986000003,
      "stddev": 0.029744025184430783,
      "median": 0.36959975406,
      "user": 0.35546906,
      "system": 0.69158442,
      "min": 0.29931461656,
      "max": 0.39898788356
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 305.0 ± 54.6 246.5 386.0 3.06 ± 0.57
pacquet@main 294.6 ± 42.5 237.4 391.8 2.95 ± 0.46
pnpr@HEAD 99.8 ± 5.6 90.7 112.7 1.00
pnpr@main 102.6 ± 7.9 90.3 119.6 1.03 ± 0.10
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.30504691491999997,
      "stddev": 0.054638730771684636,
      "median": 0.28623523622,
      "user": 0.3005069,
      "system": 0.10991120000000001,
      "min": 0.24645462172000002,
      "max": 0.38602208972
    },
    {
      "command": "pacquet@main",
      "mean": 0.29457969781090904,
      "stddev": 0.04250176030017709,
      "median": 0.28478651072,
      "user": 0.2885440090909091,
      "system": 0.11828346363636362,
      "min": 0.23740140572,
      "max": 0.39178891672
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.09981131620000001,
      "stddev": 0.005635963164523433,
      "median": 0.09976639272000001,
      "user": 0.03503094,
      "system": 0.020941816000000002,
      "min": 0.09074272372,
      "max": 0.11265592472
    },
    {
      "command": "pnpr@main",
      "mean": 0.10262887296000002,
      "stddev": 0.007854796751551733,
      "median": 0.10104667572,
      "user": 0.04034425999999999,
      "system": 0.01812382,
      "min": 0.09025586672,
      "max": 0.11963254772000001
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 307.0 ± 20.8 282.9 343.2 1.30 ± 0.11
pacquet@main 236.2 ± 11.6 219.0 256.6 1.00
pnpm@HEAD 3995.3 ± 418.1 3457.0 4807.8 16.91 ± 1.96

Confirmation (reversed target order)

Command Mean [s] Min [s] Max [s] Relative
pnpm@HEAD 4.038 ± 0.260 3.577 4.337 15.14 ± 1.11
pacquet@main 0.267 ± 0.009 0.249 0.281 1.00
pacquet@HEAD 0.267 ± 0.013 0.251 0.282 1.00 ± 0.06
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.30704765827333336,
      "stddev": 0.020765737147967995,
      "median": 0.30511858294,
      "user": 0.32621989333333334,
      "system": 0.05946478444444444,
      "min": 0.28288789694,
      "max": 0.34315287494
    },
    {
      "command": "pacquet@main",
      "mean": 0.2362438818288889,
      "stddev": 0.011639110495485603,
      "median": 0.23147216994000003,
      "user": 0.24871822666666668,
      "system": 0.047849451111111115,
      "min": 0.21898460394000002,
      "max": 0.25664363094
    },
    {
      "command": "pnpm@HEAD",
      "mean": 3.995303321051111,
      "stddev": 0.4181086032436757,
      "median": 3.94529415694,
      "user": 6.070945226666667,
      "system": 0.44003322888888896,
      "min": 3.45700777594,
      "max": 4.80781710894
    }
  ],
  "confirmation": {
    "results": [
      {
        "command": "pnpm@HEAD",
        "mean": 4.038196568155555,
        "stddev": 0.2601460645241363,
        "median": 4.1214874226,
        "user": 6.1046379377777775,
        "system": 0.43561591555555557,
        "min": 3.5766726496,
        "max": 4.3368980076
      },
      {
        "command": "pacquet@main",
        "mean": 0.26664202293333333,
        "stddev": 0.009465307673758933,
        "median": 0.2670453326,
        "user": 0.27402316,
        "system": 0.06044269333333333,
        "min": 0.2491482596,
        "max": 0.2807736436
      },
      {
        "command": "pacquet@HEAD",
        "mean": 0.2669225071555556,
        "stddev": 0.013146000230531078,
        "median": 0.26136027359999997,
        "user": 0.2733876044444445,
        "system": 0.054889582222222205,
        "min": 0.2506446166,
        "max": 0.28189152959999997
      }
    ]
  }
}

Scenario: Isolated linker: linked-workspace resolve, hot cache, offline

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 254.8 ± 20.6 229.9 301.4 1.11 ± 0.12
pacquet@main 230.4 ± 17.6 213.7 263.7 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.25481557900181817,
      "stddev": 0.020604718170475284,
      "median": 0.24726062182,
      "user": 0.20266172181818182,
      "system": 0.10069672545454544,
      "min": 0.22987250882000002,
      "max": 0.30135935682000003
    },
    {
      "command": "pacquet@main",
      "mean": 0.23035281909272728,
      "stddev": 0.017649329323386385,
      "median": 0.22750885182,
      "user": 0.18833335818181818,
      "system": 0.08297872545454545,
      "min": 0.21369259982,
      "max": 0.26374234882
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.499 ± 0.133 4.364 4.705 1.27 ± 0.05
pacquet@main 4.508 ± 0.119 4.375 4.733 1.27 ± 0.05
pnpr@HEAD 3.539 ± 0.095 3.438 3.774 1.00
pnpr@main 3.634 ± 0.083 3.483 3.725 1.03 ± 0.04
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.499343474080001,
      "stddev": 0.13291424499699467,
      "median": 4.4395513612799995,
      "user": 1.6877657399999997,
      "system": 1.6509147599999998,
      "min": 4.36371479628,
      "max": 4.70452737128
    },
    {
      "command": "pacquet@main",
      "mean": 4.5075948628799996,
      "stddev": 0.11911566146499084,
      "median": 4.4796068172800005,
      "user": 1.5899732399999995,
      "system": 1.55962456,
      "min": 4.37468179928,
      "max": 4.73347271628
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.53860710008,
      "stddev": 0.09472390523460189,
      "median": 3.50460256478,
      "user": 1.50182324,
      "system": 1.44846506,
      "min": 3.43766415528,
      "max": 3.77412074528
    },
    {
      "command": "pnpr@main",
      "mean": 3.6337033330800006,
      "stddev": 0.08321301557137274,
      "median": 3.6588357022799998,
      "user": 1.7365448399999999,
      "system": 1.65581986,
      "min": 3.48257731928,
      "max": 3.72485472728
    }
  ]
}

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

Same install as the isolated fresh-restore hot/hot scenario, into the shared virtual store, the layout pnpm 12 installs into by default. Scenarios run on separate machines, so compare main and branch within each table.

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 294.3 ± 14.8 262.8 315.4 1.63 ± 0.11
pacquet@main 243.4 ± 66.9 157.8 315.4 1.35 ± 0.38
pnpr@HEAD 180.2 ± 7.3 163.4 193.9 1.00
pnpr@main 190.7 ± 10.9 175.1 207.0 1.06 ± 0.07
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.29425331392,
      "stddev": 0.014795418201237807,
      "median": 0.29385252712000004,
      "user": 0.34408836000000004,
      "system": 0.2818843,
      "min": 0.26277648612000004,
      "max": 0.31544771312000003
    },
    {
      "command": "pacquet@main",
      "mean": 0.24337659772000003,
      "stddev": 0.0669116100579821,
      "median": 0.27661600062,
      "user": 0.29545256,
      "system": 0.24542129999999998,
      "min": 0.15776355111999998,
      "max": 0.31542923412
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.18023809551999997,
      "stddev": 0.007320729631564708,
      "median": 0.17992007812,
      "user": 0.22005889333333334,
      "system": 0.16576736666666664,
      "min": 0.16339517212,
      "max": 0.19390803312
    },
    {
      "command": "pnpr@main",
      "mean": 0.1907023910430769,
      "stddev": 0.01090157066526212,
      "median": 0.19578307312,
      "user": 0.2205107907692308,
      "system": 0.1738368384615385,
      "min": 0.17507798612,
      "max": 0.20697140712
    }
  ]
}

@lazerg
lazerg marked this pull request as ready for review October 7, 2026 05:07
@lazerg
lazerg requested a review from zkochan as a code owner October 7, 2026 05:07
@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 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.

Your trial has ended. Reactivate Greptile to resume code reviews.

@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Oct 7, 2026
@zkochan
zkochan force-pushed the fix/issue-16683-injected-files-field branch from 01e8b8e to ebadd4c Compare October 7, 2026 06:22

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

Your trial has ended. Reactivate Greptile to resume code reviews.

@qodo-code-review

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

Copy link
Copy Markdown

Code Review by Qodo

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

Grey Divider


Remediation recommended

1. The release note hides the prior bug ✓ Resolved
Description
The changeset describes the old extra files only as files that no longer appear, instead of giving
the previous behavior its own past-tense sentence. That combines the corrected behavior and
historical behavior in one release-note entry, so readers cannot distinguish what changed from what
users now observe.
Code

.changeset/injected-copy-files-field-dedicated-lockfiles.md[8]

+With `sharedWorkspaceLockfile: false`, an injected workspace package now holds only the files its `files` field selects, also when the package is installed in the same run. Files such as `tsconfig.json` no longer appear in the injected copy unless `deployAllFiles` is set [#16683](https://github.com/pnpm/pnpm/issues/16683).
Relevance

●● Moderate

Recent precedents conflict on requiring separate past-tense bug descriptions in changeset prose.

PR-#16662
PR-#16678
PR-#16650

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The changeset says the injected package now holds selected files and that tsconfig.json files no
longer appear, but it does not state the previous behavior as a separate past-tense sentence. This
violates the required release-note structure for bug fixes.

Rule 3058498: Describe previous buggy behavior in a separate past-tense sentence
.changeset/injected-copy-files-field-dedicated-lockfiles.md[8-8]

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 mentions the previous extra files as a trailing `no longer appear` clause rather than as a separate past-tense sentence.

## Fix Focus Areas
- .changeset/injected-copy-files-field-dedicated-lockfiles.md[8-8]

## Recommended Fix
Rewrite the entry as separate sentences. State the old behavior in past tense, for example, `Previously, an injected workspace package included files outside its files field when installed in the same run.` Then state the current behavior and the `deployAllFiles` exception in a separate sentence.

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



Informational

2. Release notes target both stacks together 📘 Rule violation § Compliance
Description
The new changeset combines pnpm and pacquet with the TypeScript package bumps in one file.
Because this PR changes both the pnpm v11 and v12 implementations, the release metadata reaches both
version lines without separate, version-specific changesets.
Code

.changeset/injected-copy-files-field-dedicated-lockfiles.md[R2-5]

+"@pnpm/workspace.injected-deps-syncer": patch
+"@pnpm/installing.commands": patch
+"pnpm": patch
+"pacquet": patch
Relevance

● Weak

A same-day precedent rejected splitting v11 and v12 changesets in this repository.

PR-#16678

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The checklist requires separate changesets when a single PR touches both the TypeScript pnpm v11
stack and the Rust pnpm v12 stack. The added changeset lists both pnpm and pacquet, along with
the v11 packages, in the same front matter.

Rule 713436: Changesets for pnpm v11 vs v12 (pacquet) must target the correct package and bump type
.changeset/injected-copy-files-field-dedicated-lockfiles.md[2-5]

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 combines pnpm v11 TypeScript packages and the pnpm v12 `pacquet` package in one file, while the compliance rule requires separate changesets when both stacks are changed.

## Fix Focus Areas
- .changeset/injected-copy-files-field-dedicated-lockfiles.md[2-5]

## Recommended Fix
Replace the combined changeset with separate changeset files: one targeting the affected pnpm v11 packages with `pnpm: patch`, and another targeting `pacquet: patch`. Keep each release note scoped to the behavior shipped by its corresponding stack.

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

Dismiss ↗ | View ↗


Grey Divider

Context sources
✅ Compliance rules (platform): 66 rules
Review mode: Auto: ⏭️ Skipped: Changeset prose only; no runtime behavior or reviewable defect.

Grey Divider

Tip of the day
💡 Did you know, you can route each severity your way: inline, summary, both, or drop

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Previous reviews

Review updated until commit 808d75b

Results up to commit ebadd4c ⚖️ Balanced


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


Remediation recommended
1. The release note hides the prior bug ✓ Resolved
Description
The changeset describes the old extra files only as files that no longer appear, instead of giving
the previous behavior its own past-tense sentence. That combines the corrected behavior and
historical behavior in one release-note entry, so readers cannot distinguish what changed from what
users now observe.
Code

.changeset/injected-copy-files-field-dedicated-lockfiles.md[8]

+With `sharedWorkspaceLockfile: false`, an injected workspace package now holds only the files its `files` field selects, also when the package is installed in the same run. Files such as `tsconfig.json` no longer appear in the injected copy unless `deployAllFiles` is set [#16683](https://github.com/pnpm/pnpm/issues/16683).
Relevance

●● Moderate

Recent precedents conflict on requiring separate past-tense bug descriptions in changeset prose.

PR-#16662
PR-#16678
PR-#16650

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The changeset says the injected package now holds selected files and that tsconfig.json files no
longer appear, but it does not state the previous behavior as a separate past-tense sentence. This
violates the required release-note structure for bug fixes.

Rule 3058498: Describe previous buggy behavior in a separate past-tense sentence
.changeset/injected-copy-files-field-dedicated-lockfiles.md[8-8]

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 mentions the previous extra files as a trailing `no longer appear` clause rather than as a separate past-tense sentence.

## Fix Focus Areas
- .changeset/injected-copy-files-field-dedicated-lockfiles.md[8-8]

## Recommended Fix
Rewrite the entry as separate sentences. State the old behavior in past tense, for example, `Previously, an injected workspace package included files outside its files field when installed in the same run.` Then state the current behavior and the `deployAllFiles` exception in a separate sentence.

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



Informational
2. Release notes target both stacks together 📘 Rule violation § Compliance
Description
The new changeset combines pnpm and pacquet with the TypeScript package bumps in one file.
Because this PR changes both the pnpm v11 and v12 implementations, the release metadata reaches both
version lines without separate, version-specific changesets.
Code

.changeset/injected-copy-files-field-dedicated-lockfiles.md[R2-5]

+"@pnpm/workspace.injected-deps-syncer": patch
+"@pnpm/installing.commands": patch
+"pnpm": patch
+"pacquet": patch
Relevance

● Weak

A same-day precedent rejected splitting v11 and v12 changesets in this repository.

PR-#16678

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The checklist requires separate changesets when a single PR touches both the TypeScript pnpm v11
stack and the Rust pnpm v12 stack. The added changeset lists both pnpm and pacquet, along with
the v11 packages, in the same front matter.

Rule 713436: Changesets for pnpm v11 vs v12 (pacquet) must target the correct package and bump type
.changeset/injected-copy-files-field-dedicated-lockfiles.md[2-5]

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 combines pnpm v11 TypeScript packages and the pnpm v12 `pacquet` package in one file, while the compliance rule requires separate changesets when both stacks are changed.

## Fix Focus Areas
- .changeset/injected-copy-files-field-dedicated-lockfiles.md[2-5]

## Recommended Fix
Replace the combined changeset with separate changeset files: one targeting the affected pnpm v11 packages with `pnpm: patch`, and another targeting `pacquet: patch`. Keep each release note scoped to the behavior shipped by its corresponding stack.

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

Dismiss ↗ | View ↗


Grey Divider

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.

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

Your trial has ended. Reactivate Greptile to resume code reviews.

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 808d75b

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

@zkochan

zkochan commented Oct 7, 2026

Copy link
Copy Markdown
Member

Review-and-fix pass on this PR:

  • Rebased onto main (no conflicts) and reviewed the full diff. In both stacks the sync now reads the source with !deployAllFiles, the same selection the install uses for directory dependencies. No code changes were needed.
  • Verified the new v12 e2e test catches the bug: it fails with should not hold tsconfig.json when the flag in pipelines.rs is set back to false.
  • Qodo finding 1 (changeset wording): fixed in 808d75b. The old behavior now has its own past-tense sentence.
  • Qodo finding 2 (split the v11 and v12 changesets): declined. Both versions had the same bug, and the fix changes their behavior the same way, so AGENTS.md allows one changeset that names pnpm and pacquet.

Status on 808d75b: all checks green. CodeRabbit approved with no actionable comments. Qodo reports only the declined item. Greptile posts no reviews (trial ended). Nothing else remains within scope.


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

zkochan added a commit that referenced this pull request Oct 17, 2026
…17033)

An injected copy is built by the install from the package files only
(the files field and .npmignore) unless deployAllFiles is set. Every
refresh that runs after a project's own scripts read the source with
every file instead, so the copy gained files the install had left out:
- v12: the sync after lifecycle scripts during install, after `pnpm run`
  and task-pipeline scripts named in syncInjectedDepsAfterScripts, and
  the edit watcher that publishes while such a script runs.
- v11: the same `pnpm run` sync and watcher, and the re-import after
  lifecycle scripts during install.

#16684 fixed the same thing for the dedicated-lockfile sync.
These paths now read the source with includeOnlyPackageFiles set to
!deployAllFiles too, so every writer of an injected copy selects the
same files (pnpm/tasks#145, property B).

The packlist lists a symlinked directory as one entry, where the walk
of every file lists the files under it. The syncers expand such an
entry, so a symlinked directory still reaches the copy as its files.

v12 groups the bin-linking settings of SyncInjectedDeps into
BinLinkSettings to stay under the struct field limit.
zkochan added a commit that referenced this pull request Oct 27, 2026
Every writer of an injected copy, and `pnpm deploy`, read its source
through a `DirectoryFetcher` it built itself, with
`include_only_package_files` computed at each call site as
`!config.deploy_all_files`. #16684 and #17033 were
writers that got that flag wrong.

`pnpm_directory_fetcher::CopyFiles` now owns the decision: the packlist
or every file, symlinks listed by their own path, and no path escape.
The install's directory fetch, the custom fetcher's directory callback,
the sync after scripts, the edit watcher, the dedicated-lockfile sync
and deploy all list their source through `CopyFiles::fetcher`, and take
a `CopyFiles` built from the `deployAllFiles` setting instead of a bool.

This is item 2 of pnpm/tasks#220 for pnpm v12. No behavior changes.

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Injected workspace package copy includes files outside "files" when the package itself is installed in the same run

3 participants