Repository navigation
Description
Context & Rationale
The review's static stage picks analyzers by file suffix in _run_static_scanners (ai/review/pipeline.py:1165-1229). Bandit runs on .py, Kube-linter and Pluto on YAML, Trivy on container files and lockfiles, and Gitleaks and Semgrep p/default on every file. _STATIC_ANALYZERS (pipeline.py:849-856) has no Go entry, and neither do the registry's 11 scanners (security/registry.py:16-42), so a .go file gets only generic rules. SARIF ingestion already exists (security/sarif.py:311, security/normalization.py:308). The review already reports a missing binary as not run (#516, pipeline.py:860-872). .devops/review.md already carries per-repo rules into persona prompts (ai/review/review_environment.py:74). vibes wrote its own pprof goroutine classifier. Its survey lists uber-go/goleak as the maintained alternative (docs/landscape/SURVEY.md:36), and its roadmap plans a golangci-lint integration (docs/ROADMAP.md:63).
Scope & Deliverables
- Context & Rationale*: The review's static stage picks analyzers by file suffix in
_run_static_scanners(ai/review/pipeline.py:1165-1229). Bandit runs on.py, Kube-linter and Pluto on YAML, Trivy on container files and lockfiles, and Gitleaks and Semgrepp/defaulton every file._STATIC_ANALYZERS(pipeline.py:849-856) has no Go entry, and neither do the registry's 11 scanners (security/registry.py:16-42), so a.gofile gets only generic rules. SARIF ingestion already exists (security/sarif.py:311,security/normalization.py:308). The review already reports a missing binary as not run (fix(review): the static scan reports a clean result when its scanners are not installed #516,pipeline.py:860-872)..devops/review.mdalready carries per-repo rules into persona prompts (ai/review/review_environment.py:74). vibes wrote its own pprof goroutine classifier. Its survey listsuber-go/goleakas the maintained alternative (docs/landscape/SURVEY.md:36), and its roadmap plans a golangci-lint integration (docs/ROADMAP.md:63). - Deliverable*: Add a
GolangciLintScannerto the registry. It requests SARIF output and converts it withfrom_sarifandto_finding, so no bespoke parser is needed. Default linters are errcheck, govet (with lostcancel) and staticcheck; contextcheck is opt-in. Add agokind and a golangci-lint row to_STATIC_ANALYZERS. Add a.gobranch in_run_static_scannersthat runs once per nearestgo.modroot and keeps only findings in reviewed files, using_match_static_findings_to_files. Add a golangci-lint entry incommands/install_tools.py. Keep the suffix dispatch and do not reroute the stage through the registry. Do not port the vibes classifier ortools/cpp_lifetime_sentinel.py. File two follow-ups separately. The first is a Go persona addendum that recommends goleak. It is blocked on Model-in-the-Loop Prompt Benchmarking and on a goroutine defect template, whichai/review/defects.pydoes not have. The second is clang-tidy with acompile_commands.json, only once thefmtsample shows a recall gap. - Constraint*: golangci-lint loads packages through the Go toolchain. It needs
goon PATH and module dependencies it can resolve, and it runs per module, not per file list. A missinggo, a package-load or typecheck failure, and a missing binary must each record their own analyzer state, never zero findings. The registry path still returns[]for a missing binary (security/base.py:93-97), sodevops scan reportneeds the same guard for this scanner. A first run on an existing tree floods the review. Branch reviews should use golangci-lint's own--new-from-merge-baserather than a hand-rolled baseline. Measure before claiming value: rundevops review samples validate --reviewon thegocategory (cobra) before and after the change. - Measured*: The vibes classifier reports CLEAN at 100.0 on a hand-built dump that has a
chan sendgoroutine underruntime.gopark(python3 -B probe/probe_leak.py). One managed repository holds 359 non-vendored.gofiles (find <repo> -name '*.go' -not -path '*/vendor/*' | wc -l), and it tracks none of them (git -C <repo> ls-files '*.go' | wc -lgives 0). All 3 saved Go sample validations havereview: null(.data/reviews/sample-validations/*/go.json), so Go review recall has never been measured. - Source*: vibes
examples/go-leak-sentinel/README.md,examples/go-leak-sentinel/sentinel.go,examples/go-leak-sentinel/go_leak_sentinel.py,observations/polyglot/03-go-goroutine-leakage-and-context-lifecycles.md,observations/polyglot/04-cpp-raii-and-lifetime-invariants-under-llm-synthesis.md,tools/cpp_lifetime_sentinel.py,docs/ROADMAP.md,docs/landscape/SURVEY.md
Update 2026-10-08: refinement
Nothing runs golangci-lint. A Go bucket goes in _run_static_scanners (ai/review/pipeline.py:2574), and findings pass #871's admission. #871's base-revision scan (:2238) replaces --new-from-merge-base, but it writes only reviewed files (:2253-2258), so a Go base scan also needs go.mod. The version goes in #1142's lock, not install_tools.py; it runs through #772's executor and counts after #1143's canary. Depends on #1142, #772 and #1143.
Proposed design
Problem statement
The review's static analysis stage does not include support for Go files, meaning that .go files only receive generic rule checks instead of language-specific linting. This issue aims to add golangci-lint as a scanner for Go files using SARIF output conversion.
Acceptance criteria
- Criterion 1: A GolangciLintScanner is added to the security registry
Verification: Verify that GolangciLintScanner class exists in security/registry.py and is registered with the scanner registry. - Criterion 2: Go files are analyzed using golangci-lint with SARIF output conversion
Verification: Run devops review on a Go repository and confirm that findings from golangci-lint appear in the review results for .go files. - Criterion 3: The scanner runs once per nearest go.mod root and filters findings to reviewed files
Verification: Verify that _run_static_scanners function in pipeline.py includes a branch for '.go' files that calls _match_static_findings_to_files to filter findings. - Criterion 4: Default linters include errcheck, govet (with lostcancel), and staticcheck with contextcheck as opt-in
Verification: Check that the GolangciLintScanner's default configuration includes these linters in the correct order and that contextcheck is properly configured as optional. - Criterion 5: The golangci-lint binary is installed via commands/install_tools.py
Verification: Run devops install tools and confirm that golangci-lint appears in the list of installed tools.
Key questions
- What are the default linters for golangci-lint that should be enabled?: Default linters are errcheck, govet (with lostcancel) and staticcheck; contextcheck is opt-in. [sources: docs/agent/tasks/task-603-golangci-lint-sarif-adapter-for-go-in-scan-and-review.md:17]
- How should the scanner integrate with existing SARIF ingestion capabilities?: The scanner should request SARIF output and convert it using from_sarif and to_finding functions, so no bespoke parser is needed. [sources: docs/agent/tasks/task-603-golangci-lint-sarif-adapter-for-go-in-scan-and-review.md:17]
- Should the Go scanner run per file or per module?: It should run once per nearest go.mod root, not per file list. [sources: docs/agent/tasks/task-603-golangci-lint-sarif-adapter-for-go-in-scan-and-review.md:17]
- What is the expected behavior when golangci-lint binary is not available?: A missing binary must record its own analyzer state, never zero findings, and the registry path still returns [] for a missing binary. [sources: docs/agent/tasks/task-603-golangci-lint-sarif-adapter-for-go-in-scan-and-review.md:18]
- Should the implementation port the vibes classifier or cpp_lifetime_sentinel.py?: No, these should not be ported. [sources: docs/agent/tasks/task-603-golangci-lint-sarif-adapter-for-go-in-scan-and-review.md:17]
- Should the implementation use the registry path or maintain suffix dispatch?: Keep the suffix dispatch and do not reroute the stage through the registry. [sources: docs/agent/tasks/task-603-golangci-lint-sarif-adapter-for-go-in-scan-and-review.md:17]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
dan-petty commentedon Oct 1, 2026
Moved from the shipped v0.2.23 to the backlog. It is still valid (checked 2026-10-01), and P2 items don't displace P1 work in the planned releases.
dan-petty commentedon Oct 18, 2026
Status set to Ready at 25e2cda (see proposed design in issue body).