Repository navigation
fix(pacquet): restore Bit workspace/capsule install parity with the v11 engine - #12899
Conversation
…om the hoisted graph Two hoisted-linker (nodeLinker: hoisted) bugs that silently removed packages from the materialized tree: - The walker resolved each hoister reference's metadata via `packages[full key]`, but `packages:` keys are peer-stripped while references carry the peer suffix — every peered snapshot (and its whole subtree) was dropped from the graph and never materialized. `lookup_package_metadata` now falls back to the peer-stripped key. - `hoist()` attached non-root importers to the hoister tree only when `hoist_workspace_packages` was on. pnpm v11 attaches every importer unconditionally; the knob only controls root-level name links for the workspace packages themselves. With the gate, any dependency used only by a non-root importer vanished from the install. The importers are now attached unconditionally. Restores Bit's per-root-component dependency variants (a root pinned to is-odd@1 resolved the workspace root's is-odd@2 before this). Co-Authored-By: Claude Fable 5 <[email protected]>
…lows rely on Four install-pipeline gaps against the pnpm v11 engine, all surfaced by Bit's e2e suite: - Root-component member linking read each member's manifest from its materialized virtual-store slot; a Bit workspace component has no package.json on disk (its manifest is in-memory and Bit's hooks strip sibling edges from it), so the install failed with root_component_manifest_read_failed. A member without a slot manifest now falls back to linking every member of its root — additive and name-unique per root. A malformed manifest still errors. - .modules.yaml's injectedDeps was never populated. It is now derived from the lockfile's file: snapshots — virtual-store slots under the isolated linker, the walker's hoistedLocations under the hoisted linker. Bit's build task reads it back to hard-link compiled artifacts into every materialized copy of a component. - Importer keys naming the install's own declared projects may live outside the lockfile dir (Bit's nested capsule installs pass a project at ".."); they now bypass the malformed-lockfile unsafe-path rejection, which stays in force for ids that exist only in parsed lockfile input. - link: direct deps excluded from the lockfile by excludeLinksFromLockfile were never materialized (v11's linkDirectDeps worked from the project manifests). A new post-install pass links them from the in-memory manifests; aliases the lockfile tracks are left to the lockfile passes so dedupeDirectDeps decisions are not undone. Covers Bit's link:- provided `@teambit` runtime in capsules and nmSelfReferences (link:.) entries. Co-Authored-By: Claude Fable 5 <[email protected]>
…eDependency pnpm v11 resolved an empty pref like an absent one (latest matching version); the binding passed it through verbatim and the whole chain fell off with SPEC_NOT_SUPPORTED_BY_ANY_RESOLVER. Bit's resolveRemoteVersion sends exactly this shape for a versionless spec. Co-Authored-By: Claude Fable 5 <[email protected]>
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe PR updates dependency resolution and workspace hoisting, adds manifest-based ChangesDependency resolution and workspace hoisting
Manifest and workspace linking
Install path and injected dependencies
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant Install
participant LinkManifestLinkDeps
participant VirtualStoreLayout
participant ModulesManifest
Install->>LinkManifestLinkDeps: Materialize manifest link dependencies
Install->>VirtualStoreLayout: Collect file snapshot targets
VirtualStoreLayout->>Install: Return injected dependency map
Install->>ModulesManifest: Serialize injectedDeps
Possibly related PRs
Suggested labels: Suggested reviewers: ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
PR Summary by QodoFix pacquet pnpm v11 parity for Bit workspace/capsule installs
AI Description
Diagram
High-Level Assessment
Files changed (18)
|
Micro-Benchmark ResultsLinux |
Code Review by Qodo
Context used✅ Compliance rules (platform):
51 rules 1.
|
PR Code Suggestions ✨Latest suggestions up to df90dd0 Warning
Previous suggestionsSuggestions up to commit 30c9bdf
Suggestions up to commit b683d79
Suggestions up to commit 966a6d9
Suggestions up to commit 8b28973
Suggestions up to commit 2fff932
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
pacquet/crates/package-manager/src/symlink_direct_dependencies/tests.rs (1)
588-600: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winAdd a regression test for the trusted-importer bypass
pacquet/crates/package-manager/src/symlink_direct_dependencies/tests.rs: add a case that passes an unsafe importer id throughtrusted_importer_ids: Some(...)and asserts the symlink is allowed. The current test only covers the untrustedNonepath.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pacquet/crates/package-manager/src/symlink_direct_dependencies/tests.rs` around lines 588 - 600, Add a regression test alongside the existing SymlinkDirectDependencies test, using an unsafe importer ID with trusted_importer_ids set to Some(...) and asserting the dependency symlink is created or otherwise allowed. Retain the existing trusted_importer_ids: None case to verify the untrusted path remains covered.Source: Path instructions
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pacquet/crates/package-manager/src/install.rs`:
- Around line 1476-1492: Update link_manifest_link_deps and its callers to emit
a pnpm:root added event whenever a manifest-linked link: dependency is
successfully symlinked, including the package name and relevant root-event
metadata. Ensure these events flow through the same reporting/NDJSON path used
by pnpm’s linkDirectDeps so they contribute to the +N -M summary without logging
skipped lockfile-tracked aliases.
In `@pacquet/crates/real-hoist/src/lib.rs`:
- Around line 287-323: The hoisting logic ignores
Config::hoist_workspace_packages, leaving the option inert and lacking
pnpm-compatible workspace package linking. Update the linker and hoisting flow
around the non-root importer handling and relevant configuration consumers to
implement hoistedWorkspacePackages behavior: keep importer dependency tree
membership unconditional, but conditionally create root hoisted name-links for
workspace packages based on the flag.
---
Outside diff comments:
In `@pacquet/crates/package-manager/src/symlink_direct_dependencies/tests.rs`:
- Around line 588-600: Add a regression test alongside the existing
SymlinkDirectDependencies test, using an unsafe importer ID with
trusted_importer_ids set to Some(...) and asserting the dependency symlink is
created or otherwise allowed. Retain the existing trusted_importer_ids: None
case to verify the untrusted path remains covered.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 6983bbc2-5205-44e0-985b-b5876021ed89
📒 Files selected for processing (18)
pacquet/crates/napi/src/resolve.rspacquet/crates/package-manager/src/hoisted_dep_graph.rspacquet/crates/package-manager/src/hoisted_dep_graph/tests.rspacquet/crates/package-manager/src/install.rspacquet/crates/package-manager/src/install/tests.rspacquet/crates/package-manager/src/install_frozen_lockfile.rspacquet/crates/package-manager/src/install_with_fresh_lockfile.rspacquet/crates/package-manager/src/lib.rspacquet/crates/package-manager/src/link_manifest_link_deps.rspacquet/crates/package-manager/src/link_manifest_link_deps/tests.rspacquet/crates/package-manager/src/link_root_component_members.rspacquet/crates/package-manager/src/link_root_component_members/tests.rspacquet/crates/package-manager/src/symlink_direct_dependencies.rspacquet/crates/package-manager/src/symlink_direct_dependencies/tests.rspacquet/crates/package-manager/src/virtual_store_layout.rspacquet/crates/package-manager/src/virtual_store_layout/tests.rspacquet/crates/real-hoist/src/lib.rspacquet/crates/real-hoist/src/tests.rs
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #12899 +/- ##
==========================================
- Coverage 85.34% 85.31% -0.04%
==========================================
Files 453 454 +1
Lines 71074 71474 +400
==========================================
+ Hits 60657 60976 +319
- Misses 10417 10498 +81 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Review follow-ups for the manifest link: pass: - A dependency key is a raw package.json object string; joining it into node_modules/<alias> unvalidated let a crafted alias (../.git, an absolute path, a backslash) escape node_modules and, combined with the force-replace symlink helper, rename or overwrite arbitrary paths. The join now routes through safe_join_modules_dir — the same ERR_PNPM_INVALID_DEPENDENCY_NAME guard the lockfile passes apply — and a traversal test pins the rejection. - Each manifest-linked dep now emits the same pnpm:root added event the lockfile-driven pass emits, so these links show up in the +N summary and NDJSON output like v11's linkDirectDeps reported them. Reused (already-correct) symlinks stay silent. Co-Authored-By: Claude Fable 5 <[email protected]>
…t ids A declared project at `..` must link (Bit's nested capsule installs), while the same id without the trusted set keeps the unsafe-path rejection. Review follow-up on the trusted_importer_ids change. Co-Authored-By: Claude Fable 5 <[email protected]>
|
All review findings addressed:
Written by an agent (Claude Code, claude-fable-5). |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
pacquet/crates/package-manager/src/link_manifest_link_deps.rs (1)
40-108: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winUse the linked package version here, not the raw
link:spec. pacquet/crates/package-manager/src/link_manifest_link_deps.rs:85-89 should mirror pnpm’spnpm:root addedpayload, whereversioncomes from the linked package manifest (or0.0.0fallback), not thelink:../...string.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pacquet/crates/package-manager/src/link_manifest_link_deps.rs` around lines 40 - 108, Update the RootMessage::Added construction in link_manifest_link_deps so AddedRoot.version uses the linked target package manifest’s version, falling back to "0.0.0" when unavailable, instead of spec.to_string() containing the raw link: value. Reuse the resolved target_path or existing manifest-loading utilities while preserving the current per-group reporting behavior.Source: Learnings
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@pacquet/crates/package-manager/src/link_manifest_link_deps.rs`:
- Around line 40-108: Update the RootMessage::Added construction in
link_manifest_link_deps so AddedRoot.version uses the linked target package
manifest’s version, falling back to "0.0.0" when unavailable, instead of
spec.to_string() containing the raw link: value. Reuse the resolved target_path
or existing manifest-loading utilities while preserving the current per-group
reporting behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 16cee336-9307-423a-95ff-30ef66187c3c
📒 Files selected for processing (3)
pacquet/crates/package-manager/src/install.rspacquet/crates/package-manager/src/link_manifest_link_deps.rspacquet/crates/package-manager/src/link_manifest_link_deps/tests.rs
🚧 Files skipped from review as they are similar to previous changes (1)
- pacquet/crates/package-manager/src/install.rs
|
Code review by qodo was updated up to the latest commit 8b28973 |
link_manifest_link_deps hardcoded <project>/node_modules while the lockfile-driven symlink pass derives the per-project modules dir from config.modules_dir's basename — a modulesDir override would grow a stray node_modules/ next to the intended tree. The caller now threads the same basename in, with a test pinning the custom-dir placement. Co-Authored-By: Claude Fable 5 <[email protected]>
|
Code review by qodo was updated up to the latest commit 966a6d9 |
…k pass The install call site derives the name from config.modules_dir.file_name(), which never yields `.`, `..`, or a separator — but the helper is public and the joined path decides where force-replacing symlinks land, so it now enforces the single-normal- component contract itself and errors before any filesystem write. A test pins the rejection for `.`, `..`, empty, separator-bearing, and absolute names. Co-Authored-By: Claude Fable 5 <[email protected]>
|
Code review by qodo was updated up to the latest commit b683d79 |
The isolated-linker branch of collect_injected_deps built its targets with native separators, so .modules.yaml carried backslashes on Windows — inconsistent with the hoistedLocations entries the hoisted branch reuses (normalized in path_relative_to_lockfile_dir) and with the existing unit test's expectations, which failed on the Windows CI runner. Normalize to forward slashes on every platform. Co-Authored-By: Claude Fable 5 <[email protected]>
|
Code review by qodo was updated up to the latest commit 30c9bdf |
Integrated-Benchmark Report (Linux)Commit: Each scenario reports direct installs and pnpr installs. Bencher consumes pacquet@HEAD and pnpr@HEAD. Scenario: Isolated linker: fresh restore, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.107688237440001,
"stddev": 0.12932164068438204,
"median": 4.05971658374,
"user": 3.80264606,
"system": 3.4776781999999997,
"min": 3.98237320524,
"max": 4.35115123024,
"times": [
4.28740454624,
4.08842659624,
4.04905870824,
4.35115123024,
3.98237320524,
3.9898784102400002,
4.07037445924,
4.01847427224,
4.20904696024,
4.03069398624
]
},
{
"command": "pacquet@main",
"mean": 4.10820730574,
"stddev": 0.1186923341318949,
"median": 4.15821173774,
"user": 3.80232626,
"system": 3.4513808999999993,
"min": 3.93218003024,
"max": 4.23787524224,
"times": [
4.21767048024,
3.94292316824,
4.23787524224,
4.18688877824,
3.95433303624,
4.11759401224,
4.17618483424,
4.15071448924,
4.16570898624,
3.93218003024
]
},
{
"command": "pnpr@HEAD",
"mean": 2.14532010424,
"stddev": 0.11700021424952618,
"median": 2.11845699224,
"user": 2.65063056,
"system": 2.9927297,
"min": 1.99841318024,
"max": 2.32495337924,
"times": [
2.07724804624,
2.10191857924,
2.07481424624,
2.00494641224,
2.32495337924,
2.31484471524,
1.99841318024,
2.19043914724,
2.13499540524,
2.23062793124
]
},
{
"command": "pnpr@main",
"mean": 2.17028781244,
"stddev": 0.13351329407839996,
"median": 2.20705901124,
"user": 2.63406716,
"system": 2.997778,
"min": 1.93961029424,
"max": 2.3089964802400003,
"times": [
2.23573788524,
1.93961029424,
2.3089964802400003,
2.04097249024,
2.27356581124,
2.27196891324,
2.30573956724,
2.17838013724,
2.14101696924,
2.00688957624
]
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.6543168588399999,
"stddev": 0.009615619206173277,
"median": 0.65357341164,
"user": 0.38916202,
"system": 1.32892756,
"min": 0.64092540014,
"max": 0.66786251314,
"times": [
0.66032495914,
0.64201411614,
0.6467725641400001,
0.66250209614,
0.65436145514,
0.66590955514,
0.66786251314,
0.64092540014,
0.64971056114,
0.65278536814
]
},
{
"command": "pacquet@main",
"mean": 0.6718111864399999,
"stddev": 0.04002045616051102,
"median": 0.66339302414,
"user": 0.38330422,
"system": 1.33120986,
"min": 0.6284028391400001,
"max": 0.77695359814,
"times": [
0.65062156714,
0.65774620814,
0.6284028391400001,
0.67240097214,
0.67256271514,
0.66392223214,
0.66286381614,
0.68399895314,
0.64863896314,
0.77695359814
]
},
{
"command": "pnpr@HEAD",
"mean": 0.7020989531399999,
"stddev": 0.02907702471242113,
"median": 0.6980168196400001,
"user": 0.39440652,
"system": 1.34930906,
"min": 0.66756406514,
"max": 0.76879172614,
"times": [
0.70932737214,
0.70555148914,
0.70113530114,
0.67041145014,
0.69489833814,
0.68764395714,
0.66756406514,
0.69090768514,
0.72475814714,
0.76879172614
]
},
{
"command": "pnpr@main",
"mean": 0.73159156714,
"stddev": 0.08979616074115364,
"median": 0.70667610364,
"user": 0.40604472,
"system": 1.36206816,
"min": 0.67669688014,
"max": 0.9842587501400001,
"times": [
0.71945898014,
0.7075141781400001,
0.71285822814,
0.70240013814,
0.68446406314,
0.67669688014,
0.70524565714,
0.9842587501400001,
0.71718076714,
0.70583802914
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.275639985080001,
"stddev": 0.026239450117484638,
"median": 4.27577690018,
"user": 3.76790142,
"system": 3.38621762,
"min": 4.226192092680001,
"max": 4.3154447646800005,
"times": [
4.27774155968,
4.258124044680001,
4.27879024968,
4.27120747868,
4.273812240680001,
4.29736973468,
4.25307102268,
4.226192092680001,
4.304646662680001,
4.3154447646800005
]
},
{
"command": "pacquet@main",
"mean": 4.289408362580001,
"stddev": 0.03287373392299391,
"median": 4.29311935318,
"user": 3.7518535199999996,
"system": 3.3845509199999997,
"min": 4.23879265668,
"max": 4.33525066468,
"times": [
4.23879265668,
4.27508228768,
4.273046083680001,
4.296399768680001,
4.304189126680001,
4.30826977468,
4.33105225268,
4.28983893768,
4.33525066468,
4.24216207268
]
},
{
"command": "pnpr@HEAD",
"mean": 2.2475089947799995,
"stddev": 0.12285650724189091,
"median": 2.2689741131799996,
"user": 2.4842650199999996,
"system": 2.9003441199999997,
"min": 2.0594584236799998,
"max": 2.42296778668,
"times": [
2.19996375468,
2.28005248768,
2.31584462868,
2.1150849416799997,
2.32568668368,
2.25789573868,
2.3868078596799998,
2.42296778668,
2.11132764268,
2.0594584236799998
]
},
{
"command": "pnpr@main",
"mean": 2.17129489568,
"stddev": 0.10292739917025986,
"median": 2.1438045521799998,
"user": 2.48829332,
"system": 2.91786122,
"min": 2.05210370968,
"max": 2.41065419368,
"times": [
2.15386794468,
2.28140478968,
2.14362948568,
2.14397961868,
2.41065419368,
2.14152377368,
2.09281780668,
2.17504510268,
2.05210370968,
2.11792253168
]
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.36220484292,
"stddev": 0.01622342380405314,
"median": 1.3615612594200002,
"user": 1.3156804799999997,
"system": 1.70293128,
"min": 1.34325360992,
"max": 1.39740436892,
"times": [
1.34325360992,
1.36003287892,
1.35546157192,
1.36308963992,
1.37422921092,
1.37013714792,
1.39740436892,
1.34388683992,
1.36527769892,
1.34927546192
]
},
{
"command": "pacquet@main",
"mean": 1.3618684863200001,
"stddev": 0.02934140419719299,
"median": 1.3477853734199998,
"user": 1.3206954799999997,
"system": 1.67134958,
"min": 1.32817071292,
"max": 1.42709074592,
"times": [
1.3496211599199999,
1.34594958692,
1.37738427292,
1.42709074592,
1.37262113092,
1.34589908392,
1.34587943492,
1.33973606892,
1.38633266592,
1.32817071292
]
},
{
"command": "pnpr@HEAD",
"mean": 0.6774082585200001,
"stddev": 0.028767254914916433,
"median": 0.67176180692,
"user": 0.33766818,
"system": 1.28555908,
"min": 0.65259035692,
"max": 0.75453864892,
"times": [
0.66801300692,
0.65652986392,
0.75453864892,
0.67799128692,
0.6758938599200001,
0.65259035692,
0.66146570492,
0.67234307992,
0.68353624292,
0.67118053392
]
},
{
"command": "pnpr@main",
"mean": 0.6882661691199999,
"stddev": 0.03548581991892535,
"median": 0.6798366224200001,
"user": 0.33753878,
"system": 1.3097717799999997,
"min": 0.66187658092,
"max": 0.78370555492,
"times": [
0.68877631092,
0.6811592709200001,
0.67985050292,
0.67982274192,
0.66187658092,
0.70085944992,
0.66334352092,
0.6705789869200001,
0.67268877092,
0.78370555492
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 3.05669677522,
"stddev": 0.04877192738506732,
"median": 3.03528872552,
"user": 1.79392006,
"system": 1.9898369799999998,
"min": 3.0176569830199997,
"max": 3.15797692002,
"times": [
3.03440539502,
3.03617205602,
3.02744109702,
3.02842007802,
3.04423918102,
3.0176569830199997,
3.01770044102,
3.1276150610199998,
3.15797692002,
3.07534054002
]
},
{
"command": "pacquet@main",
"mean": 3.05126624692,
"stddev": 0.04511407011146454,
"median": 3.04613468402,
"user": 1.7941742599999997,
"system": 1.9488628799999996,
"min": 2.99514804502,
"max": 3.1371190910199998,
"times": [
3.04171614702,
3.05129223502,
3.04238102302,
3.04988834502,
2.99514804502,
3.0661382220199997,
3.00055525702,
3.1371190910199998,
3.11163320602,
3.01679089802
]
},
{
"command": "pnpr@HEAD",
"mean": 0.6643381508200001,
"stddev": 0.0056948827764310055,
"median": 0.66503506702,
"user": 0.34481126,
"system": 1.28073458,
"min": 0.65406097902,
"max": 0.6723877460200001,
"times": [
0.66844508702,
0.66634949302,
0.65406097902,
0.66264730502,
0.67092792302,
0.6644978420200001,
0.6723877460200001,
0.6599068920200001,
0.6585859490200001,
0.66557229202
]
},
{
"command": "pnpr@main",
"mean": 0.66665004182,
"stddev": 0.00513779156207562,
"median": 0.66678219302,
"user": 0.34701326,
"system": 1.27814338,
"min": 0.6575686270200001,
"max": 0.6740894110200001,
"times": [
0.6575686270200001,
0.67145104702,
0.67242529102,
0.66744241902,
0.6612152290200001,
0.66740761402,
0.66615677202,
0.6653698670200001,
0.66337414102,
0.6740894110200001
]
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.6346147199999999,
"stddev": 0.009584659235510381,
"median": 0.637524492,
"user": 0.6027113999999999,
"system": 0.14985833999999998,
"min": 0.6226424285,
"max": 0.6483727245,
"times": [
0.6425016305,
0.6249382415,
0.6354049735,
0.6226424285,
0.6239109215,
0.6415080825,
0.6250005705,
0.6422236165,
0.6483727245,
0.6396440105
]
},
{
"command": "pacquet@main",
"mean": 0.6351098421000001,
"stddev": 0.006194926657461654,
"median": 0.6349302885,
"user": 0.6063903999999999,
"system": 0.14847154,
"min": 0.6255552675,
"max": 0.6470407025,
"times": [
0.6409555045,
0.6365320355,
0.6338029395,
0.6470407025,
0.6255552675,
0.6333325705,
0.6383463815,
0.6288421155,
0.6306332665,
0.6360576375
]
},
{
"command": "pnpr@HEAD",
"mean": 0.10800982022,
"stddev": 0.000360423929314787,
"median": 0.1080089865,
"user": 0.027102839999999996,
"system": 0.01942426,
"min": 0.1071482675,
"max": 0.1086476865,
"times": [
0.1071482675,
0.1078453725,
0.1080964965,
0.1078628825,
0.1082951585,
0.1077908775,
0.1081145865,
0.1080089865,
0.1081431535,
0.1078223165,
0.1085721095,
0.1075656575,
0.1084798575,
0.1083324465,
0.1080116625,
0.1077483075,
0.1086208735,
0.1075621205,
0.1079247765,
0.1079016105,
0.1077947845,
0.1086476865,
0.1082366975,
0.1076637275,
0.1080550895
]
},
{
"command": "pnpr@main",
"mean": 0.10796635594000001,
"stddev": 0.0004512734736377591,
"median": 0.1080795735,
"user": 0.02869792,
"system": 0.01773434,
"min": 0.1065398555,
"max": 0.1086225955,
"times": [
0.1073275845,
0.1079854395,
0.1082339595,
0.1082262595,
0.1077903825,
0.1077683845,
0.1086225955,
0.1079541705,
0.1075882395,
0.1078780985,
0.1082017815,
0.1074864355,
0.1082921105,
0.1081698425,
0.1074497805,
0.1080203565,
0.1082891635,
0.1083612085,
0.1076704415,
0.1080795735,
0.1081577995,
0.1082976195,
0.1081662525,
0.1086015635,
0.1065398555
]
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 6.8671285742200014,
"stddev": 0.09605064160071305,
"median": 6.889921017420001,
"user": 4.02553376,
"system": 3.71989814,
"min": 6.71256343692,
"max": 7.05917838892,
"times": [
7.05917838892,
6.71256343692,
6.7840656719200005,
6.78421876192,
6.92093749992,
6.82391490192,
6.897496745920001,
6.890803264920001,
6.90906829992,
6.88903876992
]
},
{
"command": "pacquet@main",
"mean": 6.855389324620001,
"stddev": 0.11337411795845533,
"median": 6.82720741642,
"user": 3.9904512599999995,
"system": 3.7106499399999997,
"min": 6.736040362920001,
"max": 7.1235503299200005,
"times": [
6.81305459892,
6.85235385892,
6.89584991392,
6.74830588992,
7.1235503299200005,
6.836977456920001,
6.785622415920001,
6.736040362920001,
6.94470104292,
6.81743737592
]
},
{
"command": "pnpr@HEAD",
"mean": 5.04095313762,
"stddev": 0.12218153662529183,
"median": 5.010655185420001,
"user": 2.73654756,
"system": 3.23752054,
"min": 4.90443991692,
"max": 5.264592487920001,
"times": [
4.947924293920001,
4.98085988892,
4.963851532920001,
4.9346822479200005,
5.108671307920001,
5.040450481920001,
5.04535504992,
5.21870416792,
4.90443991692,
5.264592487920001
]
},
{
"command": "pnpr@main",
"mean": 4.97807809712,
"stddev": 0.14139151911227305,
"median": 4.91218348492,
"user": 2.77094886,
"system": 3.2313981399999996,
"min": 4.86444181592,
"max": 5.27243360992,
"times": [
5.1258223349200005,
4.878960111920001,
5.27243360992,
4.86444181592,
5.11469195992,
4.90587968292,
4.89121146292,
4.866406924920001,
4.9184872869200005,
4.942445780920001
]
}
]
} |
|
| Branch | pr/12899 |
| Testbed | pnpr |
⚠️ WARNING: No Threshold found!Without a Threshold, no Alerts will ever be generated.
Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the--ci-only-thresholdsflag.
Click to view all benchmark results
| Benchmark | Latency | milliseconds (ms) |
|---|---|---|
| isolated-linker.fresh-install.cold-cache.cold-store | 📈 view plot | 2,247.51 ms |
| isolated-linker.fresh-install.cold-cache.hot-store | 📈 view plot | 664.34 ms |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot | 677.41 ms |
| isolated-linker.fresh-resolve.hot-cache.offline | 📈 view plot | 108.01 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot | 2,145.32 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr | 📈 view plot | 5,040.95 ms |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 702.10 ms |
… parity follow-ups Follow-ups closing the remaining v11-parity gaps flagged on the Bit-parity PR: - hoistWorkspacePackages (v11's hoistedWorkspacePackages) is now implemented instead of inert: every named non-root project becomes a lowest-precedence root-level hoist candidate; where a hoist pattern matches, <hoisted modules dir>/<name> symlinks straight to the project dir. Matching v11, placements stay out of .modules.yaml's hoistedDependencies and contribute no bins; one deliberate divergence — a placed name claims its alias so an equally-named transitive can't clobber the link nondeterministically. The pinned known-failure CLI test is replaced by a real end-to-end test covering both the default-on and opted-out shapes. - The manifest link: pass now links the placed deps' declared bins into <modules dir>/.bin (v11's linkDirectDeps bin-linked every direct dep, link: included); targets without a package.json are skipped, so Bit's manifest-less component links stay bin-less no-ops. - injectedDeps is restricted to directory-resolution snapshots: v11 derived the map from injected workspace projects, so a file: tarball dep — whose extracted copy mirrors no source directory — no longer appears. - Groundwork for the napi peer-issues query: Install/fresh-path gain an optional peer_issues_sink that captures the resolver's per-importer peer-dependency issues, and a sink-driven dry run suppresses the CLI's stdout diff report. Always None for CLI installs; the binding consumes it in the follow-up commit. - plans/MULTI_LEVEL_HOISTING.md documents the remaining per-importer hoisting-roots gap (layout-density only — nested placement stays resolution-correct), with the upstream reference and an implementation sketch. Co-Authored-By: Claude Fable 5 <[email protected]>
The last stubbed engine operation. The binding maps the PeerIssuesOptions subset onto the install options and runs a sink-driven dry_run resolve — a full fresh resolution that writes nothing (no lockfile, no node_modules, no CLI report) — then returns the per-importer issues in v11's PeerDependencyIssuesByProjects wire shape. conflicts / intersections are derived the way v11's mergePeers does: all-optional peers are skipped, a single wanted range passes through verbatim, and multiple ranges intersect via node-semver's bound-set intersection (an empty intersection or unparsable range records a conflict, matching v11's swallow-errors safeIntersect). Bit consumes exactly the intersections field to auto-add missing peers. autoInstallPeers defaults to false for this query, unlike install: with peers auto-installed the resolver satisfies them itself and nothing would ever be reported. Callers can opt back in; the shipped index.d.ts documents the difference. Known limitation: parents[].version is empty — the resolver's issue chain is name-only today (noted in parents_from_chain). The now-unused ERR_PNPM_NAPI_UNIMPLEMENTED helper is removed; no stubbed operations remain. Co-Authored-By: Claude Fable 5 <[email protected]>
|
Two follow-up commits close the parity gaps discussed in this review: d2a3d00 — hoistWorkspacePackages + pipeline follow-ups
df90dd0 — The remaining structural gap — per-importer multi-level hoisting roots — is layout-density only (nested placement stays resolution-correct) and is written up with an implementation sketch in Bit's Written by an agent (Claude Code, claude-fable-5). |
|
Code review by qodo was updated up to the latest commit df90dd0 |
Carries the engine fixes for Bit's e2e failures (pnpm/pnpm#12899): root-component member linking without on-disk manifests, injectedDeps in .modules.yaml, hoisted-linker peered-snapshot and importer-subtree materialization, out-of-root declared importers, lockfile-excluded link: deps, empty-specifier resolution, hoistWorkspacePackages name-links, and an implemented getPeerDependencyIssues. Co-Authored-By: Claude Fable 5 <[email protected]>
Fixes six pacquet regressions against the pnpm v11 engine, all surfaced by Bit's e2e suite after
bit'spnpm11branch moved to@pnpm/napi(12.0.0-alpha.5). Together they accounted for ~160 of the 163 e2e failures on Bit's CI (teambit/bit#10293).Hoisted linker (
nodeLinker: hoisted)packages[<full key>], butpackages:keys are peer-stripped while references carry the peer suffix — every peered package (and its whole subtree) vanished from the materialized tree (even a plainreact-dom@x(react@x)at the workspace root).lookup_package_metadatanow falls back to the peer-stripped key.hoistWorkspacePackageswas off. v11'shoist()attaches every importer unconditionally; the knob only controls root-level name links for the workspace packages themselves. Any dependency used only by a non-root importer wasn't installed at all. Importers are now attached unconditionally.Install pipeline
package.jsonon disk (its manifest is in-memory, and Bit's read-package hooks strip sibling edges from it), so everybit installin a workspace with root components failed withroot_component_manifest_read_failed. A member without a slot manifest now falls back to linking the root's full member clique (additive, name-unique per root); a malformed manifest still errors..modules.yaml'sinjectedDepswas never populated. It is now derived from the lockfile'sfile:snapshots — virtual-store slots under the isolated linker, the walker'shoistedLocationsunder the hoisted linker. Bit's build task reads it back to hard-link compiled artifacts into every materialized copy of a component...; the alpha.5 unsafe-importer-path guard refused it. Importer ids backed by the install's own declared projects now bypass the check, which stays in force for ids that exist only in parsed lockfile input.link:deps excluded byexcludeLinksFromLockfilewere never materialized. v11'slinkDirectDepsworked from the project manifests; pacquet's symlink pass works from the lockfile importers, so the excluded links were lost — including Bit'slink:-provided@teambitruntime in capsules andnmSelfReferences(link:.) entries. A new post-install pass links them from the in-memory manifests; aliases the lockfile tracks are left to the lockfile passes sodedupeDirectDepsdecisions are not undone.napi binding
bareSpecifierfell off the resolver chain. v11 resolved an empty pref like an absent one (latest matching version); the binding passed it through verbatim andresolveDependencyfailed withSPEC_NOT_SUPPORTED_BY_ANY_RESOLVER. Bit'sresolveRemoteVersionsends exactly this shape for a versionless spec.Verification
link_root_component_members,collect_injected_deps, hoisted-graph peered lookup, hoister tree membership,link_manifest_link_deps); fullcargo test --workspacefor pacquet is green, clippy clean.app root components38/38 across isolated/hoisted/yarn linkers (previously failed atbefore all/ wrong peer variants / missing build side-effects),custom-env26/26 (previously ~7before allinstall crashes), andbit new react --aspect teambit.react/react-envworks end-to-end (previouslyRefusing to install importer with unsafe path key "..").No TypeScript-side port is needed: every change restores behavior the v11 TS engine already has.
Bit needs these in a published
@pnpm/napi(12.0.0-alpha.6) plus the already-landed Bit-side fix (zkochan/bit@ee19e3327) for teambit/bit#10293's CI to go green.Written by an agent (Claude Code, claude-fable-5).
Summary by CodeRabbit
file:injected workspace dependency mappings and carry them through.modules.yaml.link:dependencies are now materialized as symlinks in projectmodulesDir(supports absolute, relative, andlink:., plus safemodulesDirvalidation).package.jsonnow link to all other sibling root members.