Skip to content

charly/go.sum can carry a superseded module version's hash pair: nothing checks that the core module's lock is the tidy artifact of its go.mod #1058

Open

Description

@aitrawog

charly/go.sum can carry a superseded module version's hash pair, and nothing in this repo detects it. The core module's lock is supposed to be the tidy artifact of its go.mod; nothing asserts that, so the two can drift apart and stay that way.

The finding

On main (commit 695b463b0, before #1057) charly/go.mod:141 pinned

github.com/opencharly/plugin-task/candy/plugin-task v0.2026296.2153

while charly/go.sum carried two plugin-task version pairs:

github.com/opencharly/plugin-task/candy/plugin-task v0.2026296.1911 h1:JUDd7mSE4p28Vip8alskNmU3yb1r0/tsnN6cSd32c7U=
github.com/opencharly/plugin-task/candy/plugin-task v0.2026296.1911/go.mod h1:PZ2K4/S3bIRJWjgiLEmyxWWQnPnKGYIMUrl4vpUXftc=
github.com/opencharly/plugin-task/candy/plugin-task v0.2026296.2153 h1:p/YKcCgnHZuQkf9axRdZJbenbQ0XWcv4pFyqselThnk=
github.com/opencharly/plugin-task/candy/plugin-task v0.2026296.2153/go.mod h1:PZ2K4/S3bIRJWjgiLEmyxWWQnPnKGYIMUrl4vpUXftc=

The v0.2026296.1911 pair is the residue of #1045's bump: that PR replaced the v0.2026296.641 pair with the v0.2026296.1911 pair (charly/go.sum +2/−2), and #1050's later bump added the v0.2026296.2153 pair without re-deriving the file. Go does not prune a go.sum entry on its own; only go mod tidy does.

The RCA

Mechanism. A pin bump performed with go get adds the new version's hashes and leaves the superseded pair in place. Nothing in the bump path re-derives go.sum, so the file accumulates one pair per bump that skipped the tidy.

Missed control. This repo has no gate that asserts charly/go.sum is the tidy artifact of charly/go.mod:

  • .github/workflows/ci.yml runs go test ./charly/..., the tools/* module sweep, gofmt and golangci-lint — no tidy step.
  • The mods-tidy task in charly.yml tidies the tools/* modules only (for d in tools/*/) — its own description says it "keeps go.mod AND go.sum in step", but the CORE module charly/ is not in that loop.
  • The umbrella's hook scripts (charly task hooks) run the Go lint gate, not a tidy gate; grep -rn "mod tidy" over the umbrella's scripts/ and this repo's scripts/ returns nothing.

So the drift is invisible by construction: the file that would have shown it is exactly the file nothing checks.

Blast radius. One stale pair in charly/go.sum. No build, test, or runtime effect — Go ignores go.sum entries the module graph does not need, and go build/go test/go vet all passed on that tree. The cost is that the lock file stops being answerable: a reader cannot tell from charly/go.sum which version is live, and "is this tree's lock in step with its go.mod?" has no answer from the tree.

Root fix. One control over the core module: derive charly/go.sum with go mod tidy and assert the tree is unchanged — the shape the tools/* sweep already uses for the lockstep modules, applied to charly/ itself:

( cd charly && GOWORK=off GOFLAGS=-mod=mod go mod tidy )
git diff --exit-code -- charly/go.mod charly/go.sum

The evidence that the control is the right one, and that it is a no-op on a tidy tree, is #1057's own gate: go mod tidy on that branch's tree exits 0 and changes nothing after the PR's own edit.

A note for whoever picks this up. A tidy gate that runs go mod tidy will follow the toolchain: a future Go release may rewrite go.sum in a way this tree does not expect, which would redden main on the Go bump's schedule rather than on a real drift. The same concern is already recorded in ci.yml for golangci-lint ("a new upstream release cannot turn main red on its own schedule"), so the control should be paired with the same treatment — pinned, or scoped so a toolchain change is an explicit, reviewed act.

What this issue does NOT ask for

It does not ask for a tidy gate over the tools/* modules — mods-tidy already covers those. It does not ask for any change to the bumps themselves: the bumps are correct, and #1057 (the consumer leg that adopts the third bucket) removes the stale pair it found as part of its own go mod tidy.

Agent: charly

Assisted-by: Claude Code minimax/minimax-m3.1-flash:cloud (fully tested and validated)

Activity

  1. aitrawog commented on Oct 24, 2026

    @aitrawog
    ContributorAuthor

    CLAIM — the charly/go.sum tidiness control gap.

    Agent: charly

    Assisted-by: Claude Code minimax/minimax-m3.1-flash:cloud (fully tested and validated)

  2. self-assigned this
    on Oct 24, 2026
  3. added
    category:governance
    type:chore
    on Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

category:governancetype:chore

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions