@cursor review
Bug classification workflow using claude_agent_sdk.query() for lightweight, stateless 3-way evidence cross-reference. This is the "how we classified" code that powers the classification results in PR #1381.
For each of 701 bugs, the workflow reads THREE evidence sources:
ci_classifications_final.json)execute() method)Then classifies into 5 responsibility buckets:
| File | Purpose |
|---|---|
cortex/agents/bug_classifier/agent.py | Uses query() from claude_agent_sdk for one-shot classification |
cortex/agents/bug_classifier/prompt.py | System prompt + user prompt template with 3-way evidence |
cortex/agents/bug_classifier/models.py | Pydantic models (BugEvidence, BugClassification, BatchClassificationResponse) |
cortex/agents/bug_classifier/runner.py | Workflow orchestrator: reads inputs, batches by (tool,action), resolves Mercury files, runs agent, writes output |
watchdog/pipelines/bug_classification/cluster.py | 10-cluster taxonomy (shared with #1381) |
watchdog/pipelines/bug_classification/categorize.py | 5-bucket responsibility mapping (shared with #1381) |
query() not ClaudeSDKClient — lightweight, stateless, no MCP server overhead. Each batch is an independent one-shot query using the logged-in Claude Code session. No separate API key.temperature=0 for deterministic, reproducible classifications.difflib.get_close_matches against the directory listing.python -m cortex.agents.bug_classifier.runner \
--classifications /tmp/ci_classifications_final.json \
--logs /path/to/all_logs.json \
--mercury-root /Users/equinox/mercury \
--output bug_logs/dashboard_backup_v7/bug_categorization.json \
--tc-row-map /tmp/tc_row_map.json
PR #1381 has the classification results (dashboard, reports, seed data). This PR has the classification methodology (the agent that produces those results). They share the taxonomy code (cluster.py, categorize.py) which is included in both PRs for self-containment.
The previous iteration used gpt-4o via OPENAI_API_KEY; this replaces it with Claude via the Claude Agents SDK, following the patterns established in cortex/agents/ and customer-support.
ruff format + ruff check passquery() function needs a live Claude Code session to execute)🤖 Generated with Claude Code
@cursor review
Skipping Bugbot: Bugbot is disabled for this repository. Visit the Bugbot dashboard to update your settings.