[PR #1237] [MERGED] fix(long-term-memory): 1.4.5 — review short names for known characters instead of forking local identities #1356

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

📋 Pull Request Information

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

Base: staging ← Head: fix(long-term-memory)/short-name-review-binding


📝 Commits (4)

  • 7050665 fix(long-term-memory): 1.4.5 — review short names for known characters instead of forking local identities (#1225)
  • c790f34 Merge upstream/staging into fix(long-term-memory)/short-name-review-binding
  • 2465d29 Merge branch 'staging' into fix(long-term-memory)/short-name-review-binding
  • caae5a0 fix(long-term-memory): give recovery drafts their own id (#1225)

📊 Changes

29 files changed (+2515 additions, -228 deletions)

View changed files

➕ artifacts/long-term-memory-1.4.5.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 (+28 -28)
📝 packages/long-term-memory/manifest.json (+5 -5)
📝 packages/long-term-memory/server.mjs (+62 -62)
📝 packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/ReviewQueue.tsx (+156 -12)
➕ packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/SubjectIdentityReview.tsx (+191 -0)
📝 packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/api.ts (+1 -0)
📝 packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/locales/en.json (+15 -1)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/draft-store.ts (+1 -1)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/evidence-unit-extraction.ts (+7 -1)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/ltm-utils.ts (+15 -0)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/rejected-suggestions.ts (+116 -8)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/routes.ts (+18 -0)

...and 9 more files

📄 Description

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 #1225

Why this change

  • A short form of a known character or persona name (Alex for Alex Rivera) had no exact-name or explicit-alias match, so extraction forked a duplicate local_character: subject. Character memories split away from the known identity, and relationship memories named two identities for one person.
  • The fix reuses the existing ambiguity and recovery machinery (dropped candidates, review drafts, persisted subject choices) instead of adding a parallel identity path.

What changed

  • long-term-memory 1.4.4 → 1.4.5.
  • Automatic binding is limited to an exact full name, an explicit alias, a trusted subject key, or a choice the user already saved. A short or partial name related to exactly one trusted character or persona waits in the Review Queue with per-participant choices: bind to the existing subject, use a different identity (Roleplay only), or skip the participant, which skips the whole fact or relationship.
  • Two trusted subjects sharing a first name stay ambiguous and are never merged; a short name is never bound by first name alone.
  • Choices are stored on the rejected suggestion, keyed to the chat or group family, reused by later extractions in every mode (Roleplay, Conversation, Game), and included in backup and restore.
  • Recovered content becomes a pending draft that only the normal preflight/accept review path can write. It never renames an existing memory, replaces another pending proposal, or applies automatically.
  • Saved decisions are listed per source in the Review Queue and removed with the ordinary rejected-suggestion delete, which also drops a still-pending recovery draft in the same mutation journal; an accepted draft is left alone.
  • A recovery draft now gets its own id instead of reusing the rejected-suggestion id. Reusing it collided with a leftover draft that a newer extraction had superseded, or that was already accepted, and permanently blocked re-resolving the same re-extracted candidate.
  • Generated outputs rebuilt from source: package manifest, server.mjs, client.js, artifacts/long-term-memory-1.4.5.zip, catalog and notes in every lane, and the builder version entry.

Package and security impact

  • Affected package IDs: long-term-memory
  • Engine compatibility impact: none. engine.min stays 2.4.1 and maxExclusive stays 4.0.0.
  • New or changed permissions/entrypoints: no new permissions. One new route, POST /rejected-suggestions/:id/resolve-identity, behind the same authenticated maintenance surface as the existing routes. It re-validates participant names, candidate freshness against the current catalog, source hash and fingerprint, scope, and Roleplay-only local identity at the boundary, and fails closed on a changed choice.
  • Restart, storage, update, or uninstall impact: adds an optional identityResolution field to stored rejected suggestions. Records without it behave exactly as before, and the default rejected list still hides resolved records.

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

  • Rebuilt long-term-memory from source with the merged builder and confirmed no further output changes.
  • Confirmed the archive members match the manifest exactly: agents.json 263273cb… (552 B), server.mjs f3a911d6… (457165 B), client.js f293a78b… (948608 B); artifact SHA-256 c3e4fa51… (1408271 B).
  • node scripts/typecheck-packages.mjs long-term-memory passed.
  • test-ltm.sh all passed, including the local-character, routes/scope, browser lifecycle, installation (install, offline restart, backup inclusion, uninstall, reinstall, durable-byte preservation), runtime, storage, and UI regressions.
  • test-fast.sh (npm run check plus git diff --check) passed with 0 errors.
  • test-ci.sh catalog and PR-gate set passed.
  • Behavioural regression coverage: short-name review, shared-first-name ambiguity, minor-character separation, relationship subject parity, saved-choice reuse in Roleplay/Conversation/Game, re-import stability, and backup round-trip in tests/long-term-memory-local-characters.regression.ts; resolving, listing, and deleting a saved choice, pending-draft cleanup, and a superseded recovery draft not blocking a re-resolve in tests/long-term-memory-routes.regression.ts; the Review Queue saved-choice surface in tests/long-term-memory-browser.regression.ts.
  • Not verified here: hosted CI, and a manual pass through a running Engine UI. The checkboxes above are left for a human.

Documentation impact

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

The README lists packages by name and Engine minimum, not by package version, and the Engine minimum is unchanged, so no README or Engine documentation edit is included.

UI evidence (if applicable)

Summary by CodeRabbit

  • New Features
    • Long-Term Memory 1.4.5 adds identity review when a name may refer to multiple people or match only part of a known name. Choose a match, mark someone as a different person where available, or skip them.
    • Identity choices can be remembered for a chat or group, included in backups, and reviewed or deleted later.
    • Recovering a suggestion creates a pending draft for review; existing memories aren’t changed automatically.

🔄 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/1237 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 10/6/2026 **Status:** ✅ Merged **Merged:** 10/6/2026 **Merged by:** [@Promansis](https://github.com/Promansis) **Base:** `staging` ← **Head:** `fix(long-term-memory)/short-name-review-binding` --- ### 📝 Commits (4) - [`7050665`](https://github.com/Pasta-Devs/Marinara-Agents/commit/7050665bf9c5fd287510376e12fb49113660b70b) fix(long-term-memory): 1.4.5 — review short names for known characters instead of forking local identities (#1225) - [`c790f34`](https://github.com/Pasta-Devs/Marinara-Agents/commit/c790f341abe430e4a55fbcc01b99b106a190990c) Merge upstream/staging into fix(long-term-memory)/short-name-review-binding - [`2465d29`](https://github.com/Pasta-Devs/Marinara-Agents/commit/2465d29a1f98b740b326d309da144a85cd7bdca7) Merge branch 'staging' into fix(long-term-memory)/short-name-review-binding - [`caae5a0`](https://github.com/Pasta-Devs/Marinara-Agents/commit/caae5a0098855136c4d9d6c6215a2fbb6f22566f) fix(long-term-memory): give recovery drafts their own id (#1225) ### 📊 Changes **29 files changed** (+2515 additions, -228 deletions) <details> <summary>View changed files</summary> ➕ `artifacts/long-term-memory-1.4.5.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` (+28 -28) 📝 `packages/long-term-memory/manifest.json` (+5 -5) 📝 `packages/long-term-memory/server.mjs` (+62 -62) 📝 `packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/ReviewQueue.tsx` (+156 -12) ➕ `packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/SubjectIdentityReview.tsx` (+191 -0) 📝 `packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/api.ts` (+1 -0) 📝 `packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/locales/en.json` (+15 -1) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/draft-store.ts` (+1 -1) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/evidence-unit-extraction.ts` (+7 -1) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/ltm-utils.ts` (+15 -0) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/rejected-suggestions.ts` (+116 -8) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/routes.ts` (+18 -0) _...and 9 more files_ </details> ### 📄 Description > [!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 Closes #1225 ## Why this change - A short form of a known character or persona name (`Alex` for `Alex Rivera`) had no exact-name or explicit-alias match, so extraction forked a duplicate `local_character:` subject. Character memories split away from the known identity, and relationship memories named two identities for one person. - The fix reuses the existing ambiguity and recovery machinery (dropped candidates, review drafts, persisted subject choices) instead of adding a parallel identity path. ## What changed - `long-term-memory` 1.4.4 → 1.4.5. - Automatic binding is limited to an exact full name, an explicit alias, a trusted subject key, or a choice the user already saved. A short or partial name related to exactly one trusted character or persona waits in the Review Queue with per-participant choices: bind to the existing subject, use a different identity (Roleplay only), or skip the participant, which skips the whole fact or relationship. - Two trusted subjects sharing a first name stay ambiguous and are never merged; a short name is never bound by first name alone. - Choices are stored on the rejected suggestion, keyed to the chat or group family, reused by later extractions in every mode (Roleplay, Conversation, Game), and included in backup and restore. - Recovered content becomes a pending draft that only the normal preflight/accept review path can write. It never renames an existing memory, replaces another pending proposal, or applies automatically. - Saved decisions are listed per source in the Review Queue and removed with the ordinary rejected-suggestion delete, which also drops a still-pending recovery draft in the same mutation journal; an accepted draft is left alone. - A recovery draft now gets its own id instead of reusing the rejected-suggestion id. Reusing it collided with a leftover draft that a newer extraction had superseded, or that was already accepted, and permanently blocked re-resolving the same re-extracted candidate. - Generated outputs rebuilt from source: package manifest, `server.mjs`, `client.js`, `artifacts/long-term-memory-1.4.5.zip`, catalog and notes in every lane, and the builder version entry. ## Package and security impact - Affected package IDs: `long-term-memory` - Engine compatibility impact: none. `engine.min` stays `2.4.1` and `maxExclusive` stays `4.0.0`. - New or changed permissions/entrypoints: no new permissions. One new route, `POST /rejected-suggestions/:id/resolve-identity`, behind the same authenticated maintenance surface as the existing routes. It re-validates participant names, candidate freshness against the current catalog, source hash and fingerprint, scope, and Roleplay-only local identity at the boundary, and fails closed on a changed choice. - Restart, storage, update, or uninstall impact: adds an optional `identityResolution` field to stored rejected suggestions. Records without it behave exactly as before, and the default rejected list still hides resolved records. ## 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 - Rebuilt `long-term-memory` from source with the merged builder and confirmed no further output changes. - Confirmed the archive members match the manifest exactly: `agents.json` `263273cb…` (552 B), `server.mjs` `f3a911d6…` (457165 B), `client.js` `f293a78b…` (948608 B); artifact SHA-256 `c3e4fa51…` (1408271 B). - `node scripts/typecheck-packages.mjs long-term-memory` passed. - `test-ltm.sh all` passed, including the local-character, routes/scope, browser lifecycle, installation (install, offline restart, backup inclusion, uninstall, reinstall, durable-byte preservation), runtime, storage, and UI regressions. - `test-fast.sh` (`npm run check` plus `git diff --check`) passed with 0 errors. - `test-ci.sh` catalog and PR-gate set passed. - Behavioural regression coverage: short-name review, shared-first-name ambiguity, minor-character separation, relationship subject parity, saved-choice reuse in Roleplay/Conversation/Game, re-import stability, and backup round-trip in `tests/long-term-memory-local-characters.regression.ts`; resolving, listing, and deleting a saved choice, pending-draft cleanup, and a superseded recovery draft not blocking a re-resolve in `tests/long-term-memory-routes.regression.ts`; the Review Queue saved-choice surface in `tests/long-term-memory-browser.regression.ts`. - Not verified here: hosted CI, and a manual pass through a running Engine UI. The checkboxes above are left for a human. ## Documentation impact - [ ] No documentation changes needed - [ ] Updated this README catalog and package guidance - [ ] Updated linked Marinara Engine documentation The README lists packages by name and Engine minimum, not by package version, and the Engine minimum is unchanged, so no README or Engine documentation edit is included. ## UI evidence (if applicable) <!-- Add before/after screenshots or recordings for package UI changes. --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Long-Term Memory 1.4.5 adds identity review when a name may refer to multiple people or match only part of a known name. Choose a match, mark someone as a different person where available, or skip them. * Identity choices can be remembered for a chat or group, included in backups, and reviewed or deleted later. * Recovering a suggestion creates a pending draft for review; existing memories aren’t changed automatically. <!-- 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:30 +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#1356
No description provided.