Skip to content

Fix Bun patch compatibility and annotations - #245

Open
Mikola Lysenko (mikolalysenko) wants to merge 3 commits into
mainfrom
codex/bun-patch-compatibility
Open

Mikola Lysenko (mikolalysenko) wants to merge 3 commits into
mainfrom
codex/bun-patch-compatibility

Conversation

@mikolalysenko

@mikolalysenko Mikola Lysenko (mikolalysenko) commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

LLM Description written by Codex:gpt-6-astra

Bun patches must survive fresh installs and describe what the project actually consumes. This supports Bun's version-0 text locks and prevents incompatible vendored operations from leaving misleading patch records in .socket/manifest.json.

  • Accept text lock versions 0, 1 and 2 in hosted and vendored mode, with byte-exact golden and rollback coverage.
  • Refuse version-0 hosted workspace locks and version-0/1 vendored workspace locks before rewriting. Native frozen installs reject or misresolve these configurations; diagnostics give the upgrade path.
  • Preflight vendored scan, get by PURL and get by UUID before writing patch intent. Preserve existing explicit manifest entries and use the nonblocking regular-file reader.
  • Test 13 pinned Bun releases, 19 configurations and hosted/vendored/detached modes on Linux, macOS and Windows. Verify installed file hashes, frozen and ordinary lock stability, repeat scans, corruption behavior and rollback.

Validation:

  • Bun compatibility matrix: all 39 jobs and 1,809 native cases pass (Linux 649, macOS 649, Windows 511). A GitHub HTTP 500 while downloading one Bun binary passed on retry.
  • Local matrix: all 649 cases pass, including both explicit-get paths.
  • Bun core regressions: 65 tests pass. CLI library: 547 tests pass. Shared redirect golden fixtures and workspace Clippy pass.
  • Full core run: 3,582 passed initially; six unrelated Ruby tests used the host's unsupported Bundler 1.17.2. All 106 Ruby setup tests, including those six, pass with the installed Ruby/Bundler 4 toolchain.
  • Companion Socket SBOM suite: all 6,301 assertions pass across 668 fixtures. Every supported native CI capture maps to a checked-in fixture with identical input bytes for the files Socket consumes.

The paired SBOM implementation is SocketDev/depscan#26450, stacked on SocketDev/depscan#26400, and pins this branch. The tests and fixtures are split into SocketDev/depscan#26453, stacked on the implementation PR, and reuse the existing real metadata/publication/SBOM validation framework.

See docs/testing/bun-compatibility.md for reproduction commands and explicit boundaries: binary-only vendoring, old workspace layouts and absent native tarball digest enforcement in tested Bun releases before 1.3.14.

Support Bun text lock version 0 and reject workspace layouts whose
tarball paths cannot survive native reinstalls. Refuse incompatible
vendored downloads before recording manifest patch intent.

Add native release/configuration checks for hosted, vendored and
detached installs, patched bytes, integrity and rollback.

Assisted-by: Codex:gpt-6-astra
Use the regular-file reader for Bun preflight and vendoring. Verify

FIFO inputs refuse promptly, and snapshot the CLI for native runs so

concurrent builds cannot change the binary under test.

Assisted-by: Codex:gpt-6-astra
Apply Bun compatibility preflight to get by UUID as well as search.

Exercise both entry points across the native release matrix.

Assisted-by: Codex:gpt-6-astra
@mikolalysenko
Mikola Lysenko (mikolalysenko) marked this pull request as ready for review September 18, 2026 18:03

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is ON. A cloud agent has been kicked off to fix the reported issue.

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit d475268. Configure here.

}));
if !params.json && !params.silent {
eprintln!(" [error] {}: {detail}", search_result.purl);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Silent mode hides Bun refusal errors

Medium Severity

The new Bun vendor preflight refusals gate stderr on both --json and --silent. --silent is only supposed to suppress progress, so scan --mode vendored --silent and get --mode vendored --silent exit 1 with no diagnostic when the lock is unsupported. Nearby download failures in the same function already print on stderr whenever output is not JSON.

Additional Locations (1)
Fix in Cursor Fix in Web

Triggered by learned rule: Workspace/user-writable file reads must use open_regular_file guard, not bare fs::read

Reviewed by Cursor Bugbot for commit d475268. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant