GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Fix quadratic hosted Hatch rewrite (#1471) by mikolalysenko · Pull Request #1474 · SocketDev/socket-patch Conversation
|
| comparison | scenario | base | head | Δ wall [95% CI] | Δ CPU |
|---|---|---|---|---|---|
vs current main 15c2c83 |
hatch/hosted (25 patched) |
81.0 ms | 71.3 ms | -10.3% [-17.4, +0.1] | -9.2% |
vs current main 15c2c83 |
hatch/rescan |
68.3 ms | 61.7 ms | -12.4% [-15.4, +2.2] | -8.9% |
vs current main, --scale 4 |
hatch/hosted (100 patched) |
309.0 ms | 167.7 ms | -46.9% | |
vs issue base 9c43dfc9 |
hatch/hosted |
65.1 ms | 69.3 ms | +3.8% [-2.2, +10.0] ≈ | +2.3% |
vs issue base 9c43dfc9 |
hatch/rescan |
68.0 ms | 63.5 ms | -4.9% [-14.0, +5.4] ≈ | -3.8% |
Against the issue's base, both scenarios are back within the 10% gate.
Local runs on b6cef30:
cargo fmt --all -- --check: cleancargo clippy --workspace --all-features -- -D warnings: cleancargo test -p socket-patch-core --all-features --lib: 6411 passed, 4 failed. The 4 also fail on main in this sandbox: they make a directory read-only and expect a write to fail, and the container runs as root.cargo test --workspace --all-features --no-fail-fast: only those root-only write-failure tests failed, plus e2e_bun_lockb::binary_shared_bundled_record_hosted_pin_is_managed, which needs patches-api.socket.dev and the sandbox proxy blocks it. No Hatch, PyPI or redirect test failed.SOCKET_PATCH_HATCH_E2E_REQUIRED=1 SOCKET_PATCH_HATCH_E2E_VERSION=1.18.1 cargo test -p socket-patch-cli --all-features --test e2e_vex_build -- hatch:: --ignored: 6 passed.No wrapper changes: npm/, pypi/ and gem/ only dispatch to the binary.
tool.hatch / hatch.toml; permission probe clones the document: one clone per round, not per dep, so linear. Not worth the extra code.rewrite_array returns a Vec most callers drop: an empty Vec doesn't allocate, and only group matches push into it.deps is built from the same url.is_some() filter a few lines above the loop that consumes the steps, and the expect guards the invariant.--json output.The remaining hatch/hosted hot spots from the issue (PurlKey::new / canonical_base_purl, list_dist_info_packages_sync name canonicalization) are shared with every PyPI lane and not part of this regression.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Tr9PtQHqFihp4KcdJ1pXCK
Note
Medium Risk
Changes core Hatch redirect/plan logic and edit recording for hosted scans; behavior is heavily tested for parity with sequential rewrites but touches dependency wiring paths.
Overview
Fixes #1471 by batching hosted Hatch PyPI redirects: rewrite_hatch now calls rewrite_all once for all patched deps instead of rewrite per dependency (re-parse/re-render of pyproject.toml and hatch.toml each time).
utils::hatch adds a shared check-then-apply walk (Round / run_round) that preserves sequential semantics—per-dep refusals, duplicate canonical names in input order, allow-direct-references, and {root:uri} / merge rules—while parsing and rendering the Hatch documents once. plan (vendored lane) uses the same engine.
Redirect file edits are finer-grained: requirement rewrites vs permission grants (redirect_hatch_requirement / redirect_hatch_permission) instead of full-document snapshots per dep. New tests assert batch output matches one-at-a-time rewrite.
Reviewed by Cursor Bugbot for commit b6cef30. Configure here.
Generated by Claude Code
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Assisted-by: Claude Code:claude-opus-5-5
A hosted scan of a Hatch project re-parsed pyproject.toml and hatch.toml, re-checked every declared requirement and rendered both files again for each patched dependency, so scan time grew with the square of the number of patched pins (#1471). utils::hatch::rewrite_all now parses the documents once, looks each requirement up by its canonical name and renders once. Each dependency still gets exactly the outcome a lone rewrite gives it: a check pass records refusals without changing anything, the apply pass rewrites only the deps that passed, a structural refusal fails every dep not already refused, and repeats of one name run in input order. The vendored planner uses the same walk with one dep. Hosted redirect edits now record the requirement strings rewritten rather than a full copy of the file per dependency. Assisted-by: Claude Code:claude-opus-5-5
When the only change a hosted Hatch re-run makes is restoring the allow-direct-references permission the user removed, the file was rewritten but no edit named it. The batch now records that change on the first dependency that needs it, as a redirect_hatch_permission edit, and the tests pin the exact output instead of only comparing against the shared single-dep path. Assisted-by: Claude Code:claude-opus-5-5
|
BugBot review Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem 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 b6cef30. Configure here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Labeled Ready for review by the burn-down agent.
Slack announcement not sent this run (Slack send tool unavailable); the next run will retry. Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Final review briefWhat it does: A hosted scan of a Hatch project used to call Risk: low-medium. The Hatch wiring logic is new (+750/−128), but it is checked hard against the old behaviour. Hosted edits aren't in Look here
Verified
Changes I made: none. Open questions (non-blocking)
Auto-merge is armed, so approving sends this straight to the merge queue. Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Final reviewer: claim released. 5f1328e (pushed by another session) fixes the refused-only Hatch render in the same way I had validated locally: the new test fails on b6cef30 and passes with the fix, and Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
rewrite_all rendered every parsed document whatever the outcome, so a hatch.toml that doesn't round-trip byte for byte (mixed line endings) came back normalised even when every dep was refused, where the per-dep rewrite wrote nothing. Return no files unless some step succeeded. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Tr9PtQHqFihp4KcdJ1pXCK
There was an error while loading. Please reload this page.
* ci(release): publish npm from release.yml, not publish-npm.yml Every socket-patch npm package's trusted publisher is registered against release.yml, and npm allows only one publisher per package. The 5.0.0 release dispatched publish-npm.yml, whose OIDC token named that file, so npm rejected it with E401 before staging anything. Move the npm leg back inline as release.yml's npm-publish job (same steps as publish-npm.yml) and delete publish-npm.yml, so the existing registration keeps working. Add an `npm-retry-version` input that skips the version gate, build, tag, GitHub release and crates.io jobs and re-stages npm from an existing release's assets; this retries 5.0.0 now and replaces the manual Publish npm dispatch. crates.io stays dispatched through publish-cargo.yml, since crates.io allows several publishers per crate. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * chore(release): fold 22 more PRs into the 5.0.0 notes Cover the PRs merged to main after #1432's base (1779317..4cb3643): Cargo source replacement and registry = "crates-io" (#338/#455, #386), pnpm lockfile=false (#1074), berry removed descriptors (#1435), yarnrc ${VAR} reads (#1100), CRLF .npmrc append (#1196), Composer vendor-dir cascade and global home (#439/#686, #586), Go +incompatible vex (#484), gem moved BUNDLE_GEMFILE and commented Gemfile revert (#952, #988), Poetry source = "pypi" (#1282) and Hatch path characters (#547). No entries for #1411 (macOS fix to code #1393 added in this release; the #1393 entry already describes the intended behavior), #1426 (perf regression introduced and fixed within 5.0.0) or the CI/test/bench PRs. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * chore(release): cover #1419, #1434, #1440, #1442, #1444 in the 5.0.0 notes Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * chore(release): 5.0.1 Cut [Unreleased] into [5.0.1] — 2026-10-13 and stamp 5.0.1 with scripts/version-sync.sh. The 5.0.1 notes cover main through 501c6d9 (#1449), i.e. every PR after the v5.0.0 tag (6ad6add): the npm publish fix (5.0.0 never reached npm or crates.io, 5.0.1 is the first v5 there), #1465, #759, #1460, #1462, #1445, #869, #1447, #1450, #1467, and #1449 under Maintenance. CI/test-only PRs (#1448, #1452, #1454, #1457, #1459) have no entries. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * chore(release): 5.0.1 notes for PRs merged since the cut Covers #1469, #1470, #1474, #1475, #1478, #1479, #1480 and #1482; #1484 is CI-only. The notes now cover main through 285a5e8. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Perf regression: hatch/hosted wall +21% (9c43dfc9..17793173)
There was an error while loading. Please reload this page.