Repository navigation
Wire every vendored Poetry lock through utils::poetry_lock (#936) - #1185
Merged
Mikola Lysenko (mikolalysenko) merged 4 commits intoOct 8, 2026
Merged
Conversation
Assisted-by: Claude Code:claude-opus-5-5
The shared poetry.lock engine rendered a 2.x package's patched
files array inline ([{ file = ..., hash = ... }]), while Poetry
itself, and the vendored LF splicer, write one file per line. Hosted
rewrites and vendored CRLF locks now get Poetry's own shape, so the
same lock gets the same diff in every mode and line ending.
Reuses the multi-line renderer the 1.0/1.1 [metadata.files] entries
already use. The poetry_rewrite and reused-parse goldens are
re-blessed: only the 2.x generations (Poetry 1.3.2+) move; every
legacy 0/1.0/1.1 case keeps its digest.
Assisted-by: Claude Code:claude-opus-5-5
Vendored Poetry picked its forward splicer by line ending: CRLF and legacy locks went through utils::poetry_lock, LF 2.x locks through a private line scanner that skipped the engine's wheel-name and digest-case gates and matched only a literal 'name = "..."' line. Every lock now goes through the engine hosted mode uses. A 2.x lock spelled name="six", or a unit with no files array, now wires (as a CRLF lock already did) and reverts byte-exact instead of being refused. Deletes rewrite_target_package_unit, toml_surgery's package_unit_lines and replace_files_array, and common::unit_has_canon_name (Poetry-only helpers). Assisted-by: Claude Code:claude-opus-5-5
Closed
6 tasks
The VEX pin-spelling test now also strips the one-file-per-line package files array a 2.x hosted lock carries, and the fragment boundary test drops that array (not only an inline line) when it simulates a relock. Assisted-by: Claude Code:claude-opus-5-5
Mikola Lysenko (mikolalysenko)
marked this pull request as ready for review
October 8, 2026 22:16
Collaborator
Author
|
BugBot review Generated by Claude Code |
Mikola Lysenko (mikolalysenko)
pushed a commit
that referenced
this pull request
Oct 8, 2026
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 0c4ddab. Configure here.
Tanmay Singla (Tanmay182003)
approved these changes
Oct 8, 2026
Collaborator
Author
|
[burn-down agent] Ready for review at
Ready for a human approval. Generated by Claude Code |
Collaborator
Author
|
[final reviewer] Enqueued (auto-merge on, squash) at head Generated by Claude Code |
Mikola Lysenko (mikolalysenko)
deleted the
arch-refactor/936-poetry-one-splicer
branch
October 8, 2026 23:52
Mikola Lysenko (mikolalysenko)
pushed a commit
that referenced
this pull request
Oct 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
LLM Description written by Claude Code:claude-opus-5-5
Fixes #936
Summary
Vendored Poetry chose its forward splicer by the lock's line endings. Legacy and CRLF locks went through the shared
utils::poetry_lockengine, while LF 2.x locks went through a privatetoml_surgeryline scanner. Now every lock goes through the engine, which writes Poetry's own one-file-per-linefilesarray for 2.x locks. The scanner and its Poetry-only helpers are deleted.Why
doc/05-vendored.md, "Vendored Poetry has two forward splicers").filesshapes for the same lock depending oncore.autocrlf;name = "…"line.arch-refactor/*oragent/fix-*PR changes.vendor/common.rsis also changed by my own #1160. Its hunks (the imports and the JSON BOM helpers, lines 9–220) don't overlap this PR's single deletion at line 626, so the two merge cleanly in either order.What changed
utils::poetry_lockwrites a 2.x package's patchedfileswith the multi-line renderer that the 1.0/1.1[metadata.files]entries already use (multiline_files, split out oflegacy_files_entry).wire_poetrycallsrewrite_poetry_lock_with_editsfor every lock generation and line ending.Deleted
pypi_poetry::rewrite_target_package_unittoml_surgery::package_unit_lines,toml_surgery::replace_files_arrayand their testscommon::unit_has_canon_nameBehavior
These changes are intended, and the issue's acceptance criteria ask for them:
poetry.lock(Poetry 1.3+) now writefiles = [\n {file = …, hash = …},\n]instead offiles = [{ file = …, hash = … }]. Vendored CRLF 2.x locks get the same shape. Vendored LF output is unchanged: the fixture testwiring_matches_fixtures_byte_identically_both_lock_versionsstays byte-identical. Legacy 0/1.0/1.1 output is unchanged.name="six", or one whose unit has nofilesarray, now wires and reverts byte-exact, as a CRLF lock already did. Before, it was refused withpypi_poetry_lock_package_missing/pypi_poetry_lock_parse_failed.revert_lock_fragment_splice_atomic. Ledgers written by the old LF path still revert: their fragments are spliced back verbatim.Golden re-bless
poetry_rewrite.golden: only the 2.x generations (1.3.2 through 2.4.3, 8 cases each) move. The 0.12.17, 1.0.10, 1.1.15 and 1.2.2 cases keep their digests.poetry_lock_reused_parse.golden: cases 0–231 (the 4 legacy generations × 58) keep their digests, and cases 232–869 (the 11 2.x generations) move.Tests
lf_and_crlf_locks_wire_to_the_same_fixture: each 2.x fixture wired as LF and as CRLF gives the same lock, and that lock is Poetry's own fixture. It fails onmain, where CRLF wrote the inline shape.wire_accepts_a_unit_spelled_without_spaces(LF and CRLF) andwire_adds_files_to_a_unit_without_one: these replace the two fail-closed tests that pinned the scanner's refusals. Both wire and then revert byte-exact.lock_2x_files_keep_poetrys_multiline_shape: the hosted (url) and vendored (file) rewrite of 3 2.x fixtures, plus an idempotent re-run.cargo clippy --workspace --all-features -- -D warnings: clean.cargo test -p socket-patch-core --lib: 5,799 passed. 4 failed, the known root-only tests (relax_loop_must_not_traverse_symlinked_root,an_unremovable_hidden_lock_keeps_every_store_entry,wire_write_failure_maps_error_and_leaves_lock_untouched,wire_failure_rolls_back_already_written_files).cargo test -p socket-patch-core --test '*': all passed.e2e_vex_lockfile(343),in_process_redirect_poetry(7),in_process_vendor(122) andhosted_memory_engine(34).covgap_commands_vendorpassed 51; 3 failed, all root-only (*_state_write_failure_*, which chmod the vendor dir to 0555).npm/,pypi/,gem/).Risk
Medium. The user-visible change is the hosted 2.x
fileslayout, which now matches what Poetry writes. Hosted restore already rebuildsfilesthroughmultiline_toml_array, and VEX discovery readsfilesthrough the parsed TOML, so neither depends on the layout.🤖 Generated with Claude Code
https://claude.ai/code/session_019qW3rRLpBivgBuWXHMZ36z
Note
Medium Risk
Changes committed
poetry.lockshape for hosted/vendored 2.x rewrites and consolidates lock mutation logic; well-covered by fixtures and goldens but affects installer hash/layout expectations.Overview
Unifies vendored Poetry lock wiring so every lock generation and line ending goes through the shared
utils::poetry_lockengine (same path hosted mode uses). The separate LF 2.x text-surgery path (rewrite_target_package_unit,toml_surgery::replace_files_array,unit_has_canon_name) is removed.Poetry 2.x
fileslayout: hosted and vendored rewrites now emit Poetry’s one-file-per-linefilesarray via newmultiline_files, instead of inlinefiles = [{ file = … }]. Legacy 0/1.0/1.1 behavior is unchanged.Behavior shifts (previously scanner-only): vendored wiring accepts
name="pkg"spelling and inserts afilesblock when the unit had none, with byte-exact revert. LF and CRLF 2.x locks produce the same shape after normalization.Tests and equivalence goldens are updated for the new 2.x output; e2e pin tests recognize the multiline
filesspelling.Reviewed by Cursor Bugbot for commit 0c4ddab. Configure here.
Generated by Claude Code