Skip to content

feat(crate-layers): check the product boundary between pnpm and pnpr - #18059

Merged
zkochan merged 2 commits into
mainfrom
crate-layers-product-boundary
Nov 13, 2026
Merged

zkochan merged 2 commits into
mainfrom
crate-layers-product-boundary

Conversation

@zkochan

@zkochan zkochan commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds a product boundary rule to crate-layers check, the "Product boundary rule" item of pnpm/tasks#253.

  • A crate's product is the first component of its directory: pnpm/ (CLI crates and tasks) or pnpr/ (registry server). The directory decides, not the name, because the pnpr crate has no pnpr- prefix.
  • A new [product_boundary] table in crate-layers.toml lists the crates that a crate of the other product may depend on.
  • The check covers every dependency kind, dev-dependencies included. It fails on a dependency on an unlisted crate of the other product. It also fails on a listed crate that no longer has a dependent in the other product, so the list only shrinks, like [[exception]].
  • The list is seeded with today's state, so just crate-layers check passes.

Crates that cross today (30):

Direction Crates
pnpr depends on these pnpm crates pnpm-cargo-resolver, pnpm-catalogs-types, pnpm-config, pnpm-config-dir, pnpm-crypto-hash, pnpm-deps-path, pnpm-diagnostics, pnpm-env-replace, pnpm-fs, pnpm-lockfile, pnpm-lockfile-verification, pnpm-network, pnpm-package-manager, pnpm-package-manifest, pnpm-package-name, pnpm-platform-variants, pnpm-python-resolver, pnpm-release-record, pnpm-reporter, pnpm-resolving-npm-resolver, pnpm-resolving-resolver-base, pnpm-shared-artifact-protocol, pnpm-store-dir, pnpm-tarball, pnpm-testing-utils (dev only), pnpm-transparency-log
pnpm depends on these pnpr crates pnpr (from pnpm-testing-utils, and dev from pnpm-cli and pnpm-pnpr-client), pnpr-fixtures (tests, benchmark, registry mock), pnpr-package-name (from pnpm-registry-mock), pnpr-registry (from pnpm-config)

Most of the pnpm crates are reached from the pnpr binary crate. The notable ones are pnpm-config and pnpm-package-manager, which pull most of the CLI into the server. In the other direction, pnpm-config → pnpr-registry is the only non-test edge from the CLI into pnpr.

Squash Commit Body

The workspace mixes the crates of the pnpm CLI and the pnpr registry
server, and nothing showed which crates the two products share.
`crate-layers check` now takes each crate's product from the first
component of its directory (`pnpm/` or `pnpr/`), since the `pnpr` crate
does not carry a `pnpr-` prefix. A new `[product_boundary]` table in
crate-layers.toml lists the crates that a crate of the other product may
depend on.

The check covers every dependency kind, dev-dependencies included,
because a test harness that pulls in the other product couples their
builds too. It fails on a dependency on an unlisted crate of the other
product, and on a listed crate that no longer has a dependent in the
other product, so the list only shrinks, like `[[exception]]`.

The list is seeded with the 30 crates that cross today: 26 pnpm crates
that pnpr depends on (among them `pnpm-config` and
`pnpm-package-manager`) and 4 pnpr crates that pnpm depends on (`pnpr`,
`pnpr-fixtures`, `pnpr-package-name`, `pnpr-registry`).

Related to pnpm/tasks#253.

Checklist

  • I checked the referenced issue and verified that none of the PRs
    already linked to it solves it.
  • Added or updated tests.
  • Updated the documentation if needed.

No changeset: internal tooling only.

🤖 Generated with Claude Code


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


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

Summary by CodeRabbit

  • New Features
    • The crate-layer check now identifies dependencies crossing between pnpm and pnpr products. It reports cross-product dependencies not covered by the configured shared-crate list, as well as listed crates that are not used across products.
    • Checks include all dependency kinds, and dependencies within the same product do not require a shared-crate entry.
  • Documentation
    • Added guidance on how product boundaries are determined and how to configure and interpret the check.

The workspace mixes the crates of the pnpm CLI and the pnpr registry
server, and nothing showed which crates the two products share.
`crate-layers check` now takes each crate's product from the first
component of its directory (`pnpm/` or `pnpr/`), since the `pnpr` crate
does not carry a `pnpr-` prefix. A new `[product_boundary]` table in
crate-layers.toml lists the crates that a crate of the other product may
depend on.

The check covers every dependency kind, dev-dependencies included,
because a test harness that pulls in the other product couples their
builds too. It fails on a dependency on an unlisted crate of the other
product, and on a listed crate that no longer has a dependent in the
other product, so the list only shrinks, like `[[exception]]`.

The list is seeded with the 30 crates that cross today: 26 pnpm crates
that pnpr depends on (among them `pnpm-config` and
`pnpm-package-manager`) and 4 pnpr crates that pnpm depends on (`pnpr`,
`pnpr-fixtures`, `pnpr-package-name`, `pnpr-registry`).

Related to pnpm/tasks#253.

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

coderabbitai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The crate-layers configuration now lists crates allowed to cross between pnpm and pnpr. The check detects cross-product dependency edges, reports unlisted destinations and stale entries, and includes boundary problems in its results.

Changes: Product boundary validation

Layer / File(s) Summary
Boundary configuration and product definition
crate-layers.toml, pnpm/tasks/crate-layers/src/layers.rs, pnpm/tasks/crate-layers/README.md
The configuration defines a product-boundary crate set, and the parser exposes it to the check. The README describes the products and boundary rules.
Cross-product validation and violations
pnpm/tasks/crate-layers/src/problem.rs, pnpm/tasks/crate-layers/src/boundary.rs
The checker finds dependency edges between products. It reports unlisted destinations and configured crates that are not destinations of cross-product edges.
Check command and validation tests
pnpm/tasks/crate-layers/src/main.rs, pnpm/tasks/crate-layers/src/tests.rs, pnpm/tasks/crate-layers/src/tests/boundary.rs
The check command invokes boundary validation and reports its results. Tests cover product lookup, listed and unlisted dependencies, stale entries, and same-product dependencies.

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

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Check
  participant Layers
  participant BoundaryCheck as boundary::check
  participant CrateGraph
  Check->>Layers: Read configured boundary crates
  Check->>BoundaryCheck: Pass graph and boundary crates
  BoundaryCheck->>CrateGraph: Inspect dependency edges
  BoundaryCheck-->>Check: Return boundary problems
  Check->>Check: Include boundary problems in check results
