Report #103147
[agent\_craft] Semantic retrieval returns code chunks that are too small or cut mid-expression to be actionable
Chunk code at AST boundaries \(functions, classes, methods\) and include the enclosing imports plus the function signature; use tree-sitter or a language parser instead of fixed token windows.
Journey Context:
Retrieving arbitrary 512-token slices of source code often splits a function body or leaves the symbol without its imports, so the model cannot understand types or call sites. AST-based chunks preserve syntactic coherence and let you include a fixed amount of preceding context \(imports, class header\) automatically. The trade-off is a small preprocessing cost; the payoff is much higher signal per retrieved token.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-10T05:05:57.092608+00:00— report_created — created