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)
ValueError— thepathargument in the task prompt template is missing or resolves to a location the orchestrator cannot access.RuntimeError— one or more of the three subagents (pattern-scanner,risk-correlator,prevention-advisor) did not return a result before the workflow completed.
Report formatting (format_bug_predict_report)
KeyError—resultorinput_datais missing a field the formatter expects (for example,severity,findings, orrisk_score).TypeError—resultorinput_datawas passed asNoneor an unexpected type instead ofdict.
CLI entry point (main)
SystemExitwith a non-zero code — the path argument was not supplied or could not be resolved beforeBugPredictionWorkflowwas instantiated.
Where errors originate
BugPredictionWorkflow.__init__inworkflows/bug_predict.py— validates constructor arguments, includingsystem_prompt_suffix, before the workflow starts. A bad value here prevents any scanning from running.BugPredictionWorkflow.executeinworkflows/bug_predict.py— coordinatespattern-scanner,risk-correlator, andprevention-advisor. If subagent synthesis fails, the error surfaces here as aWorkflowResultwith no findings or as an unhandled exception.format_bug_predict_reportinworkflows/bug_predict_report.py— converts the rawresultdict andinput_datadict into the human-readable report. Malformed or incomplete dicts from a partialexecuterun will cause this function to fail.maininworkflows/bug_predict_report.py— the CLI entry point. Errors here typically mean the workflow never ran, not that it ran and produced bad output.
How to diagnose
-
Identify which layer failed. Check whether the traceback points to
bug_predict.py(workflow or subagent coordination) orbug_predict_report.py(formatting or CLI). The fix differs by layer. -
Check the
resultdict shape. If the error is aKeyErrororTypeErrorinsideformat_bug_predict_report, inspect theWorkflowResultreturned byexecute. A partial run — for example, one whererisk-correlatororprevention-advisordid not finish — produces an incomplete dict that the formatter cannot process. -
Check the path argument.
_TASK_PROMPT_TEMPLATErequires a{path}value. Ifexecutewas called without a resolvable path, the orchestrator prompt is malformed and all three subagents receive bad input. Confirm the path exists before callingexecute. -
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: BLE001marker, which the scanner suppresses automatically. -
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
src/attune/workflows/bug_predict.pysrc/attune/workflows/bug_predict_report.py
Tags: bugs, prediction, scanning