|
| 1 | +[agent] 2026-12-01: architecture refactor |
| 2 | + |
| 3 | +**`main`:** 1b3f422. The run started at 04:56Z. |
| 4 | + |
| 5 | +### Chosen |
| 6 | +**#2382 (lead L107): `vendor --check` and `vex` call a vendored pnpm package patched when no file the project's pnpm reads declares its override.** It was the next in the register's queue after #2378 and is triaged `priority:p1`: a false `not_affected`, on a tree whose every frozen install fails and whose plain install puts the upstream package back. |
| 7 | + |
| 8 | +Two routine PRs were open at the start: #2390 (ready, no review yet) and #2393, which another run still held (`in-progress`, heartbeat 6 minutes old), so it was left alone. That left one slot. No maintainer has commented on the discussion. #2382 carried no claim, and none of its files are in #2390, #2392 or #2393. |
| 9 | + |
| 10 | +### Evidence on `main` |
| 11 | +The issue's test still fails on 1b3f422: `(vendor --check exit code, not_affected statements)` is `(0, 1)` where `(1, 0)` is right. Real pnpm, `left-pad` 1.3.0, the tree `vendor` wrote and the override taken out of one place; `main` verifies and attests every row: |
| 12 | + |
| 13 | +| pnpm | Override declared in | Frozen install | Plain install | |
| 14 | +|---|---|---|---| |
| 15 | +| 8.15.9, 9.15.9 | nowhere | `ERR_PNPM_LOCKFILE_CONFIG_MISMATCH` | upstream, lock unwired | |
| 16 | +| 9.15.9, 10.2.0, 10.4.1, 10.5.0 | `pnpm-workspace.yaml` only | the same | upstream | |
| 17 | +| 10.5.1, 10.28.0 | nowhere | the same | upstream | |
| 18 | +| 10.28.0 | the workspace file, beside a `pnpm.overrides` table of the project's own | the same | upstream | |
| 19 | +| 11.29.0, 12.23.0 | `package.json` only | the same | upstream | |
| 20 | + |
| 21 | +### PR |
| 22 | +**#2396, ready, awaiting review.** One rule in core pnpm discovery, which `vex` and `vendor --check` both read: a vendored entry of the root lock is a reference only while each override the lock records for its artifact is declared where the project's pnpm reads it. An undeclared entry is `patched_ref_invalid` with the file and the remedy, stays wiring to the prune GC, and `vendor --check` fails it as `wiring incomplete`. 8 files, +1420 −43: production +519 −43, tests +875, docs +26. Bugbot was requested and CI was still running when this was written (59 passed, 0 failed, 26 pending at 07:06Z); the final message of the run and the PR carry the outcome. |
| 23 | + |
| 24 | +What real pnpm reads, as measured for the PR: |
| 25 | + |
| 26 | +- older than 10.5.1 (8.15.9, 9.15.9, 10.2.0, 10.4.1, 10.5.0): `package.json` alone; |
| 27 | +- 10.5.1 to 10.x (10.5.1, 10.5.2, 10.6.0, 10.9.0, 10.13.1, 10.20.0, 10.28.0): `package.json` when it declares any override, else `pnpm-workspace.yaml`; |
| 28 | +- 11 and newer (11.29.0, 12.23.0): the workspace file alone; |
| 29 | +- `package.json` declares `pnpm.overrides` over the top-level `resolutions` (9.15.9 and 10.28.0 read `resolutions`, 11.29.0 does not), and an empty table declares nothing (10.5.1, 10.28.0). |
| 30 | + |
| 31 | +With the branch, 22 trees on those releases, each pinned by `packageManager`: the two commands agree with real pnpm on every one, and wherever the message says to re-run `vendor`, the re-run restored the declaration and real pnpm installed the patched copy. |
| 32 | + |
| 33 | +The first version of the fix was wrong in ways only the review and real pnpm showed. It went by pnpm major, as the lock-off reader does. Three passes of `/code-review high` then found, and real pnpm or the binary confirmed: |
| 34 | + |
| 35 | +1. pnpm 10.0 to 10.5.0 read `package.json` alone (the code's "10.5" boundary is 10.5.1), and a `pnpm.overrides` table hides the workspace file on pnpm 10; three messages were wrong. |
| 36 | +2. An install record in `node_modules` decided alone, so one checkout failed what CI verified; pins that disagree accepted a file neither pnpm reads; `resolutions`; the empty table. |
| 37 | +3. A "re-run `vendor`" remedy that cannot work beside a `resolutions` table (real 10.28.0: the re-run is idle); an empty inline `overrides: {}` switched the check off; an unreadable file read as "declares nothing". |
| 38 | + |
| 39 | +The rule now sits beside the other pin readers at release precision, reads committed pins only, and its remedy asks the writer's own predicate. Two findings were left, with the reason in the PR: a declared override is matched by its artifact rather than its spelling (not measured), and an unserved newer patch now reports `vendor_prebuilt_required` over such an entry where it said "kept the vendored patch". |
| 40 | + |
| 41 | +Verified here: CI's clippy command is clean; core lib 8669 passed; CLI lib 1083; `vendor_pnpm_override_e2e` (new), `cli`, `in_process_vendor`, `scan`, `rollback`, `remove`, `e2e_vex*`, `e2e_vendor_pnpm_build` and 16 more suites passed; `in_process_redirect` has its 3 root-only chmod failures, as on `main`. |
| 42 | + |
| 43 | +`CLI_CONTRACT.md` is not touched (#2390 and #2392 change it); the PR gives the sentence for its pnpm lock row, and `docs/ecosystems.md` has the rule. |
| 44 | + |
| 45 | +### Leads and issues |
| 46 | +- **L107 / #2382:** confirmed on 1b3f422 and in PR #2396. |
| 47 | +- **L119, new, confirmed, on #2382 (its comment): `vendor` does not restore a `package.json` override while the workspace file carries one the lock records.** pnpm 9.15.9, 10.2.0, 10.4.1 and 10.5.0 with the override in the workspace file only, and 10.28.0 beside a `resolutions` entry of the project's own: `socket-patch vendor` prints "already vendored; nothing to do" and the frozen install still fails. The writer's `workspace_overrides_govern` reads the lock's record of a workspace key as "this pnpm reads the workspace file", which its own surgery makes true on any pnpm. A plain fix (never skip under a pre-10.5.1 pin) would write a table that replaces a user's workspace overrides when the pin is stale, so it needs the committed pins in the writer. #2396's message gives the entry to add by hand; `vendor --revert` then `vendor` also repairs it. |
| 48 | +- **L120, new, confirmed, on #2382 (its comment): `vendor --dry-run` previews "already vendored" over a tree whose wet run rewrites the declaration.** Its JSON holds `skipped` / `already_vendored`. The pnpm preview does not read the override maps. |
| 49 | +- **L121, new, to verify (read, not run): the lock-off reader goes by major.** `PnpmLockOff::routes` accepts a workspace override for every pnpm 10, so with pnpm's `lockfile` setting off a pinned 10.4.1, or a 10.28 beside a `pnpm.overrides` table, would be attested from a file that pnpm does not read. |
| 50 | +- **L122, new, to verify (read, not run): hosted mode's registry route** writes `overrides:` to the lock and the workspace file, and its references are not checked against the declaration. |
| 51 | +- **L123, new, to verify (read, not run): an override respelled by hand** (`file:./.socket/…` for `file:.socket/…`) still verifies, because the check compares artifacts; whether pnpm compares the strings was not measured. |
| 52 | +- **Seen, not filed:** the code and the contract say pnpm reads workspace overrides "from 10.5"; real 10.5.0 does not, 10.5.1 does. #2396 corrects the one comment it touches. |
| 53 | + |
| 54 | +### Areas examined |
| 55 | +- **Vendored pnpm override declarations**, with the built binary and real pnpm 8.15.9, 9.15.9, 10.2.0, 10.4.1, 10.5.0, 10.5.1, 10.5.2, 10.6.0, 10.9.0, 10.13.1, 10.20.0, 10.28.0, 11.29.0 and 12.23.0: the override in each file, in neither, beside a table or a `resolutions` of the project's own, an empty table; `vendor --check`, `vex`, a wet and a dry `vendor`, `vendor --revert`, `list`, `rollback`, `remove` and `repair` over the broken tree (the last six print the same as `main`). |
| 56 | + |
| 57 | +### Lessons |
| 58 | +- **A rule about another tool needs that tool at each boundary, not at each major.** Five releases looked like enough until 10.4.1 and 10.5.0 behaved like 9. Bisect the minor (and the patch) where the code states a boundary. |
| 59 | +- **Three review passes each found real defects, and nearly every one was a measurable claim.** Run the finding before fixing it: the measurements moved the fix (10.5.1, not 10.5; `resolutions`; the idle re-run). Budget the passes: they took a third of the run. |
| 60 | +- **A verdict should read committed files only.** The install record made the same commit pass in CI and fail on a laptop. |
| 61 | +- **A remedy is part of the fix.** "Re-run vendor" was false in one case; the message now asks the writer's own predicate. |
| 62 | +- **The directory runner works for any real package manager**: a throwaway ignored test with `Server::project_with_env(<dir>)`, a copy of each binary outside `target/`, and one script per row that prints the tool's verdict beside the real install. |
0 commit comments