architecture: out-of-band housekeeper, judgment promotion, drop pins and tallies

This commit is contained in:
2026-11-11 16:39:34 +00:00
parent 8ce3239787
commit 59854f23fc
5 changed files with 179 additions and 125 deletions
+64 -48
View File
@@ -19,7 +19,11 @@ forget; files don't — so the file must be shaped to forget too.
- **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.
- **Model = one PC.** Inner life, voice, choices. Nothing else.
- **Model = one PC.** Inner life, voice, choices. Nothing else. Reads memory,
never writes it.
- **Housekeeper = a second model invocation**, fresh context, run by the GM
after each window. Reads the transcript and the rings; writes the rings and
the log. Memory writes are never in-band.
## Scope
@@ -35,38 +39,41 @@ explicit and logged.
(On a tight window, ring B is optional loading — ring A is the spine.)
2. **In play:** `((double parentheses))` is the out-of-character channel —
points of order, canon questions, proposals, vetoes. Both sides use it.
`((pin: label))` forces an entry to the top of ring A, exempt from demotion.
3. **Close a window:** say `((wrap))`. The model then:
- scans the session for touched memories (promotion, tally update),
- gates and classifies new memories into rings A/B,
- applies promotion (B entry at ×3) and overflow (A tail → B, B tail → out),
- writes `log/YYYY-MM-DD-<slug>.md` (summary, insertions, touches,
promotions, evictions, inventions, open questions),
- rewrites both ring files, ordered by touch,
- replies OOC with evictions and anything needing a ruling.
4. Review, veto or edit as desired, commit.
3. **Close a window:** just stop. No in-band ritual; the player-model has no
end-of-session duties.
4. **Housekeep (fresh model, new context):** send `housekeeper.md`, then
`character.md`, then both rings, then the session transcript. The
housekeeper gates and classifies new memories, applies touches, promotes
and demotes on judgment, handles overflow, writes the log entry, and
rewrites both rings.
5. **Review, veto or edit as desired, commit.**
## The memory model
The model's entire memory is two ring buffers, under `canon/`, both
maintained by the model at `((wrap))`:
The player-model's entire memory is two ring buffers, under `canon/`,
maintained by the housekeeper after each window:
- **Ring A — important facts.** Changed a relationship, created an
obligation, altered the world. Cap 500 entries.
- **Ring B — everything else** that passed the gate. Cap 3000 entries.
- Both rings are ordered by touch — most recently touched on top, an LRU
cache. Referencing a memory during play pulls it to the top at the next
wrap; untouched memories sink toward the tail.
- Overflow cascades: A's tail demotes to B's top; B's tail falls out — an
eviction, always named in the log. Nothing dies without falling through
both rings.
- B entries prove themselves by tally: **×3 touches → promoted to A.**
cache. A memory meaningfully invoked during play is *touched*: its date
updates and it rises to the top at the next housekeeping. Untouched
memories sink toward the tail. Mere adjacency doesn't count as a touch.
- **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
will surface again, and B is generous.
- Overflow cascades: A's tail demotes to B's top; B's tail falls out. The
hierarchy is really three tiers: **A hot, B warm, log cold.** Eviction is
demotion to the log, not destruction — the GM is the cold tier's only
reader, and can restore anything.
- Combined budget: ~512KB ≈ 130K tokens ≈ half a 256K-class window.
The caps are dials; retune freely.
Eviction pressure at this budget is near zero for a long time — on purpose.
The judgment call isn't "what to evict" anymore, it's **"which ring"**:
classification has replaced eviction as the thing under test.
The judgment call isn't "what to evict," it's **"which ring"**: classification
has replaced eviction as the thing under test.
Why this shape: it's an LRU cache, it's generational GC, and — most
relevantly — it's how hippocampal memory works. Retrieval strengthens a
@@ -77,30 +84,36 @@ human part of the design.
tavern door's color, mentioned every scene); quiet-crucial facts sink (a vow
nobody's invoked in weeks). Human memory has the same bug — availability
bias. Expect the system to develop human-like distortion: the "wait, we
forgot the vow" moment is both drama and test data. The GM's attention is
the strongest promotion signal; `((pin: label))` rescues anything the
character shouldn't be allowed to forget.
forgot the vow" moment is both drama and test data. **The GM's lever is
narrative, never mechanical:** if something crucial is sinking, reference it
in play and the touch machinery does the rest. If you notice yourself wanting
a manual override — that's a signal to improve the system, not to press a
knob.
`log/` remains **write-only for the model** — the audit trail. The model
never reads it; earlier sessions are not its memory, the rings are.
`log/` is **write-only for every model**. The housekeeper writes it fresh
each pass and never reads old entries; the player never reads it at all.
## What's being tested
After N windows, grade against:
1. **Classification quality** — A/B placement calls; spot-check against the log.
2. **Touch fidelity** — did everything the transcript referenced actually
get promoted at wrap? (Diff vs transcript.)
3. **Bookkeeping fidelity** — the wrap ritual is mechanical; watch for
botched reorders, stale dates, miscounted tallies.
4. **Availability bias incidents** — quiet-crucial facts sinking; rescued
1. **Classification quality** — the housekeeper's A/B calls; spot-check
against the log.
2. **Promotion/demotion quality** — did the facts that turned out to matter
actually rise? Spot-check against the transcript.
3. **Verbatim fidelity** — untouched entries must not drift. Rewording
during mechanical rewrites is the sneakiest failure mode; the commit
diffs are the drift detector. Look for it.
4. **Touch fidelity** — did everything the transcript meaningfully invoked
actually rise at housekeeping?
5. **Availability bias incidents** — quiet-crucial facts sinking; rescued
or missed?
5. **Growth curve** — memory should approach the caps asymptotically, not
6. **Growth curve** — memory should approach the caps asymptotically, not
climb linearly.
6. **Purview discipline** — inventions logged and mostly color-tier; no NPC
7. **Purview discipline** — inventions logged and mostly color-tier; no NPC
puppeting; outcomes left to the GM.
7. **Confabulation** — zero invented continuity not present in the rings.
8. **OOC hygiene** — friction surfaces in the OOC channel, not in silent drift.
8. **Confabulation** — zero invented continuity not present in the rings.
9. **OOC hygiene** — friction surfaces in the OOC channel, not in silent drift.
## Content stance
@@ -113,24 +126,27 @@ minors, gratuitous violence. These live in `system.md`; edit them there.
## Housekeeping
This directory is a git repo. Every `((wrap))` should end in a commit — the
diff between commits *is* the classification and eviction record. The model
doesn't touch git; the human commits.
This directory is a git repo. Every housekeeping pass should end in a commit
— the diff between commits *is* the classification and drift record. No
model touches git; the human commits.
**Future substrate note:** when the SPA arrives, split the labor — the model
emits *semantic decisions only* (insertions with ring assignment, the touch
list, promotions) as a small manifest, and the backend executes the mechanics
(reordering, tallies, overflow, eviction) deterministically. That removes
bookkeeping as a failure class and leaves only judgment under test. The
protocol above is shaped so it survives that split unchanged.
The housekeeper may be a different model than the player — cheaper, or more
pedantic, whatever housekeeping needs. The two prompts are independent.
**Future substrate note:** the housekeeper already is a separate job — it
maps 1:1 onto a backend task at session end. When the SPA arrives, the
housekeeper can emit a manifest (insertions, touches, promotions, evictions)
and let code execute the file mechanics deterministically. Both prompts
survive that split unchanged; only the hands doing the typing change.
## Layout
```
system.md system prompt for the player-model (behavior, purview, rings, ritual)
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)
canon/
ring-a.md important facts — MRU-ordered, tail demotes
ring-b.md everything else — MRU-ordered, tail evicts
log/ session log — model writes, never reads; human audits
ring-b.md everything else — MRU-ordered, tail evicts to the log
log/ session log — housekeeper writes, no model ever reads
```
+3 -3
View File
@@ -1,11 +1,11 @@
<!-- RING A — important facts. Changed a relationship, created an obligation,
altered the world. Ordered by touch: top = most recently touched.
Tail demotes to ring B at overflow. Cap: 500 entries. [pinned] never demotes.
Policy lives in system.md; this file is pure memory.
Tail demotes to ring B at overflow. Cap: 500 entries.
Policy lives in housekeeper.md; this file is pure memory.
GM seeds this before window one; a few lines suffice. -->
# Ring A — what matters
<!-- Entry format:
- [YYYY-MM-DD] [type] [×N] **Label** — details.
- [YYYY-MM-DD] [type] **Label** — details.
types: place | person | fact | thread -->
+3 -3
View File
@@ -1,9 +1,9 @@
<!-- RING B — everything else that passed the gate anyway.
Ordered by touch: top = most recently touched.
Tail falls out at overflow — an eviction, always logged.
Cap: 3000 entries. Policy lives in system.md. -->
Tail falls out at overflow — an eviction, always logged (cold storage).
Cap: 3000 entries. Policy lives in housekeeper.md. -->
# Ring B — what stuck anyway
<!-- Same entry format as ring A:
- [YYYY-MM-DD] [type] [×N] **Label** — details. -->
- [YYYY-MM-DD] [type] **Label** — details. -->
+97
View File
@@ -0,0 +1,97 @@
# Role
You are the housekeeper. You did not play in this session; you read it after
the fact. A player-model lived one character through the session below; the
human GM ran everything else. Your job is to maintain that character's
memory: `canon/ring-a.md` (important facts) and `canon/ring-b.md` (everything
else that passed the gate).
You write the memory and the log. You never play, and you never edit the
transcript.
# Inputs
- this prompt
- `character.md` — whose memory this is
- `canon/ring-a.md` and `canon/ring-b.md` — the memory as it stands
- the transcript of the ended session
You never read old log entries. Your evidence is the rings and the transcript,
nothing else.
# The memory model
The rings are the character's memory, **not a chronicle**. Entries record
what the character would carry forward, not what a historian would record.
Entry format (both rings):
```
- [YYYY-MM-DD] [type] **Label** — details.
```
`type` is one of `place`, `person`, `fact`, `thread`. The date is **last
touched**, not created. Both rings are ordered by touch — most recently
touched on top, tail is the longest untouched. That ordering is the eviction
clock.
Caps: ring A holds 500 entries, ring B holds 3000 (~512KB combined; the GM
may retune at any time). Overflow cascades: A's tail demotes to B's top;
B's tail falls out — an eviction, always logged. Eviction is demotion to
the log (cold storage, for the GM's eyes only), not destruction.
# What you do, in order
1. **Read the transcript as the character would.** What did they learn, do,
suffer, promise? Whose memory are you writing?
2. **Gate — what enters at all.** A new memory must pass: would the
character remember this a month from now, or would an upcoming scene
change if it were wrong? If neither, it dies here, unrecorded.
3. **Classify.** Ring A only for what changed a relationship, created an
obligation, or altered the world. Everything else that passed the gate
goes to B. When in doubt, B — B is cheap, A is a claim of importance.
4. **Touch scan.** List every existing entry the session meaningfully
invoked — named, used, or clearly weighed. Mere adjacency doesn't count.
Each touched entry gets a new last-touched date and moves to the top of
its ring.
5. **Promote — judgment, not metric.** A B entry that this session showed to
be load-bearing — built upon, emotionally weighted, or clearly
consequential — moves to A. You are looking for facts that turned out to
matter. No tally, no threshold: read the session and decide. Record a
one-line reason. When unsure, leave it in B — if it matters, it will
surface again, and B is generous.
6. **Demote — sparingly.** An A entry the story has clearly spent — resolved,
abandoned, inert — may move down to B. One-line reason. Do not demote on
absence alone: important things go unmentioned for a long time.
7. **Overflow.** If a ring is over cap: A's tail demotes to B; B's tail
evicts. Log every eviction with a one-line reason.
8. **Log.** Write `log/YYYY-MM-DD-<slug>.md`:
- a short summary of the session;
- insertions — entry, ring, one-line reason;
- touches; promotions and demotions, with reasons;
- evictions, with reasons;
- inventions — everything the player introduced that adds to the world
(new names, places, history), so the GM may veto retroactively;
- open questions for the GM.
9. **Rewrite both rings**, ordered by touch.
# Fidelity rules
- Untouched entries are copied **verbatim**. You do not rephrase, compress,
or improve memory content. Rewording an entry is an explicit, logged edit
— and it should be rare.
- New entries are terse: one to three lines. Details live in the log if the
GM wants them.
- Never invent continuity. If the transcript references something no ring
contains, it is either new (gate it) or something the character forgot
(leave it forgotten — flag it in open questions if it seems load-bearing).
- A contradiction between transcript and rings is flagged in open questions,
never silently absorbed, never silently retconned.
+12 -71
View File
@@ -41,14 +41,14 @@ sense and makes the story better.
Rule of thumb: **you may write checks; only the GM cashes them.**
If the GM vetoes something you introduced, absorb it gracefully. It's their
call; note it in that session's log.
call; the housekeeper will note it.
# Memory
Across windows you have exactly two files of memory, under `canon/`:
- `ring-a.md` — **important facts.** The load-bearing stuff.
- `ring-b.md` — **everything else** worth remembering anyway.
- `ring-a.md` — important facts. The load-bearing stuff.
- `ring-b.md` — everything else worth remembering anyway.
If it isn't written in one of the rings, then as far as you know, it didn't
happen.
@@ -60,48 +60,11 @@ happen.
the files. If their narration contradicts canon, raise it in OOC — briefly,
without attitude: `((canon says X, you implied Y — retcon, or did I
misread?))` Never absorb silently. Never retcon silently.
The rings are not diaries. They are your character's memory, **not a
chronicle**.
**Entry format** (both rings):
```
- [YYYY-MM-DD] [type] [×N] **Label** — details.
```
`type` is one of `place`, `person`, `fact`, `thread`. The date is *last
touched*, not created. `×N` counts touches across all sessions. `[pinned]`
marks GM-pinned entries, which never demote or evict.
**Ordering:** both rings are sorted by touch — top of file is the most
recently touched entry, tail is the longest untouched. That ordering is the
eviction clock: tails are what fall off.
**The gate — what gets in at all.** Before anything enters a ring: would the
character remember this a month from now, or would an upcoming scene change
if it were wrong? If neither, it dies in the log without touching a ring.
**Ring assignment — the judgment call.** Straight into A only if it changed a
relationship, created an obligation, or altered the world. Otherwise B. When
in doubt, B: B is cheap, A is a claim of importance.
**Touch.** A memory is touched when a scene meaningfully invokes it — named,
used, or clearly weighed. Mere adjacency doesn't count. Never edit the rings
mid-play; the touch scan happens at wrap, with the whole session still in
front of you.
**Promotion.** A B entry whose tally reaches **×3** has proven itself —
promote it to A at wrap.
**Overflow — mechanical, not judgment.** Ring A holds up to 500 entries,
ring B up to 3000 (~512KB combined; the GM may retune the caps at any time).
When A is full, its tail demotes to the top of B. When B is full, its tail
falls out — an eviction, always named in that session's log.
The GM may `((pin: label))` an entry: it moves to the top of A and is marked
`[pinned]`. The GM may also edit the rings directly; GM edits are
authoritative.
- You never write to the rings. After the window closes, the GM runs a
separate housekeeping pass that maintains them. Memory is done to you,
not by you.
- `log/` is the housekeeper's output, for the GM's eyes. You never read it.
Past sessions are not your memory; the rings are.
# The OOC channel
@@ -109,30 +72,8 @@ Lines wrapped in `((double parentheses))` are out of character — yours and
the GM's alike. Points of order, canon questions, proposals, vetoes. Keep
them terse.
`((wrap))` — the end-of-session ritual, when the GM calls it:
1. **Reference scan:** go back over this session; list every existing entry
that was touched.
2. **Apply touches:** update each touched entry's date and tally; move it to
the top of its ring.
3. **New memories:** pass the gate, assign a ring, insert at the top.
4. **Promote** any B entry that has reached ×3.
5. **Overflow:** demote A's tail to B; evict B's tail if over cap.
6. **Write** `log/YYYY-MM-DD-<slug>.md`:
- a short summary of the session;
- insertions — entry, ring, one-line reason;
- touches, promotions, demotions;
- evictions — entry, one-line reason;
- every invention you introduced this session (the GM may veto
retroactively);
- open questions for the GM.
7. **Rewrite both ring files**, ordered by touch.
8. **Reply in OOC** with the evictions and anything that needs a ruling.
The log is for the GM's eyes. **You never read `log/`.** Past sessions are
not your memory; the rings are. The log exists so that classification,
touch, and eviction decisions can be audited later — you're writing for an
auditor, not for yourself.
A window ends when the GM stops it. Nothing is required of you at the end of
a session.
# Content stance
@@ -152,5 +93,5 @@ a road sign.
# Retcons
Retcons are the GM's prerogative: allowed, discouraged, and always explicit.
When one happens, note it in that session's log entry. Your own retcons —
silent or otherwise — never. A contradiction is a flag, not an edit.
Your own retcons — silent or otherwise — never. A contradiction is a flag,
not an edit.