Generation & fidelity

What happens when you click Generate, and how to read the fidelity score on every run.

How a run works

  1. A generation_tasks row is created with status queued.
  2. The worker normalizes the frame's IR and looks up bindings.
  3. Lovable AI emits HTML, CSS, and Liquid per frame. The prompt is constrained to never invent column names that aren't in the binding map.
  4. Strict parsers run on the output: HTML must be well-formed, CSS must parse, Liquid must round-trip through our Liquid tokenizer.
  5. Fidelity is scored, output is persisted, and the task moves to succeeded (or failed with a diagnostic).

The fidelity score

The score is a weighted average of four sub-metrics (0–100):

  • Binding coverage — fraction of bound IR leaves that produced live output.
  • Structural integrity — generated tree depth and child counts vs the Figma source.
  • HTML/CSS validity — passes the strict parser without warnings.
  • IR-leaf coverage — fraction of all leaves represented in the output (catches "AI dropped a section").

Reading the score

  • 90+ — ship.
  • 70–89 — usable, but inspect the diff in Preview before packaging.
  • <70 — re-run with a smaller frame or tightened bindings.

Retries and partial regeneration

From the generation history panel, you can:

  • Retry a failed run with the same inputs.
  • Regenerate frame after editing bindings — only the affected frame re-runs.
  • Lock a frame so future package builds keep the current output even if you click "Regenerate all".
Credits
Each successful or failed run consumes one credit. Cancelled runs are free. Monitor balance from Settings → Billing.
Was this page helpful?Send feedback →