[PR #1254] [MERGED] fix(long-term-memory): 1.4.10 — count only in-scope memories toward recall caps #1370

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

📋 Pull Request Information

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

Base: staging ← Head: fix(long-term-memory)/scope-before-bucket-caps


📝 Commits (1)

  • 0464aa6 fix(long-term-memory): 1.4.10 — count only in-scope memories toward recall caps (#1251)

📊 Changes

15 files changed (+171 additions, -85 deletions)

View changed files

➕ artifacts/long-term-memory-1.4.10.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 (+28 -28)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/keyword-index.ts (+33 -7)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/metadata-index.ts (+16 -3)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/retrieval.ts (+11 -7)
📝 scripts/build-feature-packages.mjs (+1 -1)
📝 tests/long-term-memory-index-keys.regression.ts (+39 -0)

📄 Description

Linked issue

Closes #1251

Why this change

  • Long-Term Memory capped its recall candidate buckets (128 per keyword/tag/note bucket, 512 fuzzy catalog keywords) against the whole vault before the chat's scope, status and mode filter ran. Once 128+ out-of-scope memories shared a popular keyword or #tag, an in-scope memory could be crowded out of the exact keyword hit, the direct hit, and the graph seeds those hits produce; the fuzzy keyword scan had the same flaw at 512 vault-wide keywords, which could leave a late-alphabet keyword unmatchable.

What changed

  • keyword-index.ts: keyword bucket and fuzzy catalog caps now count only chunks the caller allows.
  • metadata-index.ts: getLtmMetadataMatches accepts allowedChunks and caps note/tag buckets against it.
  • retrieval.ts: passes the allowed set into the direct lane instead of post-filtering its results.
  • tests/long-term-memory-index-keys.regression.ts: regression with 130 out-of-scope keyword/tag entries and a 512-keyword catalog holding one late-alphabet in-scope keyword.
  • Rebuilt long-term-memory 1.4.10: manifest, server.mjs, artifact zip and catalog entries; changelog added.

Package and security impact

  • Affected package IDs: long-term-memory
  • Engine compatibility impact: none (min 2.4.1 / maxExclusive 4.0.0 unchanged)
  • New or changed permissions/entrypoints: none
  • Restart, storage, update, or uninstall impact: none (candidate selection only; no storage or lifecycle change)

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 0464aa6c6 (pushed SHA):

  • node scripts/test-catalog-lanes.mjs, node scripts/validate-package-locales.mjs, node scripts/validate-catalog.mjs, node scripts/tests/catalog-release-notes.regression.mjs: pass.
  • test-ltm.sh index-keys and test-ltm.sh runtime (affected package regressions): pass.
  • npm run check (via test-fast.sh): exit 0, 0 errors, 809 pre-existing warnings.
  • git diff --check upstream/staging...HEAD: clean.
  • Not performed: installing/updating the package through Marinara Engine; manual mode, restart and uninstall checks.

Documentation impact

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

UI evidence (if applicable)

None — recall candidate selection change, no UI surface.

Summary by CodeRabbit

  • Bug Fixes
    • Recall limits now count only memories eligible in the current chat, helping relevant keyword, tag, note, and fuzzy matches remain discoverable.
  • Documentation
    • Added release notes for Long-Term Memory version 1.4.10.

🔄 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/1254 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 10/7/2026 **Status:** ✅ Merged **Merged:** 10/7/2026 **Merged by:** [@Promansis](https://github.com/Promansis) **Base:** `staging` ← **Head:** `fix(long-term-memory)/scope-before-bucket-caps` --- ### 📝 Commits (1) - [`0464aa6`](https://github.com/Pasta-Devs/Marinara-Agents/commit/0464aa6c6242895a7d06bb4198da44df551fe88c) fix(long-term-memory): 1.4.10 — count only in-scope memories toward recall caps (#1251) ### 📊 Changes **15 files changed** (+171 additions, -85 deletions) <details> <summary>View changed files</summary> ➕ `artifacts/long-term-memory-1.4.10.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` (+28 -28) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/keyword-index.ts` (+33 -7) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/metadata-index.ts` (+16 -3) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/retrieval.ts` (+11 -7) 📝 `scripts/build-feature-packages.mjs` (+1 -1) 📝 `tests/long-term-memory-index-keys.regression.ts` (+39 -0) </details> ### 📄 Description ## Linked issue Closes #1251 ## Why this change - Long-Term Memory capped its recall candidate buckets (128 per keyword/tag/note bucket, 512 fuzzy catalog keywords) against the whole vault before the chat's scope, status and mode filter ran. Once 128+ out-of-scope memories shared a popular keyword or `#tag`, an in-scope memory could be crowded out of the exact keyword hit, the direct hit, and the graph seeds those hits produce; the fuzzy keyword scan had the same flaw at 512 vault-wide keywords, which could leave a late-alphabet keyword unmatchable. ## What changed - `keyword-index.ts`: keyword bucket and fuzzy catalog caps now count only chunks the caller allows. - `metadata-index.ts`: `getLtmMetadataMatches` accepts `allowedChunks` and caps note/tag buckets against it. - `retrieval.ts`: passes the allowed set into the direct lane instead of post-filtering its results. - `tests/long-term-memory-index-keys.regression.ts`: regression with 130 out-of-scope keyword/tag entries and a 512-keyword catalog holding one late-alphabet in-scope keyword. - Rebuilt `long-term-memory` 1.4.10: manifest, `server.mjs`, artifact zip and catalog entries; changelog added. ## Package and security impact - Affected package IDs: `long-term-memory` - Engine compatibility impact: none (min 2.4.1 / maxExclusive 4.0.0 unchanged) - New or changed permissions/entrypoints: none - Restart, storage, update, or uninstall impact: none (candidate selection only; no storage or lifecycle change) ## 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 `0464aa6c6` (pushed SHA): - `node scripts/test-catalog-lanes.mjs`, `node scripts/validate-package-locales.mjs`, `node scripts/validate-catalog.mjs`, `node scripts/tests/catalog-release-notes.regression.mjs`: pass. - `test-ltm.sh index-keys` and `test-ltm.sh runtime` (affected package regressions): pass. - `npm run check` (via `test-fast.sh`): exit 0, 0 errors, 809 pre-existing warnings. - `git diff --check upstream/staging...HEAD`: clean. - Not performed: installing/updating the package through Marinara Engine; manual mode, restart and uninstall checks. ## Documentation impact - [ ] No documentation changes needed - [ ] Updated this README catalog and package guidance - [ ] Updated linked Marinara Engine documentation ## UI evidence (if applicable) None — recall candidate selection change, no UI surface. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Recall limits now count only memories eligible in the current chat, helping relevant keyword, tag, note, and fuzzy matches remain discoverable. * **Documentation** * Added release notes for Long-Term Memory version 1.4.10. <!-- 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:09:58 +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#1370
No description provided.