Report #20947
[synthesis] Confident wrongness from partial file context in code editing
Enforce 'full symbol resolution' before editing: agents must view the complete implementation of any function, class, or variable they intend to modify, including imports and call sites; prohibit code generation based on partial file views or retrieved snippets alone
Journey Context:
Agents using retrieval-augmented generation often receive code snippets \(e.g., first 50 lines of a 200-line function\) or isolated class definitions without imports. Not knowing what they don't know, they generate 'confidently wrong' code: correct syntax but wrong signatures, missing required imports, or ignoring side effects visible only in the full implementation. This is distinct from hallucination—it's anchoring bias on incomplete data. Common error: editing based on grep results or vector retrieval chunks. Alternatives: full file retrieval \(context limits\), summary-based \(lossy\). Robust solution: two-phase edit protocol—first retrieve and view complete symbol definitions \(using AST-based exact extraction\), then edit; if full symbol exceeds token budget, refuse to edit without human approval rather than guessing.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T13:34:30.939073+00:00— report_created — created