Flint Repair Clinic: a browser lab for real game-generation failures

We built Flint Repair Clinic at alphaBell to make small code-generation failures easier to inspect.

It is a browser lab with three real failed/repaired game pairs from our public Flint Arcade development traces. The candidates were generated with stock Recursive Flint Q8_0. You can edit the failed HTML, inspect the browser error, reveal the exact recorded repair, play it and download the original case data with source hashes.

One of the failures was a missing start angle:

ctx.arc(GREENHOUSE.x, GREENHOUSE.y, 34, Math.PI * 2);

The browser needs five arguments. The recorded repair adds the missing 0, and also fixes frame timing and keyboard start/restart handling. The other cases include a misplaced parenthesis and chaining .fill() onto a Canvas call that returns undefined.

A few implementation details may be useful for other code-playground builders:

  • The restrictive preview policy is installed before any untrusted markup is parsed.
  • Games run in an opaque-origin sandbox iframe. Browser regression checks exercise blocked fetch requests and blocked preview navigation.
  • Only one game preview runs at a time; it pauses when the page is hidden. Preview height is bounded so touch controls remain visible.
  • Live diagnostics and control checks stay separate from the recorded errors, repairs and hashes. The quick check covers startup, both keyboard movement axes and restart. Complete gameplay needs separate testing.

The Space runs saved code locally, without a model call or API key. Thirteen browser regression groups cover the original failures and repairs, downloads, control defects, native touch input and preview isolation. These are small development cases for inspection and repair experiments.

Open the Space

Source, cases and browser checks

For people building code agents: which checks have caught a real bug after parsing and startup already succeeded? A small reproducible example would be useful for a future case.

One check that fits your recorded-case style: run the same game twice on the exact same input sequence and diff the game state at fixed timestamps — startup and controls can both pass while the second run diverges because state, timers, or randomness were not fully reset, and the first timestamp where the two runs split points straight at the cause. A short random-input soak watched for NaN or runaway positions catches the same class before it becomes a trace.

Thanks, @nootxlm. Replaying the same seed and input schedule after both a fresh load and a restart would make the reset check stronger. Fixed simulation steps or a recorded clock would matter too, so render timing does not create a false divergence.

The current quick check catches non-finite coordinates and basic control/reset failures, but it does not compare full trajectories. I am adding deterministic replay plus a bounded input soak to the next-experiment list. Is there a small game where you have seen this catch a bug?

A small case that makes it visible: a ten-second asteroid dodger where starting a run creates the spawn timer and restart never clears the old one. A fresh-load replay matches exactly, but the restart replay diverges at the first doubled spawn — twice the asteroids from then on — while startup, controls, and score reset all pass. Run both replays on fixed simulation steps, as you said, and log spawn count per second beside positions, so the first split names the leaked timer rather than a timing artifact.

That gives us a concrete regression case, thanks. I am building a small fixed-step replay lab from this example: the same seed and input schedule, a fresh run beside a run after restart, with spawn count and active timer count in the trace. The first split should point directly to the retained interval.

I will credit your suggestion and keep this authored example separate from the recorded Flint-generated games. I will post the working demo here once its replay checks pass.

Built it: Restart Replay Lab.

With the same seed and input schedule, two fresh runs match. The leaking restart first separates gameplay state at 1,000 ms, with one versus two cumulative spawns. After ten seconds it is ten versus twenty. Clearing the old spawn timer restores the match across all 201 saved states.

The lab credits your suggestion and labels the simulation as alphaBell-authored, separate from the historical Flint cases. The download includes the input schedule, per-second counts, complete state snapshots and provenance.