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 yarnrc compressionLevel comment refusal (#370) by mikolalysenko · Pull Request #508 · SocketDev/socket-patch

Conversation

@mikolalysenko

@mikolalysenko Mikola Lysenko (mikolalysenko) commented Oct 1, 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 #370

Summary

A .yarnrc.yml line such as compressionLevel: 0 # keep yarn default is yarn's default (yarn reads it as 0 and writes cacheKey: 10c0). socket-patch counted the trailing comment as part of the value, so it refused the project in both vendored mode (vendor_yarn_berry_cache_unsupported) and hosted mode (redirect_yarn_berry_cache_unsupported). Every npm purl in the project was left unpatched with exit 1.

Root cause

yarnrc_compression_level (crates/socket-patch-core/src/vendor/yarn_berry_lock.rs) took everything after compressionLevel: as the value. The vendored gate (refuse_unsupported_compression) and the hosted gate (preflight_yarn_berry_hosted) both read the knob through it, so fixing the reader fixes both.

Fix

The value is now read as a YAML scalar would be:

  • A quoted value ('0' / "0") ends at its closing quote. Anything after it, such as a comment, is ignored.
  • A plain value ends before a # that follows whitespace (space or tab).
  • A # with no whitespace before it stays part of a plain value, as in YAML. So 0#x is not the default and is still refused, so an ambiguous value still blocks.

Tests (red → green)

Test Layer Without fix With fix
yarnrc_compression_level_drops_a_trailing_comment reader unit FAIL pass
yarnrc_compression_level_keeps_an_unseparated_hash fail-closed guard pass pass
commented_default_compression_level_vendors vendored gate FAIL pass
berry_hosted_preflight_mirrors_the_rewriter_gates (+2 asserts) hosted gate FAIL pass
yarn_berry_vendor_commented_default_compression_level real yarn 4.12.0 e2e: full vendored capstone (fresh checkout --immutable --check-cache, VEX, revert) with the commented knob FAIL (vendor_yarn_berry_cache_unsupported) pass

The e2e capstone also asserts that the lock real yarn writes has cacheKey: 10c0. That shows yarn itself reads the commented line as 0.

Local results

  • cargo clippy --workspace --all-features -- -D warnings: clean.
  • cargo test --workspace --all-features: all pass except three covgap_commands_vendor state-write-failure tests. They depend on chmod 0o555 blocking writes, which root ignores in this container, and the file is unrelated to this change.
  • e2e_vendor_yarn_berry_build + e2e_redirect_yarn_berry_build on yarn 4.12.0: 14/14 + 14/14.
  • cargo fmt: the new lines follow rustfmt. I didn't run cargo fmt --all, because main itself isn't fmt-clean (it would reformat about 120 unrelated files) and CI doesn't check formatting.
  • Wrappers (npm/, pypi/, gem/): no change needed. The change is entirely inside the Rust core.

Per-issue checklist

  • Yarn berry vendored and hosted modes refuse compressionLevel: 0 # comment in .yarnrc.yml as a non-default compression level #370: vendored and hosted no longer refuse compressionLevel: 0 # comment; non-default levels with comments still refuse. Covered by the reader, gate and e2e tests above.

CI

All checks are green on 933280e. Two backtest legs that can't reach this code failed on the first attempt and passed on their one re-run each:

  • Poetry patch compatibility / native (ubuntu-latest, 1.3.2)
  • Bun patch compatibility / native (ubuntu-latest, 1.1.39)

Bugbot reviewed 933280e and found no issues.

🤖 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 #370
3886765
Assisted-by: Claude Code:claude-opus-5-5
@mikolalysenko Mikola Lysenko (mikolalysenko) mentioned this pull request Oct 1, 2026
Yarn berry vendored and hosted modes refuse compressionLevel: 0 # comment in .yarnrc.yml as a non-default compression level #370
Closed
@claude
Read yarnrc compressionLevel past YAML comments
933280e
A .yarnrc.yml line like `compressionLevel: 0 # keep yarn default` is
the yarn default (cacheKey 10c0), but socket-patch read the comment as
part of the value and refused the project in both vendored and hosted
mode. The reader now parses the value as a YAML scalar: a quoted value
ends at its closing quote and a plain value ends before a
whitespace-separated `#`. Anything not positively `0` still refuses.

Fixes #370

Assisted-by: Claude Code:claude-opus-5-5
@mikolalysenko

Mikola Lysenko (mikolalysenko) commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator Author

[agent] Bun patch compatibility / native (ubuntu-latest, 1.1.39) failed on 933280e: 43/44 cells passed. The one failure is workspace-get-search vendored, check vexLedgersDeleted (vex with the ledgers deleted, scripts/backtest-bun.py:1131).

I don't think this failure comes from this PR. The only code changed is yarnrc_compression_level, and its two callers are yarn-berry-only: refuse_unsupported_compression (vendored berry) and preflight_yarn_berry_hosted (hosted berry). The Bun backtest never reaches either of them.

The same leg passed on the heads of the other open agent PRs, all based on the same main. This run also logged a mock-API request transport failed retry in the sibling workspace hosted cell. No fix exists to port. I'll re-run the failed job once when the workflow run finishes; a second failure gets treated as real.


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) commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator Author