Loading

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

Merge Risk: Minimal · up to 5fbc6

This adds a CI-time check that enforces which crates pnpm and pnpr may share. It does not change product runtime behavior, and no merge-blocking risk was found.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • 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

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between d4e0bec and 5fbc64a.

Files selected for processing: 1

  • pnpm/tasks/crate-layers/src/tests/boundary.rs
Files skipped from review as they are similar to previous changes: 1

  • pnpm/tasks/crate-layers/src/tests/boundary.rs

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

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Micro-Benchmark Results

Linux

group                                            main                                   pr
-----                                            ----                                   --
lockfile/parse_pnpm_lock                         1.03      3.9±0.37ms    95.5 MB/sec    1.00      3.8±0.31ms    98.2 MB/sec
packument/parse                                  1.00     46.0±2.35µs  1441.6 MB/sec    1.00     46.0±2.37µs  1442.0 MB/sec
tarball/download_dependency                      1.13  986.9±220.60µs     4.3 MB/sec    1.00   871.1±88.34µs     4.9 MB/sec
tarball_batch/cold_store_many_medium_tarballs    1.07    231.4±6.56ms 69.1 KElem/sec    1.00    216.9±7.35ms 73.8 KElem/sec
version_pick/repeated_ranges_file                1.00      5.5±0.29ms  5.7 KElem/sec    1.02      5.5±0.42ms  5.6 KElem/sec
version_pick/repeated_ranges_raw                 1.00      5.3±0.18ms  5.9 KElem/sec    1.01      5.3±0.17ms  5.9 KElem/sec
version_pick/wildcard_lowest                     1.00     46.5±1.81µs 21.0 KElem/sec    1.02     47.5±4.62µs 20.6 KElem/sec
workspace_resolution/hoist_heavy                 1.08   305.4±18.65ms        ? ?/sec    1.00   283.2±16.14ms        ? ?/sec
workspace_sort/chained_projects                  1.00     15.4±1.77ms        ? ?/sec    1.00     15.4±1.99ms        ? ?/sec

@github-actions

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 2582.43 ms 2600.91 ms 0.7% 129.12 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store pnpr 1600.55 ms 1540.05 ms -3.8% 80.03 ms Within tolerance
isolated-fresh-restore-hot-cache-hot-store pacquet 222.28 ms 226.42 ms 1.9% 11.11 ms Within tolerance
isolated-fresh-restore-hot-cache-hot-store pnpr 243.81 ms 238.91 ms -2.0% 12.19 ms Within tolerance
isolated-repeat-install-hot-cache-hot-store pacquet 17.83 ms 17.65 ms -1.0% 2.00 ms Within tolerance
isolated-repeat-install-hot-cache-hot-store pnpr 19.33 ms 19.44 ms 0.6% 2.00 ms Within tolerance
isolated-repeat-install-cold-cache-hot-store pacquet 9.88 ms 10.19 ms 3.1% 2.00 ms Within tolerance
isolated-repeat-install-cold-cache-hot-store pnpr 9.55 ms 9.74 ms 2.1% 2.00 ms Within tolerance
isolated-fresh-install-cold-cache-cold-store pacquet 2728.03 ms 2718.22 ms -0.4% 136.40 ms Within tolerance
isolated-fresh-install-cold-cache-cold-store pnpr 1657.25 ms 1641.55 ms -0.9% 82.86 ms Within tolerance
isolated-fresh-install-hot-cache-hot-store pacquet 547.70 ms 514.97 ms -6.0% 27.39 ms Within tolerance
isolated-fresh-install-hot-cache-hot-store pnpr 341.40 ms 325.62 ms -4.6% 17.07 ms Within tolerance
isolated-fresh-install-cold-cache-hot-store pacquet 1838.94 ms 1827.16 ms -0.6% 91.95 ms Within tolerance
isolated-fresh-install-cold-cache-hot-store pnpr 371.55 ms 351.84 ms -5.3% 18.58 ms Within tolerance
isolated-fresh-resolve-hot-cache-offline pacquet 254.54 ms 237.64 ms -6.6% 12.73 ms Within tolerance
isolated-fresh-resolve-hot-cache-offline pnpr 82.97 ms 83.13 ms 0.2% 4.15 ms Within tolerance
isolated-peer-heavy-resolve-hot-cache-offline pacquet 290.61 ms 376.15 ms 29.4% 14.53 ms Inconclusive (overlapping samples)
isolated-linked-workspace-resolve-hot-cache-offline pacquet 72.28 ms 72.60 ms 0.4% 3.61 ms Within tolerance
isolated-injected-workspace-repeat-install-hot-cache-hot-store pacquet 82.19 ms 83.86 ms 2.0% 4.11 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pacquet 4493.05 ms 4505.50 ms 0.3% 224.65 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pnpr 3546.43 ms 3538.48 ms -0.2% 177.32 ms Within tolerance
gvs-fresh-restore-hot-cache-hot-store pacquet 132.25 ms 133.96 ms 1.3% 6.61 ms Within tolerance
gvs-fresh-restore-hot-cache-hot-store pnpr 155.01 ms 148.33 ms -4.3% 7.75 ms Within tolerance
store-only-unlocked-direct-deps-cold-cache-hot-store pacquet 1176.70 ms 1249.10 ms 6.2% 58.83 ms Inconclusive (overlapping samples)
cargo-repeat-install-hot-cache-hot-store pacquet 31.76 ms 33.26 ms 4.7% 2.00 ms Within tolerance

Same-run syscall check

Each install runs 2 more times per revision, untimed, under strace --follow-forks --summary-only. A file syscall regresses when HEAD's fewest calls exceed main's most by more than 2% of main or 50 calls, whichever is larger. mkdir and mkdirat count only the calls that created a directory, since concurrent installs fail a varying number with EEXIST. A syscall whose identical runs differ by more than that tolerance is reported unstable and not gated, unless HEAD's fewest calls also exceed main's most by more than the tolerance plus that difference. Each scenario lists its largest change relative to its tolerance and every row that is not within tolerance.

