Skip to content

fix(fs-packlist): exclude npm-packlist's default ignore patterns from pack - #16971

Merged
zkochan merged 4 commits into
pnpm:mainfrom
BerkayOzerSahin:fix/pack-default-excludes-16955
Oct 16, 2026
Merged

zkochan merged 4 commits into
pnpm:mainfrom
BerkayOzerSahin:fix/pack-default-excludes-16955

Conversation

@BerkayOzerSahin

@BerkayOzerSahin BerkayOzerSahin commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

pnpm pack and pnpm publish now leave out the files npm-packlist excludes by default. Before this change, pnpm 12 shipped them, while npm and pnpm 11 drop them:

  • .*.swp (editor swap files, which can hold secrets)
  • ._* (macOS AppleDouble files and folders)
  • .lock-wscript
  • .wafpickle-*
  • build/config.gypi
  • archived-packages/
  • the contents of a .DS_Store folder

Closes #16955.

pnpm 11 is not affected: it delegates to npm-packlist 10.0.4, so this is a v12-only fix.

The rules match npm's semantics:

  • Applied in every directory. sub/build/config.gypi and lib/.lock-wscript are excluded too.
  • Case-insensitive in ASCII, like npm's matcher.
  • Overridable:
    • a files entry naming the file, main/bin/browser, or a root .npmignore negation brings the file back;
    • files: ["lib"] still leaves out lib/._a.js, as npm does.

Real tarballs from the fixed binary match npm 11.19.1 in every scenario tested, including the issue's reproduction, nested anchored paths, files globs, named files, main/bin, workspace-inherited ignore files, and Unicode look-alike names.

Known differences that predate this change (not changed here, tracked as a follow-up):

  • A files entry or a nested main/bin naming a file inside a default-excluded directory two or more levels deep: v12 ships it, npm drops it.
  • npm skips its defaults at the root of a non-linked bundled dependency. v12 applies them there, which is stricter.
  • bun.lockb at the root is not excluded. Nested package-lock.json/yarn.lock/pnpm-lock.yaml are over-excluded.
  • .DS_Store, npm-debug.log, *.orig and .npmrc stay hard, case-sensitive exclusions.

Squash Commit Body

npm-packlist applies a set of default ignore rules in every directory it
walks, before that directory's own ignore files. pnpm 12's port of the
ignore walk never injected them, so `pnpm pack` and `pnpm publish` shipped
editor swap files, AppleDouble files, node-waf/node-gyp build leftovers and
archived-packages/.

