Skip to content

Commit 3b63926

Browse files
committed
poetry: run 26 ledger (#1615, #1589 comment, pip/pdm handovers)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wd4D6vU9pXySjX9VdmHiLu
1 parent 70de509 commit 3b63926

4 files changed

Lines changed: 91 additions & 10 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[agent] 2026-10-16: handover from the Poetry bug-hunt routine (#311): a lock re-render by another tool version makes vendored revert drift-keep forever (Poetry: #1615); please check the PDM side
2+
3+
I filed #1615 for Poetry. Vendored wiring is reverted by `revert_lock_fragment_splice[_atomic]` (`crates/socket-patch-core/src/vendor/common.rs:805`), which needs the recorded `[[package]]` fragment verbatim. Poetry 1.8 → 2.x re-locks re-render each unit (they add `groups = ["main"]`) while keeping the vendored source and hash. After that, `vendor --revert` drift-keeps with exit 0, `rollback` / `remove` exit 1, and re-vendoring is a no-op ("already vendored").
4+
5+
PDM goes through the same splice (`revert_lock_fragment_splice`, the non-atomic flavor). Worth trying: vendor with an older PDM, then `pdm lock --refresh` (or `pdm lock` keeping the pin) with a newer PDM whose `pdm.lock` renders a package unit differently (e.g. `groups` / `marker` / `files` layout changes across 2.x minors), then `vendor --revert`, `rollback` and `remove`. Your ledger says `pdm lock --refresh` keeps the vendored pin, so this may be reachable there too.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[agent] 2026-10-16: handover from the Poetry bug-hunt routine (#311): vendored `--revert` of a PEP 751 `pylock.toml` drops comment lines inside `[[packages]]` entries when two or more packages in that pylock were vendored
2+
3+
Found while testing poetry-plugin-export `pylock.toml` exports on main `657fce2`. The pylock lane is shared (pip / uv), so I'm handing it over rather than filing it under `pm:poetry`.
4+
5+
- Setup: `poetry export -f pylock.toml` (poetry-plugin-export 1.10.1, Poetry 2.5.1) writes `# requires-python = ">=2.7,<3.0 || >=3.3"` inside the six entry. Add any other comment line inside a second entry (idna).
6+
- `socket-patch scan --mode vendored --yes` wires both six and idna in `pylock.toml` (`poetry.lock` stays upstream, the documented PEP 751 precedence), then `socket-patch vendor --revert --yes`.
7+
- Result (2/2): `Reverted 2 vendored packages`, but `git diff` shows both comment lines deleted. The rest of the file is byte-identical.
8+
- Control: with only one package vendored in that pylock (six only), `--revert` is byte-identical and keeps the comment.
9+
- `poetry.lock` with comments inside two vendored units reverts byte-identical, so this is pylock-lane only.
10+
- Impact: cosmetic (comments only), but it breaks the byte-identical revert that single-package reverts give. Not filed by me.
11+
12+
Also cosmetic: with several pylocks (`pylock.toml` for `--with dev`, `pylock.test.toml` for `--with test`), hosted warns `redirect_uv_entry_not_found` ("No pylock.test.toml archive entry for idna@3.7") for every package a given pylock deliberately doesn't list. Vendored prints the same "wiring pylock.test.toml, pylock.toml" warning for each package, even one that only one of them pins.

‎entries/poetry/20261016T202635Z.md‎

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
[agent] 2026-10-16: Poetry bug-hunt run
2+
3+
**Tested:** main `657fce2` (unchanged since run 24), latest release **v5.0.1** (npm `@socketsecurity/socket-patch@5.0.1`, used as the regression baseline). Linux only, with real Poetry 1.0.10, 1.8.5, 2.4.3 and 2.5.1 (+ poetry-plugin-export 1.10.1), against a rebuilt local mock of the patch API. The mock serves patched copies of the real six 1.16.0, idna 3.7 and attrs 23.2.0 wheels, with hosted grants (sha256 + sha512), agent view/blob routes and a PyPI JSON forwarder.
4+
5+
## Re-triage
6+
7+
- **#450** (open): not re-run. Main is byte-for-byte the build that run 25 confirmed it on.
8+
- No other open `bughunt` + `pm:poetry` issues. (#1114 is `arch-audit`, not mine.)
9+
10+
## Cells (Linux, main `657fce2`)
11+
12+
| Poetry | Cell | Result |
13+
| --- | --- | --- |
14+
| 2.5.1 + export plugin | `pylock.toml` (`--with dev`) + `pylock.test.toml` (`--with test`) + `poetry.lock`, 3 patched packages: hosted scan, `poetry install --with test`, `uv pip install -r pylock.test.toml`, vex | pass (all patched, 3 statements) |
15+
| same | hosted rollback | refused, `hosted_restore_refused` (every registry package in each pylock is hosted, so no sibling evidence; Known non-bugs) |
16+
| same | vendored: both pylocks wired, `poetry.lock` upstream (`pypi_multiple_lockfiles`), uv install patched, `--check` "wiring contested" | documented precedence |
17+
| same | vendored `--revert` with ≥ 2 packages vendored in one pylock | comment lines inside `[[packages]]` dropped (single package: byte-identical; `poetry.lock`: byte-identical). Handed over to pip |
18+
| 1.0.10 | 10 hand-edited lock 1.0 `[metadata.files]` shapes (populated, CRLF, inline, no EOL, comment in array, quoted key, six-first, no trailing comma, wheel-only, blank line in array) × hosted / vendored: fresh `poetry install` (pip 22.2.2), revert | pass 20/20 (installs patched; vendored `--revert` byte-identical; hosted rollback re-renders 7 shapes canonically, documented) |
19+
| 1.0.10, 2.5.1 | Vendored in a project path with `#`, `%20`, `;` | pass, except `;` on Poetry 1.0 (pip parses `;` as a marker: Known non-bugs) |
20+
| 2.5.1, 1.8.5 | VEX product for a non-canonical PEP 440 version (`1.0.0-beta.1`, `-rc.2`, `RC1`, `2026.01.05`, `-post.1`, `-dev.3`, `+Local.Build`), `[tool.poetry]` and PEP 621 | **fail**: raw version in the product purl while Poetry builds/installs the normalized one. Covered by #1589 (uv); commented with the Poetry evidence |
21+
| 2.5.1 | Two-package hosted: `list`, `repair`, `remove six`, `sync`, vex, rollback | pass (lock byte-identical after rollback) |
22+
| 1.8.5 → 2.5.1, 1.8.5 → 2.4.3, 2.5.1 → 1.8.5 | **Vendored, then `poetry lock` with another Poetry major**: `vendor --revert`, `rollback`, `remove`, re-vendor, vendored → hosted takeover | **fail #1615**: drift-keep forever (`--revert` exit 0, rollback/remove exit 1, re-vendor no-op, takeover kept vendored). 2/2 on main, 2/2 on v5.0.1 |
23+
| 2.5.1 → 2.5.1, 1.8.5 → 1.8.5 | same, same-version relock | pass |
24+
| 1.8.5 → 2.5.1 | Hosted, then re-lock with 2.5.1: install, vex, rollback | pass |
25+
| macOS / Windows | anything | blocked: deleting `bughunt/poetry/*` is still denied, so no probes were pushed |
26+
27+
## Issues
28+
29+
- Filed **#1615**: vendored Poetry patches can't be reverted after a re-lock with another Poetry major. https://github.com/SocketDev/socket-patch/issues/1615 (plus one comment on the takeover path)
30+
- Commented on **#1589** (VEX product version not PEP 440-normalized) with the Poetry `[tool.poetry]` / PEP 621 evidence on 1.8.5 and 2.5.1. https://github.com/SocketDev/socket-patch/issues/1589#issuecomment-6223957809
31+
- Handovers: `entries/pip/20261016T202635Z-from-poetry.md` (pylock comment loss on multi-package revert, multi-pylock warning noise); `entries/pdm/20261016T202635Z-from-poetry.md` (same splice revert, check the PDM re-render).
32+
33+
## False positives ruled out
34+
35+
- `;` in the project path breaks Poetry 1.0 vendored installs: pip parses the absolute wheel path as `requirement; marker`. Any path dependency in such a directory fails the same way, and Poetry ≥ 1.2 (installer, no pip) is fine.
36+
- `list --json` "empty": my parser read `patches`; the envelope uses `events[].action = discovered`. `list` is correct.
37+
- Hosted rollback refusing for multi-pylock exports: documented `hosted_restore_refused` (no sibling registry package).
38+
39+
## Next
40+
41+
1. Re-check #1615, #1589 and #450 once fixed.
42+
2. #1615 on legacy formats: vendored with Poetry 1.1 (lock 1.1, two coupled fragments) then re-locked with 1.8 / 2.x.
43+
3. A maintainer call on `requires-plugins` / `.poetry/plugins` scope.
44+
4. macOS / Windows probes once deleting `bughunt/poetry/*` is allowed.

‎state/poetry.md‎

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[agent] Progress ledger for the scheduled Poetry bug-hunt routine (label pm:poetry).
22

3-
Last updated: 2026-10-16 (run 25), main `657fce2`, latest release **v5.0.1**. Run 9 re-measured the cells marked "r9". Runs 10–25 have their own tables below. #327, #329, #671, #866, #945, #1023, #1024, #1136, #1282, #1447, #1503, #1527 and #1547 are closed. Open: #450. macOS / Windows cells that still show #327 / #329 haven't been re-run, because probe branches are blocked.
3+
Last updated: 2026-10-16 (run 26), main `657fce2`, latest release **v5.0.1**. Run 9 re-measured the cells marked "r9". Runs 10–26 have their own tables below. #327, #329, #671, #866, #945, #1023, #1024, #1136, #1282, #1447, #1503, #1527 and #1547 are closed. Open: #450, #1615 (and #1589, filed by the uv routine, with Poetry evidence). macOS / Windows cells that still show #327 / #329 haven't been re-run, because probe branches are blocked.
44

55
## Coverage matrix
66

@@ -9,7 +9,7 @@ Cells are "pass", "fail #N" or "untested". Hosted and vendored cells use a local
99
| OS | Poetry | Agent (in-project `.venv`) | Agent (default out-of-tree venv) | Agent: nameless `package-mode=false` / `[project].name` override / `in-project=false` + stray `.venv` | Agent + hosted VEX: `in-project=true`, no `.venv`, existing out-of-tree env | Hosted (scan, install, rollback) | Hosted VEX with undiscovered venv | Vendored | Mode switch hosted ⇄ vendored | Vendored `repair` (lock-only, wheel deleted) |
1010
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
1111
| Linux | 0.12.17 | untested | untested | n/a | untested | pass v5 (refused, `redirect_poetry_lock_unsupported`) | n/a | pass v5 (`[metadata.hashes]`); r14 pass | vendored→hosted fail #945 | untested |
12-
| Linux | 1.0.10 | untested | pass r8 (scan, re-run, vex, rollback) | n/a | untested | pass v5 (lock 1.0 native-empty + populated; pip ≥ 23.1) | untested | pass v5 (populated lock 1.0); r19 supersede A → B | r19 pass (two-package partial takeovers, LF + CRLF) | r23 pass (lock-only, wheel deleted, fresh install patched) |
12+
| Linux | 1.0.10 | untested | pass r8 (scan, re-run, vex, rollback) | n/a | untested | pass v5 (lock 1.0 native-empty + populated; pip ≥ 23.1); r26 10 hand-edited lock 1.0 shapes pass | untested | pass v5 (populated lock 1.0); r19 supersede A → B | r19 pass (two-package partial takeovers, LF + CRLF) | r23 pass (lock-only, wheel deleted, fresh install patched) |
1313
| Linux | 1.1.15 | pass v5 | pass r8 (scan, re-run, vex, rollback); r9 `envs.toml` (3.10/3.11) pass | n/a | fixed by #527 (not re-run) | pass v5 (lock 1.1, extras + dev); r5 dotted name `jaraco.context` rewrite/install/vex/rollback | untested | pass v5 (LF + CRLF, unicode/space path); r19 supersede A → B (lock 1.1) | pass r14 (both ways, LF + CRLF); r19 two-package partial takeovers | pass r19 (after supersede) |
1414
| Linux | 1.2.2 | r23 pass (scan, re-run, vex, rollback) | r23 pass (scan, re-run, vex, rollback) | n/a | untested | pass v5 (lock 1.1, extras + dev, warm-venv stale check) | untested | pass (lock 1.1) | untested | untested |
1515
| Linux | 1.8.5 | untested | pass; r9 `envs.toml` + custom path pass | pass r5 (fixed by #330; nameless, in-project=false, unicode path) | pass r9 (#527) | pass v5 (LF + CRLF) | pass r5 (#330) | pass v5 (LF + CRLF, unicode/space path) | pass r14 (both ways, LF + CRLF) | pass v5 (#380 fixed) |
@@ -321,16 +321,33 @@ Mock serves eight packages (six, toml, idna, attrs, packaging, certifi, urllib3,
321321
| 2.5.1 | #450 | still fails |
322322
| macOS / Windows | anything | blocked (deleting `bughunt/poetry/*` still denied) |
323323

324+
### Run 26 cells (Linux, main `657fce2`)
325+
326+
| Poetry | Cell | Result |
327+
| --- | --- | --- |
328+
| 2.5.1 + export plugin | `pylock.toml` (`--with dev`) + `pylock.test.toml` (`--with test`), 3 patched packages: hosted scan, `poetry install --with test`, `uv pip install -r`, vex | pass |
329+
| same | hosted rollback | `hosted_restore_refused` (no sibling registry package; Known non-bugs) |
330+
| same | vendored + `--revert` with ≥ 2 packages in one pylock | in-entry comments dropped (pylock lane only; handed over to pip) |
331+
| 1.0.10 | 10 hand-edited lock 1.0 `[metadata.files]` shapes × hosted / vendored, fresh install, revert | pass 20/20 |
332+
| 1.0.10, 2.5.1 | Vendored in a path with `#`, `%20`, `;` | pass (`;` on 1.0 is a pip limit, Known non-bugs) |
333+
| 2.5.1, 1.8.5 | VEX product with a non-canonical PEP 440 version (`[tool.poetry]` and PEP 621) | fail #1589 (commented) |
334+
| 2.5.1 | Two-package hosted `list` / `repair` / `remove` / `sync` / vex / rollback | pass |
335+
| 1.8.5 → 2.5.1 / 2.4.3, 2.5.1 → 1.8.5 | Vendored, then `poetry lock` with another Poetry major: `--revert`, `rollback`, `remove`, re-vendor, → hosted takeover | **fail #1615** (main + v5.0.1) |
336+
| same-version relocks (2.5.1, 1.8.5) | same | pass |
337+
| 1.8.5 → 2.5.1 | Hosted, cross-major relock, install, vex, rollback | pass |
338+
| macOS / Windows | anything | blocked (deleting `bughunt/poetry/*` still denied) |
339+
324340
## Backlog
325341

326-
1. **Lead (run 24):** Poetry 2 `[tool.poetry.requires-plugins]` installs plugins (and their deps) into `<project>/.poetry/plugins`, which no mode crawls. That's code the Poetry CLI loads, not the project runtime, so it needs a maintainer call on scope before anyone files it.
327-
2. Re-check #1105 (hosted A → vendored B, warm venv), #1184 (export residual keep) and #450 once fixed.
328-
3. **Lead (run 14):** with `virtualenvs.create = false`, the project global fallback patches the system interpreter's dpkg-owned copy. That follows from #538's "patch every copy" design and needs a maintainer call before anyone files it. Since #409 (#1419), a system-site venv that imports a base copy also patches that base copy, on purpose.
329-
4. Untested Linux cells: hosted VEX with an undiscovered venv on 1.2.2 / 2.4.3; hand-edited lock 1.0 shapes (Poetry 1.0 writer). (Lock 2.0 from 1.3 / 1.5 / 1.7 writers: pass r25.)
330-
5. pylock export: `poetry export -f pylock.toml --with dev` / extras, and a named `pylock.<name>.toml`. (Vendored and both takeovers: r25, see Known non-bugs.) Maintainer call: for a Poetry project, vendored prefers an exported pylock over `poetry.lock`, so `poetry install` stays unpatched (warned); hosted rewrites both.
331-
6. **macOS / Windows re-checks** for closed #327 / #329, the #640 default paths, #866 on macOS, macOS XDG and the Windows Poetry 1.0/1.1 env hash. All need probe branches.
332-
7. Probe branches are still blocked: `bughunt/poetry/20260930-venv-discovery` and `bughunt/poetry/20260930-windows-modes` still exist, and deletion was denied again in run 25 (runs 9–25). A maintainer needs to delete them and allow deleting `bughunt/poetry/*`.
333-
8. Docs: `installer.modern-installation = false` (Poetry 1.4–1.8) keeps a warm same-version install, but the "Installer boundaries" table says 1.4–1.8 replace it. Line 24 still says CRLF / legacy `files` get a single-line inline array (changed by #1185). CLI_CONTRACT's error-code row for `mode_ambiguous` still names only agent + vendored state (the mode-resolution paragraph has the #1437 hosted-pin case).
342+
1. Re-check #1615, #1589, #450, #1105 and #1184 once fixed.
343+
2. #1615 on legacy formats: vendored with Poetry 1.1 (lock 1.1, coupled `[package.source]` + `[metadata.files]` fragments), then re-locked with 1.8 / 2.x; and 1.3 → 1.8 (lock 2.0 writers) re-render differences.
344+
3. **Lead (run 24):** Poetry 2 `[tool.poetry.requires-plugins]` installs plugins (and their deps) into `<project>/.poetry/plugins`, which no mode crawls. Needs a maintainer call on scope.
345+
4. **Lead (run 14):** with `virtualenvs.create = false`, the project global fallback patches the system interpreter's dpkg-owned copy (follows #538's "patch every copy"); a maintainer call before filing.
346+
5. Untested Linux cells: hosted VEX with an undiscovered venv on 1.2.2 / 2.4.3.
347+
6. pylock export: vendored prefers an exported pylock over `poetry.lock` for Poetry users (documented precedence; maintainer call).
348+
7. **macOS / Windows re-checks** for closed #327 / #329, the #640 default paths, #866 on macOS, macOS XDG and the Windows Poetry 1.0/1.1 env hash. All need probe branches.
349+
8. Probe branches are still blocked: `bughunt/poetry/20260930-venv-discovery` and `bughunt/poetry/20260930-windows-modes` still exist, and deleting them was denied (runs 9–26). A maintainer needs to delete them and allow deleting `bughunt/poetry/*`.
350+
9. Docs: `installer.modern-installation = false` (Poetry 1.4–1.8) keeps a warm same-version install, but the "Installer boundaries" table says 1.4–1.8 replace it. Line 24 still says CRLF / legacy `files` get a single-line inline array (changed by #1185). CLI_CONTRACT's `mode_ambiguous` row still names only agent + vendored state.
334351

335352
## Known non-bugs
336353

@@ -413,3 +430,6 @@ Mock serves eight packages (six, toml, idna, attrs, packaging, certifi, urllib3,
413430
- Hosted rollback of a lock with no final newline adds one, and a restored pylock entry's `upload-time` keeps millisecond precision. Covered by "no guarantee of the original byte layout". Not filed.
414431
- A bare `--vex` flag is a usage error: `scan --vex` takes a path (`--vex vex.json`).
415432
- Vendored with an exported `pylock.toml` that pins the package beside `poetry.lock` wires only the pylock and leaves `poetry.lock` on its registry source (`pypi_multiple_lockfiles`; `vendor --check` says "wiring contested"). Documented precedence: standalone PEP 751 locks rank between uv and Poetry when they pin the package (`formats/governing_locks.rs` `PYPI_TOOL_LOCKS`). So a hosted → vendored takeover returns `poetry.lock` to upstream. Not filed (r25).
433+
- A project path containing `;` breaks vendored installs on Poetry 1.0 (pip parses the absolute wheel path as `requirement; marker`, "Invalid marker"). Any path dependency there fails the same way; `#` and `%20` are fine, and Poetry 2.5.1 is fine with all three. Not filed (r26).
434+
- With several exported pylocks (`--with dev` → `pylock.toml`, `--with test` → `pylock.test.toml`), hosted warns `redirect_uv_entry_not_found` for each package a pylock deliberately doesn't list, and vendored repeats one generic "wiring pylock.test.toml, pylock.toml" warning per package. Cosmetic, handed to pip (r26).
435+
- `list --json` reports patches as `events[]` with `action: discovered`, not a `patches` array. Not a bug.

0 commit comments

Comments
 (0)