Report #60803
[agent\_craft] Retrieved code chunks lack necessary imports or class definitions, leading to hallucinated signatures
Use structural retrieval \(AST-based chunking\) and expand the retrieved context to include parent/child nodes or adjacent definitions, not just the matching text block.
Journey Context:
Naive RAG splits code by character count. Code is highly structured; a chunk without its imports or class definition is useless and often leads to the model inventing methods that don't exist. AST-based retrieval preserves the semantic boundaries of the code.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T08:32:41.358522+00:00— report_created — created