[PR #1516] [MERGED] fix(long-term-memory): match event ids in a written cause on whole words (1.4.62) #1523

Closed
opened 2026-10-22 04:03:05 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: staging ← Head: fix(long-term-memory)/cause-matcher-word-boundary


📝 Commits (4)

  • ac186e2 fix(long-term-memory): match event ids in a written cause on whole words
  • c88a90e chore(long-term-memory): release 1.4.60 (#1515)
  • f379f85 Merge upstream/staging into fix(long-term-memory)/cause-matcher-word-boundary; release long-term-memory 1.4.61
  • 88223e7 Merge upstream/staging into fix(long-term-memory)/cause-matcher-word-boundary; release long-term-memory 1.4.62

📊 Changes

13 files changed (+170 additions, -90 deletions)

View changed files

➕ artifacts/long-term-memory-1.4.62.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 (+34 -34)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/extraction/structured-summary-normalizer.ts (+14 -16)
📝 scripts/build-feature-packages.mjs (+1 -1)
📝 tests/long-term-memory-extraction-graph.regression.ts (+78 -0)

📄 Description

Pull request

Linked issue

Closes #1515

Why this change

  • A structured chat summary can give a relationship change's cause in words (caused_by: the training). Extraction then looks for a matching event among the answer's events and the existing timeline notes, but compared ids as plain substrings. An event with a short id such as rain matched "the training", so the relationship linked to the wrong event; a short cause such as rain or time matched inside training_session or every timeline_… id. A wrong match could also tie with the right one and lose it. Since the structured-summary backfill fix, character-line causes use the same matcher.
  • A character change whose cause is missing or matches nothing falls back to an event id the summary declares in its line, with the same substring test: art_show was found in "will start showing".

What changed

  • long-term-memory: fuzzyTimelineTargetFromCause and exactTimelineTargetFromLine look for event ids on whole _-separated words through one small helper, which also accepts s or es after the id's last word so a plural cause ("the training sessions") still finds its event. The cause check no longer compares the timeline_ prefix. The word-overlap score and the exact-id match are unchanged.
  • Regressions in tests/long-term-memory-extraction-graph.regression.ts. Rebuilt packages/long-term-memory bundles, artifact and catalog entry.
  • Release: long-term-memory 1.4.62, with the CHANGELOG entry, version, manifest, rebuilt server.mjs, artifact and catalog entries, on top of staging d1c6c7d78 (1.4.61).

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

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 cases fail on staging (a relationship and a character line with the cause "the training" link to an existing timeline_rain) and pass with the fix. Cases: "the training" and "timeline" don't link to timeline_rain, "rain" doesn't link to timeline_training_session, "fire" doesn't link to timeline_fireworks_show; "the long training session at the old barracks" finds timeline_training_session beside timeline_rain (on staging the two tie and neither is found); "the training sessions" finds timeline_training_session; a change fact "Mara will start showing her students the old script." with a cause that matches nothing gets no link to a declared art_show. These cases run the normalizer; end to end, a relationship change keeps a found link only when the event comes from the same source, as before (the same-source rule drops a change linked to another source's event).

Documentation impact

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

🤖 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/1516 **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)/cause-matcher-word-boundary` --- ### 📝 Commits (4) - [`ac186e2`](https://github.com/Pasta-Devs/Marinara-Agents/commit/ac186e233d037eee29d626df4508e648586fe170) fix(long-term-memory): match event ids in a written cause on whole words - [`c88a90e`](https://github.com/Pasta-Devs/Marinara-Agents/commit/c88a90e80e61e2ca67790dd988672851aad4ebf3) chore(long-term-memory): release 1.4.60 (#1515) - [`f379f85`](https://github.com/Pasta-Devs/Marinara-Agents/commit/f379f85cb4af7608529ff1015a560596d8ed2587) Merge upstream/staging into fix(long-term-memory)/cause-matcher-word-boundary; release long-term-memory 1.4.61 - [`88223e7`](https://github.com/Pasta-Devs/Marinara-Agents/commit/88223e77f1e79d7ea5b33065a4c6ed733515749e) Merge upstream/staging into fix(long-term-memory)/cause-matcher-word-boundary; release long-term-memory 1.4.62 ### 📊 Changes **13 files changed** (+170 additions, -90 deletions) <details> <summary>View changed files</summary> ➕ `artifacts/long-term-memory-1.4.62.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` (+34 -34) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/extraction/structured-summary-normalizer.ts` (+14 -16) 📝 `scripts/build-feature-packages.mjs` (+1 -1) 📝 `tests/long-term-memory-extraction-graph.regression.ts` (+78 -0) </details> ### 📄 Description # Pull request ## Linked issue Closes #1515 ## Why this change - A structured chat summary can give a relationship change's cause in words (`caused_by: the training`). Extraction then looks for a matching event among the answer's events and the existing timeline notes, but compared ids as plain substrings. An event with a short id such as `rain` matched "the training", so the relationship linked to the wrong event; a short cause such as `rain` or `time` matched inside `training_session` or every `timeline_…` id. A wrong match could also tie with the right one and lose it. Since the structured-summary backfill fix, character-line causes use the same matcher. - A character change whose cause is missing or matches nothing falls back to an event id the summary declares in its line, with the same substring test: `art_show` was found in "will start showing". ## What changed - `long-term-memory`: `fuzzyTimelineTargetFromCause` and `exactTimelineTargetFromLine` look for event ids on whole `_`-separated words through one small helper, which also accepts `s` or `es` after the id's last word so a plural cause ("the training sessions") still finds its event. The cause check no longer compares the `timeline_` prefix. The word-overlap score and the exact-id match are unchanged. - Regressions in `tests/long-term-memory-extraction-graph.regression.ts`. Rebuilt `packages/long-term-memory` bundles, artifact and catalog entry. - **Release:** `long-term-memory` 1.4.62, with the CHANGELOG entry, version, manifest, rebuilt `server.mjs`, artifact and catalog entries, on top of staging d1c6c7d78 (1.4.61). ## 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 ## 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 cases fail on `staging` (a relationship and a character line with the cause "the training" link to an existing `timeline_rain`) and pass with the fix. Cases: "the training" and "timeline" don't link to `timeline_rain`, "rain" doesn't link to `timeline_training_session`, "fire" doesn't link to `timeline_fireworks_show`; "the long training session at the old barracks" finds `timeline_training_session` beside `timeline_rain` (on `staging` the two tie and neither is found); "the training sessions" finds `timeline_training_session`; a change fact "Mara will start showing her students the old script." with a cause that matches nothing gets no link to a declared `art_show`. These cases run the normalizer; end to end, a relationship change keeps a found link only when the event comes from the same source, as before (the same-source rule drops a change linked to another source's event). ## Documentation impact - [ ] No documentation changes needed - [ ] Updated this README catalog and package guidance - [ ] Updated linked Marinara Engine documentation 🤖 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-10-22 04:03:05 +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#1523
No description provided.