[agent] A second check also failed on 933280e: Poetry patch compatibility / native (ubuntu-latest, 1.3.2). Two cells failed, direct agent (appliedExactlyOne) and crlf hosted (vexLedgersDeleted, warmInstallReplacesUpstream). The other 3/5 cells passed.

The reasoning is the same as for the Bun leg above: this PR only changes the yarn berry .yarnrc.yml reader, which no Poetry code path calls. The same workflow passed on the other PR heads built on the same main (most recently #503's 0be19d0, at 22:17). Both suites failed within a minute of each other (22:38), on vex and apply checks against the mock patch API.

I've used this check's one re-run (rerun_failed_jobs on run 36936009039). The Bun 1.1.39 leg gets its re-run once its workflow run finishes. If either fails a second time, I'll treat it as real and investigate it from the captured logs.


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) marked this pull request as ready for review October 1, 2026 22:53
@mikolalysenko

Mikola Lysenko (mikolalysenko) commented Oct 1, 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 1, 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 933280e. 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 2, 2026
@mikolalysenko

Mikola Lysenko (mikolalysenko) commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator Author

[agent] Ready for review at 933280e.

  • CI: 96/96 non-skipped checks green (plus 1 neutral: a cancelled duplicate Bugbot run). The earlier Bun 1.1.39 and Poetry 1.3.2 cell failures noted above passed on re-run.
  • Bugbot: reviewed 933280e (22:59Z) — no issues found.
  • Mergeable against main, no unresolved review threads.
  • Slack announcement pending: the burn-down agent has no Slack send tool this run.

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) commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator Author

Reviewed 933280e90eae. Ready to merge from this code review; no changes requested.

No blocking findings. The shared parser strips whitespace-separated trailing comments while retaining an unseparated hash as part of a plain scalar; both hosted and vendored gates consume the same parsed value and continue refusing unsupported compression levels.

Validation: Ran cargo test --locked -p socket-patch-core --lib yarn_berry: 83 passed, including parser and vendor/hosted refusal coverage. Reviewed the added real-Yarn capstone; did not rerun that network/toolchain matrix locally. Current CI checks pass.

All reactions

Sorry, something went wrong.

Uh oh!

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

Tanmay182003
Tanmay Singla (Tanmay182003) approved these changes Oct 2, 2026
View reviewed changes
@mikolalysenko
Mikola Lysenko (mikolalysenko) merged commit f68b18b into main Oct 2, 2026
567 of 569 checks passed

Uh oh!

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

@mikolalysenko
Mikola Lysenko (mikolalysenko) deleted the agent/fix-yarnrc-compression-comment branch October 2, 2026 15:31
@mikolalysenko Mikola Lysenko (mikolalysenko) mentioned this pull request Oct 3, 2026
Share the yarn berry project gates between hosted and vendored modes #629
Closed
5 tasks
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 vendored and hosted modes refuse compressionLevel: 0 # comment in .yarnrc.yml as a non-default compression level

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 01402520 — 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.