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 vendored npm tarballs captured by Git LFS (#1541) by mikolalysenko · Pull Request #1559 · 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 #1541

Summary

A repo whose .gitattributes hands *.tgz to Git LFS committed every vendored npm-family tarball (and each bun.lockb workspace mirror) as an LFS pointer. Any checkout that doesn't smudge LFS (actions/checkout defaults, no git-lfs, GIT_LFS_SKIP_SMUDGE=1, air-gapped builds) then failed the frozen install, while the vendored scan reported success.

Root cause

All npm-family vendored flavors (npm, pnpm, yarn classic/berry, bun text and bun.lockb, vlt) write .socket/vendor/npm/<uuid>/.gitattributes from one constant, npm_dir::UUID_GITATTRIBUTES. It held * -text, which turns off EOL conversion but leaves a parent filter=lfs rule in force.

Fix

  • UUID_GITATTRIBUTES is now * -text -filter -ident -working-tree-encoding: every attribute that lets git store or check out bytes other than the artifact's is unset at the uuid level, which beats any .gitattributes above it.
  • The pre-Vendored Bun tarballs go into Git LFS when .gitattributes tracks *.tgz with LFS, so a checkout without LFS fails bun install --frozen-lockfile #1541 * -text file still counts as ours (is_uuid_gitattributes), so a Bun workspace mirror's metadata is still removed on revert. An in-sync vendored re-run already passes through restore_uuid_metadata (via stage_patch_pack → keep_pack_committable) for all six tarball flavors, so existing trees are upgraded on their next run.
  • mirror_metadata now checks the file name before reading a sibling.
  • CLI_CONTRACT (npm and vlt rows) and docs/ecosystems.md describe the new attributes, plus the git add --renormalize .socket/vendor/npm step for a tarball an older release already committed as a pointer.

Tests (red → green)

Issue / case Test Without fix With fix
#1541 mechanism: a repo *.tgz filter=lfs / *.js ident working-tree-encoding rule no longer applies under the uuid dir npm_dir::tests::the_uuid_gitattributes_overrides_repository_lfs_rules (core, needs only git) FAILED (filter: lfs) ok
#1541 end to end, Bun 1.4.2: LFS rule → vendor → commit → GIT_LFS_SKIP_SMUDGE=1 clone → bun install --frozen-lockfile installs patched bytes e2e_vendor_bun_build::bun_vendor_tarball_is_not_committed_to_git_lfs FAILED ("the vendored tarball went into LFS") ok
Legacy file upgraded in place npm_dir::tests::legacy_uuid_gitattributes_is_upgraded n/a (new API) ok
Legacy file still removed with a reverted Bun workspace mirror bun_binary::rebuild_tests::a_tgz_rule_still_commits_every_workspace_mirror (extended) FAILED (.socket not pruned) ok

Local runs: cargo fmt --all -- --check ok; cargo clippy --workspace --all-features -- -D warnings ok; SOCKET_PATCH_BUN_REQUIRED=1 cargo test -p socket-patch-cli --all-features --test e2e_vendor_bun_build 40/40 ok. cargo test --workspace --all-features --no-fail-fast: 241 binaries ok, 10 failures, none in code this PR touches. Nine are permission-denial tests (unwritable/unremovable files), which can't fail as intended because the sandbox runs as root. The tenth is e2e_bun_lockb::binary_shared_bundled_record_hosted_pin_is_managed, a hosted rollback that needs patches-api.socket.dev, which the sandbox proxy blocks. CI is the arbiter for these.

Review notes (/code-review high)

  • Fixed: mirror_metadata read every sibling before checking its name; the doc comment overstated what can outrank the uuid file.
  • Not changed: the LFS e2e soft-skips when git-lfs is missing even under the required gate. The Depot runner images aren't guaranteed to ship git-lfs, and without it the test can't reproduce the bug at all. The core check-attr test covers the mechanism on every runner.
  • Not changed: an in-sync re-run that upgrades a legacy .gitattributes emits no event. It's a one-time metadata rewrite of a file that isn't part of the artifact, the same as today's restore of an edited file.

Follow-ups (not in this PR)

  • JVM trees (vendor/jvm/mod.rs TREE_GITATTRIBUTES, redownload.rs) and the Gradle redirect still write * -text, so *.jar filter=lfs repos are likely affected the same way (p3, separate ownership checks).
  • A tarball already committed as an LFS pointer isn't detected; a git cat-file pointer probe with a warning could replace the documented --renormalize step.
  • .git/info/attributes, and a .gitattributes shipped inside a vlt directory payload, can still override the uuid file.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WdaShef4vyGWjbTSpLbh9E


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 #1541
27b567c
Assisted-by: Claude Code:claude-opus-5-5
@mikolalysenko Mikola Lysenko (mikolalysenko) mentioned this pull request Oct 15, 2026
Vendored Bun tarballs go into Git LFS when .gitattributes tracks *.tgz with LFS, so a checkout without LFS fails bun install --frozen-lockfile #1541
Closed
@claude
Keep vendored npm tarballs out of Git LFS
4a98369
A repo that LFS-tracks *.tgz committed every vendored npm-family
tarball (and each bun.lockb member mirror) as an LFS pointer, so any
checkout without LFS smudging failed its frozen install while the
vendored scan reported success.

The per-uuid .gitattributes only unset `text`. It now also unsets
`filter`, `ident` and `working-tree-encoding`, so no parent rule can
change the committed bytes. Files written by older releases still
count as ours on revert and are rewritten by the next vendored run.

Fixes #1541

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 03:04
@claude
Test vendored Bun tarballs survive an LFS repo
ed27e5d
End-to-end check for #1541: with `*.tgz filter=lfs` in the project's
.gitattributes, vendor, commit, clone with GIT_LFS_SKIP_SMUDGE=1 and
run `bun install --frozen-lockfile`. The tarball must not be an LFS
object and the clone must install the patched bytes. Skips when
git-lfs is not installed.

Assisted-by: Claude Code:claude-opus-5-5
@claude
Check mirror metadata names before reading
e87daa4
Review follow-ups: a Bun workspace mirror's uuid dir only reads the
.gitignore and .gitattributes it may remove, not every sibling file.
Docs note how to fix a tarball an older release already committed as
an LFS pointer (git add --renormalize after the next vendored run).

Assisted-by: Claude Code:claude-opus-5-5
@mikolalysenko
Mikola Lysenko (mikolalysenko) marked this pull request as ready for review October 15, 2026 03:11
@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 e87daa4. Configure here.

Sorry, something went wrong.

Uh oh!

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

All reactions
Tanmay182003
Tanmay Singla (Tanmay182003) approved these changes Oct 15, 2026
View reviewed changes
@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 — head e87daa4.

  • CI: 36/36 run checks green (50 path-skipped); no main-wide failures.
  • Bugbot: reviewed e87daa4, no findings.
  • Already approved by Tanmay Singla (@Tanmay182003) on this head; no CHANGELOG changes.
  • Reviewer focus: the .gitattributes rule for the vendored npm tarballs (crates/socket-patch-core/src/vendor/npm_dir.rs) and the vlt/bun e2e coverage.

Slack announcement not sent this run (Slack send unavailable); next run will retry.


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) added this pull request to the merge queue Oct 15, 2026
Merged via the queue into main with commit e76cb9b 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-vendor-gitattributes-lfs branch October 15, 2026 05:58
This was referenced Oct 15, 2026
CI performance dashboard #1182
Open
Vendored PyPI wheels aren't checked against .gitignore or Git LFS rules (*.whl, .socket/), so a vendored Pipenv scan exits 0 and every fresh clone's pipenv sync fails #1572
Closed
repair leaves a pre-#1541 root <uuid>/.gitattributes as * -text, so the repaired Bun tarball goes back into Git LFS on the next commit #1581
Closed
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.

Vendored Bun tarballs go into Git LFS when .gitattributes tracks *.tgz with LFS, so a checkout without LFS fails bun install --frozen-lockfile

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.