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 — Support hosted and vendored Hatch patches by mikolalysenko · Pull Request #244 · SocketDev/socket-patch

Conversation

@mikolalysenko

@mikolalysenko Mikola Lysenko (mikolalysenko) commented Sep 17, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

LLM Description written by Codex:gpt-6-astra

Hatch projects lacked hosted and vendored manifest wiring. Add exact PEP 508 rewrites for project, optional and environment dependencies in pyproject.toml and hatch.toml, preserving extras, markers, external configuration precedence, comments and line endings. Vendored references use relocatable root URIs; both modes pin the artifact SHA-256.

Validate recorded artifact paths, pins and wheel bytes before repeated scans, refuse concurrent edits and symlinked inputs, and preserve shared ownership of Hatchling’s direct-reference permission during selective or preserved rollback. Existing requirements and lockfile routing keeps precedence. Python hosted confirmation now requires a successful writer, preventing an inactive Hatch URL from masking a refused UV/Poetry lock or failed metadata preparation. Environment discovery uses regular-file reads so FIFO configuration cannot hang a scan.

Vendored environments require Hatch >=1.2 and pip: earlier Hatch releases do not expand the root URI, and uv ignores local-wheel hash fragments. Vendored groups, ranges, transitive-only targets, dynamic metadata, source/plugin configurations and conditional overrides are refused before writes; the install hook remains available. Hosted environments support pip and uv.

Validation:

  • 17 Hatch-focused Rust tests, 58 Poetry tests, 10 UV-lock tests and 72 requirements tests pass; CLI build and Clippy with warnings denied pass.
  • Real CLI probes verify that rejected UV/legacy Poetry locks with inactive Hatch URLs report zero redirects, while a supported Poetry lock redirects and rolls back exactly.
  • Native Windows/Linux matrix covers 13 releases across both Hatch majors, including installed patch-file hashes, wrong-digest rejection, repeated scans and rollback. The permanent compatibility report separates successful installs from safe refusals and upstream limitations.
  • Companion depscan #26388 implements the SBOM support; its stacked tests and fixtures PR #26400 validates 1,267 captured/adversarial SBOM fixtures and preserves native manifest hashes and installer results.

Note

Medium Risk
Changes PyPI redirect, vendor wire/revert, and hosted attestation logic; mistakes could mis-report patched deps, but behavior is fail-closed with explicit confirmed/refused UUID sets and broad tests.

Overview
Adds Hatch as a first-class PyPI path for hosted redirects and vendored wheels, rewriting exact == PEP 508 pins in pyproject.toml / hatch.toml (project, optional, and environment deps) to direct @ URLs with SHA-256 fragments and enabling allow-direct-references when needed. Vendored wiring uses {root:uri} pins, ledger-backed wire/revert, symlink and concurrent-edit refusal, and shared permission rollback; unsupported shapes (ranges, dynamic deps, uv-only envs for vendored hashes, etc.) fail closed toward the install hook.

Hosted scan confirmation stops inferring PyPI patches from URL substrings: redirects count only when the matching writer succeeds—python lock (uv/poetry/…), Hatch, or requirements—so an inactive Hatch URL cannot attest a failed or skipped lock rewrite. Scan inputs now include hatch.toml, pdm.lock, and Pipfile.lock.

Poetry virtualenv discovery reads config via read_regular_to_string so FIFO pyproject.toml / poetry.toml cannot hang scans; redirect replay adds Hatch document restore (including CRLF drift).

Reviewed by Cursor Bugbot for commit 31e74e4. Configure here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Mikola Lysenko (mikolalysenko) added 6 commits September 17, 2026 17:58
@mikolalysenko
Support hosted and vendored Hatch patches
3bc3bb5
Wire exact Hatch requirements to hash-pinned wheels and guard repeat
scans and rollback against configuration or artifact drift.

Assisted-by: Codex:gpt-6-astra
@mikolalysenko
Guard old Hatch environment installers
6aa4b77
Require Hatch 1.2 or later for vendored environment dependencies,
whose root placeholders older releases cannot expand. Exercise
rollback after newline conversion and refuse symlinked manifests.

