Why WebMCP

Canon Ledger is a local-first belief-state debugger for narrative game developers. In branching games, one canon change can fix a quest gate while silently breaking another condition—even when the total violation count does not move. At the same time, NPCs may need to retain old rumors, mistakes, and conflicting beliefs.

Five narrow WebMCP Site tools let an agent search NPC beliefs, trace stored rumor provenance, evaluate registered dialogue and quest conditions, stage edits, and apply a page-reviewed patch. Deterministic TypeScript in the page—not the model—calculates beliefs, provenance, projections, and commit validity.

Better user experience

The page shows objective canon beside each NPC’s belief. It distinguishes “never heard” from a refused rumor, preserves wording distortion across a depth-three chain, and displays condition results on two axes: changed/preserved and satisfied/violated.

The key demo is 1 → 1 → 0: confirming the repair fixes traveller_can_stay, but warehouse_dispute becomes the new violation, so the count remains one. A separately reviewed condition-definition repair then reaches zero without deleting Gen’s incorrect theft belief or its provenance.

What developers and agents can do together

The agent can navigate the belief surface and stage independently reviewable operations. The developer can inspect their effects in the same page and record approve/reject decisions in context. An early Apply returns pending_page_review and changes no world data. Once every operation has a current page decision, Apply commits exactly the approved operations and returns a receipt.

Canon Ledger records how a decision was made, not who made it. Page review is revision- and fingerprint-bound route state, not human authentication.

Implementation

The five tools are registered synchronously against the real document.modelContext API and call the same application commands as the visible UI. Inputs use closed schemas plus page-side validation; replies are bounded ordinary JSON objects with totals, cursors, authority, and audit metadata.

The application is static Vanilla TypeScript with zero production package dependencies and no runtime API calls. It evaluates only conditions explicitly registered in the loaded world; it does not claim to discover arbitrary engine dependencies.

Built With

Share this project:

Updates