# Handoff — working state A living document: trim items as they complete. Durable decisions live in `README.md` (architecture, protocol, observables), `ROADMAP.md` (SOTA review, steals, extension points), and the prompts (`system.md`, `housekeeper.md`). Unanswered questions live in `QUESTIONS.md`, the decision queue; the agent's own working notes live in `AGENTS.md`. This file is the "where did we leave off" map. ## Where we are - All machinery is built and mock-tested. **Nothing has been played yet.** No real session, no real housekeeping. - Live endpoint probed and healthy (glm-5.3 via llm.exan.tech): all four roles accepted; multiple and mid-stream system messages honored; full tool round-trip; no assistant-prefill semantics; `reasoning_content` round-trips safely in input. The bridge loop itself is still mock-only. - The run is renamed `prisoners` → `la-caramba` (config default included); the branch is renamed `master` → `mistress`; the runs directory is renamed to `packages/`. - `system.md` opens with an input-validation section (IC/OOC buckets, injection guards). The loop (today in the bridge) tags every tool with its output channel ([IC]/[OOC]), sends the opening bundle as per-role messages — `system.md` the sole system message; backdrop, character, ring-b, ring-a, then `turn-0.md` on a new game, all as GM messages — and logs the whole bundle into the session transcript. (Status left the bundle: the paper rides every GM turn as a `` block once the server lands.) **The bridge is retired by decision (2026-11-13) before ever going live**: REST + SPA is the MVP; the loop is extracted into the server, the file is deleted at server mock-parity, the `--mock` discipline survives as a server mode. - Prompt-side settled (2026-11-13): the content stance is the GM's final form — erotica is not a special bucket (makes sense, isn't the point, no pressure, never play anticipated leads to please the GM); the adjudication philosophy is that the test is a review, not a number (README). ROADMAP gained steal #11 (prompt re-injection) and the projection principle (context is a projection, not a ledger). - Red pen largely done (2026-11-13): new PC (shop girl, conviction by association with a burnt decker), ten-state voice corpus (steal #1 done), gm notes recast (the ship-AI La Caramba, Missy, Pinky; pink ice as licensed corpo firewall; mechanical feeders). Name call resolved: keep "Rell". Optional seed voice touch-up may be revisited (QUESTIONS #19c, non-blocking). The seed is authored but NOT applied — it rides the run copy at creation and applies lazily at the first window-open. - **Phase 0 (clerk side) DONE (2026-11-13):** the paper model is live in `memory.mjs` — description-set schema (`paper` table), `paper` / `paper-set` / `paper-apply` / `paper-ingest` verbs (exact-match ``/`` deltas, non-blocking, `` reporting, prelude ingestion), amend/discard journal prior content (the saga rule), seed rejects a status key loudly. Smoke-tested end to end (delta misses, no-op re-adds, prelude ingest, dump/restore round-trip, seed apply); both dbs reset clean. Loop-side items (status tools gone from the tool list, per-turn `` ride, thinking-strip, usage tracking) land with the server. - **Phase 1 (preset/run split) DONE (2026-11-13):** packages are authored-only (backdrop, turn-0, character, seed, settings, gm — all six state dirs removed); `create ` copies the package wholesale into `runs//` (shared prompts included, run.json lineage + optional model override) and inits state; `--run` addresses runs; `packages`/`runs` list; `bridge.json` → `server.json` (bind, endpoint, models, contextWindow, params; example committed, key carried over, gitignored); `config.json` now names the default package. Smoke-tested: create → seed → turn-0 ingest → delta apply → status, re-seed refuses, smoke run deleted. `prelude.md` renamed `turn-0.md` by the GM (comment dropped); clerk and docs follow. - Boutique: dormant — a stub that never reached its design step (concept brief in `packages/boutique/gm.md`). - No runs exist in this deployment yet; both packages render clean as presets (`packages` lists them). - **Substrate design round complete (2026-11-13)** — rulings recorded in ROADMAP ("The harness"): the stated goal (a usable RP harness; clone-and-run or invited instance, key on the backend, no secrets in the repo), repo ships code + authored content only (state is per-deployment), packages are presets copied wholesale into `runs//` at creation (editable everything, discipline on the GM), lazy seed at first window-open, per-run model selection with an upstream `/models` listing, audit as per-wrap dump snapshots inside the run (commit-per-wrap retired), zero-dep stack (QUESTIONS #4, #7 resolved). ## Immediate next steps, in order 1. system.md split extraction (ruled 2026-11-13, ROADMAP "The harness"): substrate facts into `invariants.md`, security guards into `guards.md` (both repo-fed at assembly), the per-run craft copy keeps everything else, hard limits included. Drafts get the GM's red pen; must land before the first run is created so no run copies what the substrate feeds. (Prose deferred by the GM — not blocking the server build.) 2. **Server (phase 2):** loop core from the bridge, `node:http` REST spine per the ROADMAP sketch, per-run session machine with ask_gm pause/resume, view renderer, boot-rebuild, lazy seed + turn-0 ingestion orchestrated at window-open (with the #21 guard), thinking-strip, usage tracking, mock, tool-pairing validation. The API is the operable surface — testable standalone, on request, while the SPA waits. 3. **Housekeeping job (phase 3):** manual trigger, transcript with labeled thinking, auto-apply, autorestart on success, per-wrap dump snapshots. 4. **SPA (phase 4):** downstream, per the resolved v1 scope. 5. First la-caramba run: `create la-caramba ` (seed rides along, editable until the first window-open), then window one — through the API or the SPA, whichever is ready when the GM is. The live-endpoint caution transfers intact: the first real session is the loop's first live integration test (GLM tool-call edge cases; no `strict` mode, so clerk-side validation is the safety net). Housekeeping after the window runs through the job (phase 3), not the manual paste. ## Working agreements with the GM - **"I draft, you cut"** for all creative content. - Character and world work is done together, unhurried ("we'll get there together"). - The GM runs on organic memory and takes no notes — the system is the prosthesis. The GM's lever is narrative, never mechanical. - The GM answers point-by-point and expects pushback in both directions. - `gm.md` files are GM-private: never pasted to any model. - Rolls (`pick`) are legitimate at drafting time; rolled values are proposals with the alternates listed for easy swaps. - The play is uncensored; nothing lives in a special bucket — it makes sense, it isn't the point, no pressure (no playing to please the GM). Hard limits in `system.md` are absolute. ## Boutique creative brief Now recorded in `packages/boutique/gm.md` (era, specialty, cast, and seeding are open questions for the drafting session with the GM). ## Environment gotchas (learned the hard way) - The portable shell scanner is picky: **plain ASCII only in shell command strings.** Em-dashes in commit messages, here-strings, and `< NUL` redirection have all been rejected. For multi-line stdin tests, pipe an array of strings into node. - `node:sqlite` prints an ExperimentalWarning on every invocation — harmless; the clerk filters it in bridge context. - `server.json` (gitignored) holds the real key; it mirrors opencode's `dv` provider (config at `~/.config/opencode/opencode.jsonc`, auth at `~/.local/share/opencode/auth.json`). - Resetting a run: `Remove-Item packages//db/memory.db` then `init`. `--force` flags are only for disposable pre-story states. - Sessions log to `packages//sessions/.jsonl` — housekeeping's transcript, and the future watcher agent's food (see ROADMAP). - The `--mock` mode has caught two real bugs already (dump column rename, readline line-loss). Run it before any live first-use. ## Not yet exercised (expect first-use friction) - The loop-side phase-0 surface: `` blocks riding GM turns, thinking-strip, usage tracking. (The clerk side — delta apply, `` reporting, prelude ingestion, prior-content journaling — is CLI-smoke-tested but never yet exercised in flow.) - The bridge loop against the live API (mock only so far; the endpoint itself is probed — see "Where we are"). - A real housekeeping invocation with a real model's manifest. - `seed` on a real (reviewed) seed file, applied lazily at a run's first window-open. - Real-data `dump`/`restore` and the snapshot-diff review flow. - The in-flow missed-update prediction (ROADMAP, system-1 entry) — becomes measurable with the first real session.