Inspiration

Some training bays already teach a vehicle's route with paper cards: forward, turn, pick, drop, laid out in order before anyone drives. What they don't have is an honest check. We wanted a tool that says exactly which card fails, whether a small edit really fixes it, and whether one extra rack on the floor would break the fix.

What it does

KINETILE is a laboratory for a vehicle programmed with paper-style cards. The session goes Program → Failure → Diagnosis → Verified Repair → Stress test.

  • Program. Tap cards from the palette or use the keyboard (F, L, R, B, P, D, Enter). A photographed card sheet goes to on-device Gemini Nano.
  • Failure. A deterministic simulator stops on the card that collides, leaves the floor, or picks or drops illegally. The failed route is drawn as a dashed orange ghost.
  • Diagnosis. A scorecard and an execution trace show the outcome, the failing card, and the BFS shortest-route length.
  • Verified repair. The search tries every one-card edit, then every two-card edit, through the same simulator. A repair is reported only when the simulator actually reaches the bay. On the default floor, Aisle Three, it finds one edit (card 5, Turn right → Turn left) after checking 2,710 programs.
  • Stress test. It adds one rack on every free cell that keeps the floor solvable, then reruns the program. On Aisle Three that gives 19 floors tested, 14 passing and 5 failing, and it names the first counterexample.
  • Your own lab. Draw a floor from 5×5 up to 9×9 and see "Solvable in N steps" or "Unreachable" live. Save it to My lab, share it as a link, or export a JSON run report. There's no login.

How we built it

Vite, TypeScript and React. The simulator, validator, BFS, repair search and stress test are pure TypeScript, covered by 76 Vitest tests. Gemini runs through Firebase AI Logic. Card photos use InferenceMode.ONLY_ON_DEVICE, so images never fall back to the cloud. Floor drafts can come from the cloud model chain gemini-4-neon → gemini-4-hydrogen → gemini-3.5-flash. App Check uses reCAPTCHA Enterprise and is enforced: a request without a token gets HTTP 401. The app is hosted on Firebase Hosting.

The repair search is small enough to be exhaustive. For a program of (k) cards and 6 card types, the one-edit neighbourhood has at most

$$ 5k + 6(k+1) + k $$

candidates (replace, insert, delete). The two-edit space is enumerated in full before the app calls the search exhaustive.

Challenges we ran into

  • On-device AI is easy to fake. We made the photo path Nano-only, with no cloud client, and let the capability check honestly say "unavailable". We don't claim any accuracy figure until Nano has been tested on real hardware.
  • EEA terms. The Gemini API's free tier can't serve users in the EEA. The public site therefore plays recorded Gemini missions. Each one shows the real model name, the modelVersion and a timestamp, and BFS checks it again in the browser. Live generation is an opt-in flag (VITE_CLOUD_LIVE=true).
  • Neon needs Blaze. gemini-4-neon returns 429 on the free plan, so the app says so and reports whichever model actually answered.
  • modelVersion is often missing from the SDK's mapped response, so the UI never passes off the requested model as the one that answered.
  • App Check enforcement took a while to propagate before no-token calls returned 401 consistently.

What we learned

The useful hybrid split is by job. A photo of someone's cards stays on the device. A floor draft can come from the cloud and then be checked locally. The vehicle itself never needs a model: the simulator, the repair search and the stress test are enough to say exactly what a program does.

What's next

  • A real Chrome session where Nano reads printed card sheets, with every miss written down.
  • Live cloud generation, including Neon, once the project moves to the paid tier.

Built With

Share this project:

Updates

Submission history