[PR #1096] [MERGED] feat(long-term-memory): drop broad existing-note context from the extraction prompt (1.3.23) #1289

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

📋 Pull Request Information

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

Base: staging ← Head: feature(long-term-memory)/1086-remove-broad-note-context


📝 Commits (1)

  • e76d53d feat(long-term-memory): drop broad existing-note context from the extraction prompt (1.3.23) (#1086)

📊 Changes

23 files changed (+145 additions, -191 deletions)

View changed files

➕ artifacts/long-term-memory-1.3.23.zip (+0 -0)
📝 catalog/catalog.json (+8 -8)
📝 catalog/notes.json (+6 -6)
📝 catalog/v2/catalog.json (+8 -8)
📝 catalog/v2/notes.json (+6 -6)
📝 catalog/v3/catalog.json (+8 -8)
📝 catalog/v3/notes.json (+6 -6)
📝 packages/long-term-memory/CHANGELOG.md (+5 -0)
📝 packages/long-term-memory/client.js (+10 -10)
📝 packages/long-term-memory/manifest.json (+5 -5)
📝 packages/long-term-memory/server.mjs (+35 -42)
📝 packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/MemorySettings.tsx (+0 -15)
📝 packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/locales/en.json (+0 -2)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/evidence-unit-extraction.ts (+6 -47)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/extraction-config.ts (+0 -2)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/source-extraction.ts (+0 -3)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/subject-identity.ts (+0 -16)
📝 packages/long-term-memory/src/engine/packages/shared/src/features/agents/long-term-memory/constants.ts (+0 -1)
📝 packages/long-term-memory/src/engine/packages/shared/src/features/agents/long-term-memory/schema.ts (+3 -2)
📝 scripts/build-feature-packages.mjs (+1 -1)

...and 3 more files

📄 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 #1086

Why this change

  • Long-Term Memory serialized a broad existingTypedNotes collection into every extraction prompt (via formatExistingNotes), so the prompt grew with the vault and the model was treated as authoritative for existing note identity and link targets.
  • With bounded post-extraction reconciliation landed in #1085, canonical identity is resolved in code after extraction. The prompt no longer needs broad vault context, so extraction gets cheaper and stops degrading as the vault grows.

What changed

  • long-term-memory (1.3.23) server extraction prompt:
    • removed the existingTypedNotes field from the user prompt contract and deleted formatExistingNotes;
    • removed the canonical-existing-note-ID instructions and reframed subjectId/link targets as source-local hints, resolved against the vault after extraction;
    • dropped the now-unused filterDominatedLtmSubjectNotesForPrompt helper and the maxExistingNoteTokens extraction option/constant;
    • kept the evidence-unit output shape, and kept existingNoteMaxChunks/existingNoteMaxTokens because they bound post-extraction reconciliation retrieval.
  • Legacy settings migration: stale persisted maxExistingNoteTokens values are discarded on load instead of rejecting the strict settings object.
  • Client: removed the now-unused "Maximum existing-note tokens" Memory Settings control and its locale strings.
  • Tests: long-term-memory-extraction-graph and long-term-memory-reconciliation-recall now assert the prompt carries source text but no existingTypedNotes; long-term-memory-routes covers the schema-level and HTTP-route migration.
  • Generated outputs rebuilt from source: server.mjs, client.js, manifest.json, catalog/catalog.json, catalog/v2/*, catalog/v3/*, catalog/notes.json, and the new artifacts/long-term-memory-1.3.23.zip (sha256 f505348520b6d58f78f01db65207e4050debeead641522a2b145a5fc235e42a7).

Package and security impact

  • Affected package IDs: long-term-memory
  • Engine compatibility impact: none; engine.min / engine.maxExclusive unchanged (2.4.1 / 4.0.0)
  • New or changed permissions/entrypoints: none; permissions and entrypoints unchanged
  • Restart, storage, update, or uninstall impact: none expected; the retired setting is dropped on load with no destructive migration

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

  • Ran the affected Long-Term Memory regressions on this commit via the Engine runner (pnpm --filter @marinara-engine/server exec tsx, MARINARA_ENGINE_ROOT=/home/damo/dev/Marinara-Engine): storage, extraction-graph, extraction-reliability, runtime, conversation-summary-import, candidate-reconciliation, reconciliation-recall (12/12 beyond the prompt window), index-keys, local-characters, scope-targets, scope-fallback-labels, source-task, debug-log, and routes — all passed.
  • Ran the catalog/output gates: npm run typecheck:packages, node scripts/test-catalog-lanes.mjs, node scripts/validate-package-locales.mjs, node scripts/validate-package-locale-keys.mjs, node scripts/validate-catalog.mjs (verifies the artifact hash/size/contents), node scripts/tests/catalog-generatedat-determinism.regression.mjs, and node scripts/tests/catalog-release-notes.regression.mjs — all passed.
  • Ran test-fast.sh (npm run check → 0 errors, 849 pre-existing warnings; git diff --check clean).
  • Local review: read-only delta review of the repair completed with no actionable findings. Hosted checks and required human/CodeRabbit review are pending on this SHA.

Documentation impact

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

UI evidence (if applicable)

  • UI change is the removal of the unused "Maximum existing-note tokens" control from Memory Settings; no visual regression is expected and no screenshot is attached.

Summary by CodeRabbit

  • New Features
    • Long-Term Memory extraction now sends only the source to the model, then matches extracted candidates against existing memories afterward.
  • Updates
    • Removed the existing-note prompt-token setting from Memory Settings. Older saved values are discarded when settings load, without blocking them.

🔄 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/1096 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 9/27/2026 **Status:** ✅ Merged **Merged:** 9/27/2026 **Merged by:** [@Promansis](https://github.com/Promansis) **Base:** `staging` ← **Head:** `feature(long-term-memory)/1086-remove-broad-note-context` --- ### 📝 Commits (1) - [`e76d53d`](https://github.com/Pasta-Devs/Marinara-Agents/commit/e76d53d7aeff82d589b5eb2d8a2ebf22f0611738) feat(long-term-memory): drop broad existing-note context from the extraction prompt (1.3.23) (#1086) ### 📊 Changes **23 files changed** (+145 additions, -191 deletions) <details> <summary>View changed files</summary> ➕ `artifacts/long-term-memory-1.3.23.zip` (+0 -0) 📝 `catalog/catalog.json` (+8 -8) 📝 `catalog/notes.json` (+6 -6) 📝 `catalog/v2/catalog.json` (+8 -8) 📝 `catalog/v2/notes.json` (+6 -6) 📝 `catalog/v3/catalog.json` (+8 -8) 📝 `catalog/v3/notes.json` (+6 -6) 📝 `packages/long-term-memory/CHANGELOG.md` (+5 -0) 📝 `packages/long-term-memory/client.js` (+10 -10) 📝 `packages/long-term-memory/manifest.json` (+5 -5) 📝 `packages/long-term-memory/server.mjs` (+35 -42) 📝 `packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/MemorySettings.tsx` (+0 -15) 📝 `packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/locales/en.json` (+0 -2) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/evidence-unit-extraction.ts` (+6 -47) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/extraction-config.ts` (+0 -2) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/source-extraction.ts` (+0 -3) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/subject-identity.ts` (+0 -16) 📝 `packages/long-term-memory/src/engine/packages/shared/src/features/agents/long-term-memory/constants.ts` (+0 -1) 📝 `packages/long-term-memory/src/engine/packages/shared/src/features/agents/long-term-memory/schema.ts` (+3 -2) 📝 `scripts/build-feature-packages.mjs` (+1 -1) _...and 3 more files_ </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 <!-- Every PR should reference an issue or feature request. --> Closes #1086 ## Why this change <!-- What user problem, package bug, or catalog goal does this solve? --> - Long-Term Memory serialized a broad `existingTypedNotes` collection into every extraction prompt (via `formatExistingNotes`), so the prompt grew with the vault and the model was treated as authoritative for existing note identity and link targets. - With bounded post-extraction reconciliation landed in #1085, canonical identity is resolved in code after extraction. The prompt no longer needs broad vault context, so extraction gets cheaper and stops degrading as the vault grows. ## What changed <!-- Include affected package IDs and generated outputs. --> - `long-term-memory` (1.3.23) server extraction prompt: - removed the `existingTypedNotes` field from the user prompt contract and deleted `formatExistingNotes`; - removed the canonical-existing-note-ID instructions and reframed `subjectId`/link targets as source-local hints, resolved against the vault after extraction; - dropped the now-unused `filterDominatedLtmSubjectNotesForPrompt` helper and the `maxExistingNoteTokens` extraction option/constant; - kept the evidence-unit output shape, and kept `existingNoteMaxChunks`/`existingNoteMaxTokens` because they bound post-extraction reconciliation retrieval. - Legacy settings migration: stale persisted `maxExistingNoteTokens` values are discarded on load instead of rejecting the strict settings object. - Client: removed the now-unused "Maximum existing-note tokens" Memory Settings control and its locale strings. - Tests: `long-term-memory-extraction-graph` and `long-term-memory-reconciliation-recall` now assert the prompt carries source text but no `existingTypedNotes`; `long-term-memory-routes` covers the schema-level and HTTP-route migration. - Generated outputs rebuilt from source: `server.mjs`, `client.js`, `manifest.json`, `catalog/catalog.json`, `catalog/v2/*`, `catalog/v3/*`, `catalog/notes.json`, and the new `artifacts/long-term-memory-1.3.23.zip` (sha256 `f505348520b6d58f78f01db65207e4050debeead641522a2b145a5fc235e42a7`). ## Package and security impact - Affected package IDs: `long-term-memory` - Engine compatibility impact: none; `engine.min` / `engine.maxExclusive` unchanged (`2.4.1` / `4.0.0`) - New or changed permissions/entrypoints: none; permissions and entrypoints unchanged - Restart, storage, update, or uninstall impact: none expected; the retired setting is dropped on load with no destructive migration ## Validation <!-- These are human tasks. Never tick a box for a check that was not actually performed. --> - [ ] `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 <!-- Describe exactly what you tested, step by step. --> - Ran the affected Long-Term Memory regressions on this commit via the Engine runner (`pnpm --filter @marinara-engine/server exec tsx`, `MARINARA_ENGINE_ROOT=/home/damo/dev/Marinara-Engine`): `storage`, `extraction-graph`, `extraction-reliability`, `runtime`, `conversation-summary-import`, `candidate-reconciliation`, `reconciliation-recall` (12/12 beyond the prompt window), `index-keys`, `local-characters`, `scope-targets`, `scope-fallback-labels`, `source-task`, `debug-log`, and `routes` — all passed. - Ran the catalog/output gates: `npm run typecheck:packages`, `node scripts/test-catalog-lanes.mjs`, `node scripts/validate-package-locales.mjs`, `node scripts/validate-package-locale-keys.mjs`, `node scripts/validate-catalog.mjs` (verifies the artifact hash/size/contents), `node scripts/tests/catalog-generatedat-determinism.regression.mjs`, and `node scripts/tests/catalog-release-notes.regression.mjs` — all passed. - Ran `test-fast.sh` (`npm run check` → 0 errors, 849 pre-existing warnings; `git diff --check` clean). - Local review: read-only delta review of the repair completed with no actionable findings. Hosted checks and required human/CodeRabbit review are pending on this SHA. ## Documentation impact - [ ] No documentation changes needed - [ ] Updated this README catalog and package guidance - [ ] Updated linked Marinara Engine documentation ## UI evidence (if applicable) <!-- Add before/after screenshots or recordings for package UI changes. --> - UI change is the removal of the unused "Maximum existing-note tokens" control from Memory Settings; no visual regression is expected and no screenshot is attached. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Long-Term Memory extraction now sends only the source to the model, then matches extracted candidates against existing memories afterward. * **Updates** * Removed the existing-note prompt-token setting from Memory Settings. Older saved values are discarded when settings load, without blocking them. <!-- 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:43 +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#1289
No description provided.