Repository navigation
Fix yarn portal copies read as no package (#1579) - #1586
Merged
Mikola Lysenko (mikolalysenko) merged 3 commits intoOct 15, 2026
Merged
Conversation
Assisted-by: Claude Code:claude-opus-5-5
A yarn berry portal: or link: copy is locked at the placeholder version 0.0.0-use.local, so only its package.json says what it installs. Two shapes were dropped as "no package copy", so hosted and vendored scans reported a clean success and every VEX path attested not_affected while yarn linked unpatched code: - a portal: target with no package.json (a .gitkeep placeholder a fetch step fills): yarn refuses a manifest-less portal, so the directory on disk is not what gets installed. Only a link: to a plain directory is exempt now. - a manifest with no name or no version. A nameless one may be any package; one naming a package but no version may be any version of that package, and contests only that package. The copy now records whether it is a portal or a link, and the vendored, hosted and vex paths share the decision. Fixes #1579 Assisted-by: Claude Code:claude-opus-5-5
A portal:/link: copy whose package.json names a package but no version now gets a vendoring warning that says so, instead of "whose package can't be read". An empty or invalid name in that manifest names no package, so the copy is treated as possibly any package rather than as a copy of a package called "". Refs #1579 Assisted-by: Claude Code:claude-opus-5-5
Mikola Lysenko (mikolalysenko)
marked this pull request as ready for review
October 15, 2026 19:09
Collaborator
Author
|
BugBot review Generated by Claude Code |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit bca69dd. Configure here.
Tanmay Singla (Tanmay182003)
approved these changes
Oct 15, 2026
Mikola Lysenko (mikolalysenko)
deleted the
agent/fix-yarn-portal-copy-unknown
branch
October 15, 2026 19:59
This was referenced Oct 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
LLM Description written by Claude Code:claude-opus-5-5
Fixes #1579
Summary
A yarn berry
portal:/link:copy is locked at the placeholder version0.0.0-use.local, so only itspackage.jsonsays what it installs. Two shapes from #1579 were dropped as "no package copy". Hosted and vendored scans reported a clean success, and in-run and lock-onlyvexattestednot_affected, while yarn linked unpatched left-pad asnode_modules/lp2. Both shapes are now treated as possible unpatched copies: hosted warnsredirect_copy_unpatched, vendored warnsvendor_copy_unpatched, andvexwithholds the contested refs.Root cause
linked_copy_unknown(vendor/yarn_copies.rs) exempted any non-empty directory with nopackage.json, for both protocols. That exemption only holds forlink:(plain assets). Yarn refuses to install a manifest-lessportal:, so a placeholder target (a.gitkeepthat a fetch step fills) is not what gets installed.CopyRef::Linkeddidn't record its protocol, so the two couldn't be told apart.nameorversionmadeCopyRef::identityreturnNone. Themanifest_parsedshort-circuit then said "not unknown". Thefile:directory twin already failed closed.Hosted (through vex discovery), vendored (
other_name_copies) andvex(record_copies) share this decision, so the fix sits in that shared code.Changes
CopyRef::Linked(dir, LinkKind)recordsPortalorLink. Aportal:whose identity can't be read is always unknown. Only alink:to a non-empty directory with nopackage.jsonstays exempt.namemay be any package. One that names a package but no version may be any version of that package only.UnidentifiedCopygains anamethat scopes the contest, so a versionlesslink:to an unrelated package doesn't withhold every ref in the lock.docs/ecosystems.mddescribes the new shapes.portal:/link:copy whose target directory is missing (e.g. an uninitialized git submodule), so hosted and vendored scans succeed and VEX attests not_affected while that copy installs unpatched #1561 vendored test'sportal:→ plain-directory control is now a positive case (that's the Yarn berry still drops aportal:copy whose target has no package.json (e.g. a.gitkeepplaceholder) or whose package.json lacks name/version, so scans succeed and VEX attests not_affected while that copy installs unpatched #1579 change). Thelink:control is unchanged.Test evidence
New regression tests, each run against
origin/mainwith only the tests applied (red) and on this branch (green):vex::discover::yarn::tests::issue_1579_portal_placeholder_and_versionless_linked_manifests_contestvex::discover::yarn::tests::issue_1579_versionless_linked_manifest_contests_only_its_namevendor::yarn_berry_lock::tests::issue_1579_portal_placeholder_and_versionless_linked_manifests_are_namedhosted_memory_engine::issue_1579_berry_portal_placeholder_and_versionless_copies_are_namedformats::yarn::copy::tests::linked_name_reads_a_valid_name_onlyEach test covers
portal:andlink:× {.gitkeepplaceholder, manifest withoutname, manifest naming left-pad withoutversion, manifest naming another package withoutversion(control)}. Alink:placeholder remains a control, as the issue's matrix documents.Per-issue checklist:
portal:copy whose target has no package.json (e.g. a.gitkeepplaceholder) or whose package.json lacks name/version, so scans succeed and VEX attests not_affected while that copy installs unpatched #1579 shape 1 (portal:target with nopackage.json): hosted, vendored and vex tests aboveportal:copy whose target has no package.json (e.g. a.gitkeepplaceholder) or whose package.json lacks name/version, so scans succeed and VEX attests not_affected while that copy installs unpatched #1579 shape 2 (portal:/link:manifest withoutname/version): hosted, vendored and vex tests aboveLocal runs:
cargo fmt --all -- --check: okcargo clippy --workspace --all-features -- -D warnings: okcargo check --workspace --all-targets --all-features: okcargo test -p socket-patch-core --all-features --lib: 6532 passed. The 4 failures are permission tests (relax_loop_must_not_traverse_symlinked_root,an_unremovable_hidden_lock_keeps_every_store_entry,wire_write_failure_maps_error_and_leaves_lock_untouched,wire_failure_rolls_back_already_written_files). They can't fail as expected when the sandbox runs as root (uid 0). They're unrelated to this change.cargo test -p socket-patch-cli --all-features --test hosted_memory_engine: 45 passedcargo test --workspaceran out of sandbox disk while linking every e2e binary.scripts/yarn-berry-vex-matrix.sh 4.18.0couldn't fetch yarn through corepack here (corepack yarn@4.18.0 unavailable). Both are left to CI (yarn-berry-e2e).npm/,pypi/,gem/) only dispatch to the binary, so they need no change./code-review high: findings not fixed
link:to a.gitkeep-only directory is still dropped. Kept on purpose. Yarn installs alink:to any directory, including plain assets, and Yarn berry still drops aportal:copy whose target has no package.json (e.g. a.gitkeepplaceholder) or whose package.json lacks name/version, so scans succeed and VEX attests not_affected while that copy installs unpatched #1579 documents this cell as the expected "no package copy" control. Onlyportal:proves a manifest is required.link:manifest (e.g.{"private":true}) now contests every ref in its lock. This is the fail-closed behavior Yarn berry still drops aportal:copy whose target has no package.json (e.g. a.gitkeepplaceholder) or whose package.json lacks name/version, so scans succeed and VEX attests not_affected while that copy installs unpatched #1579 asks for, and it matches thefile:directory twin (Yarn classic renamed-copy detection (#1489) misses afile:copy outside the project root and a tarball whose root isn'tpackage/, so scans succeed and VEX attests while that copy installs unpatched #1516). A versionless manifest that names a package contests only that package, which keeps the common named case narrow.UnidentifiedCopy. These are quality notes. The extra parse only happens forportal:/link:copies, andUnidentifiedCopyis only built inside the crate. I left them so the diff stays focused.nameis now treated as no name, and the vendoring warning for a versionless copy no longer says "can't be read".🤖 Generated with Claude Code
https://claude.ai/code/session_01V7mhLTP7oP5FnNRWsDgkHi
Generated by Claude Code