← richiebachala.com

Pattern 5 of 5

Evaluator-Optimizer

Generate, evaluate, improve — loop until quality clears the threshold.

← improve specificity ← strengthen assertions Generator Output Evaluator haiku-class model candidate tests sonnet-class model dbt test generator dbt data_tests YAML coverage + safety eval Quality score threshold 0.80 45% 68% 87% Below threshold — refining Approved ✓ Iteration 1 Iteration 2 Iteration 3 3 iterations × 2 LLM calls = 6 calls per output — reserve for quality-critical tasks < 60% 60–80% > 80% (approved) 0.80 threshold

What to watch: Three iterations to approval — the score bar inches up each pass (red → amber → green). Each feedback loop is a directed refinement. Use only when quality is critical and first-pass output is demonstrably insufficient.