The missing defaults from npm-packlist 10.0.4 are now soft ignore rules in
fs-packlist's walker (ignore_walk/default_rules.rs):

    /.lock-wscript  /.wafpickle-*  /build/config.gypi  .*.swp
    ._*  **/._*/**  **/.DS_Store/**  /archived-packages/**

They are parsed once and evaluated before each directory's own rules, at
every ancestor level, as ignore-walk's filterEntry does. Every child
directory gets them. The package root gets them only without a `files`
field, because npm's root `files` rules ('*' plus re-includes) override root
defaults entirely. They are not added to should_always_exclude or
is_pruned, so a `files` entry, main/bin/browser, or a negation can still
re-include a file, as in npm.

Evaluating eight rules at every ancestor for every entry made
`pnpm pack --dry-run` 3-6x slower on a 46k-file tree. The same walk serves
git and directory dependency imports. A per-segment gate now skips the
defaults for paths with no segment a default rule can match, so the
no-user-rules shortcut is kept. The default rules and the gate compare in
ASCII case only, as minimatch's `nocase` regexes for these patterns do: U+212A
(Kelvin) does not match `k`, so a name that matches only through Unicode
folding keeps shipping, as it does with npm. A test fails
if a pattern is added to DEFAULT_PATTERNS without a matching sample.

Closes pnpm/pnpm#16955

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-sonnet-5-5).

🤖 Generated with Claude Code


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

Summary by CodeRabbit

  • New Features
    • Package archives created by packing or publishing now exclude editor swap files, macOS AppleDouble files, .lock-wscript, Waf pickle files, build/config.gypi, and archived-packages/ by default. These exclusions also apply to matching paths in nested directories and use ASCII case-insensitive matching.
  • Bug Fixes
    • Default exclusions now work consistently alongside package inclusion rules. Files explicitly named in files can still be included.

@welcome

welcome Bot commented Oct 16, 2026

Copy link
Copy Markdown

💖 Thanks for opening this pull request! 💖
Please be patient and we will get back to you as soon as we can.

@coderabbitai

coderabbitai Bot commented Oct 16, 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: e2b4f45b-c380-4c98-aa34-cefbec5aec60
📥 Commits

Reviewing files that changed from the base of the PR and between d1d8e73 and 187a8a5.

📒 Files selected for processing: 4
  • pnpm/crates/fs-packlist/src/ignore_walk/default_rules.rs
  • pnpm/crates/fs-packlist/src/ignore_walk/rule.rs
  • pnpm/crates/fs-packlist/src/ignore_walk/segment.rs
  • pnpm/crates/fs-packlist/src/tests/default_excludes.rs

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

📝 Walkthrough

The packlist walker now applies npm-packlist default exclusions alongside ignore-file rules. Tests cover excluded files and directories, inclusion overrides, and packed tarball contents.

Changes: Default packlist exclusions

Layer / File(s) Summary
Define and match default patterns
pnpm/crates/fs-packlist/src/ignore_walk/default_rules.rs, pnpm/crates/fs-packlist/src/ignore_walk/rule.rs, pnpm/crates/fs-packlist/src/ignore_walk/segment.rs
The code adds npm-packlist default patterns with ASCII-case-insensitive matching. The segment parser supports ASCII and Unicode literal matching modes.
Match and apply default rules
pnpm/crates/fs-packlist/src/ignore_walk.rs
The walker tracks defaults for root and child directories. It checks candidate paths and evaluates eligible defaults before local ignore rules.
Verify packlist and tarball behavior
pnpm/crates/fs-packlist/src/ignore_walk/tests.rs, pnpm/crates/fs-packlist/src/tests.rs, pnpm/crates/fs-packlist/src/tests/default_excludes.rs, pnpm/crates/pack/src/tests.rs, .changeset/pack-default-excludes.md, cspell.json
Tests cover default exclusions, case matching, ignore and files overrides, main and bin entries, and packed tarball contents. The changeset documents the exclusions and explicit-file exception.

Priority: ➖ Normal

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

Change: Bug fix · Severity of issue fixed: Medium

Assessment against linked issues

Objective Addressed Explanation
Exclude the listed junk files from pnpm 12 pack and publish output, while allowing explicit files entries and relevant manifest or ignore overrides [#16955] ✅

Suggested labels: product: pacquet

Merge Risk: ⚪ Minimal · up to 187a8

No actionable packing regression remains identified; the change is ready for normal merge checks.

✨ Finishing Touches: 💡 1
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · 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 16, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.01961% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 92.59%. Comparing base (7baeaaa) to head (187a8a5).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pnpm/crates/fs-packlist/src/ignore_walk/segment.rs 90.90% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #16971      +/-   ##
==========================================
- Coverage   92.59%   92.59%   -0.01%     
==========================================
  Files        1750     1751       +1     
  Lines      225564   225643      +79     
==========================================
+ Hits       208859   208928      +69     
- Misses      16705    16715      +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.

@github-actions

github-actions Bot commented Oct 16, 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 2502.21 ms 2463.89 ms -1.5% 125.11 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store pnpr 1575.27 ms 1472.00 ms -6.6% 78.76 ms Within tolerance
isolated-fresh-restore-hot-cache-hot-store pacquet 277.94 ms 274.45 ms -1.3% 13.90 ms Within tolerance
isolated-fresh-restore-hot-cache-hot-store pnpr 287.12 ms 262.84 ms -8.5% 14.36 ms Within tolerance
isolated-repeat-install-hot-cache-hot-store pacquet 10.72 ms 10.82 ms 0.9% 2.00 ms Within tolerance
isolated-repeat-install-hot-cache-hot-store pnpr 11.92 ms 10.90 ms -8.6% 2.00 ms Within tolerance
isolated-repeat-install-cold-cache-hot-store pacquet 11.62 ms 11.32 ms -2.6% 2.00 ms Within tolerance
isolated-repeat-install-cold-cache-hot-store pnpr 11.17 ms 11.23 ms 0.6% 2.00 ms Within tolerance
isolated-fresh-install-cold-cache-cold-store pacquet 2794.94 ms 2754.02 ms -1.5% 139.75 ms Within tolerance
isolated-fresh-install-cold-cache-cold-store pnpr 1518.74 ms 1673.55 ms 10.2% 75.94 ms Inconclusive (overlapping samples)
isolated-fresh-install-hot-cache-hot-store pacquet 503.29 ms 497.53 ms -1.1% 25.16 ms Within tolerance
isolated-fresh-install-hot-cache-hot-store pnpr 403.10 ms 340.25 ms -15.6% 20.16 ms Within tolerance
isolated-fresh-install-cold-cache-hot-store pacquet 1928.23 ms 1779.83 ms -7.7% 96.41 ms Within tolerance
isolated-fresh-install-cold-cache-hot-store pnpr 347.18 ms 324.85 ms -6.4% 17.36 ms Within tolerance
isolated-fresh-resolve-hot-cache-offline pacquet 293.50 ms 299.59 ms 2.1% 14.67 ms Within tolerance
isolated-fresh-resolve-hot-cache-offline pnpr 100.69 ms 107.86 ms 7.1% 5.03 ms Inconclusive (overlapping samples)
isolated-peer-heavy-resolve-hot-cache-offline pacquet 310.85 ms 298.13 ms -4.1% 15.54 ms Within tolerance
isolated-linked-workspace-resolve-hot-cache-offline pacquet 255.75 ms 272.59 ms 6.6% 12.79 ms Inconclusive (overlapping samples)
isolated-injected-workspace-repeat-install-hot-cache-hot-store pacquet 108.11 ms 95.38 ms -11.8% 5.41 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pacquet 4548.48 ms 4483.57 ms -1.4% 227.42 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pnpr 3567.66 ms 3499.16 ms -1.9% 178.38 ms Within tolerance
gvs-fresh-restore-hot-cache-hot-store pacquet 129.39 ms 128.90 ms -0.4% 6.47 ms Within tolerance
gvs-fresh-restore-hot-cache-hot-store pnpr 136.65 ms 137.49 ms 0.6% 6.83 ms Within tolerance
store-only-unlocked-direct-deps-cold-cache-hot-store pacquet 1169.88 ms 1173.79 ms 0.3% 58.49 ms Within tolerance

Integrated-Benchmark Report (Linux)

Commit: 187a8a50d786

Regular scenarios report direct and pnpr installs. The peer-heavy resolver scenario compares current Rust, main Rust, and TypeScript pnpm; the linked and injected workspace scenarios compare 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.564 ± 0.175 2.377 2.831 1.71 ± 0.17
pacquet@main 2.487 ± 0.101 2.308 2.644 1.66 ± 0.14
pnpr@HEAD 1.497 ± 0.106 1.364 1.731 1.00
pnpr@main 1.556 ± 0.138 1.391 1.832 1.04 ± 0.12
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.56428028578,
      "stddev": 0.1748284095499036,
      "median": 2.4638881807799997,
      "user": 1.85624754,
      "system": 1.7734144,
      "min": 2.37697289978,
      "max": 2.83146530478
    },
    {
      "command": "pacquet@main",
      "mean": 2.4865578864800004,
      "stddev": 0.10053475296672706,
      "median": 2.50221472728,
      "user": 1.74810014,
      "system": 1.6533505000000002,
      "min": 2.30839790878,
      "max": 2.64394307878
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.49690356968,
      "stddev": 0.10631262135524928,
      "median": 1.4719977552799999,
      "user": 1.6363287399999997,
      "system": 1.5531013999999996,
      "min": 1.3637776987799999,
      "max": 1.7312101337799999
    },
    {
      "command": "pnpr@main",
      "mean": 1.5556787089800002,
      "stddev": 0.13792097655424002,
      "median": 1.5752692587800001,
      "user": 1.9068002399999997,
      "system": 1.8386242999999998,
      "min": 1.39104438178,
      "max": 1.83227937278
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 283.0 ± 31.3 250.2 334.4 1.04 ± 0.16
pacquet@main 282.7 ± 23.5 252.2 326.0 1.04 ± 0.14
pnpr@HEAD 272.4 ± 29.7 239.8 337.1 1.00
pnpr@main 310.9 ± 47.3 271.1 400.9 1.14 ± 0.21
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.28304928024,
      "stddev": 0.031340707671996273,
      "median": 0.27445377864,
      "user": 0.3246773399999999,
      "system": 0.6545385400000001,
      "min": 0.25018740514,
      "max": 0.33438003214
    },
    {
      "command": "pacquet@main",
      "mean": 0.28274398414,
      "stddev": 0.02352961710677177,
      "median": 0.27793915664,
      "user": 0.32442544,
      "system": 0.6602748399999999,
      "min": 0.25217709714,
      "max": 0.32597144114
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.27237411074,
      "stddev": 0.029687633267985805,
      "median": 0.26284396014,
      "user": 0.30246344000000003,
      "system": 0.59226634,
      "min": 0.23984070214000003,
      "max": 0.33709272814
    },
    {
      "command": "pnpr@main",
      "mean": 0.31086095933999996,
      "stddev": 0.04732306087485022,
      "median": 0.28711671413999995,
      "user": 0.33594613999999995,
      "system": 0.70970254,
      "min": 0.27112924114,
      "max": 0.40085372514
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 11.1 ± 1.2 8.7 15.5 1.02 ± 0.14
pacquet@main 10.9 ± 0.9 9.1 16.6 1.00
pnpr@HEAD 11.1 ± 1.2 8.5 15.3 1.02 ± 0.14
pnpr@main 12.0 ± 1.5 8.5 16.3 1.10 ± 0.17
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.01111080187442623,
      "stddev": 0.0011737315063824801,
      "median": 0.010816441440000001,
      "user": 0.006313161967213111,
      "system": 0.0057431778688524626,
      "min": 0.00870099394,
      "max": 0.015498970940000002
    },
    {
      "command": "pacquet@main",
      "mean": 0.01090910095418439,
      "stddev": 0.000942867323383472,
      "median": 0.01072349644,
      "user": 0.00617271829787234,
      "system": 0.005691001843971631,
      "min": 0.00914122594,
      "max": 0.01655358194
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.011106557604974619,
      "stddev": 0.0012101795404571047,
      "median": 0.010896346940000001,
      "user": 0.006512250050761417,
      "system": 0.0056949396954314715,
      "min": 0.00846525794,
      "max": 0.01529384994
    },
    {
      "command": "pnpr@main",
      "mean": 0.012044528559718307,
      "stddev": 0.0015391297515261323,
      "median": 0.011920884940000001,
      "user": 0.006988812394366198,
      "system": 0.006233115915492959,
      "min": 0.008511557940000001,
      "max": 0.01625116194
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 11.9 ± 1.7 8.7 18.3 1.05 ± 0.20
pacquet@main 12.0 ± 1.4 9.9 17.2 1.06 ± 0.18
pnpr@HEAD 11.3 ± 1.3 8.1 17.0 1.00
pnpr@main 11.4 ± 1.9 8.1 25.7 1.02 ± 0.21
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.011868869593654623,
      "stddev": 0.0017229214958563448,
      "median": 0.01131760018,
      "user": 0.0069417391164658705,
      "system": 0.005906569397590361,
      "min": 0.00871915618,
      "max": 0.01826722918
    },
    {
      "command": "pacquet@main",
      "mean": 0.011979020901698115,
      "stddev": 0.0014332979014890993,
      "median": 0.011623695180000001,
      "user": 0.007113502452830188,
      "system": 0.005832839339622643,
      "min": 0.00994037218,
      "max": 0.01721373818
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.01125690634062176,
      "stddev": 0.0013357676307959516,
      "median": 0.01123353218,
      "user": 0.006462732020725389,
      "system": 0.005737309844559585,
      "min": 0.00814206318,
      "max": 0.01702329118
    },
    {
      "command": "pnpr@main",
      "mean": 0.011426487514821435,
      "stddev": 0.0019183634645081851,
      "median": 0.01117009818,
      "user": 0.006828531428571428,
      "system": 0.005476789910714285,
      "min": 0.00814040018,
      "max": 0.02566741518
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.736 ± 0.114 2.593 2.849 1.78 ± 0.10
pacquet@main 2.801 ± 0.058 2.709 2.909 1.82 ± 0.08
pnpr@HEAD 1.675 ± 0.091 1.554 1.785 1.09 ± 0.07
pnpr@main 1.535 ± 0.059 1.458 1.635 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.7364927322599994,
      "stddev": 0.11387857634152251,
      "median": 2.7540156504600004,
      "user": 2.6333430199999994,
      "system": 2.0984966199999997,
      "min": 2.59343504296,
      "max": 2.84933043696
    },
    {
      "command": "pacquet@main",
      "mean": 2.8008348559600003,
      "stddev": 0.05766223037105309,
      "median": 2.79493845796,
      "user": 2.80652382,
      "system": 2.24866282,
      "min": 2.70883375196,
      "max": 2.90946752696
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.6750681831599998,
      "stddev": 0.09053359958309413,
      "median": 1.67355335246,
      "user": 1.87239912,
      "system": 1.8599051199999999,
      "min": 1.55406621396,
      "max": 1.78506272596
    },
    {
      "command": "pnpr@main",
      "mean": 1.5351114957600003,
      "stddev": 0.05930312735886433,
      "median": 1.51874125646,
      "user": 1.4828247199999995,
      "system": 1.5575265200000001,
      "min": 1.45834342096,
      "max": 1.6349967109599999
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 502.6 ± 27.2 465.5 546.3 1.49 ± 0.11
pacquet@main 501.9 ± 29.2 456.7 563.3 1.49 ± 0.12
pnpr@HEAD 337.8 ± 18.1 315.3 368.8 1.00
pnpr@main 415.8 ± 69.7 333.8 527.4 1.23 ± 0.22
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.5025805041,
      "stddev": 0.02721669824477283,
      "median": 0.49753299910000004,
      "user": 0.7204983599999999,
      "system": 0.8131444999999999,
      "min": 0.4655394601,
      "max": 0.5463000741
    },
    {
      "command": "pacquet@main",
      "mean": 0.5018976106,
      "stddev": 0.02921523564269536,
      "median": 0.5032891656,
      "user": 0.7574554599999999,
      "system": 0.7791994000000001,
      "min": 0.45669062610000005,
      "max": 0.5633369171
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.33777712060000004,
      "stddev": 0.01809587831621522,
      "median": 0.34024639310000004,
      "user": 0.29479215999999997,
      "system": 0.6448301999999999,
      "min": 0.31525458710000004,
      "max": 0.36876406310000004
    },
    {
      "command": "pnpr@main",
      "mean": 0.41577070149999995,
      "stddev": 0.06970817041273902,
      "median": 0.4031045811,
      "user": 0.37840055999999994,
      "system": 0.7521442999999999,
      "min": 0.3338045041,
      "max": 0.5274071621
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.784 ± 0.045 1.685 1.840 5.53 ± 0.28
pacquet@main 1.911 ± 0.086 1.770 2.066 5.93 ± 0.37
pnpr@HEAD 0.322 ± 0.014 0.302 0.350 1.00
pnpr@main 0.351 ± 0.039 0.297 0.421 1.09 ± 0.13
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.78436125694,
      "stddev": 0.04524444352785388,
      "median": 1.7798310398400001,
      "user": 1.3388032200000002,
      "system": 1.2392203599999998,
      "min": 1.68491028584,
      "max": 1.84024628884
    },
    {
      "command": "pacquet@main",
      "mean": 1.91070049454,
      "stddev": 0.08574891695759282,
      "median": 1.92822581134,
      "user": 1.5326705200000001,
      "system": 1.4763266599999998,
      "min": 1.7701264138400001,
      "max": 2.0662941858400004
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.32243610924,
      "stddev": 0.013862631979784826,
      "median": 0.32484848484000006,
      "user": 0.29002162,
      "system": 0.6041200600000001,
      "min": 0.30191877384,
      "max": 0.34966185884
    },
    {
      "command": "pnpr@main",
      "mean": 0.35148421084,
      "stddev": 0.038867626564562864,
      "median": 0.34718313334,
      "user": 0.32858632,
      "system": 0.66255266,
      "min": 0.29675522984,
      "max": 0.42128199884
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 298.0 ± 11.9 272.7 315.6 2.94 ± 0.20
pacquet@main 284.8 ± 28.9 233.3 317.9 2.81 ± 0.33
pnpr@HEAD 108.8 ± 7.9 94.1 125.2 1.08 ± 0.10
pnpr@main 101.2 ± 5.7 91.7 114.1 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.29799843826,
      "stddev": 0.011900385516051408,
      "median": 0.29959324536000004,
      "user": 0.28858278,
      "system": 0.10805321999999999,
      "min": 0.27274366086,
      "max": 0.31557144086
    },
    {
      "command": "pacquet@main",
      "mean": 0.28480815026000006,
      "stddev": 0.028925295015926934,
      "median": 0.29349983486000003,
      "user": 0.25347658,
      "system": 0.11622692000000001,
      "min": 0.23325326486000003,
      "max": 0.31789254286
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.10880550752666668,
      "stddev": 0.007927226496362886,
      "median": 0.10786225686,
      "user": 0.04675914666666666,
      "system": 0.01751517,
      "min": 0.09406260386000001,
      "max": 0.12516605386000001
    },
    {
      "command": "pnpr@main",
      "mean": 0.10119584221714285,
      "stddev": 0.005688125456688575,
      "median": 0.10068657986000001,
      "user": 0.04365519428571428,
      "system": 0.016302955714285715,
      "min": 0.09170057186000001,
      "max": 0.11405096286000001
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 300.2 ± 22.8 274.0 337.9 1.00
pacquet@main 312.8 ± 24.8 266.8 348.9 1.04 ± 0.11
pnpm@HEAD 4405.4 ± 272.6 4067.9 4849.1 14.68 ± 1.44
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.30016305565333334,
      "stddev": 0.02277120300076472,
      "median": 0.29812667732000003,
      "user": 0.3079817577777778,
      "system": 0.07242596444444445,
      "min": 0.27403388032000003,
      "max": 0.33786542732
    },
    {
      "command": "pacquet@main",
      "mean": 0.3128269178755555,
      "stddev": 0.024756954569793807,
      "median": 0.31084940732,
      "user": 0.3281140911111111,
      "system": 0.06481563111111112,
      "min": 0.26681580632,
      "max": 0.34891345932
    },
    {
      "command": "pnpm@HEAD",
      "mean": 4.405351501542222,
      "stddev": 0.272609089178395,
      "median": 4.4192207343200005,
      "user": 6.764697424444445,
      "system": 0.4686665199999999,
      "min": 4.06791904732,
      "max": 4.849083831320001
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 281.7 ± 33.9 241.0 371.0 1.09 ± 0.15
pacquet@main 258.5 ± 16.0 233.7 285.5 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.28173685691333333,
      "stddev": 0.03390776107964116,
      "median": 0.27259265058000004,
      "user": 0.21188434666666664,
      "system": 0.12434413666666666,
      "min": 0.24103208808,
      "max": 0.37102764608000005
    },
    {
      "command": "pacquet@main",
      "mean": 0.2584767853527273,
      "stddev": 0.016009373950197456,
      "median": 0.25575232608000004,
      "user": 0.19646708909090907,
      "system": 0.10999481090909091,
      "min": 0.23370092308,
      "max": 0.28550102108000003
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 99.2 ± 8.1 89.9 118.6 1.00
pacquet@main 107.9 ± 7.5 95.3 123.6 1.09 ± 0.12
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.09923612068375,
      "stddev": 0.008067861980909662,
      "median": 0.09537511834000001,
      "user": 0.03756566625,
      "system": 0.06879861625,
      "min": 0.08992766784,
      "max": 0.11859031484
    },
    {
      "command": "pacquet@main",
      "mean": 0.10785181450666667,
      "stddev": 0.007475541968135345,
      "median": 0.10811265584,
      "user": 0.039375834074074086,
      "system": 0.07649712666666666,
      "min": 0.09534002284000001,
      "max": 0.12364780984000001
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.533 ± 0.127 4.416 4.801 1.30 ± 0.04
pacquet@main 4.568 ± 0.195 4.346 4.972 1.31 ± 0.06
pnpr@HEAD 3.497 ± 0.057 3.402 3.596 1.00
pnpr@main 3.573 ± 0.122 3.436 3.853 1.02 ± 0.04
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.533132008840001,
      "stddev": 0.12681956963862606,
      "median": 4.48357397414,
      "user": 1.8706686000000001,
      "system": 1.7461693999999999,
      "min": 4.41550207614,
      "max": 4.80093970614
    },
    {
      "command": "pacquet@main",
      "mean": 4.56768155614,
      "stddev": 0.19492011774413734,
      "median": 4.54848244764,
      "user": 1.6942990999999998,
      "system": 1.6112007,
      "min": 4.34599773114,
      "max": 4.9720105301399995
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.4967394385399997,
      "stddev": 0.05717971640734765,
      "median": 3.49916426764,
      "user": 1.5317428999999998,
      "system": 1.4919631,
      "min": 3.4020340561399998,
      "max": 3.59642809114
    },
    {
      "command": "pnpr@main",
      "mean": 3.57303684744,
      "stddev": 0.1220845092192331,
      "median": 3.56765561014,
      "user": 1.5288268999999999,
      "system": 1.4873615,
      "min": 3.43585276114,
      "max": 3.85313981014
    }
  ]
}

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 129.8 ± 7.3 118.9 150.8 1.00 ± 0.08
pacquet@main 129.4 ± 7.9 113.6 147.2 1.00
pnpr@HEAD 139.7 ± 11.1 125.4 170.7 1.08 ± 0.11
pnpr@main 136.7 ± 10.6 122.0 175.5 1.06 ± 0.10
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.12981463114,
      "stddev": 0.0073014970429405865,
      "median": 0.12890242794,
      "user": 0.16130028999999996,
      "system": 0.13509422,
      "min": 0.11888236944000001,
      "max": 0.15082459644
    },
    {
      "command": "pacquet@main",
      "mean": 0.12940185617684213,
      "stddev": 0.00786779729790263,
      "median": 0.12939339744,
      "user": 0.16248090315789476,
      "system": 0.12043946736842104,
      "min": 0.11356602044000001,
      "max": 0.14715140444
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.13967051486105264,
      "stddev": 0.011063478173764933,
      "median": 0.13749461744,
      "user": 0.1690919557894737,
      "system": 0.1176948357894737,
      "min": 0.12537395044,
      "max": 0.17066332044
    },
    {
      "command": "pnpr@main",
      "mean": 0.13671725214000002,
      "stddev": 0.01059677568390294,
      "median": 0.13664921794,
      "user": 0.16229474,
      "system": 0.12192927,
      "min": 0.12204767244000002,
      "max": 0.17550132144
    }
  ]
}

Scenario: Store only: unlocked direct deps, cold cache + hot store

Store-only install (enableModulesDir: false, per-file store index, trusted lockfile) against a lockfile missing the direct dependencies that have peers, with the metadata cache wiped per iteration: the install resolves those from the registry, reuses their subtrees from the lockfile and checks the store, linking nothing. Direct installs only.

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.186 ± 0.069 1.116 1.370 1.02 ± 0.06
pacquet@main 1.168 ± 0.016 1.150 1.192 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.1862785912800002,
      "stddev": 0.06945161843625713,
      "median": 1.17378667408,
      "user": 0.6102168600000001,
      "system": 0.24891684,
      "min": 1.11602386508,
      "max": 1.37009381708
    },
    {
      "command": "pacquet@main",
      "mean": 1.1682479992800001,
      "stddev": 0.01583579075981472,
      "median": 1.1698801120800002,
      "user": 0.5960221600000001,
      "system": 0.21327393999999997,
      "min": 1.1498310020800002,
      "max": 1.1920262780800002
    }
  ]
}

@BerkayOzerSahin

Copy link
Copy Markdown
Contributor Author

The failing zizmor latest via PyPI check is not caused by this PR. The PR does not touch .github/.

Every fork PR opened after that commit should hit the same failure until the workflow or its ignore config is updated.


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

@BerkayOzerSahin
BerkayOzerSahin marked this pull request as ready for review October 16, 2026 11:26
@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 16, 2026
BerkayOzerSahin and others added 3 commits October 16, 2026 15:03
… pack

npm-packlist applies a set of default ignore rules in every directory it
walks, before that directory's own ignore files. pnpm 12's port of the
ignore walk never injected them, so `pnpm pack` and `pnpm publish` shipped
editor swap files, AppleDouble files, node-waf/node-gyp build leftovers and
archived-packages/.

The missing defaults from npm-packlist 10.0.4 are now soft ignore rules in
fs-packlist's walker (ignore_walk/default_rules.rs):

    /.lock-wscript  /.wafpickle-*  /build/config.gypi  .*.swp
    ._*  **/._*/**  **/.DS_Store/**  /archived-packages/**

They are parsed once and evaluated before each directory's own rules, at
every ancestor level, as ignore-walk's filterEntry does. Every child
directory gets them. The package root gets them only without a `files`
field, because npm's root `files` rules ('*' plus re-includes) override root
defaults entirely. They are not added to should_always_exclude or
is_pruned, so a `files` entry, main/bin/browser, or a negation can still
re-include a file, as in npm.

Evaluating eight rules at every ancestor for every entry made
`pnpm pack --dry-run` 3-6x slower on a 46k-file tree. The same walk serves
git and directory dependency imports. A per-segment gate now skips the
defaults for paths with no segment a default rule can match, so the
no-user-rules shortcut is kept. The gate compares in ASCII only. npm's
matcher does not fold U+212A (Kelvin) to `k`, so a name that matches only
through Unicode folding keeps shipping, as it does with npm. A test fails
if a pattern is added to DEFAULT_PATTERNS without a matching sample.

Closes pnpm#16955

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The changeset for pnpm#16955 names .lock-wscript and .wafpickle-*,
which cspell flags.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Keeps includes under the cognitive complexity limit.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@zkochan
zkochan force-pushed the fix/pack-default-excludes-16955 branch from 84d9aa1 to d1d8e73 Compare October 16, 2026 13:07

@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 16, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

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

Grey Divider


Remediation recommended

1. Unicode files vanish in candidate folders ✓ Resolved
Description
DirDefaults::entry_may_match inherits a candidate flag from the parent directory, but the default
rules use Unicode-aware case folding once that flag enables matching. In a package containing
config.gypi/.locK-wscript, the directory activates matching and the child file matches
/.lock-wscript, so it is omitted even though the same Unicode name is included outside candidate
folders under the intended ASCII-only behavior.
Code

pnpm/crates/fs-packlist/src/ignore_walk/default_rules.rs[75]

+        self.has_candidate_segment || may_match_default_rules(name)
Relevance

●●● Strong

Concrete Unicode case-folding regression contradicts the PR’s ASCII-only contract and existing
regression coverage.

PR-#16918

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The gate deliberately rejects the Unicode look-alike on its own, but inherits a true candidate flag
from config.gypi. That makes the walker evaluate /.lock-wscript against the child entry, where
the general matcher folds K to k; the existing test establishes that the Unicode name should
remain included.

pnpm/crates/fs-packlist/src/ignore_walk/default_rules.rs[15-24]
pnpm/crates/fs-packlist/src/ignore_walk/default_rules.rs[68-79]
pnpm/crates/fs-packlist/src/ignore_walk.rs[217-220]
pnpm/crates/fs-packlist/src/ignore_walk.rs[260-264]
pnpm/crates/fs-packlist/src/ignore_walk/segment.rs[429-435]
pnpm/crates/fs-packlist/src/tests/default_excludes.rs[161-172]

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

## Issue description
An ancestor's candidate flag can activate Unicode-aware matching for a default exclusion, causing a Unicode look-alike file to be omitted only when it sits below a candidate-named directory.

## Fix Focus Areas
- pnpm/crates/fs-packlist/src/ignore_walk/default_rules.rs[68-79]
- pnpm/crates/fs-packlist/src/ignore_walk.rs[260-264]
- pnpm/crates/fs-packlist/src/tests/default_excludes.rs[161-173]

## Recommended Fix
Ensure default rules compare literals using ASCII-only case folding even when an ancestor activates the gate, without changing matching for user ignore rules. Add a test placing `.locK-wscript` inside a non-excluded `config.gypi` directory.

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



Informational

2. Packing speed lacks before-and-after proof 📜 Skill insight ➹ Performance
Description
The new default-rule gate is added to the per-entry ignore walk without a checked-in
before-and-after benchmark. On large trees this path runs for every visited entry, so maintainers
cannot verify that the optimization offsets the extra rule evaluation or detect a packing slowdown.
Code

pnpm/crates/fs-packlist/src/ignore_walk/default_rules.rs[R26-34]

+/// Whether a path segment equals a default rule's name, or matches its prefix
+/// or suffix pattern, compared ASCII-case-insensitively as npm compares them.
+/// The default rules are evaluated only for paths with such a segment.
+pub(super) fn may_match_default_rules(segment: &str) -> bool {
+    let bytes = segment.as_bytes();
+    let starts_with = |prefix: &str| {
+        bytes
+            .get(..prefix.len())
+            .is_some_and(|head| head.eq_ignore_ascii_case(prefix.as_bytes()))
Relevance

● Weak

Recent fs-packlist precedent rejected requiring quantitative benchmarks for documented performance
bounds.

PR-#16761

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The compliance checklist requires quantitative before-and-after evidence for performance changes.
The PR adds a candidate-segment optimization used by the ignore walker, but the changed files
contain no benchmark or measured result showing its cost or benefit.

pnpm/crates/fs-packlist/src/ignore_walk/default_rules.rs[26-49]
pnpm/crates/fs-packlist/src/ignore_walk.rs[217-264]
Skill: review-code

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 default-rule candidate gate changes the hot path for every walked package entry, but the PR does not provide a reproducible before-and-after measurement demonstrating its performance impact.

## Fix Focus Areas
- pnpm/crates/fs-packlist/src/ignore_walk/default_rules.rs[26-49]
- pnpm/crates/fs-packlist/src/ignore_walk.rs[217-264]

## Recommended Fix
Add a reproducible benchmark over a representative large package tree, report multiple before-and-after runs with variance, and verify that the gate does not materially regress `pnpm pack --dry-run` performance.

ⓘ 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
✅ Cross-repo context — repo relationships
Review mode: Auto: ⚖️ Balanced: Localized matcher change affects package contents and security-sensitive file exclusion.
✅ Fix-loop round: fix loop

Grey Divider

Tip of the day
💡 Did you know, you can pick a display mode instead of tweaking every Display option by hand

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Previous reviews

Review updated until commit 187a8a5

Results up to commit d1d8e73 ⚖️ Balanced


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


Remediation recommended
1. Unicode files vanish in candidate folders ✓ Resolved
Description
DirDefaults::entry_may_match inherits a candidate flag from the parent directory, but the default
rules use Unicode-aware case folding once that flag enables matching. In a package containing
config.gypi/.locK-wscript, the directory activates matching and the child file matches
/.lock-wscript, so it is omitted even though the same Unicode name is included outside candidate
folders under the intended ASCII-only behavior.
Code

pnpm/crates/fs-packlist/src/ignore_walk/default_rules.rs[75]

+        self.has_candidate_segment || may_match_default_rules(name)
Relevance

●●● Strong

Concrete Unicode case-folding regression contradicts the PR’s ASCII-only contract and existing
regression coverage.

PR-#16918

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The gate deliberately rejects the Unicode look-alike on its own, but inherits a true candidate flag
from config.gypi. That makes the walker evaluate /.lock-wscript against the child entry, where
the general matcher folds K to k; the existing test establishes that the Unicode name should
remain included.

pnpm/crates/fs-packlist/src/ignore_walk/default_rules.rs[15-24]
pnpm/crates/fs-packlist/src/ignore_walk/default_rules.rs[68-79]
pnpm/crates/fs-packlist/src/ignore_walk.rs[217-220]
pnpm/crates/fs-packlist/src/ignore_walk.rs[260-264]
pnpm/crates/fs-packlist/src/ignore_walk/segment.rs[429-435]
pnpm/crates/fs-packlist/src/tests/default_excludes.rs[161-172]

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

## Issue description
An ancestor's candidate flag can activate Unicode-aware matching for a default exclusion, causing a Unicode look-alike file to be omitted only when it sits below a candidate-named directory.

## Fix Focus Areas
- pnpm/crates/fs-packlist/src/ignore_walk/default_rules.rs[68-79]
- pnpm/crates/fs-packlist/src/ignore_walk.rs[260-264]
- pnpm/crates/fs-packlist/src/tests/default_excludes.rs[161-173]

## Recommended Fix
Ensure default rules compare literals using ASCII-only case folding even when an ancestor activates the gate, without changing matching for user ignore rules. Add a test placing `.locK-wscript` inside a non-excluded `config.gypi` directory.

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



Informational
2. Packing speed lacks before-and-after proof 📜 Skill insight ➹ Performance
Description
The new default-rule gate is added to the per-entry ignore walk without a checked-in
before-and-after benchmark. On large trees this path runs for every visited entry, so maintainers
cannot verify that the optimization offsets the extra rule evaluation or detect a packing slowdown.
Code

pnpm/crates/fs-packlist/src/ignore_walk/default_rules.rs[R26-34]

+/// Whether a path segment equals a default rule's name, or matches its prefix
+/// or suffix pattern, compared ASCII-case-insensitively as npm compares them.
+/// The default rules are evaluated only for paths with such a segment.
+pub(super) fn may_match_default_rules(segment: &str) -> bool {
+    let bytes = segment.as_bytes();
+    let starts_with = |prefix: &str| {
+        bytes
+            .get(..prefix.len())
+            .is_some_and(|head| head.eq_ignore_ascii_case(prefix.as_bytes()))
Relevance

● Weak

Recent fs-packlist precedent rejected requiring quantitative benchmarks for documented performance
bounds.

PR-#16761

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The compliance checklist requires quantitative before-and-after evidence for performance changes.
The PR adds a candidate-segment optimization used by the ignore walker, but the changed files
contain no benchmark or measured result showing its cost or benefit.

pnpm/crates/fs-packlist/src/ignore_walk/default_rules.rs[26-49]
pnpm/crates/fs-packlist/src/ignore_walk.rs[217-264]
Skill: review-code

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 default-rule candidate gate changes the hot path for every walked package entry, but the PR does not provide a reproducible before-and-after measurement demonstrating its performance impact.

## Fix Focus Areas
- pnpm/crates/fs-packlist/src/ignore_walk/default_rules.rs[26-49]
- pnpm/crates/fs-packlist/src/ignore_walk.rs[217-264]

## Recommended Fix
Add a reproducible benchmark over a representative large package tree, report multiple before-and-after runs with variance, and verify that the gate does not materially regress `pnpm pack --dry-run` performance.

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

minimatch compiles the npm-packlist default patterns to `nocase` regexes
without the `u` flag, so U+212A (Kelvin sign) does not match `k`. The
segment gate already skipped such names, but a directory with a gate
candidate in its path, such as `config.gypi/`, enabled the default rules
for its entries, and the Unicode-folding literal matcher then dropped
`config.gypi/.locK-wscript`, which npm ships.

The default rules now parse with ASCII-only literal matching. User ignore
rules keep their existing case folding.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

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

@zkochan

zkochan commented Oct 16, 2026

Copy link
Copy Markdown
Member

Qodo review follow-up:

  1. Unicode files vanish in candidate folders. Valid, fixed in 187a8a5. I checked minimatch 9 with ignore-walk's options. It compiles /.lock-wscript, /.wafpickle-* and /archived-packages/** to /i regexes without the u flag, so .locK-wscript (U+212A) does not match. Inside a directory such as config.gypi/, the gate turned on the default rules, and the Unicode-folding literal matcher then dropped the file. The default rules now parse with ASCII-only literal matching (LiteralCase::Ascii). User ignore rules keep their existing matching. The new test default_rules_match_ascii_case_only_below_a_candidate_directory fails without the fix.
  2. Packing speed lacks before-and-after proof. Not acting. The gate exists to restore the pre-PR fast path, and the PR description records the measurement that motivated it. This repository does not require checked-in benchmarks for this kind of bound.

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

@qodo-code-review

Copy link
Copy Markdown

Qodo review follow-up:

  1. Unicode files vanish in candidate folders. Valid, fixed in 187a8a5. I checked minimatch 9 with ignore-walk's options. It compiles /.lock-wscript, /.wafpickle-* and /archived-packages/** to /i regexes without the u flag, so .locK-wscript (U+212A) does not match. Inside a directory such as config.gypi/, the gate turned on the default rules, and the Unicode-folding literal matcher then dropped the file. The default rules now parse with ASCII-only literal matching (LiteralCase::Ascii). User ignore rules keep their existing matching. The new test default_rules_match_ascii_case_only_below_a_candidate_directory fails without the fix.
  2. Packing speed lacks before-and-after proof. Not acting. The gate exists to restore the pre-PR fast path, and the PR description records the measurement that motivated it. This repository does not require checked-in benchmarks for this kind of bound.

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

Thanks for the follow-up. The status is consistent with the current review:

  • Finding 1 — resolved by commit 187a8a50d786334a6909d32b24a8f2d2 using ASCII-only matching for default rules, with coverage for candidate directories.
  • Finding 2 — remains open, but your rationale for not adding a checked-in benchmark is clear: the gate restores the previous fast path, and the motivating measurement is documented in the PR description.

No dismissal action was requested, so I left finding 2 unchanged.

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 187a8a5

@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 16, 2026

Copy link
Copy Markdown
Member

Status on 187a8a5:

  • Rebased onto main. No conflicts.
  • Fixed one Qodo finding: default ignore rules now match in ASCII case only (details above). Declined the benchmark suggestion.
  • CodeRabbit and Qodo have reviewed the head with nothing left to act on. Greptile's trial has ended, so it did not review. No open review threads.
  • CI is green except zizmor latest via PyPI. That check fails on every fork PR since zizmor-action v0.7.0 and is unrelated to this change. It is tracked in CI: zizmor v0.7.0 fails every fork PR on dangerous-triggers findings tasks#136.

Nothing else remains within this PR's scope.


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

@zkochan
zkochan merged commit 91c6d76 into pnpm:main Oct 16, 2026
68 of 69 checks passed
@welcome

welcome Bot commented Oct 16, 2026

Copy link
Copy Markdown

Congrats on merging your first pull request! 🎉🎉🎉

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 state: automerge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pnpm 12 packs junk files that npm and pnpm 11 exclude (.*.swp, ._*, build/config.gypi, .lock-wscript, .wafpickle-*, archived-packages/)

3 participants