Scenario Engine Syscall main calls (max) HEAD calls (min) Change Tolerance Identical-run spread Result
isolated-fresh-restore-cold-cache-cold-store pacquet rename 2778 2779 +0.0% 55 38 Within tolerance
isolated-fresh-restore-cold-cache-cold-store pnpr access 11 11 +0.0% 50 0 Within tolerance
isolated-fresh-restore-hot-cache-hot-store pacquet readlink 15303 15329 +0.2% 306 29 Within tolerance
isolated-fresh-restore-hot-cache-hot-store pnpr readlink 15323 15335 +0.1% 306 13 Within tolerance
isolated-repeat-install-hot-cache-hot-store pacquet access 8 8 +0.0% 50 0 Within tolerance
isolated-repeat-install-hot-cache-hot-store pnpr access 8 8 +0.0% 50 0 Within tolerance
isolated-repeat-install-cold-cache-hot-store pacquet access 8 8 +0.0% 50 0 Within tolerance
isolated-repeat-install-cold-cache-hot-store pnpr access 8 8 +0.0% 50 0 Within tolerance
isolated-fresh-install-cold-cache-cold-store pacquet openat 63525 63533 +0.0% 1270 15 Within tolerance
isolated-fresh-install-cold-cache-cold-store pacquet readlink 16669 16626 -0.3% 333 373 Unstable (identical runs differ by 373, not gated)
isolated-fresh-install-cold-cache-cold-store pnpr access 11 11 +0.0% 50 0 Within tolerance
isolated-fresh-install-hot-cache-hot-store pacquet access 11 11 +0.0% 50 0 Within tolerance
isolated-fresh-install-hot-cache-hot-store pnpr access 11 11 +0.0% 50 0 Within tolerance
isolated-fresh-install-cold-cache-hot-store pacquet access 11 11 +0.0% 50 0 Within tolerance
isolated-fresh-install-cold-cache-hot-store pacquet readlink 16137 15889 -1.5% 322 341 Unstable (identical runs differ by 341, not gated)
isolated-fresh-install-cold-cache-hot-store pnpr access 11 11 +0.0% 50 0 Within tolerance
isolated-fresh-resolve-hot-cache-offline pacquet openat 2951 2953 +0.1% 59 7 Within tolerance
isolated-fresh-resolve-hot-cache-offline pnpr access 8 8 +0.0% 50 0 Within tolerance
isolated-peer-heavy-resolve-hot-cache-offline pacquet access 8 8 +0.0% 50 0 Within tolerance
isolated-linked-workspace-resolve-hot-cache-offline pacquet access 8 8 +0.0% 50 0 Within tolerance
isolated-injected-workspace-repeat-install-hot-cache-hot-store pacquet access 11 11 +0.0% 50 0 Within tolerance
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pacquet ioctl 12 18 +50.0% 50 1 Within tolerance
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pacquet rename 2817 2777 -1.4% 56 62 Unstable (identical runs differ by 62, not gated)
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pnpr access 11 11 +0.0% 50 0 Within tolerance
gvs-fresh-restore-hot-cache-hot-store pacquet access 11 11 +0.0% 50 0 Within tolerance
gvs-fresh-restore-hot-cache-hot-store pnpr access 11 11 +0.0% 50 0 Within tolerance
store-only-unlocked-direct-deps-cold-cache-hot-store pacquet access 8 8 +0.0% 50 0 Within tolerance
cargo-repeat-install-hot-cache-hot-store pacquet access 10 10 +0.0% 50 0 Within tolerance

Integrated-Benchmark Report (Linux)

Commit: d4e0bec68f2d

Compared against main at: 50cd788114b2

