feat: code gen reliability 5% → 89% — template assembly + SQL repair
Template-based generation: imports, router setup, exports, and _phoenix
metadata are guaranteed by the template. The LLM only generates business
logic (migrations, schemas, routes). assembleFromTemplate strips the
LLM's duplicate imports and splices its output into the correct structure.
SQL double-quote repair: automatically fixes datetime("now") → datetime('now')
and WHEN "value" THEN → WHEN 'value' THEN. The LLM consistently uses
double quotes in SQL inside JS template literals.
Eval tests updated for v2 spec: /tasks not /todos, /projects not
/categories. Tests accept both boolean and integer for completed field.
17/19 (89%) stable across consecutive clean bootstraps.
Remaining 2 failures: completed field type variance (boolean vs integer).