Skip to content

fix(lint): enable the gofmt formatter so the gate can fail on formatting - #36

Merged
atrawog merged 3 commits into
mainfrom
feat/lint-formatters-gate
Aug 18, 2026
Merged

atrawog merged 3 commits into
mainfrom
feat/lint-formatters-gate

Conversation

@atrawog

@atrawog atrawog commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary of changes

golangci-lint run ./... reported 0 issues. over a file gofmt -l rejected. v2 moved formatters
out of linters: into a top-level formatters: block
; these configs declared eleven quality
linters and no formatters: block, and no CI workflow or taskfile runs a separate gofmt. Formatting
was 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.yml of
their 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.yml exists — and was the one module the batch most needed to touch.
  • golangci-lint discovers a config by walking up from the working directory, and
    charly/.golangci.yml is not an ancestor of candy/<name>/. From inside a candy module:
    No config file detected.
  • A workspace run from the repo root reports 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: from candy/plugin-fleet,
golangci-lint config path resolves ../../.golangci.yml. candy/plugin-check keeps 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: none removed
five linters:

candy/plugin-appium, same file, nothing else changed
  root config with `default: none`  ->  0 issues.
  no root config (== main today)    ->  * errcheck: 3

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 already
ran — so it removes nothing and adds gofmt.

The errcheck exclusions are a reduction, and are stated as one. default: standard surfaced 5
findings across 3 modules, all the same idiom (unchecked best-effort Close). The root config carries
the same errcheck.exclude-functions list charly/sdk/spec already carry — verified present
in 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.yml files 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

  • The gate for this change class: live perturbation of the gate itself — the only thing that can
    prove a gate could not fail. No bed applies; no runtime path changes.
  • Eval beds run: none — N/A (config, no runtime path).
  • Fresh rebuild: N/A — no binary involved; golangci-lint 2.12.2, isolated GOLANGCI_LINT_CACHE.
  • Did the CHANGED code path execute live? Yes — the gate itself was run in all three states, in
    every repo, and on a candy module. Output below.
  • Concurrency: 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:

                        CONTROL           MUTATION          COUNTERFACTUAL
                        clean + block     defect + block    defect, block REVERTED
charly                  0 issues.         gofmt: 1          0 issues.      <-- the defect
sdk                     0 issues.         gofmt: 1          0 issues.      <-- the defect
spec                    0 issues.         gofmt: 1          0 issues.      <-- the defect
candy/plugin-fleet      0 issues.         gofmt: 1          0 issues.      <-- the coverage
  (via the new ROOT config)                                                    round 1 LACKED
$ # coverage under the CORRECTED config (default: standard + sibling errcheck excludes)
the 3 modules default:standard surfaced           0 issues. after the exclusions
regression sample, 12 candy modules               0 red
charly / sdk / spec                               0 issues.

$ # a false number I measured first, recorded because the output is deceptive
sweeping all 91 in one pass filled the sandbox /tmp quota; 10 modules then
reported `no go files to analyze`, which reads exactly like a finding.
plugin-vm has 71 .go files. Re-run individually against a root-fs cache: green.

$ # charly must run with go.work ON — its go.sum is incomplete standalone
(cd charly && golangci-lint run ./...)              0 issues.
(cd charly && GOWORK=off golangci-lint run ./...)   typecheck: 20
   ^ identical on main. Pre-existing harness artifact, NOT this change.

$ # the root config really is what candy modules resolve
(cd candy/plugin-fleet && golangci-lint config path)   ../../.golangci.yml

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 tier
requires 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

  • R0 skills: /charly-internals:go-quality (the .golangci.yml contract), /charly-internals:go
    (per-module invocation and the GOWORK split), /charly-internals:git-workflow (three-leg landing).
  • R1 RCA + zero warnings: root-caused before remediating — v2 relocated formatters, so a config
    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.
  • R2 no out-of-scope: every validator finding across three rounds is fixed here — the false
    coverage claim, the missed candy/plugin-check, the tier, and default: none silencing five live
    findings. Nothing deferred; the eleven quality linters remain a named separate cutover.
  • R3 no duplication: the decisive reason for a root config over 91 copies.
  • R4 no workaround: the gate is fixed, not annotated around.
  • R5: N/A — purely additive, no identifier removed or renamed.
  • R6 git safety: append-only; no force-push. The tier correction is a new commit precisely because
    amending a pushed branch would require one.
  • R7 runtime gate: N/A — config, no runtime path. The gate itself was exercised live instead.
  • R8 artifact invariants: N/A — nothing generated.
  • R9 binary == source: N/A — no binary. golangci-lint 2.12.2 stated.
  • R10 disposable + coverage: the counterfactual IS the coverage that fails without the change —
    and round 1's version of it did not cover the 91 candy modules, which is exactly what the validator
    caught. Now it does.
  • RDD / ADE / SDD: RDD applies and was used: whether a root config is even discovered from
    candy/<name>/ was proven empirically before designing on it, not assumed from documentation.
  • Hard cutover: one atomic commit per repo at merge.
  • Kernel/plugin boundary law: N/A — no Go.
  • CHANGELOG: one entry per repo, placeholder CalVer for the validator to finalize.