Regular scenarios report direct and pnpr installs. The peer-heavy resolver scenario compares current Rust, main Rust, and TypeScript pnpm; the linked, injected, and Cargo 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.587 ± 0.066 2.452 2.660 1.68 ± 0.19
pacquet@main 2.623 ± 0.090 2.531 2.820 1.70 ± 0.20
pnpr@HEAD 1.539 ± 0.169 1.347 1.867 1.00
pnpr@main 1.616 ± 0.135 1.413 1.833 1.05 ± 0.14
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.5872577980600004,
      "stddev": 0.06637638769716744,
      "median": 2.60091427376,
      "user": 2.4182556999999996,
      "system": 1.80501264,
      "min": 2.45209879476,
      "max": 2.65955599676
    },
    {
      "command": "pacquet@main",
      "mean": 2.62290144786,
      "stddev": 0.08999198010118076,
      "median": 2.58242843826,
      "user": 2.4098923,
      "system": 1.73850694,
      "min": 2.53101757876,
      "max": 2.81983742576
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.5390515306600001,
      "stddev": 0.1689055192458756,
      "median": 1.54005287126,
      "user": 1.9725857000000002,
      "system": 1.6683759400000002,
      "min": 1.34672402176,
      "max": 1.86662902876
    },
    {
      "command": "pnpr@main",
      "mean": 1.6158206270600002,
      "stddev": 0.1348616759384595,
      "median": 1.60055482876,
      "user": 2.1920916,
      "system": 1.75185834,
      "min": 1.41287774676,
      "max": 1.8332672857599999
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 232.2 ± 17.3 221.8 279.1 1.02 ± 0.09
pacquet@main 226.7 ± 12.0 215.5 253.8 1.00
pnpr@HEAD 240.3 ± 6.3 233.3 253.9 1.06 ± 0.06
pnpr@main 244.6 ± 3.5 239.1 251.5 1.08 ± 0.06
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.23215623860000006,
      "stddev": 0.017318140442452713,
      "median": 0.22641628560000002,
      "user": 0.26478517999999995,
      "system": 0.5726832,
      "min": 0.2217753386,
      "max": 0.2791094906
    },
    {
      "command": "pacquet@main",
      "mean": 0.22674406600000002,
      "stddev": 0.011962740256667038,
      "median": 0.22228370860000002,
      "user": 0.26836718,
      "system": 0.5783152999999999,
      "min": 0.21546192860000002,
      "max": 0.25384710460000004
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.240307943,
      "stddev": 0.006316067264524734,
      "median": 0.2389070151,
      "user": 0.29473868,
      "system": 0.5475422,
      "min": 0.2333101666,
      "max": 0.2539194516
    },
    {
      "command": "pnpr@main",
      "mean": 0.24456050040000005,
      "stddev": 0.0035277033196063953,
      "median": 0.24381054210000003,
      "user": 0.27603977999999996,
      "system": 0.5945315999999999,
      "min": 0.2390527536,
      "max": 0.2514671036
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 18.7 ± 3.3 13.8 28.8 1.03 ± 0.28
pacquet@main 18.2 ± 3.7 11.4 36.4 1.00
pnpr@HEAD 19.9 ± 2.4 14.9 27.6 1.10 ± 0.26
pnpr@main 19.7 ± 2.3 14.4 26.4 1.08 ± 0.25
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.018657719418367347,
      "stddev": 0.003324755997562447,
      "median": 0.0176499965,
      "user": 0.010487988979591835,
      "system": 0.00974596081632653,
      "min": 0.013819785000000001,
      "max": 0.028825148000000002
    },
    {
      "command": "pacquet@main",
      "mean": 0.018169100386503063,
      "stddev": 0.0036537733204772046,
      "median": 0.017830474000000002,
      "user": 0.010926395828220851,
      "system": 0.008760894233128834,
      "min": 0.011415978,
      "max": 0.036415966
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.019899980520000006,
      "stddev": 0.002439212593337682,
      "median": 0.0194419675,
      "user": 0.01220936,
      "system": 0.0093209024,
      "min": 0.014912190000000002,
      "max": 0.027606159
    },
    {
      "command": "pnpr@main",
      "mean": 0.01965191949315068,
      "stddev": 0.0022641002308577923,
      "median": 0.019328318500000004,
      "user": 0.011608060547945205,
      "system": 0.009713192465753424,
      "min": 0.01436542,
      "max": 0.026364742000000004
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 10.3 ± 0.6 9.4 12.7 1.06 ± 0.09
pacquet@main 10.0 ± 0.8 8.9 14.5 1.04 ± 0.11
pnpr@HEAD 9.8 ± 0.4 8.9 11.7 1.01 ± 0.08
pnpr@main 9.7 ± 0.6 8.8 12.5 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.010280960851790387,
      "stddev": 0.0005932062132028388,
      "median": 0.01018782314,
      "user": 0.005886612663755458,
      "system": 0.005469016419213971,
      "min": 0.00936564514,
      "max": 0.01270119014
    },
    {
      "command": "pacquet@main",
      "mean": 0.010031050354285713,
      "stddev": 0.0007700802532333449,
      "median": 0.00988020164,
      "user": 0.005701884873949579,
      "system": 0.005378431008403361,
      "min": 0.008946476140000001,
      "max": 0.01451826714
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.009794985041639346,
      "stddev": 0.00039604721739953724,
      "median": 0.009744536639999999,
      "user": 0.005702146721311474,
      "system": 0.005119240901639344,
      "min": 0.008873400140000001,
      "max": 0.01167127714
    },
    {
      "command": "pnpr@main",
      "mean": 0.009690165995895197,
      "stddev": 0.0006430803467108702,
      "median": 0.00954839614,
      "user": 0.005137848471615718,
      "system": 0.005479765676855897,
      "min": 0.00878233514,
      "max": 0.01249913614
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.741 ± 0.101 2.618 2.992 1.65 ± 0.12
pacquet@main 2.726 ± 0.026 2.668 2.762 1.64 ± 0.10
pnpr@HEAD 1.659 ± 0.102 1.535 1.819 1.00
pnpr@main 1.661 ± 0.111 1.462 1.834 1.00 ± 0.09
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.74059889274,
      "stddev": 0.1008395634492505,
      "median": 2.7182153088399996,
      "user": 2.8735984999999995,
      "system": 1.7947688200000003,
      "min": 2.61812508334,
      "max": 2.99193423034
    },
    {
      "command": "pacquet@main",
      "mean": 2.7258993586400004,
      "stddev": 0.025846855655459317,
      "median": 2.72802791434,
      "user": 2.8936529999999996,
      "system": 1.8073345200000002,
      "min": 2.66845368034,
      "max": 2.76178540734
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.6586774745400004,
      "stddev": 0.10202354297047289,
      "median": 1.6415544878400001,
      "user": 2.2694889,
      "system": 1.6225696199999997,
      "min": 1.5354785983400001,
      "max": 1.8193447143400001
    },
    {
      "command": "pnpr@main",
      "mean": 1.6610442551400002,
      "stddev": 0.11100049181258634,
      "median": 1.6572549358400002,
      "user": 2.2516678999999997,
      "system": 1.6341208200000001,
      "min": 1.4616653863400002,
      "max": 1.8337806123400002
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 512.4 ± 19.2 475.7 542.7 1.56 ± 0.09
pacquet@main 546.7 ± 23.8 507.5 580.0 1.67 ± 0.10
pnpr@HEAD 327.4 ± 13.5 308.6 354.7 1.00
pnpr@main 339.8 ± 10.4 325.9 354.7 1.04 ± 0.05
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.51241227728,
      "stddev": 0.019244850713613038,
      "median": 0.51496864148,
      "user": 0.71629034,
      "system": 0.8894643600000001,
      "min": 0.47573106348000005,
      "max": 0.54266702348
    },
    {
      "command": "pacquet@main",
      "mean": 0.54674889708,
      "stddev": 0.023795833268646264,
      "median": 0.54770102998,
      "user": 0.76708104,
      "system": 0.9953866600000001,
      "min": 0.50746491048,
      "max": 0.58003197348
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.32744537188000006,
      "stddev": 0.013543387515188639,
      "median": 0.32561911898000007,
      "user": 0.28740474000000005,
      "system": 0.6554283599999999,
      "min": 0.30855591248,
      "max": 0.35467711948
    },
    {
      "command": "pnpr@main",
      "mean": 0.33984424058,
      "stddev": 0.01039442784171219,
      "median": 0.3414045639800001,
      "user": 0.28597264,
      "system": 0.6954910599999999,
      "min": 0.32589821448000006,
      "max": 0.35473064948000005
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.836 ± 0.043 1.778 1.898 5.20 ± 0.26
pacquet@main 1.915 ± 0.155 1.794 2.244 5.43 ± 0.50
pnpr@HEAD 0.353 ± 0.016 0.329 0.382 1.00
pnpr@main 0.370 ± 0.016 0.340 0.399 1.05 ± 0.07
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.8362139478,
      "stddev": 0.04252303554382501,
      "median": 1.8271552258000001,
      "user": 1.11494628,
      "system": 0.97541864,
      "min": 1.7775156913000003,
      "max": 1.8976082823
    },
    {
      "command": "pacquet@main",
      "mean": 1.9146630990000002,
      "stddev": 0.1550705225611584,
      "median": 1.8389384363000003,
      "user": 1.1675014799999999,
      "system": 1.02974524,
      "min": 1.7942207413000002,
      "max": 2.2437922363
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.3528723331,
      "stddev": 0.015554105957654855,
      "median": 0.35184414480000004,
      "user": 0.33615367999999995,
      "system": 0.66438384,
      "min": 0.3290626563,
      "max": 0.3815977443
    },
    {
      "command": "pnpr@main",
      "mean": 0.3698779174,
      "stddev": 0.016276277537163507,
      "median": 0.3715530468,
      "user": 0.36590668,
      "system": 0.68173074,
      "min": 0.3397698013,
      "max": 0.3989107523
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 234.5 ± 13.0 208.9 254.2 2.83 ± 0.16
pacquet@main 249.7 ± 16.3 217.0 272.9 3.01 ± 0.20
pnpr@HEAD 83.3 ± 1.6 80.8 87.9 1.00 ± 0.02
pnpr@main 83.0 ± 0.9 81.7 86.4 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.23452217301000003,
      "stddev": 0.013020116091563613,
      "median": 0.23763957376,
      "user": 0.2172307233333333,
      "system": 0.26620091333333334,
      "min": 0.20887825926,
      "max": 0.25422959126
    },
    {
      "command": "pacquet@main",
      "mean": 0.24971357753272727,
      "stddev": 0.016337288745674777,
      "median": 0.25454454526000003,
      "user": 0.22575418545454545,
      "system": 0.26219253454545455,
      "min": 0.21699525026000002,
      "max": 0.27289950626000004
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.08331829686606063,
      "stddev": 0.0015813736326359773,
      "median": 0.08312829026,
      "user": 0.0304337006060606,
      "system": 0.018534683636363635,
      "min": 0.08084947126000001,
      "max": 0.08789134326
    },
    {
      "command": "pnpr@main",
      "mean": 0.08300651246588232,
      "stddev": 0.0008913960977134197,
      "median": 0.08296685476000001,
      "user": 0.030733051764705872,
      "system": 0.01739634,
      "min": 0.08167587026,
      "max": 0.08642870426
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 370.2 ± 37.2 293.7 414.3 1.27 ± 0.14
pacquet@main 292.6 ± 14.9 271.3 316.8 1.00
pnpm@HEAD 5162.1 ± 376.2 4468.0 5567.1 17.64 ± 1.57
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.37015503710888886,
      "stddev": 0.03718169097143075,
      "median": 0.37615106422,
      "user": 0.4080706777777778,
      "system": 0.11877433999999999,
      "min": 0.29369004622,
      "max": 0.41425389222
    },
    {
      "command": "pacquet@main",
      "mean": 0.2925688257755555,
      "stddev": 0.014857592077321478,
      "median": 0.29061196722,
      "user": 0.3271865666666667,
      "system": 0.08807222888888888,
      "min": 0.27134575922,
      "max": 0.31684933522
    },
    {
      "command": "pnpm@HEAD",
      "mean": 5.162141026108889,
      "stddev": 0.3762405848468351,
      "median": 5.16855331922,
      "user": 8.222242122222221,
      "system": 0.5188887844444445,
      "min": 4.4680225172200005,
      "max": 5.56705873022
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 73.4 ± 1.7 71.5 77.3 1.01 ± 0.03
pacquet@main 72.4 ± 1.0 70.5 75.2 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.07336964500594596,
      "stddev": 0.0017149640588163604,
      "median": 0.07259970806,
      "user": 0.06471778216216215,
      "system": 0.04591329783783784,
      "min": 0.07154358306,
      "max": 0.07725308306
    },
    {
      "command": "pacquet@main",
      "mean": 0.07242558148500002,
      "stddev": 0.0009749674111443058,
      "median": 0.07228233206000001,
      "user": 0.061480370000000006,
      "system": 0.048282309999999995,
      "min": 0.07053087006,
      "max": 0.07522079406
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 83.9 ± 2.3 79.1 88.2 1.02 ± 0.04
pacquet@main 82.2 ± 2.1 79.1 87.9 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.08385504893555557,
      "stddev": 0.0023391340659669703,
      "median": 0.08385512988000002,
      "user": 0.032461711111111104,
      "system": 0.062185604444444445,
      "min": 0.07909364038000001,
      "max": 0.08823748938
    },
    {
      "command": "pacquet@main",
      "mean": 0.08222450593555555,
      "stddev": 0.002055331450596054,
      "median": 0.08219208238,
      "user": 0.03018985,
      "system": 0.06282060444444443,
      "min": 0.07905814338000001,
      "max": 0.08791094538000001
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.570 ± 0.159 4.436 4.889 1.28 ± 0.06
pacquet@main 4.616 ± 0.190 4.461 4.911 1.30 ± 0.07
pnpr@HEAD 3.557 ± 0.115 3.434 3.809 1.00
pnpr@main 3.603 ± 0.135 3.486 3.895 1.01 ± 0.05
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.57010498602,
      "stddev": 0.15925308057465068,
      "median": 4.50550445822,
      "user": 2.07288764,
      "system": 1.45953944,
      "min": 4.43580267122,
      "max": 4.88928026322
    },
    {
      "command": "pacquet@main",
      "mean": 4.61556098772,
      "stddev": 0.18954597936960763,
      "median": 4.49304674422,
      "user": 2.0840672399999995,
      "system": 1.4137820399999996,
      "min": 4.46123161022,
      "max": 4.91137693522
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.5572975344199995,
      "stddev": 0.1152136588316176,
      "median": 3.53847524522,
      "user": 1.8803484399999995,
      "system": 1.38440454,
      "min": 3.43442708522,
      "max": 3.8092326972199997
    },
    {
      "command": "pnpr@main",
      "mean": 3.6031113657199993,
      "stddev": 0.1348094638394819,
      "median": 3.5464342692199997,
      "user": 2.00708474,
      "system": 1.5218151399999997,
      "min": 3.48562221122,
      "max": 3.8947982992199996
    }
  ]
}

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 136.1 ± 5.3 130.2 151.0 1.01 ± 0.07
pacquet@main 134.1 ± 6.8 126.5 154.8 1.00
pnpr@HEAD 148.9 ± 5.5 137.5 159.2 1.11 ± 0.07
pnpr@main 155.4 ± 6.9 147.0 173.1 1.16 ± 0.08
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.13608078676842106,
      "stddev": 0.005288518108394054,
      "median": 0.1339572044,
      "user": 0.17758235578947368,
      "system": 0.17304098631578943,
      "min": 0.13024734540000002,
      "max": 0.15103671040000002
    },
    {
      "command": "pacquet@main",
      "mean": 0.13410662392631578,
      "stddev": 0.006838079397569241,
      "median": 0.1322528084,
      "user": 0.17982851368421052,
      "system": 0.15951651263157893,
      "min": 0.1265397214,
      "max": 0.1547897704
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.1488635712235294,
      "stddev": 0.005455011958582152,
      "median": 0.1483334594,
      "user": 0.1882316870588235,
      "system": 0.16295616588235293,
      "min": 0.13747542340000002,
      "max": 0.1592067544
    },
    {
      "command": "pnpr@main",
      "mean": 0.155353916525,
      "stddev": 0.0069438630092702415,
      "median": 0.15500704190000003,
      "user": 0.19602522749999998,
      "system": 0.17042770999999995,
      "min": 0.14702695840000002,
      "max": 0.1730628734
    }
  ]
}

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.232 ± 0.081 1.123 1.337 1.03 ± 0.09
pacquet@main 1.195 ± 0.076 1.119 1.321 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.23230377054,
      "stddev": 0.08107199100513046,
      "median": 1.24909594504,
      "user": 0.57142726,
      "system": 0.28819452,
      "min": 1.12260762204,
      "max": 1.33715890904
    },
    {
      "command": "pacquet@main",
      "mean": 1.19475881684,
      "stddev": 0.07647002170578368,
      "median": 1.17669622804,
      "user": 0.5588663599999999,
      "system": 0.27529172,
      "min": 1.11927354904,
      "max": 1.32115034104
    }
  ]
}

