[PR #1284] [MERGED] fix(long-term-memory): 1.4.21 — keep extraction results that should be kept #1385

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

📋 Pull Request Information

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

Base: staging ← Head: fix(long-term-memory)/1277-extraction-validation


📝 Commits (1)

  • 4018b66 fix(long-term-memory): 1.4.21 — keep extraction results that should be kept (#1277)

📊 Changes

18 files changed (+691 additions, -241 deletions)

View changed files

➕ artifacts/long-term-memory-1.4.21.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 (+4 -0)
📝 packages/long-term-memory/client.js (+1 -1)
📝 packages/long-term-memory/manifest.json (+5 -5)
📝 packages/long-term-memory/server.mjs (+56 -56)
📝 packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/ReviewQueue.tsx (+1 -0)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/evidence-unit-extraction.ts (+8 -2)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/evidence-unit-validation.ts (+6 -2)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/structured-summary-normalizer.ts (+4 -1)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/subject-identity.ts (+96 -4)
📝 scripts/build-feature-packages.mjs (+1 -1)
📝 tests/long-term-memory-extraction-graph.regression.ts (+467 -127)

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

Why this change

Long-Term Memory could drop or misroute valid memories during extraction:

  • A model that returned an explicitly empty subjectKeys: [] suppressed trusted name-based identity resolution, so a valid subjectNames entry never got the chance to match.
  • A relationship change whose dimensionChanges map contained only zero-valued entries was treated as an actual change, which rejected static memories that merely carried the optional field.
  • A nameless, keyless candidate whose subjectId had already been resolved by a named sibling in the same extraction batch was rejected instead of reusing that identity, even though the batch clearly identified the subject.

All three caused legitimate character and relationship memories to be rejected or routed to the wrong memory. The issue reporter observed a real character-fact rejection in extraction logs.

What changed

  • evidence-unit-extraction.ts: an explicitly empty subjectKeys array now normalizes to an omitted field so name-based resolution still runs; the internal resolver stays strict.
  • evidence-unit-validation.ts: a relationship dimensionChanges map whose deltas are all zero is no longer treated as a change.
  • subject-identity.ts: a nameless, keyless character/relationship candidate may borrow the identity a named sibling resolved for the exact same bucket + subjectId. Only solid matches (trusted_key / exact_name / unique_alias) qualify; contested or skipped donors disqualify the key, and borrowing emits a review-required borrowed_subject_identity diagnostic. The prediction path (identityKeyForUnit) adopts borrowed keys only when they resolve, mirroring the resolver.
  • ReviewQueue.tsx: borrowed_subject_identity maps to the existing "Normalized and corrected" review category.
  • scripts/build-feature-packages.mjs and packages/long-term-memory/CHANGELOG.md: Long-Term Memory 1.4.21.
  • Rebuilt generated outputs: packages/long-term-memory/manifest.json, server.mjs, client.js, artifacts/long-term-memory-1.4.21.zip, and catalog/{,v2/,v3/}{catalog,notes}.json. The prior artifacts/long-term-memory-1.4.20.zip is untouched.

Package and security impact

  • Affected package IDs: long-term-memory
  • Engine compatibility impact: none — engine.min 2.4.1 and maxExclusive are unchanged.
  • New or changed permissions/entrypoints: none.
  • Restart, storage, update, or uninstall impact: restartRequired unchanged; no storage schema 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

Local checks run on commit 4018b664b (the Engine-backed LTM regression used MARINARA_ENGINE_ROOT=/home/damo/dev/Marinara-Engine):

  • npm run check — 809 problems (0 errors, 809 pre-existing warnings)
  • node scripts/test-catalog-lanes.mjs — passed
  • node scripts/validate-package-locales.mjs — passed
  • node scripts/validate-catalog.mjs — passed (39 packages; lanes v2=39, v3=39)
  • node scripts/tests/catalog-release-notes.regression.mjs — passed
  • test-ltm.sh extraction-graph — passed (static grounding, change linkage, relationship causes, source-link normalization)
  • git diff --check — passed

The affected package was not manually installed through a Marinara Engine UI in this work unit, so the installation, mode, restart, and uninstall checkboxes are intentionally left for human verification.

Documentation impact

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

No README catalog membership or compatibility change; the package version and catalog entries were regenerated from source.

UI evidence (if applicable)

The Review Queue change only routes a new diagnostic code into an existing localized category; there is no visual layout change.

Summary by CodeRabbit

  • Bug Fixes
    • Empty subject-key lists no longer prevent trusted name-based identity matching.
    • Relationship updates with only zero-valued changes are no longer treated as meaningful changes.
    • Nameless candidates can use a named sibling’s resolved identity when the match is trusted. These cases remain in the Review Queue for human review.
  • Release
    • Long-Term Memory updated to version 1.4.21.

🔄 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/1284 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 10/9/2026 **Status:** ✅ Merged **Merged:** 10/9/2026 **Merged by:** [@Promansis](https://github.com/Promansis) **Base:** `staging` ← **Head:** `fix(long-term-memory)/1277-extraction-validation` --- ### 📝 Commits (1) - [`4018b66`](https://github.com/Pasta-Devs/Marinara-Agents/commit/4018b664b96fbbcf045fe78e62cfe790bc4a8dc7) fix(long-term-memory): 1.4.21 — keep extraction results that should be kept (#1277) ### 📊 Changes **18 files changed** (+691 additions, -241 deletions) <details> <summary>View changed files</summary> ➕ `artifacts/long-term-memory-1.4.21.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` (+4 -0) 📝 `packages/long-term-memory/client.js` (+1 -1) 📝 `packages/long-term-memory/manifest.json` (+5 -5) 📝 `packages/long-term-memory/server.mjs` (+56 -56) 📝 `packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/ReviewQueue.tsx` (+1 -0) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/evidence-unit-extraction.ts` (+8 -2) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/evidence-unit-validation.ts` (+6 -2) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/structured-summary-normalizer.ts` (+4 -1) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/subject-identity.ts` (+96 -4) 📝 `scripts/build-feature-packages.mjs` (+1 -1) 📝 `tests/long-term-memory-extraction-graph.regression.ts` (+467 -127) </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`. ## Linked issue Closes #1277 ## Why this change Long-Term Memory could drop or misroute valid memories during extraction: - A model that returned an explicitly empty `subjectKeys: []` suppressed trusted name-based identity resolution, so a valid `subjectNames` entry never got the chance to match. - A relationship change whose `dimensionChanges` map contained only zero-valued entries was treated as an actual change, which rejected static memories that merely carried the optional field. - A nameless, keyless candidate whose `subjectId` had already been resolved by a named sibling in the same extraction batch was rejected instead of reusing that identity, even though the batch clearly identified the subject. All three caused legitimate character and relationship memories to be rejected or routed to the wrong memory. The issue reporter observed a real character-fact rejection in extraction logs. ## What changed - `evidence-unit-extraction.ts`: an explicitly empty `subjectKeys` array now normalizes to an omitted field so name-based resolution still runs; the internal resolver stays strict. - `evidence-unit-validation.ts`: a relationship `dimensionChanges` map whose deltas are all zero is no longer treated as a change. - `subject-identity.ts`: a nameless, keyless character/relationship candidate may borrow the identity a named sibling resolved for the exact same `bucket + subjectId`. Only solid matches (`trusted_key` / `exact_name` / `unique_alias`) qualify; contested or skipped donors disqualify the key, and borrowing emits a review-required `borrowed_subject_identity` diagnostic. The prediction path (`identityKeyForUnit`) adopts borrowed keys only when they resolve, mirroring the resolver. - `ReviewQueue.tsx`: `borrowed_subject_identity` maps to the existing "Normalized and corrected" review category. - `scripts/build-feature-packages.mjs` and `packages/long-term-memory/CHANGELOG.md`: Long-Term Memory 1.4.21. - Rebuilt generated outputs: `packages/long-term-memory/manifest.json`, `server.mjs`, `client.js`, `artifacts/long-term-memory-1.4.21.zip`, and `catalog/{,v2/,v3/}{catalog,notes}.json`. The prior `artifacts/long-term-memory-1.4.20.zip` is untouched. ## Package and security impact - Affected package IDs: `long-term-memory` - Engine compatibility impact: none — `engine.min` 2.4.1 and `maxExclusive` are unchanged. - New or changed permissions/entrypoints: none. - Restart, storage, update, or uninstall impact: `restartRequired` unchanged; no storage schema 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 Local checks run on commit `4018b664b` (the Engine-backed LTM regression used `MARINARA_ENGINE_ROOT=/home/damo/dev/Marinara-Engine`): - `npm run check` — 809 problems (0 errors, 809 pre-existing warnings) - `node scripts/test-catalog-lanes.mjs` — passed - `node scripts/validate-package-locales.mjs` — passed - `node scripts/validate-catalog.mjs` — passed (39 packages; lanes v2=39, v3=39) - `node scripts/tests/catalog-release-notes.regression.mjs` — passed - `test-ltm.sh extraction-graph` — passed (static grounding, change linkage, relationship causes, source-link normalization) - `git diff --check` — passed The affected package was not manually installed through a Marinara Engine UI in this work unit, so the installation, mode, restart, and uninstall checkboxes are intentionally left for human verification. ## Documentation impact - [ ] No documentation changes needed - [ ] Updated this README catalog and package guidance - [ ] Updated linked Marinara Engine documentation No README catalog membership or compatibility change; the package version and catalog entries were regenerated from source. ## UI evidence (if applicable) The Review Queue change only routes a new diagnostic code into an existing localized category; there is no visual layout change. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Empty subject-key lists no longer prevent trusted name-based identity matching. * Relationship updates with only zero-valued changes are no longer treated as meaningful changes. * Nameless candidates can use a named sibling’s resolved identity when the match is trusted. These cases remain in the Review Queue for human review. * **Release** * Long-Term Memory updated to version 1.4.21. <!-- 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:10:12 +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#1385
No description provided.