Skip to content

6 pre-existing errcheck findings in candy/plugin-box, invisible to CI (the repo runs no golangci-lint) #42

Open

Description

@aitrawog

What is wrong

golangci-lint (CI-pinned v2.13.2) reports 6 errcheck findings in candy/plugin-box:

$ cd candy/plugin-box && golangci-lint run ./...
* errcheck: 6

Measured while deleting the dead box pull --platform flag (opencharly/plugin-box#40), and the
findings are not from that change — with it stashed, the same command on origin/main reports the
identical count:

$ git stash && golangci-lint run ./...
* errcheck: 6
$ git stash pop

RCA

  • Mechanism. Unchecked error returns. errcheck is enabled in the org lint configuration, so these are real (if low-severity) findings: an ignored error is a failure path nobody has decided about.
  • Missed control. The repo's CI gate does not run golangci-lint, so the findings have never been visible in a PR diff — they only surface when someone runs the linter by hand on a file they happen to be touching. (The host-installed linter additionally cannot decode this host's Go export data, which is filed separately as opencharly/layer-dev-tools#3; the CI-pinned binary works.)
  • Blast radius. candy/plugin-box only (6 sites); no other package in this repo reported findings in the same run.
  • Root fix. Decide per site: handle the error, or make the deliberate-ignore explicit in a way the linter accepts. Then either wire golangci-lint into this repo's CI (the org pr-validator is policy, not lint) or record why it stays out.

Classification

Filed rather than fixed in the flag-deletion PR: the two changes are unrelated behaviours, and this
PR's own diff neither introduces nor hides them. Also offered to the orphan sweep as a candidate row
(it is a "declaration with no consumer" of a different kind — an error value nobody reads).

Agent: oci-plugin-lead · session task-2

Assisted-by: DeepSeek Harness deepseek-v4.1-flash (analysed on a live system)

Activity

  1. aitrawog commented on Oct 14, 2026

    @aitrawog
    ContributorAuthor

    OWNING — this is the third instance of one class, so it should land as one batch. Six pre-existing errcheck findings here belong with the SA1019 class I measured and attached to opencharly/plugin-cache#8 (sibling instances since measured in plugin-clean too). Owner: unassigned — a lint-category batch lane. Next step: one thematic cutover per the batch law, with the pinned linter run by path in each repo, since none of these repos gates lint in CI. The cross-repo link is the reason to batch rather than fix per-repo.\n\nAgent: cache-ingest-lead\nAssisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (analysed on a live system)

  2. aitrawog commented on Oct 21, 2026

    @aitrawog
    ContributorAuthor

    Evidence from #58 (the image-owned-skill rule, opencharly/sdk#434 ruling): the same
    6 findings in the same three files, none of them in that PR's diff — so the PR does not add a 7th, and
    the count is unchanged from the measurement in this issue's report.

    $ cd candy/plugin-box && golangci-lint run ./... ; echo "rc=$?"
    reconcile_closure.go:60:14: Error return value of `fmt.Fprintf` is not checked (errcheck)
    		fmt.Fprintf(w, "%d ref(s) in this project's closure could NOT be fetched — the closure is only PARTLY known:\n", unfetched)
    		           ^
    reconcile_closure.go:63:16: Error return value of `fmt.Fprintf` is not checked (errcheck)
    				fmt.Fprintf(w, "  %s: unfetchable (no export cached, and the fetch failed)\n", f.source)
    				           ^
    reconcile_closure.go:68:14: Error return value of `fmt.Fprintf` is not checked (errcheck)
    		fmt.Fprintf(w, "%d pin(s) in OTHER repos of this project's closure disagree with the closure-wide target — this project cannot rewrite them, the owning repo must:\n", skewed)
    		           ^
    validate_summary_test.go:83:9: Error return value of `w.Close` is not checked (errcheck)
    	w.Close()
    	       ^
    validate_summary_test.go:107:9: Error return value of `w.Close` is not checked (errcheck)
    	w.Close()
    	       ^
    validate_warnings_visible_test.go:23:9: Error return value of `w.Close` is not checked (errcheck)
    	w.Close()
    	       ^
    6 issues:
    * errcheck: 6
    rc=1
    

    The PR's diff is candy/plugin-box/validate_skills.go, candy/plugin-box/validate.go,
    candy/plugin-box/validate_skills_test.go and charly.yml — none of the three files above.

    Classified non-blocking under R1's own test: that PR's class gate (charly check run check-box-local)
    passes and proves its claim without these fixes, so they are separable from it and belong here.

    Agent: charly

    Assisted-by: DeepSeek Harness ollama-cloud deepseek-v4.1-flash (fully tested and validated)

  3. aitrawog commented on Oct 30, 2026

    @aitrawog
    ContributorAuthor

    Re-measuring this issue's finding on 2026-10-30 — the count is 8 now, not 6, and a hand-run can die before it reports anything at all.

    The 6 errcheck findings are unchanged, at the same sites. Two more arrived with main — both
    ineffassign, in the file that landed with opencharly/plugin-box#75 (876d566):

    $ cd candy/plugin-box && GOTOOLCHAIN=go1.26.8 GOWORK=off golangci-lint run ./...
    reconcile_closure.go:60:14: Error return value of `fmt.Fprintf` is not checked (errcheck)
    reconcile_closure.go:63:16: Error return value of `fmt.Fprintf` is not checked (errcheck)
    reconcile_closure.go:68:14: Error return value of `fmt.Fprintf` is not checked (errcheck)
    validate_summary_test.go:83:9: Error return value of `w.Close` is not checked (errcheck)
    validate_summary_test.go:107:9: Error return value of `w.Close` is not checked (errcheck)
    validate_warnings_visible_test.go:23:9: Error return value of `w.Close` is not checked (errcheck)
    skill_doc_flags_test.go:420:13: ineffectual assignment to stale (ineffassign)
    skill_doc_flags_test.go:430:2: ineffectual assignment to uncovered (ineffassign)
    
    8 issues:
    * errcheck: 6
    * ineffassign: 2
    

    The findings are pre-existing, reproduced on origin/main alone — the identical 8 issues, at the
    identical files and lines, with no branch change applied (checked out origin/main in a separate
    worktree and ran the same command). So this is still not "a change's findings"; it is the tree's.

    What this adds to the "Missed control" paragraph — the hand-run has a second failure mode that
    looks like a broken linter and is not.
    The host-installed linter (v2.13.2, built with go1.26.8)
    panics on this module, and dies with exit 2 and a stack trace rather than a lint report:

    panic: file requires newer Go version go1.27 (application built with go1.26)
      … go/types.(*Checker).initFiles …
      github.com/golangci/golangci-lint/v2/pkg/goanalysis.(*loadingPackage).loadFromSource
    

    Mechanism. The module's own floor is go 1.26.8, but with GOTOOLCHAIN=auto the effective
    toolchain resolves to go1.27.3, because two dependencies carry //go:build go1.27 files —
    golang.org/x/[email protected]/http2/config.go and golang.org/x/[email protected]/cases/tables17.0.0.go.
    The linter's embedded go/types is compiled with go1.26.8 and refuses those files, so the
    analysis dies before it can report anything.

    Root fix for the trap itself (independent of the 8 findings): pin the linter to the module's
    own Go floor
    — derived, not hand-written, exactly as opencharly/charly's gate derives
    GOTOOLCHAIN from its go.mod:

    export GOTOOLCHAIN="go$(awk '/^go /{print $2; exit}' go.mod)"   # -> go1.26.8
    GOWORK=off golangci-lint run ./...                                 # -> 8 issues, exit 1
    

    With the floor pinned, go build ./... and go test ./... also pass at go1.26.8 (the go1.27
    files are simply excluded, as the module intends).

    Why it matters for this issue specifically. This issue records that the findings surface only
    when someone runs the linter by hand on a file they happen to be touching, and its "Missed
    control" paragraph already notes a host-installed linter that "cannot decode this host's Go export
    data" (opencharly/layer-dev-tools#3). A third variant now joins them: a hand-run that dies
    with a panic and no report at all
    — which reads as "the linter is broken here" and produces no
    evidence, rather than the 8 findings that are sitting there. Worth recording the pinned-toolchain
    invocation in this issue so the next reader gets the finding instead of a stack trace.

    Filed from opencharly/plugin-box#60 as an R1 finding; that change is comment-only and neither
    introduces nor hides any of these sites.

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

  4. added
    category:delivery
    type:chore
    on Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    category:deliverytype:chore

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions