Repository navigation
ci: run golangci-lint, matching the local pre-commit gate - #486
Conversation
No opencharly repo runs golangci-lint in CI. The only enforcement is .claude/hooks/pre-commit-gate.sh, which runs it locally at commit time — so nothing keeps a default branch green between commits and lint debt accumulates on main unnoticed. That debt is not theoretical, and it does not land on whoever created it: the hook lints the WHOLE repo rather than the diff, so the next contributor to touch a drifted repo cannot commit at all until they have cleaned up someone else's files. Measured in opencharly/spec on 2026-08-29: 11 findings (7 errcheck, 2 gofmt, 2 unparam) sitting on a pristine main. This repo's main is clean today (`golangci-lint run ./charly/...` -> 0 issues), so the gate lands green and its job is to keep it that way. Pinned by module version rather than a third-party action, so the CI binary is the same build the hook uses locally and a new upstream release cannot turn main red on its own schedule. First instance of the go-ci-lint-parity batch (#464); the other Go repos take the same step. Claude-Session: https://claude.ai/code/session_016fnPmYiC6ZkqXSi6D8PAP6
Review — PASSHead SHA: Security screen: PASS — no scope mismatch (single CI step matching the description), no secrets/exfiltration, no weakened guardrails (this adds a lint gate), supply chain is a pinned Checklist: All applicable rules PASS or NA.
Verdict: PASS ollama/deepseek-v4-flash — pi-review-action. |
Review — PASSHead SHA: Security screen: PASS — single CI step matching the description (no scope mismatch), no secrets/exfiltration, no weakened guardrails (this adds a lint gate), supply chain is a deterministic Checklist: All applicable rules PASS or NA.
Comment intake: The single prior comment is a PASS from a previous review at head Verdict: PASS ollama/deepseek-v4-flash — pi-review-action. |
This repo had NO Go CI: only pr-validator.yml and tag-on-merge.yml, neither of which builds, tests or lints the module. The only enforcement was the local pre-commit hook, so nothing kept main green between commits. The drift is not hypothetical, and it recurs. opencharly/charly#464 measured 11 findings on this repo's main on 2026-08-29; #68 cleared them; main has 2 again today, from #73: lock/filelock_timeout_test.go:25:15: Error return value of `f.Close` is not checked lock/filelock_timeout_test.go:30:15: Error return value is not checked Both are deferred calls in a test whose errors were never meant to be consumed; they are made explicit rather than silenced, so the gate lands green. That recurrence is the argument for the gate. Because the hook lints the WHOLE repo rather than the diff, these two findings would have blocked the next contributor to touch this repo — someone with no connection to #73. golangci-lint is pinned by module version rather than a third-party action, so the CI binary is the same build the hook uses locally and a new upstream release cannot turn main red on its own schedule. Second instance of the go-ci-lint-parity batch, after opencharly/charly#486. Claude-Session: https://claude.ai/code/session_016fnPmYiC6ZkqXSi6D8PAP6 Co-authored-by: atrawog <[email protected]>
- opencharly/sdk #486 merged ca7aef33e2d3f1ece96f3877072d23a9ba0e1c46, tag v0.2026308.652 (relaxes the FoldMembers origin identity for one repo mounted at two refs) The umbrella imports distro-cachyos at two tags (v2026.281.1001 via charly/layer-openclaw and v2026.290.2137 via layer-strata). The .444 origin identity included the ref, so the same member under cachyos-gpu was reported as a collision; .652 folds it and keeps different repos and different import subpaths as hard errors. box validate from the umbrella root: rc=1 before (the .444 binary), rc=0 after (609 candies, 198 boxes, 7 distros, 7 builders, 0 warnings). Gate on this tree: gofmt -l (empty); go mod tidy twice per module (second no-op); go build ./...; go vet ./...; go test ./...; tools sweep; bootstrap-charly.sh; charly box validate (603 candies, 122 boxes, 49 deploys); umbrella box validate (609 candies, 198 boxes). All rc=0. Agent: containerd-crabbox-program/pin1083 Assisted-by: Claude Code ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
* chore(deps): adopt sdk v0.2026308.444 and spec v0.2026308.344 Producer-first contract bump: - opencharly/spec #291 merged c9343efc2e344706d885053161d01129864b51a2, tag v0.2026308.344 - opencharly/sdk #483 merged 1175c7c7651b5789f40838abf027676329854f42, tag v0.2026308.351 - opencharly/sdk #485 merged 57221e49b93d017fa60c135914df530067a4a7f7, tag v0.2026308.444 (repairs sdk#484: the namespace-diamond member collision in the .351 fold) The .351 tag is not adopted: it made charly box validate fail with a phantom deploy-level member collision on the arch + cachyos.arch diamond. .444 dedupes diamond members by logical origin instead of node pointer, and box validate is green again with 603 candies, 122 boxes, 49 deploys, 7 distros, 7 builders, 0 warnings. Adopted in charly/go.mod and in the three lockstep tools modules that carry the shared pins (tools/generate-packages, tools/golden-cloudinit, tools/golden-compile), as TestContractPinsMatchEverywhere requires. Gate on this tree: go mod tidy twice per module (second no-op); go build ./...; go vet ./...; go test ./...; tools sweep; scripts/bootstrap-charly.sh; charly box validate. All rc=0. Agent: containerd-crabbox-program/pin1083 Assisted-by: Claude Code ollama-cloud/deepseek-v4.1-flash (fully tested and validated) * chore(deps): adopt sdk v0.2026308.652 (umbrella-load repair) - opencharly/sdk #486 merged ca7aef33e2d3f1ece96f3877072d23a9ba0e1c46, tag v0.2026308.652 (relaxes the FoldMembers origin identity for one repo mounted at two refs) The umbrella imports distro-cachyos at two tags (v2026.281.1001 via charly/layer-openclaw and v2026.290.2137 via layer-strata). The .444 origin identity included the ref, so the same member under cachyos-gpu was reported as a collision; .652 folds it and keeps different repos and different import subpaths as hard errors. box validate from the umbrella root: rc=1 before (the .444 binary), rc=0 after (609 candies, 198 boxes, 7 distros, 7 builders, 0 warnings). Gate on this tree: gofmt -l (empty); go mod tidy twice per module (second no-op); go build ./...; go vet ./...; go test ./...; tools sweep; bootstrap-charly.sh; charly box validate (603 candies, 122 boxes, 49 deploys); umbrella box validate (609 candies, 198 boxes). All rc=0. Agent: containerd-crabbox-program/pin1083 Assisted-by: Claude Code ollama-cloud/deepseek-v4.1-flash (fully tested and validated) * fix(check): compose the `vm` substrate so check-sidecar-pod's member can deploy `check-sidecar-pod` declares a deploy-level VM member (`from: eval-vm` at charly.yml:1243), and `sdk/deploykit.BringUpMembers` dispatches `deploy add` for it. A `vm:` deploy needs the `vm` substrate, and this project imported only the six distro layers — so the member deploy refused: the "vm" deploy substrate is not available in this project — its deploy plugin (plugin-deploy-vm) is not in the candy closure That refusal is the last surviving failure of the bed this whole chain exists for. Measured across five runs, each exposing the next layer: 2026.307.2144 short-name "charly/check-sidecar-pod" (deploy key, pre-plugin-fix) 2026.308.0128 resolving ref "charly.eval-vm" for "pod" (substrate defaulted to pod) 2026.308.0525 vm substrate not available (charly's root) (fold fixed, venue lacked it) 2026.308.0722 short-name "charly.check-k8s-deploy-app" (pins without the overlay fix) 2026.308.0842 vm substrate not available (umbrella) (this import missing) Neither project composed it: `charly/charly.yml` had zero occurrences outside two comments, and the umbrella imports only `./charly`. Verified: `charly box validate` goes 603 -> 604 candies, 0 warnings, 0 errors — the extra candy is plugin-deploy-vm — and the full R10 bed then passes end to end, all 19 steps, RC=0, errors: 0 (run 2026.308.1106 on a disposable VM target), including bring-up-members, check-live, the fresh `charly update` rebuild, and check-live-rebuild. Agent: containerd-crabbox-program, session 8b1c01cf-7f79-4a75-bff8-240415a06208 Assisted-by: Claude Code ollama-cloud/deepseek-v4.1-flash (fully tested and validated) --------- Co-authored-by: Andreas Trawoeger <[email protected]>
Summary
First instance of the
go-ci-lint-paritybatch (#464).No opencharly repo runs
golangci-lintin CI. The only enforcement is.claude/hooks/pre-commit-gate.sh, which runs it locally at commit time — so nothing keeps a default branch green between commits, and lint debt accumulates onmainunnoticed.That debt does not land on whoever created it. The hook lints the whole repo, not the diff, so the next contributor to touch a drifted repo cannot commit at all until they have cleaned up someone else's files. Measured in
opencharly/specon 2026-08-29: 11 findings (7errcheck, 2gofmt, 2unparam) sitting on a pristinemain.This adds the step to
ci.yml's existinggojob, next to thego testandgofmtsteps already there.How tested
This repo's
mainis clean today, so the gate lands green and its job is to keep it that way:The pinned version is the same build the local hook uses, confirmed rather than assumed:
Workflow parses:
The step's own run in CI on this PR is the live proof that it executes and passes.
Two deliberate choices
Pinned by module version, not a third-party action.
go install github.com/golangci/golangci-lint/v2/cmd/[email protected]means the CI binary is the same build the pre-commit hook uses locally — a gate that disagrees with the hook is worse than no gate, because it fails people who did everything right. It also means a new upstream release cannot turnmainred on its own schedule.Scoped to
./charly/..., matching thego teststep above it rather than linting paths the existing job does not build.On the rest of the batch
charly#464 covers 98 Go repos in the umbrella; none currently has this gate. I am landing this one first rather than opening 98 PRs at once, deliberately: I ran a 94-repo sweep earlier in this session that stamped a schema version the repos' pinned charly could not read, and turned
candyCI red onmainfor ~84 of them until a second corrective sweep. A proven template first, replication second, is the lesson from that.What makes this one a template rather than a one-off: the step is self-contained, pins its own tool, and needs no repo-specific configuration beyond the package scope. What still has to be checked per repo before it lands there is whether that repo's
mainis currently lint-clean —specdemonstrably was not — because adding the gate to a drifted repo turns itsmainred immediately. That check is per-repo work, not a copy-paste.Rulebook compliance
grep -rl golangci */.github/workflows/→ nothing across the umbrella; 98 Go repos), not assumed, and the consequence is a measured 11 findings on a realmain.gojob and the repo's existing.golangci.yml; no parallel lint configuration.Change classification
golangci-lint run ./charly/...clean on the committed tree, workflow YAML parsed, and the step executing in this PR's own CI runfully tested and validated— the exact command the step runs was executed against this tree with its output pasted, and the pinned version is confirmed from the installed binary's module metadataAssisted-by: Claude Code Anthropic Opus 5 (fully tested and validated)