Skip to content

Commit 569665f

Browse files
committed
refactor: Bazel support and Composer ran clean
No PR and no new issue. The Bazel workspace support ran clean without a Bazel binary: the off switch on eleven package managers, the MODULE.bazel block, .bazelignore, lookups and streams. Real Composer installs a vendored rewire. Real pip does not, which another routine had filed as #2302. L73 is out of charter: the hosted Cargo guard sees no hub in a MODULE.bazel that is not UTF-8, as its module documents. Assisted-by: Claude Code
1 parent 6661397 commit 569665f

2 files changed

Lines changed: 92 additions & 8 deletions

File tree

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
[agent] 2026-11-28: architecture refactor
2+
3+
**`main`:** cfc870f. The run started at 16:55Z.
4+
5+
### Chosen
6+
No PR this run, and no new issue. Three routine PRs are open (#2261, #2265, #2267), so step 3 applies: open none and verify leads instead. All three are `ready` and none has changed since 2026-11-26 (each `updated_at` is the same): none merged or closed, none has a review from a person, and no maintainer has commented on the discussion. Since 14:55Z other routines opened two `bughunt` issues (#2338, #2341) and one PR (#2342); none carries `arch-audit`.
7+
8+
The leads still marked `to verify` (L08, L13, L14, #1970) need Windows, scala-cli or a Docker daemon. So this run took the one large module no entry under this charter names: the Bazel workspace support (core `bazel/`, 20,000 lines, experimental). Everything of it that can run without a Bazel binary came back clean. One thing it does by design is recorded as L73. Two shorter looks followed, both at the install a vendored rewire asks for: real Composer is clean, and real pip confirmed a problem another routine had already filed (#2302).
9+
10+
### PR
11+
None opened. #2261, #2265 and #2267 still await review. `main` has not moved from cfc870f.
12+
13+
### Leads and issues
14+
15+
**L73, out of charter; the module documents it.** In a Bazel workspace, hosted mode withholds a Cargo pin while a rules_rust hub reads the project's Cargo files and names no `cargo_config` (`redirect_cargo_bazel_config_unread`). With one byte of `MODULE.bazel` that is not UTF-8, the guard sees no hub and the pin is written, without a word. The bench's Cargo project under the `crate.from_cargo` hub of the repository's own fixture, less its `cargo_config` line:
16+
17+
```
18+
$ socket-patch scan --yes # MODULE.bazel as it is, with a UTF-8 comment, with a BOM, or as CRLF
19+
Switched 0 packages to hosted patches; rewrote 0 files.
20+
Warning: dielnoli1-core@3.16.6: the rules_rust hub at MODULE.bazel:10 reads the Cargo files of this project, and it names no `cargo_config`. […] dependency skipped (nothing rewritten).
21+
$ printf '# Maintainer: Jos\xe9\n' | cat - MODULE.bazel > M && mv M MODULE.bazel # one Latin-1 byte, in a comment
22+
$ socket-patch scan --yes
23+
Switched 1 package to hosted patches; rewrote 3 files. # no warning
24+
```
25+
26+
The Maven guard, given the same byte, says so and writes nothing for the hub (`maven_bazel_unreadable`: "MODULE.bazel: it cannot be read: it is not UTF-8"). It is not filed, for three reasons. The header of core `bazel/cargo.rs` lists "a `MODULE.bazel` that cannot be read" under "Not seen, and there a hub without the config fails as before". The contract's row ends "Nothing is read or changed … where no such hub is seen to read the project's Cargo files". And whether a real Bazel takes such a file could not be run here. What a maintainer could still want is the Maven guard's answer for Cargo: a workspace file that is there and was not read withholds the pin.
27+
28+
**#2302 (another routine's, `bughunt`), confirmed for vendored mode with pip 24.0; nothing filed.** After a vendored rewire of `requirements.txt`, over a virtualenv that holds the release from PyPI:
29+
30+
```
31+
$ socket-patch vendor --yes
32+
Vendored 1 package.
33+
2. Reinstall from the updated lockfile, then run `socket-patch vex` to verify the installed patches.
34+
$ .venv/bin/pip install -r requirements.txt
35+
Processing ./.socket/vendor/pypi/2222…/six-1.16.0-py2.py3-none-any.whl (from -r requirements.txt (line 1))
36+
six is already installed with the same version as the provided wheel. Use --force-reinstall to force an installation of the wheel.
37+
$ grep -c SOCKET_PATCHED .venv/lib/python3.11/site-packages/six.py
38+
0
39+
$ socket-patch vendor --check
40+
pkg:pypi/six@1.16.0: committed artifact and wiring verified
41+
$ socket-patch vex --product pkg:generic/app@1.0.0 -O vex.json # the statement: not_affected
42+
Warning: pkg:pypi/six@1.16.0: the installed tree does not match its vendored artifact; […] re-run your package manager's install to resync it.
43+
```
44+
45+
I had the transcript before I searched. #2302, opened on 2026-11-27 by the pip bug-hunt routine and triaged `priority:p1`, has the same case for hosted and vendored mode on pip 26.3 and 20.3.4, and names the vendored twins that Pipenv, Hatch and PDM already have (`pypi_*_stale_install`). It needs nothing from this routine.
46+
47+
**Seen and not filed:**
48+
- **`vex` says `not_affected` of a hosted Maven patch while scan has just said it could not read the hub** (`maven_bazel_unreadable`). The contract's `vex_bazel_not_in_build` row says so: "where the files are not read with certainty … the statement is then the `not_affected` one of a project without Bazel".
49+
- **A `--json` run that writes `.bazelignore` names the file nowhere in its envelope.** `docs/ecosystems.md` says so: "`Updated <path>` or `Removed <path>`, on stdout, not under `--json` or `--silent`".
50+
- **`rollback --json` and `repair --json` over a project with no patches** give `manifest_not_found` in two shapes (a top-level `path`; the path inside `message`). Consistency alone.
51+
- **L08, L13, L14, #1970:** still to verify. They need Windows, scala-cli or Docker.
52+
53+
### Areas examined
54+
All with the binary built from `main`. The Bazel files are the repository's own (`tests/fixtures/bazel/<ruleset>/bzlmod/e9/MODULE.bazel`) laid over a project of the benchmark harness, which has a `.git`.
55+
56+
- **The off switch, hosted mode**: pnpm, pip, Bundler, Composer, Cargo, Go, NuGet, Maven, Gradle, npm and uv, nine commands each (`scan` wet, again, dry and `--json`, `list` twice, `vex`, `repair`, `rollback`). The project without Bazel files, run twice, against the project with them under `SOCKET_NO_BAZEL=1`: the exit codes, both streams and every file under the project and its home are the same. The control (the files, no switch) differs for Cargo (the withheld pin), Maven and Gradle (their warnings, and the block once the hub is pinned).
57+
- **The off switch, agent mode**: the Go project with a stand-in API, three sequences. Same.
58+
- **The switch set after the scan**, over a tree a run without it wrote: Maven's block (`list`, `vex`, dry and wet rescans, `repair`, `rollback` dry and wet, `remove`) and Go's `.bazelignore` pair (the same, with `apply --check`). Each says and writes what it does without the switch.
59+
- **The block in `MODULE.bazel`**: a pinned `maven.install` hub with its lock and a `MODULE.bazel.lock` that names the ruleset's release. Six shapes of the file (LF and CRLF; a final line break, none, a blank last line): `rollback` leaves each byte for byte as it was.
60+
- **`.bazelignore` for a project below the root** (`svc/app`, the root two levels up), `--cwd` spelled eight ways (none, `.`, absolute, relative, with a trailing slash, through `..`, through a symlink, from inside the symlink): one pair, `svc/app/.socket/go-patches`, added by the scan and removed by `rollback`.
61+
- **The `.bazelignore` line under `--json` and `--silent`**: `scan`, `get`, `rollback`, `remove`, `apply`, `repair` and a dry scan, each three ways (21 runs). Human mode says `Updated` once on stdout, `--json` is one document, `--silent` leaves both streams empty, and a dry run writes nothing.
62+
- **The Cargo withhold** through `get` and `scan`, dry and wet, human and `--json`: one warning or one `warnings[]` entry, nothing written. And under five shapes of `MODULE.bazel` (L73).
63+
- **Composer's install after a vendored rewire**, Composer 2.8.12 on PHP 8.3.6, over `psr/log` 3.0.0 as this sandbox installs it: from source, a git clone, because the dist download is refused. `composer install` removes the clone and mirrors the vendored copy, and the patched file is the one installed. `composer require` of another package keeps the vendored entry. `vendor --revert` and `composer install` bring the upstream file back. Clean.
64+
- **pip's install after a vendored rewire**, pip 24.0 on Python 3.11: #2302.
65+
- Not run: whatever needs a Bazel binary (which copy a build takes), and vendored mode in a Bazel workspace (the `.bazelrc` lines, the refusals beside a hub). Found after my own runs: `tests/e2e_bazel_build/harness.rs` (lines 1460 to 1535) holds the off-switch rule for every ecosystem, and CI runs it with a real Bazel.
66+
67+
### Lessons
68+
- **Search by the tool's own words before building the case.** The pip transcript took six minutes and `search/issues` with "pip install vendored stale requirements" found #2302 in one request. Other routines hunt one package manager each and file `bughunt` issues with a `pm:<name>` label. This routine's ground is what cuts across them.
69+
- **Grep the tests for the switch before writing a differential.** `grep -rn SOCKET_NO_BAZEL crates/socket-patch-cli/tests` shows the repository's suite already compares a run under the switch with a run in the checkout without its workspace file. Mine agreed with it and cost fifteen minutes.
70+
- **Read the module's header before weighing a guard that fails open.** `bazel/cargo.rs` has a list titled "Not seen, and there a hub without the config fails as before". L73 was on it.
71+
- **A differential needs the same path.** `drv.py <pm> <sequence> <variants>` restores the bench's `work/` directory from a pristine copy before each variant, lays the Bazel files in, runs the sequence, and keeps each step's exit code, streams and a hash of every file under `work/`; `cmp.py` normalizes times and durations and prints where two variants differ. Running the plain variant twice gives the noise.
72+
- **Python's text mode turned my CRLF fixture into LF on read**, so three shapes looked changed after a rollback that had restored them. Read and write fixtures with `newline=""`.
73+
- **A hub that writes the Maven block needs three files**: `MODULE.bazel` with `maven.install(artifacts, lock_file, repositories)`, a `maven_install.json` of format 3 that pins the artifact, and a `MODULE.bazel.lock` whose `registryFileHashes` names `…/modules/rules_jvm_external/7.2/source.json`. Without the last the run says `maven_bazel_release` and writes no entry.
74+
- **The vendor fixture service also serves a real install.** With `psr/log` and `six` installed by the real tools and a hand-written manifest record, the throwaway test of the 20:56Z entry of 2026-11-26 packed the installed copy with the patched file.
75+
- The sandbox refuses `rm -rf "$W"` when `W` comes from `dirname`: write the literal path in a loop that resets a fixture.
76+
- The hunt took about 22 minutes of wall time: the builds 5 (the CLI, the bench and the fixture service, in the background), the off switch 6, the block, the lookups and the streams 5, Composer and pip 4, the rest reading the contract and `docs/ecosystems.md`.
77+
- The register was at 11,997 characters and is at 11,993. L73 joined the out-of-charter row, the two areas the Areas row, and one note names the per-package-manager routines and #2302. To make room, the `filed` row points at the Next PR line for its 37 issue numbers, and one note went.
78+
- The owner was not notified: nothing new needs them.
79+
80+
### Needs a person
81+
- **Review #2261, #2265 and #2267.** This is the thirty-first run in a row that could only verify leads.
82+
- **#2270** still blocks `ci-ok` on every PR; #2280 is open for it.
83+
- **#2340, #2309, #2277 and #2297 need an answer.** **#2299** and **#2315** each ask which of two fixes a maintainer prefers.
84+
- **L73 is a maintainer's call, not a defect by the contract:** whether the hosted Cargo guard should withhold a pin when a workspace file is there and could not be read, as the Maven guard does.
85+
- Thirty-nine confirmed problems wait for a slot, in the order the register's "Next PR" line gives.

0 commit comments

Comments
 (0)