mirror of
https://github.com/Pasta-Devs/Marinara-Agents.git
synced 2026-12-03 18:55:07 +07:00
[PR #1454] [MERGED] fix(long-term-memory): ignore provider subject keys, strip late-drop links, blank template fallback (1.4.49) #1468
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#1468
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?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Agents/pull/1454
Author: @Promansis
Created: 10/18/2026
Status: ✅ Merged
Merged: 10/18/2026
Merged by: @Promansis
Base:
staging← Head:fix(long-term-memory)/1448-extraction-identity-links📝 Commits (3)
494e71cfix(long-term-memory): ignore provider subject keys, strip late-drop links, blank template fallbackd39d20bchore(long-term-memory): release 1.4.49 (#1448)f777500fix(long-term-memory): keep candidate indexes in the late link closure (#1448)📊 Changes
17 files changed (+443 additions, -129 deletions)
View changed files
➕
artifacts/long-term-memory-1.4.49.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(+6 -0)📝
packages/long-term-memory/manifest.json(+3 -3)📝
packages/long-term-memory/server.mjs(+39 -39)📝
packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/evidence-unit-extraction.ts(+58 -18)📝
packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/evidence-unit-validation.ts(+82 -29)📝
packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/extraction-config.ts(+2 -1)📝
packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/subject-identity.ts(+1 -2)📝
scripts/build-feature-packages.mjs(+1 -1)📝
tests/long-term-memory-extraction-graph.regression.ts(+159 -0)📝
tests/long-term-memory-local-characters.regression.ts(+56 -0)📄 Description
Linked issue
Closes #1448
Why this change
Three extraction defects in
evidence-unit-extraction.ts(tracker EX-I2, EX-I1, EX-I9):subjectKeysvalue the model returned, so "Alice prefers tea" with Bob's key was saved to Bob. That only raised a warning, so it could be applied automatically.deduplicateUnits,dropLocalCharactersOutsideRoleplay,closeSourceEventGraph) drop units without closing links again. A memory linking to a dropped unit compiled with the link intact. Preflight then threwdraft link target not found, the source failed atfinalizewith its fingerprint already saved, and every retry failed the same way. In manual review, the suggestion was blocked with a raw error.What changed
evidence-unit-extraction.ts,subject-identity.ts): when the server resolves subjects from names, the parser dropssubjectKeys, and the response schema leaves the field out.trustedLtmSubjectPromptCatalogsends{ name, aliases }only. The prompt is its only reader. The internal resolver still sets keys for established and borrowed subjects, andresolveSubjectNames: falsekeeps provider keys.evidence-unit-validation.ts,evidence-unit-extraction.ts): the validator's closure loop is exported and reused aftercloseSourceEventGraph. A dangling non-structural link is stripped with a diagnostic. A relationship change whose only cause was dropped is dropped too (relationship_state_missing_caused_by) and added to the dropped-candidate accounting.extraction-config.ts,evidence-unit-extraction.ts): a template that is empty after trimming counts as absent, so the mode default applies (activePromptTemplateId: null).evidenceUnitMessagesfalls back to the mode's default, not the Roleplay one.SH/schema.tskeeps.min(1)without.trim(), so stored settings that already hold a blank template still load.f77750017): the late closure reported each unit's position in the filtered list, so after the local-character pass dropped a unit, a stripped-link warning or a late drop named the wrong candidate.validateLtmEvidenceUnitsnow returns its kept-unit index map, and the late closure uses it. The earlier late passes (dropLocalCharactersOutsideRoleplay,closeSourceEventGraph) still index by position, as on staging.long-term-memory1.4.49: CHANGELOG entry, version, manifest, rebuiltserver.mjs, artifact and catalog entries. No release merge was needed; the branch was already onupstream/staging1f7954305.Diff: source +140/−50 lines, tests +208/−0, CHANGELOG +6, before the release commit.
Differences from the issue's Minimal fix, accepted in review:
relationship_state_missing_caused_byrather thanunknown_link_target. A dangling target is never an event id, so it cannot be what grounded an event. Event-grounding losses are still dropped bycloseSourceEventGraph.closeSourceEventGraph: strip-mode only drops relationship units, never timeline events, so a second event-graph pass has nothing to drop.duplicateAliasClosure.units, which only producesset_titlemutations and carries no links.Not in this PR: resolving link targets outside the retrieval window (audit F7 part 2), the prompt-envelope work (EX-I5), and a dedicated drop message for
unknown_link_target(EX-I6, #1450).Package and security impact
long-term-memoryValidation
node scripts/validate-catalog.mjspasses locallygit diff --checkpasses locallyCONTRIBUTING.mdManual verification notes
These checks were run by the coding agent, not by a person. Engine checkout
2039583ca, Nodev24.15.0.tests/long-term-memory-local-characters.regression.ts: Alice's fact resolves to Alice with and without Bob's key; the serialized catalog has nokeyorref; established and borrowed keys still resolve; a link to a local character dropped outside Roleplay is stripped, and its warning names the right candidate (index 1; it reported 0 before the repair).tests/long-term-memory-extraction-graph.regression.ts: the probe-B fixture (achangethread with no event link, plus aworld_factlinking to it) and a late relationship drop. No compiledcreate_noteoradd_linktargets a dropped unit, the drop is counted, and the accounting balances. Also the Conversation-mode whitespace prompt andgetLtmExtractionConfigwith a blank active template.char_maralink,subjectKeysin the schema,key/refin the catalog, Roleplay prompt for a blank Conversation template, unbalanced accounting).494e71c27, these passed:test-ltm.shextraction-graph,local-characters,extraction-reliability,routes-drafts,runtime,storage,routes-imports,conversation-summary-import,review-queue-ambiguous-link,source-taskandroutes, pluscandidate-reconciliationandreconciliation-recallrun directly.f77750017(release plus the CodeRabbit repair), these all passed:test-fast.sh(npm run check,git diff --check) andtypecheck-packages long-term-memory.test-catalog-lanes,validate-package-locales,validate-catalogandcatalog-release-notes.test-ltm.shextraction-graph,local-characters,extraction-reliability,routes-draftsandruntime, pluscandidate-reconciliationandreconciliation-recall.test-ltm.sh installationfor the 1.4.49 artifact. Hosted CI runs the full Long-Term Memory regression list.Documentation impact
UI evidence (if applicable)
None. Nothing changes on screen.
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.