main is lint-red: the worktree-rented-from-mac merge landed 17 golangci-lint issues in internal/clan + app/helper (13 revive, 4 errcheck) #2042

Closed
opened 2026-10-04 18:55:58 +00:00 by matou-build-agent · 2 comments

main is red at the seam's Go: go.work resolves both modules; build, vet, test, lint each stage. golangci-lint run ./... reports 17 issues (13 revive, 4 errcheck), all of them in code that landed with the merge ff947743 Merge branch 'worktree-rented-from-mac' (2026-10-04 18:30 UTC).

CI run: https://git.matou.nz/Matou/idss/actions/runs/39368 — healer signature 8f30dbc7ed4e.

Proof the merge introduced it

Fresh clone, the pinned nix develop .#go-ci shell (golangci-lint 2.12 schema, .golangci.yml as committed):

  • at 9a382df2 (the main head immediately before the merge) → 0 issues.
  • at ff947743 (current main) → 17 issues: errcheck 4, revive 13

Five of the six offending files are new in the merge (git diff --name-status 9a382df2..ff947743): A internal/clan/remotecli.go, A internal/clan/remoterepo.go, A internal/clan/remoterepo_test.go, A internal/clan/mirror_test.go, A app/helper/cmd/helper/feedresolver_test.go; M internal/clan/secrets.go.

The 17 issues

revive exported — missing/malformed doc comments on exported identifiers:

internal/clan/remotecli.go:9:6    exported type Box should have comment or be unexported
internal/clan/remotecli.go:16:6   exported type RemoteCLI should have comment or be unexported
internal/clan/remotecli.go:23:1   exported function NewRemoteCLI should have comment or be unexported
internal/clan/remoterepo.go:13:1  comment on exported type RemoteConfigRepo should be of the form "RemoteConfigRepo ..." (with optional leading article)
internal/clan/remoterepo.go:29:1  exported function OpenRemoteConfigRepo should have comment or be unexported
internal/clan/remoterepo.go:35:1  exported method RemoteConfigRepo.Dir should have comment or be unexported
internal/clan/remoterepo.go:36:1  exported method RemoteConfigRepo.ExecDir should have comment or be unexported
internal/clan/remoterepo.go:159:1 exported method RemoteConfigRepo.Mutate should have comment or be unexported
internal/clan/remoterepo.go:229:1 exported method RemoteConfigRepo.Head should have comment or be unexported
internal/clan/remoterepo.go:242:1 exported method RemoteConfigRepo.ResetToRevision should have comment or be unexported

revive unused-parameter:

internal/clan/secrets.go:89:32    parameter 'ctx' seems to be unused (func (a *Adapter) ensureAgeKey(ctx context.Context))
internal/clan/secrets.go:116:106  parameter 'dir' seems to be unused (the registerOperator Mutate closure)
internal/clan/secrets.go:292:115  parameter 'dir' seems to be unused (the EnsureMachineAdmin own-key-grant Mutate closure)

errcheck — unchecked error returns in tests:

app/helper/cmd/helper/feedresolver_test.go:57:10  w.Write(...)
app/helper/cmd/helper/feedresolver_test.go:70:10  w.Write(...)
internal/clan/mirror_test.go:50:11               os.Remove(...)
internal/clan/remoterepo_test.go:126:13          os.Remove(...)

Note remoterepo.go:13 is a comment-form violation, not a missing comment: the doc comment reads // RemoteConfigRepo: git lives on the box…; revive wants // RemoteConfigRepo holds … (no colon after the identifier).

Why it reached main without being caught

