gm surface: home flow, run identity, full-assembly editor, notepad, wrap replay; sigils and dateless rings

This commit is contained in:
2026-11-14 09:04:13 +00:00
parent ba72d2ed1f
commit 9f85adc3c6
20 changed files with 2014 additions and 433 deletions
+73 -28
View File
@@ -50,6 +50,11 @@ 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.
## Runs
Two interleaved stories calibrate the memory system against itself:
@@ -62,14 +67,20 @@ Two interleaved stories calibrate the memory system against itself:
| 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 dormant — a stub that never reached its design step — until
its drafting session.
Boutique is dormant and defunct — a stub that never reached its design
step — broken is fine until its drafting session gives it design and
proper content.
`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 creates the run, opens the
window, and sends turn-0 as the first GM turn in one action.
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.
@@ -97,10 +108,15 @@ its drafting session.
freely editable; deleting it from the run is the opt-out. Everything
is journaled under window `seed`. Her opening paper does not seed —
it rides turn-0's `<status>` block.
5. **Create the run** — `node tool/memory.mjs create <story> <run-id>`:
the package is copied wholesale into `runs/<run-id>/` — the craft
prompts (`handbook.md`, `housekeeper.md`) ride along, battery
included — and the db is initialized. From then on the run directory is the
5. **Create the run** — `node tool/memory.mjs create <story> <pc-name>`:
the package is copied wholesale into `runs/<id>/` — the craft
prompt (`handbook.md`) rides along, battery
included — and the db is initialized. 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 in the
run is editable at any time. The discipline not to break a running
narrative sits with the GM.
@@ -118,14 +134,24 @@ its drafting session.
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. On a new game, `turn-0.md` is the opening beat, before
the GM's first line, and its trailing `<status>` block is ingested
as her opening paper. In play the current paper rides every GM turn
recency slot. On a new game, `turn-0.md` is the opening beat: its
trailing `<status>` block is ingested as her opening paper at
window-open, and the beat itself is sent as the first GM turn when
play starts — a separate message through the turn path, not part of
the bundle. In play the current paper rides every GM turn
the same way (the per-turn ride lands with the server). (On a tight
window, ring B is optional loading — ring A is the spine.) `$NAME`
tokens in any bundle file are substituted from the run's
`settings.json` `vars` before sending. The server assembles and
logs all of this automatically (until it lands: manual relay).
window, 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`; `$TOKEN`s 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 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. Entries carry stable ids (`[e17]`);
@@ -143,7 +169,9 @@ its drafting session.
tool; the GM's own OOC stays `(...)` in their turns.
4. **Close a window:** just stop. No in-band ritual; the player-model has no
end-of-session duties.
5. **Housekeep (fresh model, new context):** send `housekeeper.md`, then
5. **Housekeep (fresh model, new context):** send `housekeeper.md`
(the repo-fed housekeeping prompt — substrate-internal, never
copied into a run), then
the run's `backdrop.md` and `character.md`, then both ring views, then
the session transcript — pasted, or the latest
`runs/<id>/sessions/*.jsonl` when playing through the server (the
@@ -201,9 +229,15 @@ mechanical — `LIMIT 10` in the tool, not a polite request in the prompt.
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*: its date
updates and it rises. Untouched memories sink toward the tail. Mere
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
@@ -215,7 +249,7 @@ mechanical — `LIMIT 10` in the tool, not a polite request in the prompt.
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, dates, caps, overflow,
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
@@ -364,13 +398,19 @@ invariants.md the substrate tier — the mechanical contracts (syntax
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 shipped-default housekeeping prompt — copied per run
housekeeper.md the wrap prompt — repo-fed at wrap, never copied
into a run, never user-facing: it prompts the
internal housekeeper agent, never the bundle
(system.md and invariants.md are bundle parts and
are inspectable read-only in the SPA)
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
AGENTS.md the agent's own working notes — style lessons, gotchas,
state pointers
config.json the default package
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, init, seed, render,
apply, insert, delete, revive, file, amend, discard,
@@ -385,7 +425,7 @@ server/ the substrate: a zero-dependency node:http service
open windows from the session logs on start
provider.mjs the endpoint client (chat completions, models listing)
bundle.mjs run context: prompt assembly (the trio system message,
the GM-message bundle, $NAME vars), the tool manifest
the GM-message bundle, @ sigils + $ vars), the tool manifest
and its clerk dispatch
session.mjs window lifecycle (open guards, lazy seed + turn-0
ingestion), the append-only typed jsonl, the view
@@ -397,24 +437,29 @@ server/ the substrate: a zero-dependency node:http service
with labeled thinking, run-state injection, the
housekeeper call, manifest save, apply, autorestart;
rejections hold and surface why
web/ the SPA — no build, vanilla ES modules, served at /
index.html the layout: transcript, status pane, context meter,
GM input, ask modal
app.mjs the client: register parsing (speech / narration /
OOC), bundle cards, turns, housekeeping polling
web/ the SPA — no build, vanilla ES modules, path-routed
index.html the shell: home (runs), new (packages), setup (editor),
play (transcript, status pane, context meter, GM input,
ask modal) — the server serves it for any extensionless
path
app.mjs the client: routing, the setup editor, register parsing
(speech / narration / OOC), bundle cards, turns,
housekeeping polling
style.css dark, quiet, fiction-first
server.example.json copy to server.json (gitignored) — bind, endpoint +
key env, models, contextWindow, params passthrough
db/
schema.sql entries, records, paper, events journal (shared)
runs/ per-deployment run state (gitignored) — one dir per run:
the copied package, the craft prompts (handbook.md,
housekeeper.md), run.json (lineage,
runs/ per-deployment run state (gitignored) — one anonymous
id per run (carries no facts): the copied package,
the craft prompt (handbook.md),
run.json (lineage,
model override), db/, canon/ (rendered views), dumps/,
log/, manifests/, sessions/
packages/ presets — authored content only, never state
la-caramba/ backdrop.md, turn-0.md (new-game opener), character.md,
seed.json, settings.json, gm.md (GM-private — never in
seed.json, settings.json, gm.md (the GM's notepad —
seeded per run, always editable in the SPA, never in
any bundle)
boutique/ dormant stub, same shape — records enabled (the
shopkeep's PC) once designed