From fa3f23b47490919a55017ee2f34f67bad16532af Mon Sep 17 00:00:00 2001 From: Mute Date: Sun, 15 Nov 2026 14:35:00 +0000 Subject: [PATCH] variant round: roll retired, chance is variant literature (strict parse, crypto pick on reception, picked-only rendering, /story variance metric); entity round: /story the whole deliverable, /table the play projection, the slidwin carry (smart contwin cutoff, whole exchanges, housekeeper reads session-minus-tail); dormant-session rework: universal session lifecycle (dormant->live->finished, sessions/ storage), move-at-stop, start lint + auto-send rule, rebaseable housekeeping, turn-0 -> carryover.jsonl, seed -> memory.json, draft-only save-package; format house rules enforced by the nine-rule check-repo (ascii bytes, no text-mutating css); smoke 105/105 + restart + reminder + browser pass green, irene hand-migrated to the new layout --- AGENTS.md | 199 ++++--- DICTIONARY.md | 279 +++++---- HANDOFF.md | 498 +++++++++++++--- QUESTIONS.md | 183 +++--- README.md | 483 +++++++++------- ROADMAP.md | 258 +++++---- db/schema.sql | 10 +- handbook.md | 22 +- housekeeper.md | 88 +-- invariants.md | 14 +- packages/boutique/backdrop.md | 9 - packages/boutique/character.md | 14 - packages/boutique/gm.md | 39 -- packages/la-caramba/backdrop.md | 4 - packages/la-caramba/carryover.jsonl | 2 + .../la-caramba/{seed.json => memory.json} | 14 +- packages/la-caramba/turn-0.md | 14 - reminder.md | 42 +- server/bundle.mjs | 79 ++- server/carry.mjs | 93 +++ server/clerk.mjs | 2 +- server/fork.mjs | 19 +- server/housekeeping.mjs | 230 +++++--- server/loop.mjs | 126 ++-- server/main.mjs | 437 +++++++++----- server/provider.mjs | 2 +- server/session.mjs | 438 ++++++++++---- server/users.mjs | 18 +- server/variants.mjs | 64 +++ test/check-reminder.mjs | 31 +- test/check-repo.mjs | 161 ++++++ test/restart-check.mjs | 4 +- test/smoke.mjs | 191 ++++++- tool/memory.mjs | 538 ++++++++++-------- web/app.mjs | 7 +- web/chrome.mjs | 14 +- web/client.mjs | 12 +- web/dom.mjs | 2 +- web/index.html | 35 +- web/log.mjs | 8 +- web/router.mjs | 9 +- web/state.mjs | 6 +- web/style.css | 44 +- web/transcript.mjs | 40 +- web/view-claim.mjs | 4 +- web/view-home.mjs | 36 +- web/view-new.mjs | 14 +- web/view-play.mjs | 184 +++--- web/view-setup.mjs | 102 ++-- web/view-story.mjs | 56 ++ web/widgets.mjs | 18 +- 51 files changed, 3477 insertions(+), 1719 deletions(-) create mode 100644 packages/la-caramba/carryover.jsonl rename packages/la-caramba/{seed.json => memory.json} (73%) delete mode 100644 packages/la-caramba/turn-0.md create mode 100644 server/carry.mjs create mode 100644 server/variants.mjs create mode 100644 test/check-repo.mjs create mode 100644 web/view-story.mjs diff --git a/AGENTS.md b/AGENTS.md index ad5bd5b..5bb9f79 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,7 +1,7 @@ -# AGENTS.md — the agent's own notes +# AGENTS.md -- the agent's own notes Working notes for the agent working this repo. Not project -documentation — the project's homes are README (architecture, protocol, +documentation -- the project's homes are README (architecture, protocol, observables), ROADMAP (decisions, steal list, substrate plan), QUESTIONS (the decision queue), DICTIONARY (the terms of art), HANDOFF (working state). This file is @@ -14,16 +14,16 @@ memory the agent owes itself across sessions. manifests, or transcripts to save tokens. - The GM drafts creative content; the agent drafts mechanical content. "I draft, you cut" runs both directions. They edit files directly and - say "check it out" — always re-read before reviewing or editing; the + say "check it out" -- always re-read before reviewing or editing; the last read never still holds. - They think across several lines at once and answer in batches; silence on a proposal usually means "not persuaded, moving on." - Discuss in prose — question dialogs have been dismissed twice. + Discuss in prose -- question dialogs have been dismissed twice. - **Commit discipline: they commit when pieces are in place. Never propose, nudge, or ask about committing.** (Learned 2026-11-13, after being told four-plus times.) - Reviewing their creative work: check coherence against the rest of - the system, flag ripples, name what works and why — the verdict on + the system, flag ripples, name what works and why -- the verdict on creative content is theirs. GM-private files (gm.md) are never edited and only flagged. @@ -31,14 +31,14 @@ memory the agent owes itself across sessions. - **Plainness over subtlety.** Learned 2026-11-13: my content-stance prose was aphoristic ("the weather is hers", "the camera keeps to - her side") and the GM — the co-designer — could not decode most of + her side") and the GM -- the co-designer -- could not decode most of it. Their rewrite named the thing (erotica), stated rules as behavior (strike down unwanted advances; don't play anticipated leads to please the GM), and stated the thesis outright (nothing lives in a special bucket). Match that register. -- Metaphor survives only when cashed out in the same breath — "tense - is the camera: present while the scene plays — example — past to - summarise — example" passed their red pen. A metaphor left uncashed +- Metaphor survives only when cashed out in the same breath -- "tense + is the camera: present while the scene plays -- example -- past to + summarise -- example" passed their red pen. A metaphor left uncashed is a riddle. - **No HTML comments in prose or prompt files** (2026-11-14): purpose descriptions live in README (layout), AGENTS, or as comments in the @@ -53,19 +53,19 @@ memory the agent owes itself across sessions. ## Environment gotchas -- Shell command strings: plain ASCII only — em-dashes and fancy quotes +- Shell command strings: plain ASCII only -- em-dashes and fancy quotes get rejected. - The edit tool matches bytes, and the console renders dashes unreliably. When an edit fails on text that "looks right," dump char codes via PowerShell before retrying; or transcribe from a fresh read, never from memory. **The three-space trap (bitten 2026-11-13 and 2026-11-14):** the read tool prefixes each line with `N: `, so - continuation-line indentation LOOKS one space deeper than it is — + continuation-line indentation LOOKS one space deeper than it is -- eyeballing a " the package" was really " the package". Never count indentation from the rendered display: dump the exact line with `node -e` + JSON.stringify and transcribe from that when an edit keeps failing on text that reads right. -- `node:sqlite` prints an ExperimentalWarning on every clerk call — +- `node:sqlite` prints an ExperimentalWarning on every clerk call -- harmless, filtered in bridge context. - Session logs, dumps, and views are generated; never hand-edit them. @@ -77,28 +77,28 @@ memory the agent owes itself across sessions. invites single-use with a permanent spent record; bootstrap invite auto-mints on fresh deployment to state/bootstrap-invite.txt; op mints/revokes invites and users; revocation destroys identity (new - invite = new person). Ownership is RESOLVED, never maintained — + invite = new person). Ownership is RESOLVED, never maintained -- run.json keeps dead owner ids, the API reads them as ownerless (GM overruled my file-sweep; resolution won). Fork = atomic copy, owner replaced, `forked: unixtime` stamped, no lineage. Packages split system (repo) / user (state/packages, published). Spectators read everything incl. gm.md (the boundary is the model boundary), mutate - nothing. Dates/times always UTC — house rule. Model selection: + nothing. Dates/times always UTC -- house rule. Model selection: per-run `models: {player, housekeeper}` over server.json defaults (#16 narrowed to the default choice only). Signing in is permanent - and per-browser — no sign-out (lifecycle is a ROADMAP extension + and per-browser -- no sign-out (lifecycle is a ROADMAP extension point). The agenda (QUESTIONS #32): the player's second block, ``/ `` deltas, cap-5 recency queue; Irene's events journal - migrated (CHECK widened) — her db is agenda-ready. The per-turn + migrated (CHECK widened) -- her db is agenda-ready. The per-turn reminder (QUESTIONS #34, steal #11 done): reminder.md is repo-shared, rides after every GM turn as its own system chunk, one live copy - (older elide); its CONTENT is the GM's — my draft is a proposal, + (older elide); its CONTENT is the GM's -- my draft is a proposal, the handbook duplicate-cut is their red pen. - Substrate design round complete (2026-11-13); rulings live in ROADMAP ("The harness") and HANDOFF. Bridge retired before ever going live; REST + SPA is the MVP; runs are per-deployment instances copied from packages at creation; zero-dep stack. Doc set updated to match. -- Build order: ALL FOUR PHASES DONE (2026-11-13/14) — clerk paper +- Build order: ALL FOUR PHASES DONE (2026-11-13/14) -- clerk paper migration, preset/run split, prompt split, server, housekeeping job, SPA. The MVP substrate is complete and live-proven end to end (two real wraps, one full UI-driven session). Remaining roadmap @@ -110,78 +110,144 @@ memory the agent owes itself across sessions. Invoke-RestMethod (curl.exe mangles quotes); background start/stop via Start-Process -PassThru with a PID file in $env:TEMP. - Gotcha (2026-11-14): before starting the server, check - `Get-NetTCPConnection -LocalPort 7350` — a forgotten instance holds + `Get-NetTCPConnection -LocalPort 7350` -- a forgotten instance holds the port and silently answers with OLD code while the new one dies on bind (bit me once; two accidental live turns resulted). -- Gotcha (2026-11-14, GM): **never call browser.screenshot** — the +- Gotcha (2026-11-14, GM): **never call browser.screenshot** -- the image return breaks the session (glm-5.3 is not multimodal; the GM had to rewind once). Verify UI text-safely: browser.snapshot (accessibility tree), browser.console, browser.network. If real vision is ever needed, the endpoint carries multimodal - deepseek-v4.1 — but prefer never needing it. + deepseek-v4.1 -- but prefer never needing it. - Gotcha (2026-11-14, GM): **no JS alert()/confirm()/prompt() in the - SPA** — they block the embedded browser pane (the GM sat locked out + SPA** -- they block the embedded browser pane (the GM sat locked out of their input once while a test confirm hung on my dialog-tool fumbling). In-page UI only: the banner for notices, two-click arm for confirms. - Browser-tool gotchas (2026-11-14, UI testing): evaluate takes a raw expression, not an arrow function (an arrow returns the function - uninvoked — its .value serializes to {} and silently corrupts - whatever you build from it); wait's text matches RENDERED text, so - CSS text-transform breaks literal waits (wait for "HER STATUS", not - "her status") and PLACEHOLDERS never match a wait at all (probe the + uninvoked -- its .value serializes to {} and silently corrupts + whatever you build from it); wait's text matches RENDERED text + (moot for letter case since the all-caps CSS ban, 2026-11-15 -- + waits match source text now) and PLACEHOLDERS never match a wait at + all (probe the textarea via evaluate instead); clickable divs are invisible to the - a11y tree and the keyboard — clickable things are buttons. Added + a11y tree and the keyboard -- clickable things are buttons. Added 2026-11-14 (multiuser round): the a11y snapshot races async renders - — waiting for static skeleton text ("RUNS", the aside headings) + -- waiting for static skeleton text ("RUNS", the aside headings) snapshots BEFORE the fetches land and looks like a rendering bug; wait for text that only exists post-render (a card name, the session-info line) or probe the DOM via evaluate. - Test-state discipline (2026-11-14): the deployment's state/ is real - — never leave test users or invites in it. Smoke against --mock, + -- never leave test users or invites in it. Smoke against --mock, then Remove-Item state/ and every test run (all but the GM's real ones) before calling it done. A stale bootstrap file is harmless (dead once a superuser exists), but test users make the deployment NOT fresh and block the real bootstrap. - Naming gotcha (2026-11-14, SPA round): static files under web/ must - not have names starting with "api" — the server's route guard + not have names starting with "api" -- the server's route guard matches the /api PREFIX, so web/api.mjs 404'd as a bogus API route and the app died at module load with an empty
. The REST client module is client.mjs. Any future web file name gets this check. - Gotcha (2026-11-14, rewind aftermath): a session rewind erases my - memory of tool calls but NOT their effects — the server, files, and + memory of tool calls but NOT their effects -- the server, files, and databases keep them. After any rewind, external state is the truth: re-read it, and never assume authorship of found content (I once credited the GM with a GM-turn that pre-rewind me had written). - Open tails (handoff, 2026-11-14, evening): **housekeeper.md review - is still the next creative step** — the GM's dry-run verdict was + is still the next creative step** -- the GM's dry-run verdict was "works, but not as expected; I never saw the prompt"; iterate with the replay button (nothing applied). **Status discipline: RESOLVED** by the agenda (QUESTIONS #32/#33). **Verbosity**: completions lengthened 103 -> 668 chars across session one; the per-turn reminder - is the countermeasure now built — the next live session is the test. + is the countermeasure now built -- the next live session is the test. The first real housekeeping pass (Irene's session) is the memory test's start, and the op's one-time act (bootstrap claim + - hand-stamping Irene's owner) rides before it (HANDOFF step 1). **Replay-after-housekeeping is - dead** (found in the SPA round, unfixed, server-side): housekeeping - auto-restarts the next session, so the replay default (latest - session) points at the fresh empty session and 409s — the closed - session needs naming. GM's call where the default should point. -- Active work: NONE — the SPA module refactor + terminology round is - complete, verified, and committed (2026-11-14): web/ is flat ES - modules (app, router, client, state, chrome, log, widgets, - transcript, view-* per view), the three hand-copied patterns became - factories (armedButton, paneEditor, modelsBox), views own their - state and teardown via enter/leave, the mock smoke lives in test/, - and DICTIONARY.md rules the terms — four renames swept clean - through the machinery (paper->status, window->session, wrap-> - housekeeping, context window->contwin), one clerk normalizer - migrates old dbs/dumps, no dual-accepts (GM: no legacy hauling). - The multiuser + agenda + reminder round is committed through - 89a2c16 (the amended reminder commit — abf8ef3 is its dead - pre-amend twin); the first real story is being played. Working - lessons from the build: the newest GM + hand-stamping Irene's owner) rides before it (HANDOFF step 2). + **Replay-after-housekeeping is dead** (found in the SPA round) -- + RESOLVED BY PLAN (2026-11-15): the dormant-session rework kills + the autorestart, and during dormancy the latest log IS the + just-closed session; the replay default never needed to move. +- Active work: the entity round, the variant round, and the + dormant-session rework are BUILT (2026-11-15, uncommitted, awaiting + the GM's eye). **The rework is now SMOKE-PROVEN end to end + (2026-11-15, evening): smoke 105/105, restart-check, check-reminder, + check-repo, and a full browser pass, all green; test state cleaned. + The Irene hand-migration is DONE the same sitting (fork proven end + to end, then real her mutated identically, reads green, zero writes + to her log -- see HANDOFF "Where we are"). Next: the op's one-time + first start under multiuser (HANDOFF step 2), then the first real + housekeeping pass (step 3).** Plan of record: + HANDOFF ("The dormant-session rework"); status: HANDOFF ("Where we + are"). En-route fix flagged to the GM: the roll retirement had + missed bundle.mjs's tool list; + removed. Working lessons from the build: the mock model's script + keys on assistant replies counted CUMULATIVELY across the log + (gated: turns before the first exchange don't count; the conflict + heal is a reply like any other) -- the first build reset the count + on every GM turn, so every direct reply landed on script position 0; + a carried history shifts a session's first script position, and the + smoke knows the exact tail (a hand-driven browser run with a + different tail lands elsewhere in the script -- that is the script, + not a bug). The clerk's --json now means stdout is JSON only + (renderAll used to print view paths under --json; create started + applying memory.json in-process and the route's JSON.parse choked); + every server->clerk spawn passes --quiet. The lint + (check-repo) reads the git INDEX, so a renamed tracked file must be + staged or the lint dies on the ghost; the README layout section + lives inside a code fence with its own deeper indent -- byte-dump, + the read display lies about depth there too. Deferred to ROADMAP: + GM-input expansion, save-as-package beyond drafts, the carryover + editor. The variant round: roll + retired as a model tool, chance in play is variant literature + (four ruled turn shapes), the loop picks one candidate at random + on reception (crypto, pre-append strict parse, 422 on malformed), + the pick note is the metric, every model-facing surface renders + the picked variant only, thinking never crosses the story wire, + boot resolves a crash between message and pick note. The entity + round: /story = the whole deliverable (literature only, all + sessions, no doubles -- the reading surface the observables + promised); /table = the play view's session projection (the + renamed old /story); the carry = the slidwin (contiguous + raw tail, whole exchanges, smart cutoff counting only prose the + model sees vs 96KB; the housekeeper reads session-minus-tail, so + an event files exactly when it drops out of the carry; the + boundary is invisible to the model, dimmed behind a divider for + the GM). Working lessons: a scripted mock keys its branches on + the count of assistant MESSAGES, not turns (the roll->variants + renumber bit once); README layout lines wrap at 17 spaces of + indent for continuations -- byte-dump before editing, the read + display lies about depth. Smoke 79/79, restart + reminder + + repo checks green. Unexercised live: the pick, the carry at a + real session boundary, the story as reading surface, coin-flip + personality. (Prior rounds, committed: SPA module refactor + + terminology through c51d310; multiuser + agenda + reminder through + 89a2c16 -- abf8ef3 is its dead pre-amend twin.) +- Format house rules, same sitting (2026-11-15, GM, from their + operator's queue): ASCII bytes in every tracked file (the ENCODING + is the problem, never the visual -- rendered glyphs travel + ASCII-safe: the middle dot is \u00b7 in JS strings, entities in + HTML; em dash is --, ellipsis is ...) and no text-mutating CSS: + rendered text must match authored text (no text-transform, no + generated content: incl. ::before/::after, no caps font variants -- + inline styles included). Both enforced by + test/check-repo.mjs; the repo swept clean (43 files), style.css + de-capped (source-case labels now -- waits match source text), the + setup editor's dirty marker authored into the DOM. The audit pass + (same day, GM-ordered) grew the check to NINE rules -- read its + header for the list; the found-and-fixed: four html comments in + prose files (la-caramba's backdrop rode one into every bundle), + README's "256K-class window", ROADMAP's "rides the prelude". The + lint's carve-outs are rulings, not sloppiness: historical records + keep their day's words, gm.md is GM-private, contwin glosses may + name the context window, and the clerk's paper->status migration + code is the ruled one-time + exception (which is why the term check scopes to living prose, not + code). + gm.md note: the sweep once touched packages/boutique/gm.md's + typography; moot since the GM emptied the package. +- Working lessons (prior builds): the newest GM turn must keep its / blocks (that ride is the status/agenda blocks' only channel from session two on); any new path that reads a run file for sending goes through expandVars (turn0() initially @@ -192,21 +258,24 @@ memory the agent owes itself across sessions. against the users table, never swept on disk; same-verb delta blocks combine into one apply, never execute in sequence. Rename-mechanics lesson (2026-11-14): scripted renames with split/join replace EVERY - occurrence — renaming the clerk's `paper` case to `status` and then + occurrence -- renaming the clerk's `paper` case to `status` and then `status` to `report` ate both, leaving no `status` dispatch; the smoke caught it on the next run. Order rename pairs so a new name is never a later pair's old name, and grep dispatch tables after. CLI note: the run summary is `report` now; `status` is the tier verb. - Postulates (GM, 2026-11-14): female PCs only (names are gendered; - QUESTIONS #2 closed by it). Boutique is dormant AND defunct — fine - broken until its design round; do not fix or design it unprompted, - and do not keep it aligned: term sweeps, renames, and audits skip - it entirely (2026-11-14, GM — its gm.md "paper" wording stays - as-is; don't flag it again). + QUESTIONS #2 closed by it). Boutique: the GM emptied it wholesale + (2026-11-15 -- it kept being a noisy problem); placeholder files + only, no content anywhere. Still do not fix or design it + unprompted -- its design round is where content returns. The + skip-it carve-outs are retired with the content: the lint covers + packages/ like any living prose, and the clerk's completeness + check now requires non-empty files (an emptied package lists + honestly as MISSING, never "ok"). - Identity model (2026-11-14): @PC/@Package are identity sigils (settings pc/name); $TOKENs are prompt-declared template vars - (setup inputs -> settings vars). Run ids are anonymous hex — + (setup inputs -> settings vars). Run ids are anonymous hex -- display is always "Package / PC". Any new prompt-side file reader goes through expandVars. - Exposure rule (GM, 2026-11-14): everything that enters the bundle @@ -215,27 +284,27 @@ memory the agent owes itself across sessions. an internal agent (housekeeper.md) is never exposed. Don't hide bundle parts, don't surface agent prompts. - Dates principle (revised 2026-11-14, GM): **no model-facing surface - renders a date** — ring views, search results, everything the + renders a date** -- ring views, search results, everything the player-model sees. Memory doesn't timestamp; when something happened lives in the entry prose. Internal stamps (created/last_touched) are real, mechanical (LRU/overflow/sinking), never rendered; GM-facing - CLI keeps them. The manifest and seed carry no date keys at all — + CLI keeps them. The manifest and seed carry no date keys at all -- the housekeeper's date duty is gone (it couldn't ask, and the touch stamp was rewriting story time). Supersedes the story-date ruling below. - Watch: the "never open with world narration" rule was cut as - superfluous by the GM — reinstate only if testing shows drift. + superfluous by the GM -- reinstate only if testing shows drift. - Defaults taken without asking (2026-11-13): #21 session-open refuses over an unhousekept session with explicit override; #16 housekeeper defaults to the player's model; #10 tool-call pairing validation goes into the server loop. -- Open decisions live in QUESTIONS.md — read it first. Remaining: #19c - (seed voice, GM may revisit — non-blocking, seed editable until first +- Open decisions live in QUESTIONS.md -- read it first. Remaining: #19c + (seed voice, GM may revisit -- non-blocking, seed editable until first session-open) and #16 (which model the housekeeper defaults to). Resolved lately: #19a keep "Rell"; #20 system.md split (substrate facts / per-project guards / per-run craft, hard limits in the craft copy); #21 unhousekept-session guard (refuse with override). - The tree is usually dirty by design; git status is not an alarm. - Edit-tool lesson repeated (2026-11-13): nested-list indentation in - HANDOFF failed twice from memory — always transcribe oldString from a + HANDOFF failed twice from memory -- always transcribe oldString from a fresh read, counting spaces. diff --git a/DICTIONARY.md b/DICTIONARY.md index de29efd..55b0d55 100644 --- a/DICTIONARY.md +++ b/DICTIONARY.md @@ -1,4 +1,4 @@ -# Dictionary — the terms of art +# Dictionary -- the terms of art The source of truth for what things are called. When prose, UI, or code drifts from these names, the fix is to align to this file; when @@ -8,183 +8,226 @@ WORDS. ## The people and the models -- **the GM** — the human running the world: every NPC, every +- **the GM** -- the human running the world: every NPC, every consequence, all retcons. Runs on organic memory; the model's canon files are the prosthesis. Always a human, never a model. -- **the player** — the player-model: the LLM playing the one PC. +- **the player** -- the player-model: the LLM playing the one PC. The two parties who play are the GM and the player (2026-11-14, - GM) — and the player is always the model: humans are never "the + GM) -- and the player is always the model: humans are never "the player" (QUESTIONS #28); a human in the app is a GM (of their own runs), a spectator, or the op. -- **the PC** — the one character the player-model plays. Female by +- **the PC** -- the one character the player-model plays. Female by postulate (README Scope); the shared prompts say "she" throughout. -- **the housekeeper** — a fresh model invocation after each session, +- **the housekeeper** -- a fresh model invocation after each session, reading the transcript and the rings; emits a manifest. Judgment, never clerical work; never plays, never edits files. Its prompt (housekeeper.md) is substrate-internal and never exposed. -- **the clerk** — `tool/memory.mjs`: validates, applies, renders, +- **the clerk** -- `tool/memory.mjs`: validates, applies, renders, dumps. Fails loudly, never drifts silently. Code, never a model. -- **the op** — the superuser of a deployment: mints and revokes +- **the op** -- the superuser of a deployment: mints and revokes invites and users; recovery is filesystem access. The whole of admin. ## The story state -- **the deployment** — one clone plus `server.json`, `state/`, and +- **the deployment** -- one clone plus `server.json`, `state/`, and `runs/` (all gitignored): the unit of sharing. Invited users need neither the key nor a clone. -- **the package** — a preset: authored content only, no state. +- **the package** -- a preset: authored content only, no state. System packages ship with the repo; user packages are saved runs, - published to the deployment (gm.md included — saving is the act of - publishing). Read exactly once per run, ever — at create. -- **the run** — one story: the package copied wholesale into + published to the deployment (gm.md included -- saving is the act of + publishing). Read exactly once per run, ever -- at create. +- **the run** -- one story: the package copied wholesale into `runs//` at create; from then the run directory is the only truth. The id is anonymous hex and carries no facts; the visible name is "Package / PC". The run is the PROCESS that delivers; the story is the DELIVERABLE it exists to produce. In anything mechanical it is always "the run". -- **the story** — the emerging deliverable: the narrative a run - exists to deliver. Prose may speak of the story; mechanics - always say run. -- **draft** — a run with no sessions yet: created, never started. - Editable in setup, deletable from the SPA; a played run refuses - deletion server-side. -- **the session** — one play period between housekeeping passes: - opens with the bundle assembly, plays by turns, ends with - housekeeping (which applies memories and auto-opens the next). - Renamed from "window" — see Ruled renames. Its transcript log is - `sessions/.jsonl`; ordinals in prose: "session one", "her - next session". -- **the turn** — one exchange: a GM turn (user role), then the +- **the story** -- the deliverable: the narrative a run exists to + produce. Rendered (`/api/runs//story`) from non-dropped + literature turns only -- OOC, tool calls, substrate verbs, + thinking, rings all out -- always spanning every session in order, + the opening to the last turn recorded, plus the dormant session's + current carryover. Load-bearing prose living inside OOC only is a + GM protocol violation, and the story enforces it by omission: the + hole shows. Prose may speak of the story; mechanics always say run. +- **draft** -- a run whose session one is dormant: created, never + started. Editable in setup, deletable from the SPA; a played run + refuses deletion server-side. +- **the session** -- one stretch of play inside one contwin: a + stateful entity, dormant -> live -> finished, owning its own bundle + (prompt copies), rings db, and carryover under `sessions//`. It + goes live at start (the bundle freezes), plays by turns in its own + `log.jsonl`, finishes at stop (the tail moves into the next dormant + session's carryover; housekeeping runs over what remains). No + contwin before live; a run's state is its latest session's. + Renamed from "window" -- see Ruled renames. Ordinals in prose: + "session one", "her next session". +- **the turn** -- one exchange: a GM turn (user role), then the player's turn (assistant role; tool calls may interleave between - beats). -- **the bundle** — the opening context of a session, assembled in - order: the system message trio (system.md → invariants.md → the - run's handbook), then the GM messages — backdrop, character, - ring-b, ring-a. Everything in it is inspectable read-only in the - SPA; agent prompts never enter it. -- **fresh** — a session over a never-started run: the seed applies - (lazily, once) and turn-0's `` block ingests at open. -- **the seed** — `seed.json`, the run's initial state (`entries` → - rings, `records` → files). Rides the run copy until the first - session-open applies it; freely editable until then; re-apply - refuses. -- **turn-0** — the opening beat file: the GM's zeroth turn, sent - once as the first GM message of the first session. The FILE is - turn-0; the MESSAGE, once sent, is "the opening beat". + beats). A player turn takes one of four shapes: literature, variant + literature, tool call, OOC message. +- **the bundle** -- the opening context of a session, assembled in + order: the system message trio (system.md -> invariants.md -> the + session's handbook copy), then the GM messages -- backdrop, + character, ring-b, ring-a. Session-specific: the craft files are + the session's own frozen copies (from the package for session one, + from the previous session afterwards, editable during dormancy). + Everything in it is inspectable read-only in the SPA; agent prompts + never enter it. +- **the carryover** -- every session's opening material, one format + (`carryover.jsonl`, raw log events). Session one's is authored in + the package: her opening, the events before the story's first live + GM turn. Session N+1's is the moved tail of session N -- contiguous + raw lines, whole exchanges, nothing filtered, cut at stop by the + smart visible-prose budget (96KB; invisible events ride at zero + cost). The move is at stop: each line exists in exactly one jsonl, + ever, no markers anywhere. Raw in storage, filtered on serve; + GM-editable during dormancy in principle (the editor is a later + task). At start: if it ends on a GM turn, that turn is sent + automatically as the first request; otherwise the table waits for + the GM. The housekeeper reads session N's log as it was left -- the + truncation is the bound -- so the rings never overlap the carried + prose. The mechanism's name is the slidwin. +- **the table** -- the GM's play surface: the open session curated + for play (`/api/runs//table`), what the model is working with + plus the meta the GM needs -- thinking never crosses the wire, + variant turns carry only the picked one. The table sees only the + open session: previous sessions' prose lives in the story. During + dormancy the play view shows the carryover the same way -- a pure + mirror of what the next contwin will hold. +- **memory.json** -- the package's session-0 manifest: her starting + memories as the mock housekeeping output of the non-existent + session zero (an all-insert manifest, housekeeper vocabulary, + reasons included). It applies once, at run creation, through the + standard apply path; afterwards it is inert provenance, read-only + in the run. Pre-story records are not its business -- those are + filed ahead of play with `file --gm`. ## Memory -- **the rings** — her salient memory, two tiers ordered by touch - (an LRU cache): **ring A** — important facts, cap 500; **ring B** — +- **the rings** -- her salient memory, two tiers ordered by touch + (an LRU cache): **ring A** -- important facts, cap 500; **ring B** -- the rest that passed the gate, cap 3000. Storage is rows; the views (`canon/ring-*.md`) are rendering. -- **touch** — a meaningful invocation during play (named, used, +- **touch** -- a meaningful invocation during play (named, used, clearly weighed); raises the entry. Mere adjacency doesn't count. -- **promotion / demotion** — the housekeeper's A↔B judgment, reason +- **promotion / demotion** -- the housekeeper's A<->B judgment, reason logged. Judgment, not a metric. -- **overflow** — mechanical and exact: A spills to B, B spills to +- **overflow** -- mechanical and exact: A spills to B, B spills to cold, oldest-touched first. Enforced by count, never by a model's arithmetic. -- **cold storage** — everything evicted or deleted. Beyond the +- **cold storage** -- everything evicted or deleted. Beyond the models' reach; GM-reachable via revive. Nothing is ever destroyed. -- **status** — descriptions of her immediate situation, admitted by +- **status** -- descriptions of her immediate situation, admitted by the three-part gate (non-normal, acute, turn-affecting). Rides every GM turn as the `` block; mutated by - ``/`` deltas; entirely hers — the housekeeper never - writes it. Renamed from "paper" — see Ruled renames. -- **the agenda** — her second self-kept block: intentions — what she - means to do — in a cap-5 recency queue. Rides as the `` + ``/`` deltas; entirely hers -- the housekeeper never + writes it. Renamed from "paper" -- see Ruled renames. +- **the agenda** -- her second self-kept block: intentions -- what she + means to do -- in a cap-5 recency queue. Rides as the `` block, mutated by ``/`` (drops by 0-based index); disposable by design. The seam with the status: how she is vs what she means to do. -- **records** — her files: the card index, the ledger, whatever she +- **records** -- her files: the card index, the ledger, whatever she keeps. Diegetic and per-run (the settings gate); narrow query, hard cap 10 in the tool; a miss is a miss. Filed at her desk by the player; the housekeeper only archives. -- **the backdrop** — the world as everyone in it knows it: public +- **the backdrop** -- the world as everyone in it knows it: public knowledge. Never memory, never decays, always in the bundle. -- **identity** — `character.md`, the sheet: concept, drives, skills, +- **identity** -- `character.md`, the sheet: concept, drives, skills, voice. The GM's to edit; the housekeeper proposes via open questions; blanks are the player's to invent. -- **the manifest** — the housekeeper's whole output: JSON semantic +- **the manifest** -- the housekeeper's whole output: JSON semantic operations (insert, touch, promote, demote, reword, delete, archive; plus summary, inventions, open questions). Validated and applied by the clerk; a rejected manifest changes nothing and says why. -- **housekeeping** — the session-close ritual: a fresh housekeeper - call over the transcript + rendered rings, the manifest, the - apply, the log, the autorestart of the next session. The only - word for it (2026-11-14, GM): the old shorthand "the wrap" is - retired. -- **the log** — `log/.md`, one per pass: what the - housekeeper declared, cross-checked against the dump diff. The - `events` table is the journal underneath; both are write-only for +- **housekeeping** -- the pass that turns a finished session's log + into the next session's rings: a fresh housekeeper call over the + transcript + rendered rings, the manifest, the apply into the + dormant session's db (rebased from the finished session's copy each + run). Re-enterable during dormancy: every run re-copies and + re-applies, and hand edits made in between are overwritten. The + dry-run replay changes nothing. The only word for it (2026-11-14, + GM): the old shorthand "the wrap" is retired. +- **the log** -- the housekeeping record, `sessions//log/.md`: + what the housekeeper declared, cross-checked against the dump diff. + The `events` table is the journal underneath; both are write-only for every model. ## Channels and syntax -- **IC / OOC** — in-character vs out-of-character. OOC is a line +- **IC / OOC** -- in-character vs out-of-character. OOC is a line opening with `(`, closing paren optional; any opening `` line is substrate traffic and always OOC. Unknown tags are reported to the GM. -- **speech / narration** — plain text is spoken aloud; `*italics*` +- **speech / narration** -- plain text is spoken aloud; `*italics*` carry actions, descriptions, thoughts, interiority. -- **sigils** — `@PC` (her name) and `@Package` (the display name): +- **sigils** -- `@PC` (her name) and `@Package` (the display name): identity substitution resolved from the run's settings. Any other - `@`-word is the author's own text — `@` syntax is not owned here. -- **$TOKENs / vars** — template variables the prompts declare + `@`-word is the author's own text -- `@` syntax is not owned here. +- **$TOKENs / vars** -- template variables the prompts declare themselves; setup collects them; the run's `settings.vars` holds the answers. -- **deltas** — the in-band mutations: ``/`` on the +- **deltas** -- the in-band mutations: ``/`` on the status, ``/`` on the agenda. Same-verb blocks combine into one apply; misses return as a conflict. -- **conflict** — the self-heal message: a `` block sent as +- **conflict** -- the self-heal message: a `` block sent as its own GM-side message, clean of prose; the model adjusts in the same exchange. Capped at 3 heals per turn. -- **ask_gm** — the player's tool for points of order, canon +- **ask_gm** -- the player's tool for points of order, canon questions, proposals. Pauses the turn mid-loop; the answer is authoritative and never elides from the context. -- **roll** — the dice tool: a uniform random pick among equal-weight - options; the model receives `picked: