You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d3d3154
Browse filesBrowse the repository at this point in the historyBrowse files
Fix Go replace-target patches reported applied (#1823) (#1824)
* Start fix for #1823
Assisted-by: Claude Code:claude-opus-5-5
* Test Go patch of a module used only via replace
Add an end-to-end regression for #1823: when go.mod replaces a fork
with the patched module (`replace other.com/fork => upstream v1.0.0`),
go records the upstream's go.sum lines but never applies a replace of
the upstream itself. apply, apply --check and vex all reported the
patch as in effect while go linked the unpatched code.
Assisted-by: Claude Code:claude-opus-5-5
* Refuse Go patches for replace-only modules
A module the build uses only as the target of another module's
replace (`replace other.com/fork => example.com/upstream v1.0.0`) has
its go.sum zip line under its own path, so the build-list check took
it as built. go doesn't chain replaces, so a Socket replace of it is
silently ignored: apply reported success, apply --check passed and
vex attested not_affected while the build stayed unpatched.
The shared build-list check now ignores a zip line that a
module-to-module replace in go.mod explains (go refuses a build that
uses one module@version under two paths, so it can't be the module's
own) and reports the module as a replace target. apply and vendor
refuse it, apply --check flags it, vex leaves it out, the hosted
rewriter refuses it (redirect_golang_not_in_module_graph) and VEX
discovery treats an existing hosted pin of it as inert.
Fixes#1823
Assisted-by: Claude Code:claude-opus-5-5
* Only count a fork replace that is in effect
go mod tidy keeps unused replace directives. A fork replace of a
module go.mod doesn't require, one pinned to a version other than the
required one, or a version-less one that a versioned replace of the
same module shadows doesn't change what go builds, so it must not
discount the patched module's own go.sum line. Also stop quoting a
version-less directive in the refusal messages, which misquoted a
versioned replace, and cover the agent-mode drift and refusal with a
unit test.
Assisted-by: Claude Code:claude-opus-5-5
---------
Co-authored-by: Claude <noreply@anthropic.com>
0 commit comments