Skip to content

Commit 4ce496e

Browse files
committed
yarn-classic: run 48 ledger (filed #2341)
1 parent b88df48 commit 4ce496e

3 files changed

Lines changed: 45 additions & 17 deletions

File tree

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[agent] 2026-11-28: Yarn classic (1.x) bug-hunt run
2+
3+
Run 48. Tested main `cfc870f` (the same SHA as run 47) against release v5.1.0, on Linux with Node 22 and yarn 1.7.0, 1.9.4, 1.10.1 and 1.22.22. The local mock patch API was rebuilt (see known-non-bugs "Run-48 harness"). Every result below is the same on v5.1.0, so there are no regressions.
4+
5+
**Re-triage:** the only open `pm:yarn-classic` issue was #691, which is `agent:needs-human`, so it was skipped.
6+
7+
**Filed:** #2341 (https://github.com/SocketDev/socket-patch/issues/2341). Standalone `vex` in a hosted project whose only pin is withheld (a git or `file:` copy installs beside it) says "no hosted or vendored patch references were found … Run `socket-patch scan` first" (`manifest_not_found`, exit 2). Re-running scan loops. `scan --vex` and the vendored version of the same shape correctly say `no_applicable_patches` / "No applied patches …" (exit 1). It's friction, not a wrong attestation, and it's the same on v5.1.0.
8+
9+
**Cells:** each one is a fresh-checkout frozen install on a cold cache, a check that the patched bytes load, `vex`, rollback and a second frozen install.
10+
- Common path H/V/A on 1.7.0, 1.10.1 and 1.22.22: pass. H/V on 1.9.4 (a lock without `integrity`): pass.
11+
- Git dep (alone, and as a member git copy beside a registry block) in H/V/A: pass. H skips with `redirect_yarn_classic_git_skipped`, and V refuses `vendor_lock_entry_not_rewritable` (exit 1) when git is the only copy. VEX withholds as the contract says.
12+
- `file:` dir and `file:` tarball member copies beside a registry block, H/V: pass (`redirect_yarn_classic_directory_skipped` / `_non_registry_entry_skipped`, `vendor_link_entry_skipped`).
13+
- An `integrity sha1-…` lock, and a `resolved` without a `#sha1` fragment, H/V: pass. Hosted rollback writes the registry's canonical `sha512` and `#sha1` back, and the frozen install still passes (known class).
14+
- `yarn upgrade left-pad` / `yarn add left-pad@1.3.0` after H/V drop the pin, and socket-patch fails closed: `vendor --check` exits 1 with a working remedy, and `vex` omits the package. `yarn add left-pad@^1.3.0` keeps the pin.
15+
- Offline mirror in user `~/.yarnrc`, project `.npmrc` and `YARN_YARN_OFFLINE_MIRROR`: hosted refuses `redirect_yarn_classic_offline_mirror` in all three. Agent mode with a project mirror plus pruning: pass, and the mirror tarball isn't touched.
16+
- Global `-g`: hosted refuses `global_scope_unsupported` (exit 2). Agent applies and rolls back: pass.
17+
- SIGKILL sweep of vendored and hosted `scan` (kills at 20–500 ms): the project is either untouched or fully wired. No dangling vendor paths, and the frozen install and re-scan recover every time.
18+
19+
**Backlog 1 resolved:** a hosted re-run reporting `applied` is family-wide (npm and pnpm do it too) and is handled by open PR #2307 (`details.pinChanged`). Nothing was filed or handed over.
20+
21+
**Ruled out:** hosted rollback on a `.yarnrc` `registry` restores registry.yarnpkg.com (already a known non-bug, documented: `SOCKET_NPM_REGISTRY`).
22+
23+
**Next:** merge flows (two branches), BOM/CRLF with a git copy, and `vex --grype-config`.

‎known-non-bugs/yarn-classic.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,3 +142,8 @@ entries/yarn-classic/20261017T041837Z-from-bun.md
142142
entries/yarn-classic/20261017T080000Z.md
143143
- Run-47 harness (2026-11-26): `scratchpad/bin/mock.py <fx> 18080` (python stdlib mock of batch / by-package / view / blob / patches/package / hosted tarball for left-pad@1.3.0, patched tarball built from the registry tgz), `cp.sh <bin> <yarn> <mode> <dir> <shape>` (shapes single / ws / crlf / bom / alias / aliasboth / res), `batch.sh`, `switch.sh` (re-runs + mode switches), `mirror.sh`. Pass `--patch-server-url` = the mock so hosted pins are recognised; vendored mode uses the same `patches/package` grant. Yarn releases from `registry.yarnpkg.com/yarn/-/yarn-<v>.tgz`, run with `node <dir>/bin/yarn.js`.
144144
- Hosted `scan` with an offline mirror refuses (`redirect_unconfirmed` + `redirect_yarn_classic_offline_mirror`); a following `rollback` exits 1 "Manifest not found" because there is nothing to roll back. Expected (run 47).
145+
- Run-48 harness (2026-11-28): `scratchpad/bin/mock.py <fx> 18080` (org routes batch / by-package / view with blobContent / blob / patches/package grant with sha1 + sha512 / hosted tgz, the same shape as `e2e_redirect_yarn_classic_build.rs`), `mkfx.py` (builds the patched tgz from the registry left-pad 1.3.0), `cp.sh`, `git.sh`, `file.sh`, `sha1lock.sh`, `nofrag.sh`, `upg.sh`, `kill.sh`, `batch.sh <bin> <tag>`. Git over https to github.com works in the sandbox; codeload.github.com is 403.
146+
- A hosted re-run that changes nothing reports `applied` in npm, pnpm and yarn alike. It's a family-wide design, handled by PR #2307 (`details.pinChanged`), so don't file it (run 48).
147+
- Hosted rollback of a lock with `integrity sha1-…`, or a `resolved` without a `#sha1` fragment, writes the registry's canonical `sha512` / `#sha1` back. The frozen install passes; it's the same class as the < 1.10 `integrity` note (run 48).
148+
- `yarn upgrade <pkg>` and an exact-version `yarn add` re-resolve a pinned or vendored block from the registry. That's yarn's own behavior, and socket-patch fails closed: `vendor --check` exits 1 "wiring missing … re-run `socket-patch vendor`", and vex omits the package (`vendor_unwired`) or exits 2 for hosted (run 48).
149+
- Vendored `scan` exits 1 with `vendor_lock_entry_not_rewritable` when the only yarn.lock copy is a git dep. Hosted exits 0 with `redirect_yarn_classic_git_skipped`. Both are documented (run 48).

‎state/yarn-classic.md‎

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,39 @@
11
[agent] Progress ledger for the scheduled Yarn classic (1.x) bug-hunt routine (label pm:yarn-classic).
22

3-
Last run: 2026-11-26 (run 47), main `cfc870f`, release v5.1.0, newest yarn classic 1.22.22 (no 1.x release since). Open `pm:yarn-classic` issues: #691 only (`agent:needs-human`). Compacted this run: the old 82 KB state (per-run cells, harness notes, non-bugs) is in branch history before this commit; non-bugs and harness notes moved to `known-non-bugs/yarn-classic.md`.
3+
Last run: 2026-11-28 (run 48), main `cfc870f`, release v5.1.0, newest yarn classic 1.22.22 (no 1.x release since). Open `pm:yarn-classic` issues: #691 (`agent:needs-human`), #2341 (filed run 48).
44

55
## Coverage matrix
66

77
H = hosted (`scan --mode hosted`), V = vendored (`scan --mode vendored`), A = agent (`scan --mode agent`, then `apply` after each fresh install; `setup` was removed in v5). Every cell runs: install, scan, fresh-checkout `yarn install --frozen-lockfile` on a cold cache, patched bytes loaded, `vex -O` attests `not_affected` naming `pkg:npm/left-pad@1.3.0`, `rollback`, then another fresh frozen install (unpatched). Local mock patch API (see known-non-bugs "Run-47 harness"). Linux only (probe workflows are switched off). CI's `yarn-classic-matrix` (1.0.2, 1.6.0, 1.7.0, 1.9.4, 1.10.1, 1.22.22) is green on the 2026-11-25 and 11-26 nightlies.
88

99
| workflow | H | V | A |
1010
| --- | --- | --- | --- |
11-
| Single dep, common path | pass 1.0.2 / 1.7.0 / 1.10.1 / 1.22.22 (2026-11-26; < 1.10 rollback adds `integrity`, known) | pass 1.7.0 / 1.10.1 / 1.22.22 (2026-11-26); 1.0.2: yarn ≤ 1.6 installs nothing (known limitation) | pass 1.0.2 / 1.7.0 / 1.10.1 / 1.22.22 (2026-11-26) |
11+
| Single dep, common path | pass 1.7.0 / 1.9.4 / 1.10.1 / 1.22.22 (2026-11-28), 1.0.2 (2026-11-26; < 1.10 rollback adds `integrity`, known) | pass 1.7.0 / 1.9.4 / 1.10.1 / 1.22.22 (2026-11-28); 1.0.2: yarn ≤ 1.6 installs nothing (known limitation) | pass 1.7.0 / 1.10.1 / 1.22.22 (2026-11-28), 1.0.2 (2026-11-26) |
1212
| Workspaces (`^1.3.0` + `1.3.0` merged block) | pass 1.7.0 / 1.10.1 / 1.22.22 (2026-11-26) | pass 1.7.0 / 1.10.1 / 1.22.22 (2026-11-26); member-dir install: #691 | pass 1.22.22 (2026-11-26) |
1313
| CRLF yarn.lock | pass 1.7.0 / 1.10.1 / 1.22.22 (2026-11-26) | pass 1.7.0 / 1.10.1 / 1.22.22 (2026-11-26) | pass 1.22.22 (2026-11-26) |
1414
| BOM yarn.lock | pass 1.22.22 (2026-11-26) | pass 1.22.22 (2026-11-26) | pass 1.22.22 (2026-11-26) |
1515
| `resolutions` forcing the patched version | pass 1.7.0 / 1.10.1 / 1.22.22 (2026-11-26) | pass 1.7.0 / 1.10.1 / 1.22.22 (2026-11-26) | pass 1.22.22 (2026-11-26) |
1616
| `npm:` alias (alias only / alias + direct) | refused `redirect_yarn_classic_alias_skipped`, vex omits (documented) 1.22.22 (2026-11-26) | pass 1.22.22 (2026-11-26) | pass 1.22.22 (2026-11-26) |
17-
| Offline mirror (`.yarnrc`, pruning) + `yarn add` + rollback | refused `redirect_yarn_classic_offline_mirror` 1.10.1 / 1.22.22 (2026-11-26) | pass 1.10.1 / 1.22.22 (2026-11-26) | untested |
18-
| Re-run idempotency + mode switch H→V→A→H→rollback | pass 1.22.22 (2026-11-26; re-run reports `applied`, see backlog 1) | pass 1.22.22 (2026-11-26) | pass (keeps vendored ownership) 1.22.22 (2026-11-26) |
17+
| Offline mirror (`.yarnrc`, user `~/.yarnrc`, `.npmrc`, env; pruning) + `yarn add` + rollback | refused `redirect_yarn_classic_offline_mirror` in all four 1.22.22 (2026-11-28) | pass 1.10.1 / 1.22.22 (2026-11-26) | pass 1.22.22 (2026-11-28) |
18+
| Re-run idempotency + mode switch H→V→A→H→rollback | pass 1.22.22 (2026-11-26; re-run reports `applied`, family-wide, PR #2307) | pass 1.22.22 (2026-11-26) | pass (keeps vendored ownership) 1.22.22 (2026-11-26) |
1919
| `get <name>` / `list` / `remove <name>` | pass 1.22.22 (2026-11-26) | pass 1.22.22 (2026-11-26) | pass 1.22.22 (2026-11-26) |
20-
| git dep (`git+…`) | untested since 11-11 (last pass run 20; needs github.com) | untested since 11-11 | untested since 11-11 |
20+
| git dep (alone / member git copy beside registry) | pass, skips `redirect_yarn_classic_git_skipped` 1.22.22 (2026-11-28); standalone vex remedy: #2341 | pass (git-only refuses `vendor_lock_entry_not_rewritable`) 1.22.22 (2026-11-28) | pass 1.22.22 (2026-11-28) |
2121
| Merge flows (two branches vendor / pin) | untested since 11-11 (runs 44–45 pass) | untested since 11-11 (#1610 fixed) | n/a |
22-
| Global (`-g`) | untested since 11-11 | refused (documented) | untested since 11-11 |
23-
| `file:` copies (dir, renamed, tarball, backslash) | untested since 11-11 (run 45 pass) | untested since 11-11 | n/a |
24-
| Interrupted runs (SIGKILL) | untested since 11-11 (run 42 pass) | untested since 11-11 | untested since 11-11 |
22+
| Global (`-g`) | refused `global_scope_unsupported` 1.22.22 (2026-11-28) | refused (documented) | pass 1.22.22 (2026-11-28) |
23+
| `file:` copies (dir, tarball) beside registry | pass 1.22.22 (2026-11-28); standalone vex remedy: #2341 | pass 1.22.22 (2026-11-28) | n/a |
24+
| Interrupted runs (SIGKILL 20–500 ms) | pass 1.22.22 (2026-11-28) | pass 1.22.22 (2026-11-28) | untested since 11-11 |
25+
| `sha1-` integrity / `resolved` without `#sha1` / `yarn upgrade` after pin | pass 1.22.22 (2026-11-28; rollback writes canonical sha512 / #sha1) | pass 1.22.22 (2026-11-28; upgrade drop caught by `vendor --check`) | n/a |
2526
| macOS / Windows | probes off; last results in history (run 31 / 18) | same | same |
2627

2728
## Backlog
2829

29-
1. Hosted re-run that changes nothing reports `applied: 1` (event `applied`, mode hosted, lock byte-identical), while vendored says `skipped already_vendored`. Same on v5.1.0. Since #2178 telemetry is derived from these events, so hosted pin counts may inflate. Check npm / pnpm hosted re-runs; if it's family-wide, hand it over to npm (not yarn-specific), else file.
30-
2. Re-run the untested-since-11-11 rows above: git dep (H/V), merge flows, global `-g`, `file:` copies, SIGKILL.
31-
3. Offline mirror in agent mode; user-level / env mirror refusal on main (#1013 / #1078 shapes); workspace member `.yarnrc` mirror (#1115 fixed).
32-
4. `yarn upgrade left-pad` / `yarn add left-pad@^1.3.0` after vendored and hosted (does the pin or the vendored block survive, and does `vendor --check` notice?).
33-
5. `integrity sha1-` locks and 1.9.4 (no `integrity` line) on main, H/V.
34-
6. Friction: `vex` in a project whose only pin is skipped (alias + direct) says "No patches in this project … Run `socket-patch scan` first" (exit 2) right after a scan that pinned one copy. Decide whether that remedy misleads enough to file.
35-
7. Yarn ≤ 1.6 vendored installs nothing (exit 0) and `vex` still attests from the lock. Known yarn limitation, not in user docs. Ask whether vendored mode should warn when `packageManager` names yarn ≤ 1.6.
36-
8. #691 (`agent:needs-human`): leave alone unless a maintainer comments.
37-
9. New on main: `vex --grype-config` with a yarn project (needs grype; generic, low priority).
30+
1. Merge flows (two branches each vendoring or pinning), untested since 11-11 (runs 44–45 pass).
31+
2. CRLF / BOM lock combined with a git or `file:` copy and a workspace, H/V.
32+
3. #2341 follow-up: check whether npm or pnpm hosted shapes that withhold every reference give the same `manifest_not_found` vex remedy. If they do, comment on #2341 instead of filing.
33+
4. Agent-mode SIGKILL during `apply`, and `repair` after it.
34+
5. Yarn ≤ 1.6 vendored installs nothing (exit 0) while `vex` still attests from the lock. This is a known yarn limitation but not in the user docs. Decide whether vendored mode should warn when `packageManager` names yarn ≤ 1.6.
35+
6. `vex --grype-config` with a yarn project (needs grype; generic, low priority).
36+
7. #691 (`agent:needs-human`): leave it alone unless a maintainer comments.
3837

3938
## Known non-bugs
4039

@@ -47,4 +46,5 @@ Full list: `known-non-bugs/yarn-classic.md` (search it with `git grep`). The one
4746
- npm 7+ `npm install` in a yarn 1 project rewrites yarn.lock, so the frozen install still passes (#1629 context).
4847
- yarn 1 `workspaces` ignore `!` patterns.
4948
- Lock / ledger mixed merges fail closed (`vendor --check` / `rollback` exit 1); the remedy loop is the #1072 / #991 class.
49+
- `yarn upgrade <pkg>` / an exact `yarn add <pkg>@<ver>` re-resolve and drop a hosted or vendored pin. socket-patch fails closed (`vendor --check` exit 1, vex omits).
5050
- `vex --json` needs `--output`; `setup` and `scan --apply` were removed in v5 (use `--mode agent` + `apply`).

0 commit comments

Comments
 (0)