mute 4b8fbd7471 the debug round: server.json deleted, the bind hardcoded to loopback (RP_PORT for the port), the debug superuser token-gated behind a printed, persisted token, and the context meter reading the discovered per-model contwin
The rulings (developer, 2026-11-19, in conversation): a deployment basically always needs a fronting proxy, so the listen address is code -- loopback, no override (an op who wants otherwise owns their own socat); the port rides the RP_PORT env var (the RP_BASE twin the test scripts use, default 7350, garbage refused loud); server.json is deleted entirely, file and reader both, because it held no meaningful configuration once the bind died -- only the dead bind and the declared contwin; and contwin is provider/model dependent, never a deployment global, so the meter must DISCOVER it, not read a declaration.

The meter: the run detail's context block now derives its window from the registry -- modelState's resolved player spec, findModel, the model's input ceiling -- null when the provider states none or no pick stands, pct computed against that. A dividend named in review: pct is uncapped, so a mid-run re-pick onto a smaller model shows the meter over 100% BEFORE the first send refuses (the endpoint's own context-length 400 is the designed refusal -- no pre-request check, nothing truncates, the failed call lands its req event, the composer keeps the line per the standing rule).

Debug mode reworked around its real purpose (skip the invite dance on a fresh server, mocks in particular): the old shape -- every request the superuser, no auth at all -- left any debug server that somehow reached a network fully open. Now one fixed superuser behind a real bearer token: minted into state/debug-token.txt (the bootstrap-invite precedent -- a raw secret on disk so a restart never invalidates what the tester already pasted; the developer ruled persist), printed at every boot, and the claim screen gains the paste path ("or paste a token": store it, verify through the public /session, land or banner). The paste path is generic surface, not debug-only: tokens are returned once and never listed, so a pasted saved token is the only browser-migration path that existed to build. The public /session carries a debug flag so the claim hint says "paste the token the server printed at boot" instead of pointing at the bootstrap file debug never mints. Debug browser passes now exercise the real auth path (the 401, the u: attribution line) instead of bypassing it.