Assisted-by: Codex:gpt-6-astra
@mikolalysenko
Preserve shared Hatch permissions on rollback
c84f476
Restore direct-reference settings after the last project source is
unwired, including selective and preserved rollback. Refuse malformed
metadata and local uv wheels whose digest fragments are ignored.

Confirm requirements-driven projects from active declarations.

Assisted-by: Codex:gpt-6-astra
@mikolalysenko
Check explicit Hatch uv executable settings
ece5393
Refuse vendored local wheels when uv is enabled through uv-path as
well as installer or environment configuration.

Assisted-by: Codex:gpt-6-astra
@mikolalysenko
Clarify vendored Hatch requirements
b456a8e
Distinguish the environment version floor from hosted support and
clarify shared permission ownership during rollback.

Assisted-by: Codex:gpt-6-astra
@mikolalysenko
Merge Poetry support and guard patch claims
31e74e4
Keep Hatch and Poetry rollback handlers after the base update. Confirm
Python redirects only through successful writers, so inactive Hatch
sources cannot mask rejected locks. Read config files without blocking
on FIFOs during environment discovery.

Assisted-by: Codex:gpt-6-astra
@mikolalysenko
Mikola Lysenko (mikolalysenko) marked this pull request as ready for review September 17, 2026 22:56
@mikolalysenko
Mikola Lysenko (mikolalysenko) enabled auto-merge (squash) September 18, 2026 13:49
Wenxin-Jiang
Wenxin Jiang (Wenxin-Jiang) approved these changes Sep 18, 2026
View reviewed changes
@mikolalysenko
Mikola Lysenko (mikolalysenko) merged commit 649d457 into main Sep 18, 2026
95 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@mikolalysenko
Mikola Lysenko (mikolalysenko) deleted the codex/hatch-patch-compatibility branch September 18, 2026 13:54
Mikola Lysenko (mikolalysenko) added a commit that referenced this pull request Sep 18, 2026
@mikolalysenko @claude
Merge origin/main (Poetry #241, Hatch #244) into the Pipenv fix branch
e521093
Conflicts resolved: the crawler runs Poetry's then Pipenv's out-of-tree
venv discovery (both gated on nothing found above); replay keeps the
PipenvEntry inverse next to main's HatchDocument; the hosted confirmed-uuid
filter confirms Pipfile.lock rewrites through `confirmed_pipenv_uuids`
alongside main's python-lock / hatch / requirements sets and still vetoes
`refused_pipenv_uuids`; main's generic Python stale-install guard
(`redirect_pypi_stale_install`, `known_stale`) replaces the Pipenv-specific
hosted probe — it now judges only the project's own venvs (no global
interpreter fallback) and names the Pipenv-specific remedy (`pipenv run pip
uninstall -y <pkg> && pipenv sync`, never `pipenv uninstall`) for
Pipfile.lock redirects; the pypi fetcher keeps the digest-set resolver
(superset of main's single-hash one); the candidate-file list, the
ecosystem matrix row, the hosted-e2e note, CHANGELOG and CLI_CONTRACT carry
both sides once.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
This was referenced Sep 18, 2026
Support hosted Pipenv patches and safe vendoring #242
Merged
Support hosted and vendored PDM patches #243
Merged
This was referenced Sep 30, 2026
Hosted Hatch rewrite leaves an existing Hatch environment unpatched with no stale-install warning, and vex still attests not_affected #335
Closed
Hatch rollback and remove refuse with "configuration drifted" after the project version is bumped or a dependency is added, in both hosted and vendored mode #385
Closed
Hatch 1.17+ projects with a hatch-generated pylock.toml get only the lock rewritten, and Hatch regenerates it from pyproject, so hosted and vendored patches are silently dropped #479
Closed
Vendored scan in a Hatch workspace member writes {root:uri} that the workspace root env never expands, so every hatch run at the root fails to install #505
Closed
Vendored Hatch wiring makes every Hatch install fail when the checkout path contains %XX, # or ; (e.g. a Jenkins "feature%2Fx" workspace), because Hatch's {root:uri} only escapes spaces #547
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@Wenxin-Jiang Wenxin Jiang (Wenxin-Jiang) Wenxin-Jiang approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@mikolalysenko @Wenxin-Jiang
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.
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.