Repository navigation
feat(crate-layers): check the product boundary between pnpm and pnpr - #18059
Conversation
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]>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Micro-Benchmark ResultsLinux |
Same-run regression checkHEAD 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.
Same-run syscall checkEach install runs 2 more times per revision, untimed, under
Integrated-Benchmark Report (Linux)Commit: Compared against main at: 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
BENCHMARK_REPORT.jsonScenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.jsonScenario: Isolated linker: repeat install, hot cache + hot store
BENCHMARK_REPORT.jsonScenario: Isolated linker: repeat install, cold cache + hot store
BENCHMARK_REPORT.jsonScenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.jsonScenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.jsonScenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.jsonScenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.jsonScenario: Isolated linker: peer-heavy resolve, hot cache, offline
BENCHMARK_REPORT.jsonScenario: Isolated linker: linked-workspace resolve, hot cache, offline
BENCHMARK_REPORT.jsonScenario: Isolated linker: injected workspace repeat install, hot cache + hot store
BENCHMARK_REPORT.jsonScenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.jsonScenario: GVS linker: fresh restore, hot cache + hot storeSame 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.
BENCHMARK_REPORT.jsonScenario: Store only: unlocked direct deps, cold cache + hot storeStore-only install (
BENCHMARK_REPORT.jsonScenario: Cargo: repeat install, hot cache + hot storeFrozen repeat install of a Cargo workspace (
BENCHMARK_REPORT.json |
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
PR Summary by QodoEnforce the pnpm–pnpr crate product boundary
AI Description
Diagram
High-Level Assessment
Files changed (8)
|
Code Review by Qodo
1. Workspace aliases hide product crossings
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
[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 |
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Code review by qodo was updated up to the latest commit 5fbc64a |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Summary
Adds a product boundary rule to
crate-layers check, the "Product boundary rule" item of pnpm/tasks#253.pnpm/(CLI crates and tasks) orpnpr/(registry server). The directory decides, not the name, because thepnprcrate has nopnpr-prefix.[product_boundary]table incrate-layers.tomllists the crates that a crate of the other product may depend on.[[exception]].just crate-layers checkpasses.Crates that cross today (30):
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-logpnpr(frompnpm-testing-utils, and dev frompnpm-cliandpnpm-pnpr-client),pnpr-fixtures(tests, benchmark, registry mock),pnpr-package-name(frompnpm-registry-mock),pnpr-registry(frompnpm-config)Most of the pnpm crates are reached from the
pnprbinary crate. The notable ones arepnpm-configandpnpm-package-manager, which pull most of the CLI into the server. In the other direction,pnpm-config→pnpr-registryis the only non-test edge from the CLI into pnpr.Squash Commit Body
Checklist
already linked to it solves it.
No changeset: internal tooling only.
🤖 Generated with Claude Code
Written by an agent (Claude Code, claude-opus-5-5).
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Summary by CodeRabbit