Skip to content

Commit 671bc1c

Browse files
committed
bun bughunt run 59 (2026-12-06)
1 parent 14c8342 commit 671bc1c

3 files changed

Lines changed: 41 additions & 18 deletions

File tree

‎entries/bun/20261206T101505Z.md‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[agent] 2026-12-06: Bun bug-hunt run
2+
3+
Run 59. Main `cd7c5c5` (unchanged since run 58). Latest release v5.2.0. Bun 1.4.5 and canary 1.4.5-canary.20261205.1 (new, `bun --version` prints 1.4.6). Linux only, patch API mocked locally.
4+
5+
**Filed**
6+
- #2540: hosted `rollback` / `remove` of a committed `bun.lockb` pin refuses with `git checkout -- bun.lockb`, which is a no-op once the pin is in `HEAD`; `bun install --force` keeps the patched copy and the next `rollback` refuses again. `scan --mode vendored` + `vendor --revert` does undo it (lock dump equal to the pre-scan lock). Reproduced on 1.4.5 and canary. Not a regression (documented refusal since v5.0); the gap is the remedy.
7+
8+
**Re-triage**
9+
- Skipped: main hasn't changed since run 58 re-checked #2335 on `cd7c5c5`. #2384, #2406, #2479 stay open.
10+
11+
**Cells on `cd7c5c5`**
12+
- Repo real-Bun e2e suites on canary 20261205.1: 102/102 pass (lockb 16, redirect 8, vendor 12, takeover 49, mode migration 5, eject 12).
13+
- Canary 20261205.1 common path, hosted / vendored / agent, text + lockb: scan → fresh-checkout frozen install with a cold cache → patched bytes → `vex` attests. Lock bytes after the hosted and vendored rewrites equal 1.4.5's.
14+
- Project path with a space and `ü` (1.4.5, all three modes, text + lockb): scan, frozen install, `vex`, a re-run changes nothing, agent `rollback` / `vendor --revert` / hosted text `rollback` restore the lock byte for byte. Vendored lock keeps a relative tarball path.
15+
- #1581 legacy path: pre-#1541 `* -text` uuid `.gitattributes` with the tarball committed as an LFS pointer. LFS-less clone: `vendor --check` exit 1 `vendor_artifact_unreadable`; `repair` rewrites the root `.gitattributes` to the new form; the commit stores the real tarball; the next clone installs frozen and patched. Fix holds.
16+
- #1631: independent project in `packages/.tools` beside a `packages/*` workspace, all three modes, text + lockb: scan from `.tools`, frozen install patched, `vex` attests, the root workspace lock is untouched and installs frozen.
17+
18+
**Ruled out**
19+
- `remove` / `list` on a hosted pin say "No patches" without `SOCKET_PATCH_SERVER_URL` pointing at the mock (the pin URL is the mock's origin). Mock artifact.
20+
- A `bun.lockb` after hosted → vendored → `vendor --revert` and an intervening `bun install --force` differs in bytes but its dump equals the pre-scan lock (known non-bug).
21+
- Run note: an unquoted path with a space in my cell script made `cd` fail, so one pass ran inside the repo checkout (detached HEAD, nothing pushed). Restored to `cd7c5c5` before the e2e runs; the method now says to quote paths.

‎known-non-bugs/bun.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,4 @@ Documented limitations and verified false positives. One bullet each. Search thi
112112
- `rollback -g` run from a non-project directory whose nested projects hold hosted-patched copies warns their "copy in the project" is still patched and keeps the manifest record: the manifest lives in the cwd and hosted bytes equal the afterHash. Contrived layout; cd to an empty dir for global runs (run 52).
113113
- (2026-12-03) `apply` / `apply --check` (exit 0, "No patch manifest found"), `vex` (exit 2, "run scan first") and `rollback` / `remove` run from a Bun workspace member see no patches when `.socket/` is at the root: `--cwd` scoping, same as npm's known-non-bugs line on member `apply`. `scan` from the member refuses `redirect_workspace_lockfile_elsewhere` and names the root, and `vendor --check` refuses `vendor_lockfile_missing`.
114114
- (2026-12-03) Bun drops the userinfo of a bunfig `registry = "http://user:tok@host/"` from `bun.lock` (it writes `http://host/...` tarball URLs). A hosted rollback with that registry unreachable falls back to the default registry's version document, warns, prints no credential and stays byte-exact.
115+
- `remove` / `list` on a hosted pin report no patches unless `SOCKET_PATCH_SERVER_URL` names the server the pin URL points at (the mock's origin in the sandbox). Mock artifact, not a bug (run 59).

‎state/bun.md‎

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
[agent] Progress ledger for the scheduled Bun bug-hunt routine (label pm:bun).
22

3-
Last run: 2026-12-05 (run 58), main `cd7c5c5` (v5.2.0 + 2 gem-only commits), latest release v5.2.0, newest Bun 1.4.5 (canary 1.4.5-canary.20261204.1).
3+
Last run: 2026-12-06 (run 59), main `cd7c5c5` (v5.2.0 + 2 gem-only commits, unchanged since run 58), latest release v5.2.0, newest Bun 1.4.5 (canary 1.4.5-canary.20261205.1, reports 1.4.6).
44

5-
The per-run narrative (runs 1–48) and the old per-version matrices are in the branch history (`git log -p -- state/bun.md`) and in `entries/bun/`.
5+
Per-run narrative and old matrices: branch history and `entries/bun/`.
66

77
## Method (Linux sandbox)
88

99
- `unset BUN_OPTIONS` (the sandbox exports `--smol`). Bun binaries: `npm i --no-save --ignore-scripts @oven/bun-linux-x64@<v>` in a scratch dir. On Bun ≥ 1.2, `bunfig [install] saveTextLockfile = false` writes `bun.lockb`; Bun 1.1.x writes `bun.lockb` only.
1010
- The patch API is mocked locally (patch.socket.dev and patches-api are blocked). Use the authenticated routes: `--api-url http://127.0.0.1:A --org o --api-token fake`, serving `POST /v0/orgs/o/patches/batch` (answer only for the requested purls), `GET …/by-package/<purl>`, `POST …/package` (grants: `{"results":{uuid:{"status":"granted","url","purl","artifacts":[{"kind":"tarball","url","integrity":{"sha512":"sha512-…"}}]}}}`), `GET …/view/<uuid>` (with `files` before/after git-sha256 + blob contents) and the tarball at `/patch/npm/<name>/<ver>/<tok>/<uuid>/<name>-<ver>.tgz`. Set `SOCKET_PATCH_SERVER_URL`, `SOCKET_PROXY_URL` and `SOCKET_VENDOR_URL` to the mock's origin. Hosted rollback needs `SOCKET_NPM_REGISTRY` if the CLI can't reach npmjs. A ~100-line Python `http.server` mock that builds each patched tarball from the registry tarball (marker prepended to `index.js`) covers all three modes; agent mode needs `blobContent` (base64) in `view`. Also serve the public routes: `GET /patch/view/<uuid>` (hosted-only `vex` without `--api-url` reads it) and `GET /patch/blob/<git-sha256>` or `/v0/orgs/o/patches/blob/<hash>` (agent `rollback` downloads before-blobs).
11-
- The repo's real-Bun e2e suites run with `PATH=<bun dir>:$PATH SOCKET_PATCH_BUN_E2E_REQUIRED=1 SOCKET_PATCH_BUN_E2E_VERSION=<v> SOCKET_PATCH_BUN_LOCKB_REQUIRED=1 cargo test --release -p socket-patch-cli --test …`.
11+
- The repo's real-Bun e2e suites run with `PATH=<bun dir>:$PATH SOCKET_PATCH_BUN_E2E_REQUIRED=1 SOCKET_PATCH_BUN_E2E_VERSION=<v> SOCKET_PATCH_BUN_LOCKB_REQUIRED=1 cargo test --release -p socket-patch-cli --test …`. `<v>` must equal `bun --version` (a canary prints e.g. `1.4.6`, not `1.4.6-canary.1`). Quote every path in cell scripts: an unquoted dir with a space made `cd` fail and the script ran in the repo checkout (run 59).
1212
- Patch mirror: a second port serving the same tarball paths under `/artifactory/socket-patch` (HEAD and GET). Pass `--patch-mirror-url http://127.0.0.1:B/artifactory/socket-patch`, or set `SOCKET_PATCH_MIRROR_URL` for later commands.
1313
- Oracle: a fresh-checkout `bun install --frozen-lockfile` with an empty `BUN_INSTALL_CACHE_DIR`, then the marker bytes in `node_modules`, the mock's request log (which host served the tarball), byte compares of the lock, and `vex -O`. Test repos need `node_modules/` in `.gitignore`.
1414
- A local registry for a made-up package must serve the packument, `/<name>/<version>` (hosted rollback reads it) and the tarball. Keep one mock process alive for the whole cell: a restart re-gzips tarballs with new integrity.
@@ -20,10 +20,10 @@ v5.2.0 was tagged 2026-12-03 at `d987721`; the common-path and workspace rows we
2020

2121
| Workflow | Agent | Vendored | Hosted |
2222
| --- | --- | --- | --- |
23-
| Repo real-Bun e2e suites (redirect, vendor, lockb, mode migration, takeover, eject: 101 tests) | pass 1.1.39 / 1.4.5 / canary 20261203.1, 102 tests (v5.2.0, 2026-12-04); 1.2.23 / 1.3.9 / 1.3.10 (2026-11-27) | | |
24-
| Common path, single project, `bun.lock` v0/v1/v2 (scan → frozen fresh install → `vex` → rollback → install) | pass 1.2.23 v1 / 1.3.9 / 1.3.10 v1 / 1.4.5 v2 / canary 20261204.1 (`cd7c5c5`, 2026-12-05); 1.1.39 v0 (2026-12-03) | pass same (`cd7c5c5`, 2026-12-05) | pass same (`cd7c5c5`, 2026-12-05); credentialed bunfig registry + unreachable-registry fallback byte-exact, no secret printed (v5.2.0, 2026-12-03) |
25-
| Common path, single project, `bun.lockb` (1.1.39 → 1.4.5) | pass 1.1.39 / 1.2.23 / 1.3.9 / 1.3.10 / 1.4.5 / canary 20261204.1 (`cd7c5c5`, 2026-12-05) | pass same (`cd7c5c5`, 2026-12-05) | pass same; rollback refuses (documented) (`cd7c5c5`, 2026-12-05) |
26-
| Workspaces (text v0/v1/v2 + lockb, hoisted + isolated) | pass 1.1.39 lockb / 1.2.23 / 1.3.9 / 1.3.10 / 1.4.5 / canary 20261204.1 text + lockb, frozen + `apply` + `vex` (`cd7c5c5`, 2026-12-05); rollback byte-exact 1.4.5 + canary (2026-12-05); npm alias in an isolated ws: scan, `vex`, frozen + `apply`, `rollback` byte-exact (1.4.5, 2026-12-01) | pass 1.1.39 / 1.2.23 / 1.3.9 / 1.3.10 lockb, 1.4.5 + canary text + lockb, `vendor --revert` byte-exact (`cd7c5c5`, 2026-12-05); v1 refusal remedy (delete `bun.lock`, `bun install` on 1.4.5) works (2026-12-05); 1.3.10 lockb (2026-12-02); lockb all four + text v2 1.4.5; npm alias + member-nested copy on 1.2.23 lockb / 1.4.5 (2026-11-29); alias of a scoped package text + lockb, hosted + vendored (1.4.5, 2026-11-30); text v0/v1 refused `vendor_bun_workspace_unsupported` (documented); lockb on 1.2.23/1.3.10 survives unfrozen install + member `bun add` (2026-11-27) | pass 1.1.39 lockb / 1.2.23 / 1.3.9 / 1.3.10 / 1.4.5 / canary text + lockb (`cd7c5c5`, 2026-12-05); hosted text rollback byte-exact 1.4.5 + canary; v1/v2 + lockb; v0 refused `redirect_bun_workspace_unsupported` (documented) (2026-11-27). Catalogs (`catalog:` / named), `!` negation, dot-dir members: pass all three modes, text + lockb 1.4.5 (2026-11-28) |
23+
| Repo real-Bun e2e suites (redirect, vendor, lockb, mode migration, takeover, eject: 101 tests) | pass canary 20261205.1 102/102 (`cd7c5c5`, 2026-12-06); 1.1.39 / 1.4.5 (v5.2.0, 2026-12-04); 1.2.23 / 1.3.9 / 1.3.10 (2026-11-27) | | |
24+
| Common path, single project, `bun.lock` v0/v1/v2 (scan → frozen fresh install → `vex` → rollback → install) | pass canary 20261205.1 (2026-12-06); 1.2.23 v1 / 1.3.9 / 1.3.10 v1 / 1.4.5 v2 (`cd7c5c5`, 2026-12-05); 1.1.39 v0 (2026-12-03). Path with space + `ü`: scan, frozen, `vex`, re-run no-op, rollback byte-exact (1.4.5, 2026-12-06) | pass same; path with space + `ü`, relative tarball path, `vendor --revert` byte-exact (2026-12-06) | pass same; path with space + `ü` (2026-12-06); credentialed bunfig registry + unreachable-registry fallback (v5.2.0, 2026-12-03) |
25+
| Common path, single project, `bun.lockb` (1.1.39 → 1.4.5) | pass canary 20261205.1 (2026-12-06); 1.1.39 / 1.2.23 / 1.3.9 / 1.3.10 / 1.4.5 (2026-12-05); space + `ü` path (2026-12-06) | pass same | pass same; rollback refuses (documented), but its `git checkout -- bun.lockb` remedy is a no-op on a committed pin: fail #2540 (1.4.5 / canary, 2026-12-06) |
26+
| Workspaces (text v0/v1/v2 + lockb, hoisted + isolated) | pass 1.1.39 lockb / 1.2.23 / 1.3.9 / 1.3.10 / 1.4.5 / canary 20261204.1 text + lockb, frozen + `apply` + `vex` (`cd7c5c5`, 2026-12-05); rollback byte-exact 1.4.5 + canary (2026-12-05); npm alias in an isolated ws: scan, `vex`, frozen + `apply`, `rollback` byte-exact (1.4.5, 2026-12-01) | pass 1.1.39 / 1.2.23 / 1.3.9 / 1.3.10 lockb, 1.4.5 + canary text + lockb, `vendor --revert` byte-exact (`cd7c5c5`, 2026-12-05); v1 refusal remedy works (2026-12-05); npm alias, member-nested copy, scoped alias (2026-11-30); text v0/v1 refused `vendor_bun_workspace_unsupported` (documented); lockb survives unfrozen install + member `bun add` (2026-11-27) | pass 1.1.39 lockb / 1.2.23 / 1.3.9 / 1.3.10 / 1.4.5 / canary text + lockb (`cd7c5c5`, 2026-12-05); hosted text rollback byte-exact; v0 refused `redirect_bun_workspace_unsupported` (documented) (2026-11-27). Catalogs (`catalog:` / named), `!` negation, dot-dir members: pass all three modes, text + lockb 1.4.5 (2026-11-28) |
2727
| Takeovers (agent → hosted, hosted ⇄ vendored, partial #1039, superseding uuid) | agent → hosted → vendored → hosted → agent chain pass 1.4.5 text + lockb, single + ws: frozen install patched and `vex` attests at each step, `vendor_takeover_reverted_redirect`, `hosted_wiring_retained` on the agent step (`cd7c5c5`, 2026-12-05) | hosted → vendored pass text + lockb 1.4.5 (2026-12-02); partial pass (2026-11-27); superseding uuid pass text + lockb 1.4.5, live-tree `bun install` picks it up (2026-11-28) | vendored → hosted pass text + lockb 1.4.5, `redirect_takeover_reverted_vendored` (2026-12-02); with mirror pass (2026-11-27); superseding uuid pass text + lockb 1.4.5 (2026-11-28) |
2828
| Unwinds (rollback / remove / `vendor --revert` / `scan --prune` / `repair`) | rollback + `remove <purl>` pass 1.4.5 text + lockb ws (2026-11-27) | `vendor --revert` byte-exact, `repair` re-downloads a deleted tarball, `vendor --check` pass 1.4.5 text + lockb ws (2026-11-27) | rollback pass text (all versions); `scan --prune` n/a (`redirect_prune_ignored`). Vendored `--prune` after `bun remove` pass text + lockb; agent `--sync` prunes (1.4.5, 2026-11-28) |
2929
| `vex` (isolated linker, lockfile-only, workspaces) | pass all common-path cells (2026-11-27) | pass all common-path cells (2026-11-27) | pass all common-path cells + mirror ws (2026-11-27); refuses on an unreinstalled live tree with a clear message |
@@ -37,23 +37,24 @@ v5.2.0 was tagged 2026-12-03 at `d987721`; the common-path and workspace rows we
3737
| Global `-g` | pass scan / bin / `vex -g` / `rollback -g` (1.4.5, 2026-11-29) | n/a | refuses `--global` with hosted (documented, 2026-11-29) |
3838
| `bun patch` interplay (#367 / #1019) | n/a | URL-keyed user patch skipped on takeover, rollback warns dropped (1.4.5, 2026-11-28); aliased `bun patch lp` skipped / refused with `--allow-patch-conflicts` (1.4.5, 2026-11-30) | URL-keyed survives superseding; registry-keyed lockb skipped (1.4.5, 2026-11-28); aliased `bun patch lp` skipped (1.4.5, 2026-11-30) |
3939
| Lifecycle scripts / `trustedDependencies` / default trust | n/a | default-trust refusal incl. alias pass; explicit trust by real name on an npm alias: fail #2335 (1.4.0+ lockb, 1.4.4+ text; hosted still fails on `6280589`, 2026-12-02) | same: skip pass, alias trust fail #2335 (2026-11-28) |
40-
| `.gitignore` / LFS on vendored artifacts | n/a | `*.tgz` rule: still committed; `.socket/` / `vendor/` rules: clear refusal, nothing written (1.4.5, 2026-11-28). `git lfs track '*.tgz'`: fresh vendored run keeps tarballs out of LFS, clone installs frozen, `vendor --check` green (1.4.5 text single + lockb ws, 2026-12-05); pre-#1541 `repair` path not re-run | n/a |
41-
| Self-update of a Bun-installed CLI (#1621) | pass: `--update` refuses `managed_install` with `bun add -g …@latest` (global) / `bun add …@latest` (project, hoisted + isolated); the project remedy keeps it a devDependency and frozen install stays clean (1.4.5, v5.2.0, 2026-12-04) | — | — |
42-
| Canary lock bytes vs stable | canary 20261204.1 = 1.4.5 for text + lockb after the hosted and vendored rewrites; unfrozen `bun install` keeps the rewritten lock (2026-12-05); canary 20261203.1 passes the 102 repo e2e tests (2026-12-04) | | |
43-
| Agent-mode file `mode` (#2433, new) | pass 1.4.5 hoisted + isolated, umask 000 (Bun keeps 0666 and hardlinks to its cache): content + mode and mode-only patches tighten to 0644 via rename, cache copy untouched, `apply --check` / `vex` catch a reinstall, `apply` re-tightens, rollback keeps the mode (documented) (2026-12-02) | n/a (content only) | `mode` in `view` doesn't disturb hosted (2026-12-02) |
40+
| `.gitignore` / LFS on vendored artifacts | n/a | `*.tgz` rule: still committed; `.socket/` / `vendor/` rules: clear refusal, nothing written (1.4.5, 2026-11-28). `git lfs track '*.tgz'`: fresh vendored run keeps tarballs out of LFS, clone installs frozen, `vendor --check` green (1.4.5 text single + lockb ws, 2026-12-05); pre-#1541 legacy `* -text` uuid `.gitattributes` + LFS pointer: LFS-less clone → `vendor --check` exit 1 `vendor_artifact_unreadable` → `repair` upgrades the root `.gitattributes`, commit stores a real tarball, next clone installs frozen patched (#1581 fix holds, 1.4.5 text, 2026-12-06) | n/a |
41+
| Self-update of a Bun-installed CLI (#1621) | pass: `--update` refuses `managed_install` with a working `bun add [-g] …@latest` remedy (1.4.5, v5.2.0, 2026-12-04) | — | — |
42+
| Canary lock bytes vs stable | canary 20261205.1 = 1.4.5 for text + lockb after the hosted and vendored rewrites (2026-12-06) | | |
43+
| Agent-mode file `mode` (#2433, new) | pass 1.4.5 hoisted + isolated, umask 000: tightens to 0644 via rename, cache copy untouched, `apply --check` / `vex` catch a reinstall (2026-12-02) | n/a (content only) | `mode` in `view` doesn't disturb hosted (2026-12-02) |
4444
| `file:` folder copy of the patched version in a member (text + lockb ws) | pass: both copies patched, `vex` attests (1.4.5, 2026-12-05) | registry copy wired, folder copy unpatched, no scan warning, `vex` omits it (known non-bug) (2026-12-05) | `redirect_unattributable` veto (known non-bug) (2026-12-05) |
4545
| Vendored dry run / `--max-new-patches` on a URL-tarball dep (text + lockb) | n/a | fail #2479: preview `verified`, rollout "Next up" then exit 1 every run (1.2.23 / 1.4.5, v5.2.0, 2026-12-03); hosted dry run warns correctly | pass: dry run and wet run warn `redirect_bun_non_registry_entry_skipped`; a credential in the dep URL is never printed (#2445) (1.4.5, 2026-12-03) |
46+
| Independent project in `packages/.tools` under `packages/*` (#1631) | pass text + lockb: scan, frozen, `vex`, root ws untouched and installs frozen (1.4.5, 2026-12-06) | pass same | pass same |
4647
| macOS / Windows | untested on main: probe workflows are off, Linux only | | |
4748

4849
## Backlog
4950

50-
1. #2479: re-test when fixed (dry run `[would-refuse]`, rollout skips the refused purl, no view fetch; text + lockb; also a bundled-only copy and a `file:` tarball).
51-
2. #2406 / #2384 (likely one root cause: `read.files` lacks `bun.lockb`): re-test both when fixed (lockb reverse case on 1.1.39 / 1.2.23 / 1.4.5; lockb re-run with the mirror at 200 / 401 / 5xx sends no HEAD; a lockb ws with one existing and one new pin; text unchanged).
52-
3. #2335: re-test when fixed (alias trusted by real name, hosted + vendored, text 1.4.4+ / lockb 1.4.0+; also the reverse, trusted by alias name only; and the default-trust skip remedy for an alias).
53-
4. Each new main SHA: re-run the common path + workspaces (done on `cd7c5c5`; repo real-Bun e2e suites last run on `d987721`, re-run them when main touches npm/bun code). Patch mirror outside the repo suites not re-run since v5.2.0.
54-
5. #1581 legacy path: a pre-#1541 `* -text` uuid `.gitattributes` under `git lfs track '*.tgz'`, then `repair` + commit (fresh vendored runs pass).
55-
6. Spot-check #1631 (dot-dir workspaces) fully on main.
56-
7. Each new Bun release or canary: compare its text and lockb bytes with the latest stable.
51+
1. #2540: re-test when fixed (committed hosted `bun.lockb` pin, rollback + `remove`; the new remedy must work when followed literally; text unaffected).
52+
2. #2479: re-test when fixed (dry run `[would-refuse]`, rollout skips the refused purl, no view fetch; text + lockb; also a bundled-only copy and a `file:` tarball).
53+
3. #2406 / #2384 (likely one root cause: `read.files` lacks `bun.lockb`): re-test both when fixed (lockb reverse case on 1.1.39 / 1.2.23 / 1.4.5; lockb re-run with the mirror at 200 / 401 / 5xx sends no HEAD; a lockb ws with one existing and one new pin).
54+
4. #2335: re-test when fixed (alias trusted by real name, hosted + vendored, text 1.4.4+ / lockb 1.4.0+; also trusted by alias name only).
55+
5. Each new main SHA: common path + workspaces, and the repo real-Bun e2e suites when main touches npm/bun code. Patch mirror outside the repo suites not re-run since v5.2.0.
56+
6. Untested shapes: CRLF / BOM `package.json` + `bunfig.toml` in hosted and vendored; symlinked project dir; `--json` output of scan / rollback on Bun; an interrupted (killed) hosted run on lockb.
57+
7. Each new Bun release or canary: compare its text and lockb bytes with the latest stable, run the repo e2e suites.
5758
8. macOS / Windows (path quoting, junctions, `bun.cmd`): can't be probed now. Note likely platform differences in issues.
5859

5960
## Known non-bugs

0 commit comments

Comments
 (0)