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 — Replace a superseded patch generation's wiring on re-pin and remove by mikolalysenko · Pull Request #1035 · SocketDev/socket-patch Conversation
|
| Logic | Before | After |
|---|---|---|
| Hosted pin matching for remove/rollback identifiers | 2 (remove.rs hosted_pins_matching, inline loop in rollback.rs) |
1 (ledgers::hosted_pins_matching) |
| Same-release predicate (canonical base equal, or composer-equivalent) | 4 (ledgers::same_release added earlier in this PR, same_package in vex_sources.rs, same_package in vex/discover/mod.rs, inline in rollback::superseded_by_hosted from #934) |
1 (vex::discover::same_release) |
socket-patch-<uuid> prefix constant / exact parser |
3 (vendor::cargo_config::SOCKET_REGISTRY_PREFIX, the literal in socket_patch_name_uuid_exact, a literal in vex/discover/maven.rs) |
1 (generation::PIN_NAME_PREFIX, generation::pin_name_uuid) |
socket-patch-<uuid> name formatting in production code |
9 (cargo, maven and nuget rewriters; cargo, maven (×2) and nuget restores; vendor/nuget_feed.rs; vex/discover/cargo.rs) |
1 (generation::hosted_pin_name) |
Maven <repository> lookup by id + own-line removal |
1 (private to upstream/maven.rs) |
1 (extracted as maven_repositories_with_id / remove_maven_repository, now shared by the rewriter and the restore) |
The remaining socket-patch-… literals are in tests, in diagnostics text, and in vex/discover/mod.rs test helpers.
All commands ran on macOS through the shared limiter with CARGO_INCREMENTAL=0 -j4, after rebasing onto main 1bbcbe3c.
cargo test -p socket-patch-core --lib: 5614 passed.cargo test -p socket-patch-cli --all-features --lib -- commands::rollback commands::remove commands::vex_sources: 82 passed.cargo test -p socket-patch-cli --all-features --test remove --test rollback --test in_process_rollback_hosted --test in_process_rollback_vendored --test in_process_redirect --test in_process_remove_repair_lifecycle --test in_process_rollback_all_ecosystems --test e2e_golang_hosted_state --test e2e_redirect_cargo_shapes --test e2e_vex --test e2e_vex_redirect --test e2e_vex_vendor --test covgap_commands_vex: all green.cargo clippy -p socket-patch-core -p socket-patch-cli --all-targets --all-features: no findings on changed lines. -D warnings fails on this host because of pre-existing findings on main (for example python_crawler.rs unix_default, jvm_jar.rs, and doc-comment blank lines in maven_repo.rs and nuget_feed.rs). Left to CI.owned_pin_generation_matrix::{cargo_repin_drops_the_superseded_registry_block, golang_repin_drops_the_superseded_gosum_pair, maven_repin_moves_the_suffix_and_drops_the_superseded_repository, maven_rotated_grant_token_refreshes_the_repository_url, maven_repin_drops_superseded_checksums_from_a_crlf_file}, upstream::cargo::tests::restore_sweeps_a_leftover_superseded_registry_block, remove_invariants::{remove,rollback}_by_uuid_reverts_vendoring_when_ledger_generation_is_older, in_process_rollback_hosted::remove_and_rollback_by_superseded_record_uuid_unhost_the_release.maven_vendored_suffix_literal_is_not_a_prior_generation (it pins the mismatch skip that the earlier head of this PR broke) and restore_keeps_an_unselected_generation_still_referenced.golang_rewrite.golden was re-blessed. Its re-run cases feed the rewriter's output back in, and that output no longer carries superseded sum lines.e2e_redirect_maven_build, e2e_golang_hosted_build, e2e_redirect_cargo_build, mode_migration_cargo).owned_pin_generation_matrix covers hosted re-pins only, at the planner level. The pending_build / build_failed / not_found policy is still decided per mode. Vendored npm re-scan exits 1 ("Failed to vendor", "1 failed") on every run while a superseding patch's artifact is pending_build / build_failed / not_found, although the vendored older patch is intact; hosted skips the same upgrade with exit 0 #954 (a vendored re-scan exits 1 while a superseding patch is pending) is claimed by Fix open npm issues #1008 (pm:npm). The shared policy (keep the recorded generation and report a skip, as hosted does) should land there or on top of this module.remove or rollback. Only the cargo restore sweeps.Cargo.toml, the workspace members and Cargo.lock. A block that only a non-member or excluded crate under the root uses (and that its own lock does not name in the root lock) would be swept. The hosted rewriter never writes such a pin itself.socket-patch-<uuid> source on re-pin) and gem are not done. Maven and NuGet are lower priority.canonical_base_purl still has two copies (rollout.rs and vex/discover/mod.rs). That is out of scope for B07.🤖 Generated with Claude Code
Note
Medium Risk
Changes remove/rollback selection and multi-ecosystem lockfile rewrites; mistakes could leave patches half-wired or over-unwind pins, though behavior is heavily tested and fail-closed on restore refusals.
Overview
Enforces one owned pin per package release (patch uuid = generation): a new patch::redirect::generation module centralizes socket-patch-<uuid> naming and supersede detection, and remove / rollback identifiers now span generations—matching a manifest entry also selects the vendored ledger entry that key claims and hosted lockfile pins for the same release, so removing by an older uuid unwinds newer hosted wiring instead of leaving orphan pins (#999).
Hosted re-pins drop stale wiring from the previous generation: Cargo removes unreferenced [registries.socket-patch-<old>] blocks on re-pin and on upstream restore (#864); Go strips the prior gopatch module’s go.sum pair (#682); Maven re-pins earlier -socket.<hex8> literals when the pom still declares that generation’s repository, drops superseded repos/trusted checksums, and refreshes rotated grant URLs (#266). Shared same_release replaces ad-hoc composer/package matching in vex and rollback paths.
CLI contract and ecosystem docs describe the new identifier and unwind behavior; tests cover ledger-generation remove/rollback, superseded hosted unwind, and a cross-ecosystem owned-pin matrix.
Reviewed by Cursor Bugbot for commit 0a9ae86. Configure here.
Generated by Claude Code
Sorry, something went wrong.
There was an error while loading. Please reload this page.
remove <uuid> and rollback <uuid> matched the vendor ledger and the hosted pins by the raw identifier only, never by the manifest entries the identifier selected. When the manifest recorded a superseding patch B while the ledger still held the vendored generation A, `remove <B>` dropped the manifest record and left A's vendoring wired, reporting success (#999). Ledgers::matching now also selects the vendored entries a matched manifest key claims, and the new ledgers::hosted_pins_matching selects the hosted pins wiring the same release as a matched manifest key. remove and rollback both route through them; the duplicate pin matcher in remove.rs and the inline loop in rollback.rs are deleted. Un-ignores remove_by_uuid_reverts_vendoring_when_ledger_generation_is_older and adds its rollback twin. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A hosted re-pin to a superseding patch moved the pin but left the old generation's wiring behind: - cargo kept [registries.socket-patch-<old>] in the cargo config, and remove never swept it (#864); - Go kept the old gopatch module's go.sum pair, so `go mod tidy -diff` failed after every patch update (#682); - Maven treated an earlier `-socket.<hex8>` literal as a user mismatch and never re-pinned, and a rotated grant token left the stale repository URL in place (#266). Add patch::redirect::generation, the shared owned-pin generation policy: one live socket-owned pin per release, a re-pin replaces the previous generation and drops the wiring only it used, and a restore sweeps every unreferenced generation. The cargo, Go and Maven rewriters and the cargo restore use it; cargo, Maven and NuGet pin names now come from its single hosted_pin_name, and the upstream Maven restore reuses the rewriter's repository lookup/removal instead of its own copy. Adds an owned_pin_generation_matrix test module (cargo, Go new-uuid and republish, Maven supersede and token rotation) asserting that no file names the superseded generation and a re-run is a no-op. The Go equivalence golden is re-blessed: its re-run cases feed the rewriter's own output back in, which now carries no superseded sum lines. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The `socket-patch-<uuid>` grammar now lives only in patch::redirect::generation: PIN_NAME_PREFIX, hosted_pin_name and pin_name_uuid (the exact parser moved there from redirect/mod.rs as socket_patch_name_uuid_exact). vendor::cargo_config::SOCKET_REGISTRY_PREFIX is deleted, and the hand-built names in vendor/nuget_feed.rs, vex/discover/cargo.rs, vex/discover/maven.rs and upstream/maven.rs go through the generation helpers. The same-release predicate (canonical base equal, or composer equivalent) had four copies: ledgers::same_release, same_package in vex_sources.rs and in vex/discover/mod.rs, and the inline filter in rollback::superseded_by_hosted. vex::discover::same_release is the one left; the others are deleted and their call sites routed through it. The generation module doc now says what is implemented: the Go and Maven restores do not sweep residue an older CLI left, and vendored NuGet uses the same socket-patch-<uuid> source key. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A `<base>-socket.<hex8>` literal counted as an earlier hosted generation whenever its base matched, so a vendored reactor / sbt pin (the same suffix under a socket-patch-vendor-<uuid> repository) was silently re-pinned when the vendor ledger was missing. It is now a prior generation only when the pom declared a hosted socket-patch-<uuid> repository whose uuid starts with that hex8; otherwise the redirect_maven_dep_version_mismatch skip stays. The trusted-checksums drop split a CRLF file one way for the check and another for the filter, so superseded entries survived and every re-run rewrote the file. The file is LF-normalized first and both use the same line test. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A leftover socket-patch-A block beside the live pin B is swept when B is restored, and the emptied config is deleted (#864). A generation the restore did not select that a manifest still pins keeps its block. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
`remove <uuid A>` and `rollback <uuid A>` of a manifest record that a hosted scan superseded with patch B now unwind B's lockfile pin too (one owned pin per release). CLI_CONTRACT says so for both commands, and that the hosted restore can then refuse offline. The in-process test reuses the #933 fixture and drives both commands by the superseded uuid. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
137891d to
da19b80
Compare
…fecycle # Conflicts: # crates/socket-patch-cli/CLI_CONTRACT.md
This branch now removes a superseded generation's [registries.*] block on re-pin (d548f08), but the cargo/cargo/supersede redirect fixture and the VEX discovery golden still expected the old socket-patch-0000... block to survive, so redirect_golden and committed_fixture_corpus_matches_golden failed. Record the new config, the redirect_cargo_superseded_registry_removed edit, and regenerate the discovery golden with SOCKET_PATCH_UPDATE_GOLDEN. Co-Authored-By: Claude <[email protected]>
|
bugbot run 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 a problem 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.
There was an error while loading. Please reload this page.
|
bugbot run 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 a problem 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.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
The Benchmarks job flagged maven/rescan at +9-11% wall and CPU on three consecutive heads of this branch. The supersede work added two per-pom lookups that each re-scanned the whole pom with the repository regex: the hosted-generation set (one scan per named generation) and the rotated-token URL refresh (one scan per patched dep, even on a no-op rescan). Read every <repository>'s id and url in one pass up front. The hosted generations come from that index (an exact `socket-patch-<uuid>` id is the same set the per-uuid lookup produced), and while the pom is still unchanged the refresh is skipped unless the index shows exactly one repository with that id whose url differs, which is exactly when refresh_maven_repository_url would have rewritten it. Once the pom has changed this run, the refresh runs as before. Local compare against main (perf profile, 15 paired runs): maven/rescan +3.8% -> +0.6%; maven/hosted unchanged (+1.7%). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The superseded-repository cleanup removed every socket-patch-<uuid> repository whose uuid starts with the old suffix's eight hex digits. The suffix carries only those eight digits, so another artifact's live `-socket.<hex8>` pin from a different uuid with the same prefix lost its repository and stopped resolving. Skip the removal while any `-socket.<hex8>` literal remains in the pom, and pin it with a two-artifact re-pin test. Co-Authored-By: Claude <[email protected]>
|
bugbot run Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Burn-down agent handing off to the CI-green driver now holding this PR: on top of your 49c8d33 I pushed 0a9ae86 (rebased, no force) fixing Bugbot thread 4211624219 — Maven re-pin cleanup no longer drops a live pin's 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.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
Bugbot Autofix is ON. A cloud agent has been kicked off to fix the reported issue.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 0a9ae86. Configure here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
…fecycle Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
… pinned The hex8-sharing guard skipped the whole superseded-version cleanup, so a re-pin that kept another artifact's -socket.<hex8> literal also left the abandoned generation's jar and pom entries in the trusted checksums file. Those entries are keyed by the artifact's own GAV and cannot belong to the twin pin, so only the repository removal is now guarded. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Pick up #1093 so PR CI runs without the macOS legs. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
There was an error while loading. Please reload this page.
Resolve conflicts with #1035 (supersede lifecycle), #1038 (shared repo-root walk), and #1033 (unwired VEX copies): - #1035 added `vex::discover::same_release` and a second `canonical_base_purl` there. `PurlKey::same` already treats composer version spellings as one release, so every `same_release` call (vex_sources, rollback, discover, and `ledgers::hosted_pins_matching`) now uses `PurlKey::same`, and the duplicate helpers are dropped. - Both sides' new ledgers tests are kept. - The repo-root lookup in `policy` takes main's `utils::repo_root` version. `canonical_pypi_purl` stays deleted (nothing calls it now). - `vex` re-exports main's `UnattestedKind`. `UnwiredCopy::covers` compares purls with `PurlKey::same` rather than raw string equality. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Brings in #1044 (governing lock table), #1035, #1038, #1083, #724. Drop the BUN_LOCK/BUN_LOCKB/NPM_LOCKS imports #1044 added to npm_flavor.rs: their only user, vendored_entry_in_use, is removed by this PR (liveness now comes from Discovery::vendor_entry_in_use). This unused import failed clippy in the merge group. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Resolve conflicts with #1038 (shared repo-root walk, Option m2_repo) and #1045; route #1035's superseded-checksum path and the hosted engine's Gradle root files through vendor::jvm::layout. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The only conflict was tests/equivalence/golang_rewrite.golden. Both sides re-blessed it: this branch because go.mod appends now take their terminator from line_endings::terminator, and main (#1035) because the superseded-gosum cleanup changes the go.sum output. A textual pick of either side would drop the other's behavior, so the golden was re-blessed on the merged code. Lines only one side changed keep that side's digest; the 53 lines both sides changed get new digests. Co-Authored-By: Claude <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
remove <uuid> deletes the manifest entry but leaves the package vendored when the vendor ledger holds an older patch generation Hosted cargo re-pin to a superseding patch leaves the old uuid's [registries.socket-patch-*] block in .cargo/config, and remove never deletes it Hosted Go redirect leaves the superseded gopatch module's go.sum lines behind when a newer patch replaces an existing redirect, sogo mod tidy is no longer a no-op
Hosted Maven never re-pins: a superseding patch uuid or a rotated grant token leaves the old wiring in place
There was an error while loading. Please reload this page.