Files
tiny-worlds/ROADMAP.md
T
mute 530170224f substrate: paper model in the clerk, preset/run split, harness decisions
- clerk phase 0: the paper replaces key/value status - a description set with exact-match lost/gained delta apply (paper-apply), non-blocking, misses relayed back as conflict strings; paper / paper-set (GM override) / paper-ingest (a file's status block at new-game); amend and discard journal prior content and the paper ops journal what they replace (events.prior, the saga rule); seed rejects a status key loudly. Smoke-tested end to end
- preset/run split: packages are presets (authored content only - the six state dirs are gone from both), runs are per-deployment instances under runs/ (gitignored); create <package> <run-id> copies the package wholesale (shared prompts included, run.json lineage plus optional model override) and inits state; --run addresses runs; packages and runs list them; config.json names the default package. The seed applies lazily at a fresh run's first window-open
- bridge retired before ever going live: bridge.json became server.json (bind, endpoint, models, contextWindow, params - steal #4), example committed, bridge.mjs stays as the loop donor until server mock-parity
- prelude.md renamed turn-0.md (GM); mechanical feeders, pink ice as licensed corpo firewall, slop section, Pinky treatment pinned (GM)
- harness decisions (ROADMAP The harness): stated goal - a usable RP harness, clone-and-run or invited instance, key on the backend, no secrets in the repo; repo ships code and authored content only; copy-at-creation, editable everything, discipline on the GM; per-run model selection with an upstream models listing; audit as per-wrap dump snapshots inside the run (commit-per-wrap retired); zero-dep stack (#4 resolved, #7 dissolved with the bridge, #21 by default)
- system.md split ruled (#20): substrate facts / per-project guards / per-run craft, hard limits in the craft copy; name call resolved - keep Rell (#19a)
- docs: README gains the goal and deployment model, booting rewritten for the create flow; ROADMAP phasing 0-1 done; HANDOFF and the decision queue current
2026-11-13 23:40:33 +00:00

404 lines
24 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Roadmap — SOTA review and steal list
Reviewed 2026-11-11 via web survey: consumer companion apps, power
frontends, agent RP frameworks, memory research. Items below are meant to
be worked through one by one; statuses in caps, decisions dated.
## The landscape (what exists, as of the review)
| Family | Exemplars | Memory approach |
|---|---|---|
| Consumer companions | Character.AI, Nomi, Kindroid, Replika | Pinned facts + layered stores (Nomi short/med/long; Kindroid persistent + cascaded + retrieved, ~480K chars). Differentiator: visible, editable memory UIs (Nomi Mind Map, Kindroid Learned Context) |
| Power frontends | SillyTavern + extension ecosystem (CharMemory), RisuAI, Agnaistic | Four bolt-ons assembled by the user: lorebooks (keyword-triggered push), Summarize (rolling lossy flatten), Vector Storage / Data Bank (embedding-similarity pull RAG). ST's own docs hedge calling any of it "long-term memory" |
| Story platforms | AI Dungeon, DreamGen, NovelAI, LoreWeaver, aiga_ | Story Cards / Scenario Codex / lorebooks + auto-summaries; world state for multiplayer. Author-curated, static once written |
| Agent RP frameworks | Talemate, Letta | Multi-agent (narrator, summarizer, director, world-state, editor); Letta: agent-editable memory blocks, agent-immutable archival, and as of 2026 a git-backed markdown memory FS with a "dream" reorganization subagent |
| Memory research | Generative Agents (Stanford), Mem0, Zep/Graphiti, MemoryBank, AssoMem | Scored retrieval (recency × importance × relevance); ADD-only consolidation (Mem0 v3); bi-temporal fact invalidation (Zep); hybrid BM25+vector+graph retrieval |
Context: a 2026 25-platform rubric scored only Kindroid and AI Dungeon
4/4 on long-term recall; most consumer apps scored 1/4. The industry's
long-memory problem is unsolved. Our test aims at that gap.
## Validation receipts (we built it first or in parallel)
- Letta 2026 converged on our substrate: git-versioned markdown memory +
separate housekeeping subagent ("dream") + defragmentation passes.
- Generative Agents' retrieval score = recency × importance × relevance;
our rings encode recency (MRU) and importance (A/B) structurally,
relevance at query time. Their importance is LLM-rated 1–10 at write;
ours is the housekeeper's classify/promote judgment — the harder version.
- Talemate mechanized our prompt-level guards: per-character knowledge
("characters know only the passages they were present for") and
per-character perspectives (their version of rings-as-her-memory).
- Mem0 v3 went ADD-only because reconciliation "destroyed context" — the
same fear behind our verbatim-dump discipline. We keep reword (rings are
state) but with journal + git audit, so we get append-only history
without giving up state semantics. Their warning is our observable #3.
- Zep's fact invalidation ≈ our reword-with-audit; their token-efficient
"Context Block" ≈ our rendered views.
- Letta's tier guidance ("always visible → blocks; changing state →
blocks; query on demand → archival") = our status/rings/records split,
discovered from the other direction.
## Architectural decisions from the review (2026-11-11)
- **SPA: yes, eventually. The bridge is the MVP.** The SPA's defining
features per the review: fiction-first chat UI, GM console, context
inspector (steal #6), memory browser (steal #7), turn surgery buttons
(steal #2 with UI), housekeeping job runner.
(Superseded 2026-11-13: the bridge is retired before ever going live —
REST + SPA is the MVP. See "The harness" below.)
- **Voice examples: accepted** — will be present (steal #1).
- **Single LLM player, for now at least.** Mechanical per-character data
separation (Talemate-style knowledge tracking, per-character
perspectives) is superfluous — the run boundary already separates
memory. Revisit only if multi-PC play ever happens.
- **System-1 classification: extension point.** Prediction (2026-11-11):
models deep in roleplay flow won't spontaneously self-interrupt with
structure (JSON, classifications, status declarations) — register
momentum eats it, and instruction weight decays with context distance.
Native tools remove the *format* barrier but not the *attention*
barrier; expect missed updates even in tool mode. Design principle:
**the flow is sacred** — anything mechanical rides a structural channel
(tools) or lives outside the flow (housekeeper, GM, watcher);
prompt-nagging mid-flow is the last resort. System-1's natural homes:
(a) GM-side aids — salience pre-pass before wrap, quick oracle,
transcript review helpers; (b) an auxiliary watcher agent — a cheap
model reading the live session JSONL, flagging touches, stance drift,
and status lag; it proposes, never writes, and its flags become hints
the housekeeper verifies at wrap. Two-speed memory: watcher = salience
capture (recall), housekeeper = consolidation (precision), GM =
authority. The seam exists: sessions/*.jsonl is the watcher's food.
Player-side missed-update rate becomes a testable observable.
- **Visuals: paperdoll engine, not diffusion — much later**, when there
is a solid thing to visualize. Note the synergy: the status tier's
`outfit` key can drive paperdoll layers directly, same as it drives
prose. Procedural, state-driven, no model in the loop.
- **TTS: trivial add-on at any moment.** Park it.
## The harness — product and deployment decisions (2026-11-13, GM)
The project's goal, stated for the first time (now also in README): the
memory test exists to arrive at a **usable roleplaying harness** people
can enjoy making stories on. End shape: clone and run it yourself, or an
invite to a running instance — the LLM key lives on the backend, so
invited players need neither the host's secrets nor their own key. No
secret ever lives in the repo in cleartext (config pattern: committed
example, gitignored real file, env-var option).
- **The repo ships code and authored content, never run state.** Saved
state is per-deployment. Three layers: repo (code, prompts, packages)
→ deployment (a clone + server.json + runs/) → run (a story). A fresh
clone boots with zero runs; the first act is creating one from a
package.
- **Packages are presets; runs are instances.** Creating a run copies
the package into `runs/<id>/` — every file, `gm.md` and the shared
prompts included — then inits the db. After creation the run directory
is the only truth: everything is editable at any time, and the
discipline not to break a running narrative sits with the user/GM.
`packages/` is read exactly once per run, ever. Edits to a copied
file land at the next window-open (no hot reload into an open
window). Packages carry authored content only — `canon/`, `db/`,
`dumps/`, `log/`, `manifests/`, `sessions/` are all state and are
born in the run at creation. The new-game opener file is `turn-0.md`
(renamed from `prelude.md`, 2026-11-13) — the GM's zeroth turn, same
semantics: sent once as the first GM message, `<status>` block
ingested.
- **The seed is initial state of the run.** `seed.json` rides the copy
like any other file. It applies lazily at the first window-open of a
fresh run, before render and bundle assembly; until then the run is
freely editable — deleting or editing `seed.json` in the copy is the
generic opt-out, no flag. After application it is inert provenance:
the journal records the application and a re-apply refuses.
- **Per-run model selection.** `server.json` names one endpoint
(baseUrl, key) plus default models (player, housekeeper).
`GET /api/models` asks the upstream what it carries; the user selects
from the list. A run may carry a model override (default: player) —
the comparison rig: same package, different models, identical
prompts. The housekeeper's model choice stays open (#16); the
mechanism is settled.
- **`system.md` is battery included, split along ownership seams
(ruled 2026-11-13).** Three tiers:
1. **Substrate facts** (proposed `invariants.md`, repo-fed at
assembly, never copied): the mechanical contracts the substrate
depends on — the IC/OOC channel distinction, the `((...))`
syntax, the format markers the SPA parses registers by (plain =
speech, *italic* = narration), the memory contract (rings are
read-only generated views with stable ids, never written by the
player; the ring header announcing records availability), the
status tag transport (`<status>`/`<lost>`/`<gained>`/`<conflict>`
semantics), the tool-mode addendum. Editing these breaks
machinery; they travel with the code.
2. **Common security guards** (proposed `guards.md`, per-project,
repo-fed, never copied): the input-validation bucket model,
injection guards, the addresses-the-model rule, the Refuse
cases. The deployment owner tunes the house security posture;
individual runs never carry it.
3. **Craft** (the `system.md` copy, per-run, freely editable):
purpose framing, style coaching, purview, the status gate,
records discipline, content stance — **hard limits included**.
Different people have different content they don't want to deal
with and different styles of preferred RP; we ship what works
for us, users adjust to taste.
Assembly: system message = invariants + guards + the run's
`system.md` copy. The payoff: repo-level harness tweaks to tiers
1–2 reach existing runs; craft edits are per-run.
- **The audit moved into the run.** Runs are gitignored, so the
commit-per-wrap ritual is retired. At apply time the clerk snapshots
`dumps/w<N>.sql`; post-wrap review is async — the window log against
the snapshot diff. Provenance of what the model was sent is the
session jsonl (it logs the as-sent bundle); the canon views are
regenerated state, not provenance. A run may later self-version
(git init inside a run) as the service step's backup/export story —
designed for, not built.
- **The service step is later, with its own design round** (auth,
invites, multi-user). v1 stays single-GM loopback; nothing in the
design precludes it — the self-contained run directory is the
per-user seam.
- **Boutique is dormant** — a stub that never reached its design step;
untouched until its drafting session.
- **Stack: zero-dependency** (QUESTIONS #4 resolved). `node:http` with
a hand-rolled router, no-build vanilla ES-module SPA, no
`package.json`. The hard parts of this project are prompt-side and
clerk-side; the web side at loopback single-user scale is the easy
part.
## SPA v1 — substrate decisions (2026-11-12, GM)
- **The whole story is recorded; publishing is a someday option.**
Storage: backend, full stop — `sessions/*.jsonl` already is the
complete record (bundle + exchange), git versions it, the SPA holds
nothing. Publishing is an export render that filters to fiction;
book formatting out of scope for v1.
- **Sessions outlive the browser; the server is the truth.** Live state
is in-memory and rebuilt from the jsonl on boot (messages, elision
view, pending ask_gm). The log is truth, the context is a view.
- **Single human: loopback bind, no cookies, no auth.** One active
window *per run* (amended 2026-11-13) — several runs may hold live
windows; nothing runs concurrently in practice, and API-driven tests
can proceed alongside a real window.
- **ask_gm surfaces as a modal**; the pending question survives a
browser refresh (the server holds the pause, the SPA re-presents it).
- **Status rides the GM turns.** The full paper is attached to every
GM turn as a `<status>` block — reads are state, writes are deltas:
the player mutates with `<lost>`/`<gained>` tags in its own turn,
exact-match, non-blocking, misses relayed back via `<conflict>`. Old
status blocks elide from the live context view like old tool results;
the log keeps them all. The initial paper rides the prelude, ingested
at new-game. GM turns never carry deltas; GM override stays
out-of-band.
- **Status pane always visible** — the current description set, live;
`<conflict>` reports surface there too.
- **Thinking blocks are logged but never sent back** — the live context
strips `reasoning_content` (a delta from current bridge behavior,
phase 0); the housekeeping transcript labels them as `[thinking]`
attention evidence for touch/adjudication.
- **Context meter always visible, loud past 85%.** Exact, from the last
response's `usage.prompt_tokens` against a `contextWindow` value in
server.json. The 100% endgame is close-and-housekeep.
- **Housekeeping is the window-close ritual, and it autorestarts.** A
run always ends the session — "any time" means the GM may close a
window early, not that housekeeping is a mid-session action. The
chain runs unattended: housekeeper -> manifest -> apply -> next
window opens with fresh views. Review is async, via the log and the
dump diff; GM edits and vetoes remain available through the clerk at
any time, including mid-next-window. A rejected manifest holds the
restart and surfaces the reason for a re-run.
- **Rewrite-here, not forks.** An unfortunate GM turn is edited and the
session restarts from there — all turns since are lost from the live
context; the append-only log records the surgery and keeps them for
audit. The housekeeping transcript renders the effective view, so the
housekeeper never memorizes retconned-out turns. Window-scoped only:
after housekeeping the story is consolidated, and corrections become
proper retcons. Trivial typos are tolerated; the publishing pass
catches them. Tool side effects in the lost range are compensated
mechanically (see tool discipline below).
- **Tool discipline for rewrite (the saga rule).** Every player tool is
either **session-pure** — roll, ask_gm, records_search: effects live
in the conversation only, truncation removes them wholesale — or a
**journaled mutator** — the status and records verbs: the journal
must capture prior state, so compensation is mechanical. Clerk
amendment: amend and discard currently journal ids only; extend them
to record prior content, and every mutator becomes compensatable.
- **The context is a projection, not a ledger.** The API is stateless:
every call ships a freshly rendered view, and nothing obliges the
view to grow mechanically turn by turn. The append-only jsonl is the
record; the view is a pure render of it under a policy. Soundness
invariants: (a) the view is always derivable from log + policy —
policies deterministic or logged, or "exactly what the model was
sent" provenance dies; (b) tool-call pairing is never broken — the
endpoint silently tolerates orphaned tool results (probe 2026-11-12),
so this one fails quiet: stub or keep both; (c) elide only what is
durable elsewhere — the current status block re-rides, tool results
are use-and-discard, the log keeps full prose; (d) order is preserved
— salience is managed by repetition and compression, never by
shuffling time. Unlocked as policy rules: status re-riding (v1),
prompt re-injection (steal #11), mid-view prose compaction (the
marathon relief valve short of #10), history caps backed by the
rings.
- **REST is the full substrate; the SPA is strictly a client.**
Synchronous requests, no streaming — single-human latency tolerates a
POST that runs the tool loop and returns.
Phasing (amended 2026-11-13 — bridge retired, SPA downstream):
0. clerk-side paper migration (substrate-independent): description-set
status schema, `<lost>`/`<gained>` delta apply (exact match,
`<conflict>` reporting), turn-0 ingestion at new-game, amend/discard
prior-content journaling (compensation-grade audit) — DONE 2026-11-13
1. preset/run split: `runs/` dir, copy-at-creation, lazy seed at first
window-open, clerk re-addressing, config rename (bridge.json →
server.json), packages cleaned to authored-only; the system.md
split lands here too (invariants.md + guards.md repo-fed, the
craft copy rides the run) so no run ever copies what the substrate
feeds — DONE 2026-11-13 except the system.md split (prose, GM's
red pen; must land before the first run is created)
2. loop core + REST spine: the loop extracted from the bridge (one
consumer — the sharing question died with the bridge), `node:http`
server, per-run session machine with ask_gm pause/resume, the view
renderer (log + policy → per-call context, elision as its first
rule), bundle assembly (system message = invariants + guards + the
run's system.md copy), boot-rebuild from jsonl, thinking-strip and
usage tracking land here, mock mode, status/context endpoints; the
API is testable standalone — the front end may wait
3. housekeeping job: manual trigger (always ends the window), transcript
assembly with labeled thinking, auto-apply, autorestart on success,
async log view; a rejection holds the restart and surfaces why;
per-wrap dump snapshots land with apply
4. SPA: transcript with three visual registers (voice / narration /
OOC), bundle as a collapsed "window opened" card, turn-0 as
fiction; GM line input; ask_gm modal; status pane; context meter
Later: turn surgery (steal #2 with UI), memory browser (steal #7),
context inspector (steal #6), book export, the service step.
API sketch (the operable spine, amended per-run):
GET /api/models ask the upstream what it carries
GET /api/packages list presets (records gate, turn-0, seed)
GET /api/runs list runs (package, fill, window state)
POST /api/runs create {package, name, model?}
GET /api/runs/<id> status tier, fill, context meter, pending ask_gm
POST /api/runs/<id>/windows open a window (lazy seed, render, assemble)
GET /api/runs/<id>/session transcript + pending ask_gm + usage
POST /api/runs/<id>/turn GM line -> runs the loop
POST /api/runs/<id>/ask answer a pending ask_gm
GET /api/runs/<id>/status the status tier, structured
POST /api/runs/<id>/housekeeping run the chain (ends the window), async
GET /api/runs/<id>/housekeeping job state: idle | running | applied | rejected
GET /api/runs/<id>/housekeeping/log latest window log
POST /api/runs/<id>/housekeeping/apply apply a manifest directly
## The steal list (work point by point)
### 1. Voice examples in the character sheet — DONE (2026-11-13)
`mes_example` from the character-card spec: 2–3 sample exchanges per
character. The strongest voice-calibration tool the RP community has.
Cost: zero (content). Add an example-dialogue block to the character.md
template and to both casts when drafting.
Status: DONE (2026-11-13) — a ten-state voice corpus in the la-caramba
sheet; the backstory is first person to match the memory voice.
### 2. Turn surgery: /retry, /edit in the bridge — DECIDED (2026-11-12)
Rewrite-here, not fork-here: an unfortunate GM turn is edited in place
and the session restarts from there, losing all turns since. Window-
scoped only — after a housekeeping run the story is consolidated and
corrections become proper retcons (the boundary falls out of the memory
model: pre-housekeeping events live in context only). Trivial typos are
tolerated as-is; the publishing pass catches them. Forks rejected as
unnecessary. Remaining details in QUESTIONS #15; implementation with
the substrate.
### 3. Transient status digest injected post-history — DECIDED (2026-11-12)
The Author's Note / `@@depth` / `post_history_instructions` pattern:
instructions placed after history get better adherence. Folded into the
SPA v1 substrate — superseded by the status redesign (QUESTIONS #17):
the full paper rides every GM turn as a `<status>` block; reads are
state, writes are deltas (`<lost>`/`<gained>`). Old blocks elide from
the live context view like old tool results; the log keeps every
as-sent block (provenance, rewrite snapshots, status evolution for
observable #12). Status left the opening bundle. Adherence remains an
observable to measure once live.
### 4. Generation params passthrough — DONE (2026-11-13)
Every frontend exposes sampler settings; the loop sends none by
default. `server.json` carries an optional `params` object spread into
the request body (temperature, top_p, etc.) — in from day one, empty
by default.
Status: DONE (landed with the server config shape).
### 5. Hybrid retrieval for records_search — OPEN, DEFERRED
SOTA baseline is BM25 + vector + entity-boost (Mem0 v3, Zep). Our
LIKE-only search is fine at boutique scale. Upgrade path: SQLite FTS5 +
label-match boosting (cheap, no embeddings — our records are curated
one-liners, embeddings still solve a problem we don't have).
Cost: cheap. When: records > ~50 cards.
Status: OPEN (deferred until scale demands).
### 6. Context inspector — OPEN (SPA)
CharMemory's Injection Viewer: per-category token breakdown of exactly
what the model sees (system, backdrop, card, status, rings, history,
tool results), stacked bar, actionable tips. Our audit is archaeology;
this is a glance.
Status: OPEN (SPA).
### 7. Memory browser — OPEN (SPA)
Nomi Mind Map / Kindroid Learned Context: a browsable "what she
remembers" view over rings, records, status, journal. The observability
feature for reviewers and for you as GM.
Status: OPEN (SPA).
### 8. Cheap-model housekeeping / decision oracle — OPEN
Talemate runs each agent on its own model, including a small "decision
model" for oracle calls. The housekeeper can already run on any model
(it's a separate invocation); `ds4-flash` housekeeping is one config
away when cost matters. Same for a fast oracle in the SPA.
Status: OPEN.
### 9. Character-card V3 import/export — OPEN (OPTIONAL)
Portability to/from the ST ecosystem (PNG-embedded cards, CCv3 spec).
Only if sharing characters with the outside world ever matters.
Status: OPEN (low priority).
### 10. Mid-session housekeeping trigger — DEFERRED
Talemate summarizes on token thresholds; Letta dreams on compaction.
Our housekeeping is per-window; a marathon session has no relief valve.
Current answer: close the window. Fine for the test; revisit if real
sessions regularly overflow.
Status: DEFERRED.
### 11. Periodic system-prompt re-injection — OPEN
If the system prompt gets disregarded as it sinks into distant context,
try sending it again every X turns. The transport exists: the endpoint
accepts and honors mid-stream system messages (probed 2026-11-12), and
the status block already re-rides every GM turn — the same trick at a
slower cadence. This is the "last resort" the system-1 decision
anticipated (prompt-nagging mid-flow), so it stays conditional on
observed decay: measure first — observable #14 (narrative discipline)
and the context meter mark when drift starts, and X should come from
that data, not guesswork. Open details: fixed cadence vs
decay-triggered; system message vs GM-turn attachment; whether
superseded copies elide from the live view (like old status blocks) or
accumulate.
Status: OPEN (2026-11-13).
## Rejected, with reasons
- **Keyword-triggered lorebook injection** — push pollutes context and
breaks pull discipline; the "a miss is a miss" test depends on
deliberate lookup.
- **Vector embeddings over the rings** — rings are small, curated,
always-in-context. Embeddings solve problems we don't have. (Records
tier may eventually want FTS5 — see #5 — still no embeddings.)
- **ADD-only housekeeping** — we keep reword: rings are state, and
journal + git give the append-only audit Mem0 wanted without losing
state semantics. Their drift warning stays on the observables list.
- **Group chat / multi-character modes, "impersonation"** (model writes
the user's turn) — antithetical to GM authority and the single-PC
premise.
- **Diffusion image generation** — superseded by the paperdoll decision
above.
## Notes
- Web research goes stale; re-survey before acting on anything in the
landscape table. The steal list items stand on their own.
- The NSFW-preset body of prompt craft was deliberately not mined — our
own substrate has no censor to engineer around.