Scenario: Cargo: repeat install, hot cache + hot store

Frozen repeat install of a Cargo workspace (cargo.enabled: true) whose crates are already materialized in <storeDir>/v11/crates/ and linked into .pnpm/crates/crates-io. Direct installs only.

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 34.0 ± 4.3 28.0 44.9 1.05 ± 0.16
pacquet@main 32.3 ± 2.6 29.0 42.4 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.034038924845641014,
      "stddev": 0.004305828407051366,
      "median": 0.033263876319999997,
      "user": 0.026591776923076918,
      "system": 0.023056136923076908,
      "min": 0.027999601320000005,
      "max": 0.04489169832
    },
    {
      "command": "pacquet@main",
      "mean": 0.032333206809361685,
      "stddev": 0.002588654080574431,
      "median": 0.03176475082,
      "user": 0.023470359574468084,
      "system": 0.023670815319148938,
      "min": 0.028992131320000003,
      "max": 0.04241111632
    }
  ]
}

@codecov-commenter

codecov-commenter commented Nov 13, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.92%. Comparing base (50cd788) to head (5fbc64a).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #18059      +/-   ##
==========================================
- Coverage   91.92%   91.92%   -0.01%     
==========================================
  Files        2363     2363              
  Lines      295861   295861              
==========================================
- Hits       271978   271968      -10     
- Misses      23883    23893      +10     

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

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

