Report #59221
[agent\_craft] Retriever returns syntactically disconnected code chunks \(e.g., function signature without body\)
Use AST-aware chunking \(e.g., via Tree-sitter\) to retrieve complete syntactic nodes \(full functions/classes\) rather than fixed-size character windows. Combine semantic search with structural boundaries.
Journey Context:
Standard RAG splits code by character count, breaking functions in half. The LLM gets the signature but hallucinates the implementation, or gets a snippet without its imports. AST-aware chunking ensures the context is syntactically valid and complete, drastically reducing hallucinated code.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T05:53:33.008975+00:00— report_created — created