Report #47783
[agent\_craft] Agent overfits to few-shot example patterns and fails to adapt refactoring rules to new language versions
Use zero-shot prompting with explicit 'Transformation Grammar': list numbered rules \(e.g., '1. Identify all print statements, 2. Replace print \[x\] with print\(\[x\]\)'\) rather than providing example code pairs. Instruct the model to apply these rules mechanically rather than pattern-matching against examples
Journey Context:
Few-shot examples carry implicit stylistic baggage \(specific variable names, indentation styles, language versions\) that confuses structural transformations. Explicit rules force the model to focus on the abstract syntax transformation rather than surface form similarity. This is critical for refactoring tasks where the target pattern is precise but the source code varies widely \(e.g., converting callbacks to async/await across different coding styles\).
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T10:40:54.325963+00:00— report_created — created