[PR #1566] [MERGED] fix(long-term-memory): share only a character-scoped memory read with other packages (1.4.83) #1568

Closed
opened 2026-10-23 04:03:14 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Agents/pull/1566
Author: @Promansis
Created: 10/22/2026
Status: ✅ Merged
Merged: 10/22/2026
Merged by: @Promansis

Base: staging ← Head: fix(long-term-memory)/storage-service-read


📝 Commits (2)

  • 9cea17d fix(long-term-memory): share only a character-scoped memory read with other packages (#1565)
  • 0f10c9d chore(long-term-memory): release 1.4.83 (#1565)

📊 Changes

16 files changed (+219 additions, -99 deletions)

View changed files

➕ artifacts/long-term-memory-1.4.83.zip (+0 -0)
📝 catalog/catalog.json (+6 -6)
📝 catalog/notes.json (+6 -6)
📝 catalog/v2/catalog.json (+6 -6)
📝 catalog/v2/notes.json (+6 -6)
📝 catalog/v3/catalog.json (+6 -6)
📝 catalog/v3/notes.json (+6 -6)
📝 packages/long-term-memory/CHANGELOG.md (+4 -0)
📝 packages/long-term-memory/docs/ARCHITECTURE.md (+13 -6)
📝 packages/long-term-memory/manifest.json (+3 -3)
📝 packages/long-term-memory/server.mjs (+43 -43)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/server-entry.ts (+5 -5)
➕ packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/services/storage-read.ts (+42 -0)
📝 scripts/build-feature-packages.mjs (+1 -1)
📝 tests/long-term-memory-routes.regression.ts (+12 -4)
📝 tests/long-term-memory-runtime.regression.ts (+60 -1)

📄 Description

Pull request

Linked issue

Closes #1565

Why this change

  • Long-Term Memory has registered an Engine service, long-term-memory:storage, since 1.0.0. It hands out { root, storage, drafts }: the vault folder, the whole memory store and the suggestion store. Since Engine 2.5.1 any installed package can look up another package's service, so any package can list every memory, including memories limited to one chat, and create, change or delete memories and suggestions.
  • The Engine doesn't use this service. Slurp reads one thing through it: a character's own memories for its flavour brief ("What your other Agents know").

What changed

  • long-term-memory: the storage service now offers one read, the memories available to a character everywhere. The service key and the call Slurp makes keep their shape.
 activate
-  registerService("long-term-memory:storage", { root, storage, drafts })
+  registerService("long-term-memory:storage", createLtmStorageReadService(storage))
+    storage.listNotes({ type?, characterIds })   # 1 to 100 character ids; any other field is ignored
+      memories available to those characters      # a chat-only memory never matches a character
+      minus imported sources, archived and game-only memories
+      no character ids or a malformed filter -> []
  • New services/storage-read.ts: the filter is checked with zod, and only type and characterIds reach the store, so a chat or group id in the filter can't open chat-limited memories. Malformed vault files are skipped, as in chat recall.
  • Imported sources are left out: an imported chat summary's source memory is available to the summary's chat and to the destination characters, so a character query would otherwise return the raw summary text.
  • server-entry.ts registers the read in place of { root, storage, drafts }. The routes regression took the store from the service; it now opens the store on the same folder directly.
  • docs/ARCHITECTURE.md names the new services/ folder and the rule that anything handed to other packages lists only memories available everywhere.
  • Regression extended in tests/long-term-memory-runtime.regression.ts. CHANGELOG entry; rebuilt packages/long-term-memory server bundle, manifest, artifact and catalog entries as 1.4.83.

Package and security impact

  • Affected package IDs: long-term-memory
  • Engine compatibility impact: none. The service key stays, so Engine 2.5.1 lookups still find it.
  • New or changed permissions/entrypoints: no manifest change. The object registered for long-term-memory:storage shrinks from { root, storage, drafts } to { storage: { listNotes } }.
  • Restart, storage, update, or uninstall impact: none. No stored memory, setting or index changes. Slurp 0.3.53 keeps working with the same call and memory shape; the one difference is that a game-only character memory no longer reaches a feed post. Rolling back to 1.4.82 restores the old object.

Validation

  • node scripts/validate-catalog.mjs passes locally
  • git diff --check passes locally
  • Rebuilt every affected manifest, payload, artifact, and catalog entry
  • Installed or updated the affected package through Marinara Engine
  • Checked supported modes, restart behavior, and uninstall cleanup
  • Read and followed CONTRIBUTING.md

Manual verification notes

  • The runtime regression checks the registered service and a separate vault with eight memories: available to the character; to a chat and the character; to a chat only; to another character; archived; game-only; an imported chat summary for that chat and character; the character's own character memory.
services.get("long-term-memory:storage")
  before: { root, storage, drafts }
  after:  { storage: { listNotes } }
listNotes({ characterIds: ["char-a"] })  -> the first two and the character memory
listNotes({}) / ({ characterIds: [] })   -> []
listNotes({ characterIds: ["char-a"], chatId: "chat-a" }) -> same as without the chat id
  • On staging a6e2b20ce's server-entry.ts, the new regression fails at "the storage service must not hand out the vault folder or drafts". With the fix it passes. Letting imported sources through, or allowing an empty character list, fails the matching assertion.
  • On the implementation commit 9cea17dce: package typecheck, format and lint, the feature build, the typecheck regression and every CI-listed Long-Term Memory suite run one by one (31, plus the regression helpers) passed, including runtime, routes, browser and installation.
  • On the release commit 0f10c9d7b (1.4.83): the rebuild is clean, and the fast checks, the package typecheck, the runtime, routes and installation suites, and the catalog-lane, locale, catalog and release-notes checks pass. Hosted CI runs the full regression set.
  • Not installed through a running Engine; the installation suite installs the rebuilt archive.

Documentation impact

  • No documentation changes needed
  • Updated this README catalog and package guidance
  • Updated linked Marinara Engine documentation

packages/long-term-memory/docs/ARCHITECTURE.md describes the shared read.

UI evidence (if applicable)

No UI change.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Other installed agents can read memories available to a character everywhere, including roleplay- and conversation-compatible notes.
  • Privacy
    • Chat- or group-limited memories, imported sources, archived or game-only memories, drafts, suggestions, and the vault folder remain private.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Agents/pull/1566 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 10/22/2026 **Status:** ✅ Merged **Merged:** 10/22/2026 **Merged by:** [@Promansis](https://github.com/Promansis) **Base:** `staging` ← **Head:** `fix(long-term-memory)/storage-service-read` --- ### 📝 Commits (2) - [`9cea17d`](https://github.com/Pasta-Devs/Marinara-Agents/commit/9cea17dcebcee6cd0b72b1fc80675af4a47157b7) fix(long-term-memory): share only a character-scoped memory read with other packages (#1565) - [`0f10c9d`](https://github.com/Pasta-Devs/Marinara-Agents/commit/0f10c9d7bc26e46765778f8c2b4c4d999116b106) chore(long-term-memory): release 1.4.83 (#1565) ### 📊 Changes **16 files changed** (+219 additions, -99 deletions) <details> <summary>View changed files</summary> ➕ `artifacts/long-term-memory-1.4.83.zip` (+0 -0) 📝 `catalog/catalog.json` (+6 -6) 📝 `catalog/notes.json` (+6 -6) 📝 `catalog/v2/catalog.json` (+6 -6) 📝 `catalog/v2/notes.json` (+6 -6) 📝 `catalog/v3/catalog.json` (+6 -6) 📝 `catalog/v3/notes.json` (+6 -6) 📝 `packages/long-term-memory/CHANGELOG.md` (+4 -0) 📝 `packages/long-term-memory/docs/ARCHITECTURE.md` (+13 -6) 📝 `packages/long-term-memory/manifest.json` (+3 -3) 📝 `packages/long-term-memory/server.mjs` (+43 -43) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/server-entry.ts` (+5 -5) ➕ `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/services/storage-read.ts` (+42 -0) 📝 `scripts/build-feature-packages.mjs` (+1 -1) 📝 `tests/long-term-memory-routes.regression.ts` (+12 -4) 📝 `tests/long-term-memory-runtime.regression.ts` (+60 -1) </details> ### 📄 Description # Pull request ## Linked issue Closes #1565 ## Why this change - Long-Term Memory has registered an Engine service, `long-term-memory:storage`, since 1.0.0. It hands out `{ root, storage, drafts }`: the vault folder, the whole memory store and the suggestion store. Since Engine 2.5.1 any installed package can look up another package's service, so any package can list every memory, including memories limited to one chat, and create, change or delete memories and suggestions. - The Engine doesn't use this service. Slurp reads one thing through it: a character's own memories for its flavour brief ("What your other Agents know"). ## What changed - `long-term-memory`: the storage service now offers one read, the memories available to a character everywhere. The service key and the call Slurp makes keep their shape. ```diff activate - registerService("long-term-memory:storage", { root, storage, drafts }) + registerService("long-term-memory:storage", createLtmStorageReadService(storage)) + storage.listNotes({ type?, characterIds }) # 1 to 100 character ids; any other field is ignored + memories available to those characters # a chat-only memory never matches a character + minus imported sources, archived and game-only memories + no character ids or a malformed filter -> [] ``` - New `services/storage-read.ts`: the filter is checked with zod, and only `type` and `characterIds` reach the store, so a chat or group id in the filter can't open chat-limited memories. Malformed vault files are skipped, as in chat recall. - Imported sources are left out: an imported chat summary's source memory is available to the summary's chat and to the destination characters, so a character query would otherwise return the raw summary text. - `server-entry.ts` registers the read in place of `{ root, storage, drafts }`. The routes regression took the store from the service; it now opens the store on the same folder directly. - `docs/ARCHITECTURE.md` names the new `services/` folder and the rule that anything handed to other packages lists only memories available everywhere. - Regression extended in `tests/long-term-memory-runtime.regression.ts`. CHANGELOG entry; rebuilt `packages/long-term-memory` server bundle, manifest, artifact and catalog entries as 1.4.83. ## Package and security impact - Affected package IDs: `long-term-memory` - Engine compatibility impact: none. The service key stays, so Engine 2.5.1 lookups still find it. - New or changed permissions/entrypoints: no manifest change. The object registered for `long-term-memory:storage` shrinks from `{ root, storage, drafts }` to `{ storage: { listNotes } }`. - Restart, storage, update, or uninstall impact: none. No stored memory, setting or index changes. Slurp 0.3.53 keeps working with the same call and memory shape; the one difference is that a game-only character memory no longer reaches a feed post. Rolling back to 1.4.82 restores the old object. ## Validation - [ ] `node scripts/validate-catalog.mjs` passes locally - [ ] `git diff --check` passes locally - [ ] Rebuilt every affected manifest, payload, artifact, and catalog entry - [ ] Installed or updated the affected package through Marinara Engine - [ ] Checked supported modes, restart behavior, and uninstall cleanup - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes - The runtime regression checks the registered service and a separate vault with eight memories: available to the character; to a chat and the character; to a chat only; to another character; archived; game-only; an imported chat summary for that chat and character; the character's own character memory. ```text services.get("long-term-memory:storage") before: { root, storage, drafts } after: { storage: { listNotes } } listNotes({ characterIds: ["char-a"] }) -> the first two and the character memory listNotes({}) / ({ characterIds: [] }) -> [] listNotes({ characterIds: ["char-a"], chatId: "chat-a" }) -> same as without the chat id ``` - On staging a6e2b20ce's `server-entry.ts`, the new regression fails at "the storage service must not hand out the vault folder or drafts". With the fix it passes. Letting imported sources through, or allowing an empty character list, fails the matching assertion. - On the implementation commit 9cea17dce: package typecheck, format and lint, the feature build, the typecheck regression and every CI-listed Long-Term Memory suite run one by one (31, plus the regression helpers) passed, including runtime, routes, browser and installation. - On the release commit 0f10c9d7b (1.4.83): the rebuild is clean, and the fast checks, the package typecheck, the runtime, routes and installation suites, and the catalog-lane, locale, catalog and release-notes checks pass. Hosted CI runs the full regression set. - Not installed through a running Engine; the installation suite installs the rebuilt archive. ## Documentation impact - [ ] No documentation changes needed - [ ] Updated this README catalog and package guidance - [ ] Updated linked Marinara Engine documentation `packages/long-term-memory/docs/ARCHITECTURE.md` describes the shared read. ## UI evidence (if applicable) No UI change. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **New Features** * Other installed agents can read memories available to a character everywhere, including roleplay- and conversation-compatible notes. * **Privacy** * Chat- or group-limited memories, imported sources, archived or game-only memories, drafts, suggestions, and the vault folder remain private. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:03:14 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Agents#1568
No description provided.