[PR #1552] [MERGED] fix(long-term-memory): read a summary name starting with Char or Rel as a name (#1550) #1938

Closed
opened 2026-11-07 16:38:06 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: staging ← Head: fix(long-term-memory)/summary-prefix-word-name


📝 Commits (4)

  • adb4e2e fix(long-term-memory): read a summary name starting with Char or Rel as a name (#1550)
  • 6ae6388 Merge upstream/staging into fix(long-term-memory)/summary-prefix-word-name; release long-term-memory 1.4.79
  • 0c49100 fix(long-term-memory): give a characters-field pair the leading pair's id and name it in its cause event
  • 08bceb2 chore(long-term-memory): rebuild 1.4.79 with the characters-field and cause event fix

📊 Changes

13 files changed (+272 additions, -94 deletions)

View changed files

➕ artifacts/long-term-memory-1.4.79.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 (+40 -40)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/extraction/structured-summary-normalizer.ts (+64 -13)
📝 scripts/build-feature-packages.mjs (+1 -1)
📝 tests/long-term-memory-extraction-graph.regression.ts (+124 -1)

📄 Description

Pull request

Linked issue

Closes #1550

Why this change

  • A structured chat summary can write a character's name out, but the summary parser read every name as a memory id and removed a leading char_ or rel_. A character whose name starts with "Char" (such as "Char Aznable") or a pair whose first name starts with "Rel" lost that word whenever the summary wrote the name: as a leading name or pair (- Char Aznable | …, - Rel Varga, Sayla Mass | …), in a character:, subject: or relationship: field (character: Char Aznable), or as the key (- Char Aznable: …). The summary's section for the character (such as Profile) no longer reached their memory. Those lines were dropped as "not in the trusted chat roster or bound memories", so a fact only the summary held was lost. A relationship only the summary mentioned got no memory.
  • This covers names the summary writes out. A line that writes an id made from the name, as the Engine's built-in LTM summary prompt asks (subject: char_aznable), is still read as an id and dropped: telling it apart from Mara's char_mara needs the chat's character list, which the parser does not get. This PR does not change that case.

What changed

  • long-term-memory: the structured-summary parser reads a value with a space in it as a name, unless its first word has an underscore (an id followed by a name, such as char_mara (Mara)), and gives it the subject id identity gives that name's memory ("Char Aznable" → char_char_aznable, "Mara Lee" → mara_lee). Any other value is still read as an id and stripped once. This applies to the character section hint (also kept under the old key, so a memory saved under the shorter id still takes it), to the character line's subject, and to the relationship line's leading pair and id fields (the second strip goes). The event the parser writes for a relationship line's cause drops the prefix once in its text, so it does not read "rel and rel and …".
  • After review: a relationship line that names its pair only in a characters: field (characters: Rel Varga, Sayla Mass) now gets the same subject as the leading pair (rel_rel_varga_sayla_mass); it was varga_sayla_mass. The event made for a relationship's cause names the pair as the line writes it ("Rel Varga and Sayla Mass relationship changed after the hangar fire."), instead of splitting the id into words ("rel and varga and sayla and mass …"); a pair written as an id keeps the text made from the id. The regression covers both.
  • Regression in tests/long-term-memory-extraction-graph.regression.ts. Rebuilt packages/long-term-memory bundles, artifact and catalog entry.

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. No migration: lines dropped in earlier extractions stay dropped, and re-extracting the summary adds them.

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

  • The new extraction-graph step fails on staging (no relationship memory for "Rel Varga, Sayla Mass") and passes with the fix. A structured summary with character: Char Aznable / section: profile, a character: Mara section and three relationship lines creates char_char_aznable, char_mara and rel_rel_varga_sayla_mass. Both character memories hold only Profile, the character: field line reaches Char Aznable's memory, two Mara lines written as char_mara (Mara) reach Mara's memory, nothing is dropped, and the cause event reads "Rel Varga and Sayla Mass relationship changed after the hangar fire." A characters: Rel Varga, Sayla Mass line, normalized on its own, gets the subject rel_rel_varga_sayla_mass Reverting any changed line fails the step.
  • Identity itself is unchanged; only the subjects the summary parser hands it change. Names that don't start with the prefix word ("Mara", "Ana, Bo") and ids (char_mara, char_mara (Mara)) give the same subjects as before, with one exception: a relationship id written with the prefix twice (rel_rel_ana_bo) is now stripped once. That relationship still reaches rel_ana_bo, but the event made for its cause is now timeline_rel_ana_bo_… instead of timeline_ana_bo_…. An id written with a space (char mara) now reads as a name. A character with no roster entry whose name starts with "Char" no longer gets a second memory from a summary line; the line joins the model's memory for him. A vault where Char Aznable's memory was saved as char_aznable (bound) still takes the section hint, and new summary lines for him are now added to it instead of being dropped. A vault with two memories bound to him is held as ambiguous before and after. The event made for a relationship's cause now uses the names as the line writes them for any pair written as names ("Ana and Bo relationship changed after …" instead of "ana and bo …"); its id and links are unchanged.

Documentation impact

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

UI evidence (if applicable)

Not applicable: server-side extraction only.

🤖 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/1552 **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)/summary-prefix-word-name` --- ### 📝 Commits (4) - [`adb4e2e`](https://github.com/Pasta-Devs/Marinara-Agents/commit/adb4e2edd319cb110e464bd6fbedd2b0ef891514) fix(long-term-memory): read a summary name starting with Char or Rel as a name (#1550) - [`6ae6388`](https://github.com/Pasta-Devs/Marinara-Agents/commit/6ae638800b185e02d36ed772ef0ede2fb554ad11) Merge upstream/staging into fix(long-term-memory)/summary-prefix-word-name; release long-term-memory 1.4.79 - [`0c49100`](https://github.com/Pasta-Devs/Marinara-Agents/commit/0c49100de33a1d0f8654a987d645abe333b3caa3) fix(long-term-memory): give a characters-field pair the leading pair's id and name it in its cause event - [`08bceb2`](https://github.com/Pasta-Devs/Marinara-Agents/commit/08bceb2587054160401dbd6f466d072971ecf9a5) chore(long-term-memory): rebuild 1.4.79 with the characters-field and cause event fix ### 📊 Changes **13 files changed** (+272 additions, -94 deletions) <details> <summary>View changed files</summary> ➕ `artifacts/long-term-memory-1.4.79.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` (+40 -40) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/extraction/structured-summary-normalizer.ts` (+64 -13) 📝 `scripts/build-feature-packages.mjs` (+1 -1) 📝 `tests/long-term-memory-extraction-graph.regression.ts` (+124 -1) </details> ### 📄 Description # Pull request ## Linked issue Closes #1550 ## Why this change - A structured chat summary can write a character's name out, but the summary parser read every name as a memory id and removed a leading `char_` or `rel_`. A character whose name starts with "Char" (such as "Char Aznable") or a pair whose first name starts with "Rel" lost that word whenever the summary wrote the name: as a leading name or pair (`- Char Aznable | …`, `- Rel Varga, Sayla Mass | …`), in a `character:`, `subject:` or `relationship:` field (`character: Char Aznable`), or as the key (`- Char Aznable: …`). The summary's section for the character (such as Profile) no longer reached their memory. Those lines were dropped as "not in the trusted chat roster or bound memories", so a fact only the summary held was lost. A relationship only the summary mentioned got no memory. - This covers names the summary writes out. A line that writes an id made from the name, as the Engine's built-in LTM summary prompt asks (`subject: char_aznable`), is still read as an id and dropped: telling it apart from Mara's `char_mara` needs the chat's character list, which the parser does not get. This PR does not change that case. ## What changed - `long-term-memory`: the structured-summary parser reads a value with a space in it as a name, unless its first word has an underscore (an id followed by a name, such as `char_mara (Mara)`), and gives it the subject id identity gives that name's memory ("Char Aznable" → `char_char_aznable`, "Mara Lee" → `mara_lee`). Any other value is still read as an id and stripped once. This applies to the character section hint (also kept under the old key, so a memory saved under the shorter id still takes it), to the character line's subject, and to the relationship line's leading pair and id fields (the second strip goes). The event the parser writes for a relationship line's cause drops the prefix once in its text, so it does not read "rel and rel and …". - After review: a relationship line that names its pair only in a `characters:` field (`characters: Rel Varga, Sayla Mass`) now gets the same subject as the leading pair (`rel_rel_varga_sayla_mass`); it was `varga_sayla_mass`. The event made for a relationship's cause names the pair as the line writes it ("Rel Varga and Sayla Mass relationship changed after the hangar fire."), instead of splitting the id into words ("rel and varga and sayla and mass …"); a pair written as an id keeps the text made from the id. The regression covers both. - Regression in `tests/long-term-memory-extraction-graph.regression.ts`. Rebuilt `packages/long-term-memory` bundles, artifact and catalog entry. ## 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. No migration: lines dropped in earlier extractions stay dropped, and re-extracting the summary adds them. ## 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 - The new extraction-graph step fails on `staging` (no relationship memory for "Rel Varga, Sayla Mass") and passes with the fix. A structured summary with `character: Char Aznable` / `section: profile`, a `character: Mara` section and three relationship lines creates `char_char_aznable`, `char_mara` and `rel_rel_varga_sayla_mass`. Both character memories hold only Profile, the `character:` field line reaches Char Aznable's memory, two Mara lines written as `char_mara (Mara)` reach Mara's memory, nothing is dropped, and the cause event reads "Rel Varga and Sayla Mass relationship changed after the hangar fire." A `characters: Rel Varga, Sayla Mass` line, normalized on its own, gets the subject `rel_rel_varga_sayla_mass` Reverting any changed line fails the step. - Identity itself is unchanged; only the subjects the summary parser hands it change. Names that don't start with the prefix word ("Mara", "Ana, Bo") and ids (`char_mara`, `char_mara (Mara)`) give the same subjects as before, with one exception: a relationship id written with the prefix twice (`rel_rel_ana_bo`) is now stripped once. That relationship still reaches `rel_ana_bo`, but the event made for its cause is now `timeline_rel_ana_bo_…` instead of `timeline_ana_bo_…`. An id written with a space (`char mara`) now reads as a name. A character with no roster entry whose name starts with "Char" no longer gets a second memory from a summary line; the line joins the model's memory for him. A vault where Char Aznable's memory was saved as `char_aznable` (bound) still takes the section hint, and new summary lines for him are now added to it instead of being dropped. A vault with two memories bound to him is held as ambiguous before and after. The event made for a relationship's cause now uses the names as the line writes them for any pair written as names ("Ana and Bo relationship changed after …" instead of "ana and bo …"); its id and links are unchanged. ## Documentation impact - [ ] No documentation changes needed - [ ] Updated this README catalog and package guidance - [ ] Updated linked Marinara Engine documentation ## UI evidence (if applicable) Not applicable: server-side extraction only. 🤖 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-11-07 16:38:06 +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#1938
No description provided.