[GH-ISSUE #1225] [Issue]: Long-Term Memory: short names for known characters create duplicate local character identities #625

Closed
opened 2026-10-20 17:29:09 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @Promansis on GitHub (Oct 5, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1225

Originally assigned to: @Promansis on GitHub.

Summary

During extraction, a short form of a known character's or persona's name (for example "Alex" for a character
named "Alex Rivera") does not resolve to that existing subject. Instead it becomes a new local_character: subject.
This creates duplicate character memories and splits relationship memories across two identities.

Affected package

long-term-memory

Expected behavior

  • Automatic binding happens only on certain evidence: an exact full name, an alias the user set explicitly,
    a trusted subject key, or a choice the user has already saved.
  • If a short or partial name relates to exactly one trusted character or persona, the memory goes to review with these choices:
    • bind to the existing subject (for example "Alex Rivera"),
    • treat as a different character,
    • skip.
  • The user's choice is saved and reused, so the same name is not asked about again.
  • A short name is never bound to a trusted subject automatically by first name alone.
    Two characters named "Alex" must never be merged without the user's confirmation.
  • Relationship memories resolve both participants with the same rules as character memories.

Actual behavior

  • With a character card named "Alex Rivera" and a persona named "Sam Carter" (both with existing character memories
    bound to character: and persona: subjects, and no explicit aliases), extracted units naming "Alex" and "Sam"
    resolve to new local_character:<family>:alex and local_character:<family>:sam subjects.
  • The same import using the full names, or with "Alex" and "Sam" set as explicit aliases, correctly binds to the
    existing character: and persona: subjects.

Steps to reproduce

  1. Create a vault with character memories for a card named "Alex Rivera" (character:<cardId>) and
    a persona named "Sam Carter" (persona:<personaId>), with no aliases set.
  2. Import a Roleplay chat summary whose extracted character facts name "Alex" and "Sam".
  3. Inspect the proposed create-note mutations. Their subjects are local_character:, not the existing subjects.

Environment

  • Marinara Engine version: any version supported by the package (>= 2.4.1)
  • Package version: 1.4.4
  • Install type: reproduced at source level (isolated vault, fixed extraction output), Agents ef64aeb7b
  • OS + version: not OS-specific
  • Browser or app shell: not applicable

Logs, screenshots, or video

The resolver emits:

source_backed_npc_identity: Accepted Alex as scoped local characters from the source.
subject_identity_normalized: Resolved char_alex_<suffix> to canonical subject target char_alex_<hash>.

Additional context

Where the behavior comes from (at ef64aeb7b):

  • subject-identity.ts:1403-1455: names with no exact or alias match become provisional local subjects.
  • subject-identity.ts:1724-1731: matchTrustedNameRelation compares only the full name and explicit aliases,
    so "Alex" does not relate to "Alex Rivera".

Investigate reusing the existing ambiguity and recovery machinery (ambiguous_subject_identity diagnostics,
recovery candidates, persisted subject choices) before adding anything new. The local-characters regression
already covers ambiguous aliases and saved choices.

Not in scope:

  • No fuzzy or first-name auto-binding.
  • Do not change the rule that local character subjects are Roleplay-only.
  • No automatic merging of existing duplicate notes.

Regression proof (each case must fail before the fix):

  • A short name related to one trusted subject goes to review. It creates no local subject and produces no failure.
  • Two trusted subjects sharing a first name ("Alex Rivera", "Alex Moreau") produce an ambiguous result and are never merged.
  • A minor character who shares a first name with the persona stays separate unless the user links them.
  • A relationship between "Alex" and "Sam" uses the same subjects as their character memories.
  • Exact full names and explicit aliases still bind automatically.
  • A saved choice is reused, and re-importing the same source creates no new identities.
  • The existing local-characters, group, and Game mode identity regressions still pass.

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @Promansis on GitHub (Oct 5, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1225 Originally assigned to: @Promansis on GitHub. ## Summary During extraction, a short form of a known character's or persona's name (for example "Alex" for a character named "Alex Rivera") does not resolve to that existing subject. Instead it becomes a new `local_character:` subject. This creates duplicate character memories and splits relationship memories across two identities. ## Affected package long-term-memory ## Expected behavior - Automatic binding happens only on certain evidence: an exact full name, an alias the user set explicitly, a trusted subject key, or a choice the user has already saved. - If a short or partial name relates to exactly one trusted character or persona, the memory goes to review with these choices: - bind to the existing subject (for example "Alex Rivera"), - treat as a different character, - skip. - The user's choice is saved and reused, so the same name is not asked about again. - A short name is never bound to a trusted subject automatically by first name alone. Two characters named "Alex" must never be merged without the user's confirmation. - Relationship memories resolve both participants with the same rules as character memories. ## Actual behavior - With a character card named "Alex Rivera" and a persona named "Sam Carter" (both with existing character memories bound to `character:` and `persona:` subjects, and no explicit aliases), extracted units naming "Alex" and "Sam" resolve to new `local_character:<family>:alex` and `local_character:<family>:sam` subjects. - The same import using the full names, or with "Alex" and "Sam" set as explicit aliases, correctly binds to the existing `character:` and `persona:` subjects. ## Steps to reproduce 1. Create a vault with character memories for a card named "Alex Rivera" (`character:<cardId>`) and a persona named "Sam Carter" (`persona:<personaId>`), with no aliases set. 2. Import a Roleplay chat summary whose extracted character facts name "Alex" and "Sam". 3. Inspect the proposed create-note mutations. Their subjects are `local_character:`, not the existing subjects. ## Environment - Marinara Engine version: any version supported by the package (>= 2.4.1) - Package version: 1.4.4 - Install type: reproduced at source level (isolated vault, fixed extraction output), Agents `ef64aeb7b` - OS + version: not OS-specific - Browser or app shell: not applicable ## Logs, screenshots, or video The resolver emits: source_backed_npc_identity: Accepted Alex as scoped local characters from the source. subject_identity_normalized: Resolved char_alex_<suffix> to canonical subject target char_alex_<hash>. ## Additional context Where the behavior comes from (at `ef64aeb7b`): - `subject-identity.ts:1403-1455`: names with no exact or alias match become provisional local subjects. - `subject-identity.ts:1724-1731`: `matchTrustedNameRelation` compares only the full name and explicit aliases, so "Alex" does not relate to "Alex Rivera". Investigate reusing the existing ambiguity and recovery machinery (`ambiguous_subject_identity` diagnostics, recovery candidates, persisted subject choices) before adding anything new. The local-characters regression already covers ambiguous aliases and saved choices. Not in scope: - No fuzzy or first-name auto-binding. - Do not change the rule that local character subjects are Roleplay-only. - No automatic merging of existing duplicate notes. Regression proof (each case must fail before the fix): - [ ] A short name related to one trusted subject goes to review. It creates no local subject and produces no failure. - [ ] Two trusted subjects sharing a first name ("Alex Rivera", "Alex Moreau") produce an ambiguous result and are never merged. - [ ] A minor character who shares a first name with the persona stays separate unless the user links them. - [ ] A relationship between "Alex" and "Sam" uses the same subjects as their character memories. - [ ] Exact full names and explicit aliases still bind automatically. - [ ] A saved choice is reused, and re-importing the same source creates no new identities. - [ ] The existing local-characters, group, and Game mode identity regressions still pass. ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-20 17:29:09 +07:00
  • closed this issue
  • added the
    bug
    label
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#625
No description provided.