Repository navigation
Fix git-ignored bun.lockb workspace mirrors (#1116) - #1442
Merged
Mikola Lysenko (mikolalysenko) merged 4 commits intoOct 12, 2026
Merged
Conversation
Assisted-by: Claude Code:claude-opus-5-5
On a bun.lockb workspace, vendoring also writes the patched tarball under each member's .socket/vendor/npm/<uuid>/, because Bun 0.5.9-1.3 installs from there. Those copies never got the git-ignore check or the !* .gitignore the root artifact gets, so GitHub's stock *.tgz rule (or a member's .socket/ rule) kept them out of the commit: the scan said success, and fresh clones failed or hung on bun install --frozen-lockfile, or failed vendor --check on Bun 1.4. Each mirror now gets the same .gitignore and .gitattributes as the root artifact (on vendor and on repair), and a rule no nested file can override refuses vendor_artifact_gitignored before anything is written, dry runs and hosted takeovers included. Reverting removes that metadata with the mirror so the member's .socket/ is pruned. Fixes #1116 Assisted-by: Claude Code:claude-opus-5-5
The CLI contract now says that each bun.lockb workspace member's tarball copy gets the same .gitignore/.gitattributes as the root artifact, and that a member .socket/ ignore rule refuses vendoring. Refs #1116 Assisted-by: Claude Code:claude-opus-5-5
- Probe every written member mirror in one git call instead of two git processes per mirror. - Name the member git actually ignores in the refusal, not the first one probed. - A mirror tarball already deleted by hand still takes its .gitignore/.gitattributes on revert, so the member's .socket/ is pruned. - Find the member uuid dir from path components, so Windows verbatim paths clean up too. Refs #1116 Assisted-by: Claude Code:claude-opus-5-5
Mikola Lysenko (mikolalysenko)
marked this pull request as ready for review
October 12, 2026 20:03
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 79c12b6. Configure here.
Tanmay Singla (Tanmay182003)
approved these changes
Oct 12, 2026
Mikola Lysenko (mikolalysenko)
deleted the
agent/fix-bun-lockb-mirror-gitignore
branch
October 12, 2026 20:59
This was referenced Oct 12, 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 #1116
Root cause
In a
bun.lockbworkspace, vendoring writes the patched tarball twice:the canonical root artifact
.socket/vendor/npm/<uuid>/<leaf>, and acopy (mirror) inside each member at
<member>/.socket/vendor/npm/<uuid>/<leaf>.Bun 0.5.9–1.3 installs from the member copy. The #837 guard covers only
the root artifact's uuid dir. That guard probes
git check-ignorebeforethe write, then writes a
!*<uuid>/.gitignoreafter it. The mirrorloop in
bun_binary.rswrote straight toroot.join(rel). So GitHub'sstock
*.tgzrule, or a member-local.socket/rule, kept the mirror outof the commit while the scan reported success. Fresh clones then failed
bun install --frozen-lockfile(1.1–1.2), hung (1.3.9), or failedvendor --check/vex(1.4).Fix
probes every member mirror's uuid dir and refuses
vendor_artifact_gitignoredwhen a directory rule ignores it, namingthat member. The hosted→vendored takeover pre-flight
(
npm_tarball_gitignore_preflight) probes the same dirs, so a takeovernever restores the registry entry and then refuses.
<uuid>/.gitignoreand.gitattributes, including in-sync re-runs, so re-running a scanfixes an already-vendored project. All written paths then go through
one batched
git check-ignore. If they are still ignored, the rununwinds; if git can't answer, it warns
vendor_artifact_gitignore_unchecked.bun_workspace::repair(run bysocket-patch repairon healthyand broken bun entries alike) restores the metadata.
mirror, even when the tarball was already deleted by hand. That keeps
the member's
.socket/pruned. Deferred removal during a stagedtakeover queues the metadata as well.
CLI_CONTRACT.mddocuments the member mirrors and the refusal.Tests (red → green)
New unit tests in
crates/socket-patch-core/src/vendor/bun_binary.rs:a_tgz_rule_still_commits_every_workspace_mirror: a real git work treewith
node_modulesand*.tgzignored. Vendoring succeeds andgit check-ignorereports no mirror as ignored.repairrestores adeleted mirror
.gitignore. Revert, with one mirror tarball deleted byhand, restores the lock and prunes the member's
.socket/.Without the fix:
left: Some(".gitignore:2:*.tgz\tpackages/helper/.socket/vendor/npm/…/minimist-1.2.2.tgz").an_ignored_member_vendor_dir_refuses_before_any_write: covers amember
.socket/rule and a root*/**/.socket/rule, each as a dryrun and a real run. Vendoring refuses
vendor_artifact_gitignoredwith the lock byte-identical and no
.socket/vendorwritten, and thetakeover pre-flight refuses too. Without the fix:
expected a refusal, got Done { … success: true … }.first_ignored_names_the_path_git_reports: the refusal names theignored member, not the first one probed.
*.tgz(root or member) drops the mirrora_tgz_rule_still_commits_every_workspace_mirror.socket/rulean_ignored_member_vendor_dir_refuses_before_any_writerepaircan't make the mirror committablea_tgz_rule_still_commits_every_workspace_mirror(repair step)Local results (Linux, Bun 1.4.2)
cargo fmt --all -- --checkandcargo clippy --workspace --all-features -- -D warnings: clean.cargo test -p socket-patch-core --lib bun: 355 passed.e2e_vendor_bun_build(37),in_process_vendor_bun_takeover(40),mode_migration_bun(33) andvendor_eject_bun_lockb(10), all with--include-ignored: all pass.e2e_bun_lockb: 22/23. The onefailure,
binary_shared_bundled_record_hosted_pin_is_managed, is ahosted rollback that can't reach
patches-api.socket.devfrom thesandbox (
tunnel error).cargo test --workspace --all-features --no-fail-fast: all bun suitespass. The only failures are chmod- or unremovable-file write-failure
tests (
covgap_commands_vendor×3,in_process_redirect×3,repair×2, core lib ×4: copy_tree, vlt_heal, pypi_poetry,pypi_requirements). They can't fail as intended because the sandbox
runs as uid 0, and none touch the bun code. CI runs them as a normal
user.
Review notes (/code-review high)
Fixed: one batched git probe instead of two git processes per mirror,
the refusal now names the ignored member, a hand-deleted mirror's
metadata is cleaned on revert, and the uuid dir is now found from path
components so Windows verbatim paths clean up.
Not changed:
repaircallsrepair_workspace_copiesfor healthy entries too (repair.rs:422), soit does.
!*.gitignoreis a genericfailure, not a
Refused: the wire step returnsStringerrors. Thatcase needs a rule a deeper
.gitignorecan't override, which thepre-flight already refuses. The error text still starts with
vendor_artifact_gitignored, and the run unwinds.preflight_packages) doesn't probe git: thismatches the root artifact's check, which also runs only at staging. The
backend still refuses before writing anything.
write fails: those files are what a committed vendored dir should
hold anyway.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Swcnf9zxfEYuSqCy8F3TWy
Generated by Claude Code