[GH-ISSUE #1041] [Issue]: LTM subject resolution must preserve explicit identity and fail closed #532

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

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

Originally assigned to: @Promansis on GitHub.

Summary

Long-term memory subject resolution can assign the wrong identity or reject recoverable candidates. Make explicit keys authoritative, prefer exact trusted names over conflicting aliases, resolve only unique aliases automatically, and keep ambiguous or fuzzy matches from silently selecting an identity.

Affected package

long-term-memory (server-side subject identity resolution)

Expected behavior

  • Valid explicit subjectKeys are authoritative; invalid explicit keys fail closed without falling back to names.
  • Exact trusted names win over another identity's alias. Unique aliases resolve automatically; ambiguous aliases require a scoped choice that is reused.
  • Fuzzy matches can be suggested but never automatically assign identity. Short/full-name links are not inferred without explicit evidence.
  • A malformed incidental character/relationship subjectId does not discard a candidate when valid subjectNames resolve it.
  • Unicode, ordinary punctuation, lowercase names, and source-visible names resolve correctly.
  • Uncertain candidates retain original names, proposed matches, and reasons so they can be recovered.

Actual behavior

Identity resolution may choose an alias over an exact name, auto-assign fuzzy or inferred name matches, reject names due to ASCII-only or case/punctuation eligibility rules, or discard candidates because an incidental ID is malformed. Ambiguous aliases lack a reusable scoped choice.

Steps to reproduce

  1. Resolve synthetic inputs with conflicting exact-name and alias matches, ambiguous aliases, or fuzzy-neighbor names such as Maria and Marie.
  2. Repeat with Unicode and punctuated/lowercase names, and with valid subjectNames plus a malformed incidental subjectId.
  3. Inspect resolved subject keys and diagnostics.

Environment

  • Marinara Engine version: current staging baseline
  • Package version: 1.3.14 at investigation time
  • Install type: source
  • OS + version: n/a — deterministic server-side logic
  • Browser or app shell: n/a

Logs, screenshots, or video

Use synthetic regression fixtures only; no private chat, vault, or user data.

Additional context

  • Target branch: staging.
  • Related prior issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/899 (closed; earlier extraction/backfill scope).
  • Keep target-ID collision and normalization stability work in a separate issue. Keep legacy duplicate/conflict repair and link remapping in a separate issue.
  • Acceptance: invalid explicit keys reject; exact trusted names beat aliases; unique aliases resolve; ambiguous and fuzzy cases do not silently assign; supported Unicode/punctuation resolves; incidental malformed IDs do not defeat valid names; uncertainty remains recoverable.

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 (Sep 23, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1041 Originally assigned to: @Promansis on GitHub. ## Summary Long-term memory subject resolution can assign the wrong identity or reject recoverable candidates. Make explicit keys authoritative, prefer exact trusted names over conflicting aliases, resolve only unique aliases automatically, and keep ambiguous or fuzzy matches from silently selecting an identity. ## Affected package `long-term-memory` (server-side subject identity resolution) ## Expected behavior - Valid explicit `subjectKeys` are authoritative; invalid explicit keys fail closed without falling back to names. - Exact trusted names win over another identity's alias. Unique aliases resolve automatically; ambiguous aliases require a scoped choice that is reused. - Fuzzy matches can be suggested but never automatically assign identity. Short/full-name links are not inferred without explicit evidence. - A malformed incidental character/relationship `subjectId` does not discard a candidate when valid `subjectNames` resolve it. - Unicode, ordinary punctuation, lowercase names, and source-visible names resolve correctly. - Uncertain candidates retain original names, proposed matches, and reasons so they can be recovered. ## Actual behavior Identity resolution may choose an alias over an exact name, auto-assign fuzzy or inferred name matches, reject names due to ASCII-only or case/punctuation eligibility rules, or discard candidates because an incidental ID is malformed. Ambiguous aliases lack a reusable scoped choice. ## Steps to reproduce 1. Resolve synthetic inputs with conflicting exact-name and alias matches, ambiguous aliases, or fuzzy-neighbor names such as `Maria` and `Marie`. 2. Repeat with Unicode and punctuated/lowercase names, and with valid `subjectNames` plus a malformed incidental `subjectId`. 3. Inspect resolved subject keys and diagnostics. ## Environment - Marinara Engine version: current staging baseline - Package version: 1.3.14 at investigation time - Install type: source - OS + version: n/a — deterministic server-side logic - Browser or app shell: n/a ## Logs, screenshots, or video Use synthetic regression fixtures only; no private chat, vault, or user data. ## Additional context - Target branch: `staging`. - Related prior issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/899 (closed; earlier extraction/backfill scope). - Keep target-ID collision and normalization stability work in a separate issue. Keep legacy duplicate/conflict repair and link remapping in a separate issue. - Acceptance: invalid explicit keys reject; exact trusted names beat aliases; unique aliases resolve; ambiguous and fuzzy cases do not silently assign; supported Unicode/punctuation resolves; incidental malformed IDs do not defeat valid names; uncertainty remains recoverable. ## 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:28:22 +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#532
No description provided.