GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix yarn berry missing portal:/link: copies (#1561) by mikolalysenko · Pull Request #1571 · SocketDev/socket-patch

Conversation

@mikolalysenko

@mikolalysenko Mikola Lysenko (mikolalysenko) commented Oct 15, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

LLM Description written by Claude Code:claude-opus-5-5

Fixes #1561

Summary

A yarn berry portal: / link: dependency under another name ("lp2": "portal:./vend/lp") whose relative target can't be read is now treated as an unknown copy of any version of any package, the same as an absolute one (#1540). Hosted warns redirect_copy_unpatched, vendored warns vendor_copy_unpatched, and vex withholds every package that lock wires. Before this change the copy was dropped: scans reported success and VEX attested not_affected, while the install with the target present linked unpatched bytes as node_modules/lp2.

Root cause

Such a copy's lock version is the placeholder 0.0.0-use.local, so only its package.json says what it is. When reading that manifest yielded no identity, both the vendored/hosted copy finder (vendor/yarn_copies.rs other_name_copies) and VEX lockfile discovery (vex/discover/yarn.rs record_copies) treated "the read failed" the same as "read and found to hold no versioned package" (a link: to plain assets), and skipped the copy unless the path was absolute.

Fix

One shared predicate, yarn_copies::linked_copy_unknown, used by both callers. A linked copy is unknown when it is:

  • never read (an absolute path, Yarn berry renamed-copy detection ignores a portal: / link: copy with an absolute path, so hosted and vendored scans succeed and every VEX path attests not_affected while that copy installs unpatched #1540),
  • a missing target directory,
  • an empty target directory (what git leaves for a submodule CI never checked out, the issue's main real-world trigger),
  • a package.json that isn't a readable regular file, or isn't JSON (a Git LFS pointer, an encrypted blob).

It is not a package copy, and so stays ignored per the #1551 review intent, only when it is a non-empty directory with no package.json, or a parsed manifest naming no versioned package. CopyRef::is_unread_linked is folded into the predicate. The berry vendored warning keeps the "installs a package" wording for every unidentified linked copy. docs/ecosystems.md now spells out the missing / empty / LFS cases.

Tests (red → green)

Issue Test Red on main
#1561 vex (lock-only and in-run) vex::discover::yarn::tests::issue_1561_unreadable_relative_portal_and_link_targets_contest_every_ref (portal/link × missing, empty, manifest-is-a-directory, LFS pointer) yes, refs attested
#1561 vendored scan vendor::yarn_berry_lock::tests::issue_1561_missing_relative_portal_and_link_targets_are_named (portal/link × missing, empty, LFS pointer; plain asset directory control stays unnamed) yes, 0 vendor_copy_unpatched
#1561 hosted scan hosted_memory_engine::issue_1561_berry_missing_relative_portal_and_link_copies_are_named (+ control: a target whose package.json names another package is not flagged) yes, no redirect_copy_unpatched

The first commit (87d9321) holds only the tests, which failed on main as listed. The empty / lfs-pointer variants came from the pre-ready /code-review high pass.

Commands run locally (Linux, as root):

  • cargo fmt --all -- --check: ok
  • cargo clippy --workspace --all-features -- -D warnings: ok
  • cargo test --workspace --all-features --no-fail-fast: 14,563 passed. The 10 failures are environment-only and touch no yarn code: write-failure / read-only-parent tests that can't fail when run as root (e.g. copy_tree::relax_loop_must_not_traverse_symlinked_root, pypi_requirements::wire_failure_rolls_back_already_written_files, repair_*, redirect_json_mode_write_failures_emit_error_envelope), and e2e_bun_lockb::binary_shared_bundled_record_hosted_pin_is_managed, which needs the live patch API (sandbox tunnel blocked). CI runs non-root with network.
  • yarn-berry e2e with real yarn 4.18.0 (SOCKET_PATCH_YARN_E2E_REQUIRED=1): e2e_redirect_yarn_berry_build 37/37, e2e_vendor_yarn_berry_build 44/44, e2e_yarn4_pnpm_linker_build 40/40, e2e_yarn4_workspaces_build 39/39.
  • Wrappers (npm/, pypi/, gem/) only dispatch to the binary and need no change.

/code-review high: findings not fixed

  • Hosted in-memory scans and target files the host never sent. In memory mode, a relative linked copy is read only when the host includes its target's package.json in the snapshot (the new control test shows such a file is read and honoured). When the host leaves it out, the copy is now flagged as possibly unpatched instead of silently dropped. Dropping it was the fail-open this issue reports. Flagging matches how memory mode already treats an unread file: directory copy at its lock version (Yarn classic renamed-copy detection (#1489) misses a file: copy outside the project root and a tarball whose root isn't package/, so scans succeed and VEX attests while that copy installs unpatched #1516). Teaching path selection to fetch linked targets' manifests would mean parsing yarn.lock before the fetch, which is a separate change. Follow-up if wanted.
  • other_name_copies probes with ProjectView::Disk (sync is_dir) rather than group-commit-aware helpers. The read beside it uses read_regular_to_bytes on the same disk path. No caller runs this inside an open group commit before the lock rewrite, and one stat per linked candidate is negligible. Left as is.

🤖 Generated with Claude Code


Generated by Claude Code

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@claude
Start fix for #1561
716b756
Assisted-by: Claude Code:claude-opus-5-5
@mikolalysenko Mikola Lysenko (mikolalysenko) mentioned this pull request Oct 15, 2026
Yarn berry drops a relative 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
Closed
Claude (claude) added 3 commits October 15, 2026 08:33
@claude
Test yarn berry missing portal:/link: copies
87d9321
A yarn berry portal: or link: dependency under another name whose
relative target directory is missing (for example a git submodule CI
didn't check out) is silently dropped today: hosted and vendored scans
report success and vex attests not_affected, while the install that has
the directory links an unpatched copy.

Add regression tests for #1561 on the vex discovery, vendored berry and
hosted engine paths. They fail on main.

Assisted-by: Claude Code:claude-opus-5-5
@claude
Flag yarn berry portal:/link: copies with no target
e89b9db
A yarn berry portal: or link: dependency under another name gets its
package and version only from its package.json. When a relative target
was missing (an uninitialized git submodule, a generated or gitignored
directory) or its package.json couldn't be read, the copy was treated
like a link: to a plain asset directory and dropped. Scans reported
success and vex attested not_affected, while the install that had the
directory linked an unpatched copy.

Such a copy is now unknown, like an absolute one: hosted warns
redirect_copy_unpatched, vendored warns vendor_copy_unpatched, and vex
withholds every package the lock wires. A link: to a directory that
exists with no package.json is still ignored.

Fixes #1561

Assisted-by: Claude Code:claude-opus-5-5
@claude
Docs: missing yarn portal:/link: targets
39b542b
Say that a relative portal: or link: copy whose target is missing is
treated like an absolute one, and that a link: to a directory with no
package.json is not a package copy.

Refs #1561

Assisted-by: Claude Code:claude-opus-5-5
@mikolalysenko Mikola Lysenko (mikolalysenko) mentioned this pull request Oct 15, 2026
Swarm health manager log #1382
Open
Claude (claude) added 2 commits October 15, 2026 09:33
@claude
Flag empty and unparseable portal:/link: targets
6a3fc28
A git submodule CI never checked out leaves an empty directory, not a
missing one, and a package.json that is a Git LFS pointer or encrypted
blob reads fine but is no JSON. Both were still dropped like a link: to
plain assets, so scans stayed clean and vex attested not_affected.

An empty target directory and a package.json that doesn't parse now
make the copy unknown too. Only a non-empty directory with no
package.json, or a parsed manifest with no versioned package, is still
ignored. Also pass the root as "" to the project view so hosted and
disk agree on portal:. targets, and share the hosted test fixture.

Refs #1561

Assisted-by: Claude Code:claude-opus-5-5
@claude
Docs: empty and LFS portal:/link: targets
1018077
Refs #1561

Assisted-by: Claude Code:claude-opus-5-5
@mikolalysenko
Mikola Lysenko (mikolalysenko) marked this pull request as ready for review October 15, 2026 09:33
@mikolalysenko

Mikola Lysenko (mikolalysenko) commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator Author

BugBot review


Generated by Claude Code

cursor[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed Oct 15, 2026
View reviewed changes

@cursor cursor Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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 1018077. Configure here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mikolalysenko Mikola Lysenko (mikolalysenko) added the Ready for review Agent-verified: mergeable, CI green, Bugbot clean — awaiting human review label Oct 15, 2026
@mikolalysenko

Mikola Lysenko (mikolalysenko) commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator Author

Ready for review at 1018077.

  • CI: 36/36 run checks green, 50 skipped by path filters (86 total); no main-wide failures.
  • Bugbot: reviewed 1018077, no findings; no unresolved review threads.
  • Mergeable against main, no CHANGELOG.md change.
  • Worth a look: the shared yarn_copies::linked_copy_unknown predicate (which unreadable portal:/link: targets count as unknown copies vs. non-package directories).

Slack announcement not sent this run (Slack send unavailable); the next run retries.


Generated by Claude Code

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mikolalysenko
Mikola Lysenko (mikolalysenko) enabled auto-merge October 15, 2026 11:56
@mikolalysenko

Mikola Lysenko (mikolalysenko) commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator Author

Final review brief

What it does. A yarn berry portal: / link: dependency under another name with a relative target that can't be read (missing, an empty directory such as an unchecked-out submodule, or a package.json that isn't JSON, like a Git LFS pointer) is now treated as an unknown copy, the same as an absolute one (#1540). Hosted scans warn redirect_copy_unpatched, vendored scans warn vendor_copy_unpatched, and vex withholds every ref the lock wires. Before this, such copies were silently dropped, so vex could attest not_affected for a lock that installs unpatched bytes (#1561).

Risk: low. Fail-closed change in one predicate shared by two callers; the worst case is an extra warning, never a missed copy. A link: to a non-empty, manifest-less asset directory and a manifest naming another package both stay ignored, as before.

Look here

  • yarn_copies.rs:143 linked_copy_unknown: the unknown vs. not-a-package rules.
  • yarn_copies.rs:117 vendored/hosted caller.
  • vex/discover/yarn.rs:901 VEX caller (now passes no lock version for any linked copy).
  • hosted_memory_engine.rs:1966 hosted test plus the control case.

Verified

  • Read the full diff (6 files, +291/-76). Paths: dir is the same base-joined, normalized path read_path already reads, absolute paths still short-circuit before any filesystem call, so no new path exposure. Forward-slash relative paths join fine on Windows.
  • Tests cover portal/link × missing / empty / manifest-is-a-directory / LFS pointer, with a plain-directory control (vendored) and an other-package control (hosted). Ran cargo test -p socket-patch-core --lib issue_1561 locally: 2/2 pass.
  • CI green on 1018077 (ci-ok, clippy and all run checks). Bugbot reviewed 1018077 with no findings, no open review threads, mergeable, CHANGELOG.md untouched.

Changes I made: none.

Open questions: none blocking. Known trade-off, written up in the PR description: in hosted in-memory mode a relative linked copy whose target files the host didn't send is now flagged rather than dropped (fail-closed, matching #1516).

Auto-merge is armed, so approving sends it straight to the merge queue.


Generated by Claude Code

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mikolalysenko Mikola Lysenko (mikolalysenko) mentioned this pull request Oct 15, 2026
CI performance dashboard #1182
Open
Tanmay182003
Tanmay Singla (Tanmay182003) approved these changes Oct 15, 2026
View reviewed changes
@mikolalysenko
Mikola Lysenko (mikolalysenko) added this pull request to the merge queue Oct 15, 2026
Merged via the queue into main with commit 2e71d5f Oct 15, 2026
86 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@mikolalysenko
Mikola Lysenko (mikolalysenko) deleted the agent/fix-yarn-berry-missing-linked-copy branch October 15, 2026 14:22
This was referenced Oct 15, 2026
Yarn berry still drops a portal: copy whose target has no package.json (e.g. a .gitkeep placeholder) or whose package.json lacks name/version, so scans succeed and VEX attests not_affected while that copy installs unpatched #1579
Closed
CI perf (settings): merge queue builds 5 entries at a time — a 13-PR burst took 100 min to drain on a 21-min CI run (~21 min per PR past the 5th) #1248
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@cursor cursor[bot] cursor[bot] left review comments
@Tanmay182003 Tanmay Singla (Tanmay182003) Tanmay182003 approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

Ready for review Agent-verified: mergeable, CI green, Bugbot clean — awaiting human review

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Yarn berry drops a relative 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

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@mikolalysenko @Tanmay182003 @claude
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.