GeezerVison is showing github.com — Fix hosted uv missing uv<0.5.6 advisories (#1569) by mikolalysenko · Pull Request #1609 · SocketDev/socket-patch
Conversation
LLM Description written by Claude Code:claude-opus-5-5
Fixes #1569
Summary
A hosted uv scan can wire the patched package in two ways that uv before
0.5.5 doesn't honour:
- Transitive package: a
[tool.uv] override-dependencies entry plus a
[tool.uv.sources] url. On old uv a plain uv sync re-resolves the
override against the registry and silently reinstalls the unpatched
wheel.
- Package in
constraint-dependencies: the lock's [manifest] constraints / build-constraints entry is repointed, and old uv rejects
that under uv sync --locked.
Vendored mode already warned about both (pypi_uv_override_requires_uv_0_5_6,
pypi_uv_constraints_require_uv_0_5_6). Hosted mode warned about neither and
exited 0. Now hosted scans emit redirect_uv_override_requires_uv_0_5_6 and
redirect_uv_constraints_require_uv_0_5_6 when they write that wiring, for
project and PEP 723 script locks. These are advisories only: the redirect
still counts, the exit code doesn't change, and a settled re-run says nothing.
Root cause
rewrite_uv_lock (patch/redirect/mod.rs) confirms the pin without looking
at which wiring shape it used, so the uv-version advisories that
vendor/pypi_uv.rs emits for the same shapes had no hosted equivalent.
Changes
rewrite_uv_lock: once a dep is confirmed and this run changed its
wiring, check whether the paired pyproject/script reaches it through an
override (a marked entry or the user's own) and whether the lock's
[manifest] constrains it. The constraints check reads the lock session's
existing parsed document, so the lock isn't parsed again.
- Hosted and vendored share one advisory text (
utils/python_script.rs).
The text now gives the measured affected range (uv before 0.5.5, per
docs/testing/uv-compatibility.md) and keeps the documented >= 0.5.6
advice. Before, the constraints text said only 0.2.37–0.5.3 were affected,
but 0.5.4 rejects the entry too.
UV_OLD_RELEASE_ADVISORIES: excluded from the "see the warning below"
count and from the takeover's skip-reason lookup, because they describe a
pin that landed.
- CLI_CONTRACT.md row and uv-compatibility.md notes.
Test evidence
- New
patch::redirect::uv_old_release_advisories tests: transitive
override (LF and CRLF), repointed constraint, a user-written override
under a non-canonical Six grant, script-lock override, and a silent
direct dependency. Before the fix: 3 failed (left: [], expected the
code). After the fix: all pass.
python_lock_rewrite.golden re-blessed. To check it, I filtered out the
two new codes in the harness and matched the previous golden exactly
across all 1500 seeded cases. The sweep now has to reach both codes.
tests/uv_hosted.rs: the transitive case expects the override advisory.
- Real uv 0.12.17,
cargo test -p socket-patch-cli --all-features --test e2e_redirect_uv_build -- --ignored: 9/9 pass. The hosted transitive and
constraints lanes now assert their advisory, and every other lane asserts
that neither code appears.
cargo fmt --all -- --check and cargo clippy --locked --workspace --all-features -- -D warnings: clean. cargo test -p socket-patch-cli --lib: 921 pass.
- Full
cargo test --workspace --all-features --no-fail-fast: the only
failures were tests that can't pass in this sandbox, which runs as root
with no route to patches-api.socket.dev: chmod-based write-failure tests
(poetry/requirements wire rollback, repair cleanup, vlt heal, copy_tree
symlink) and the network-backed e2e_bun_lockb rollback. None of them
touch uv. CI runs them as non-root.
Per-issue checklist
Bugbot
- Takeover
explain could name a uv advisory as a package's skip reason through the names_package pass. Fixed in 21f5d28 with the regression test uv_old_release_advisories_never_explain_a_skip, which goes red to green.
Review notes (/code-review high)
Fixed: user-written overrides were missed, takeover skip-reason list,
wrong version range in the text, non-canonical name, an extra lock parse,
duplicated text, and the e2e absence check. Not changed: re-emitting on a
re-pin to a superseding patch. That run rewrites the same fragile wiring, so
the advisory still applies; the contract now says so.
Generated by Claude Code
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Assisted-by: Claude Code:claude-opus-5-5
A hosted uv scan wires a transitive patched package through a marked
override-dependencies entry, and repoints [manifest] constraints in
uv.lock. uv before 0.5.5 honours neither: a plain uv sync silently
reinstalls the unpatched wheel, or uv sync --locked fails. Vendored
mode already warns about both; hosted printed nothing and exited 0.
Hosted scans now emit redirect_uv_override_requires_uv_0_5_6 and
redirect_uv_constraints_require_uv_0_5_6 on the run that wires those
shapes (project and script locks). They advise only: the redirect
still counts and the exit code is unchanged.
Fixes #1569
Assisted-by: Claude Code:claude-opus-5-5
Re-bless the uv rewrite golden: the only change in its 1500 seeded
cases is the new advisory (verified by filtering those two codes and
matching the previous golden exactly), and require that the sweep
reaches both codes. The real-uv hosted transitive and constraints
lanes now assert the advisory, and the uv_hosted transitive case
expects it.
Refs #1569
Assisted-by: Claude Code:claude-opus-5-5
Review fixes for the hosted uv advisories:
- A user's own override-dependencies entry, which the hosted rewrite
reuses for its source, now gets the advisory too: old uv ignores the
source there just the same.
- Read the [manifest] constraints from the lock session's document
instead of parsing the lock again per package.
- Hosted and vendored now share one advisory text, which names the
real affected range (uv before 0.5.5) and the canonical name.
- Vendored-to-hosted takeover no longer names a uv advisory as the
reason another package stayed vendored.
Refs #1569
Assisted-by: Claude Code:claude-opus-5-5
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
cursor
Bot
left a comment
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stale Bugbot comment from a previous run.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
The takeover's skip explanation matched a warning that names the
package before it filtered out landed-pin advisories, so a package
named like a word in the uv advisory (wheel, uv, sync) could inherit
another pin's advisory as its reason for staying vendored. Filter the
uv advisories out of both passes.
Refs #1569
Assisted-by: Claude Code:claude-opus-5-5
cursor[bot] reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ 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 21f5d28. Configure here.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Ready for review at 21f5d28: CI 35/35 green (19 skipped), no conflicts, Bugbot reviewed this head with no findings and the one earlier review thread is resolved. Reviewers: the new hosted advisories redirect_uv_override_requires_uv_0_5_6 / redirect_uv_constraints_require_uv_0_5_6 are warnings only and don't change exit codes.
Generated by Claude Code
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
[agent] I verified this PR (head 21f5d28) against real uv 0.5.3 and 0.13.1 on Linux with the bughunt mock patch server, comparing it with main 657fce2:
| Lane |
main hosted |
PR hosted |
vendored (both) |
| transitive six (isodate) |
none |
redirect_uv_override_requires_uv_0_5_6 |
pypi_uv_override_requires_uv_0_5_6 |
six direct + constraint-dependencies |
none |
redirect_uv_constraints_require_uv_0_5_6 |
pypi_uv_constraints_require_uv_0_5_6 |
| transitive + constraint |
none |
both codes |
both codes |
| direct six |
none |
none |
none |
- An idempotent re-scan is silent in every lane.
- H→V and V→H takeovers on 0.5.3 each emit the advisory for the new mode.
- On 0.5.3,
uv sync --locked exits 2 and a plain sync rewrites the lock and installs unpatched six, matching the advisory text. On 0.13.1 both stay patched.
No issues found.
Generated by Claude Code
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
|
[agent] The merge queue dropped this PR because of a failure unrelated to it: e2e (ubuntu-latest, e2e_vex_build, pipenv:: --ignored, 2026.8.0) → pipenv::pipenv_pylock_projects_wire_what_pipenv_installs. That test runs uv pip install -r pylock.toml, and uv rejects the file with "The target environment is not supported by the lockfile". The pipenv/pip legs install uv through setup-uv without a version pin, so today they picked up uv 0.13.4. uv 0.13.2 and later refuse Pipenv's environments = [] pylock. This PR only touches the hosted uv.lock rewrite, and main was last green yesterday on an older uv.
#1639 already fixes it by pinning those legs to uv 0.13.1. The queue builds on main, so this PR needs no change: re-queue it once #1639 merges.
Generated by Claude Code
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Oct 20, 2026
|
[final reviewer] Re-added to the merge queue (squash, auto-merge) at 21f5d2871, which is the commit Wenxin Jiang (@Wenxin-Jiang) approved. The earlier eviction was the main-wide uv 0.13.2 Pipenv pylock break. main now pins setup-uv to 0.13.1 (#1605), and the same e2e … pipenv:: --ignored, 2026.8.0 leg is green on main a54753a. This is the one re-enqueue after that eviction.
Generated by Claude Code
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
Ready for review
Agent-verified: mergeable, CI green, Bugbot clean — awaiting human review
Milestone
No milestone
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.
|