agent-orchestrator/backend/internal
prateek 8df074b1c9 chore(backend): add golangci-lint with a strong ruleset and clear the tree
Introduces backend/.golangci.yml (27 linters across correctness, dead-code/
boilerplate, style, and security), wires it into CI as a blocking job, and
fixes every finding so the tree starts at zero.

Config:
- 27 linters: errcheck, govet, staticcheck, errorlint, bodyclose,
  sqlclosecheck, rowserrcheck, nilerr, makezero, unused, unparam, unconvert,
  wastedassign, copyloopvar, prealloc, dupl, revive (incl. exported-symbol doc
  comments), gocritic, misspell, usestdlibvars, predeclared, nakedret, gosec, …
- Tuned for signal over noise: govet/shadow and gocritic hugeParam/rangeValCopy/
  unnamedResult disabled (idiomatic-Go false positives); sqlc-generated code and
  tests get scoped exclusions; gosec G304 excluded (paths are config/run-file/
  worktree-derived, not user input); nilerr excluded in cli/status.go (probe
  failures are the reported status, not a command error).

CI:
- New blocking lint job (golangci-lint-action, latest binary for Go-version
  compatibility).
- go-version now read from go.mod (was pinned 1.22 while go.mod declares 1.25).

Cleanup to reach zero (no behavior change):
- errcheck: wrap deferred/inline Close()/Remove()/Rollback() with `_ =`.
- gosec: tighten dir/file perms (0755->0750, 0644->0600).
- unparam: drop always-nil error return from startLifecycle; drop unused
  shellPath param (zellij PowerShell) and always-500 fallbackStatus param
  (writeProjectError).
- gocritic: regexp \d, s != "", switch->if, combined appends.
- revive: doc comments on all exported symbols; rename project.ProjectRow ->
  project.Row (stutter); rename `max` locals shadowing the builtin.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 04:58:41 +05:30
..
adapters chore(backend): add golangci-lint with a strong ruleset and clear the tree 2026-06-01 04:58:41 +05:30
cdc chore(backend): add golangci-lint with a strong ruleset and clear the tree 2026-06-01 04:58:41 +05:30
cli chore(backend): add golangci-lint with a strong ruleset and clear the tree 2026-06-01 04:58:41 +05:30
config Revert "feat: add notifier delivery runtime" 2026-06-01 04:46:38 +05:30
daemon chore(backend): add golangci-lint with a strong ruleset and clear the tree 2026-06-01 04:58:41 +05:30
daemonmeta fix(cli): verify daemon ownership before stop signal 2026-06-01 01:45:04 +05:30
domain chore(backend): add golangci-lint with a strong ruleset and clear the tree 2026-06-01 04:58:41 +05:30
httpd chore(backend): add golangci-lint with a strong ruleset and clear the tree 2026-06-01 04:58:41 +05:30
integration chore(backend): add golangci-lint with a strong ruleset and clear the tree 2026-06-01 04:58:41 +05:30
lifecycle chore(backend): add golangci-lint with a strong ruleset and clear the tree 2026-06-01 04:58:41 +05:30
notification chore(backend): add golangci-lint with a strong ruleset and clear the tree 2026-06-01 04:58:41 +05:30
observe/reaper feat(backend): port lifecycle lane onto the new storage+CDC model 2026-05-31 07:16:06 +05:30
ports chore(backend): add golangci-lint with a strong ruleset and clear the tree 2026-06-01 04:58:41 +05:30
project chore(backend): add golangci-lint with a strong ruleset and clear the tree 2026-06-01 04:58:41 +05:30
runfile chore(backend): add golangci-lint with a strong ruleset and clear the tree 2026-06-01 04:58:41 +05:30
session chore(backend): add golangci-lint with a strong ruleset and clear the tree 2026-06-01 04:58:41 +05:30
storage/sqlite chore(backend): add golangci-lint with a strong ruleset and clear the tree 2026-06-01 04:58:41 +05:30
terminal chore(backend): add golangci-lint with a strong ruleset and clear the tree 2026-06-01 04:58:41 +05:30