En-route mock fidelity fix the smoke earned: the mock path never set s.usage (no provider call happens), so every usage and context surface was null under the smoke -- the first cut of the new gauge assertion failed on exactly that. The mock now carries a synthetic usage (the assembled view's chars over 4), riding the msg events like the real path's, so the detail's usage and the context gauge are smoke-assertable: contwin 524288 straight from the mock's registry input ceiling, pct computed.

Verified: typecheck green both programs; smoke ALL PASS (+1, the discovered-gauge assertion); restart + reminder checks green (5 runs again); a browser pass on --mock --debug end to end -- the wrong token banners "token rejected" and stays on claim, the printed token lands as Debug the op, the stored token survives a server restart (the persistence proof), zero console errors; check-repo clean (it caught the round's own "window" in the new README passage -- contwin is the word); the dev machine's server.json deleted and the debug server restarted on the real state (Chloe and Irene rebuilt, the token minted into the real state/). Docs: README's deployment and debug passages, the config passage, and the layout tree (the server.example.json lines gone with the file); DICTIONARY's meter and contwin entries (the config key died with the file -- the dated rename record keeps its day's words); AGENTS's server entry and the two server.json gotchas; HANDOFF's round record and the push-queue count (now eight). The developer's operator-queue line ("revisit the debug mode, hardcode loopback") is struck by them in the same commit. packages/detention stays untracked WIP, untouched.
2026-11-19 10:31:03 +00:00
the state-scan round: the log is the one truth for status and agenda, the db tiers retired -- scanState (server/session.mjs) derives each kind newest-wins across her emissions (the picked variant's text), the GM's override records, and the boundary state notes; the panes, the run detail, and the stamp all read it, GET /status and detail.status are derived reads, no clerk call, no db copy; the agenda cap is a derivation rule (GM, 2026-11-16: we log all seven items on reception, but the only way to see all seven is the raw event -- at no point an over-cap list can be derived), the reception note still shows the GM what sank; the stamp renders the canonical grammar -- status comma-separated, agenda markdown bullets, matching the line the GM added to invariants; the GM's block edits are overrides (GM, 2026-11-16: mutate during the contwin composition, the logs record the overrides arriving with the GM's turn as they should, the model sees the blocks overwritten with GM's edits attached to her turn, append if empty): the pane editors STAGE (paneEditor reworked -- no save callback, staged state, pending marker, discard), the send attaches them to POST /turn, node logs the override field on the GM turn, the composition renders it as hers -- the log never mutates, her words stay verbatim, the raw surfaces show the record; OOC turns refuse edits client and server both, the out-of-band POST /status and /agenda routes retired; stop writes the boundary state note at the carry head always (the crash-reconcile filters it before comparing), the start gate's n=1 seeding is dead (her authored opening turn IS the seed, the lint keeps requiring it), continuation carryovers are writable in the file editor during dormancy -- the review window's one editing surface, blocks included, no new pane; the clerk lost the tiers wholesale (schema tables, four verbs, canon status/agenda views, dump sections, report fields; the events CHECK keeps the historical op names; old dbs keep dead tables, never read, never dropped -- Irene is hands-off, and by the same day's ruling she is broken and never runs again: logs and db kept as they are, no replay, no continuation, no compatibility designed for her); Chloe hand-migrated to the new protocol -- her most recent turn carries the whole-list blocks applied from her db's exact values, her next context stamps them, her older lost/gained tags stay as history; the mock's agenda blocks went bullet, a new script position for the override turn's reply restates the mind so the boundary assert holds; smoke reworked to the scan battery (+ the 10f override block: the record rides its turn, the composition stamps at her canon point, the log keeps her emission verbatim, the OOC refusal, the boundary note at the carry head, the retired routes 404) -- ALL PASS; restart + reminder + repo checks green; the browser pass caught and fixed two real bugs (the pending marker's display:flex beat the hidden attribute -- any display rule needs a [hidden] override; setEditable(true) never ran the widget sync so the edit button stayed hidden) and proved the whole UX end to end with zero console errors -- staging, send-with-turn, the machinery lines on the table and raw, the OOC gate banner, discard, dormant read-only panes, the boundary note in the dormant preview; typecheck green on both programs; README/DICTIONARY carry the single-truth design, HANDOFF the round record and the Irene rewording, AGENTS the state pointer and the browser lessons
2026-11-16 22:49:50 +00:00
the prompt-craft round: the handbook's pointers section becomes "Story is the deliverable" (the repo's own term of art, DICTIONARY's "the story -- the deliverable", imported into model-facing prose -- the heading stops naming a question and names a why: the pointers are craft standards for an artifact) and gains the audience doctrine: three parties read the emerging prose (player, GM, reader), GM's turns are not hers exclusively -- the reader sees them too, and on /story the GM's turn and hers sit adjacent with every GM turn carried exactly once, so a summary or a direct quote from the most recent GM turn is literally duplicated text in the deliverable; the rule is cashed out as behavior (avoid summarising GM's turns in yours, avoid quoting directly from the latest one -- it reads as repetition), aimed at the real observed failure mode of model players echoing the GM's narration. Naming the reader also anchors a term the prompt set already used load-bearing without defining: the Thoughts section's "give the reader of the story an insight" and the reminder's "thoughts are the exposition vehicle for the reader" now have their introduction. The follow-up paragraph prices the obvious next question a clever model would ask: addressing the reader is risky but can read as witty and postmodern (priced, not banned -- the content-stance philosophy, nothing in a special bucket), while addressing GM in-character is nonsensical because the GM is not diegetic -- the missing half of the OOC rule, since talking to the GM is what the paren channel is for. invariants.md gains the typography ruling: emphasis is **bold**, italics are reserved for actions, thoughts and descriptions -- which codifies what the renderers already assume from the other side (the workbench transcript's token model is literally *italics* = narration, **bold** = emphasis, and the book spends the asterisks the same way, so italicized emphasis would render as narration on the tool and as action in the deliverable; the ruling makes her output unambiguous on both surfaces at once), and every example in the prompt set already follows the convention, so nothing in the corpus contradicts it. Both retired operator-queue items struck from ROADMAP (the echo/summarise tendency, the italics-for-emphasis teach) -- the edits are the answers. Grammar flagged in review taken (metrics FOR what makes the story better; can read AS witty); the hand-verified coherence: the reminder's "What makes the story better?" is a standalone rhetorical question, not a reference to the renamed heading, and "Mirror the GM's format" (structure) does not collide with the no-quoting rule (content). The purview outcome example reworded in the same sitting: "I swing at him" -- never "I connect" becomes "Alice swings at him" -- never "The swing connects" -- the old example's first person contradicted the third-person narration every other example teaches (and her turns actually use), and the new counterexample shows the outcome claim in narration form, which is how outcomes actually sneak into player turns. The Retcons section moved from the file's foot (stranded after Hard limits, unrelated) to sit under Continuity as a subsection -- whose closing line is "never retcon silently", making the GM's-prerogative ruling ("allowed, discouraged, and always explicit") the natural next beat; the canon doctrine now reads as one passage
2026-11-17 02:43:51 +00:00
the sheet round: the GM's ledger of arbitrated run state -- the second state channel, split from status and agenda by truth model (GM, 2026-11-17). The rulings first: status and agenda are narrative self-report (their truth is "she said so", the scan caches her latest words); the sheet is actual run state (its truth is "the GM set so", the record IS the truth event -- nothing cached from anyone's words). The override channel promoted to a standing section, and that precedent decided the presentation: the sheet renders as its OWN authoritative system chunk at the freshest end, never a canon-point stamp, which would read as her words -- the same reason the override composes as hers and the sheet never does. Schemaless JSON in the tag (the mind-verb philosophy: the substrate teaches the channel, the package teaches the vocabulary -- the invariants rule the GM wrote is one universal paragraph with deliberately non-box examples, clothes and grades, and the propose-additions line as her schema-evolution channel); details learnt in-place; NO package gating -- the channel is universal and "optional, if given" makes the invariant forward-compatible in every bundle that never sets one. The build: a sheet record rides the GM turn like the override (readSheet: object-ness is the route's only law, 400 loud on arrays and scalars, nothing appended; OOC turns refuse it exactly like block edits); scanState derives newest-wins whole-set -- an absent key drops, never keeps, and {} is a live empty ledger (a truthy check, never falsy); the boundary state note carries it across stops and the dormant read path serves it; renderView appends the chunk once per assembly so one live copy holds by construction; the guard is the <model> sibling (an emitted <sheet> conflicts with "the GM's ledger -- propose changes in prose", healed in-turn, cap 3, and her emission never applies -- the scan holds the GM's record); every strip surface learned the tag (the view's STRIP_HERS, the story's verbs, the table's chip regex -- the standing grep-every-strip-list lesson, applied); and the web gains sheetEditor, the paneEditor's JSON sibling in widgets.mjs (same stage/pending/discard pattern, bad JSON refuses at the stage), the third pane in the aside, the send attaching body.sheet, and [sheet] machinery lines on both table and raw walks. The mock's sheet-guard branch is CUE-KEYED, not position-keyed: the carried tail shifts the script's counts (session 4's log starts the script over -- the battery's first attempt landed on the ask position and crashed renderView on the unpaired call; the battery now answers the script ask and moves on), while a marked GM turn is immune to every shift -- mockModel reads the view, the marked turn earns the emission, the conflict it earns earns the plain-prose heal. check-reminder is sheet-aware (the chunk is a legitimate third system surface; the count and freshest-end assertions tolerate exactly one, and the freshest-end check now allows her latest reply and/or the chunk to follow the reminder). Verified: smoke ALL PASS with +15 sheet assertions (newest-wins, whole-set semantics, the chunk one-live-copy -- ANCHORED with startsWith because the invariants bundle itself mentions the tag and a bare regex matches it twice, an honest test bug caught by an honest test), the guard's conflict and heal with her emission kept verbatim in the raw log and never applied, the view and story strips, the empty ledger rendering its chunk, the boundary note carrying the sheet, the dormant read deriving it, and session 5 deriving it from the carried note end to end), restart + reminder checks green, typecheck green on both programs, check-repo clean (it caught the round's own prose twice: "window" is a retired term in README, the contwin vocabulary wins), and a browser pass over the pane end to end with zero console errors -- staging, the pending marker, the ride, the scan re-render, and both machinery lines on the table. Docs: README's protocol passage carries the sheet with the numbers-live-on-the-sheet line (prose numbers die with the contwin; sheet numbers ride the scan forever) -- NOT in the memory tiers table, where the first draft wrongly put it (the GM's ruling: the sheet belongs in neither memories nor records); the identity tier lost its loose "character sheet" name now that the term is technical; DICTIONARY gains the sheet entry with the history line (dice retired into variant literature, sheets arrived as the state machinery -- the tabletop metaphor completing while its realism stays advisory, players hold their own pencils in the real thing and we don't, for drift); ROADMAP parks the bookkeeper extension (the housekeeper's arithmetic sibling: reads the setting's rules prose and the latest turns, computes the ledger delta from a purchase in her prose, lands it as a STAGED edit -- applied on the GM's next turn or discarded; sheet-only authority, curator fallback, per-package opt-in because an agent cannot bookkeep what is not arithmetic). The GM's prompt-side edits ride the same commit: invariants' "Character's sheet" section (the universal rule, the trailing-clause flag taken in review), the reminder's inventory line gaining "the sheet (optional)", and la caramba's gm.md lore updates. The box package (the first consumer) and detention stay untracked WIP, untouched. The 2026-11-17 roadmap audit rides the same commit (GM: "done items can retire"): retired outright -- the SPA-vs-bridge and voice-examples decisions (long resolved) and steal items #1, #3, #4, #8, #11 (done, or in #8's case never work -- the housekeeper model is per-run selection, built); retired with tombstones -- the multiuser section (built 2026-11-14, the rulings live in DECISIONS #22-31 and README, the lifecycle tail kept visible) and the SPA v1 section (all four phases done, the API sketch superseded by README's living API docs, the substrate doctrine in README), with the one unbuilt design it held -- the turn-surgery saga rule -- surviving as its own bullet cross-referenced at steal #2; amended in place, dated -- seed.json (dead, successors named: the authored carryover and memory.json), turn-0.md (dead: her authored opening turn), the upstream model listing (never queried in play since discovery), the delta-tag transport (the full-block protocol, the sheet named), the service step (multiuser built, hosting remains), the carryover editor (the raw file-editor surface exists, the purpose-built UI stays deferred); kept -- the operator's queue, the landscape and receipts, the live constraints, the open steals with numbering preserved so cross-references resolve, the deferred tasks, the distant points, the rejections, the notes. 582 lines to 338; the first deletion pass duplicated the steal-list header and the verification re-read caught it
2026-11-17 22:50:59 +00:00
the 2026-11-16 rounds, the whole day in one commit: model discovery (the two-step op act -- discover scrapes the provider metadata, refine runs the deterministic battery over every id and hands the adjudicated results to the best passing model for the curated registry; state/models.json is the truth of selectable models and gates all model use, a fresh deployment has none; the five named sampling knobs ride run.json params over server.json params, sent only when set; the curator call retries once on the host's network hiccups, its output strictly validated with the machine-list fallback, and the do-not-deliberate line keeps its thinking tokens down); the pick rule reworked on the GM's rulings -- the dv endpoint's 5.2/5.3-max flip was an alias (one model behind both ids), the rank keys on the reasoning bucket not the raw token count (within-bucket differences are sampling noise, the thresholds sit in the endpoint's observed gaps) and full ties settle sort-lex-pick-bottom, with the mock registry carrying a canned tie pair (mock/mock-tie) and the smoke asserting the lex-bottom pick; the play-protocol batch (OOC GM turns carry no cache blocks, memory.json is authored draft applied by the start gate's reapply over a fresh db, /story filters OOC whole, the per-turn raw control on the table); the tunables UX round (web/knobs.mjs: the definitions table with the GM's hint texts and the probed this-endpoint bounds, the per-knob explicit override toggle replacing implicit empty-means-unset diffing, the shared focus-driven hint bar; the run detail and /model responses carry paramDefaults, the deployment layer -- the only default anyone can honestly name); request recording (every provider call lands its resolved model + effective params on the msg event as via, a failed call lands a req event with the failure, both surface on the raw tab and the per-turn raw control on no model-facing surface, a req riding the slidwin tail passes the start lint as conversation machinery; the housekeeping pass log names its model via the clerk's --model flag); the mind verb (<mind> JSON in a player turn sets its sampling for its next turn -- one-shot, max_tokens excluded, a budget not a mind; bounds enforced in KNOB_BOUNDS with the range named in the conflict and the heal restatement the statement that counts; derive() makes a statement live until a player reply consumes it, honest across restarts, session boundaries and forks -- an unconsumed mind rides on); the full-block protocol (the GM rewrote system/invariants/reminder to eliminate the diff verbs: she emits whole <status>/<agenda> at her turn tail, a present block is a whole-list set, absent means unchanged never blank, over-cap agendas evict from the bottom silently -- ruled a feature, silent to her, the note shows the GM; renderView strips every copy and stamps the newest of each kind at the tail of her most recent prose turn, her own emission, so the context reads as the same sequence of events the game had; GM prose goes pure, old logs' composited rides strip, they were never GM words; <mind> is write-only, its tags strip from the view; every turn of hers carries its <model> block -- the params it rode, bare JSON from the via record, the current call included, suppressed when nothing is set, emitting one refused with a pointer at <mind>; the clerk's status-apply/agenda-apply delta verbs RETIRED with their dispatch and collectors, status-set/agenda-set are the player path now; the story strips her blocks, the table chips them; the smoke imports renderView and asserts the view policy directly -- the pattern for testing view-only policy no API exposes); and the opening event RETIRED (the start gate seeds the clerk from her last authored turn's blocks -- the GM moved la-caramba's initial status into her opening turn; old carryovers keep their events as inert history; the event's pre-existing double-landing in every started log, pre-bundle and in-carry, died with the branch); smoke ALL PASS + restart + reminder + repo checks green, browser passes over the knob UX and the new chips and notes with zero console errors, typecheck green on both programs; README and DICTIONARY carry the durable design, HANDOFF trimmed to the map
2026-11-16 21:32:02 +00:00

Tiny Worlds

Long-form, freeform, text-based roleplay where the model plays one character and the human plays everything else.

The premise

Using a model as the GM hits the contwin (context window) wall and dilutes creativity -- it has to hold the whole world in its head. Inverting the roles fixes the footprint: a player-character holds one perspective. Short plays would work fine either way; the actual test is long, cross-session stories: can the model persist established lore without drowning in it?

More precisely: this isn't a model test, it's an instruction test. The subject is whether a model can be taught to decide what to write down. Humans forget; files don't -- so the file must be shaped to forget too. The product that test serves is the harness below.

A corollary shapes everything downstream, and names the project: each package is a tiny world on purpose. A small cast, one place, a few live pressures. The smaller the scope, the easier her choices -- everything she must weigh stays close, and the rings stay legible.

The goal

The memory test is not the end product. It exists to arrive at a usable roleplaying harness -- something people can enjoy making long stories on. The end shape: clone and run it yourself, or get an invite to a running instance. The inference key lives on the backend, so invited users get the functionality without the op disclosing secrets and without bringing their own model. Correspondingly: this repo ships code and authored content only -- no run state, and never a secret in cleartext (the config pattern is a committed example plus a gitignored real file). As of 2026-11-14 the MVP substrate is complete: clerk, server, housekeeping job, and SPA -- see node server/main.mjs and open http://127.0.0.1:7350/.

Roles

  • Human = the GM. The world, every NPC, all consequences, all retcons. Runs on organic memory -- no notes. The canon files are the prosthesis.
  • The player = one PC. Inner life, voice, choices. Nothing else. Reads memory, never writes it.
  • The housekeeper = a separate inferencer invocation, fresh context, run after each session. Reads the transcript and the rendered rings; emits a manifest of semantic operations. Judgment, no clerical work.
  • tool/memory.mjs = the clerk. Validates and applies manifests, maintains the database, enforces caps, renders views, writes the log, dumps canonical state. Fails loudly, never drifts silently.

Scope

Tiny on purpose: a handful of locations, a handful of characters. Freeform -- no handbook, no stats. Anything goes if it makes sense and makes the story better. Retcons are allowed but discouraged; when they happen they are explicit and logged.

The harness currently supports female PCs only -- names are inherently gendered and the shared prompts say "she" throughout; the postulate is cheaper than a gender system no customer has asked for yet. When a male or otherwise PC ever needs support, this is the line to revisit.

The deployment (multiuser)

A deployment is one clone plus state/ and runs/ (all gitignored state); the provider entities live in state/config.json, server-written, SPA-managed, zero manual file edits. The inference key lives on the backend need neither the key nor a local clone. Identity is a token, nothing else: no usernames, no passwords, no external IDPs. A single-use invite code -- spent codes are recorded forever and rejected loudly on reuse -- is exchanged at claim time for a persistent token; display names are freeform labels, collisions allowed. On a fresh deployment (empty users table) the server mints the superuser's bootstrap invite to state/bootstrap-invite.txt and the console; it is dead the moment any superuser exists, and recovery for the superuser is filesystem access. The superuser mints and revokes invites, lists and revokes users -- that is the whole of admin. Revocation destroys the identity: no suspend, no restore; a returning user is a new identity, and forking makes that cheap -- stories outlive identities by design.

  • Every API route except GET /api/session and POST /api/claim requires a signed-in user (Authorization: Bearer <token>).
  • Runs belong to their starter -- the table is the owner's, the story is everyone's. Every mutation, every model call, and the whole working surface (table, raw session, carryover, files, status, notepad) is owner-only; what any signed-in user gets is the story, the curated deliverable, and the fork button on it. gm.md stays never-model-facing; its human-side open read (#28) was overturned with this ruling (2026-11-15). Ownerless runs -- pre-user, or the owner was revoked -- are one uniform state: story-readable, forkable, no owner actions, never re-claimed. Ownership is resolved, never maintained: run.json keeps the record, a dead owner id reads as absent.
  • Fork is the way in: any user can fork any run, including their own. A mechanical atomic copy -- staged, swapped in by a same-volume rename, under the run's activity lock -- with the owner replaced. No lineage is recorded (runs are entirely independent); the fork's only mark is forked: unixtime in run.json, beside the carried-over created.
  • Packages are system or user. System packages ship with the repo; a user can save their run's craft as a user package under state/packages/ -- published to everyone, gm.md included (saving is the act of publishing), the pc never riding.
  • Models are per-run picks of full specs. A pick is {provider, model, effort} -- there is no unset effort (it substantially changes inference quality, so it is a property of the pick, developer 2026-11-18), and the per-run sampling-knob layer is retired: params are per-turn, the verb's alone. The provider's default pair (the op's selection, also the refine curator) pre-selects the create flow; a run's owner overrides either role -- in setup for drafts, in the play aside for started runs. Each call resolves fresh, so a mid-session switch simply takes the next turn. A pick is invalidatable: a provider removed from the config, a model gone from its registry, a model the battery disqualified -- the run blocks with the note naming what died until the GM sets it up again.
  • Every logged inferencer call records the acting user. Quotas and limits are an extension point, not built.
  • All dates and times are UTC everywhere. No time zones, ever.

Debug mode (--debug) is for testing: one fixed superuser ("debug") that bypasses the user database entirely -- no invite to claim. The bearer token that signs it in is minted into state/debug-token.txt and printed at every boot; paste it into the sign-in box on the claim screen. It reads normal state (runs, packages) unchanged, so it can inspect a real deployment -- and with every request token-gated, a debug server that somehow faces a network is not an open door. It stays testing-only regardless: the debug user is an unlimited superuser.

Runs

Two interleaved stories calibrate the memory system against itself:

la-caramba boutique
entries per session few -- tiny cast, deep history many -- the customer parade
dominant ops touch, reword insert, gate, demote/retire
ring A pressure staleness -- standings shift on hot entries clutter -- obligations accrete
player agency constrained -- reactive creativity full -- proactive creativity
records access none -- until the GM unlocks it in the story the card index on the shop PC

Boutique is an emptied placeholder (cleared 2026-11-15) -- no content, awaiting its design round; the table above is the design intent for it.

node tool/memory.mjs packages lists presets; runs lists instances; --run <id> addresses a run for any command.

Booting a run

Through the CLI below, or through the SPA: home -> new run -> pick a package -> edit the copied prompts (project prompts inspectable read-only alongside) -> start -- which takes dormant session one live: the carryover is linted, the bundle freezes, the opening consumes into the log, in one action. The steps below walk every hat on one head -- the package author's files (1-4), the deployment-side create (5), the GM's start (6); on a real deployment they split: a user drafts and creates through the SPA, and the package files are the author's, wherever they sit.

  1. Backdrop -- write packages/<story>/backdrop.md: the world as everyone in it knows it. Public knowledge, general setting. Neither memory nor state -- never touches the rings, never decays, always in the bundle. The housekeeper is instructed to keep it out of the rings.
  2. The carryover (optional) -- write packages/<story>/carryover.jsonl: her opening, as a short log -- one JSON event per line, the same format every session's carryover uses. {"t":"msg","m":{"role":"assistant","content":"..."}} is one of her turns, {"t":"msg","m":{"role":"user","content":"..."}} is one of yours, and her opening status rides her own last turn as a <status> block (the opening event is retired; old carryovers keep theirs as inert history). End it however you want the game to open: on her turn the table waits for your input, on your turn start sends it automatically as her cue. Start lints it -- only clean openings go live.
  3. Character -- write packages/<story>/character.md: starting identity. The sheet is a reduction of choice surface -- a ledger of decisions already made; "what would make sense" does the cutting. Three kinds of field:
    • provided -- write it in;
    • random -- draft a few candidates, node tool/memory.mjs pick "one" "two" "three", write the winner. A roll is a decision made by nobody that the player must honor -- that's its whole value;
    • free -- leave blank; the player invents it through play, the GM ratifies notable inventions afterward.
  4. Memory -- write packages/<story>/memory.json: her starting memories, as the mock housekeeping manifest of session zero -- the same vocabulary a real pass emits (all-insert ops, reasons included, a session of "0" and a summary). It stays authored material while the run is a draft (editable in the run's setup), and the start gate applies it over a fresh db -- the file is the one truth of a draft; afterwards it is inert provenance, read-only. Pre-existing records are not its business -- file those ahead of play with file --gm.
  5. Create the run -- node tool/memory.mjs create <story> <pc-name> (the API create route wraps the same clerk call; through the SPA it is home -> new run): the package is copied into runs/<id>/ -- the craft prompt (handbook.md) rides along, battery included -- landing where it lives from now on: the bundle files and the session-0 artifacts in sessions/1/, identity and the notepad at the run root. Session one is born dormant, its rings already applied. The run id is anonymous (it carries no facts, so there is nothing to rename); the pc's name and the package's display name land in the run's settings.json and drive what everything shows: "La Caramba / Rell". Different runs of the same package need different pc names. From then on the run directory is the only truth: the package is never read again, and everything is editable during dormancy. The discipline not to break a running narrative sits with the GM.
  6. First session -- press start (the SPA's setup editor, or POST /api/runs/<id>/sessions): the carryover passes the lint, the bundle freezes, the opening consumes into the log, and the table opens -- sending your closing turn automatically if the carryover ends on one, otherwise waiting for your input.

The protocol

  1. Refresh the views: node tool/memory.mjs --run <id> render
  2. Open a session: one system-role message is assembled in order: system.md (glossary, purpose, input guards) and invariants.md (the substrate's mechanical contracts) -- both repo-fed -- then the run's handbook.md craft copy. Everything else arrives as GM messages (user role), one message per file: backdrop.md, character.md, canon/ring-b.md, canon/ring-a.md -- identity first, then memory, ring A in the recency slot. Every GM turn is followed by the reminder -- reminder.md (repo-fed) as its own role: system chunk carrying the turn-composition protocol; superseded copies elide from the live view, so exactly one exists, always at the freshest end. The session's carryover rides behind the bundle as its opening material: raw log events, expanded at start when authored (session one's), never expanded when carried (live prose) -- and a carryover ending on a GM turn is sent automatically as her cue. In play the turn reminder rides every GM turn the same way (its own system chunk, one live copy in the view; her status and agenda never ride GM turns -- they stamp at her own tail). (On a tight session, ring B is optional loading -- ring A is the spine.) Substitution has two classes: @PC (her name) and @Package (the display name) are identity sigils resolved from the run's settings.json pc/name; $TOKENs are template vars declared by the prompts themselves -- every $TOKEN found in any prompt surfaces as an input in the SPA's setup, and the run's vars holds the answers (a package may ship defaults). Unresolved sigils-of-ours and vars fail loudly before anything is sent; any other @-word is the author's own text -- @ syntax is not owned here -- and passes through untouched. The GM's live input expands the same way at ingestion: the line resolves before it is logged, an unresolved token refuses the turn, and the line is handed back for editing. The server assembles and logs all of this automatically (until it lands: manual relay).
  3. In play: a line opening with ( is the out-of-character channel -- points of order, canon questions, proposals, vetoes; both sides use it, closing paren optional. A GM turn on that channel carries no <status>/<agenda> blocks -- an OOC exchange does not move her state, and the next in-character turn re-carries them. Entries carry stable ids ([e17]); citing one is the precise way to reference a memory. The status and agenda travel in-band at her own tail (the full-block protocol, 2026-11-16): the player emits whole <status> and <agenda> blocks in its own turns -- a present block is a whole-list SET (a present-but-empty one is a deliberate clear), an absent block means unchanged, never blank. The log is the one truth: the state scan derives each kind newest-wins across her emissions, the GM's override records, and the boundary state note -- the panes, the run detail, and the stamp all read it, no db holds a copy. The view strips every copy and stamps the derived value of each kind at the tail of her most recent turn, exactly where she left it: the status is the game world as of her turn -- the canon point -- and the context reads as the same sequence of events the game had. An over-cap agenda is never derivable (the scan caps every derivation at the top five; the log keeps her full list, and the note shows the GM what sank -- ruled a feature: immersive, human-like, fun chaos). GM prose goes pure: no blocks ride any turn, old logs' composited rides strip (they were never GM words). The GM's block edits are overrides: the pane editors stage them, they ride the next non-OOC GM turn as a record on it, and the composition renders them as if she had stated them -- mutated in place at her newest blocks, invisible to the model as an act, visible only as state. The sheet (2026-11-17) is the second state channel, and the split is semantic: status and agenda are narrative self-report (their truth is "she said so", the scan caches her latest words), the sheet is arbitrated run state (its truth is "the GM set so", nothing cached from anyone's words) -- schemaless JSON the setting's prose gives meaning to, GM-only authorship, model-read-only. A sheet record rides a GM turn like the override, newest-wins, whole-set (an absent key is dropped, never kept; an empty object is a live empty ledger, not an absent one); the boundary state note carries it across stops, so it survives the contwin, housekeeping, and session boundaries like the other channels. It renders as its own authoritative system chunk at the freshest end -- never a canon-point stamp, which would read as her words -- and she proposes changes in prose: emitting a <sheet> block conflicts with a pointer at the channel, the same guard <model> has. Numbers that affect play live on the sheet, never in prose alone -- prose numbers die with the contwin; sheet numbers ride the scan forever. The rewind (2026-11-17) is the GM's take-back, and it rides the send: a turn may carry rewind -- a log line index naming one of your turns -- and that send replaces the named turn, everything after it leaving the log outright (physical truncation; fork is the preservation story -- fork before rewinding keeps the branch, no fork no archaeology). The state channels re-derive to the cut: a sheet record or override inside the dead range reverts with it. The floor is the frozen opening (the start marker right after the carryover), never reached past; a pending ask refuses the send. Every send also carries expect -- the log line count it was composed against -- so a stale tab refuses before anything rides. The mind verb rides the same channel: <mind>{"temperature": 1.4}</mind> in a player turn sets its sampling knobs for its NEXT turn -- one-shot, JSON inside the tag, temperature/top_p/top_k/repetition_penalty (max_tokens is a budget, not a mind), bounds enforced strictly with the range named in the conflict so she can heal; the params merge over the run and deployment layers for every call of the turn that rides at it, then spend. <mind> is write-only (her tags strip from the view); the read side is the <model> block -- every turn of hers carries the params it rode as bare JSON before the prose, rendered from the via record, the current call included, suppressed when nothing is set; emitting one is refused with a pointer at <mind>. The sampling itself becomes hers to speak with. The self-heal channel's lifetime (2026-11-18): a conflict stays in the contwin -- a mistake remains visible so it is not made again -- and every conflict is self-contained, describing its problem in full with the offending emission quoted, because the block it answers strips from the view and an old conflict cannot lean on the turn it follows. A player turn takes one of four shapes -- literature, variant literature, tool call, OOC message (the reminder teaches them); variant literature is the randomness channel: several complete candidate turns in one <variants> block, each carrying its own blocks, one picked at random on reception -- only the picked one's blocks apply, and the unpicked rest never render on any model-facing surface. Records work travels the tools (records_search/file/amend/discard) when the run provides them; the CLI equivalents remain the deployment-side path -- --gm marks the writes as GM-authorized, and the CLI itself is filesystem reach, whoever's hand runs it (the op's, or the developer's on a dev box). The full play protocol -- format, one-thing-per-turn, thoughts off the page, intent-form, immersion over realism -- lives in system.md, invariants.md, and handbook.md. Through the server, the model's OOC is the ask_gm tool; the GM's own OOC stays (...) in their turns. Load-bearing prose lives in literature, not OOC -- the story render enforces this by omission: GET /api/runs/<id>/story is the whole deliverable read-only (every non-dropped literature turn, the opening to the last recorded, all sessions in order -- a dormant session's carryover included; OOC, tools, verbs, thinking, rings all out), and anything said only OOC leaves a hole the reading surface shows honestly. The play view is the table (GET /api/runs/<id>/table): the live session curated for the GM -- thinking never crosses the wire, variant turns carry only the picked one, and the opening carryover renders as ordinary history (during dormancy the carryover endpoint previews it the same way).
  4. Close a session: just stop. No in-band ritual; the player has no end-of-session duties. The stop moves the session's tail into the next dormant session's carryover, freezes this one, and runs housekeeping over what remains.
  5. Housekeep (fresh model, new context): send housekeeper.md (the repo-fed housekeeping prompt -- substrate-internal, never copied into a run), then the finished session's backdrop.md and character.md, then both ring views, then the session transcript -- pasted, or the latest runs/<id>/sessions/<n>/log.jsonl when playing through the server (the housekeeping job automates this). Save its manifest to runs/<id>/manifests/<n>.json.
  6. Apply: node tool/memory.mjs --run <id> --session <n+1> apply runs/<id>/manifests/<n>.json -- the tool validates, applies, handles overflow, writes the sessions/<n+1>/log/<n>.md, re-renders the views. A rejected manifest changes nothing and says why. The server's pass rebases first -- each run re-copies the finished session's db, so re-runs never double-apply.
  7. Review the log, veto or edit as desired. Memory edits go through the insert / delete / revive commands -- the CLI is deployment-side filesystem reach, its writes --gm-authorized; a run's GM without that reach reviews through the server instead (the housekeeping log, the rendered rings, the story).

The memory model

State lives in SQLite (runs/<id>/sessions/<n>/db/memory.db -- one per session, copied forward at stop); the canon/ring-*.md views are generated per session. Markdown survives as rendering, dies as storage -- the models see prose, the machine sees rows.

Memory is seven tiers:

tier what in context who writes it
backdrop the world as everyone knows it -- public knowledge, the general setting; never memory, never forgotten always GM, rarely (retcons)
identity the character's concept -- drives, skills, voice; changes rarely always GM, rarely; housekeeper may propose via open questions; blanks are the player's to invent
status descriptions of her immediate situation, admitted by a three-part gate: non-normal, acute, turn-affecting stamped at her most recent turn's tail, the scan's derived value the player (whole-list <status> block in its turns; absent = unchanged); GM override riding a turn, composing as hers
agenda her hot queue of intentions -- what she's working towards right now; a fixed-cap recency buffer (new on top, overflow evicts the bottom), disposable by design stamped at her most recent turn's tail, the scan's derived value (capped at five -- her full list lives only in the log) the player (whole-list <agenda> block in its turns; over-cap never derivable); GM override riding a turn, composing as hers
rings A/B salient memory -- facts, on her mind, MRU-evicted always housekeeper manifest
records her files -- the card index, the ledger. Narrow query only, hard cap 10 (in the tool, not the prompt), never bulk-loaded never -- on demand the player (file/amend/discard at her desk); GM files ahead of play; housekeeper only archives. The player's records tools are off until rewind-compatible (2026-11-17) -- the CLI path stands
cold forgotten or vetoed never -- not even queryable GM only (revive)

The boundary that keeps the tiers honest: stances are feelings (status, the player's); facts are facts (rings, the housekeeper's). The housekeeper never writes feelings; the player never rewrites facts. The status and the agenda split the player's own two surfaces along the same seam: how she is (status) vs what she means to do (agenda) -- states fade with the situation, intentions persist until dropped or evicted. And if she doesn't file it, it's not in her files -- records reflect what the character actually kept, nothing more.

Records access is diegetic and per-run: packages/<story>/settings.json gates it. The boutique's keeper has her card index on the shop PC ("records": true); the la-caramba cast has nothing ("records": false). The tool refuses queries and record ops when the flag is off, and the rendered views tell the model the current truth. Unlocking mid-story is a narrative act: narrate the discovery (the salvaged manifest), flip the flag, re-render -- the next session and the next housekeeping both see it. (The player-facing records tools are off until they are rewind-compatible, 2026-11-17: the flag keeps gating, the manifest simply does not carry the verbs; the GM's CLI filings are unaffected.)

The query discipline is an instruction test in itself: queries must be narrow (what this beat needs, not a fishing expedition), and a miss is a miss -- no rephrasing, no broadening, no retry this scene. The character doesn't have it written down; play on. (Concluding "not in my records" in-fiction is honest use of a miss; rummaging is not.) The result cap is mechanical -- LIMIT 10 in the tool, not a polite request in the prompt.

  • Ring A -- important facts. Changed a relationship, created an obligation, altered the world. Cap 500 entries.
  • Ring B -- everything else that passed the gate. Cap 3000 entries.
  • Cold storage -- everything evicted or deleted. Beyond the models' reach, GM-reachable via revive. Nothing is ever destroyed; the hierarchy is A hot, B warm, cold dead-to-the-character.
  • Both rings are ordered by touch -- most recently touched on top, an LRU cache. A memory meaningfully invoked during play is touched: it rises. Untouched memories sink toward the tail. Mere adjacency doesn't count as a touch.
  • Entries carry no dates. Memory doesn't timestamp -- when something happened lives in the prose ("the morning after the storm"), which is the only chronology the views ever had anyway, since they order by touch. Internal stamps exist and stay mechanical (LRU, overflow, "what's sinking") but never render; no model-facing surface shows a date.
  • Promotion and demotion are the housekeeper's judgment, not metrics: a B entry the session showed to be load-bearing moves to A (reason logged); a spent A entry may move down. When unsure, leave it -- if it matters, it will surface again, and B is generous.
  • Overflow is mechanical and exact: A spills to B, B spills to cold, oldest-touched first. Caps are enforced by count, not by a model's ability to count.
  • Combined budget: ~512KB ~ 130K tokens ~ half a 256K-class contwin. Caps are dials in tool/memory.mjs; retune freely.

The judgment call under test is "which ring" -- classification, plus the promote/demote eye. Everything clerical (ordering, caps, overflow, rendering, logging) is code.

Why this shape: it's an LRU cache, it's generational GC, and -- most relevantly -- it's how hippocampal memory works. Retrieval strengthens a trace; unretrieved traces decay. "Referenced memories rise" is the most human part of the design.

Known feature: frequently referenced != important. Loud trivia rises (the tavern door's color, mentioned every scene); quiet-crucial facts sink (a vow nobody's invoked in weeks). Human memory has the same bug -- availability bias. Expect the system to develop human-like distortion: the "wait, we forgot the vow" moment is both drama and test data. The GM's lever is narrative, never mechanical: if something crucial is sinking, reference it in play and the touch machinery does the rest. If you notice yourself wanting a manual override -- that's a signal to improve the system, not to press a knob.

log/ and the events table are write-only for every model. The housekeeper never reads old entries; the player never reads any. Past sessions are not the character's memory; the rings are.

What's being tested

The adjudication isn't a number -- it's a review. Read the session as a story and write what works and what doesn't, as a reader would: the classic trap is trying to arrive at an objective value for a creative piece, and a score -- holistic or otherwise -- is still that trap. The observables below are the reviewer's craft vocabulary and instrumentation: dimensions a practiced reader knows to examine (voice, continuity, nerve), used to isolate and name what the reading finds, never summed into a grade -- a rubric invites gaming, an argued review doesn't. What reads clean but still feels wrong is the review noticing what the list can't; that's how the list grows. The fiction-only story render is the reading surface: machinery seams show as prose seams.

After N sessions, grade against:

  1. Classification quality -- the housekeeper's A/B calls; spot-check against the log and the transcript.
  2. Promotion/demotion quality -- did the facts that turned out to matter actually rise? Spot-check against the transcript.
  3. Touch fidelity -- did everything the transcript meaningfully invoked get touched? (The events table makes this a query, not an archaeology dig.)
  4. Manifest hygiene -- do ops reference real ids, in the right rings? (Malformed manifests are rejected mechanically; valid-but-wrong ops -- touching things never mentioned, promoting noise -- are the model's errors and the real observable.)
  5. Availability bias incidents -- quiet-crucial facts sinking; rescued or missed? (report shows what's sinking.)
  6. Growth curve -- memory should approach the caps asymptotically, not climb linearly. (status per commit.)
  7. Purview discipline -- inventions logged and mostly color-tier; no NPC puppeting; outcomes left to the GM.
  8. Confabulation -- zero invented continuity not present in the rings.
  9. OOC hygiene -- friction surfaces in the OOC channel, not in silent drift.
  10. Query discipline -- narrow queries; zero retry-on-miss cascades.
  11. Archive classification -- on-her-mind (rings) vs in-her-files (records): are customer cards filed, not memorized?
  12. Status maintenance -- excursions declared when leaving baseline and cleared when returning; baseline shifts track character growth; her status stays small. Does her declared status match the transcripts?
  13. Filing discipline -- cards filed at natural desk moments and kept current, or dumped and forgotten?
  14. Narrative discipline -- one thing per turn; zero hedged alternatives; checked actions written as intent; thoughts narrated but never audible. The failure to watch is telepathy leakage: the cast conveniently knowing what was only thought, or the player expecting them to.

Content stance

The play is uncensored: erotica is not a special bucket -- it plays by the same rules as everything else. It makes sense, it isn't the point, and there is no pressure: unwanted advances may be struck down, and the player must not play anticipated leads to please the GM. The GM's narration is the ruling on what is earned.

Hard limits, absolute: scat, vore, any sexual or romantic content involving minors, gratuitous violence. These live in system.md; edit them there.

Housekeeping

The primary audit surface is the per-session dump (runs/<id>/sessions/<n>/dumps/memory.sql): id-ordered, one row per line, auto-written by every mutation. Because the ordering is by id, diffs are position-stable -- a touch is one changed line, a promotion is one changed line, an eviction is one changed line. Diffing two consecutive dumps reconstructs exactly the operations that were applied, including overflow and everything in cold storage.

Cross-check it against the session's log: the log is what the housekeeper declared, the dump-diff is what actually happened. Any disagreement is either a tool bug or a hand edit -- and hand edits have a contract: all mutations go through the tool, so the dump never drifts. (If you ever poke the db with a sqlite browser, run dump afterwards.) The dump is filesystem state, so this cross-check belongs to the deployment's operator side; a run's GM reviews a pass through the server instead -- the housekeeping log, the rendered rings, the story.

The dump is restorable SQL; the binary memory.db (one per session, copied forward at stop) is rebuilt from it by node tool/memory.mjs restore (per run). The canon/ views stay as provenance -- exactly what the models were sent -- and log/ + manifests/ remain the human-readable record.

The housekeeper may run a different model than the player -- cheaper, or more pedantic, whatever housekeeping needs. The two prompts are independent.

Substrate: server/ -- a zero-dependency node:http service (node server/main.mjs [--mock]), multiuser (bearer-token identities, the deployment section above), synchronous JSON. Boot-rebuilds open sessions from the session logs on start; the append-only jsonl is the truth, the live context is a view under policy (thinking never goes back, old tool results elide to stubs -- ask_gm answers never do, a ruling must not vanish -- old GM-side status blocks elide, her own blocks strip, and the derived state stamps at her most recent turn's tail). Tool-call pairing is validated before every call. The tool list is the capability surface: ask_gm always; records are OFF for now (2026-11-17: their verbs mutate the session db, which a rewind does not compensate -- until they are rewind-compatible the manifest carries ask_gm alone, whatever the settings gate says; the CLI's --gm filings never ride a turn and stand). Chance in play is not a tool: she answers with variant literature -- several complete candidate turns in one <variants> block -- and the server picks one at random on reception; the pick is logged, and the unpicked variants never render on any model-facing surface (the session log keeps them). The carry: a new session does not open cold -- the previous session's tail rides into the new log behind the bundle, flagged carried, and the model's view renders it as ordinary history, so the fresh contwin reads as the old one continuing (the boundary is invisible from inside). The walk is mechanically dumb -- contiguous raw lines from the end, whole exchanges, nothing filtered -- while the cutoff counts only the prose the model will see (thinking, notes, and draft variants ride at zero cost) against a 96KB budget (~10% of a 256K-class contwin). The housekeeper reads the session minus its live tail: an event files into the rings exactly when it drops out of the carry, so the rings never overlap the carried prose. Three projections of the same logs: the session route serves the raw log, thinking included -- the audit surface (the table's raw tab in the SPA, and the per-turn raw control inline on the table -- one entry's wire form fetched on demand, no tab switch); every provider request records its resolved model and effective params (the merged layer actually sent) on the resulting msg event, and a failed call lands a req event with the failure -- both surface on those same raw faces, never on any model-facing one; the table (/api/runs/<id>/table) is the open session curated for the GM -- no thinking, only the picked variant, carried turns flagged for the dimming, plus the variance metric (picks, offered, max -- straight off the pick notes); the story (/api/runs/<id>/story) is the whole deliverable read-only, every session in order, carried copies never re-rendered. ask_gm pauses the turn mid-loop -- the request returns with the question, the answer call resumes it, and a refresh re-presents it after a restart. The old tool/bridge.mjs is deleted: it never went live, and the server reached mock-parity (2026-11-14). Config is self-healing state, not a hand-edited file (developer, 2026-11-18): the provider entities -- slug, baseUrl, optional key, the op's default model spec -- live in state/config.json, written only by the server, managed from the SPA's admin block. There is no server.json (developer, 2026-11-19: it held no meaningful configuration once the bind died): the listen address is code -- loopback always, a deployment fronts the server with a proxy -- the port rides the RP_PORT env var (default 7350), and the context meter reads the discovered per-model contwin from the registry, never a declared one. No legacy config shapes are read: shape changes come with one-time migrations, not permanent tolerance (the no-legacy rule, developer, 2026-11-18). Boot always succeeds: a fresh clone with nothing comes up serving and mints the superuser invite, and -- the self-heal rule, broadly: an error that can be mechanically fixed to a reasonable degree without requiring human input gets fixed -- the empty provider list is auto-fixed by adding opencode/free (the anonymous, keyless fallback: fixed slug and base, never carrying auth -- a 401 from it is upstream breakage to show, not a prompt to fix) and running its discovery in the background. The list is never empty in lifetime either: opencode/free is removable only while another provider stands. Custom providers add from the SPA taking only the endpoint (a slug and a baseUrl -- never a key): discovery runs on add and IS the probe (developer, 2026-11-19). A working keyless listing never sees a key field; a recognizable auth refusal (401/403) stands the provider broken and opens the key path -- the key rides the auth route, checked on reception, saved only on success, asked again on the next refusal; every other failure refuses the add outright, nothing stands. The card reads the last probe outcome, and only the explicit acts move it (add, key, remove-key, discover) -- usage errors are transient and the op's to fix, nothing auto-flips. A keyed provider carries a remove-key control: a provider gone public, or the first half of a replacement (the ask re-opens when the keyless probe meets the refusal again). The housekeeper inherits: no pick of its own means the player spec's provider default. The mind verb stands above every pick -- the player's own one-shot statement for its next turn (the play protocol above), and the only params source there is. --mock runs a scripted fake model that proves the loop without a key. The SPA is the server plus a fiction-first UI, a GM console, and the housekeeping job runner -- and the tool-calling part is the smallest component, because the provider does the structured emission and the clerk already speaks function-shaped. If player-side status maintenance proves too costly for the player's attention, the fallback is a dedicated status-keeper invocation reading transcripts -- same pattern as the housekeeper, smaller job.

Model discovery is per provider, the op's acts from the SPA's admin block, and the registry it writes (state/models.json, one section per provider) is the truth of selectable models -- a provider not discovered has nothing selectable. Discover scrapes one provider's surface: API metadata only, zero inference, the section written preliminary (free, but it resets a refined section -- the battery results are re-earned by refining). Refine runs the deterministic battery over that provider's list -- the tool-manifest ping at the working effort (the exact request shape a player turn takes; a model that cannot take it is not an inference model and stays out of the selectors), two reasoning samples on a fixed puzzle, the disable-thinking probe whose working spelling is recorded as a discovered fact, and the reasoning-effort ladder (each level measured for mean thinking) -- then hands the adjudicated results to the op's selected default model (repo craft: curator.md) for the presentation layer: families, labels, descriptions, role eligibility, and one overall-best recommendation {model, effort} -- intel only, shown beside the op's selection, applied by one click, never auto-landed, and never a deterministic stand-in on a bad model day (the op gets no advice, not machine advice). The curator's output is strictly validated; any failure falls back to the machine list, so refine can never be blocked by a bad model day. The battery's measured effortDefault is pre-fill and hint only -- nothing rides implicitly anymore (developer, 2026-11-18, amending 2026-11-16: with effort a property of the pick, the selection prompt pre-selects and the recommendation informs, no silent layer). The adjudication cache (state/refine-cache.json) keys each refined entry by the full spec tuples on both sides -- the probed model at the effort the deployment sends, and the curator at its own spec (a weak curator at a low effort adjudicates worse; reasoning effort substantially changes inference quality) -- so churn is cheap: discovery re-runs freely (opencode/free rotates its models), and a refine that sees the same tuple reuses the cached verdict, refreshing it in place when it re-probes. Failures never cache (developer, 2026-11-19): a failure is the absence of a measurement, not a measurement -- every refine re-probes the models that failed the last one, so a transient error never pins a false verdict, and a model that fails for real costs one cheap probe per refine. No inference call retries itself (developer, 2026-11-19, the universal rule): every call is user-initiated and every act has its manual retry -- the send again, the housekeeping re-run, the refine button; a dead curator call lands the machine-label fallback, which is the designed outcome, not a degraded one.

Layout

system.md         the opening: glossary, purpose, input validation --
                 the guards tier, per-project, repo-fed at assembly
invariants.md     the substrate tier -- the mechanical contracts (syntax
                 markers, tool channels, memory, records, the status and
                 its gate); repo-fed at assembly, never copied into a
                 run, travels with the code
handbook.md       the craft tier, shipped default -- copied into each
                 run at creation, editable to taste (shape of play,
                 purview, time skips, content stance, hard limits)
housekeeper.md    the housekeeping prompt -- repo-fed at housekeeping, never copied
                 into a run, never user-facing: it prompts the
                 internal housekeeper, never the bundle
                 (system.md and invariants.md are bundle parts and
                 are inspectable read-only in the SPA)
curator.md        the registry curator prompt -- repo-fed at refine,
                 never copied, never player-facing: it prompts the
                 one-shot curator that labels the discovered models
reminder.md      the per-turn reminder: the turn-composition protocol,
                 repo-shared, never copied into a run -- sent after the
                 GM's prose as its own system chunk every turn, one
                 live copy (older elide). Absent/empty = no ride
HANDOFF.md       working state -- where did we leave off, next steps, gotchas
ROADMAP.md       SOTA review and steal list, worked point by point
QUESTIONS.md     the decision queue -- open questions, pending calls
DECISIONS.md     the resolved record -- every answered question, kept
                 verbatim with its day's words; the citation numbers
DICTIONARY.md    the terms of art -- the ruled names, one source of
                 truth; a rename rules here first, then sweeps
AGENTS.md        the assistant's own working notes -- style lessons, gotchas,
                 state pointers
config.json      the default package
package.json     dev tooling only -- the runtime is zero-dependency;
                 typecheck script + pinned devDependencies (typescript,
                 @types/node; node_modules/ gitignored)
tsconfig.json    tsc as a no-emit checker over the JSDoc annotations
                 (checkJs, strict); server core typed, the clerk and
                 web to follow
names-female.txt the name dictionary -- one name per line; the new-run
                 form rolls an unused one for the main character
tool/
  memory.mjs     the clerk: packages, runs, create, save-package, init,
                 render, apply, insert, delete, revive, file,
                 amend, discard, search, unarchive, pick, dump,
                 restore, report (her status and agenda never lived
                 here in the end -- the log is their one truth)
                 (--run <id>; --session <n> addresses one session,
                 defaulting to the active -- the live one, else the
                 latest; --owner stamps a run's owner; --gm for
                 GM writes; --force for migrations; --json for machine
                 output on packages/runs/report)
server/          the substrate: a zero-dependency node:http service
  main.mjs       entry + REST spine (node server/main.mjs [--mock] [--debug]);
                 bearer-token auth on every route (session/claim are
                 public), ownership gating, per-run activity locks
                 (turn, ask, start, the housekeeping job, fork);
                 boot-resumes interrupted stops and reopens live
                 sessions from the session logs on
                 start; bootstraps the fresh-deployment superuser
                 invite; the request log and every inferencer call carry the
                 acting user; four projections of the state: GET
                 /session (raw, the audit surface), GET /table (the
                 play view), GET /story (the whole deliverable),
                 GET /carryover (the dormant preview)
  provider.mjs   the provider clients (one per configured entity --
                  chat completions, models listing with metadata; API
                  failures carry their HTTP status) and providerFor,
                  the slug-keyed routing
  providers.mjs  the provider entities: state/config.json (the
                  server-written truth), the one-time server.json
                  import, the opencode/free singleton (authless,
                  guarded removal), the self-heal auto-add
  users.mjs      the deployment's people: users, invites, tokens
                 (state/deployment.db; hashes only, spent invites
                 recorded forever)
  discovery.mjs  model discovery, per provider: discover (the
                  metadata scrape, the section reset) and refine (the
                  battery, the curator pass, the recommendation, the
                  spec-keyed adjudication cache);
                  state/models.json is the per-provider registry the
                  selectors, model routes, and the turn loop gate on
  bundle.mjs     run context: prompt assembly (the trio system message,
                 the GM-message bundle, @ sigils + $ vars), the tool manifest
                 and its clerk dispatch (records off until
                 rewind-compatible, 2026-11-17)
  session.mjs    session lifecycle (dormant -> live -> finished: the
                 start lint and the session-0 memory apply, freeze
                 and consume; stop with the
                 move-at-stop slidwin), the typed
                 jsonl (append-only save the rewind's sanctioned
                 truncation), the rewind floor (the start
                 marker), the view renderer (the stamping at the
                 canon point, elision, thinking-strip,
                 variant resolution, pairing check)
  loop.mjs       the turn loop: ask_gm pause/resume, the
                 full-block protocol (whole-list status/agenda
                 sets, absent = unchanged; the view does the
                 stamping), conflict carry, the variant pick, the
                 mind verb (one-shot <mind> layer over the knob
                 resolution, bounds enforced, the <model> guard),
                 the request record (via / req events), the
                 rewind send (the expect staleness guard, the
                 truncation commit); the
                 scripted mock model
  variants.mjs   variant literature: strict parsing of the
                 <variants> block (malformed refuses loud, nothing
                 applied), the random pick, and the effective-content
                 map every model-facing projection renders through
  carry.mjs      the slidwin: the tail walk (contiguous raw
                 lines, whole exchanges) and the smart cutoff --
                 only prose the model will see counts against the
                 96KB budget; the tail moves at stop, so the
                 housekeeper reads the log as it was left
  fork.mjs       fork: the staged atomic copy with the owner replaced
                 and the `forked` stamp
  clerk.mjs      the clerk boundary (every state op via memory.mjs)
  shapes.mjs     the shared type declarations -- no runtime code; the
                 tsc checker and the humans agree on the load-bearing
                 shapes (log events, wire messages, manifests, job
                 state)
  housekeeping.mjs the pass as an async job: one trigger, two
                 behaviors -- stop (close, move the tail, freeze,
                 then the pass) and the re-run (rebase + fresh
                 manifest into the dormant session); transcript
                 with labeled thinking, run-state injection, the
                 housekeeper call, manifest save, apply, ready;
                 rejections hold and surface why
web/             the SPA -- no build, vanilla ES modules, path-routed;
                 flat modules like server/, views own their state
  index.html     the shell: claim (invite), home (runs + admin), new
                 (packages), setup (editor), play (transcript, status
                 pane, context meter, GM input, ask modal, fork) --
                 the server serves it for any extensionless path
  app.mjs        the entry: view registration and the token-session
                 boot -- thin
  router.mjs     path routing + the view lifecycle (enter/leave per
                 view; the seq race guard; runGone ejection)
  client.mjs     the REST client: the one fetch choke point (named
                 client, never api -- /api is the server's route
                 namespace and the static guard matches by prefix)
  state.mjs      the shared runtime state: me, seq, runId
  chrome.mjs     the shared page chrome: identity, session info, the
                 context meter, the busy note, the notice banner
  log.mjs        the diagnostics event log (sessionStorage, survives
                 refreshes; the header's "log" button)
  widgets.mjs    the shared factories: armedButton (the two-click
                  confirm), paneEditor (the status/agenda pattern),
                  modelsBox (the per-run spec picks: provider, model,
                  effort per role, the invalidation health line)
  knobs.mjs      the reasoning-effort ladder (mirrors the server's)
                  and the effort select -- the per-run knob rows are
                  retired (params are per-turn, the mind verb's alone)
  transcript.mjs register rendering (speech / narration / OOC) and
                 the session-log entry walk (historical opening
                 events render as machinery); colour-only tokens,
                 source verbatim -- the workbench renders no faces
                 (the book does: the story view carries its own
                 renderer)
  view-*.mjs     one module per view -- claim, home, new, setup, play
                 (the table), story (the whole deliverable, read-only)
                 -- each owning its elements, its state, and its wiring
  style.css      dark, quiet, fiction-first
test/            the mock smoke, kept next to the code
  smoke.mjs      the multiuser/lifecycle/agenda/reminder/variant/
                 slidwin pass against the --mock server -- expects a
                 clean state/, prints
                 its run ids, leaves a temp token file for the
                 restart check; clean up state/ and the smoke runs
                 afterwards
  check-reminder.mjs  unit-verifies the reminder elision policy (one
                 live copy, at the freshest end) against a run's
                 session log
  restart-check.mjs   after a server restart: the token survives,
                 live sessions rebuild, drafts stay intact
  check-repo.mjs      the repo's rules, no server needed: ascii bytes
                 in every tracked file, no text-mutating css, no html
                 comments in prose, retired terms banned from living
                 prose, zero-dependency imports, utc discipline, web/
                 static naming (never "api"), the bundle boundary,
                 dateless memory
db/
  schema.sql     entries, records, events journal (shared; the status
                 and agenda tables are retired -- the log is their
                 one truth, old runs keep dead tables, never read)
state/           per-deployment people + shared packages (gitignored):
                  deployment.db (users, invites), bootstrap-invite.txt,
                  config.json (the provider entities -- server-written,
                  SPA-managed), models.json (the per-provider registry
                  -- the truth of selectable models), refine-cache.json
                  (the adjudication cache), packages/ (user-saved,
                  published to everyone)
runs/            per-deployment run state (gitignored) -- one anonymous
                  id per run (carries no facts): run.json (lineage,
                  owner, `forked` stamp on a fork, models -- the
                  per-run player/housekeeper specs; the params layer is
                  retired, per-turn via the mind verb), settings.json
                 knobs), settings.json, gm.md
                 (the GM's notepad), manifests/, and sessions/<n>/ per
                 session: session.json (phase, ready), bundle/ (the
                 frozen craft copies), db/ (the session's rings),
                 canon/ (rendered views), dumps/, log/ (the
                 housekeeping records), carryover.jsonl (while
                 dormant), log.jsonl (live and after)
packages/        system presets -- authored content only, never state
  la-caramba/    backdrop.md, character.md, carryover.jsonl (her
                 opening log), memory.json (her starting memories),
                 settings.json, gm.md (the GM's notepad -- copied per
                 run, always editable in the SPA, never in
                 any bundle)
  boutique/      emptied placeholder (2026-11-15) -- awaiting its
                 design round
S
Description
LLM RP harness
Readme 2.1 MiB
Languages
JavaScript 95.5%
CSS 3.1%
HTML 1.4%