Inspiration
AI tutors can generate clear explanations, but a correct answer does not prove that a learner changed the causal model in their head. Astronomy misconceptions make that gap visible: a learner may memorize Moon-phase vocabulary while still believing that Earth's shadow causes every phase. ModelDuel began with a different question: what if a misconception became a runnable prediction that had to face evidence?
What it does
ModelDuel guides a learner through one protected sequence: capture → interpret → predict → observe → revise → transfer → trace.
A learner explains an idea in text, optionally adds a sketch, and chooses either configured live analysis or an authored verified sample. ModelDuel compares the learner's mental model with the scientific model, requires a prediction before revealing evidence, renders both worlds under the same case, asks for a revised explanation, and checks a new transfer question.
The final Model Revision Trace preserves the initial belief, locked prediction, contradictory observation, revised explanation, and transfer result. A compact same-session teacher review makes that conceptual revision discussable without creating a teacher account or server-side learner record.
Two complete challenges share the loop:
- Moon phases: confronts the belief that Earth's shadow causes regular phases.
- Seasons: tests the belief that Earth–Sun distance causes summer and winter.
Verified samples are visibly labeled, require no login or API key, and never masquerade as live output. Judges can complete both journeys immediately at the live demo.
How we built it
The browser experience uses Next.js, React, TypeScript, and Three.js. Zod schemas constrain learner models and every server contract. GPT output is validated before it can cross into the application domain.
The key boundary is deliberate: GPT-5.6 Terra extracts a bounded learner model from text or a sketch and completes a validated Programmatic Tool Calling sequence. GPT-5.6 Luna gives bounded feedback on revised prose. The application—not GPT—owns the allow-listed cases, WorldSpecs, simulation constants, physical evidence, transfer answer keys, and grading. Deterministic simulation code produces the astronomy state, and Three.js renders it. GPT never generates or executes arbitrary Three.js code.
Live learner-data Responses requests use store: false. Transfer answer keys remain server-side inside an authenticated evaluation token and replay-safe Cloudflare Durable Object flow. Unsupported or cross-scenario claims fail closed before tool orchestration, and a failed live request never silently becomes a verified sample. Cloudflare Workers provides the production runtime and fail-closed rate limits.
The public verified path makes zero paid model calls. A dated production integration smoke separately completed one paid Terra analysis/tool-orchestration request and one paid Luna revision request without HTTP retry; it is historical integration evidence, not a claim that the recorded verified journey was live.
How Codex helped
Codex translated the concept into the capture → interpret → predict → observe → revise → transfer → trace state machine. It scaffolded the Next.js application, schemas, routes, domain layer, deterministic simulations, Three.js renderers, and automated tests. It then iterated on Responses API integration, Programmatic Tool Calling, encrypted evaluation tokens, bounded live requests, race conditions, accessibility, responsive behavior, security findings, visual polish, deployment gates, and the reproducible 2:45 submission-video pipeline.
Human decisions remained human-owned: the Education category, target misconceptions, pedagogical sequence, scenario scope, privacy stance, trust boundary, experience priorities, and release acceptance.
Codex Feedback Session ID: 019f648c-0eb8-7b60-ad84-28ce35bbac4b
Challenges we ran into
The hardest challenge was making an AI-assisted experience feel generative without handing scientific truth or grading authority to the model. The live and authored paths also had to remain unmistakably separate: a network or configuration failure cannot silently turn into a successful fixture.
Other challenges included protecting the prediction before evidence is revealed, keeping transfer keys off the client, handling stale asynchronous responses, making a replay-safe paid revision route, supporting WebGL fallbacks, and preserving readable, touch-friendly layouts on narrow mobile screens.
Accomplishments that we're proud of
- Two complete astronomy journeys reuse one coherent learning loop and deterministic simulation foundation.
- Predictions are locked before evidence, and transfer grading is authenticated at the server boundary.
- The configured live path is schema-constrained, tool-validated, cost-bounded, and fail-closed.
- The verified path is account- and key-independent while clearly disclosing its authored source.
- The completed attempt becomes a teacher-review summary and learner-controlled local text handoff without a share link or new API call.
- The 3D comparison stays interactive, responsive, keyboard-readable, and usable with an accessible no-WebGL fallback.
- The public repository records build-week provenance, SDK decisions, test gates, deployment evidence, and the primary Codex session ID.
What we learned
The useful boundary is not “AI versus deterministic code.” It is deciding which responsibility belongs to each. A model is valuable for extracting a learner's claim and giving bounded feedback on revised prose. Deterministic code is better for selecting cases, simulating worlds, revealing evidence, protecting answer keys, and grading transfer.
We also learned that provenance labels and explicit failure states are part of the learning design: learners and judges should always know whether they are seeing configured live output or an authored verified sample.
What's next
The first pilot is one middle-school astronomy lesson: learners complete one duel independently, then use the same-session trace for a short teacher conversation. We will measure completion without rescue, correct handling of prediction-before-evidence, and performance on the unseen transfer item. These are feasibility signals, not a causal learning-gain claim.
Next, we plan to validate the pilot with educators, strengthen accessibility testing, add carefully reviewed misconception packs beyond astronomy, and preserve the same boundary: models interpret and coach; deterministic application code owns scientific truth and grading.
Try it
- Live demo: https://modelduel.yasei.workers.dev
- Source: https://github.com/Yasei-no-otoko/ModelDuel
- License: MIT
Choose Run verified sample for the instant, API-free judge path.
Built With
- cloudflare-workers
- codex
- gpt-5.6-luna
- gpt-5.6-terra
- next.js
- openai-responses-api
- opennext
- playwright
- programmatic-tool-calling
- react
- structured-outputs
- three.js
- typescript
- vitest
- zod
Log in or sign up for Devpost to join the conversation.