Debug Generated Code Safely
Evidence status: This procedure was applied while classifying the recorded Java generator/runtime blockers and Rust generated-workspace findings. Repeat it and retain fresh evidence for every new failure.
Problem
A compiler or runtime failure points into generated code, and you need to find the real source without creating a patch that disappears on regeneration.
Diagnostic Workflow
- Reproduce the failure from a clean evaluation and generation.
- Read the complete Markdown report if one exists.
- Identify the first handwritten-to-generated API boundary in the stack.
- Open the generated entity/request source and record exact signatures.
- Step through or add a debugger breakpoint without editing generated source.
- Classify the cause as model, generator/configuration, version alignment, handwritten caller, or runtime/provider behavior.
- Fix the responsible input and regenerate.
- Confirm the fix survives another clean regeneration.
Useful Evidence
- model element and generated file path;
- generator/client and runtime versions;
- exact generated signature;
- application call site;
- query
commentandpurposeor mutation audit description; - provider and framework configuration;
- first compiler/runtime error;
- minimal reproducer.
Never Do This
- Add a guessed method to a generated entity.
- Remove intent or audit enforcement from generated builders.
- Patch generated dependencies without aligning the generator/template.
- Hide a model error with handwritten schema or mapper changes.
- Report only the last stack-trace line when a Markdown report exists.