๐ง JEV SOLVES THE CUBE ๐ฟ
September 19, 2026 ยท View on GitHub
๐ง JEV SOLVES THE CUBE ๐ฟ
You scramble like a menace. Jev โ the in-house AI solver โ judges the chaos, roasts you, and cooks the solve live.
An AI-gamified twisty puzzle โ scramble it, gamble it, watch Jev cook. ๐ฐ
โจ What is this?
A one-page, no-scroll Rubik's cube playground with an AI attitude:
- ๐ช๏ธ You scramble โ pick a preset (Chill โ Spicy โ GIGACHAD โ ๐คฏ UNHINGED), mash the manual turn buttons, or unleash a custom number of turns (up to 4900).
- ๐ง Jev judges โ a System One judgment model rates your chaos: one of five meme tiers, a 1โ5 star difficulty rating, and exactly one roast.
- ๐ค Jev solves โ an agent loop: Jev reads the live cube state, picks its next job from a toolbox step by step, and every move streams over SSE while the 3D cube executes it at adaptive speed.
- ๐ฐ You gamble โ bank the XP, or feed it to Jev's Gambit: a double-or-nothing slot machine (ร2, ร3, ร5, ร10โฆ or ๐ bust).
Plus: XP, ranks (NPC โ Mid Scrambler โ Certified Cook โ GIGACHAD โ Sigma Orchestrator), badges, run stats, confetti, victory spins, and a live feed that never stops talking.
๐น๏ธ How to play
| Step | Action |
|---|---|
| 1 | Choose a preset or hand-scramble / unleash custom turns |
| 2 | Hit SCRAMBLE โ the cube shakes while chaos is applied |
| 3 | Hit SOLVE WITH JEV โ verdict streams in, cube animates the solve |
| 4 | Watch the โ SOLVED banner with your run stats |
| 5 | ๐ฆ Bank the XPโฆ or ๐ฒ double or nothing it on the slot |
| 6 | Climb the ranks: NPC โ Mid Scrambler โ Certified Cook โ GIGACHAD โ Sigma Orchestrator |
๐๏ธ Architecture
โโโโโโโโโโโโโโโโโโโโโโโโโโโ browser โโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Next.js App Router ยท React Three Fiber ยท Tailwind v4 โ
โ shadcn/ui ยท zustand (localStorage) ยท canvas-confetti โ
โ receives ONLY curated game events (SSE) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ POST /api/solve
โ { history: ["R","U'",โฆ] }
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ /api/solve (server-only route) โ
โ โข validates + simplifies the scramble โ
โ โข computes the real cube state (cubie model + facelets) โ
โ โข MOVE-BY-MOVE LOOP: Jev judges EVERY single move โ the โ
โ 18-move alphabet is declared once, then it sees only the โ
โ live cube state (facelets + progress โ NEVER the move โ
โ history) each turn and plays one move; the only non-Jev โ
โ moves are the superhuman tool's, streamed only when Jev โ
โ itself invokes it (tagged โก) โ no engine, no rotation โ
โ โข judgment pass via engine adapter โโโบ JEV (AI verdict) โ
โ โข every solution verified vs a reference model before โ
โ streaming; raw inference is never leaked โ
โ โข streams curated events: meta โธ waypoint โธ move โธ done โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
The cube machinery (adapted from buuing/Rubiks-Cube, the most-starred Three.js cube, rebuilt for React Three Fiber) only turns for judged moves: Jev plays one judged move per call against the live state; the sole non-Jev mover is the Kociemba two-phase solver, and only when Jev itself invokes it as a tool (tagged โก in the stream). Every solve is verified against an independent reference model before streaming, and the ๐ Audit tab logs every turn that rotated the cube (๐ช๏ธ yours ยท ๐ง Jev's ยท โก its tool's). Harnesses: pnpm check (scripts/solver-check.mjs: model + facelets + randomized Kociemba, reference cross-checked) and scripts/cube-math-check.mjs (200 animation-math trials). Every cubie returns home, always.
๐ Security & compliance
The AI provider is a deliberate implementation detail:
| Secret | Where it lives |
|---|---|
JEV_ENGINE_API_KEY | Server env only (Vercel Secret / .env.local) โ never NEXT_PUBLIC_* |
JEV_ENGINE_BASE_URL | Server env only โ the engine endpoint is not hardcoded anywhere |
| Raw inference (questions, criteria, probabilities, model ids, latency) | Stays inside the API route โ never logged, never streamed |
| Client bundle | Zero provider strings (verified by bundle grep โ see COMPLIANCE.md ยง5) |
The client receives exactly five curated event types โ meta, waypoint, move, done, error โ signed engine: "jev-stream/1", plus a generic token count.
๐ COMPLIANCE.md maps every obligation of the engine's Master Customer Agreement (license scope ยง2.1โ2.3, credentials ยง2.4, input/output handling ยง4, end-user disclosures ยง5, publicity ยง15.4) to the exact files and mechanisms that satisfy it โ including the deliberate no-benchmarks rule (ยง2.3f) and the provider-anonymized public copy.
๐ Getting started
# 1. install
pnpm install
# 2. configure the engine (server-only secrets)
echo 'JEV_ENGINE_API_KEY=<your-key>' >> .env.local
echo 'JEV_ENGINE_BASE_URL=<endpoint>' >> .env.local
# 3. run
pnpm dev # http://localhost:3000
# 4. verify the cube math anytime
node scripts/cube-math-check.mjs
node scripts/cube-stress-large.mjs
โ๏ธ Scripts
| Command | What it does |
|---|---|
pnpm dev | Dev server |
pnpm build | Production build |
pnpm start | Serve the production build |
pnpm check | cube model + facelets + Kociemba harness (reference cross-checked) |
node scripts/cube-math-check.mjs | 200-trial animation-math correctness harness |
node scripts/cube-stress-large.mjs | 500-turn scramble stress harness |
๐ Project map
src/
โโโ app/
โ โโโ api/solve/route.ts ๐ Jev agent loop + SSE stream (server-only)
โ โโโ opengraph-image.tsx dynamic OG image (ImageResponse)
โ โโโ layout.tsx fonts ยท metadata ยท JSON-LD ยท Analytics
โ โโโ robots.ts ยท sitemap.ts ยท manifest.ts ยท icon.svg
โ โโโ page.tsx the one-page game
โโโ components/
โ โโโ cube/RubiksCube.tsx 3D engine (r3f pivot-group turns)
โ โโโ cube/CubeStage.tsx canvas, lights, camera
โ โโโ legal.tsx consent ยท privacy ยท disclaimer
โ โโโ ErrorBoundary.tsx localStorage corruption shield
โ โโโ Logo.tsx
โโโ lib/
โ โโโ cube.ts move alphabet (validate ยท invert ยท simplify)
โ โโโ cubie.ts cubie state model (perm + orientation)
โ โโโ solve-kociemba.ts โก superhuman solver + reference verification
โ โโโ store.ts XP ยท badges ยท run stats (persisted)
โ โโโ memes.ts tier banks ยท roasts ยท ranks
โโโ server/
โโโ jev-engine.ts ๐ single engine choke point (server-only)
๐ Credits
- Cube model adapted from buuing/Rubiks-Cube โ the most-starred Three.js Rubik's cube.
- Font vibes from Bruno Simon's portfolio (Amatic SC + Nunito).
- Judgments by Jev via the TypeSafe System One API โ probabilistic, for fun, never a fact.
๐ซก Author
Trou ยท 0xtrou
the one who taught Jev to cook ๐จโ๐ณ
enjoyed the chaos? drop a โญ โ Jev counts the stars too
โ ๏ธ Disclaimer
Fan-made demo, provided as is, for entertainment only. Not affiliated with Rubik's Brand Ltd or Spin Master Ltd โ "Rubik's Cube" is a trademark of its respective owner; this project simulates a classic 3ร3 twisty puzzle. AI output is probabilistic and may be inaccurate. Scores and XP have no value outside this site. See the in-app Disclaimer, Privacy & Cookies, and Experimental Notice for the full text.