The sandbox pre-push gate runs the full Go seam including golangci-lint (gate_go_default_cmd, .sandcastle/gate-lib.sh:51), but the host pre-push path runs the cheap gofmt-only tier (gate_run's go_tier=gofmt, #1458) — so a push made from a host worktree never lints. This merge came off the local worktree-rented-from-mac branch, so only gofmt ran. The host gate's gofmt leg is separately known-broken (#1913). Widening or re-tiering the host gate is a human decision and is not part of this ticket.

Acceptance

  • nix develop .#go-ci --command golangci-lint run ./... reports 0 issues. at the root module, and the broker module stays clean.
  • Doc comments are real sentences in this repo's voice (what the type/method is for, the invariant it holds), not restatements of the signature — remoterepo.go/remotecli.go are the on-the-box git/CLI seam of the rented founding (ADR 0102), so say that.
  • An unused ctx/dir parameter is renamed _ only where it genuinely cannot be used; if ensureAgeKey should be threading its ctx into a call, thread it instead of blanking it.
  • The errcheck sites are tests: assert the error (if _, err := w.Write(...); err != nil { t.Fatal(err) }) rather than discarding it to _ where the write's success is part of the fixture's contract.
  • No change to .golangci.yml — the linter contract is not the fault here.

Filed by the swarm healer (hook mode, run heal-Matou-idss-1791139845-2933374). Classified product-class: the fix lives in internal/ and app/ sources, which the healer charter forbids it from touching.

`main` is red at the seam's **`Go: go.work resolves both modules; build, vet, test, lint each`** stage. `golangci-lint run ./...` reports **17 issues** (13 revive, 4 errcheck), all of them in code that landed with the merge `ff947743 Merge branch 'worktree-rented-from-mac'` (2026-10-04 18:30 UTC). CI run: https://git.matou.nz/Matou/idss/actions/runs/39368 — healer signature `8f30dbc7ed4e`. ## Proof the merge introduced it Fresh clone, the pinned `nix develop .#go-ci` shell (golangci-lint 2.12 schema, `.golangci.yml` as committed): - at `9a382df2` (the main head immediately before the merge) → **`0 issues.`** - at `ff947743` (current main) → **`17 issues: errcheck 4, revive 13`** Five of the six offending files are **new in the merge** (`git diff --name-status 9a382df2..ff947743`): `A internal/clan/remotecli.go`, `A internal/clan/remoterepo.go`, `A internal/clan/remoterepo_test.go`, `A internal/clan/mirror_test.go`, `A app/helper/cmd/helper/feedresolver_test.go`; `M internal/clan/secrets.go`. ## The 17 issues revive `exported` — missing/malformed doc comments on exported identifiers: ``` internal/clan/remotecli.go:9:6 exported type Box should have comment or be unexported internal/clan/remotecli.go:16:6 exported type RemoteCLI should have comment or be unexported internal/clan/remotecli.go:23:1 exported function NewRemoteCLI should have comment or be unexported internal/clan/remoterepo.go:13:1 comment on exported type RemoteConfigRepo should be of the form "RemoteConfigRepo ..." (with optional leading article) internal/clan/remoterepo.go:29:1 exported function OpenRemoteConfigRepo should have comment or be unexported internal/clan/remoterepo.go:35:1 exported method RemoteConfigRepo.Dir should have comment or be unexported internal/clan/remoterepo.go:36:1 exported method RemoteConfigRepo.ExecDir should have comment or be unexported internal/clan/remoterepo.go:159:1 exported method RemoteConfigRepo.Mutate should have comment or be unexported internal/clan/remoterepo.go:229:1 exported method RemoteConfigRepo.Head should have comment or be unexported internal/clan/remoterepo.go:242:1 exported method RemoteConfigRepo.ResetToRevision should have comment or be unexported ``` revive `unused-parameter`: ``` internal/clan/secrets.go:89:32 parameter 'ctx' seems to be unused (func (a *Adapter) ensureAgeKey(ctx context.Context)) internal/clan/secrets.go:116:106 parameter 'dir' seems to be unused (the registerOperator Mutate closure) internal/clan/secrets.go:292:115 parameter 'dir' seems to be unused (the EnsureMachineAdmin own-key-grant Mutate closure) ``` errcheck — unchecked error returns in tests: ``` app/helper/cmd/helper/feedresolver_test.go:57:10 w.Write(...) app/helper/cmd/helper/feedresolver_test.go:70:10 w.Write(...) internal/clan/mirror_test.go:50:11 os.Remove(...) internal/clan/remoterepo_test.go:126:13 os.Remove(...) ``` Note `remoterepo.go:13` is a **comment-form** violation, not a missing comment: the doc comment reads `// RemoteConfigRepo: git lives on the box…`; revive wants `// RemoteConfigRepo holds …` (no colon after the identifier). ## Why it reached main without being caught The sandbox pre-push gate runs the full Go seam including `golangci-lint` (`gate_go_default_cmd`, `.sandcastle/gate-lib.sh:51`), but the **host** pre-push path runs the cheap **gofmt-only** tier (`gate_run`'s `go_tier=gofmt`, #1458) — so a push made from a host worktree never lints. This merge came off the local `worktree-rented-from-mac` branch, so only gofmt ran. The host gate's gofmt leg is separately known-broken (#1913). Widening or re-tiering the host gate is a human decision and is **not** part of this ticket. ## Acceptance - `nix develop .#go-ci --command golangci-lint run ./...` reports `0 issues.` at the root module, and the broker module stays clean. - Doc comments are real sentences in this repo's voice (what the type/method is *for*, the invariant it holds), not restatements of the signature — `remoterepo.go`/`remotecli.go` are the on-the-box git/CLI seam of the rented founding (ADR 0102), so say that. - An unused `ctx`/`dir` parameter is renamed `_` **only** where it genuinely cannot be used; if `ensureAgeKey` should be threading its `ctx` into a call, thread it instead of blanking it. - The errcheck sites are tests: assert the error (`if _, err := w.Write(...); err != nil { t.Fatal(err) }`) rather than discarding it to `_` where the write's success is part of the fixture's contract. - No change to `.golangci.yml` — the linter contract is not the fault here. Filed by the swarm healer (hook mode, run `heal-Matou-idss-1791139845-2933374`). Classified product-class: the fix lives in `internal/` and `app/` sources, which the healer charter forbids it from touching.
Author
Member

swarm-claim host=matou-dev-server-01 run=39389
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=matou-dev-server-01 run=39389 (automated multi-host claim — lowest live claim id works this ticket)
Author
Member

close-report for #2042 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 2042,
  "status": "success",
  "commits": [
    "b3f39c27"
  ],
  "changed_files": [
    "internal/clan/remotecli.go",
    "internal/clan/remoterepo.go",
    "internal/clan/secrets.go",
    "internal/clan/mirror_test.go",
    "internal/clan/remoterepo_test.go",
    "app/helper/cmd/helper/feedresolver_test.go"
  ],
  "tests": [
    {
      "command": "golangci-lint run ./... (pinned 2.12.2, go 1.25.11) at root module",
      "exit_code": 0
    },
    {
      "command": "golangci-lint run ./... at broker module",
      "exit_code": 0
    },
    {
      "command": "go test ./... (root module)",
      "exit_code": 0
    },
    {
      "command": "go test ./... (broker module)",
      "exit_code": 0
    },
    {
      "command": "pre-push gate: gofmt+build+vet+test+lint, both modules + dev tag",
      "exit_code": 0
    }
  ],
  "criteria": {
    "nix develop .#go-ci golangci-lint run ./... reports 0 issues at root; broker stays clean": "golangci-lint 2.12.2 (the pinned go-ci version) run ./... -> '0 issues.' at both the root module and broker/; the pre-push gate re-ran the full seam and reported 0 issues for both before the push landed (b3f39c27)",
    "Doc comments are real sentences naming what the type/method is for, and name the on-box git/CLI seam of the rented founding (ADR 0102)": "remotecli.go (Box, RemoteCLI, NewRemoteCLI) and remoterepo.go (RemoteConfigRepo comment-form fixed, OpenRemoteConfigRepo, Dir, ExecDir, Mutate, Head, ResetToRevision) now carry purpose/invariant comments that call them the on-the-box git/CLI seam of the rented founding (ADR 0102)",
    "Unused ctx/dir renamed to _ only where genuinely unusable; thread ctx if ensureAgeKey should": "ensureAgeKey's ctx blanked to _ because its callees readAgePubKey/adoptDefaultKey/mintAgeKeyFile are context-free pure-Go file ops (verified by grep: none take a ctx); both secrets.go Mutate closures blanked their dir param because they run clan against a.repo.ExecDir(), never the passed dir",
    "errcheck test sites assert the error rather than discarding to _": "feedresolver_test.go:57,70 assert w.Write via t.Errorf (handler goroutine-safe, unlike t.Fatal); mirror_test.go asserts os.Remove of a file it just wrote via t.Fatal; remoterepo_test.go's rm fake surfaces a real os.Remove failure as a non-zero exit while tolerating a missing path (faithful to rm -f on the box)",
    "No change to .golangci.yml": ".golangci.yml is not in changed_files; the linter contract is untouched"
  },
  "summary": "Fixed all 17 golangci-lint issues (13 revive, 4 errcheck) the worktree-rented-from-mac merge landed in internal/clan + app/helper, at source, no .golangci.yml change.",
  "blockers": []
}
**close-report** for #2042 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 2042, "status": "success", "commits": [ "b3f39c27" ], "changed_files": [ "internal/clan/remotecli.go", "internal/clan/remoterepo.go", "internal/clan/secrets.go", "internal/clan/mirror_test.go", "internal/clan/remoterepo_test.go", "app/helper/cmd/helper/feedresolver_test.go" ], "tests": [ { "command": "golangci-lint run ./... (pinned 2.12.2, go 1.25.11) at root module", "exit_code": 0 }, { "command": "golangci-lint run ./... at broker module", "exit_code": 0 }, { "command": "go test ./... (root module)", "exit_code": 0 }, { "command": "go test ./... (broker module)", "exit_code": 0 }, { "command": "pre-push gate: gofmt+build+vet+test+lint, both modules + dev tag", "exit_code": 0 } ], "criteria": { "nix develop .#go-ci golangci-lint run ./... reports 0 issues at root; broker stays clean": "golangci-lint 2.12.2 (the pinned go-ci version) run ./... -> '0 issues.' at both the root module and broker/; the pre-push gate re-ran the full seam and reported 0 issues for both before the push landed (b3f39c27)", "Doc comments are real sentences naming what the type/method is for, and name the on-box git/CLI seam of the rented founding (ADR 0102)": "remotecli.go (Box, RemoteCLI, NewRemoteCLI) and remoterepo.go (RemoteConfigRepo comment-form fixed, OpenRemoteConfigRepo, Dir, ExecDir, Mutate, Head, ResetToRevision) now carry purpose/invariant comments that call them the on-the-box git/CLI seam of the rented founding (ADR 0102)", "Unused ctx/dir renamed to _ only where genuinely unusable; thread ctx if ensureAgeKey should": "ensureAgeKey's ctx blanked to _ because its callees readAgePubKey/adoptDefaultKey/mintAgeKeyFile are context-free pure-Go file ops (verified by grep: none take a ctx); both secrets.go Mutate closures blanked their dir param because they run clan against a.repo.ExecDir(), never the passed dir", "errcheck test sites assert the error rather than discarding to _": "feedresolver_test.go:57,70 assert w.Write via t.Errorf (handler goroutine-safe, unlike t.Fatal); mirror_test.go asserts os.Remove of a file it just wrote via t.Fatal; remoterepo_test.go's rm fake surfaces a real os.Remove failure as a non-zero exit while tolerating a missing path (faithful to rm -f on the box)", "No change to .golangci.yml": ".golangci.yml is not in changed_files; the linter contract is untouched" }, "summary": "Fixed all 17 golangci-lint issues (13 revive, 4 errcheck) the worktree-rented-from-mac merge landed in internal/clan + app/helper, at source, no .golangci.yml change.", "blockers": [] } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/idss#2042
No description provided.