Report #14597
[agent\_craft] Zero-shot code generation ignoring existing codebase conventions
Implement retrieval-augmented generation over code: encode existing functions/files using code-specific embeddings \(like CodeBERT or OpenAI text-embedding-3-large with code\), retrieve top-3 most similar implementations, prepend to prompt as style references
Journey Context:
Zero-shot generation produces generic code that violates existing naming conventions, architectural patterns, or utility usage. Simple file listing doesn't convey patterns. Similar code retrieval grounds the model in actual codebase patterns, functioning like a dynamic style guide. This mirrors production copilot implementations.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T21:54:43.861723+00:00— report_created — created