[PR #1034] [MERGED] fix(long-term-memory): prevent repeated scoped memories #1260

Closed
opened 2026-10-21 05:07:09 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: staging ← Head: fix(ltm)/1027-repeated-memories


📝 Commits (2)

  • 10891a5 fix(long-term-memory): scope repeated-memory deduplication (#1027)
  • b30471d fix(long-term-memory): drop wildcard scope in dedup fallback (#1027)

📊 Changes

14 files changed (+291 additions, -95 deletions)

View changed files

➕ artifacts/long-term-memory-1.3.12.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 (+43 -43)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/dedup.ts (+63 -10)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/evidence-unit-extraction.ts (+1 -1)
📝 scripts/build-feature-packages.mjs (+1 -1)
📝 tests/long-term-memory-extraction-graph.regression.ts (+140 -1)

📄 Description

Pull request

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #1027

Why this change

  • Repeated extractions could fork or suppress Long-Term Memory facts when equivalent character-name variants resolved to different note IDs or ranked retrieval omitted the canonical target.

What changed

  • Match duplicate evidence by canonical subjects as well as note ID while keeping comparisons isolated to the resolved target scope and section.
  • Preserve distinct subjects, scopes, sections, and additive facts, with regressions for legacy IDs, retrieval-missed targets, and overlapping scopes.
  • Release Long-Term Memory 1.3.12 and rebuild its server bundle, archive, release notes, and catalog lanes.

Package and security impact

  • Affected package IDs: long-term-memory
  • Engine compatibility impact: unchanged; Marinara Engine >=2.4.1 <4.0.0
  • New or changed permissions/entrypoints: none
  • Restart, storage, update, or uninstall impact: no schema or permission changes; installation, offline restart, backup, uninstall, reinstall, and durable-byte preservation were exercised by the LTM suite

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

  • MARINARA_AGENTS_ROOT="/home/damo/dev/marinara-worktrees/Marinara-Agents-1027-repeated-memories" MARINARA_ENGINE_ROOT="/home/damo/dev/Marinara-Engine" node scripts/build-feature-packages.mjs long-term-memory — passed; generated outputs remained clean.
  • MARINARA_AGENTS_ROOT="/home/damo/dev/marinara-worktrees/Marinara-Agents-1027-repeated-memories" MARINARA_ENGINE_ROOT="/home/damo/dev/Marinara-Engine" /home/damo/.config/opencode/marinara-agents-local/test-ltm.sh all — passed.
  • MARINARA_AGENTS_ROOT="/home/damo/dev/marinara-worktrees/Marinara-Agents-1027-repeated-memories" MARINARA_ENGINE_ROOT="/home/damo/dev/Marinara-Engine" /home/damo/.config/opencode/marinara-agents-local/test-ci.sh — passed.
  • Publication proof matched commit 10891a50631d15170a2bb5ce5f29dd51b8de2716; repair-delta review is delegated to CodeRabbit per maintainer direction.

Documentation impact

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

UI evidence (if applicable)

  • Not applicable; no UI changes.

Summary by CodeRabbit

  • Bug Fixes

    • Improved Long-Term Memory deduplication by recognizing equivalent memories across abbreviated and full-name subject variants.
    • Prevented duplicate memories from being created when canonical notes are missed during ranked retrieval.
    • Preserved separate memories for different subjects, scopes, sections, and genuinely new information.
    • Ensured deduplication remains limited to the relevant conversation or context scope.
  • Release

    • Updated the Long-Term Memory package to version 1.3.12.

🔄 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/1034 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 9/22/2026 **Status:** ✅ Merged **Merged:** 9/22/2026 **Merged by:** [@Promansis](https://github.com/Promansis) **Base:** `staging` ← **Head:** `fix(ltm)/1027-repeated-memories` --- ### 📝 Commits (2) - [`10891a5`](https://github.com/Pasta-Devs/Marinara-Agents/commit/10891a50631d15170a2bb5ce5f29dd51b8de2716) fix(long-term-memory): scope repeated-memory deduplication (#1027) - [`b30471d`](https://github.com/Pasta-Devs/Marinara-Agents/commit/b30471df914a85765c5fc54710131dd53d288f1a) fix(long-term-memory): drop wildcard scope in dedup fallback (#1027) ### 📊 Changes **14 files changed** (+291 additions, -95 deletions) <details> <summary>View changed files</summary> ➕ `artifacts/long-term-memory-1.3.12.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` (+43 -43) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/dedup.ts` (+63 -10) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/evidence-unit-extraction.ts` (+1 -1) 📝 `scripts/build-feature-packages.mjs` (+1 -1) 📝 `tests/long-term-memory-extraction-graph.regression.ts` (+140 -1) </details> ### 📄 Description # Pull request > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. <!-- Open as a draft while implementation is in progress. Mark Ready for review only after validation and self-review. --> ## Linked issue Closes #1027 ## Why this change - Repeated extractions could fork or suppress Long-Term Memory facts when equivalent character-name variants resolved to different note IDs or ranked retrieval omitted the canonical target. ## What changed - Match duplicate evidence by canonical subjects as well as note ID while keeping comparisons isolated to the resolved target scope and section. - Preserve distinct subjects, scopes, sections, and additive facts, with regressions for legacy IDs, retrieval-missed targets, and overlapping scopes. - Release Long-Term Memory `1.3.12` and rebuild its server bundle, archive, release notes, and catalog lanes. ## Package and security impact - Affected package IDs: `long-term-memory` - Engine compatibility impact: unchanged; Marinara Engine `>=2.4.1 <4.0.0` - New or changed permissions/entrypoints: none - Restart, storage, update, or uninstall impact: no schema or permission changes; installation, offline restart, backup, uninstall, reinstall, and durable-byte preservation were exercised by the LTM suite ## 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 - `MARINARA_AGENTS_ROOT="/home/damo/dev/marinara-worktrees/Marinara-Agents-1027-repeated-memories" MARINARA_ENGINE_ROOT="/home/damo/dev/Marinara-Engine" node scripts/build-feature-packages.mjs long-term-memory` — passed; generated outputs remained clean. - `MARINARA_AGENTS_ROOT="/home/damo/dev/marinara-worktrees/Marinara-Agents-1027-repeated-memories" MARINARA_ENGINE_ROOT="/home/damo/dev/Marinara-Engine" /home/damo/.config/opencode/marinara-agents-local/test-ltm.sh all` — passed. - `MARINARA_AGENTS_ROOT="/home/damo/dev/marinara-worktrees/Marinara-Agents-1027-repeated-memories" MARINARA_ENGINE_ROOT="/home/damo/dev/Marinara-Engine" /home/damo/.config/opencode/marinara-agents-local/test-ci.sh` — passed. - Publication proof matched commit `10891a50631d15170a2bb5ce5f29dd51b8de2716`; repair-delta review is delegated to CodeRabbit per maintainer direction. ## Documentation impact - [ ] No documentation changes needed - [ ] Updated this README catalog and package guidance - [ ] Updated linked Marinara Engine documentation ## UI evidence (if applicable) - Not applicable; no UI changes. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved Long-Term Memory deduplication by recognizing equivalent memories across abbreviated and full-name subject variants. * Prevented duplicate memories from being created when canonical notes are missed during ranked retrieval. * Preserved separate memories for different subjects, scopes, sections, and genuinely new information. * Ensured deduplication remains limited to the relevant conversation or context scope. * **Release** * Updated the Long-Term Memory package to version 1.3.12. <!-- 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-21 05:07:09 +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#1260
No description provided.