Overview
pdd crash fixes errors in a code module and its calling program that caused a program to crash at runtime. It modifies the code file, and optionally the program file, until the module runs without errors.
How crash differs from fix and verify:
| Command | Triggered by | Fixes |
|---|---|---|
pdd crash | Runtime errors (the program fails to run) | Code and program files |
pdd fix | Unit test failures | Code and test files |
pdd verify | Output mismatch (LLM judgment) | Code and program files |
Usage
PROMPT_FILE— Prompt file that generated the code module.CODE_FILE— Code module that caused the crash. This file is modified until it runs correctly.PROGRAM_FILE— Program that was running the code module. This file is also modified if necessary to fix the crash.ERROR_FILE— File containing the error output from the failed program run.
Options
Where to save the fixed code file. Defaults to
<basename>_fixed.<extension>, or to PDD_CRASH_OUTPUT_PATH if set.Where to save the fixed program file. Defaults to
<program_basename>_fixed.<extension>.Enable iterative fixing. The command reruns the program after each fix attempt and continues until it succeeds,
--max-attempts is reached, or --budget is exhausted.Maximum number of fix attempts in
--loop mode.Maximum cost in USD allowed for the fixing process.
When sync calls crash
pdd sync runs crash as step 4 of its workflow, after example has been generated. It uses the example file as the PROGRAM_FILE and any runtime error output as the ERROR_FILE. If the example runs without errors, this step is skipped.
Examples
crash is intended for runtime errors — situations where the program fails to start or throws an unhandled exception. For logical errors where the program runs but produces wrong output, use pdd verify. For failing unit tests, use pdd fix.