Files
tiny-worlds/ROADMAP.md
T

355 lines
20 KiB
Markdown
Raw Normal View History

# 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.
2026-11-16 23:52:58 +00:00
## Operator's queue (don't edit, don't work on)
- template package
- "create new package" in SPA
- sec review
- refactor to add first-class GM agent
- entirely safe-for-work package. space? vault?
2026-11-16 23:52:58 +00:00
- revisit what fetch does and SPA reactivity
- user manual
## 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 x importance x 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 x importance x 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)
- **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 housekeeping, 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 housekeeping. 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 session-open (no hot reload into an open
session). Packages carry authored content only -- `canon/`, `db/`,
`dumps/`, `log/`, `manifests/`, `sessions/` are all state and are
2026-11-17 22:35:44 +00:00
born in the run at creation. (Amended 2026-11-16: the turn-0.md
opener is retired -- the opening is her authored turn in
carryover.jsonl, GM-written, whose authored blocks are the state
seed; the start gate lints it and the old opening event is inert
history.)
- **The seed is initial state of the run.** (Superseded 2026-11-15,
the dormant-session rework: seed.json is gone. Its successors are
carryover.jsonl -- the authored opening turn, whose authored blocks
are the state seed -- and memory.json, authored draft material
applied by the start gate's reapply over a fresh db.)
- **Per-run model selection.** `server.json` names one endpoint
2026-11-17 22:35:44 +00:00
(baseUrl, key) plus default models (player, housekeeper). A run
carries per-run overrides for both roles (`run.json` `models:
{player, housekeeper}`, wired in the SPA 2026-11-14 -- setup for
drafts, the play aside for started runs; each call resolves fresh,
so a mid-session switch takes the next turn) -- the comparison rig:
same package, different models, identical prompts. (Amended
2026-11-16, model discovery: the upstream listing is never queried
in play -- state/models.json is the registry of selectable models,
written by the op's two-step discover/refine act and gating all
model use; server.json's explicit pick beats the registry's
discovered default.) Which model the housekeeper DEFAULT points at
stays open (#16); the mechanism is settled.
- **The player prompt is battery included, split along ownership seams
(ruled 2026-11-13; cut executed by the GM 2026-11-14).** Three tiers,
three files:
1. **Substrate facts** -- `invariants.md`, repo-fed at assembly, never
copied, travels with the code: the syntax markers the renderer
parses registers by (plain = speech, *italic* = narration,
single-paren OOC), the tool-channel contract, the memory contract,
2026-11-17 22:35:44 +00:00
records availability via the tool list, the block transport
**and the status's three-part admission gate** (moved into the
substrate tier in the GM's cut). (Amended 2026-11-16, the
full-block protocol: the delta verbs retired -- the player emits
whole `<status>`/`<agenda>` lists, absent means unchanged, and
the `<sheet>` channel joined 2026-11-17.)
Implementation-agnostic by design: storage details
unimportant, the tool manifest is self-describing.
2. **Opening + guards** -- `system.md`, per-project, repo-fed, never
copied: the glossary, the purpose statement, the input-validation
bucket model, the four communication layers, the addresses-the-
model rule, the Refuse cases. The deployment owner tunes the house
security posture; individual runs never carry it. (`guards.md` as
a separate file is dead -- the guards live in system.md.)
3. **Craft** -- `handbook.md`, copied per run at creation, freely
editable: the shape of play, thoughts, purview, time skips,
continuity, 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 (confirmed 2026-11-14): one system-role message, assembled
in order -- `system.md`, `invariants.md` (both repo-fed), then the
run's `handbook.md` copy -- then the rest of the bundle as GM
messages. The payoff: repo-level tweaks to the opening, guards, and
substrate reach existing runs; craft edits are per-run. The GM's cut
also resolved the OOC syntax conflict (system.md no longer teaches
`((double parens))`).
Amendment (GM, 2026-11-14): `housekeeper.md` is repo-fed at housekeeping,
never copied into a run, never user-exposed. The seam is not
machinery vs taste but the exposure rule: everything that enters
the bundle is inspectable read-only (`system.md`, `invariants.md`
included -- the user should understand how the model is prompted);
`housekeeper.md` never enters the bundle -- it prompts the separate
internal housekeeper agent.
- **The audit moved into the run.** Runs are gitignored, so the
commit-per-pass ritual is retired. At apply time the clerk snapshots
`dumps/w<N>.sql`; post-apply review is async -- the session 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.
2026-11-17 22:35:44 +00:00
- **The service step is later, with its own design round.** (Amended
2026-11-14: the auth/invites/multiuser half is BUILT -- see DECISIONS
#22-31; the service step that remains is the hosting story alone --
clone-and-run already works, a running instance is one deployment
away.)
- **Boutique is dormant** -- a stub that never reached its design step;
untouched until its drafting session.
2026-11-15 22:37:06 +00:00
- **Stack: zero-dependency runtime** (DECISIONS #4, amended
2026-11-15). `node:http` with a hand-rolled router, no-build
vanilla ES-module SPA; clone-and-run with node alone. Dev tooling
is exempt: `typescript` + `@types/node` type-check the JSDoc
annotations (`tsc` no-emit -- everything stays `.mjs`). The hard
parts of this project are prompt-side and clerk-side; the web side
at loopback single-user scale is the easy part.
## The multiuser server (2026-11-14, GM)
2026-11-17 22:35:44 +00:00
BUILT (2026-11-14, mock-proven end to end) and retired from the
roadmap in the 2026-11-17 audit. The durable record: the rulings in
DECISIONS #22-31, the surface rules in README (ownership, the
story's public read, invites, forks, ownerless runs), the design
history in the git log. The one open tail from that round -- proper
user lifecycle and auth story (sign-out, token expiry, multiple
devices) -- remains a distant extension point: signing in is
permanent and per-browser, and revisit waits for a real need.
## SPA v1 -- substrate decisions (2026-11-12, GM)
2026-11-17 22:35:44 +00:00
BUILT, and retired from the roadmap in the 2026-11-17 audit: the
phasing completed 2026-11-14 (all four phases), the API sketch was
superseded by README's living API documentation, and the substrate
doctrine it fixed -- the log is truth and the context a projection,
thinking never returns, OOC is the paren channel, the context meter,
the reminder's single-copy policy -- lives in README. What the audit
kept from this section is the one design not yet built:
- **Turn surgery -- BUILT as the rewind (2026-11-17).** The GM took
"session rewind" off the operator queue and ruled the simpler
design: rewrite-here stands (an unfortunate GM turn is re-sent,
everything after it leaves the live context), but the mechanism is
physical truncation at the send, not typed cut events -- fork is
the preservation story (fork before rewinding keeps the branch; no
fork, no archaeology). Window-scoped stands by construction: the
rings never move mid-session, so a live-session cut needs zero
compensation, and post-housekeeping corrections remain proper
retcons. The floor is the start marker (the frozen opening);
every send guards staleness via `expect` (the log line count it
was composed against). The full rulings live in the amendment
under DECISIONS #15. The records verbs are off until they are
rewind-compatible (same ruling) -- the journaled-mutator
compensation the original saga rule sketched is what their return
build owes.
## The steal list (work point by point)
### 2. Turn surgery: /retry, /edit in the bridge -- BUILT AS THE REWIND (2026-11-17)
Rewrite-here, not fork-here, exactly as decided (DECISIONS #15); the
build's amendment lives there too. What the build changed from the
original sketch: the jsonl keeps no surgery entries -- the send that
carries `rewind` truncates the log to its target and lands the new
turn in one commit (fork is the preservation story), and /retry never
existed -- resending the same words after a rewind is the retry
(the GM had no recollection of where /retry even came from; dropped).
The bridge itself was retired before this ever built; the feature
lives in the server's turn loop. The records half of the saga rule
(journaled-mutator compensation) is owed when the records tools
return.
### 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).
### 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-session; a marathon session has no relief valve.
Current answer: close the session. Fine for the test; revisit if real
sessions regularly overflow.
Status: DEFERRED.
## Deferred tasks (ruled out of the dormant-session rework, 2026-11-15)
- **Save-as-package beyond drafts.** Today it fires only from
never-started runs. Opening it to any dormancy raises unanswered
questions: which carryover rides (the dormant session's story tail
vs session-1's spent authored opening), which memory (the authored
memory.json vs evolved rings -- needs a rings-to-manifest export),
whether spent carryovers survive start. All questions open. The
principle proposed, not ruled: a package is a starting point, never
a snapshot -- fork is the continue-this-story verb.
2026-11-17 22:35:44 +00:00
- **The carryover editor.** (Amended 2026-11-17: the raw surface
exists -- the file editor edits a continuation carryover during
dormancy, save-linted, blocks included.) What remains deferred is
the purpose-built editing surface over the dormant view's
read-only render.
- **gm.md desync on rewind (GM, 2026-11-17).** Notes taken at turn
30 survive a rewind to turn 20, orphaned from the narrative --
references to events that never happened. Parked: nothing
mechanical is safe there (the substrate cannot know which note
lines anchor to which turns); the honest tools are GM discipline
and fork-covers-it (the fork copies the notepad with the branch).
2026-11-16 23:52:58 +00:00
## Distant extension points (someday, not scheduled)
2026-11-17 22:35:44 +00:00
- **the bookkeeper: a sheet-keeping agent.** The GM is the sheet's
author and its error model (GM, 2026-11-17: the counts are the
GM's job). When keeping the papers correct becomes unproductive
bother, an internal agent -- the housekeeper's arithmetic sibling,
never model-facing -- reads the setting's rules prose and the
latest turns, computes the ledger delta (a purchase in her prose
applied against the catalog), and lands it as a STAGED sheet edit
with a pending marker: applied when the GM's next turn rides, or
discarded. Sheet-only authority, strictly-validated output, a bad
day falls back to no-change (the curator pattern); per-package
opt-in, because an agent cannot bookkeep what is not arithmetic.
The tabletop metaphor bends here on purpose (players hold their
own pencils in the real thing): the deviation is substrate
pragmatism, drift-proofing, not realism.
2026-11-16 23:52:58 +00:00
- **n-choice inference composed by a turn-editor agent.** The
provider's `n` parameter asks for several statistically independent
completions of the same prompt -- the same moment re-rolled by the
dice, where variant literature is her deliberate alternatives. The
composition: request n choices, hand them to a turn-editor agent
that splices/edits them into the one turn that lands. Open
questions if it ever earns a keep: who edits (the agent's brief,
the GM's veto), what the log keeps (every choice belongs on the
raw surface, and the variance metric wants them -- today the loop
reads choices[0] only), cost (every choice bills its completion
tokens), provider support (patchy outside the first-party APIs --
the discovery battery would need to probe it), and the knob
surface (`n` is not a named knob; whose is it to set?). Until
then, variant literature plus the crypto pick is the ruled
mechanism for chance in play.
## 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.