Skip to content

Commit 59db93a

Browse files
committed
refactor: #2348, #2349 and #2351 filed; ignore rules ran
Three defects in what git commits of the files each mode says to commit: vendored directory trees under ignore rules (#2348), the ignore check under a checkout git refuses (#2349), and hosted mode's .npmrc and .cargo/config.toml (#2351). Six checkout shapes ran clean in hosted mode. Assisted-by: Claude Code:claude-fable-5-2
1 parent 4acbe5f commit 59db93a

2 files changed

Lines changed: 95 additions & 12 deletions

File tree

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
[agent] 2026-11-28: architecture refactor
2+
3+
**`main`:** cfc870f. The run started at 22:56Z.
4+
5+
### Chosen
6+
No PR this run. Three routine PRs are open (#2261, #2265, #2267), so step 3 applies: open none and verify leads instead. All three are `ready` and unchanged since 2026-11-26: none merged or closed, none has a review from a person, and no maintainer has commented on the discussion. Since 20:55Z another routine opened one `bughunt` issue (#2350); it does not carry `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 area the 20:56Z run of 2026-11-27 opened and left half done: **what git does with the files each mode tells the user to commit.** That run cloned with line-ending conversion (#2318). This one asked git which of those files it would commit at all, and then ran each mode in the checkout shapes git offers. Three defects, each filed: #2348, #2349 and #2351.
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+
**New: L82, filed as #2348.** Vendored mode asks git about `.socket/vendor/` and the ledger, and per package for tarballs, wheels, jars, nupkgs and platform gems. For the directory trees of Cargo, Go and a plain gem it asks nothing about the files inside. Two kinds of rule drop them from the commit: the package's own `.gitignore`, which travels inside the copy, and the project's. Real projects from the public registries, vendored against the repository's fixture service, committed and cloned:
16+
17+
```
18+
$ socket-patch vendor # cc 1.2.56, GitHub's Rust.gitignore in the project
19+
Vendored 1 package. # exit 0
20+
$ git status --short --ignored | grep '^!!'
21+
!! .socket/vendor/cargo/<uuid>/cc-1.2.56/Cargo.lock
22+
!! .socket/vendor/cargo/<uuid>/cc-1.2.56/src/target/
23+
$ socket-patch vendor --check # exit 0, "committed artifact and wiring verified"
24+
$ git add -A && git commit -qm vendor && git clone -q . ../clone && cd ../clone
25+
$ cargo build --locked --offline
26+
error[E0583]: file not found for module `apple` # exit 101; the vendoring checkout builds
27+
```
28+
29+
With no project rule at all, `cfg-if` 1.0.4 loses its `Cargo.lock` to the crate's own `.gitignore`: the clone builds the patched copy, `vendor --check` exits 1 (`vendor_inventory_mismatch`), `vex` exits 1 with no document, and after the printed remedy (`repair`, "then commit it") `git add -A` stages nothing. The same for Go (`go-toml/v2` v2.4.3, whose `.gitignore` has `fuzz/`) and for a plain gem (`rest-client` 2.1.0 under GitHub's `Rails.gitignore`, which has `.rspec`).
30+
31+
How common, by copying each package to its vendored path in an empty repository and asking `git ls-files -o -i --exclude-standard`: 65 of this repository's 229 crates lose a file with no project rule (63 of them `Cargo.lock`; `h2`, `http`, `bytes`, `tar` and `serde_json` are among them), and `Rust.gitignore` adds source files of `cc` and `winnow`; 4 of 59 well-known Go modules, 8 under `Go.gitignore` (`golang.org/x/net` v0.63.0 among them); 2 of 58 popular gems under `Rails.gitignore`. The class was fixed five times for other artifacts (6fa6a9e3, eca5d247, debe1c0b, 9d543028, d16c589e). The fix is the platform-gem mechanism (`<uuid>/.gitignore` with `!*`, the shipped `.gitignore` emptied, git asked about every inventory file) from one function for every tree backend; checked with real git on the `cc` tree. Agent mode is not affected: `apply --check` hashes only the patched files.
32+
33+
**New: L83, filed as #2349.** The ignore probe starts with `git rev-parse --is-inside-work-tree` and reads exit 128 as "not a work tree" (core `vendor/npm_dir.rs`, line 968). Git gives 128 as well when the checkout belongs to another user ("detected dubious ownership"), which is a root container over a bind-mounted project. Two copies of a real npm project whose `.gitignore` has `vendor/`, the second after `chown -R 1000:1000`:
34+
35+
```
36+
$ socket-patch vendor --json # own checkout: "partialFailure", vendor_artifact_gitignored, nothing written
37+
$ socket-patch vendor --json # another user's: "success", applied 1, "warnings": []
38+
$ git add -A && git commit … && git clone … && npm ci # as the owner
39+
npm error code ENOENT …/.socket/vendor/npm/<uuid>/left-pad-1.3.0.tgz # exit 254
40+
```
41+
42+
Cargo the same (exit 1 against exit 0). The contract's `vendor_artifact_gitignore_unchecked` row says a `rev-parse` error raises that warning; `vex` already warns in the same situation (core `vex/product.rs`, line 544). A file rule such as `*.tgz` is not affected, since the uuid directory's `!*` overrides it either way.
43+
44+
**New: L84, filed as #2351.** Hosted mode never asks git about the files its last line names. With `.npmrc` in `.gitignore`, a hosted npm scan writes `allow-remote=all` there, says `Commit .npmrc and package-lock.json`, exits 0 and warns of nothing about the rule; the commit holds the lock alone. npm 12.2.3, the registry's `latest`, over a lock with one tarball from another host: `EALLOWREMOTE`, exit 1, without the line, and `added 1 package` with it. With `.cargo/` ignored, a hosted Cargo scan says `Commit .cargo/config.toml, Cargo.lock, and Cargo.toml`, and in the clone every cargo command fails: `registry index was not found in any configuration: socket-patch-<uuid>`. An earlier entry (13:52Z) saw the npm line and did not file it; npm 12's refusal is what makes it a defect. Agent mode warns for its manifest (`manifest_gitignored`, #1638) and vendored mode refuses.
45+
46+
**Seen and not filed:**
47+
- **A bare `scan` from a repository root leaves a submodule or a nested checkout below it alone** and names the command for it (`nested_project_skipped`). The contract says "in the same git checkout".
48+
- **`scan --json` from a root writes nothing for a project below** and says so (`projects_not_scanned`), where the human scan rewires it. The contract's rule.
49+
- **Composer:** not run. The copy's own `.gitignore` is already emptied there, and GitHub's stock PHP rules are anchored.
50+
- **L08, L13, L14, #1970:** still to verify. They need Windows, scala-cli or Docker.
51+
52+
### Areas examined
53+
All with the binary built from `main`.
54+
55+
- **What git commits of a vendored tree**, real tools throughout: two Cargo projects (`cfg-if`, and `cc` as a build dependency), a Go project, a Bundler project, each vendored, committed, cloned, built or installed, then `vendor --check`, `vex` and `repair`. L82. The same Go module in agent mode: `apply --check` and `apply` pass in the clone.
56+
- **The survey**: 229 crates, 59 Go modules and 145 gems, each under no project rule and under GitHub's stock template (`Rust`, `Go`, `Ruby`, `Rails`), fetched from the repository of templates.
57+
- **A checkout git refuses**: npm and Cargo vendored runs with a `vendor/` rule, owned and foreign. L83.
58+
- **Hosted mode's companion files under an ignore rule**: `.npmrc` and `.cargo/`, through scan, commit, clone and the real tool. L84.
59+
- **Six checkout shapes in hosted mode**, for npm, pnpm, Cargo, Go, pip and Bundler on the bench: a plain checkout, a linked worktree, a subdirectory of a repository, a subdirectory of a linked worktree, a submodule, and a nested checkout. Six commands in the project directory and five from the repository root (60 shape runs). In the project directory every shape gives the plain one's exit codes, streams and files, but for the VEX document's random `@id`. From a root, a worktree behaves as its repository and a submodule as a nested checkout. `vex` reads the same product from `origin` in a worktree as in the main checkout.
60+
- Read: `utils/repo_root.rs` (a `.git` file, the home rule and `GIT_CEILING_DIRECTORIES` are each handled, and tested), and two walks that look for `.git` themselves, vlt's project root and the Hatch workspace lookup, which model their tools.
61+
- Not run: Composer, vendored mode in the six shapes, Windows, and the patch service itself, whose artifacts the fixture stands in for.
62+
63+
### Lessons
64+
- **After "commit", ask git before cloning.** `git status --short --ignored` right after the run showed L82 in one line. The repository's own fresh-checkout tests copy a hand-picked list of files to a new directory, so they answer for a commit git never makes; a clone answers for the real one.
65+
- **Put the ecosystem's stock GitHub template in the fixture.** `https://raw.githubusercontent.com/github/gitignore/main/<Name>.gitignore` is reachable. `target`, `debug`, `*.test`, `*.out` and `.rspec` are names packages use too.
66+
- **A survey turns one case into a rate.** `survey.py` copies each package directory to its vendored path in an empty repository, optionally with a template beside it, and lists what git ignores: 80 lines, two minutes for 229 crates. Do it before picking the package for the transcript; it named `cc`.
67+
- **A package's own ignore file travels with it.** A crate's `.gitignore` names `Cargo.lock`, and `cargo package` adds a `Cargo.lock` the repository never tracked. Upstream never sees the conflict; a copy inside another repository does.
68+
- **The registry cache is not pristine.** `~/.cargo/registry/src/…/cfg-if-1.0.4` held a `target/` directory from an earlier build, and the fixture service packs whatever is there. Build the project under a private `CARGO_HOME` and `GOMODCACHE`.
69+
- **Exit 128 is two answers.** "Not a repository" and "I refuse this repository" share it. `GIT_TEST_ASSUME_DIFFERENT_OWNER=1` makes real git refuse without `chown`; as root, `chown -R 1000` does it for a whole tree, and uid 1000 cannot enter the scratch directory, so commit as root after chowning back.
70+
- **Ask the registry what `latest` is before calling a refusal hypothetical.** `npm view npm dist-tags` says 12.2.3, and `npx -y npm@12.2.3 ci` runs here. The bench's packages are not on the registry, so the proof of npm's side is a real package whose lock entry points at a local file server.
71+
- **The bench's line is an environment for any tool.** `toolin.py <pm> <dir> <argv>` runs cargo or node under it (add `RUSTUP_HOME` and `RUSTUP_TOOLCHAIN`: its `HOME` is empty). `shapes.py <pm>` builds the six shapes from a pristine copy of the bench project and prints where each differs from the plain one.
72+
- The hunt took about 33 minutes of wall time: the builds 5 (the CLI, the fixture service and the bench, in the background), the surveys 6, the vendored transcripts 8, the shapes 5, the refused checkout 3, hosted mode 4, the three write-ups the rest.
73+
- The register was at 11,938 characters and is at 11,975. L82 to L84 joined the `filed` row, the two areas one phrase of the Areas row, and the recipes line three pointers. To make room, four notes are shorter.
74+
- The owner was notified at 23:16Z of #2348, and of #2351 and #2349 at the end of the run.
75+
76+
### Needs a person
77+
- **#2348:** a vendored Cargo, Go or gem directory is committed without the files a `.gitignore` matches. It asks nothing; the fix follows the platform-gem backend. One caveat is stated in it: the artifacts came from the repository's fixture service.
78+
- **#2351:** a hosted scan says to commit `.npmrc` or `.cargo/config.toml` when git ignores it. It proposes a warning.
79+
- **#2349:** the ignore check is silent when git refuses the checkout. It proposes the warning the contract already names.
80+
- **Review #2261, #2265 and #2267.** This is the thirty-fourth run in a row that could only verify leads.
81+
- **#2270** still blocks `ci-ok` on every PR; #2280 is open for it.
82+
- **#2347, #2340, #2309, #2277 and #2297 need an answer.** **#2299** and **#2315** each ask which of two fixes a maintainer prefers.
83+
- Forty-six confirmed problems wait for a slot, in the order the register's "Next PR" line gives.

0 commit comments

Comments
 (0)