[PR #1537] [MERGED] fix(long-term-memory): offer a chat's changes to a shared memory for review instead of forking a private copy (#1533) #1534

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

📋 Pull Request Information

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

Base: staging ← Head: fix(long-term-memory)/shared-memory-review-suggestion


📝 Commits (4)

  • 0f62ea3 fix(long-term-memory): offer a chat's changes to a shared memory for review instead of forking a private copy (#1533)
  • d69149a chore(long-term-memory): release 1.4.70 (#1533)
  • 63cca0e fix(long-term-memory): leave a memory shared after extraction for Review in low-risk auto-apply (#1533)
  • b35eff8 chore(long-term-memory): release 1.4.70 (#1533)

📊 Changes

18 files changed (+633 additions, -100 deletions)

View changed files

➕ artifacts/long-term-memory-1.4.70.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/manifest.json (+3 -3)
📝 packages/long-term-memory/server.mjs (+41 -41)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/drafts/draft-projector.ts (+3 -2)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/drafts/draft-review.ts (+15 -1)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/drafts/reconciliation.ts (+34 -6)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/extraction/evidence-unit-compiler.ts (+11 -1)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/extraction/scoped-targets.ts (+22 -4)
📝 scripts/build-feature-packages.mjs (+1 -1)
📝 tests/long-term-memory-delta-review.regression.ts (+21 -1)
📝 tests/long-term-memory-extraction-graph.regression.ts (+442 -4)

📄 Description

Pull request

Linked issue

Closes #1533

Why this change

  • When you share a memory with a character and its chat keeps adding to it, extraction never updates the shared memory: #1028's privacy rule blocks a chat-only source from writing into a memory visible outside the chat, so it silently writes a private copy for that chat instead. The chat then recalls two versions (the shared one frozen at the moment you shared it, and the copy), the character's other chats never see the update, and nothing tells you. In a live-extraction benchmark on a real vault, about a fifth of "new" world memories per run were such copies.
  • This keeps #1028's rule (nothing reaches a shared memory without review, and a review writes only the rows you selected plus the link and event they need) but makes the update reviewable: Review offers the change on the shared memory itself, marked as also reaching where the memory is shared.
  • It replaces one line of 1.3.14 ("Fork new chat-only evidence instead of adding it to a previously broader memory"). The fork becomes a review suggestion; the automatic write that 1.3.14 prevented stays prevented.

What changed

  • long-term-memory:
    • Extraction keeps a memory as the target when its scope includes the whole source scope and more, the identity matches, and the source has no copy of it yet (isSharedLtmScopedTarget).
    • Those changes are never low risk.
    • The projector shows them in Review with a shared_memory_update warning on each row.
    • Apply writes to a shared memory only when every change to it is named in the apply; Review names the rows you selected plus the link and event they need. Auto-apply cannot: low-risk auto-apply leaves rows on a memory that is shared when it runs (for example one shared after extraction, whose rows kept their stored low risk) in Review instead of failing the batch. A row the apply did not name blocks it, and a shared event's own changes are no longer pulled in by a link to it.
    • A chat's existing copy keeps receiving that chat's changes. Memories from other chats and global memories still get a private copy.
  • Regressions in the delta-review and extraction-graph suites. The old case "chat-only evidence forks instead of updating a persona-visible memory" now expects a review target. New cases keep the fork for another chat's memory and keep a chat's existing copy.
  • Release: long-term-memory 1.4.70 on staging 5984f0784, with the CHANGELOG entry, version, manifest, rebuilt server.mjs, artifact and catalog entries.

Package and security impact

  • Affected package IDs: long-term-memory
  • Engine compatibility impact: none
  • New or changed permissions/entrypoints: none
  • Restart, storage, update, or uninstall impact: none to storage format. Existing private copies are not removed or migrated and keep their chat's updates; suggestions on the shared memory start for chats without a copy. Privacy boundary: only a reviewed apply that names every change to a shared memory can write it; auto-apply and auto-included rows fail closed.

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

  • On staging, the new extraction-graph case fails ("the chat's evidence must not fork a private copy of the shared memory") and the delta-review truth table fails (isSharedLtmScopedTarget is not a function). With the fix:
    • the chat's evidence is offered on the shared memory, not low risk and not auto-applied;
    • every Review row on it shows shared_memory_update;
    • low-risk auto-apply with every row forced to low risk leaves the shared memory's rows in Review and the memory unchanged (without the skip, the whole auto-apply fails with "belongs to another scope");
    • a reviewed apply is rejected once the memory belongs to another chat;
    • a Review accept updates it and keeps its character;
    • accepting a link to a shared event leaves the event's own change pending;
    • a change on a shared memory is blocked until its grounding link row is selected too;
    • a chat with an existing copy keeps updating the copy.
  • On the fix commit (base 5984f0784): typecheck, lint, the Pull Request Checks commands, the package build and every Long-Term Memory regression suite pass. On the release head: the package rebuild leaves the tree clean, the catalog, locale and release-notes checks and the typecheck pass, and the delta-review, extraction-graph and routes-drafts suites pass. Hosted CI runs the full suite list on this head.
  • To check in the app: share a chat's world memory with a character, continue the chat so it adds to that memory, run extraction, and confirm Review shows the change on the shared memory with the warning, and that no copy appears.

Documentation impact

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

UI evidence (if applicable)

  • n/a (server change; Review shows the new warning text through its existing per-row diagnostics)

🤖 Generated with Claude Code


🔄 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/1537 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 10/21/2026 **Status:** ✅ Merged **Merged:** 10/21/2026 **Merged by:** [@Promansis](https://github.com/Promansis) **Base:** `staging` ← **Head:** `fix(long-term-memory)/shared-memory-review-suggestion` --- ### 📝 Commits (4) - [`0f62ea3`](https://github.com/Pasta-Devs/Marinara-Agents/commit/0f62ea368a2f108558a17b967e4a89c1d0ea9c1a) fix(long-term-memory): offer a chat's changes to a shared memory for review instead of forking a private copy (#1533) - [`d69149a`](https://github.com/Pasta-Devs/Marinara-Agents/commit/d69149a168f3201fa241a7a7e1c1e8c7d71dee88) chore(long-term-memory): release 1.4.70 (#1533) - [`63cca0e`](https://github.com/Pasta-Devs/Marinara-Agents/commit/63cca0e938e6b2767e181a782dc36fa4fde5466a) fix(long-term-memory): leave a memory shared after extraction for Review in low-risk auto-apply (#1533) - [`b35eff8`](https://github.com/Pasta-Devs/Marinara-Agents/commit/b35eff813d142fd8ee029e1d84d1fd61ddf68b37) chore(long-term-memory): release 1.4.70 (#1533) ### 📊 Changes **18 files changed** (+633 additions, -100 deletions) <details> <summary>View changed files</summary> ➕ `artifacts/long-term-memory-1.4.70.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/manifest.json` (+3 -3) 📝 `packages/long-term-memory/server.mjs` (+41 -41) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/drafts/draft-projector.ts` (+3 -2) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/drafts/draft-review.ts` (+15 -1) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/drafts/reconciliation.ts` (+34 -6) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/extraction/evidence-unit-compiler.ts` (+11 -1) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/extraction/scoped-targets.ts` (+22 -4) 📝 `scripts/build-feature-packages.mjs` (+1 -1) 📝 `tests/long-term-memory-delta-review.regression.ts` (+21 -1) 📝 `tests/long-term-memory-extraction-graph.regression.ts` (+442 -4) </details> ### 📄 Description # Pull request ## Linked issue Closes #1533 ## Why this change - When you share a memory with a character and its chat keeps adding to it, extraction never updates the shared memory: #1028's privacy rule blocks a chat-only source from writing into a memory visible outside the chat, so it silently writes a private copy for that chat instead. The chat then recalls two versions (the shared one frozen at the moment you shared it, and the copy), the character's other chats never see the update, and nothing tells you. In a live-extraction benchmark on a real vault, about a fifth of "new" world memories per run were such copies. - This keeps #1028's rule (nothing reaches a shared memory without review, and a review writes only the rows you selected plus the link and event they need) but makes the update reviewable: Review offers the change on the shared memory itself, marked as also reaching where the memory is shared. - It replaces one line of 1.3.14 ("Fork new chat-only evidence instead of adding it to a previously broader memory"). The fork becomes a review suggestion; the automatic write that 1.3.14 prevented stays prevented. ## What changed - `long-term-memory`: - Extraction keeps a memory as the target when its scope includes the whole source scope and more, the identity matches, and the source has no copy of it yet (`isSharedLtmScopedTarget`). - Those changes are never low risk. - The projector shows them in Review with a `shared_memory_update` warning on each row. - Apply writes to a shared memory only when every change to it is named in the apply; Review names the rows you selected plus the link and event they need. Auto-apply cannot: low-risk auto-apply leaves rows on a memory that is shared when it runs (for example one shared after extraction, whose rows kept their stored low risk) in Review instead of failing the batch. A row the apply did not name blocks it, and a shared event's own changes are no longer pulled in by a link to it. - A chat's existing copy keeps receiving that chat's changes. Memories from other chats and global memories still get a private copy. - Regressions in the delta-review and extraction-graph suites. The old case "chat-only evidence forks instead of updating a persona-visible memory" now expects a review target. New cases keep the fork for another chat's memory and keep a chat's existing copy. - **Release:** `long-term-memory` 1.4.70 on staging 5984f0784, with the CHANGELOG entry, version, manifest, rebuilt `server.mjs`, artifact and catalog entries. ## Package and security impact - Affected package IDs: `long-term-memory` - Engine compatibility impact: none - New or changed permissions/entrypoints: none - Restart, storage, update, or uninstall impact: none to storage format. Existing private copies are not removed or migrated and keep their chat's updates; suggestions on the shared memory start for chats without a copy. Privacy boundary: only a reviewed apply that names every change to a shared memory can write it; auto-apply and auto-included rows fail closed. ## 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 - On `staging`, the new extraction-graph case fails ("the chat's evidence must not fork a private copy of the shared memory") and the delta-review truth table fails (`isSharedLtmScopedTarget is not a function`). With the fix: - the chat's evidence is offered on the shared memory, not low risk and not auto-applied; - every Review row on it shows `shared_memory_update`; - low-risk auto-apply with every row forced to low risk leaves the shared memory's rows in Review and the memory unchanged (without the skip, the whole auto-apply fails with "belongs to another scope"); - a reviewed apply is rejected once the memory belongs to another chat; - a Review accept updates it and keeps its character; - accepting a link to a shared event leaves the event's own change pending; - a change on a shared memory is blocked until its grounding link row is selected too; - a chat with an existing copy keeps updating the copy. - On the fix commit (base 5984f0784): typecheck, lint, the Pull Request Checks commands, the package build and every Long-Term Memory regression suite pass. On the release head: the package rebuild leaves the tree clean, the catalog, locale and release-notes checks and the typecheck pass, and the delta-review, extraction-graph and routes-drafts suites pass. Hosted CI runs the full suite list on this head. - To check in the app: share a chat's world memory with a character, continue the chat so it adds to that memory, run extraction, and confirm Review shows the change on the shared memory with the warning, and that no copy appears. ## Documentation impact - [ ] No documentation changes needed - [ ] Updated this README catalog and package guidance - [ ] Updated linked Marinara Engine documentation ## UI evidence (if applicable) - n/a (server change; Review shows the new warning text through its existing per-row diagnostics) 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:03:11 +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#1534
No description provided.