@zkochan
zkochan marked this pull request as ready for review November 13, 2026 14:22
@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Enforce the pnpm–pnpr crate product boundary

✨ Enhancement 🧪 Tests ⚙️ Configuration changes 🕐 20-40 Minutes

Grey Divider

AI Description

• Check all workspace dependency kinds, including dev-dependencies, against directory-based product
 ownership.
• Allow the 30 existing cross-product dependency targets while rejecting new or stale entries.
• Document the rule and test crossings in both directions.
Diagram

graph TD
  A["Workspace manifests"] --> B["Crate graph"] --> E{"Boundary check"} --> F["Unlisted crossing"] --> H["Check result"]
  C["Boundary configuration"] --> E
  E --> G["Stale entry"] --> H
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Allowlist individual dependency edges
  • ➕ Restricts each shared crate to specific cross-product dependents.
  • ➖ Requires a larger baseline and more maintenance as dependents change.

Recommendation: Keep the target-crate allowlist: it directly tracks which crates are shared, and stale-entry checks make that set shrink as coupling is removed. An edge-level allowlist would provide finer control but impose substantially more configuration for this goal.

Files changed (8) +294 / -5

Enhancement (3) +96 / -3
boundary.rsDetect unlisted and stale cross-product targets +58/-0

Detect unlisted and stale cross-product targets

• Derives products from crate directories and examines dependencies of every kind. Emits violations for unlisted cross-product targets and allowlist entries with no cross-product dependent.

pnpm/tasks/crate-layers/src/boundary.rs

main.rsRun boundary validation during crate-layers check +8/-3

Run boundary validation during crate-layers check

• Integrates boundary violations into the existing check result and updates command help and success output.

pnpm/tasks/crate-layers/src/main.rs

problem.rsReport actionable boundary violations +30/-0

Report actionable boundary violations

• Adds problem types and messages identifying unlisted cross-product dependencies or allowlist entries that should be removed.

pnpm/tasks/crate-layers/src/problem.rs

Tests (2) +119 / -0
tests.rsRegister boundary tests +1/-0

Register boundary tests

• Includes the new boundary test module in the crate-layers test suite.

pnpm/tasks/crate-layers/src/tests.rs

boundary.rsTest product ownership and boundary outcomes +118/-0

Test product ownership and boundary outcomes

