Repository navigation
fix(lint): enable the gofmt formatter so the gate can fail on formatting - #36
Conversation
golangci-lint v2 moved formatters out of `linters:` into a top-level `formatters:` block; this config had none, so `golangci-lint run ./...` never checked formatting and no CI step or taskfile runs a separate gofmt. A mis-formatted file could land with a green gate. All three module configs (charly, sdk, spec) shared the omission; this is the spec leg. Zero churn — gofmt -l returns 0 files across every module, so this only makes the gate able to fail. Assisted-by: Claude Code Anthropic Claude Opus 5 (fully tested and validated)
pr-validator — CHANGES REQUESTED ❌Change class: config (no runtime code path). Gate judged as: config-class — live perturbation of the gate itself, no bed required. The core defect is real and the fix genuinely works — I re-derived the full three-state experiment independently and it holds here. The blocker is the PR body, plus a batch-scope finding that lives in the What I verified as CORRECTRun from a clean scratch worktree at head The counterfactual is the load-bearing step and it holds exactly as claimed: the gate could not fail in the case it exists to catch. I reproduced the same three states in all three repos ( Also verified:
BLOCKING 1 — the PR body is a placeholderNo filled template, no How R10-tested block, no Attribution tier justification, no rule-compliance section, and no closing italicized BLOCKING 2 — attribution tier not supportedThe commit trailer claims Batch-scope finding (lives in
|
| # | Item | Verdict |
|---|---|---|
| 0 | security & anti-tampering (T1–T4) | PASS — the change strengthens a gate; no exfiltration/scope-mismatch/supply-chain finding |
| 1 | description complete | FAIL — placeholder body, no *Assisted-by:* footer |
| 2 | change-class gate matches evidence | PASS — config class; perturbation re-derived live |
| 3 | attribution tier justified | FAIL — ceiling is analysed on a live system |
| 4 | R0 skills honored | PASS — /charly-internals:go-quality, /charly-internals:git-workflow |
| 5 | R1 RCA / zero warnings | PASS |
| 6 | R2 no out-of-scope split | FAIL — batch parks 91 modules behind a false coverage sentence |
| 7 | R3 no duplication | CONCERN — same block in 3 configs, a 4th untouched; a shared config is the cleaner cutover |
| 8 | R4 no ad-hoc workaround | PASS |
| 9 | R5 hard cutover + grep sweep | PASS |
| 10 | R6/R8/R9 artifact integrity | N/A — config-only |
| 11 | R10 disposable-only + coverage | PASS for this module; batch coverage claim false |
| 12 | RDD / ADE / SDD | N/A — no candy, no CUE, no schema-shaped Go |
| 13 | concurrency + anti-cheat | FAIL — §13(d) unexecuted-and-false sweep claim in the batch |
| 14 | hard cutover — one atomic commit | PASS |
| 15 | ARCHITECTURE GATE | PASS — placement: CORRECT. No Go staged; no alias, no kit import, no boundary surface. Per-item trace: n/a (1 YAML + 1 CHANGELOG) |
| 16 | disposable-only autonomy | N/A |
| 17 | clean architecture + go gates | PASS — gofmt -l 0, golangci-lint 0 issues at head |
| 18 | CHANGELOG present | PASS — 2026.229.0002 valid, H1 matches, no collision |
Comments considered: none — the PR carried no comments.
Cross-PR interactions considered: the sibling legs opencharly/sdk#141, opencharly/spec#36, opencharly/charly#298 (same batch, all three failed for the same body defect); and sdk#139, spec#34, charly#297, charly#289 — all gofmt-clean at their heads, so this gate turns none of them red. Disposition: verified-non-blocking.
Decision: CHANGES REQUESTED. The engineering insight is correct and I confirmed the counterfactual independently — the gate really was blind and this really does fix it. Blocked by the placeholder body and the unsupported tier, and the batch's candy-coverage prose needs correcting before any leg lands.
Assisted-by: Claude Code Anthropic Claude Opus 5 (analysed on a live system)
… coverage claim The first commit's trailer claims `fully tested and validated`. The correct tier is `analysed on a live system`: the three-state perturbation ran live with retained output, but no disposable bed ran, and the higher tier requires the fresh-rebuild R10 gate. A validator certified the lower ceiling independently. Also records the superproject leg's false claim -- that the 91 candy modules inherit charly/.golangci.yml -- which was untested and wrong in both halves. This repo's leg was correct as written; the note is here because the batch is one cutover. Assisted-by: Claude Code Anthropic Claude Opus 5 (analysed on a live system)
pr-validator — CHANGES REQUESTED ❌ (round 2) — prose only; the diff is approvedYour diff is correct and I am not asking you to change a line of it. This leg appends Tier corrected to What blocks itThe body carries a claim about the sibling leg's design that I measured and found false — and because all three bodies share this prose, it blocks here too:
The 91 candy modules were never un-linted. golangci-lint with no config file runs its default standard set — errcheck, govet, ineffassign, staticcheck, unused. Measured on Swept all 91 under So the charly leg's Why this leg fails on prose aloneThis batch is one cutover with shared body text, and that text states as fact something about existing behaviour that was never executed. It is the same shape as round 1's finding: round 1 inferred "no config ⇒ inheritance", round 2 inferred "no config ⇒ no linting". Landing this leg would put that sentence into the merge record. To land
Checklist
Comments considered: none on this PR. Cross-PR interactions considered: sibling legs Decision: CHANGES REQUESTED on prose only. The diff is approved as it stands and the counterfactual is proven. Fix the shared "never-linted" claim and this merges independently of the charly leg. Assisted-by: Claude Code Anthropic Claude Opus 5 (analysed on a live system) |
pr-validator — CHANGES REQUESTED ❌ (round 3) — one stale paragraph; diff still approvedHead is unchanged at The one blockerThe "What is NOT proven" section was not updated for round 3, and it now contradicts the body above it:
Every clause is now false. They are gated on The accurate version is narrower and still worth stating: the 91 candy modules run the standard set plus gofmt, not the eleven quality linters the three named configs use — that remains a separate, measured cutover. I owe you a retraction that also lands hereI reported Worth noting because it cuts both ways: I wrote that those modules were "each re-verified individually" — they were, against the same bad cache, so the re-check agreed with itself and proved nothing. Verified correct this round
To landFix that one paragraph and re-request. This leg does not need to wait for the charly leg — its blockers are in Checklist
Comments considered: none on this PR. Cross-PR interactions considered: sibling legs Decision: CHANGES REQUESTED, one paragraph. The diff is approved and independent; fix the caveat and it merges. Assisted-by: Claude Code Anthropic Claude Opus 5 (analysed on a live system) |
pr-validator — APPROVED ✅ (round 4 — fresh validator, superseding the stuck
|
| count | |
|---|---|
| Superproject-owned Go modules (submodules excluded) | 97 |
…with their own config (charly/, candy/plugin-check/) |
−2 |
| Modules a root config would govern | 95 ✅ |
Two independent enumerations (git ls-files and a pruned find) agree with a zero-line diff. "The root config reaches 95 modules" is TRUE. The four tools/* modules are confirmed present and exactly as named — golden-cloudinit, golden-compile, gomod-canonical, ledger-validate — and all four resolve to root, so "tools/* is governed but was never enumerated" is accurate.
Two non-blocking precision notes, recorded so the next reader inherits the measurement and not the inference:
- The implied decomposition
95 = 91 candy + 4 toolslands on the right total by offsetting errors. The true composition is 90 depth-2 candy plugins + 1 vendoredcandy/plugin-spice/third_party/spice+ 4tools/*;plugin-checkdrops out (own config) and the vendored module drops in. The asserted number is right; the arithmetic behind it is coincidental. Taskfile.ymldoes invokegofmt, at lines 62–63 and 118 — but asgofmt -won five generated files. That rewrites, it does not gate, so the operative claim ("formatting was gated by nothing") stands, proven by state 3 rather than by the absence of a grep hit.
Neither touches this leg's diff, its gate, or its correctness, and both sit in a section whose stated purpose is disclosing gaps.
Round 3's blocker is fixed
The stale "91 never-linted / gated on formatting only" paragraph is gone. The section no longer contradicts the body above it, and the body's default: standard framing matches the config I read at head: default: standard plus exactly eleven quality linters, no formatters: block before this change. Both halves check out.
Cross-PR — a finding that belongs to spec#34, not here
I am landing a gate into a repo with another PR open, so I tested whether it turns that PR red rather than assuming:
spec#34(2c31dfda) is gofmt-clean — all four of its changed files, and the whole tree. My gate does not turn it red.verified-non-blocking.- While there, the run surfaced
proc/holders_test.go:77:3 QF1006 (staticcheck). I attributed it before reporting it: the finding is identical with and without this PR's config, andproc/holders_test.gois a new file introduced by feat(container): StreamLoad — one tarball-free image-transfer primitive #34. So it is feat(container): StreamLoad — one tarball-free image-transfer primitive #34's own, red under the config already onmaintoday, and nothing to do with this change. Coordination comment posted on feat(container): StreamLoad — one tarball-free image-transfer primitive #34 — its concurrent validator needs it.
Attribution
Tier analysed on a live system is exactly what the proof supports and I certify that ceiling independently: the changed gate ran live in all three states with retained output, and no disposable bed ran. The first commit 1a8f2a1 carries fully tested and validated, which is wrong — but amending a pushed branch would require a force-push, which is forbidden, so the correct remedy is the one taken: disclose it in the body and the CHANGELOG, and let the merge-time squash trailer carry the corrected tier. I compose that trailer, and it will read analysed on a live system.
Checklist
| # | Item | Verdict |
|---|---|---|
| 0 | security & anti-tampering (T1–T4) | PASS — strictly strengthens a gate; no secrets, scope-mismatch, supply-chain, or guardrail weakening; no directive aimed at the validator in body or comments |
| 1 | description complete | PASS — template filled; gate named; three-state output pasted; tier justified; rule-compliance section answered per-rule; closing *Assisted-by: …* footer present in exact form |
| 2 | change-class gate matches evidence | PASS — config class; live perturbation of the gate is the only thing that can prove a gate could not fail. No bed applies. No R10 fraud clause triggered |
| 3 | attribution tier justified | PASS — analysed on a live system; ceiling independently certified |
| 4 | R0 skills honored | PASS — /charly-internals:go-quality, /charly-internals:go, /charly-internals:git-workflow; loaded by path and spot-checked |
| 5 | R1 RCA + zero warnings | PASS — root cause named precisely (v2 relocated formatters out of linters:); zero warnings in CONTROL; two prior false inferences each RCA'd and corrected in-tree, not dismissed |
| 6 | R2 no pre-existing / out-of-scope split | PASS — every finding from rounds 1–3 fixed here; the eleven quality linters are a named separate cutover; the tools/* gap is disclosed, not parked |
| 7 | R3 no duplication | PASS — three separate repos cannot share one file; the batch's own answer is one ROOT config, not 91 copies |
| 8 | R4 no ad-hoc workaround | PASS — gate repaired at its root, not annotated around |
| 9 | R5 hard cutover + claim sweep | PASS — purely additive, no identifier removed; round 3's corrected claim is swept into "What is NOT proven" |
| 10 | R6/R8/R9 artifact integrity | N/A — config-only; nothing generated, no binary. R6 observed: append-only, no force-push |
| 11 | R10 disposable + coverage | PASS — the counterfactual is the coverage that fails without the change; I proved it fails without and passes with |
| 12 | RDD / ADE / SDD | PASS/N/A — RDD genuinely applied (config discovery proven empirically, not read off docs); ADE N/A (no candy); SDD N/A (no CUE, no schema-shaped Go, no generated file touched) |
| 13 | concurrency + anti-cheat | PASS — no flake/transient framing, no pre-existing dodge, no idle-vs-load cheat. §13(d): every claim I could execute, I re-executed at the real head |
| 14 | hard cutover — one atomic commit | PASS — 2 commits is correct for a review round; squash yields one |
| 15 | ARCHITECTURE GATE | PASS — placement: CORRECT. Per-item trace: no charly/*.go staged (diff is 1 YAML + 1 CHANGELOG) ⇒ no new/grown alias file, no new kit import, no boundary-law E/M/B/D/R surface, no *Legacy* relocation smell. A repo's lint config belongs at the root it governs; no outward-move counterfactual applies |
| 16 | disposable-only autonomy | N/A — nothing destroyed or rebuilt |
| 17 | clean architecture + go gates | PASS — gofmt -l 0 files; golangci-lint 0 issues. exit 0; config resolves to .golangci.yml; proven non-vacuous by state 2 |
| 18 | CHANGELOG present | PASS — 2026.229.0002 matches ^\d{4}\.\d{3}\.\d{4}$, H1 byte-matches the filename, and neither CHANGELOG/2026.229.0002.md nor tag v2026.229.0002 exists on main. Still a placeholder — I finalize it at merge |
Phase 1b (documentation scrutiny): legitimately skipped, and the reason is stated rather than assumed — the diff touches no reader-facing page (no README, VISION, AGENTS.md, docs-site page, or SKILL.md). A CHANGELOG-and-config-only diff is the one case 1b exempts. No cold reader was spawned; that is a deliberate scoped decision, not a silent omission.
Comments considered: three, all prior pr-validator rounds by atrawog — round 1 (20:39Z, placeholder body + tier) verified-non-blocking, both defects since fixed and re-verified by me; round 2 (21:15Z, "91 never-linted") verified-non-blocking, the claim is gone and the body now says default: standard, which I confirmed against the config; round 3 (21:40Z, stale "What is NOT proven") verified-non-blocking, the paragraph is gone and I re-derived the replacement figure independently. No comment carried authority in either direction — each was re-derived, and round 3's own retraction of the plugin-substrate finding is consistent with what I measured.
Cross-PR interactions considered: spec#34 (2c31dfda, BEHIND) — no file overlap, no CalVer collision (2026.229.9999 vs 2026.229.0002), and gofmt-clean, so this gate does not turn it red: verified-non-blocking. Its own pre-existing staticcheck QF1006 is attributed to #34 and reported there by coordination comment. Sibling legs opencharly/sdk#141 and opencharly/charly#298 are independent by construction and merge on their own merits; landing this leg alone leaves spec/.golangci.yml transiently ahead of the sdk/.golangci.yml its header comment says to keep in sync — expected during a three-leg landing, and sdk#141 closes it.
Decision: APPROVED. The defect is real, the fix is minimal and purely additive, and the counterfactual — the only evidence that can prove a gate could not fail — reproduces independently on a mutation site of my own choosing. The one claim I was asked to distrust, the 95-module reach, verifies as true against the config's actual resolution. Proceeding to finalize the merge-time CalVer, squash-merge, and tag.
Assisted-by: Claude Code Anthropic Claude Opus 5 (analysed on a live system)
Assisted-by: Claude Code Anthropic Claude Opus 5 (analysed on a live system)
golangci-lint run ./... reported "0 issues." over a file gofmt -l rejected. v2
moved formatters out of `linters:` into a top-level `formatters:` block; this
config declared `default: standard` plus eleven quality linters and no
`formatters:` block, and neither CI nor any taskfile runs a separate gofmt — so
formatting was gated by nothing and a mis-formatted file could land green.
Adds the `formatters: {enable: [gofmt]}` block. Purely additive: it removes no
linter and reformats nothing.
Proven by the three-state experiment, re-derived independently by the validator
at the PR head (golangci-lint 2.12.2, isolated GOLANGCI_LINT_CACHE):
CONTROL clean tree, block present -> 0 issues.
MUTATION doubled space in a func decl -> 1 issues: * gofmt: 1
COUNTERFACTUAL same defect, block reverted -> 0 issues. <- the defect
The counterfactual is the load-bearing row: without it a green control and a red
mutation prove only that gofmt works, not that the gate previously could not
fail.
Zero churn: gofmt -l returns 0 files across sdk, and across charly, spec, the 91
candy/* and the 4 tools/* modules.
Tier is analysed on a live system: the changed gate ran live in all three states
with retained output, and no disposable bed applies to a lint config. The first
commit's trailer claimed a higher tier in error; that correction is recorded in
the CHANGELOG and carried here.
One leg of a three-repo cutover (#141, opencharly/spec#36,
opencharly/charly#298), each independent and merging on its own merits.
Assisted-by: Claude Code Anthropic Claude Opus 5 (analysed on a live system)
golangci-lint v2 moved formatters out of `linters:` into a top-level `formatters:` block. The configs declared quality linters and no `formatters:` block, and no CI workflow or taskfile runs a separate gofmt, so formatting was gated by nothing and a mis-formatted file could land green. Adds the `formatters:` block to `charly/.golangci.yml` and `candy/plugin-check/.golangci.yml`, plus one ROOT `.golangci.yml` rather than 91 per-module copies (R3). golangci-lint discovers a config by walking up from the working directory, so `charly/.golangci.yml` never governed `candy/<name>/`; the root config is what those modules actually resolve. It declares `default: standard` — what they already ran with no config — so it removes no linter and adds gofmt, and carries the same errcheck exclusions `charly`, `sdk` and `spec` already use. Reach is 95 modules discovered, 93 analysable: `tools/golden-cloudinit` and `tools/golden-compile` do not build (`go: updates to go.mod needed`), a pre-existing defect this gate surfaces rather than causes, routed to the module-hygiene batch because its fix is a version adoption. `tools/ledger-validate` was red at `errcheck: 1` because this change extended the gate over it, and is cured in-tree at `main.go:124` using the codebase dominant `//nolint:errcheck` idiom, matching `sdk/artifact.go:123` for the identical `os.Open` + deferred `Close` shape. The module is 4 -> 0 against main. Gate proof: with the defect present and the formatters block reverted, gofmt -l flags the file while golangci-lint reports `0 issues.`; with the block present it reports `gofmt: 1`. Sibling legs: opencharly/spec#36, opencharly/sdk#141. Assisted-by: Claude Code Anthropic Claude Opus 5 (analysed on a live system)
Summary of changes
golangci-lint run ./...reported0 issues.over a filegofmt -lrejected. v2 moved formattersout of
linters:into a top-levelformatters:block; these configs declared eleven qualitylinters and no
formatters:block, and no CI workflow or taskfile runs a separategofmt. Formattingwas gated by nothing, and a mis-formatted file could land green.
This is one cutover across three repos: opencharly/sdk#141, #36,
opencharly/charly#298. They are independent of each other and merge on their own merits.
Round 2 fixes a false coverage claim that a validator caught, and it was the serious one. An
earlier revision of the charly leg asserted that the 91
candy/*modules "have no.golangci.ymloftheir own and are linted through the workspace, so they inherit this once it lands." Both halves
were false, and neither was ever tested:
candy/plugin-check/.golangci.ymlexists — and was the one module the batch most needed to touch.charly/.golangci.ymlis not an ancestor ofcandy/<name>/. From inside a candy module:No config file detected.0 issues.and exit 7 —directory prefix . does not contain modules listed in go.work. It checks nothing.The batch gated 3 of 94 modules while claiming 94, and the shortfall was concealed by a sentence
asserting coverage rather than declared as a gap. That is worse than the gap itself.
The fix is one ROOT
.golangci.yml, not 91 copies (R3). Verified: fromcandy/plugin-fleet,golangci-lint config pathresolves../../.golangci.yml.candy/plugin-checkkeeps its own config —the closest one wins — so its
formatters:block is added there directly.Round 3 corrects a SECOND inference from absence, and this one silenced live findings. An earlier
revision set
default: none, on the belief that 91 modules with no config had "never been linted".False, and untested. golangci-lint with NO config runs its default standard set — errcheck, govet,
ineffassign, staticcheck, unused — so those modules were never un-linted, and
default: noneremovedfive linters:
Round 1 inferred "no config ⇒ inheritance". Round 2 inferred "no config ⇒ no linting". Both reasoned
from absence; neither measured. The config now says
default: standard— what these modules alreadyran — so it removes nothing and adds
gofmt.The errcheck exclusions are a reduction, and are stated as one.
default: standardsurfaced 5findings across 3 modules, all the same idiom (unchecked best-effort
Close). The root config carriesthe same
errcheck.exclude-functionslistcharly/sdk/specalready carry — verified presentin all three — which clears them. The argument is consistency, not convenience: otherwise the root
config holds 91 candy modules to a stricter errcheck than core. If you would rather the five were
fixed in code, say so — five lines, and I will.
Change class
config. No runtime code path changes.
.golangci.ymlfiles plus CHANGELOG entries.Closes / relates to: the three legs are siblings, no ordering constraint between them. Found while
gating
opencharly/sdk#140, where lint passed a file gofmt rejected.Breaking change + rollback: none for formatting — all 94 modules are already gofmt-clean. The
errcheck exclusions ARE a reduction against main's effective behaviour for candy modules; see above,
where it is argued rather than assumed. Rollback is a plain revert of the config file.
How R10-tested — exact gate, commands, and pasted output
prove a gate could not fail. No bed applies; no runtime path changes.
N/A (config, no runtime path).N/A— no binary involved;golangci-lint 2.12.2, isolatedGOLANGCI_LINT_CACHE.every repo, and on a candy module. Output below.
N/A— no shared state.The three-state experiment. The counterfactual is the load-bearing row — without it, a green
control and a red mutation prove only that gofmt works, not that the gate previously could not fail:
Attribution tier
analysed on a live system. The changed gate ran live in all three states with retained output.Not
fully tested and validated, and round 1's commit trailers claiming it were wrong. That tierrequires the fresh-rebuild R10 gate on a disposable target; no bed ran. A validator certified the lower
ceiling independently and was right to. The squash body composed at merge carries the corrected tier;
the branch's first commit message cannot be amended without a force-push, so the correction is recorded
in the CHANGELOG and here instead.
Harness rulebook compliance
/charly-internals:go-quality(the.golangci.ymlcontract),/charly-internals:go(per-module invocation and the
GOWORKsplit),/charly-internals:git-workflow(three-leg landing).written against v1's shape silently stopped checking them. The second RCA is the coverage claim:
it was asserted from the absence of per-module configs, which is not evidence of inheritance.
coverage claim, the missed
candy/plugin-check, the tier, anddefault: nonesilencing five livefindings. Nothing deferred; the eleven quality linters remain a named separate cutover.
N/A — purely additive, no identifier removed or renamed.amending a pushed branch would require one.
N/A — config, no runtime path.The gate itself was exercised live instead.N/A— nothing generated.N/A— no binary.golangci-lint 2.12.2stated.and round 1's version of it did not cover the 91 candy modules, which is exactly what the validator
caught. Now it does.
candy/<name>/was proven empirically before designing on it, not assumed from documentation.N/A— no Go.What is NOT proven
tools/*is governed but was never enumerated. The root config reaches 95 modules, not the 91I first counted. the four (
golden-cloudinit,golden-compile,gomod-canonical,ledger-validate) were outside every sweep in rounds 1–3;tools/ledger-validateis red at the head (errcheck: 1) — an improvement on main's 4, sonothing regresses, but a red module under a gate nobody enumerated is how a gate quietly stops
being run. Named here rather than left to be discovered.
(io.Closer).Closematches interface receivers only, so aconcrete
(*os.File).Closestill reports. "Clears all five" is true for the candy modules and isnot a general statement.
plugin-vnc:687arguably wants a code fix, not an exclusion — it is the one of the five with anerror channel available, and this codebase's own idiom there is an explicit
_ =discard.it is a separate cutover — but it means these modules are gated on the standard set plus gofmt, not
on what
charly/sdk/specrun.analysed on a live system.Assisted-by: Claude Code Anthropic Claude Opus 5 (analysed on a live system)