# 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, observables), ROADMAP (decisions, steal list, substrate plan), QUESTIONS (the decision queue), HANDOFF (working state). This file is memory the agent owes itself across sessions. ## Working with the GM - **Their LLM tokens are free (2026-11-14): never economise on usage.** Run live tests freely; don't hesitate over spend or trim prompts, 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 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. - **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 creative content is theirs. GM-private files (gm.md) are never edited and only flagged. ## Writing prompt-bound text - **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 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 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 substrate code. Generated views carry their do-not-edit warning in the clerk, not in the output. The views are pure memory: run state (records availability) rides the phase-3 housekeeping invocation, not the ring headers. - Output-style counterexamples prime what they prohibit (far context can't suppress, only prime). State tests and positives instead. Input-side counterexamples (routing examples, "Refuse" cases) are safe and stay. ## Environment gotchas - 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 — 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 — harmless, filtered in bridge context. - Session logs, dumps, and views are generated; never hand-edit them. ## State pointers - **The multiuser server is built and mock-proven (2026-11-14).** Design: ROADMAP "The multiuser server" + QUESTIONS #22-31 (all resolved). Identity = bearer token, no usernames/passwords/IDPs; 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 — 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: 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 point). The agenda (QUESTIONS #32): second player paper, ``/ `` deltas, cap-5 recency queue; Irene's events journal migrated (CHECK widened) — her db is agenda-ready. - 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 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 surface is the "Later" list (turn surgery, memory browser, context inspector, book export, service step) plus whatever the first real story surfaces. Server entry: `node server/main.mjs [--mock]`; SPA at http://127.0.0.1:7350/; POST bodies from PowerShell need 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 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 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. - Gotcha (2026-11-14, GM): **no JS alert()/confirm()/prompt() in the 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 PAPER", not "her paper"); clickable divs are invisible to the 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") snapshots BEFORE the fetches land and looks like a rendering bug; wait for text that only exists post-render (a card name, the window-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, 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. - Gotcha (2026-11-14, rewind aftermath): a session rewind erases my 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): **housekeeper.md review is 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**: the paper has taken up thread-tracking; the GM wants the admission-gate section in invariants.md tightened. **Verbosity**: completions lengthened 103 -> 668 chars across window one; the GM is thinking about it. The first real wrap (Irene's window) is the memory test's start. - Active work: NONE — the GM surface rework is complete and live-proven; the first real story is being played. Working lessons from the build: the newest GM turn must keep its / blocks (that ride is the paper's only channel from window two on); any new path that reads a run file for sending goes through expandVars (turn0() initially didn't); the transcript must surface failed window-open notes (ingest), not print success unconditionally; after changing a default, re-run the primary path (the start button broke for the GM because post-redesign tests never pressed it). - 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. - 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 — 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 is inspectable read-only in the SPA (system.md, invariants.md, the assembled system message in the bundle card); anything that prompts 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 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 — 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. - Defaults taken without asking (2026-11-13): #21 window-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 window-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 fresh read, counting spaces.