Repository navigation
Add daily linter-miner agentic workflow for auto-generating Go linters - #32263
Merged
Merged
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
Add daily linter-miner agentic workflow
Add daily linter-miner agentic workflow for auto-generating Go linters
May 15, 2026
pelikhan
marked this pull request as ready for review
May 15, 2026 03:09
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new daily Agentic Workflow (“Linter Miner”) that mines repo discussions/issues and scans Go code for recurring patterns, then generates a new go/analysis linter package and opens it as a draft PR.
Changes:
- Introduces
.github/workflows/linter-miner.mddefining the agentic workflow prompt, sub-agents, safe outputs, and tool allowlists. - Adds the compiled workflow
.github/workflows/linter-miner.lock.ymlgenerated from the markdown source.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/linter-miner.md |
Defines the daily “linter-miner” agent workflow, its sub-agents, constraints, and safe-output PR creation policy. |
.github/workflows/linter-miner.lock.yml |
Compiled GitHub Actions workflow implementing the agentic run, tool mounting, cache-memory, detection, and safe-outputs handling. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comments suppressed due to low confidence (1)
.github/workflows/linter-miner.md:29
- Step 5 requires verifying compilation with
go build ./cmd/linters, buttools.bashdoesn’t currently allow runninggo build(and the compiled lock file has noshell(go ...)allowance). Add an explicitgo build ./cmd/lintersentry (and any other requiredgocommands) to thetools.bashallowlist so the agent can actually perform the required verification.
key: linter-miner-state-${{ github.workflow }}
bash:
- "find pkg/linters -type f -name *.go"
- "find pkg/linters -type d"
- "cat pkg/linters/**/*.go"
- "cat cmd/linters/main.go"
- "grep -r * pkg/linters --include=*.go"
- "cat pkg/linters/largefunc/largefunc.go"
- "cat .github/skills/go-linters/SKILL.md"
- Files reviewed: 2/2 changed files
- Comments generated: 4
Comment on lines
+14
to
+22
| engine: copilot | ||
| tools: | ||
| cli-proxy: true | ||
| github: | ||
| mode: gh-proxy | ||
| toolsets: [default, discussions, issues, repos] | ||
| cache-memory: | ||
| key: linter-miner-state-${{ github.workflow }} | ||
| bash: |
| bash: | ||
| - "find pkg/linters -type f -name *.go" | ||
| - "find pkg/linters -type d" | ||
| - "cat pkg/linters/**/*.go" |
| - "find pkg/linters -type d" | ||
| - "cat pkg/linters/**/*.go" | ||
| - "cat cmd/linters/main.go" | ||
| - "grep -r * pkg/linters --include=*.go" |
| - "cat cmd/linters/main.go" | ||
| - "grep -r * pkg/linters --include=*.go" | ||
| - "cat pkg/linters/largefunc/largefunc.go" | ||
| - "cat .github/skills/go-linters/SKILL.md" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
New Feature
What does this feature do?
Adds
.github/workflows/linter-miner.md— a daily scheduled agentic workflow that mines repo discussions, issues, and Go source for recurring error patterns, then generates and submits newgo/analysislinters as draft PRs targetingpkg/linters/.Implementation details
Mining (parallel sub-agents)
discussion-miner— queries last 60 days of Discussions/Issues for Go patterns mentioned in reviews or bug reports (unchecked errors, missing defers, nil derefs, etc.)code-pattern-scanner— uses Serena LSP to scan non-test Go underpkg/andcmd/for constructs likeos.Openwithout deferredClose,context.Background()inside context-receiving functions, and ignored error returnsDeduplication
cache-memorytracks previously proposed linter names across runs; already-submitted ideas are skippedCode generation (
linter-writersub-agent)Writes a complete linter package following
pkg/linters/largefuncconventions:pkg/linters/<name>/<name>.go—go/analysisanalyzer withAnalyzer, optional flaginit(), andrun()pkg/linters/<name>/<name>_test.go—analysistest-based test (build-tagged!integration)pkg/linters/<name>/testdata/src/<name>/<name>.go— fixture with// wantannotationscmd/linters/main.go— updated to register new analyzer inmultichecker.MainVerifies
go build ./cmd/lintersbefore opening a draft PR scoped topkg/linters/**+cmd/linters/main.go.