mirror of
https://github.com/Pasta-Devs/Marinara-Agents.git
synced 2026-12-03 18:55:07 +07:00
[GH-ISSUE #1085] [Feature]: Bounded post-extraction reconciliation for Long-Term Memory extraction #551
Labels
No labels
agent: chess
agent: conversation-calls
agent: eightball
agent: haptic
agent: hierarchical-maps
agent: hierarchical-maps
agent: illustrator
agent: poker
agent: rock-paper-scissors
agent: tic-tac-toe
agent: uno
artifacts
bug
bugfix
build
catalog
ci
client
dependencies
docs
documentation
enhancement
feature
fixed-in-staging
in-pr
normal-scope
packages
pull-request
qol
regression
roadmap
scope-risk
server
soup
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Agents#551
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Promansis on GitHub (Sep 26, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1085
Originally assigned to: @Promansis on GitHub.
What problem does this solve?
Long-Term Memory extraction currently relies on the provider prompt to reuse existing note IDs.
evidence-unit-extraction.tsinstructs the model: "Do not intentionally target an existing note id unless that exact note appears in existingTypedNotes."Only
character_factandrelationship_statesubjects receive code-side canonical resolution through the trusted catalog. Every other stream (timeline_event,thread,world_fact,tone,anchor) derives its target note id directly from the model-chosensubjectIdvianoteIdForEvidenceUnit(evidence-unit-validation.ts). As the vault grows we want canonical identity to be code-owned, but removing model-visible note IDs without a code-side replacement makes the model re-inventsubjectIds for notes that already exist, producing duplicate notes.This issue builds the missing code-side reconciliation first, while the existing prompt is still in place, so a later prompt change has a proven replacement.
Proposed package or change
Package:
long-term-memory(server extraction).Add bounded, deterministic post-extraction reconciliation that resolves extracted candidates to existing notes in code, before validation and compilation:
Focus the new work on the non-character streams that currently rely most directly on model-visible IDs. Keep character/relationship resolution in
subject-identity.tsas-is unless focused tests prove it must participate.Keep unchanged: prompt contents and
existingTypedNotes;LtmEvidenceUnitstructure; draft/review/apply, locks, fingerprints, index rebuild; deterministic game-mode extraction. Do not add vector/embedding search or a second LLM stage.Proof: focused tests covering deduplication, create behavior, ambiguity, scope isolation, link/event closure, and mutation kinds; plus boundedness and retrieval recall measured against a recorded baseline, including a vault larger than the current prompt could hold.
Why should this be optional?
This is a behavior change inside the existing downloadable
long-term-memoryAgent package's server extraction code. It belongs in the package payload, not the lightweight Engine core, consistent with the catalog model: change source/builders, then rebuild generated bundles and the catalog lane separately.Alternatives considered
LtmEvidenceUnitshape: not needed; the type already carriessubjectNames/subjectKeyshints.Additional context
First of two sequenced issues. The prompt-decoupling issue depends on this reconciliation being in place and proven. Target branch:
staging.Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked: