Bug Predict errors

Common error signatures

Errors in bug predict fall into three categories: failures during workflow execution, failures during report formatting, and failures in the subagent coordination layer.

Workflow execution (BugPredictionWorkflow.execute)

Report formatting (format_bug_predict_report)

CLI entry point (main)

Where errors originate

How to diagnose

  1. Identify which layer failed. Check whether the traceback points to bug_predict.py (workflow or subagent coordination) or bug_predict_report.py (formatting or CLI). The fix differs by layer.

  2. Check the result dict shape. If the error is a KeyError or TypeError inside format_bug_predict_report, inspect the WorkflowResult returned by execute. A partial run — for example, one where risk-correlator or prevention-advisor did not finish — produces an incomplete dict that the formatter cannot process.

  3. Check the path argument. _TASK_PROMPT_TEMPLATE requires a {path} value. If execute was called without a resolvable path, the orchestrator prompt is malformed and all three subagents receive bad input. Confirm the path exists before calling execute.

  4. Inspect false-positive filter state. If the scan runs but returns no findings on code you expect to be flagged, check whether the matched lines contain any _INTENTIONAL_KEYWORDS (fallback, ignore, optional, best effort, graceful, intentional) or a # INTENTIONAL: / # noqa: BLE001 marker, which the scanner suppresses automatically.

  5. Verify test files are not contaminating results. Files matching _SCANNER_TEST_PATTERNS (test_bug_predict, test_scanner, test_security_scan) are excluded from scanning. If your production code path shares a name with one of these patterns, it will be silently skipped.

Source files

Tags: bugs, prediction, scanning