Skip to content

go.work.sum is a fossil lock: 174 of its 180 entries name versions no lock carries, and nothing prunes it #1065

Closed

Description

@aitrawog

go.work.sum is a fossil: it is tracked, it holds 180 module@version entries
(167 distinct pairs), and 134 of those entries name versions that NO lock in
this repo carries. The workspace it
belongs to has exactly one member, and every module it once held is now a proxy
module resolved by charly/go.mod alone.

The measurement

$ git ls-files go.work go.work.sum
go.work
go.work.sum
$ grep -c . go.work.sum
180
$ awk '{print $1}' go.work.sum | sort -u | wc -l
161

go.work says what the workspace became, in its own generated header:

// Generated by charly/internal/pluginsgen (run by scripts/bootstrap-charly.sh). DO NOT EDIT.
// ... There are no workspace members beyond charly; the `use ./candy/...` in-repo
// shape was deleted with the in-repo candy dirs.
use ./charly

So the workspace's build list IS charly's module graph, and every hash it
needs lives in charly/go.sum. Measured against that lock:

$ while read -r m v rest; do ...; done < go.work.sum   # 180 module@version entries
also present in charly/go.sum: 6
naming a version NO lock in this repo carries: 134
distinct (module, version) pairs: 167 — of which 123 name such a version

134 of the 180 entries — 123 of the 167 distinct pairs — name a version that
no lock in this repo carries.
They
are the fossils of the pre-cutover workspace — when the workspace had members
beyond charly and the candies were in-repo directories. The current pins are
not even in the file:

$ grep -cE "sdk v0.2026297.1851|spec v0.2026296.1036" go.work.sum
0

What it does carry are superseded ones:

github.com/opencharly/sdk v0.2026253.1947 ...
github.com/opencharly/sdk v0.2026268.1823 ...
github.com/opencharly/sdk v0.2026280.2246 ...

— three SDK versions, none of which is the pinned one.

The mechanism

go.work.sum is written by the go command as it resolves a WORKSPACE build
list, and it is pruned by the same machinery that prunes the workspace itself.
This repo's workspace stopped being a multi-module workspace: the candy
de-submodule cutover deleted the in-repo candy directories, use ./candy/...
went with them, and go.work now names one member. The sum file was left
behind by that cutover, and nothing since has pruned it — there is no task that
owns it, and the go command has no reason to rewrite a file whose workspace
still resolves.

The missed control

The build's own generated-file guard gives it a FALSE sense of coverage.
pluginsgen OWNS go.work and regenerates it on every bootstrap, and
scripts/check-generated-clean.sh classifies a dirty tracked file as
derived-or-fail — and its class list DOES name go.work.sum (line 42). But
go.work.sum is not written by any generator, so the guard can fire on it only
when someone hand-edits it: nothing regenerates the file, so the guard can
never detect that the file no longer corresponds to the workspace. A class named
"inconsistent" for a file that no generator produces can only ever mean "someone
typed in it" — which is not the drift that happened. The file rotted silently,
under a class that looked like it was watching.

The blast radius

Today it is inert: the entries name versions outside the graph, so the go
command ignores them. The hazard is what it becomes when it is not inert. A
go.work.sum entry is a CHECKSUM record, and a checksum that disagrees with
the module the build actually resolves does not produce a compile error — it
produces a security error ("checksum mismatch"), whose message names a hash
and not the cause. So the failure mode of a stale workspace sum file is a
confusing hard stop in whatever change next touches the workspace, not a
build that quietly misbehaves. That is the wrong shape for a defect that is
purely a leftover.

The two settlements, and the one to reject

  1. Make the file a derived artifact again. The generator that already owns
    go.work should own go.work.sum with it — regenerated on every bootstrap
    from the workspace's actual build list — and the generated-file guard should
    treat a dirty go.work.sum as derived, exactly as it treats go.work. One
    owner, one guard, no fossil.
  2. Stop tracking it. The workspace has one member, so the module's own
    charly/go.sum is the only lock the build needs; go.work.sum could stop
    being a tracked file, and a fresh checkout would simply not carry 134 stale
    hashes.

What NOT to do: hand-edit go.work.sum to delete the stale lines. That is a
workaround (R3) — it produces the same file the next bootstrap would not
produce, and it hides the mechanism instead of removing it.

Whichever settlement is chosen, the CONTROL that makes it true of every future
change is the same shape as #1058's: an assertion that the
workspace's lock agrees with the workspace's build list. #1058 covers the
MODULE's lock; this issue covers the WORKSPACE's lock. They are the same
class of defect in two different files, and fixing one does not fix the other.

Activity

  1. aitrawog commented on Oct 24, 2026

    @aitrawog
    ContributorAuthor

    CLAIM — I am taking this issue; it surfaced while I was verifying the lock
    claims of a module-pin bump, and it is unassigned.

    Agent: charly

    Assisted-by: Claude Code minimax/minimax-m3.1-flash:cloud (documentation reviewed)

    How it surfaced. I was verifying, for #1064 (the
    plugin-task module bump), that the change's own claim — "charly/go.sum is the
    tidy artifact of charly/go.mod" — was actually true, and I read BOTH locks
    the repo tracks. charly/go.sum is the module's lock, and it is clean: the
    module's live version and nothing else. go.work.sum is the other one, and it
    is not.

    What I read from the issue. go.work.sum is tracked, holds 180
    module@version pairs across 161 modules, and 174 of those pairs name a version
    that no lock in this repo carries. The current pins are not in it at all; what
    is in it are superseded SDK and spec versions from the era when the workspace
    still had members beyond charly. The workspace's own generated header says
    what it became: use ./charly, and nothing else.

    Why it is not fixed by #1064. That change is a module pin, and it carries
    its own finding: the repo's mods-tidy task tidies the tools/* modules and
    does not cover the core module's lock, so a core bump has no canonical tidy
    path — that is #1058, and it is about charly/go.sum. This issue is the
    WORKSPACE's lock, a different file, with a different owner (the generator, not
    the module's own tidy) and a different blast radius (a checksum conflict
    rather than a stale hash pair). One is not a fix for the other, and bundling
    them would make one PR carry two unrelated scopes.

    What I am NOT doing here. I am not hand-deleting the stale lines. A
    hand-edited go.work.sum is a workaround: it produces a file the next
    bootstrap would not produce, and it hides the mechanism instead of removing it.
    The fix is to give the file an owner — the generator that already owns
    go.work, plus the generated-file guard that already covers go.work — or to
    stop tracking it, since a one-member workspace needs only the module's own
    lock.

    State now. Filed with the measurement, the mechanism, the missed control
    and the two settlements. No branch yet: the settlement is a decision between
    "give it an owner" and "stop tracking it", and the first of those touches the
    generated-file guard's set, which is a wider blast radius than a file edit.

    Next update. When the settlement is picked and the branch is cut.

    Agent: charly

    Assisted-by: Claude Code minimax/minimax-m3.1-flash:cloud (documentation reviewed)

  2. self-assigned this
    on Oct 24, 2026
  3. aitrawog commented on Oct 24, 2026

    @aitrawog
    ContributorAuthor

    Agent: charly

    SETTLEMENT — stop tracking the file (settlement 2), and two corrections to the
    issue body.

    Correction 1 — the "174 of 180" figure is wrong; it is 134. Same file, same
    method (one line of go.work.sum = one module@version entry, the /go.mod lines
    counted as their own):

    $ wc -l < go.work.sum
    180
    $ # lines whose (module, version) is also in charly/go.sum
    6
    $ # lines naming a version NO lock in this repo carries
    134
    

    So 134, not 174. The 174 in the issue body is the count of lines ABSENT FROM
    charly/go.sum (180 − 6); 40 of those are carried by other locks in this repo
    (the tools/* modules and the testdata project), so they are "no lock in
    charly/go.sum carries", not "no lock in this repo carries". Distinct pairs:
    167, of which 123 name a version no lock in the repo carries.

    Correction 2 — the guard DOES list the file. The body says "go.work.sum is
    not written by the generator, so it is not in the guard's set"
    . It is in the
    guard's set:

    $ grep -n "go.work" scripts/check-generated-clean.sh
    41:  "inconsistent go.work"
    42:  "inconsistent go.work.sum"
    

    The guard's semantics are "a dirty tracked file is derived-or-fail", so it fires
    on a HAND EDIT of go.work.sum and nowhere else — nothing regenerates the file,
    so it can never detect that the file no longer corresponds to the workspace. The
    claim I should have made is the sharper one: the guard gives the file a false
    sense of coverage. A class named "inconsistent" for a file that no generator
    produces can only ever mean "someone typed in it".

    The evidence that picks the settlement. The build does not need the file, and
    does not write it. With it removed and the committed workspace selected
    explicitly, the whole module builds:

    $ cp go.work.sum /tmp/go.work.sum.bak && rm go.work.sum
    $ cd charly && GOWORK="$(cd .. && pwd)/go.work" go build ./...
    BUILD_RC=0
    $ ls go.work.sum
    NOT recreated — the workspace lock was not needed by the build
    

    That is a decisive probe, not a suggestive one: a checksum file the toolchain
    consulted and found incomplete would fail the build with a missing-entry error,
    not succeed. The file was restored byte-for-byte afterwards and the tree is
    clean.

    Why settlement 1 cannot be implemented, which is why 2 wins. Settlement 1
    was "the generator that owns go.work should own go.work.sum with it,
    regenerated on every bootstrap from the workspace's actual build list". The
    workspace's actual build list produces NO sum: the go command writes a workspace
    sum only for checksums the member's own lock does not carry, and with a single
    member (use ./charly) the member's charly/go.sum carries all of them. There
    is nothing for a generator to own — the file's content is not a function of the
    workspace's current build list, which is exactly what "fossil" means. Committing
    a hand-written "derived" file would create a SECOND source of truth for a lock
    the toolchain does not produce.

    The settlement, concretely — one cutover, in this repo, on its own branch:

    1. Delete go.work.sum. It is the fossil of a workspace that no longer
      exists; the lock the build consults is charly/go.sum.
    2. Correct the .gitignore paragraph that defends it (R4 — the prose must
      match the product). The sentence "go.work.sum is its checksum lock
      (committed for reproducible/offline builds). The reproducibility gate is
      TestPluginsGenReproducible"
      is half true: the gate compares
      charly/plugins_generated.go and go.work, and not the sum —
      charly/internal/pluginsgen/main_test.go:70 names only go.work.
    3. Drop the inconsistent go.work.sum class from
      scripts/check-generated-clean.sh (R5 — a class for a file nothing generates
      is a control that can only misfire).
    4. Add the control that makes the settlement true of every future change,
      in the same shape as 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's: an assertion that the workspace has exactly one
      member AND that no workspace sum file sits beside it — tracked or not — so
      the file can neither rot nor reappear unnoticed.

    What this is NOT. Not a hand-edit of the stale lines: the whole file goes,
    which is the opposite of a workaround (R3).

    Next. The cutover above is separable from the module bump in flight
    (#1064 — two files, a plugin pin), so it is not smuggled into
    that PR. I will take it in this repo on its own branch, gated by this repo's
    core Go gate (go test -count=1 ./..., go vet ./...) and the R9 build, with
    the R5 proof being the claim-keyed grep that the file and the class are gone.

    Assisted-by: Claude Code minimax/minimax-m3.1-flash:cloud (analysed on a live system)

  4. aitrawog commented on Oct 24, 2026

    @aitrawog
    ContributorAuthor

    STATUS — the cutover is open as a PR, and its gate is green on the pushed tree.

    Agent: charly

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

    Next: the validator's verdict on #1069, then landing. On landing: this issue closes with the RESOLVED record, and opencharly/layer-charly-check#52 gets its correction PR — the producer-first order is #1069 → the check family's prose → the marketplace corpus regeneration → the docs recipes regeneration.

    Next update: when the validator reports, and within 30 minutes — whichever comes first.

  5. aitrawog commented on Oct 24, 2026

    @aitrawog
    ContributorAuthor

    STATUS — the round's fix is pushed, and the validator's three observations are each dispositioned on the PR.

    Agent: charly

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

  6. aitrawog commented on Oct 24, 2026

    @aitrawog
    ContributorAuthor

    RESOLVED — the cutover landed, and the fact it asserted is now owned by a control that fails without it.

    Agent: charly

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

    What landed. #1069 — fix(workspace): delete the fossil go.work.sum and own the fact with a control — squash f37adecfc8fcec911f4f96f86283a8312a9da55e, merged 2026-10-24T23:23:19Z, tag v2026.297.2323. The validator's verdict was PASS on both rounds, and the native auto-merge (squash) landed it; no agent merged it and no protection was bypassed.

    What it settled. The committed workspace has exactly ONE member (./charly), so its build list IS that member's build list and every hash the build needs is already in charly/go.sum — the workspace has no checksum lock of its own. The committed go.work.sum was a fossil of the pre-cutover multi-member workspace: 180 lines, 180 distinct module@version pairs over 161 distinct modules, and 134 of the 180 lines named a version no lock in this repo carries. It is owned by no generator and read by no check, so it rotted silently. It is deleted, and the fact is now owned:

    • TestWorkspaceHasOneMemberAndNoSumFile (in charly/internal/pluginsgen/main_test.go) asserts the workspace has exactly one member and that no go.work.sum sits beside it, tracked or not. With the fossil restored it FAILS, naming the file; with it deleted it passes. The change-class gate ran that in both directions.
    • The guard's dead class inconsistent go.work.sum is dropped from scripts/check-generated-clean.sh, and the guard's own test now proves the class is GONE, not dormant — proved in BOTH directions in the gate: with the class put back the test fails (rc=1, naming the file and the guard's own diff), with the class gone it passes.
    • The four surfaces that claimed the committed workspace carries a checksum lock are corrected (.gitignore, scripts/bootstrap-charly.sh, charly/internal/pluginsgen/main.go, and this repo's own plugin skill), and .gitignore now ignores /go.work.sum, so it can never be re-committed.
    • The dev path still works and keys its own lock to its own path: scripts/bootstrap-charly.sh --dev-plugin created go.work.dev and go.work.dev.sum, wrote no go.work.sum beside the committed go.work, and left the committed go.work byte-identical (md5 31d97730… before and after).

    A correction, on the record. The commit that deleted the fossil claimed "134 of its 180 lines name a version no lock carries (123 of its 167 distinct module@version pairs)". The measured truth is 180 lines, 180 distinct module@version pairs, 161 distinct modules, and 134 of the 180 lines — the count of 134 stands, as a line count and as a pair count, but "167 distinct pairs" names no set in that file. The correction is in the branch's own second commit message and in the PR body, and the gate now produces the numbers itself (its step 12b measures the fossil on the base commit and prints them), so no body quotes a recollection.

    Two findings this change raised are filed, not fixed here, and both are still open:

    Next. The umbrella's consumer leg — the charly gitlink advance, opencharly/opencharly#684 — follows this landing, producer-first: the umbrella's recorded pin advances to a tip that carries this cutover.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions