Skip to content

Add daily linter-miner agentic workflow for auto-generating Go linters - #32263

Merged
pelikhan merged 1 commit into
mainfrom
copilot/add-daily-agentic-workflow
May 15, 2026
Merged

pelikhan merged 1 commit into
mainfrom
copilot/add-daily-agentic-workflow

Conversation

Copilot AI commented May 15, 2026 •

Copy link
Copy Markdown
Contributor

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 new go/analysis linters as draft PRs targeting pkg/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 under pkg/ and cmd/ for constructs like os.Open without deferred Close, context.Background() inside context-receiving functions, and ignored error returns

Deduplication

  • cache-memory tracks previously proposed linter names across runs; already-submitted ideas are skipped

Code generation (linter-writer sub-agent)
Writes a complete linter package following pkg/linters/largefunc conventions:

  • pkg/linters/<name>/<name>.go — go/analysis analyzer with Analyzer, optional flag init(), and run()
  • pkg/linters/<name>/<name>_test.go — analysistest-based test (build-tagged !integration)
  • pkg/linters/<name>/testdata/src/<name>/<name>.go — fixture with // want annotations
  • cmd/linters/main.go — updated to register new analyzer in multichecker.Main

Verifies go build ./cmd/linters before opening a draft PR scoped to pkg/linters/** + cmd/linters/main.go.

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
Copilot AI requested a review from pelikhan May 15, 2026 03:07
@pelikhan
pelikhan marked this pull request as ready for review May 15, 2026 03:09
Copilot AI review requested due to automatic review settings May 15, 2026 03:09
@pelikhan
pelikhan merged commit 8786ae0 into main May 15, 2026
@pelikhan
pelikhan deleted the copilot/add-daily-agentic-workflow branch May 15, 2026 03:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.md defining the agentic workflow prompt, sub-agents, safe outputs, and tool allowlists.
  • Adds the compiled workflow .github/workflows/linter-miner.lock.yml generated 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, but tools.bash doesn’t currently allow running go build (and the compiled lock file has no shell(go ...) allowance). Add an explicit go build ./cmd/linters entry (and any other required go commands) to the tools.bash allowlist 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"
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.

3 participants