Inspiration

I am solving two problems I see in LitRPG.

First, the genre has huge variation and an insatiable reader base. Readers want a specific reincarnation, System, power curve, cast, and world. Infinite LitRPG lets them create that personal story and keep reading without having to become the author.

Second, many web novels stop for years before the story reaches a conclusion. This project explores a reader-controlled path that can keep moving while preserving what already happened.

What it does

Infinite LitRPG is a local, bring-your-own-key story creator and reader.

The reader chooses the shape of a new life: starting age, power path, genres, background, personality, rebirth cause, memory, System focus, optional protagonist name, and guidance. GPT-5.6 Terra generates the complete starting world. Deterministic TypeScript compiles stable canonical IDs and validates topology, factions, inventory, relationships, facts, milestones, threat, System rules, and the legal opening action. Terra audits that genesis before it is saved.

For every chapter, up to three GPT-5.6 Luna character agents propose intent from only what those characters know. GPT-5.6 Sol frames and narrates the chapter. Terra translates custom reader actions and audits the finished prose. Models propose. One deterministic resolver owns canon.

The reader can:

  • create and switch between multiple books;
  • keep reading another book while generation continues;
  • make a choice when a decision matters;
  • add a custom action;
  • rewrite the latest chapter without changing accepted canon;
  • reject or reopen a book;
  • export Markdown and reader-safe JSON.

Stories stay on the user's machine. Each book has one SQLite database and one readable Markdown file per chapter. There is no account, payment, analytics, hosted feed, image generation, or mobile app.

How I used Codex

I built the repository during Build Week with Codex as the implementation partner. I gave it an alignment document, scope locks, engineering rules, an execution loop, and acceptance checks. I then let it work continuously, reviewed the real reader experience, and stopped or redirected it when the product was wrong.

Codex implemented the strict TypeScript domain, OpenAI Responses API adapters, SQLite transaction boundary, recovery behavior, tests, provider-free evals, browser checks, architecture notes, and release packet.

The important part was not accepting polished-looking output. An early version claimed to generate new worlds but only renamed one fixed fixture. Human review caught that. I rejected the approach. Codex replaced it with server-generated genesis and added regressions that compare topology, incident, inventory, System mechanics, cast roles, and opening actions. During final submission work, the offline eval exposed another bug: normalization could silently remove an unknown map reference before validation. Codex fixed it and added a regression.

Technical decisions

  • OpenAI Responses API only.
  • GPT-5.6 Sol, Terra, and Luna have distinct jobs.
  • Character agents emit intent only.
  • One canonical state writer commits world delta, knowledge delta, prose, trace, usage, and version atomically.
  • Model output is untrusted and parsed through strict schemas.
  • Accepted WorldDelta is the only source of new chapter canon.
  • POV prompts receive only selected character knowledge.
  • At most three background-character agents run per chapter.
  • Chapter 350 is terminal. Chapter 351 is blocked before any model call.
  • Native Multi-agent beta stays behind an adapter with an application-concurrency fallback.

What I am proud of

The demo story is not a reskinned template. Cael's Covenant Ledger, hidden oath dais, succession purge, competing witnesses, and next action with Ilyra Voss come from accepted generated genesis and chapter state.

The repository also has a provider-free npm run check gate: formatting, lint, strict types, 439 tests, offline invariants, 1,000 simulations, POV leak checks, Chapter 351 protection, production build, desktop and mobile browser tests, secret scan, client-bundle scan, license check, and dependency audit.

Run it

Requirements: Node.js 24+, npm 11+, and an OpenAI API key with GPT-5.6 Sol, Terra, and Luna access.

npm ci
Copy-Item .env.example .env
# Add OPENAI_API_KEY to .env
npm run dev

Open http://127.0.0.1:3000.

The full repository, architecture, test commands, and Codex collaboration history are public under the MIT license.

Built With

  • codex
  • gpt-5.6-luna
  • gpt-5.6-sol
  • gpt-5.6-terra
  • next.js
  • openai-responses-api
  • playwright
  • react
  • sqlite
  • typescript
  • vitest
  • zod
Share this project:

Updates