Skip to content

Commit 371205f

Browse files
committed
bundler: run 2026-11-30 (#2376)
1 parent c629d2b commit 371205f

3 files changed

Lines changed: 41 additions & 8 deletions

File tree

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
[agent] 2026-11-30: Bundler (RubyGems) bug-hunt run
2+
3+
**Tested:** main `cfc870f` (unchanged since 2026-11-26), release 5.1.0 (from npm, for the regression check). Linux. Ruby 3.3.6 with Bundler 4.1.1 and 2.6.9. Newest Bundler is still 4.1.1. Main had not moved, so this run worked backlog item 3 (optional groups, a CI gem cache, `--add-checksums` with 8 platform builds).
4+
5+
**Harness:** one loopback server in front of seven instances of the repo's stand-in (`tests/nokogiri/patch_service.rb`): rack 3.2.9, puma 6.6.1 (native), nokogiri 1.19.7 (8 prebuilds), rake 13.4.2 in a `group` block, tilt 2.9.0 and memory_profiler 1.1.0 in a `group :profiling, optional: true` block, mustermann 3.1.1 transitive. A second server serves a newer patch (new uuid) for the same versions. New this run: the patch view carries `blobContent` / `beforeBlobContent`, as the real API does, so an agent scan keeps its blobs in `.socket/blobs/`. Earlier agent cells ran on hand-written records, mostly without the `?platform=ruby` qualifier the stand-in gives every gem patch.
6+
7+
**Re-triage:** the open issues without `agent:needs-human` were all filed on this same main, so there was nothing to re-check. Nothing closed.
8+
9+
**Cells**
10+
11+
| Cell | Result |
12+
| --- | --- |
13+
| Hosted, 4.1.1, a project with an optional group that is not installed: scan (6 declarations, 1 transitive line, nokogiri from 8 prebuilds beside its `ruby` entry), frozen install, app, a deployment clone `with profiling`, `vex` (7 statements), rollback, frozen install | pass: the pair is byte-exact |
14+
| Hosted, a 2.6.9 lock without `CHECKSUMS`, 9 platforms: scan, frozen install, `bundle lock --add-checksums` (the printed remedy), frozen install, re-scan (no change), deployment clone, `pristine`, rollback, frozen install, `pristine` | pass: only the 23 upstream `CHECKSUMS` lines remain |
15+
| Agent, 4.1.1: scan, app (6 gems; the gem of the optional group is skipped with a clear message) | pass |
16+
| Agent, a newer patch for the same gem versions: re-scan, `apply`, `apply --check`, `vex`, rollback | **fail #2376** (5.1.0 too): `no matching variant found` for all 6 gems, exit 1 |
17+
| The same after the updated `.socket/` is committed: a clone with the CI cache of `vendor/bundle` restored, `bundle install`, `apply` | **fail #2376**: exit 1 on every build |
18+
| The printed remedy (`bundle pristine <gem>`, `apply`), and `apply --force` | both work |
19+
| The same update with an unqualified record (`pkg:gem/rack@3.2.9`) | pass: the newer patch is written, rollback restores the gem |
20+
21+
**Filed**
22+
- https://github.com/SocketDev/socket-patch/issues/2376: agent mode cannot move a gem to a newer patch of the same version. The installed file holds the earlier Socket patch's output and its blob is in `.socket/blobs/`, which the CLI contract says is overwritten with a warning. For a `?platform=ruby` record the variant gate (`apply.rs:3782`) skips the gem before that rule is reached. The re-scan exits 1 with the manifest already rewritten, and a CI job with a cached `vendor/bundle` fails `socket-patch apply` until the cache is cleared. The message says the gem was edited. Not a regression. The issue has an offline repro script.
23+
24+
**Ruled out** (added to `known-non-bugs/bundler.md`)
25+
- "`scan --mode agent` keeps no blobs" was an artifact of the stand-in's patch view, which carries no file contents.
26+
- Hosted `rollback` prints the generic "keeps its patched bytes in installed trees" note for a gem of an optional group that is not installed.
27+
- Hosted `vex` attests a gem of an optional group that this machine has not installed: it reads the lock.
28+
29+
**Blocked / not reached:** Ruby 3.4 / 4.0 and 2.7 (none under `/opt`), `rake release` in a gem library (a `bundle gem` project is set up; nothing run), optional groups in vendored mode, a CI cache restored after an agent rollback, the re-runs of backlog 6. The release build of the CLI took 10 minutes.

‎known-non-bugs/bundler.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,3 +245,7 @@ Documented limitations and verified false positives. One bullet each. Search thi
245245
- Bundler 2.5.22 prints "Cannot write a changed lockfile while frozen." on a deployment install of a hosted or vendored Bundler 4 lock and still completes: it prints the same on the unpatched lock (11-29).
246246
- Agent `rollback` of every patch leaves `.socket/manifest.json` as `{"patches": {}}` in a project that had no `.socket/`: not gem-specific, harmless, not filed (11-29).
247247
- `scan` in a directory with a `Gemfile` but no `Gemfile.lock` reports the gems of the running Ruby's gem home and "No patches available": nothing is written (11-29).
248+
- `scan --mode agent` leaving only `.socket/manifest.json` (no `.socket/blobs/`): a mock artifact. The repo's stand-in serves a patch view without `blobContent`; with it the scan keeps the blobs, and `apply --offline` works after a reinstall (11-30).
249+
- Hosted `rollback` prints "1 unwired package keeps its patched bytes in installed trees" for a gem of an `optional: true` group that is not installed at all: the generic note, as for vendored-only gems (11-30).
250+
- Hosted `vex` attests a gem of an optional group that this machine has not installed: the statement is read from the lock, which pins the patched build for every machine that does install it (11-30).
251+
- Agent `scan` skips a patched gem of an optional group that is not installed, with "[skip] … (not installed; run your package manager's install first, or `socket-patch scan --mode vendored` …)": the message names the step (11-30).

‎state/bundler.md‎

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

3-
Last run: 2026-11-29, main `cfc870f`, release 5.1.0, newest Bundler 4.1.1. Tested so far: Bundler 1.17.3, 2.2.15 to 4.1.1 on Ruby 3.1.6 to 3.3.6.
3+
Last run: 2026-11-30, main `cfc870f`, release 5.1.0, newest Bundler 4.1.1. Tested so far: Bundler 1.17.3, 2.2.15 to 4.1.1 on Ruby 3.1.6 to 3.3.6.
44

5-
Harness: rubygems.org is reachable, the Socket patch API is not. Use the repo's stand-in, `tests/nokogiri/patch_service.rb`: `PatchService.new(name, version, platforms, uuid, ghsa, workdir, mark)` (for the versions the lock resolved) appends `mark` to `lib/<name>.rb` of the real gems and serves the API, the index and the artifacts for ONE gem (org `nokogiri-e2e`). An empty platform list gives a ruby-platform patch; vendored mode then also needs a `gem-stub-gemspec` artifact (add it to `package_result`, serve the gem's `spec.to_ruby`). For several gems, put one loopback server in front of several instances (subclass, override `url` with the front's): route a path that holds a uuid to that instance's `respond`, merge `batch` (by the body's `components`) and `package` (by `uuids`), answer `by-package/<purl>`, and serve `…/patches/blob/<git-sha256>`. Pass `--api-url <mock> --patch-server-url <mock> --api-token fake --org nokogiri-e2e` to every command. Rubies: `/opt/rbenv/versions` (3.1.6, 3.2.6, 3.3.6); `gem install bundler -v <v>` (2.2.x runs on 3.1.6), then select it with `BUNDLER_VERSION`. A Rails app: `gem install rails -v 8.0.2` into a scratch `GEM_HOME`, then `rails new app --skip-git --skip-bundle --skip-javascript --skip-hotwire --skip-docker` (10 min). The release: `npm install @socketsecurity/socket-patch@5.1.0`. Agent cells need no mock: hand-write `.socket/manifest.json` and `.socket/blobs/<git-sha256>`, then `apply --offline`. `vex` writes with `--output`.
5+
Harness: rubygems.org is reachable, the Socket patch API is not. Use the repo's stand-in, `tests/nokogiri/patch_service.rb`: `PatchService.new(name, version, platforms, uuid, ghsa, workdir, mark)` (for the versions the lock resolved) appends `mark` to `lib/<name>.rb` of the real gems and serves the API, the index and the artifacts for ONE gem (org `nokogiri-e2e`). An empty platform list gives a ruby-platform patch; vendored mode then also needs a `gem-stub-gemspec` artifact (add it to `package_result`, serve the gem's `spec.to_ruby`). For several gems, put one loopback server in front of several instances (subclass, override `url` with the front's): send a path that holds a uuid to that instance's `respond`, merge `batch` (by the body's `components`) and `package` (by `uuids`), answer `by-package/<purl>`, serve `…/patches/blob/<git-sha256>`. Pass `--api-url <mock> --patch-server-url <mock> --api-token fake --org nokogiri-e2e` to every command. Rubies: `/opt/rbenv/versions` (3.1.6, 3.2.6, 3.3.6); `gem install bundler -v <v>` (2.2.x runs on 3.1.6), then select it with `BUNDLER_VERSION`. A Rails app: `gem install rails -v 8.0.2` into a scratch `GEM_HOME`, then `rails new app --skip-git --skip-bundle --skip-javascript --skip-hotwire --skip-docker` (10 min). The release: `npm install @socketsecurity/socket-patch@5.1.0`. Agent cells: the stand-in's patch view has no file contents, so add `blobContent` / `beforeBlobContent` (base64) to its `files` entry or the scan stores no blobs. Without a mock, hand-write `.socket/manifest.json` (key `pkg:gem/<name>@<version>?platform=ruby`, as the service does) and `.socket/blobs/<git-sha256>`, then `apply --offline`. `vex` writes with `--output`.
66

77
## Coverage matrix
88

99
| Workflow | Agent | Vendored | Hosted |
1010
| --- | --- | --- | --- |
11-
| Common path: scan, patch, fresh `bundle install`, app loads patched code, `vex`, rollback, `bundle install` again | pass 2.2.15 to 4.1.1 on Ruby 3.1.6 to 3.3.6 (11-29), under `bundle exec` too (11-25); Rails 8.0 app 4.1.1 (11-26), 2.6.9 (11-27), 2.5.22 with a warm bootsnap cache (11-29) | pass 2.2.15 to 4.1.1, deployment clone (11-29); a Bundler 2.2 lock: nokogiri refused, the `update --bundler` remedy works (11-29); executables of vendored gems, binstubs (11-29); CRLF pair (11-25); Rails 8.0 app 4.1.1 (5 platforms removed first), 2.6.9, 2.5.22: every gem not refused (11-29); the printed `--remove-platform ruby` alone: fail #2284; a merge conflict in the pair: nothing written (11-28); the Dockerfile gem layer (`COPY Gemfile Gemfile.lock`): fail #2326 | pass 2.2.15 to 4.1.1: 6 gems (puma native, nokogiri from prebuilds), deployment clone, rollback byte-exact (11-29); `pristine`, `update --all` (11-26); Rails 8.0 app 4.1.1 (11-26), 2.6.9 (11-27), 2.5.22: production clone, `bin/rubocop`, `bin/brakeman` (11-29); a merge conflict in the pair 4.1.1: refused with the marker's line (11-27) |
11+
| Common path: scan, patch, fresh `bundle install`, app loads patched code, `vex`, rollback, `bundle install` again | pass 2.2.15 to 4.1.1 on Ruby 3.1.6 to 3.3.6 (11-29), under `bundle exec` too (11-25); Rails 8.0 app 4.1.1 (11-26), 2.6.9 (11-27), 2.5.22 with a warm bootsnap cache (11-29) | pass 2.2.15 to 4.1.1, deployment clone (11-29); a Bundler 2.2 lock: nokogiri refused, the `update --bundler` remedy works (11-29); executables of vendored gems, binstubs (11-29); CRLF pair (11-25); Rails 8.0 app 4.1.1 (5 platforms removed first), 2.6.9, 2.5.22: every gem not refused (11-29); the printed `--remove-platform ruby` alone: fail #2284; a merge conflict in the pair: nothing written (11-28); the Dockerfile gem layer (`COPY Gemfile Gemfile.lock`): fail #2326 | pass 2.2.15 to 4.1.1: 6 gems (puma native, nokogiri from prebuilds), deployment clone, rollback byte-exact (11-29); `pristine`, `update --all` (11-26); Rails 8.0 app 4.1.1 (11-26), 2.6.9 (11-27), 2.5.22: production clone, `bin/rubocop`, `bin/brakeman` (11-29); an `optional: true` group, a clone `with` it, 4.1.1 (11-30); a merge conflict in the pair 4.1.1: refused with the marker's line (11-27) |
1212
| System or user gem home (no `BUNDLE_PATH`) | pass 4.0.18, 2.5.22 with `GEM_HOME` (11-15); native rebuild, rollback byte-exact (11-17); a `path` other than `vendor/bundle`, or nothing installed in it yet: fail #2313 | pass 4.1.1: an unlocked version in the home is skipped (#2075 holds, 11-27) | pass 4.0.18: warning, `--gem-refresh-shared` on `scan` and `rollback` (11-15) |
1313
| `bundle config set path vendor/bundle` | pass 2.6.9 (11-13) | pass 4.0.18 (11-14) | pass 2.3.27 to 4.0.18 (11-14) |
1414
| Deployment and frozen installs (`BUNDLE_DEPLOYMENT`, `BUNDLE_FROZEN`, `.bundle/config`) | pass frozen 2.6.9, 4.0.18 (11-13); Docker-image style (`GEM_HOME` = `BUNDLE_APP_CONFIG`, deployment, `without`) 4.0.18 (11-17) | pass frozen and deployment clone, with `BUNDLE_WITHOUT` too, 4.0.18 (11-14) | pass frozen on all, deployment clone 2.5.22, 2.6.9, 4.0.18 (11-14) |
@@ -20,14 +20,14 @@ Harness: rubygems.org is reachable, the Socket patch API is not. Use the repo's
2020
| Rollback and remove restore `Gemfile` and `Gemfile.lock` byte for byte | pass (pair never touched) (11-14); a gem edited in place: `bundle pristine <gem>` is named and works (11-26) | rollback, `remove`, `vendor --revert` pass 4.0.18 (11-14), 2.5.22 (11-24); #2214 fixed (11-25); platform gem after `--remove-platform`: fail #2283 | pass on all, CRLF and `vendor/cache` archives too (11-16); `remove` of a transitive and a direct gem out of 12 (11-18); no `cache/` dir 2.6.9, `--add-checksums` on a patched lock (11-19) |
2121
| `vex` reports only what is really applied | pass 2.6.9, 4.0.18 (11-13) | attests correctly 4.0.18; #2076 fixed, not re-run | pass 2.6.9, 4.0.18, stale shared-home copy omitted (11-15); #2087 fixed, not re-run |
2222
| `gems.rb` / `gems.locked` spelling | pass 2.5.22 (11-15) | refused as documented (`gemfile_not_loaded`), not re-run | pass 4.0.18 (11-14) |
23-
| Lock with a CHECKSUMS section (Bundler 2.6+) | n/a | pass 4.0.18; without the section 2.5.22, 2.6.9 (11-15) | pass 4.0.18 (11-13) |
23+
| Lock with a CHECKSUMS section (Bundler 2.6+) | n/a | pass 4.0.18; without the section 2.5.22, 2.6.9 (11-15) | pass 4.0.18 (11-13); `lock --add-checksums` on a hosted 2.6.9 lock with 8 nokogiri builds, re-scan, clone, rollback, `pristine` (11-30) |
2424
| Monorepo: several Gemfiles, nested projects, scan from the repo root | one project by design; from the root it names the projects and the `--cwd` to use (11-19) | pass 4.1.0: 3 Gemfiles, scan, frozen installs, `list`, rollback from the root (11-16) | pass 4.0.18: scan, `list`, rollback from the root (11-14); two locks with different platform sets 2.5.22: one wired, one refused, remedy, rollback from the root (11-20) |
2525
| Gem library project (`gemspec` in the Gemfile), runtime and development dependencies patched | pass 4.0.18, 2.5.22: all gems, rollback (11-19); `gem build` packs `.socket/manifest.json` (#2354) | runtime dependency vendored, frozen install, rollback; an ignored lock, a clone without one 4.1.1 (11-29); `gem build` of a `bundle gem` library packs `.socket/vendor/` 4.1.1, 2.6.9: fail #2354; development dependency refused (#2151 fixed, not re-run) | runtime dependency: transitive line, frozen install, rollback byte-exact; an ignored lock, a clone without one, `gem build` unchanged 4.1.1 (11-29); development dependency refused (#2151 fixed, not re-run) |
2626
| A second rubygems source (private gem server) beside patched gems; a private mirror as the only `source` | `source … do` block: pass 4.0.18 (11-19); a gem the private server rebuilt is refused (11-25) | block: pass 4.0.18: frozen install, `vex`, rollback (11-19) | block: pass 4.0.18 (11-19); two top-level `source` lines: #2162 fixed, not re-run; mirror as the only source: scan passes; the unwind behind a `gem generate_index` mirror, 4.1.1: fail #2285 |
2727
| Patched gem that is a default gem of the running Ruby | pass 4.0.18 (11-19) | pass 4.0.18: json refused as documented (11-19) | pass 4.0.18 (11-19) |
2828
| Appraisal-style `gemfiles/*.gemfile` (`BUNDLE_GEMFILE`) | pass 4.0.18 (11-24) | as hosted (11-24) | refused with a remedy under `BUNDLE_GEMFILE`; a root scan wires the root pair only (11-19) |
2929
| `bundle install --standalone` (Bundler 4, `./bundle`) | pass 4.0.18 (11-24) | pass 4.0.18 after a re-run of `--standalone` (11-24) | known non-bug |
30-
| A newer patch (new uuid, same gem version) supersedes the recorded one on a re-scan | pass 4.0.18 (11-19) | pass 4.0.18 (11-16); #2129 fixed, not re-run | pass 4.0.18: source, remote, CHECKSUMS and the installed copy move, rollback byte-exact (11-16) |
30+
| A newer patch (new uuid, same gem version) supersedes the recorded one on a re-scan | an unqualified record passes 4.0.18 (11-19); a `?platform=ruby` record, 4.1.1, 2.6.9, a CI cache too: fail #2376 | pass 4.0.18 (11-16); #2129 fixed, not re-run | pass 4.0.18: source, remote, CHECKSUMS and the installed copy move, rollback byte-exact (11-16) |
3131
| Gemfile declaration shapes (23) | n/a (agent does not edit the Gemfile) | refused shapes are documented, not re-run | pass 4.0.18: scan, frozen install, lock stable, app, rollback byte-exact for each (11-16) |
3232
| Re-runs (idempotency) and `--json` output | pass 4.0.18 (11-14) | re-scan pass 2.6.9, 4.0.18 | pass 4.0.18 (11-14) |
3333
| Switching modes on one project | pass 4.0.18: hosted to agent, agent to hosted (native and precompiled too), agent to vendored and rollback, vendored then agent for a refused gem (11-15 to 11-20) | pass: hosted to vendored and rollback (11-18); `get <purl> --mode vendored` over a hosted gem, then each unwind (#2174 fixed, 11-24); `get --mode hosted` for the native ones 4.1.1 (11-25); vendored to hosted is refused with a remedy (11-20); `remove` of a vendored gem beside hosted ones 4.1.1 (#2090 holds, 11-27); after `get --mode hosted` / `--mode agent` for the refused native gems every `scan --mode vendored` exits 1, fail #2269 | hosted beside vendored gems installs and attests 4.0.18 to 4.1.1 (11-25) |
@@ -42,8 +42,8 @@ Harness: rubygems.org is reachable, the Socket patch API is not. Use the repo's
4242

4343
1. Precompiled platform gems: PRs #2226 / #2257 change hosted and vendored mode for them; re-run the nokogiri, ffi and sqlite3 cells after either merges, and the `vex` product form in agent mode (#2243: `pkg:gem/<name>@<version>` only).
4444
2. Gem libraries, the rest: `rake release` / `rake install`, a gemspec with `Dir[...]` globs.
45-
3. Not run yet: optional groups (`group :x, optional: true`), a CI cache of `vendor/bundle` restored after an agent rollback, `bundle lock --add-checksums` on a 2.6 hosted lock with 8 platform builds.
46-
4. Re-check when fixed: #2269, #2283, #2284, #2285, #2313, #2325, #2326, #2338, #2354. A mirror whose index has hex checksums (gemstash, or rewrite `info/*`): the hosted unwind, vendored mode, the agent native rebuild, credentials in the URL.
45+
3. Agent cells again through the mock with `blobContent` and `?platform=ruby` records (earlier agent cells used hand-written, mostly unqualified records): rollback, remove, `vex`, a native rebuild, a platform gem, a CI cache of `vendor/bundle` restored after a rollback. Optional groups in vendored mode.
46+
4. Re-check when fixed: #2269, #2283, #2284, #2285, #2313, #2325, #2326, #2338, #2354, #2376. A mirror whose index has hex checksums (gemstash, or rewrite `info/*`): the hosted unwind, vendored mode, the agent native rebuild, credentials in the URL.
4747
5. Agent native rebuild, the rest: a private source, sass-embedded; real nokogiri with `--use-system-libraries` (#2136).
4848
6. Re-run the repros of fixes not re-run yet: #2106, #2185, #2129, #2151, #2162, #2087, #2092 (4.1 `prune`), #2117.
4949
7. The terminal UI rework (#2153): read the gem messages of `rollback` and `vex` as a first-time user (`get` by name, `list` and `show` read well, 11-29).
@@ -58,4 +58,4 @@ The full list is in `known-non-bugs/bundler.md` on this branch. Search it with `
5858
- "the patched gem's gemspec differs from the installed one" after a hosted scan: a mock gem rebuilt with `gem build`. Repack with the original `metadata.gz`.
5959
- `vex` / `list` report no patches on a hosted project whose patch URLs are on loopback: pass `--patch-server-url`.
6060
- `vex` exits 2 asking for a product when the project has no git origin or gemspec: pass `--product`.
61-
- `scan --mode agent` keeps no blobs: after a reinstall run plain `apply`, not `apply --offline`.
61+
- `scan --mode agent` storing no blobs was a mock artifact (a patch view without `blobContent`); with it the blobs are kept in `.socket/blobs/`.

0 commit comments

Comments
 (0)