the roles inventory: every human and inferencer seat named, the vocabulary swept, and the duties audit

the inventory (GM-designed in conversation, 2026-11-19): six human roles -- the developer (maintains the repo, and is the system packages author by consequence: system packages ship in the repo), the deployment operator (maintains a deployment: identities, providers, the registry; filesystem access as recovery; never a reader of runs' private surfaces -- owner-gating holds even against the superuser), the deployment user (any claimed identity; the only reach is the API -- no filesystem, no keys, ever), the package author (an off-platform seat: authorship travels with the files, the machinery sees only the publisher), a run's GM (maintains a run they own -- the same person the machinery records as the run's owner, one role two names, never split; the fork creates a second GM seat over a branching canon), and the reader (defined by the act, membership-free: on-platform any signed-in user, off-platform anyone the story text reaches). The inferencer roles: the assistant, the player, the housekeeper, the curator, the clerk (code, never a model), and the bookkeeper (parked). The example that pinned the mappings: Alice the op forking Bob's Faye into her Kate (hats stack, seats don't), Charlie authoring package files Bob publishes (the author-publisher split), Dave reading the exported story with no invite at all (the reader needs nothing).

the naming convention, stated in AGENTS's header and DICTIONARY both: "GM" always means a run's GM, everywhere; ruling attributions name the developer; the assistant is the assistant; the op stays the op. The role line that is never crossed (developer, 2026-11-19): the assistant is NOT the player -- player-facing instructions are for the assistant to understand how the player would interpret them, never to follow. The root prompts and every model-facing string were already correct (GM there was always the run's GM) and are untouched; the packages' fiction is exempt from the term lint (rule 4 scopes to the substrate: README and the root prompts); the records keep their day's words -- DECISIONS gained one dated header note mapping the old usage instead of a rewrite ("GM" in a ruling attribution is the developer, "the agent" is the assistant).

the sweep: 125+ ruling attributions rewritten across living prose and code comments in every spelling the repo used (paren-wrapped, date-first, mid-sentence, line-wrapped); AGENTS.md fully re-voiced (the header rewritten, "the agent" gone, the developer-meaning prose fixed line by line); README's "invited players" became "invited users"; the gm.md carve-out made precise everywhere (the file is the run's GM's private file, the flagging target is the developer, the non-editor is the assistant).

the word retirements, both lint-banned in rule 4 exactly like "window": "agent" (the word did too many jobs at once; every seat is named; the filename AGENTS.md consumed as-is, "Windows" the OS the precedent) and "LLM" (the class word is "inferencer(s)"; "model" kept as the machinery's noun -- a registry entry, never a seat: a model is what the registry lists, an inferencer is who a seat is). The fixes the bans forced: the exposure rule's "internal agents" -> "internal inferencers", the hypothetical "status-keeper agent" -> invocation, the bookkeeper shed its "agent" tag, "player-model" fell to "the player" everywhere including housekeeper.md's one prompt hit, README's "inference key" and its Roles section re-voiced, the #22 attribution comments at the three call sites, and the runtime log markers renamed (llm -> inferencer, a meaning-preserving log rename under the no-legacy rule). DICTIONARY's renames section carries both retirement entries.

the duties audit (along the what-hats-do lines: the developer maintains the repo, the op maintains a deployment, a user's only reach is the API, a run's GM maintains their run). Found and fixed: README's Housekeeping section was pre-split era text -- "every housekeeping pass should end in a commit" and "confess in the commit message" (runs/ is gitignored; the developer's commit duty was assigned to the run flow), the dead packages/<story>/dumps and packages/<story>/db paths (the dump is per-session under runs/<id>/sessions/<n>/), "canon/ stays committed", and "single-human" (multiuser since 2026-11-14) -- rewritten to the current paths with the audit's hat named: the dump cross-check is the operator side's, a run's GM reviews a pass through the server (the housekeeping log, the rendered rings, the story). The CLI-attributed-to-the-GM lines now say what they are: deployment-side filesystem reach, --gm-authorized writes, whoever's hand runs it (the protocol passage, quickstart step 7 -- which also dropped its "commit" -- and the booting intro now names its hat switches: the author's files, the deployment-side create with its API twin named, the GM's start). "The host" -> "the op" in the pitch. One mechanical fiction PARKED on the ROADMAP deferred list instead of fixed: the memory tiers table promises records access "none -- until the GM unlocks it in the story", but no channel exists (records is a creation-time settings bool, settings.json is read-only in the file API) -- build the channel or fix the promise, later. Verified consistent by the audit: the notepad (ONE notepad -- the run's gm.md, owner-writable through its route, seeded from the package copy), the op's non-reader boundary, every provider act, the spec attributions, the reader, the prompts.

verified: typecheck green both programs, check-repo ALL CLEAN with both new bans active, the ban regexes proven by direct test (agent/agents/multi-agent and LLM/LLMs caught; AGENTS.md and the assistant pass), and final greps confirming every remaining "GM" is a protocol term and every remaining "agent"/"LLM" is a quoting entry or a record's day-words. The developer's own edits ride along: the operator queue strike (the inventory line done, the loopback typo, "external sec review"), and the handoff prepared -- the queue renumbered, the fresh-run item's garbled line repaired, the commit count brought current (seven await the push), template and box marked committed, a stray paragraph break fixed. detention stays untracked WIP, untouched.
This commit is contained in:
2026-11-19 09:56:56 +00:00
parent e60fd63d2b
commit ccdd9ea129
28 changed files with 529 additions and 285 deletions
+52 -38
View File
@@ -26,8 +26,8 @@ must weigh stays close, and the rings stay legible.
The memory test is not the end product. It exists to arrive at a usable
roleplaying harness -- something people can enjoy making long stories
on. The end shape: clone and run it yourself, or get an invite to a
running instance. The LLM key lives on the backend, so invited players
get the functionality without the host disclosing secrets and without
running instance. The inference key lives on the backend, so invited users
get the functionality without the op disclosing secrets and without
bringing their own model. Correspondingly: this repo ships code and
authored content only -- no run state, and never a secret in cleartext
(the config pattern is a committed example plus a gitignored real
@@ -38,10 +38,10 @@ housekeeping job, and SPA -- see `node server/main.mjs` and open
## Roles
- **Human = the GM.** The world, every NPC, all consequences, all retcons.
Runs on organic memory -- no notes. The model's canon files are the prosthesis.
- **Player-model = one PC.** Inner life, voice, choices. Nothing else. Reads
Runs on organic memory -- no notes. The canon files are the prosthesis.
- **The player = one PC.** Inner life, voice, choices. Nothing else. Reads
memory, never writes it.
- **Housekeeper-model = a separate invocation**, fresh context, run after each
- **The housekeeper = a separate inferencer invocation**, fresh context, run after each
session. Reads the transcript and the rendered rings; emits a **manifest** of
semantic operations. Judgment, no clerical work.
- **`tool/memory.mjs` = the clerk.** Validates and applies manifests,
@@ -65,7 +65,7 @@ or otherwise PC ever needs support, this is the line to revisit.
A deployment is one clone plus `state/` and `runs/` (all gitignored
state) and an optional `server.json` -- bind and contwin only; the
provider entities live in `state/config.json`, server-written,
SPA-managed, zero manual file edits. The LLM key lives on the backend
SPA-managed, zero manual file edits. The inference key lives on the backend
need neither the key nor a local clone. Identity is a token, nothing
else: no usernames, no passwords, no external IDPs. A single-use
invite code -- spent codes are recorded forever and rejected loudly on
@@ -105,7 +105,7 @@ forking makes that cheap -- stories outlive identities by design.
- **Models are per-run picks of full specs.** A pick is
{provider, model, effort} -- there is no unset effort (it
substantially changes inference quality, so it is a property of the
pick, GM 2026-11-18), and the per-run sampling-knob layer is
pick, developer 2026-11-18), and the per-run sampling-knob layer is
retired: params are per-turn, the <mind> verb's alone. The
provider's default pair (the op's selection, also the refine
curator) pre-selects the create flow; a run's owner overrides
@@ -115,7 +115,7 @@ forking makes that cheap -- stories outlive identities by design.
from the config, a model gone from its registry, a model the
battery disqualified -- the run blocks with the note naming what
died until the GM sets it up again.
- Every logged LLM call records the acting user. Quotas and limits are
- Every logged inferencer call records the acting user. Quotas and limits are
an extension point, not built.
- All dates and times are UTC everywhere. No time zones, ever.
@@ -151,7 +151,11 @@ 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 takes dormant session one
live: the carryover is linted, the bundle freezes, the opening
consumes into the log, in one action.
consumes into the log, in one action. The steps below walk every hat
on one head -- the package author's files (1-4), the deployment-side
create (5), the GM's start (6); on a real deployment they split: a
user drafts and creates through the SPA, and the package files are
the author's, wherever they sit.
1. **Backdrop** -- write `packages/<story>/backdrop.md`: the world as everyone
in it knows it. Public knowledge, general setting. Neither memory nor
@@ -187,7 +191,9 @@ consumes into the log, in one action.
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>`:
5. **Create the run** -- `node tool/memory.mjs create <story> <pc-name>`
(the API create route wraps the same clerk call; through the SPA
it is home -> new run):
the package is copied into `runs/<id>/` -- the craft prompt
(`handbook.md`) rides along, battery included -- landing where it
lives from now on: the bundle files and the session-0 artifacts in
@@ -331,8 +337,10 @@ consumes into the log, in one action.
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`
marks GM-authorized writes). The full play protocol -- format,
the run provides them; the CLI equivalents remain the
deployment-side path -- `--gm` marks the writes as GM-authorized,
and the CLI itself is filesystem reach, whoever's hand runs it
(the op's, or the developer's on a dev box). The full play protocol -- format,
one-thing-per-turn, thoughts off the page, intent-form, immersion
over realism -- lives in `system.md`, `invariants.md`, and
`handbook.md`. Through the server, the model's OOC is the `ask_gm`
@@ -348,7 +356,7 @@ consumes into the log, in one action.
-- thinking never crosses the wire, variant turns carry only the
picked one, and the opening carryover renders as ordinary history
(during dormancy the carryover endpoint previews it the same way).
4. **Close a session:** just stop. No in-band ritual; the player-model has no
4. **Close a session:** just stop. No in-band ritual; the player has no
end-of-session duties. The stop moves the session's tail into the
next dormant session's carryover, freezes this one, and runs
housekeeping over what remains.
@@ -365,8 +373,11 @@ consumes into the log, in one action.
`sessions/<n+1>/log/<n>.md`, re-renders the views. A rejected manifest changes
nothing and says why. The server's pass rebases first -- each run
re-copies the finished session's db, so re-runs never double-apply.
7. **Review the log, veto or edit as desired, commit.** GM edits go through
`insert` / `delete` / `revive` commands.
7. **Review the log, veto or edit as desired.** Memory edits go
through the `insert` / `delete` / `revive` commands -- the CLI is
deployment-side filesystem reach, its writes `--gm`-authorized; a
run's GM without that reach reviews through the server instead
(the housekeeping log, the rendered rings, the story).
## The memory model
@@ -527,9 +538,9 @@ minors, gratuitous violence. These live in `system.md`; edit them there.
## Housekeeping
This directory is a git repo. Every housekeeping pass should end in a commit.
The **primary audit surface is `packages/<story>/dumps/memory.sql`** -- the canonical dump:
id-ordered, one row per line, auto-written by every mutation. Because the
The **primary audit surface is the per-session dump**
(`runs/<id>/sessions/<n>/dumps/memory.sql`): id-ordered, one row per
line, auto-written by every mutation. Because the
ordering is by id, diffs are position-stable -- a touch is one changed line,
a promotion is one changed line, an eviction is one changed line. Diffing
two consecutive dumps reconstructs exactly the operations that were applied,
@@ -539,20 +550,23 @@ Cross-check it against the session's log: the log is what the housekeeper
*declared*, the dump-diff is what *actually happened*. Any disagreement is
either a tool bug or a hand edit -- and hand edits have a contract: all
mutations go through the tool, so the dump never drifts. (If you ever poke
the db with a sqlite browser, run `dump` afterwards and confess in the
commit message.)
the db with a sqlite browser, run `dump` afterwards.) The dump is
filesystem state, so this cross-check belongs to the deployment's
operator side; a run's GM reviews a pass through the server instead --
the housekeeping log, the rendered rings, the story.
The dump is restorable SQL and the **committed truth**; the binary
`packages/<story>/db/memory.db` is a gitignored local cache -- fresh clone:
`node tool/memory.mjs restore` (per run). The `canon/` views stay committed
as provenance -- exactly what the models were sent -- and `log/` +
The dump is restorable SQL; the binary `memory.db` (one per session,
copied forward at stop) is rebuilt from it by
`node tool/memory.mjs restore` (per run). The `canon/` views stay as
provenance -- exactly what the models were sent -- and `log/` +
`manifests/` remain the human-readable record.
The housekeeper may be a different model than the player -- cheaper, or more
The housekeeper may run a different model than the player -- cheaper, or more
pedantic, whatever housekeeping needs. The two prompts are independent.
**Substrate:** `server/` -- a zero-dependency `node:http` service
(`node server/main.mjs [--mock]`), loopback, single-human, synchronous
(`node server/main.mjs [--mock]`), multiuser (bearer-token
identities, the deployment section above), synchronous
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 --
@@ -599,14 +613,14 @@ the request returns with the question, the answer call resumes it,
and a refresh re-presents it after a restart. The old
`tool/bridge.mjs` is deleted: it never went live, and the server
reached mock-parity (2026-11-14).
Config is self-healing state, not a hand-edited file (GM, 2026-11-18):
Config is self-healing state, not a hand-edited file (developer, 2026-11-18):
the provider entities -- slug, baseUrl, optional key, the op's
default model spec -- live in `state/config.json`, written only by
the server, managed from the SPA's admin block. `server.json`
(gitignored, optional) is the static remainder: `bind` and `contwin`
(the context budget in tokens). No legacy config shapes are read:
shape changes come with one-time migrations, not permanent tolerance
(the no-legacy rule, GM, 2026-11-18). Boot always succeeds: a fresh clone with nothing comes
(the no-legacy rule, developer, 2026-11-18). Boot always succeeds: a fresh clone with nothing comes
up serving and mints the superuser invite, and -- the self-heal
rule, broadly: an error that can be mechanically fixed to a
reasonable degree without requiring human input gets fixed -- the
@@ -617,7 +631,7 @@ fix) and running its discovery in the background. The list is never
empty in lifetime either: opencode/free is removable only while
another provider stands. Custom providers add from the SPA taking
only the endpoint (a slug and a baseUrl -- never a key): discovery
runs on add and IS the probe (GM, 2026-11-19). A working keyless
runs on add and IS the probe (developer, 2026-11-19). A working keyless
listing never sees a key field; a recognizable auth refusal (401/403)
stands the provider broken and opens the key path -- the key rides
the auth route, checked on reception, saved only on success, asked
@@ -638,9 +652,9 @@ 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
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.
player-side status maintenance proves too costly for the player's
attention, the fallback is a dedicated status-keeper invocation
reading transcripts -- same pattern as the housekeeper, smaller job.
**Model discovery** is per provider, the op's acts from the SPA's
admin block, and the registry it writes (`state/models.json`, one
@@ -665,7 +679,7 @@ stand-in on a bad model day (the op gets no advice, not machine
advice). The curator's output is strictly validated; any failure
falls back to the machine list, so refine can never be blocked by a
bad model day. The battery's measured effortDefault is pre-fill and
hint only -- nothing rides implicitly anymore (GM, 2026-11-18,
hint only -- nothing rides implicitly anymore (developer, 2026-11-18,
amending 2026-11-16: with effort a property of the pick, the
selection prompt pre-selects and the recommendation informs, no
silent layer). The adjudication cache (`state/refine-cache.json`)
@@ -676,11 +690,11 @@ worse; reasoning effort substantially changes inference quality) --
so churn is cheap: discovery re-runs freely (opencode/free rotates
its models), and a refine that sees the same tuple reuses the
cached verdict, refreshing it in place when it re-probes. Failures
never cache (GM, 2026-11-19): a failure is the absence of a
never cache (developer, 2026-11-19): a failure is the absence of a
measurement, not a measurement -- every refine re-probes the models
that failed the last one, so a transient error never pins a false
verdict, and a model that fails for real costs one cheap probe per
refine. No inference call retries itself (GM, 2026-11-19, the
refine. No inference call retries itself (developer, 2026-11-19, the
universal rule): every call is user-initiated and every act has its
manual retry -- the send again, the housekeeping re-run, the refine
button; a dead curator call lands the machine-label fallback, which
@@ -700,7 +714,7 @@ handbook.md the craft tier, shipped default -- copied into each
purview, time skips, content stance, hard limits)
housekeeper.md the housekeeping prompt -- repo-fed at housekeeping, never copied
into a run, never user-facing: it prompts the
internal housekeeper agent, never the bundle
internal housekeeper, 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,
@@ -717,7 +731,7 @@ DECISIONS.md the resolved record -- every answered question, kept
verbatim with its day's words; the citation numbers
DICTIONARY.md the terms of art -- the ruled names, one source of
truth; a rename rules here first, then sweeps
AGENTS.md the agent's own working notes -- style lessons, gotchas,
AGENTS.md the assistant's own working notes -- style lessons, gotchas,
state pointers
config.json the default package
package.json dev tooling only -- the runtime is zero-dependency;
@@ -747,7 +761,7 @@ server/ the substrate: a zero-dependency node:http service
boot-resumes interrupted stops and reopens live
sessions from the session logs on
start; bootstraps the fresh-deployment superuser
invite; the request log and every LLM call carry the
invite; the request log and every inferencer call carry the
acting user; four projections of the state: GET
/session (raw, the audit surface), GET /table (the
play view), GET /story (the whole deliverable),