• Uses an in-memory two-product workspace to verify directory-based ownership, allowed crossings, unlisted crossings, stale entries, and same-product dependencies. The fixture includes a dev-dependency crossing.

pnpm/tasks/crate-layers/src/tests/boundary.rs

Documentation (1) +17 / -1
README.mdDocument the product boundary rule +17/-1

Document the product boundary rule

• Explains directory-based product ownership, coverage of dev-dependencies, and the failures for unlisted crossings and stale entries.

pnpm/tasks/crate-layers/README.md

Other (2) +62 / -1
crate-layers.tomlBaseline 30 cross-product dependency targets +46/-1

Baseline 30 cross-product dependency targets

• Adds a documented product-boundary allowlist containing 26 pnpm crates and four pnpr crates currently depended on across products.

crate-layers.toml

layers.rsParse the product-boundary allowlist +16/-0

Parse the product-boundary allowlist

• Adds an optional product-boundary table to layer configuration and exposes its crate set to the checker.

pnpm/tasks/crate-layers/src/layers.rs

@qodo-code-review

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

Copy link
Copy Markdown

Code Review by Qodo

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

Grey Divider


Remediation recommended

1. Workspace aliases hide product crossings 🐞 Bug ≡ Correctness
Description
product_of takes the first component of a workspace member path without resolving .., so a pnpr
crate recorded as pnpm/../pnpr/... is classified as pnpm. If a member is listed through that path
and gains a dependency on an unlisted pnpm crate, crossing_edges treats the dependency as staying
within one product and does not report it.
Code

pnpm/tasks/crate-layers/src/boundary.rs[R12-14]

+        .split('/')
+        .find(|component| !component.is_empty() && *component != ".")
+}
Relevance

●● Moderate

Real correctness bug in new crate-layers code, but the closest precedent is a rejected
path-traversal validation request in tree.rs (PR #17615).

PR-#17615
PR-#17748

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The graph retains the manifest path derived from the workspace member spelling, while the
working-tree reader opens that path through the filesystem. The new check compares products
extracted from those retained strings, so a path beginning pnpm/../pnpr yields pnpm even though
it opens a pnpr manifest.

pnpm/tasks/crate-layers/src/graph.rs[87-116]
pnpm/tasks/crate-layers/src/graph.rs[59-70]
pnpm/tasks/crate-layers/src/tree.rs[23-43]
pnpm/tasks/crate-layers/src/boundary.rs[9-14]
pnpm/tasks/crate-layers/src/boundary.rs[48-57]

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

## Issue description
Workspace member paths containing `..` can make a crate under `pnpr` appear to belong to `pnpm`, hiding a cross-product dependency.

## Fix Focus Areas
- pnpm/tasks/crate-layers/src/boundary.rs[9-14]
- pnpm/tasks/crate-layers/src/graph.rs[59-63]

## Recommended Fix
Normalize workspace member paths relative to the repository root before recording or interpreting their product. Reject paths that escape the root or cannot be assigned to an expected product, and test a member spelled with `..`.

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

Dismiss ↗ | View ↗


2. External crates trigger false boundary errors 🐞 Bug ≡ Correctness
Description
crossing_edges accepts every graph edge as a workspace dependency, but graph::read creates edges
when a dependency's package name matches a workspace crate without checking whether it resolves to
that crate. If a crate in one product declares a registry dependency with the same name as a crate
in the other product, the new check reports an unlisted crossing—or treats a listed crossing as
still active—even though the dependency is external.
Code

pnpm/tasks/crate-layers/src/boundary.rs[R53-56]

+    graph.edges
+        .iter()
+        .filter(|edge| crosses(&edge.from, &edge.to))
+        .map(|edge| (edge.from.as_str(), edge.to.as_str()))
Relevance

●● Moderate

Plausible graph-edge correctness issue in crate-layers, but no close accepted or rejected precedent
covers same-name external dependencies.

PR-#17748
PR-#17743

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Graph construction inserts a workspace edge based solely on the resolved dependency name, and the
new crossing check interprets every such edge as a product crossing. The boundary tests themselves
use version-only declarations for their cross-product fixtures, demonstrating that those
declarations are currently treated as workspace edges.

pnpm/tasks/crate-layers/src/graph.rs[64-70]
pnpm/tasks/crate-layers/src/graph.rs[179-203]
pnpm/tasks/crate-layers/src/boundary.rs[20-39]
pnpm/tasks/crate-layers/src/tests/boundary.rs[31-39]

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 boundary check consumes name-matched graph edges even when their declarations resolve to external packages, causing false crossings and masking stale entries.

## Fix Focus Areas
- pnpm/tasks/crate-layers/src/graph.rs[64-70]
- pnpm/tasks/crate-layers/src/graph.rs[179-203]
- pnpm/tasks/crate-layers/src/boundary.rs[53-57]

## Recommended Fix
Construct internal graph edges only for dependencies that resolve to workspace members, following `path` and inherited workspace dependency declarations rather than relying on package-name equality alone. Test a version-only registry dependency whose name matches a crate in the opposite product.

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

Dismiss ↗ | View ↗



Informational

3. Boundary tests leave debug dumps in test output 🐞 Bug ◔ Observability ⭐ New
Description
Five dbg! calls in the new boundary tests (takes_the_product_from_the_crate_directory,
accepts_dependencies_on_listed_crates_in_either_direction,
reports_a_dependency_on_an_unlisted_crate_of_another_product,
a_listed_crate_without_a_dependent_in_another_product_is_stale,
a_dependency_inside_one_product_needs_no_entry) print the product map and the problem lists on
every run, including passing runs. This repeats the unconditional dbg!(&graph) that was removed
from the crate-layers tests in PR #17615, and it adds noise to cargo test/nextest output that the
earlier fix was meant to prevent.
Code

pnpm/tasks/crate-layers/src/tests/boundary.rs[55]

+    dbg!(&products);
Relevance

●● Moderate

Same-folder precedent is split: PR #17615 accepted removing dbg!(&graph) in crate-layers tests,
while PR #17618 rejected a similar dbg! there. Repo-wide dbg! precedent is also mixed, so near-even.

PR-#17615
PR-#17618
PR-#13773

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Each new test calls dbg! on its results before its assert_eq!, so the debug macro runs on every
test execution regardless of outcome. Assertions alone already show the values on failure, so the
dbg! calls only add output and should be removed (or replaced by assertion messages). The commit
message says the logging was added deliberately, but it is not conditional on failure, which is the
pattern the earlier fix rejected.

pnpm/tasks/crate-layers/src/tests/boundary.rs[55-55]
pnpm/tasks/crate-layers/src/tests/boundary.rs[71-71]
pnpm/tasks/crate-layers/src/tests/boundary.rs[81-81]
pnpm/tasks/crate-layers/src/tests/boundary.rs[105-105]
pnpm/tasks/crate-layers/src/tests/boundary.rs[125-125]

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 new boundary tests in `pnpm/tasks/crate-layers/src/tests/boundary.rs` call `dbg!` on their computed values before asserting. This prints output on every run, including passing runs, which repeats a pattern previously removed from the crate-layers tests.

## Fix Focus Areas
- pnpm/tasks/crate-layers/src/tests/boundary.rs[55-55]
- pnpm/tasks/crate-layers/src/tests/boundary.rs[71-71]
- pnpm/tasks/crate-layers/src/tests/boundary.rs[81-81]
- pnpm/tasks/crate-layers/src/tests/boundary.rs[105-105]
- pnpm/tasks/crate-layers/src/tests/boundary.rs[125-125]

## Recommended Fix
Delete each `dbg!(...)` line. The `assert_eq!` calls already print both sides on failure through pretty_assertions, so no diagnostic output is lost.

ⓘ 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): 59 rules
✅ Cross-repo context — repo relationships
Review mode: Auto: 🚀 Fast: Localized test-only addition with low blast radius and one concern.

