GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Hosted rollback, remove and vendored takeover always refuse on a `uv pip compile` pylock.toml because its packages carry no `index` key · Issue #407 · SocketDev/socket-patch

Hosted rollback, remove and vendored takeover always refuse on a uv pip compile pylock.toml because its packages carry no index key #407

New issue
Copy link
New issue
Copy link
Closed
#512
Closed
Hosted rollback, remove and vendored takeover always refuse on a uv pip compile pylock.toml because its packages carry no index key#407
#512
Copy link
Labels
agent:triagedbugSomething isn't workingSomething isn't workingbughuntFound by a scheduled package-manager bug-hunt agentFound by a scheduled package-manager bug-hunt agentpm:uvuvuvpriority:p1

Description

@mikolalysenko
Mikola Lysenko (mikolalysenko)
opened on Oct 1, 2026
Issue body actions

[agent] Found by the scheduled uv bug-hunt routine (ledger #310).

Summary

A standalone PEP 751 lock made by uv pip compile --format pylock.toml is a supported hosted lane (docs/testing/uv-compatibility.md, "standalone PEP 751 compilation"). scan --mode hosted wires it, and uv pip sync pylock.toml installs the patch. But on main the hosted pin can't be unwound by anything:

  • rollback → partial_failure: cannot restore pkg:pypi/[email protected] to its upstream registry entry: pylock.toml: no sibling registry package shows the registry and artifact fields this uv release records; restore it from version control instead (git checkout -- pylock.toml)
  • remove pkg:pypi/[email protected] → hosted_revert_failed (same message)
  • scan --mode vendored (hosted → vendored takeover) → failed redirect_revert_failed

The cause: uv pip compile never writes an index key on [[packages]] (only uv export --format pylock.toml does). The v5 upstream restore takes a pylock entry's registry only from a sibling's index (crates/socket-patch-core/src/patch/redirect/upstream/uv.rs:314-321). With no sibling carrying one, registries is empty and the restore refuses, however many plain PyPI siblings the lock has. Every sibling here is a files.pythonhosted.org artifact with the full url / upload-time / size / hashes shape.

Impact

Any project that uses uv pip compile --format pylock.toml and adopts hosted mode can't roll back, remove or switch to vendored mode afterwards. The only remedy is the git checkout the error suggests, which also throws away any unrelated lock changes made since. A rollback meant to unpatch everything leaves the patch wired and installable.

Repro (Linux)

Mock patch API as in #379 / #381 (now also returning integrity.sha512), --patch-server-url for the mock origin, PyPI JSON API reachable.

SP="socket-patch --api-url http://127.0.0.1:18080 --api-token t --org test-org --patch-server-url http://127.0.0.1:18080"
mkdir p && cd p
printf 'six==1.16.0\nidna==3.7\ncertifi==2024.2.2\n' > req.in
uv pip compile --format pylock.toml req.in -o pylock.toml
grep -c '^index' pylock.toml                 # 0: uv pip compile records no index
$SP scan --mode hosted --json --yes          # redirected 1, rewrittenFiles [pylock.toml]
uv venv v && VIRTUAL_ENV=v uv pip sync pylock.toml   # installs the patched six.py
$SP rollback --json --yes                    # exit 1, partial_failure, hosted.failed[0] = "...no sibling registry package shows the registry..."
$SP remove pkg:pypi/[email protected] --json --yes  # exit 1, hosted_revert_failed
$SP scan --mode vendored --json --yes        # exit 1, failed redirect_revert_failed
grep -c 127.0.0.1:18080 pylock.toml          # 1: still wired

Control: the same packages exported with uv lock && uv export --format pylock.toml (which writes index = "https://pypi.org/simple") roll back successfully.

Expected vs actual

  • Expected: CLI_CONTRACT.md, "Hosted unwind coverage", pypi: rollback / remove restore PEP 751 pylock*.toml pins, with hashes re-derived from PyPI's JSON API. The listed refusals for pylock are only "a release with a wheel that is not pure Python 3". The "other registry packages name no registry" refusal is stated for uv locks, where every registry package records its source. For a uv pip compile pylock the missing index is normal, so the restore should follow the siblings' shape (no index key) when their artifacts are PyPI files. At minimum, the refusal should be documented, and hosted mode should warn before it wires a lock it can never unwind.
  • Actual: rollback, remove and the vendored takeover all refuse on every uv pip compile pylock, and the hosted pin stays.

OS × uv matrix (main 2463257)

OS uv 0.8.17 uv 0.12.21
Linux fail (rollback / remove / takeover) fail (rollback / remove / takeover; reproduced 2×)

macOS and Windows weren't probed. The refusal is in platform-independent TOML inspection.

First bad

2463257 (#277, the v5 upstream restore; v4's ledger-based revert didn't depend on sibling entries).

Suspect code

  • crates/socket-patch-core/src/patch/redirect/upstream/uv.rs:314-321: for pep751, the registry comes only from package.get("index"), and siblings without it are skipped.
  • crates/socket-patch-core/src/patch/redirect/upstream/uv.rs:345-351: the "no sibling registry package" refusal.

Related, separate: the restored entry's upload-time precision on exported pylocks (filed separately).

Activity

  1. Mikola Lysenko (mikolalysenko)
    added
    bugSomething isn't workingSomething isn't working
    bughuntFound by a scheduled package-manager bug-hunt agentFound by a scheduled package-manager bug-hunt agent
    pm:uvuvuv
    agent:triaged
    priority:p1
    on Oct 1, 2026
  2. mikolalysenko commented on Oct 1, 2026

    @mikolalysenko
    Mikola Lysenko (mikolalysenko)
    on Oct 1, 2026
    CollaboratorAuthor
    More actions

    [agent] Triaged: priority:p1 (uv). Not a duplicate, and no open or merged PR covers it.

    Shares root cause with #408: lock_shape / render_artifact in crates/socket-patch-core/src/patch/redirect/upstream/uv.rs apply uv.lock rules to PEP 751 pylock files. They take the registry only from an index key (which uv pip compile never writes) and format upload-time with uv.lock's millisecond precision (pylock uses whole seconds). The fix is to read the pylock siblings' own shape: infer the registry from their PyPI artifact URLs and follow their upload-time precision. Will be fixed together.


    Generated by Claude Code

  3. mikolalysenko commented on Oct 1, 2026

    @mikolalysenko
    Mikola Lysenko (mikolalysenko)
    on Oct 1, 2026
    CollaboratorAuthor
    More actions

    [agent] Claiming this issue (with #408; shared root cause: the PEP 751 upstream restore in upstream/uv.rs applies uv.lock rules to pylock files: registry only from index, millisecond upload-time). Branch: agent/fix-uv-pylock-restore-shape. Claim-ID: 2026-10-01T23:20:47Z-0e9aae


    Generated by Claude Code

  4. Mikola Lysenko (mikolalysenko)
    added
    agent:claimed
    on Oct 1, 2026
  5. mikolalysenko commented on Oct 1, 2026

    @mikolalysenko
    Mikola Lysenko (mikolalysenko)
    on Oct 1, 2026
    CollaboratorAuthor
    More actions

    [agent] Draft PR: #512


    Generated by Claude Code

  6. Mikola Lysenko (mikolalysenko)
    added 2 commits that reference this issue on Oct 2, 2026

    Add failing tests for uv pylock rollback shape

    1c3f502

    Fix uv pylock rollback refusing and drifting

    116d022
  7. mikolalysenko commented on Oct 2, 2026

    @mikolalysenko
    Mikola Lysenko (mikolalysenko)
    on Oct 2, 2026
    CollaboratorAuthor
    More actions

    [agent] From the Hatch bug-hunt routine (ledger #314): Hatch's own locker also produces this pylock shape, so every locked Hatch project hits this too.

    On main 61cfb9b with real Hatch 1.17.0 and 1.18.1: [tool.hatch.envs.default] locked = true, installer = "uv" with dependencies = ["six==1.16.0", "idna==3.7", "certifi==2024.8.30"], then hatch lock. The resulting pylock.toml (created-by = "uv") has 3 [[packages]] and no index key. Then scan --mode hosted rewrites six to an archive entry, and after that (two runs per version):

    • rollback → partial_failure: pylock.toml: no sibling registry package shows the registry and artifact fields this uv release records; restore it from version control instead
    • remove pkg:pypi/[email protected] → hosted_revert_failed (same message)
    • scan --mode vendored --vendor-source service (hosted → vendored takeover) → redirect_revert_failed

    The vendored rollback / remove on the same project succeed. (The fact that only the lock gets wired on these projects is tracked separately in #479.)


    Generated by Claude Code

  8. Mikola Lysenko (mikolalysenko)
    added 2 commits that reference this issue on Oct 2, 2026

    hatch: 2026-10-02 bug-hunt run (#505, #407 comments)

    9596cf2

    Fix uv pylock rollback shape (#407, #408) (#512)

    7825622
  9. Mikola Lysenko (mikolalysenko)
    closed this as completedin #512on Oct 2, 2026
  10. Mikola Lysenko (mikolalysenko)
    removed
    agent:claimed
    on Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent:triagedbugSomething isn't workingSomething isn't workingbughuntFound by a scheduled package-manager bug-hunt agentFound by a scheduled package-manager bug-hunt agentpm:uvuvuvpriority:p1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.