Skip to content

ci: run golangci-lint, matching the local pre-commit gate - #486

Merged
github-actions[bot] merged 2 commits into
mainfrom
feat/ci-golangci-lint
Aug 30, 2026
Merged

github-actions[bot] merged 2 commits into
mainfrom
feat/ci-golangci-lint

Conversation

@atrawog

@atrawog atrawog commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Summary

First instance of the go-ci-lint-parity batch (#464).

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 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/spec on 2026-08-29: 11 findings (7 errcheck, 2 gofmt, 2 unparam) sitting on a pristine main.

This adds the step to ci.yml's existing go job, next to the go test and gofmt steps already there.

How tested

This repo's main is clean today, so the gate lands green and its job is to keep it that way:

$ golangci-lint run ./charly/...
0 issues.
lint exit=0

The pinned version is the same build the local hook uses, confirmed rather than assumed:

$ go version -m $(command -v golangci-lint)
	path	github.com/golangci/golangci-lint/v2/cmd/golangci-lint
	mod	github.com/golangci/golangci-lint/v2	v2.13.2

Workflow parses:

$ python3 -c "import yaml; yaml.safe_load(open('.github/workflows/ci.yml'))"
workflow YAML 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 turn main red on its own schedule.

Scoped to ./charly/..., matching the go test step 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 candy CI red on main for ~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 main is currently lint-clean — spec demonstrably was not — because adding the gate to a drifted repo turns its main red immediately. That check is per-repo work, not a copy-paste.

Rulebook compliance

  • R1 (RCA) — the gap is measured (grep -rl golangci */.github/workflows/ → nothing across the umbrella; 98 Go repos), not assumed, and the consequence is a measured 11 findings on a real main.
  • R2 (no deferral) — charly#464 was mine, filed rather than fixed; this starts fixing it rather than leaving the issue as the deliverable.
  • R3 (no duplication) — reuses the existing go job and the repo's existing .golangci.yml; no parallel lint configuration.
  • R4 (no workarounds) — a real CI gate, pinned to the same tool build as the local hook, rather than loosening the hook to match CI's absence.
  • R6 (git safety) — feature branch, no force-push, no hook bypass.
  • R7 (prove the gate) — the lint run and the version provenance are pasted above; the workflow's own execution on this PR is the gate proving itself.

Change classification

  • Change class: CI configuration (one step added to an existing job)
  • Verification gate: golangci-lint run ./charly/... clean on the committed tree, workflow YAML parsed, and the step executing in this PR's own CI run
  • Attribution tier: fully 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 metadata

Assisted-by: Claude Code Anthropic Opus 5 (fully tested and validated)

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
@github-actions

Copy link
Copy Markdown
Contributor

Review — PASS

Head SHA: 6b41d16b51affdc635e87ff9def6b2dbddd36373 (branch: PR #486)

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 go install [email protected] (deterministic, same build as the local hook).

Checklist: All applicable rules PASS or NA.

  • Change class: CI configuration (one step added to the existing go job in .github/workflows/ci.yml).
  • A1/A2/A3: Body supplies summary, pasted lint output (0 issues. lint exit=0), version provenance, YAML parse, and names the batch (charly#464). Attribution footer *Assisted-by: Claude Code Anthropic Opus 5 (fully tested and validated)* is in the exact required form and justified for a CI-config change whose exact command was executed against the tree. Rulebook section answers the applicable rules (R1–R4, R6, R7); R5/R8/R9 are genuinely N/A for a CI-config change.
  • B5–B15: No warnings in gate output; RCA given for the 11-finding debt; no deferral (names the batch); no duplication (reuses existing job + .golangci.yml); no workarounds (real pinned gate); single atomic commit; no candy/schema/generated-file changes (ADE/SDD N/A).
  • B16 placement: CORRECT — CI enforcement belongs in .github/workflows/ci.yml; no core/sdk/candy placement concern.
  • B17/B18: No autonomous destroy/rebuild; no Go code in the diff (YAML parses per pasted output).

Verdict: PASS


ollama/deepseek-v4-flash — pi-review-action.

View action run

@github-actions
github-actions Bot enabled auto-merge (squash) August 30, 2026 11:08
@github-actions

Copy link
Copy Markdown
Contributor

Review — PASS

Head SHA: 10276569aba6ef93117ad273cea25b25732571b2 (branch: PR #486)

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 go install [email protected] pin (same build as the local hook).

Checklist: All applicable rules PASS or NA.

  • Change class: CI configuration (one step added to the existing go job in .github/workflows/ci.yml).
  • A1/A2/A3: Body supplies a real summary accounting for the single file, a How tested block with pasted output (0 issues. lint exit=0, go version -m module provenance showing v2.13.2, YAML parse), names the batch (charly#464), and ends with the exact *Assisted-by: Claude Code Anthropic Opus 5 (fully tested and validated)* footer. fully tested and validated is justified for a CI-config change whose exact command was executed against the tree and whose changed path (the step) runs live in the PR's own CI. Rulebook section answers the applicable rules; R5/R8/R9/R10 are genuinely N/A for a CI-config change.
  • B5–B15: No warnings in gate output; RCA given for the measured 11-finding debt; no deferral (names the batch); no duplication (reuses existing job + .golangci.yml); no workarounds (real pinned gate, not a loosened hook); single atomic commit; no candy/schema/generated-file changes (ADE/SDD N/A).
  • B16 placement: CORRECT — CI enforcement belongs in .github/workflows/ci.yml; no core/sdk/candy placement concern.
  • B17/B18: No autonomous destroy/rebuild; no Go code in the diff (YAML parses per pasted output).

Comment intake: The single prior comment is a PASS from a previous review at head 6b41d16b51af; the current head is a merge of main with an unchanged diff, so its claims still hold against the current state — verified-non-blocking.

Verdict: PASS


ollama/deepseek-v4-flash — pi-review-action.

View action run

@github-actions
github-actions Bot merged commit e9229a9 into main Aug 30, 2026
3 checks passed
charly-auto-merge Bot added a commit that referenced this pull request Aug 30, 2026
github-actions Bot pushed a commit to opencharly/spec that referenced this pull request Aug 30, 2026
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]>
@aitrawog
aitrawog deleted the feat/ci-golangci-lint branch September 25, 2026 19:04
aitrawog pushed a commit that referenced this pull request Nov 4, 2026
- 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)
github-actions Bot pushed a commit that referenced this pull request Nov 4, 2026
* 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]>
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