records: queryable file tier, diegetic per-run gate, narrow search with hard cap

This commit is contained in:
2026-11-11 18:30:29 +00:00
parent 57e8718ffa
commit b77a0de527
13 changed files with 277 additions and 49 deletions
+44 -18
View File
@@ -45,6 +45,7 @@ Two interleaved stories calibrate the memory system against itself:
| dominant ops | touch, reword | insert, gate, demote/retire |
| ring A pressure | staleness — standings shift on hot entries | clutter — obligations accrete |
| 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 |
`node tool/memory.mjs runs` shows fill levels; `--run <name>` overrides the
`config.json` default for any command.
@@ -60,7 +61,9 @@ Two interleaved stories calibrate the memory system against itself:
3. **In play:** `((double parentheses))` is the out-of-character channel —
points of order, canon questions, proposals, vetoes. Both sides use it.
Entries carry stable ids (`[e17]`); citing one is the precise way to
reference a memory.
reference a memory. To consult the records (when the views say they're
available): `((q: sapphire buyers))` — the GM runs `search` and relays
the result (max 10; a miss is a miss).
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
@@ -75,9 +78,33 @@ Two interleaved stories calibrate the memory system against itself:
## The memory model
State lives in **SQLite** (`db/memory.db`); `canon/ring-*.md` are generated
views. Markdown survives as rendering, dies as storage — the models see
prose, the machine sees rows.
State lives in **SQLite** (`runs/<story>/db/memory.db`); `canon/ring-*.md`
are generated views. Markdown survives as rendering, dies as storage — the
models see prose, the machine sees rows.
Memory is **four tiers**:
| tier | what | in context | who writes it |
|---|---|---|---|
| **aggregates** | the character sheet — identity, drives, the values that decide a turn | always | GM; the housekeeper proposes amendments via open questions only |
| **rings A/B** | salient memory — on her mind, MRU-evicted, terse | always | housekeeper manifest |
| **records** | her files — the card index, the ledger, the manifest. Narrow query only, hard cap 10 (in the tool, not the prompt), never bulk-loaded | never — on demand | housekeeper (`record`, `archive`), GM CLI |
| **cold** | forgotten or vetoed | never — not even queryable | GM only (`revive`) |
Records access is **diegetic and per-run**: `runs/<story>/settings.json`
gates it. The boutique's keeper has her card index on the shop PC
(`"records": true`); the prisoners have nothing (`"records": false`). The
tool refuses queries and record ops when the flag is off, and the rendered
views tell the model the current truth. Unlocking mid-story is a narrative
act: narrate the discovery (the salvaged manifest), flip the flag,
re-render — the next window and the next housekeeping both see it.
The query discipline is an instruction test in itself: queries must be
narrow (what this beat needs, not a fishing expedition), and **a miss is a
miss** — no rephrasing, no broadening, no retry this scene. The character
doesn't have it written down; play on. (Concluding "not in my records"
in-fiction is honest use of a miss; rummaging is not.) The result cap is
mechanical — `LIMIT 10` in the tool, not a polite request in the prompt.
- **Ring A — important facts.** Changed a relationship, created an
obligation, altered the world. Cap 500 entries.
@@ -145,6 +172,9 @@ After N windows, grade against:
puppeting; outcomes left to the GM.
8. **Confabulation** — zero invented continuity not present in the rings.
9. **OOC hygiene** — friction surfaces in the OOC channel, not in silent drift.
10. **Query discipline** — narrow queries; zero retry-on-miss cascades.
11. **Archive classification** — on-her-mind (rings) vs in-her-files
(records): are customer cards filed, not memorized?
## Content stance
@@ -188,20 +218,16 @@ Nothing gets redesigned; the SPA just stops the copy-pasting.
## Layout
```
system.md system prompt for the player-model (play-side only)
housekeeper.md system prompt for the post-session housekeeping model
character.md the model's PC sheet (GM fills in before window one)
system.md system prompt for the player-model (play-side only, shared)
housekeeper.md system prompt for the post-session housekeeping model (shared)
config.json the default run
tool/
memory.mjs the clerk: init, render, apply, insert, delete, revive, status
memory.mjs the clerk: runs, init, render, apply, insert, delete, revive,
record, search, unarchive, dump, restore, status
db/
schema.sql entries + append-only events journal
memory.db the state (gitignored local cache — rebuilt via restore)
dumps/
memory.sql canonical dump (GENERATED): id-ordered, restorable SQL —
the committed truth and primary diff/audit surface
manifests/ housekeeper manifests, one JSON per window (diffable)
canon/
ring-a.md GENERATED view: important facts, MRU-ordered
ring-b.md GENERATED view: everything else, MRU-ordered
log/ session logs — generated from manifests; no model ever reads
schema.sql entries, records, events journal (shared by all runs)
runs/
prisoners/ one story: character.md, settings.json, db/, dumps/, canon/,
log/, manifests/ — records disabled
boutique/ same shape — records enabled (the shopkeep's PC)
```