What is NOT proven

  • tools/* is governed but was never enumerated. The root config reaches 95 modules, not the 91
    I first counted. the four (golden-cloudinit, golden-compile, gomod-canonical, ledger-validate) were outside every sweep in rounds 1–3;
    tools/ledger-validate is red at the head (errcheck: 1) — an improvement on main's 4, so
    nothing 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.
  • The exclusion does not generalize. (io.Closer).Close matches interface receivers only, so a
    concrete (*os.File).Close still reports. "Clears all five" is true for the candy modules and is
    not a general statement.
  • plugin-vnc:687 arguably wants a code fix, not an exclusion — it is the one of the five with an
    error channel available, and this codebase's own idiom there is an explicit _ = discard.
  • The eleven quality linters remain off for the 95 modules. That is deliberate and measured, and
    it is a separate cutover — but it means these modules are gated on the standard set plus gofmt, not
    on what charly/sdk/spec run.
  • No bed ran, which is why the tier is capped at analysed on a live system.

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; 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)
@atrawog

atrawog commented Aug 17, 2026

Copy link
Copy Markdown
Contributor Author

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 charly leg.


What I verified as CORRECT

Run from a clean scratch worktree at head 1a8f2a19, isolated GOLANGCI_LINT_CACHE, golangci-lint 2.12.2:

CONTROL       clean tree, formatters block PRESENT
              gofmt -l -> 0 files
              golangci-lint run ./...  ->  0 issues.

MUTATION      doubled space: func  ComputeCalVer(   in spec/calver.go
              gofmt -l -> spec/calver.go
              golangci-lint run ./...  ->  spec/calver.go: File is not properly formatted (gofmt)
                                           1 issues: * gofmt: 1

COUNTERFACTUAL  same mutation, .golangci.yml reverted to origin/main
              gofmt -l -> spec/calver.go          (defect still there)
              golangci-lint run ./...  ->  0 issues.        <-- the defect, confirmed

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 (charly, sdk, spec) — identical result each time.

Also verified:

  • Zero churn — TRUE. 94 modules swept (charly, sdk, spec, 91 candy/*): 0 unformatted files. Merging turns nothing red.
  • "no CI step or taskfile runs a separate gofmt" — TRUE. Only gofmt -w on generated files, which is a formatter, not a gate.
  • One atomic commit; CalVer 2026.229.0002 valid, H1 byte-matches, no tag collision.
  • No in-flight PR turns red under the new gate.

BLOCKING 1 — the PR body is a placeholder

No filled template, no How R10-tested block, no Attribution tier justification, no rule-compliance section, and no closing italicized *Assisted-by: …* footer. Pointing at the CHANGELOG is not a substitute: the body is the evidence surface, and the CHANGELOG's evidence is a summary table rather than pasted command output. Blocking on its own.

BLOCKING 2 — attribution tier not supported

The commit trailer claims fully tested and validated. The perturbation was genuinely executed and I confirmed it, but no evidence is pasted in the body and the batch ships an untested coverage claim (below). Ceiling I certify: analysed on a live system.

Batch-scope finding (lives in opencharly/charly#298, affects this leg's scope)

charly#298's CHANGELOG states the 91 candy/* modules "have no .golangci.yml of their own and are linted through the workspace, so they inherit this once it lands." Both halves are false, measured: candy/plugin-check/.golangci.yml exists; golangci-lint config path in candy/plugin-fleet and candy/plugin-vm reports "No config file detected"; and a workspace run from the superproject root exits 7 with typechecking error … does not contain modules listed in go.work while printing 0 issues. A live gofmt defect in candy/plugin-fleet is not caught. The batch gates 3 of 94 modules. Full detail on charly#298.

That does not change this leg's diff, but it changes what the batch may claim — so please keep the three legs' prose consistent when you fix it.

What to fix

  1. Fill this PR's body per the template — pasted control/mutation/counterfactual output, tier with justification, rule-compliance section, and the closing *Assisted-by: …* footer.
  2. Lower the trailer to analysed on a live system, or supply the evidence the higher tier needs.
  3. Reconcile the candy-coverage prose across all three legs (see charly#298).

Checklist

# 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)
@atrawog

atrawog commented Aug 17, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — CHANGES REQUESTED ❌ (round 2) — prose only; the diff is approved

Your diff is correct and I am not asking you to change a line of it. This leg appends formatters: {enable: [gofmt]} to a config that already declares default: standard, so it is a pure strengthening with no side effects. Re-derived at head 6cb0b4d4, clean scratch worktree, submodules at pinned gitlinks:

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, confirmed

Tier corrected to analysed on a live system, body filled, footer present, CalVer valid, H1 matches, no tag collision, one logical change. All of that is right.

What blocks it

The 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:

Deliberately formatters-only (default: none): gating 91 never-linted modules on eleven quality linters in one step is a separate, measured cutover.

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 candy/plugin-appium, same module, same file:

root config present (default: none)  ->  0 issues.
root config removed  ==  main today  ->  3 issues: * errcheck: 3
                                         w3c.go:77:23  Error return value of
                                         `resp.Body.Close` is not checked

Swept all 91 under main's effective config: 87 green, 4 red — plugin-appium (errcheck: 3), plugin-agentteams (errcheck: 1), plugin-vnc (errcheck: 1), plugin-substrate (typecheck: 1). At charly#298's head all four report 0 issues.

So the charly leg's default: none is a net weakening — +gofmt, −5 linters across 91 candy and 4 tools/* modules — and it silences six live findings. Full detail and the fix on opencharly/charly#298.

Why this leg fails on prose alone

This 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

  1. Fix the shared prose in all three bodies: the candy modules are linted today by the standard set; the gap was gofmt specifically, not linting in general.
  2. Nothing else here. Re-request as soon as the prose is fixed — this leg does not need to wait for the charly redesign, since its diff is independent and already approved. I will re-validate the prose and merge it.

Checklist

# Item Verdict
0 security & anti-tampering PASS — this leg strictly strengthens its own gate
1 description complete FAIL — well-organised and thorough, but asserts "91 never-linted modules", which is false
2 change-class gate matches evidence PASS — three-state experiment re-derived live
3 attribution tier justified PASS — analysed on a live system
4 R0 skills honored PASS
5 R1 RCA / zero warnings PASS for this leg
6 R2 no out-of-scope split PASS for this leg
7 R3 no duplication PASS
8 R4 no workaround PASS
9 R5 hard cutover PASS
10 R6/R8/R9 N/A — config-only
11 R10 coverage PASS — counterfactual is the coverage that fails without the change
12 RDD / ADE / SDD N/A
13 concurrency + anti-cheat FAIL — §13(d): a claim about existing behaviour asserted without executing it
14 hard cutover — one atomic commit PASS — 2 commits is correct for a review round; squash yields one
15 ARCHITECTURE GATE PASS — placement: CORRECT; no Go staged, no alias, no kit import
16 disposable-only autonomy N/A
17 clean architecture + go gates PASS — 0 issues. at head
18 CHANGELOG present PASS — CalVer valid, H1 matches, no collision

Comments considered: none on this PR.

Cross-PR interactions considered: sibling legs opencharly/charly#298 (blocking design finding) and the other of sdk#141/spec#36; plus sdk#139, spec#34, charly#297, charly#289 — all gofmt-clean at current heads, none turns red under the new gate. verified-non-blocking.

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)

@atrawog

atrawog commented Aug 17, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — CHANGES REQUESTED ❌ (round 3) — one stale paragraph; diff still approved

Head is unchanged at 6cb0b4d4 (a body edit is not a commit), and your diff remains approved exactly as it was — pure strengthening on a config that already declares default: standard, counterfactual proven. Nothing here asks you to touch code.

The one blocker

The "What is NOT proven" section was not updated for round 3, and it now contradicts the body above it:

  • The 91 candy modules are gated on formatting only. ... enabling them across 91 never-linted modules in one step would be an unmeasured blast radius — but it means "the candy modules are linted" is still false in the general sense.

Every clause is now false. They are gated on standard plus gofmt; "never-linted" is the phrase this same body labels "False, and untested" about thirty lines earlier; and "the candy modules are linted" is now true in the sense the sentence denies. It reads as a live caveat rather than as history, which is the one thing the section must not do.

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 here

I reported plugin-substrate as a fourth red module with typecheck: 1. That was wrong. substratekind is the module's own package name, and the line I flagged was an import statement belonging to a different module — a stale golangci-lint cache surfacing another tree's finding. It is 0 issues. in every clean configuration I have now tried. The correct figure is 5 findings across 3 modules, as the charly leg's CHANGELOG says.

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

  • Full sweep at the sibling head: 91/91 candy modules green; the standard linters are demonstrably live (probe → errcheck: 1, unused: 1); gofmt still gated.
  • This leg: 0 issues., tier analysed on a live system, footer present, CalVer valid, H1 matches, no collision.
  • Cross-PR re-checked at current heads (three moved since round 2, one is new): charly#297 8ffb07ed, charly#289 6838886e, charly#299 d1c88d27, sdk#139, spec#34 — all gofmt-clean, none turns red.

To land

Fix that one paragraph and re-request. This leg does not need to wait for the charly leg — its blockers are in .golangci.yml's comment, not here. I will merge this as soon as the caveat is accurate.

Checklist

# Item Verdict
0 security & anti-tampering PASS — strictly strengthens its own gate
1 description complete FAIL — "What is NOT proven" stale and self-contradictory
2 change-class gate matches evidence PASS
3 attribution tier justified PASS
4 R0 skills honored PASS
5 R1 RCA / zero warnings PASS for this leg
6 R2 no out-of-scope split PASS
7 R3 no duplication PASS
8 R4 no workaround PASS
9 R5 hard cutover + claim sweep FAIL — the corrected claim was not swept into this section
10 R6/R8/R9 N/A — config-only
11 R10 coverage PASS — counterfactual is the coverage that fails without the change
12 RDD / ADE / SDD N/A
13 concurrency + anti-cheat PASS
14 hard cutover — one atomic commit PASS — squash yields one
15 ARCHITECTURE GATE PASS — placement: CORRECT; no Go staged, no alias, no kit import
16 disposable-only autonomy N/A
17 clean architecture + go gates PASS — 0 issues. at head
18 CHANGELOG present PASS — this leg's CHANGELOG is clean; the stale text is body-only

Comments considered: none on this PR.

Cross-PR interactions considered: sibling legs opencharly/charly#298 (three text blockers) and the other of sdk#141/spec#36; plus sdk#139, spec#34, charly#297, charly#289, charly#299 — all re-checked at current heads, verified-non-blocking.

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)

@atrawog

atrawog commented Aug 18, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — APPROVED ✅ (round 4 — fresh validator, superseding the stuck pending)

Change class: config (1 YAML + 1 CHANGELOG; no runtime code path).

A round-4 status was posted at 21:44Z and never resolved — it sat pending for over three hours. I am a fresh validator with no inherited context: I re-derived every load-bearing claim from the diff, the repo, and the rulebook, and I trusted neither the author's evidence nor rounds 1–3. Note the ordering that matters here: the body was edited at 21:59Z, fifteen minutes after round 4 announced itself, so that validator most likely read the pre-fix body. I read the body as it stands at 6cb0b4d4.


The counterfactual, re-derived — not inherited

Clean scratch worktree at 6cb0b4d4, isolated GOLANGCI_LINT_CACHE, GOTMPDIR/TMPDIR off the repo, golangci-lint 2.12.2, go1.26.5. I used a different mutation site than round 3 (checkhost/apk.go, not spec/calver.go) so this is an independent derivation rather than a re-run of theirs:

STATE 1  CONTROL          clean tree, formatters block PRESENT
                          golangci-lint config path -> .golangci.yml
                          gofmt -l .                -> (0 files)
                          golangci-lint run ./...   -> 0 issues.        exit 0

STATE 2  MUTATION         func  ResolveApkPath(  in checkhost/apk.go
                          gofmt -l .                -> checkhost/apk.go
                          golangci-lint run ./...   -> checkhost/apk.go:27:1:
                                                       File is not properly formatted (gofmt)
                                                       1 issues: * gofmt: 1     exit 1

STATE 3  COUNTERFACTUAL   same defect; .golangci.yml restored to the pre-change
                          blob 2b6ae7d (verified byte-identical to origin/main)
                          gofmt -l .                -> checkhost/apk.go   (defect still present)
                          golangci-lint run ./...   -> 0 issues.          exit 0   <-- THE DEFECT

State 3 is the whole point and it holds exactly as claimed: the gate could not fail in the case it exists to catch. State 2 also proves the run is not vacuous — a 0 issues. that can be driven red is a real gate, not the exit-7 no-op that this repo family has been bitten by before.

The 91 → 95 correction — verified against the config's actual reach

The team lead flagged that a corrected figure carries the same burden as the one it replaced, and that this PR has now published two different counts. I enumerated it rather than accepting either number, resolving each module by golangci-lint's walk-up rule:

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 tools lands on the right total by offsetting errors. The true composition is 90 depth-2 candy plugins + 1 vendored candy/plugin-spice/third_party/spice + 4 tools/*; plugin-check drops out (own config) and the vendored module drops in. The asserted number is right; the arithmetic behind it is coincidental.
  • Taskfile.yml does invoke gofmt, at lines 62–63 and 118 — but as gofmt -w on 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:

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)
@atrawog
atrawog merged commit 01dcaae into main Aug 18, 2026
@atrawog
atrawog deleted the feat/lint-formatters-gate branch August 18, 2026 01:26
atrawog added a commit to opencharly/sdk that referenced this pull request Aug 18, 2026
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)
atrawog added a commit to opencharly/charly that referenced this pull request Aug 18, 2026
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant