Repository navigation
fence: go.sum completeness across the multi-module tree (#976) - #985
Conversation
The #975 class: a merge changed one module's import surface (#938's nip19 in package config_manager) and left three importers' go.sum incomplete; every gate that ran stayed green because go.sum completeness was nobody's beat — check-deps-sync.py covers go.mod Require sync only, and per-PR verification builds the PR's touched modules, not every importer. Only the 2026-10-16 night battery caught it, hours after merge. tests/contract/check-gosum-completeness.sh probes every module under src/ (glob discovery, never enumeration) with the exact failing command — go build ./... from inside the module dir (#961), GOWORK=off and -mod=readonly so nothing rescues an incomplete go.sum — and fails loudly naming the modules, quoting the missing-entry lines, with the go-mod-tidy fix hint. ~2s warm for all 18 modules; test files are the battery's beat, keeping the fence per-push cheap. Negative controls, both proven: the hermetic --selftest strips the go.sum lines of a dependency chosen from the module's own dep graph (rot-proof) and requires the probe to go red; and the live one — on current main the fence is RED on exactly merchant_types, upstream_detector and upstream_session_manager until #975 lands (the documented sequencing: #975 first, or accept the temporary red). Wired into release-check's deps leg and both test.yml twins' deps-and- imports jobs (the twins have drifted on main — pre-existing, noted in the PR, not touched here).
|
Evidence review (#976 fence — independently verified on x280, live negative control included):
Ready for approving review; tracked on #965. |
Local CI gate — PR #985: fence: go.sum completeness across the multi-module tree (#976)Run of
Verdict: 2 leg(s) RED — 4 green. What this gate does not run (no vacuous green)
failing-leg log tailscontract-fences — tailgo-battery — tail |
|
Stamp context (this seat): both reds are the documented tree-age classes — battery = the pre-#975 go.sum trio (this branch adds the fence for that class; the fix is #975, so its own base carries the breakage by design), contract-fences = the pre-#1000 doc-facts/desync drift. Fittingly, the fence this PR ships goes green the moment #975 lands (proven in the release-prep dry-run: 18/18 inside release-check with both merged). |
Local CI gate — PR #985: fence: go.sum completeness across the multi-module tree (#976)Run of
Verdict: 2 leg(s) RED — 4 green. What this gate does not run (no vacuous green)
failing-leg log tailscontract-fences — tailgo-battery — tail |
Evidence review — 13-criteria pass (verified at head, with a bonus live negative)Fence mechanism verified twice over at this head:
Shape review: probe = the exact failing command ( Merge note (same class as #1039): rebase onto current main first — the three carriers are fixed there (#1013/#1032/#1030), so the fence goes green on its own tree; without the rebase it ships red-on-self. After merge: this is the fence the #975/#1013 history justifies, and the natural negative-control home for the cold-cache class #1013's diagnosis named (warm-cache CI passing while cold vet fails — worth one seeded-failure test in the follow-up the body's boundary statement already scopes). Verdict: mechanically ready post-rebase. Human gate. |
c03rad0r
left a comment
There was a problem hiding this comment.
Technical review — head 5eb29a7. The fence is right and it has already earned its keep; approve with a sequencing condition.
The shape is exactly the check-ssid-format pattern done well: probe the real failing command (GOWORK=off GOFLAGS=-mod=readonly go build ./...) from inside each glob-discovered module, categorize the failure, and refuse to hide a non-go.sum red behind the category. The hermetic --selftest is the part most fences skip: deleting the last go.sum line did not fail (not every sum is build-required), so the fixture derives its victim from go list -deps — the control is load-bearing.
Verified here:
bash tests/contract/check-gosum-completeness.sh --selftest
selftest ok: stripping 'github.com/ImVexed' go.sum lines in a temp copy of config_manager fails the probe
It also caught a real main break, which I fixed: current main still fails the probe in src/upstream_detector and src/upstream_session_manager (missing btcsuite/btcd/btcec/v2 resolution from go-nostr v0.51.12; #975 was closed unmerged). I opened #1120 with go mod tidy in both modules — all 18 modules now build with GOWORK=off -mod=readonly, so the fence lands green.
Condition: the branch still points at an older main, so at its head the fence is red (3 modules, incl. merchant_types). Rebase onto current main after #1120 lands and re-run the fence before merge — otherwise the PR that adds the fence is the one that turns the lane red.
Disposition: land (after #1120 + rebase).
* fix(deps): complete go.sum for the two go-nostr carriers (#975) `GOWORK=off GOFLAGS=-mod=readonly go build ./...` fails in src/upstream_detector and src/upstream_session_manager: go-nostr v0.51.12 imports btcsuite/btcd/btcec/v2 and the carriers' go.sum lacks the entries that resolve it (btcutil v1.1.6). The night battery caught it; no per-PR gate did, which is what #985's fence is for. `go mod tidy` in both modules adds the missing sums and drops requires the tidy graph no longer needs. Verified all 18 module builds green with GOWORK=off and -mod=readonly, and deps-sync + gonuts-pin fences still pass. * changelog: fragment for #1120 --------- Co-authored-by: felixfelix-bot <felixfelix-bot@users.noreply.github.com>
What
tests/contract/check-gosum-completeness.sh— the fence for the #975 class: a merge can change one module's import surface (e.g. #938 adding nip19 topackage config_manager) and leave every importer's go.sum incomplete.go buildthen fails withmissing go.sum entry, but only for that module — and no gate owned that beat (check-deps-sync.py= go.mod Require sync; per-PR verification builds the PR's touched modules, not every importer). Only the 2026-10-16 night battery caught it, hours after merge.Shape (per #976's proposal, and the repo's fence patterns)
go build ./...from inside each module dir (ci: go test fails in git worktrees — 'main module does not contain package' error #961 discipline), withGOWORK=off GOFLAGS=-mod=readonly— no workspace rescue, no re-tidy rescue; each module resolves against its own go.sum.go.modundersrc/(18 today; a new module must not need a fence edit).missing go.sum entrylines, prints thego mod tidyfix hint to stderr; non-gosum build failures are reported separately (still red — a fence that hides a red behind a category is decoration).go testlegs — that boundary is stated in the header).release-check.shdeps leg (the per-push shape) + bothtest.ymltwins'deps-and-importsjobs, one identical step each.Negative controls — both proven
--selftest): temp-copies a real module, strips the go.sum lines of a dependency chosen from that module's owngo list -depsoutput (so the fixture cannot rot with dep churn), and requires the probe to go red. Verified:selftest ok: stripping 'github.com/ImVexed' go.sum lines in a temp copy of config_manager fails the probe. (A naive "delete the last go.sum line" fixture was tried first and did not fail — not every sum line is build-required; the graph-derived victim is the fix.)src/merchant_types,src/upstream_detector,src/upstream_session_manager— the fix(deps): restore battery-green main — bech32 go.sum entries for #938's nip19 import surface #975 breakage, named, with thebtcsuite/btcd/btcutil/bech32missing-entry lines quoted, exit 1. Full transcript in the verification section below. This is the fence working as designed: main stays red until fix(deps): restore battery-green main — bech32 go.sum entries for #938's nip19 import surface #975 lands — sequencing note for the owner: land fix(deps): restore battery-green main — bech32 go.sum entries for #938's nip19 import surface #975 first and this PR's lanes go green, or land this first and accept the temporary red (either order proves the fence).Evidence (this branch)
bash -nclean;release-check.shsyntax-clean with the new leg.Notes
test.ymltwins are documented byte-identical (.ngit/README.md) but have substantially diverged on main (the.githubtwin carries a happy-path job and more). This PR added the identical step to both; reconciling the twins is its own change.