mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #6696] [Feature]: Game Mode long campaigns: campaign-wide memory, continuity, Campaign Wiki and cache-stable Game prompts #3751
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#3751
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @SirAdoni on GitHub (Sep 26, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/6696
Originally assigned to: @SpicyMarinara on GitHub.
Part of the contribution roadmap in #6624 (Game Mode theme 1 of 3).
What problem does this solve?
Game Mode works well within a session. Across a long campaign of many sessions, a few things get harder:
Proposed solution
These build on what Game Mode already has: the session recap, the Lorebook Keeper, the journal, the NPC tracking and the cache-friendly prompt work in package F.
Campaign memory
Continuity pipeline (per game, off until turned on)
Campaign Wiki
NPCs and scenes
Game prompt caching and cost
How it's switched: every piece sits behind a switch or a per-game or per-chat setting: the continuity pipeline (per game), campaign memory scope (per chat), Scene timeline (per game), ChatGPT history replay, Cache-stable Game prompt, Session-frozen NPC cards, Stable lore order (with Linger turns) and the final-checks opt-in (per chat). The fork turns most of them on; the upstream versions will default off, and off keeps today's prompts and data byte for byte, checked by regressions that compare the off path with
staging.packages/server/src/services/game: campaign memory, continuity, session summary and conclusion, scene timeline, NPC sync and backfill, named-card cache, GM prompts, Lorebook Keeper integration, codexpackages/server/src/services/generation: GM prompt runtime, game lore prompt, new stable layout and history replay modulespackages/server/src/services/lorebook: stable lore order;services/llm/providers: ChatGPT cache helper, Anthropic marker placementpackages/server/src/routes: generate, game, new campaign memory, campaign index and continuity routespackages/server/src/db/schemaandservices/storage: campaign memory and game continuity tablescomponents/game: Campaign Wiki, Memory panel, continuity panel, scene timeline, GM reasoning effort sectionpackages/shared: memory and continuity types, NPC id helpers, feature switch registryAlternatives considered
Additional context
Screenshots
Taken from the fork build with invented demo data (characters, lorebooks and a campaign made up for these shots). Model replies and token counts come from a local test stub, so no real model was called.
Campaign Wiki front page: people, player characters, organizations and lore across sessions, with recent changes.
A wiki page: facts grouped by session, the source quote, who else knows it, and Correct or Wrong.
The Memory panel: mode, how the GM uses memory, campaign or session scope, and the memory budget.
A concluded session's recap with resume point, discoveries, character moments and NPC updates.
Indexing an existing campaign: what will be read, per-session progress, and a quota warning before anything starts.
Template check
@SpicyMarinara commented on GitHub (Sep 26, 2026):
@kolacheee, tagging you since you've been working on Game mode; please check if this doesn't overlap with what you're doing.
@kolacheee commented on GitHub (Sep 27, 2026):
@SirAdoni, nothing here blocks my Game Mode work either, but a few seams to keep in mind:
Cache-stable Game prompt. The Game Master's format reminder after the history carries values that change every turn:
<character_sheets>);Those need to stay in the live tail rather than the cached baseline. The command grammar lines (
[sheet:],[inventory:]) are fixed per game, so they could move into the baseline.Session start and conclusion. The carry-over in
POST /session/startnow carries every party member's bag (carryGameInventory) and the ruleset sheets. Please keep both when adding party memory there.NPC ids. Inventory bags name their holder by the character's name, the same way ruleset sheets and live sheet state are keyed. If stable NPC ids land, bags could move onto them, so a heads-up when that PR is up would help.
generate.routes.ts. Inventory tags are now carried out right after the reply is saved (#6772). Changes to the post-generation flow should keep that step after the save.Caching. My earlier caching audit (#6217 to #6222) is already closed, so nothing of mine is open there. Any further caching work I had in mind I'll leave to Package F and the Game caching work here rather than build something in parallel.