Inspiration

A fictional world can contradict itself long after a rule is established.

The problem is rarely a simple name or keyword mismatch. A rule may depend on timing, location, character state, or an exception introduced in another source. The decisive evidence might be spread across several scenes. Sometimes the evidence proves a contradiction. Sometimes one crucial fact is genuinely missing, and calling the result a plot hole would be dishonest.

Most continuity tools are designed around search, notes, or general chat. I wanted to test a narrower idea: could an AI system reason across explicit fictional-world rules and exact narrative evidence, while remaining inspectable enough that a writer could verify every conclusion?

That became Misrule.

What it does

Misrule is an inspectable continuity auditor for writers, lore editors, campaign creators, and narrative-system designers.

A creator works with a structured World Pack containing:

  • world and source-volume metadata;
  • explicit rules, constraints, conditions, and temporal facts;
  • exact narrative evidence spans.

World Packs are portable JSON documents. A user can open a bundled example or create, import, edit, export, save, and delete packs locally in the browser.

When an audit runs, Misrule performs two reasoning stages.

The first stage searches broadly for possible conflicts. The second stage adjudicates each candidate and may accept it, reject it, narrow its evidence, or classify it as a legitimate ambiguity.

The model does not control the final public result. Misrule converts the response into an application-owned contract and validates its structure, cited rule and span identities, reasoning relationships, and semantic consistency before displaying anything.

The result is not just a warning. A user can inspect the rule, narrative evidence, inference route, and—when the answer remains unresolved—the narrow missing fact and two evidence-supported readings.

How I built it

I used GPT-5.6 and Codex as the central reasoning and implementation partnership.

GPT-5.6 in ChatGPT helped me design and run the hackathon workflow, compare and screen concepts, refine the selected idea, make scope and trust-boundary decisions, write bounded implementation briefs, review result artifacts, and diagnose failures between build passes.

The primary Codex session using GPT-5.6 Sol built the initial end-to-end Misrule product and its portable World Pack foundation. Codex accelerated implementation across the typed data contracts, audit route, structured-output handling, client workflow, tests, and repository hardening.

I remained responsible for the product decisions: choosing the concept, rejecting a hard-coded demonstration, requiring a reusable World Pack format, distinguishing contradictions from ambiguities, selecting the deployed runtime, and deciding what the submission could truthfully claim.

Later bounded implementation and review passes also used Codex and Claude Code for reliability work, evaluator tooling, adversarial tests, interface refinement, and deployment support.

The application is built with Next.js, React, TypeScript, Zod, Vitest, and an OpenAI-compatible inference client. The public hosted audit currently uses OpenRouter with Gemini 2.5 Flash and JSON-object transport. GPT-5.6 was central to the build and reasoning process; it is not the current live inference runtime.

Challenges

Making model output inspectable

A plausible paragraph was not enough. Every displayed finding needed to resolve back to real rule and narrative-span IDs. Misrule therefore rejects malformed, uncited, or semantically unsupported results instead of quietly repairing them into something that merely looks convincing.

Separating contradiction from ambiguity

An ambiguity is not a weaker contradiction. It must identify one narrow missing fact and preserve two readings that are both supported by the supplied evidence. Building that distinction into the public contract required more than prompt wording; it required application-owned semantics and validation.

Correcting a live semantic failure

One early live audit returned structurally valid output but classified a forced contradiction as an ambiguity. I did not replace it with a prerecorded or hard-coded result.

Instead, the architecture changed from one-pass inference to candidate generation followed by focused adjudication. The evaluator and adversarial tests were strengthened, and the application took ownership of final labels and supported readings.

On the controlled Ashglass fixture, the corrected pipeline later matched all five expected findings with no false positives, no false negatives, and no distractor violations. That result is evidence for the bounded fixture—not a claim of universal accuracy across all fiction.

Making the interface understandable

The first production interface was visually distinctive but too difficult to understand on first contact. After the audit architecture worked, I initiated a separate frontend redesign.

The current interface presents the World Library as a shelf of book spines, replaces the earlier radial control system with a clearer audit route, introduces a step-based World Pack editor, and gives contradictions, ambiguities, and citation paths visibly different treatments.

What I learned

The largest lesson was that model reasoning becomes more useful when the surrounding application is stricter.

Structured input helped, but it was not sufficient. Reliability came from combining:

  • bounded evidence;
  • two-stage reasoning;
  • application-owned result semantics;
  • exact citation validation;
  • deterministic evaluation;
  • adversarial tests;
  • explicit rejection of unsupported output.

I also learned that build-time model choice and runtime model choice are separate product decisions. GPT-5.6 and Codex were valuable for architecture, implementation, and difficult correction work. The deployed model was selected separately around validated structured-output behavior and hosting constraints.

Most importantly, AI-assisted development did not remove the need for product judgment. It made it possible to explore and implement faster, but I still had to decide what problem was worth solving, what evidence counted, where automation had to stop, and when a convincing result was not trustworthy enough.

Current limitations

Misrule currently audits structured World Pack JSON. It does not yet parse complete manuscripts, PDFs, EPUB files, or Scrivener projects.

It does not use RAG or embeddings, and it does not currently provide accounts, cloud persistence, collaborative editing, or manuscript-scale ingestion. Browser-created World Packs are stored locally.

Live audit quality also depends on the configured inference provider and model.

What is next

The next logical step is assisted World Pack creation: helping a writer convert an existing story bible or manuscript excerpt into explicit rules and evidence spans without losing the current audit contract.

I would also like to add larger-world evaluation sets, richer temporal and identity relationships, and comparison views that help a creator understand how a continuity issue developed across revisions.

Built With

Share this project:

Updates