predict_bugs
Rank files by multi-signal bug risk score (git churn, complexity, coupling) to triage code reviews and prioritize inspection. Output includes risk bucket and confidence level.
Instructions
Heuristic bug-risk triage: ranks files by a multi-signal score (git churn, fix-commit ratio, complexity, coupling, PageRank importance, author count), NOT a validated predictor. Each prediction includes a numeric score, risk bucket (low/medium/high/critical) AND a confidence_level (low/medium/high/multi_signal) counting how many independent signals actually fired. The score is a prioritization heuristic — on this repo, a temporal-holdout calibration (scripts/calibrate-health-metrics.mjs) shows the git signals rank future-fixed files above chance (churn Spearman ~0.3, ~2x precision@K lift over random), which is useful for triage but far from a guarantee. Result envelope includes _methodology disclosure with limitations. Cached for 1 hour; use refresh=true to recompute. Requires git. Use to prioritize where to look first, not to certify a file as buggy. For complexity+churn hotspots only use get_risk_hotspots instead. Read-only. Returns JSON: { predictions: [{ file, score, risk, confidence_level, signals }], total }.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Max results (default: 50) | |
| refresh | No | Force recomputation (default: false) | |
| min_score | No | Min bug probability score to include (default: 0) | |
| file_pattern | No | Filter files containing this substring |