# Lab Report — Page Generation: Quests, Waypoints, and Mission Bits ### Architectural review of the Story-Mode rendering pipeline in `play.html` | | | |---|---| | **Written** | 2026-07-07 20:28 | | **Author's build** | `125ef7c` — 36,192 lines, 5,305,672 bytes (both figures byte-exact) | | **Verified** | 2026-08-18 (§DOC-02ca) against HEAD `a029d5b` — 38,712 lines | | **Scope** | how a story "page" is produced from `NODE_MAP` + `QUEST_DB`, and how the **quest**, **waypoint** and **mission-bit** subsystems interlock to drive it | | **Companion** | `edit.html` (data-layer editor; port-1367 WBAPI) | --- ## Abstract Story Mode has no templates, no virtual DOM, no router and no server. Every page the player sees — node prose, action cards, quest panel, exits, minimap — is produced by one imperative function, `storyRender(node)`, which mutates a fixed set of pre-existing DOM slots in place. Navigation is not URL-driven; it is a coordinate move on a 90×360 world grid whose destination cell may or may not carry a named node. This report traces the pipeline (`cellMove → storyRender → tail synthesis`) and then the three data-driven subsystems that make the page *stateful*: the Universal Quest Format (UQF-1.0) runtime, the waypoint navigation-target mechanism, and the mission-bit dual-ontology token system. **Thesis.** These are not three features. They are three positions in one closed loop — *completion writes flags → flags open gates → gates activate quests → quests publish waypoints → travel re-enters the renderer* — and the whole loop is re-evaluated on **every cell step**, inside one 18-line synthesis block. **Verdict at 42 days (§DOC-02ca).** The thesis holds and the loop is real. **Four of the report's five recommendations shipped within 28 days**, one of them (§VM-01-G) cutting `storyRender` from 4,287 lines to 1,490. Every function body, every gate term and the whole 12-entry bit ISA verify byte-exact against the author's own build; **349/349 acceptance tests green**. What failed is the report's *arithmetic* — four census figures were copied from older documents and were wrong the day they were written, one line citation is a digit transposition that lands on a live line, and the coupling loop it calls typical is authored on **15 of 2,853 quests**. The one recommendation that did **not** ship — a flag registry — has a bill: **138 quests, ~148,000 characters of authored prose, are unreachable at HEAD** because 55 gate flags have no writer anywhere in the file. §VM-01-E's soft-lock prover diagnosed the cause correctly on 2026-07-22, scoped the repair out, and no row was ever filed; the gate has printed the list on every CI push since **and exited `0`**. --- ## I. Introduction ### A. The question under review *"How do we generate an HTML page, with JavaScript, using the mission bits, quests, and waypoints?"* This is a page-generation review, not a full-system review (see `lab-report-architecture-full.md` for that). The object of study is the path from a player action — walk north, click **Navigate →** — to repainted DOM, and the three subsystems whose state that path reads and writes. ### B. The governing constraint One HTML file. No build, no modules, no CDN, no server at play time (mesh multiplayer excepted and out of scope). Every choice below is downstream of that. There is no `