mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
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#6518
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?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/4852
Author: @kolacheee
Created: 8/10/2026
Status: ✅ Merged
Merged: 8/10/2026
Merged by: @kolacheee
Base:
staging← Head:feat/4851-mari-instructions-memory📝 Commits (1)
1bab3eefeat(mari): give Professor Mari a persistent, retrievable memory (#4851)📊 Changes
17 files changed (+1795 additions, -15 deletions)
View changed files
📝
CHANGELOG.md(+1 -0)📝
docs/home/professor-mari.md(+19 -0)📝
package.json(+2 -1)📝
packages/client/src/components/chat/HomeProfessorMariChat.tsx(+557 -4)📝
packages/client/src/localization/locales/en.json(+23 -0)📝
packages/server/src/db/file-backed-store.ts(+1 -0)📝
packages/server/src/db/schema/index.ts(+1 -0)➕
packages/server/src/db/schema/mari-instructions.ts(+28 -0)📝
packages/server/src/routes/professor-mari-workspace.routes.ts(+69 -1)📝
packages/server/src/services/mari-db/mari-db.service.ts(+315 -5)➕
packages/server/src/services/professor-mari/mari-instructions-prompt.ts(+101 -0)📝
packages/server/src/services/professor-mari/workspace-agent.service.ts(+29 -4)➕
packages/server/src/services/storage/mari-instructions.storage.ts(+158 -0)📝
packages/shared/src/types/professor-mari-workspace.ts(+26 -0)📝
scripts/regressions/mari-db-review-durability.regression.ts(+63 -0)➕
scripts/regressions/mari-instructions-memory.regression.ts(+374 -0)📝
scripts/regressions/open-issues.regression.ts(+28 -0)📄 Description
Linked issue
Closes #4851
Why this change
Professor Mari had no persistent memory of a user's preferences across sessions: every conversation, the user re-explains how they like lorebooks/characters formatted, their conventions, and how eager they want her to be about editing. Behavior also wasn't user-configurable: after #4813/#4816/#4838 tightened her to confirm before editing (the right default), users who preferred the older "just make the edit" behavior had no way to opt back in. The maintainer approved the feature request, with one caveat: watch for token bloat, which is exactly what the index-and-fetch retrieval here is designed around.
What changed
A persistent, retrievable memory for Professor Mari (the Home workspace agent), with both a chat flow and a management panel.
mari_instructionsfile-native table (registered in the schema barrel +FILE_BACKED_TABLES; noSTORAGE_VERSIONbump, since an additive table is backward/forward-compatible and the launcher-format-guard pairing stays at 4) plus amari-instructions.storage.tsmodule. Deliberately not namedmemory_*(that namespace already means conversation-RAGmemory_chunks,agent_memory, scene memories, and the "Important Memories" block).<professor_mari_memory>block; full bodies are pulled on relevance withinstruction.get. A Persistent memory inlines its body every turn (for the rare directive that must not risk a fetch-miss). Aggregate caps on the index and persistent bodies, with honest "N more not shown" reporting (never silent truncation). Injected fields are sanitized so a memory can't forge the block boundary or fake index lines. Rendering lives in a pure, unit-tested helper (renderMariMemoryPrompt).instruction.list | get | remember | update | forget(with amemory.*alias). Reads classify read-only;remember/update/forgetrun through the existing mutation pipeline, so every memory Mari writes shows a Keep/Restore review card with the exact text before it persists. Over-cap fields are rejected with a clear error, never silently truncated.mari_instructionsinserts). This is defense-in-depth: even a hypothetically-planted memory can't take effect until the user explicitly enables it..md/text Upload. Panel writes go directly through reset-free/instructionsroutes (the user is the reviewer of their own memory, so no Keep/Restore card and, critically, noworkspaceService.reset()that would tear down Mari's live chat session).regression:mari-instructionslane drives the realMariDbService+ the pure renderer through remember/list/get/update/forget + Keep/Restore round-trip, thememory.*alias, disabled-by-default, Keep & Enable, the direct panel create/update/remove path, the Persistent flag, over-cap rejection, and the token-bloat + injection-forgery invariants.docs/home/professor-mari.md"Saved memories" section and a CHANGELOG entry.Out of scope (planned follow-ups): a semantic-ranked index at scale; per-chat vs. global scope; translating the new UI/docs strings to the non-English packs (docs-i18n follow-up #4853).
Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Automated checks already run by the author (please re-run to tick the boxes):
pnpm checkpasses (tsc + lint + client build), on top of a fresh rebase ontostaging.regression:mari-instructionspasses (server engine + renderer + panel storage + Keep & Enable), plusregression:mari-preset-granular,regression:mari-review-durability,professor-mari-prompt-context,professor-mari-documentation,docs-language,localization-key-references(en at 100%),launcher-format-guard, andfile-backed-shutdown.Manual verification still needed (needs a configured LLM connection and/or a real browser, so the owner must do this):
.md, and delete one. Confirm each round-trips and the panel styling matches the Skills panel in light + dark mode and at a mobile width.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)Docs: updated
docs/home/professor-mari.md("Saved memories") andCHANGELOG.md. The docs-i18n follow-up for the new doc + UI strings is #4853.UI evidence (if applicable)
Summary by CodeRabbit
Summary by CodeRabbit
New Features
Documentation
Tests
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.