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

This commit is contained in:
2026-11-16 21:32:02 +00:00
parent 193dc336be
commit 894737fcf3
30 changed files with 2193 additions and 518 deletions
+129 -37
View File
@@ -170,10 +170,12 @@ consumes into the log, in one action.
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 applies once,
at run creation, through the standard apply path; afterwards it is
inert provenance, read-only in the run. Pre-existing records are
not its business -- file those ahead of play with `file --gm`.
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 package is copied into `runs/<id>/` -- the craft prompt
(`handbook.md`) rides along, battery included -- landing where it
@@ -213,8 +215,9 @@ consumes into the log, in one action.
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 current status rides every GM turn
the same way (the per-turn ride lands with the server). (On a tight
In play the current status rides every in-character GM turn
the same way (the per-turn ride lands with the server; an OOC GM
turn carries none). (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
@@ -232,21 +235,46 @@ consumes into the log, in one action.
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]`);
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
travels in-band: the current `<status>` block rides every GM turn,
and the player mutates it with `<lost>`/`<gained>` tags in its own
turns (the clerk applies the deltas -- same-verb blocks combine into
one apply -- and misses go back as a `<conflict>` turn of their own:
clean of prose, read it and adjust; the model heals in the same
exchange). The agenda rides alongside: `<agenda>` on every GM turn,
`<add>`/`<drop>` deltas in the player's turns -- drops cite the
indexes it was shown. A player turn takes one of four shapes --
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 view strips
every copy and stamps the newest 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 evicts from the bottom silently (ruled a
feature: immersive, human-like, fun chaos -- silent to her, the
note shows the GM what sank). GM prose goes pure: no blocks ride
any turn, old logs' composited rides strip (they were never GM
words), and the GM's pane/CLI sets are model-invisible -- the
compositing that once showed them was a side-effect, not a
purpose; the GM's lever is narrative. 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. 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 deltas, one picked at random on
reception -- only the picked one's deltas apply, and the unpicked
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 for the GM (`--gm`
@@ -299,8 +327,8 @@ Memory is **seven tiers**:
|---|---|---|---|
| **backdrop** | the world as everyone knows it -- public knowledge, the general setting; never memory, never forgotten | always | GM, rarely (retcons) |
| **identity** | the character sheet -- 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 | every GM turn, as its `<status>` block | **the player** (`<lost>`/`<gained>` deltas in its turns); GM override out-of-band |
| **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 | every GM turn, as its `<agenda>` block | **the player** (`<add>`/`<drop>` deltas in its turns, drops by index); GM override out-of-band |
| **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 newest of her whole-list `<status>` blocks | **the player** (whole-list `<status>` block in its turns; absent = unchanged); GM override out-of-band, model-invisible |
| **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 newest of her whole-list `<agenda>` blocks | **the player** (whole-list `<agenda>` block in its turns; over-cap evicts silently); GM override out-of-band, model-invisible |
| **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 `archive`s |
| **cold** | forgotten or vetoed | never -- not even queryable | GM only (`revive`) |
@@ -471,7 +499,8 @@ 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, the current status rides every GM turn).
status blocks elide, the current status rides every in-character
GM turn).
Tool-call pairing is validated before every call. The tool list is
the capability surface: ask_gm always; records only when the run's
gate allows. Chance in play is not a tool: she answers with **variant
@@ -492,7 +521,13 @@ 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); **the table**
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
@@ -506,11 +541,24 @@ reached mock-parity (2026-11-14).
Config: copy `server.example.json` to `server.json` (gitignored) -- any
OpenAI-compatible endpoint; put the key in the endpoint's `apiKey`
field or name an env var via `apiKeyEnv`; `models` names the player
and housekeeper defaults, `contwin` (the context window; the old
and housekeeper defaults (the op's explicit pick -- it beats the
registry's discovered default), `contwin` (the context window; the old
`contextWindow` key still accepted) drives the context meter,
`params` is generation-passthrough; a run may carry a model override
in `run.json`. `--mock` runs a scripted fake model that proves the
loop without a key. The SPA is the server plus a fiction-first UI, a
`params` holds the deployment-default sampling knobs per role
(temperature, top_p, top_k, repetition_penalty, max_tokens) -- a
run carries its own overrides for models and knobs in `run.json`,
merged over the deployment layer, sent only when set. The knob UX
(web/knobs.mjs) is explicit: a per-knob override toggle (off = unset,
the input disabled; on demands a number), the definitions table
carrying every text -- label, hint, this endpoint's probed bounds --
and one shared hint bar driven by focus; unset and set-to-the-
deployment-default are distinct states, the run detail exposes the
deployment layer (`paramDefaults`), and the provider's own serving
defaults stay unstated. Above every layer sits the mind verb -- the
player's own one-shot statement for its next turn (the play protocol
above). `--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
@@ -518,6 +566,27 @@ player-side status maintenance proves too costly for the player-model's
attention, the fallback is a dedicated status-keeper agent reading
transcripts -- same pattern as the housekeeper, smaller job.
**Model discovery** is the op's two-step act from the SPA's admin
block, and the registry it writes (`state/models.json`) is the truth
of selectable models -- a fresh deployment has none and model use is
disabled until the op acts. **Discover** scrapes the provider
surface: API metadata only, zero inference, the preliminary list.
**Refine** runs the deterministic battery over that list -- the
tool-manifest ping (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, and the
disable-thinking probe whose working spelling is recorded as a
discovered fact -- then hands the adjudicated results to the
best-measured model (repo craft: `curator.md`) for the
presentation layer: families, labels, descriptions, role
eligibility. The curator's output is strictly validated; any
failure falls back to the machine list, so discovery can never be
blocked by a bad model day. Defaults never consult the curator: the
max-reasoning rule picks them (most measured thinking, then input
ceiling, then output ceiling, then id), for both roles. Refine sends
real traffic over every listed model and is armed with the warning;
discover is free but resets a refined registry to the fresh scrape.
## Layout
```
@@ -535,6 +604,9 @@ housekeeper.md the housekeeping prompt -- repo-fed at housekeeping, never cop
internal housekeeper agent, 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
@@ -560,8 +632,8 @@ names-female.txt the name dictionary -- one name per line; the new-run
tool/
memory.mjs the clerk: packages, runs, create, save-package, init,
render, apply, insert, delete, revive, file,
amend, discard, search, unarchive, status, status-apply,
status-set, agenda, agenda-apply,
amend, discard, search, unarchive, status,
status-set, agenda,
agenda-set, pick, dump, restore, report
(--run <id>; --session <n> addresses one session,
defaulting to the active -- the live one, else the
@@ -581,20 +653,33 @@ server/ the substrate: a zero-dependency node:http service
/session (raw, the audit surface), GET /table (the
play view), GET /story (the whole deliverable),
GET /carryover (the dormant preview)
provider.mjs the endpoint client (chat completions, models listing)
provider.mjs the endpoint client (chat completions, models listing
with metadata)
users.mjs the deployment's people: users, invites, tokens
(state/deployment.db; hashes only, spent invites
recorded forever)
discovery.mjs model discovery: the two op acts -- discover (the
metadata scrape) and refine (the deterministic
battery, the curator pass, the registry write);
state/models.json is the 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
session.mjs session lifecycle (dormant -> live -> finished: the
start lint, freeze and consume; stop with the
start lint and the session-0 memory apply, freeze
and consume; stop with the
move-at-stop slidwin), the append-only typed
jsonl, the view renderer (elision, thinking-strip,
jsonl, 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, status ride and
delta apply, conflict carry, the variant pick; the
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
scripted mock model
variants.mjs variant literature: strict parsing of the
<variants> block (malformed refuses loud, nothing
@@ -640,9 +725,13 @@ web/ the SPA -- no build, vanilla ES modules, path-routed;
widgets.mjs the shared factories: armedButton (the two-click
confirm), paneEditor (the status/agenda pattern),
modelsBox (per-run model selects over the listing)
knobs.mjs the sampling knobs: the definitions table (every
knob text -- label, hint, this endpoint's probed
bounds) and the per-role row with the explicit
override toggle and the shared hint bar
transcript.mjs register rendering (speech / narration / OOC) and
the session-log entry walk (the opening event
renders as machinery); renderContent is shared with the
the session-log entry walk (historical opening
events render as machinery); renderContent is shared with the
story view
view-*.mjs one module per view -- claim, home, new, setup, play
(the table), story (the whole deliverable, read-only)
@@ -672,11 +761,14 @@ db/
schema.sql entries, records, status, agenda, events journal (shared)
state/ per-deployment people + shared packages (gitignored):
deployment.db (users, invites), bootstrap-invite.txt,
packages/ (user-saved, published to everyone)
models.json (the discovered registry -- the truth of
selectable models), 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 -- per-run
player/housekeeper overrides), settings.json, gm.md
owner, `forked` stamp on a fork, models and params --
per-run player/housekeeper overrides and sampling
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),