Grey Divider

Tip of the day
💡 Did you know, you can start a comment with 'qodo' or '@qodo' to chat about any finding

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Previous reviews

Review updated until commit 5fbc64a

Results up to commit d4e0bec ⚖️ Balanced


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


Remediation recommended
1. Workspace aliases hide product crossings 🐞 Bug ≡ Correctness
Description
product_of takes the first component of a workspace member path without resolving .., so a pnpr
crate recorded as pnpm/../pnpr/... is classified as pnpm. If a member is listed through that path
and gains a dependency on an unlisted pnpm crate, crossing_edges treats the dependency as staying
within one product and does not report it.
Code

pnpm/tasks/crate-layers/src/boundary.rs[R12-14]

+        .split('/')
+        .find(|component| !component.is_empty() && *component != ".")
+}
Relevance

●● Moderate

Real correctness bug in new crate-layers code, but the closest precedent is a rejected
path-traversal validation request in tree.rs (PR #17615).

PR-#17615
PR-#17748

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The graph retains the manifest path derived from the workspace member spelling, while the
working-tree reader opens that path through the filesystem. The new check compares products
extracted from those retained strings, so a path beginning pnpm/../pnpr yields pnpm even though
it opens a pnpr manifest.

pnpm/tasks/crate-layers/src/graph.rs[87-116]
pnpm/tasks/crate-layers/src/graph.rs[59-70]
pnpm/tasks/crate-layers/src/tree.rs[23-43]
pnpm/tasks/crate-layers/src/boundary.rs[9-14]
pnpm/tasks/crate-layers/src/boundary.rs[48-57]

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

## Issue description
Workspace member paths containing `..` can make a crate under `pnpr` appear to belong to `pnpm`, hiding a cross-product dependency.

## Fix Focus Areas
- pnpm/tasks/crate-layers/src/boundary.rs[9-14]
- pnpm/tasks/crate-layers/src/graph.rs[59-63]

## Recommended Fix
Normalize workspace member paths relative to the repository root before recording or interpreting their product. Reject paths that escape the root or cannot be assigned to an expected product, and test a member spelled with `..`.

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

Dismiss ↗ | View ↗


2. External crates trigger false boundary errors 🐞 Bug ≡ Correctness
Description
crossing_edges accepts every graph edge as a workspace dependency, but graph::read creates edges
when a dependency's package name matches a workspace crate without checking whether it resolves to
that crate. If a crate in one product declares a registry dependency with the same name as a crate
in the other product, the new check reports an unlisted crossing—or treats a listed crossing as
still active—even though the dependency is external.
Code

pnpm/tasks/crate-layers/src/boundary.rs[R53-56]

+    graph.edges
+        .iter()
+        .filter(|edge| crosses(&edge.from, &edge.to))
+        .map(|edge| (edge.from.as_str(), edge.to.as_str()))
Relevance

●● Moderate

Plausible graph-edge correctness issue in crate-layers, but no close accepted or rejected precedent
covers same-name external dependencies.

PR-#17748
PR-#17743

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Graph construction inserts a workspace edge based solely on the resolved dependency name, and the
new crossing check interprets every such edge as a product crossing. The boundary tests themselves
use version-only declarations for their cross-product fixtures, demonstrating that those
declarations are currently treated as workspace edges.

pnpm/tasks/crate-layers/src/graph.rs[64-70]
pnpm/tasks/crate-layers/src/graph.rs[179-203]
pnpm/tasks/crate-layers/src/boundary.rs[20-39]
pnpm/tasks/crate-layers/src/tests/boundary.rs[31-39]

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 boundary check consumes name-matched graph edges even when their declarations resolve to external packages, causing false crossings and masking stale entries.

## Fix Focus Areas
- pnpm/tasks/crate-layers/src/graph.rs[64-70]
- pnpm/tasks/crate-layers/src/graph.rs[179-203]
- pnpm/tasks/crate-layers/src/boundary.rs[53-57]

## Recommended Fix
Construct internal graph edges only for dependencies that resolve to workspace members, following `path` and inherited workspace dependency declarations rather than relying on package-name equality alone. Test a version-only registry dependency whose name matches a crate in the opposite product.

ⓘ 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 commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge; the previous finding is fully addressed.

Reviews (2) · Last reviewed commit: "test(crate-layers): log boundary check r..." · Reviewed by Greptile

@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Nov 13, 2026
@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 5fbc64a

@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 merged commit 1885aac into main Nov 13, 2026
62 checks passed
@zkochan
zkochan deleted the crate-layers-product-boundary branch November 13, 2026 14:45
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.

2 participants