[PR #1238] [MERGED] fix(long-term-memory): 1.4.6 — keep local character memories Roleplay-only instead of failing the import (#1226) #1361

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

📋 Pull Request Information

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

Base: staging ← Head: fix(long-term-memory)/local-character-roleplay-modes


📝 Commits (1)

  • fd866df fix(long-term-memory): 1.4.6 — keep local character memories Roleplay-only instead of failing the import (#1226)

📊 Changes

14 files changed (+227 additions, -70 deletions)

View changed files

➕ artifacts/long-term-memory-1.4.6.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 (+4 -0)
📝 packages/long-term-memory/manifest.json (+3 -3)
📝 packages/long-term-memory/server.mjs (+28 -28)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/evidence-unit-compiler.ts (+2 -1)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/evidence-unit-extraction.ts (+56 -1)
📝 scripts/build-feature-packages.mjs (+1 -1)
📝 tests/long-term-memory-local-characters.regression.ts (+97 -0)

📄 Description

Pull request

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

Why this change

  • In a Roleplay chat, a newly met minor character (for example "Jordan the innkeeper") resolves to a local_character: subject. The compiler gave every new note all of the selected availability modes. With Conversation or Game also selected, the note failed the Roleplay-only validator, and the whole source failed (requested 1, wrote 1, succeeded 0, failed 1). Retrying failed the same way.
  • The validator is correct. The pipeline was creating a note that its own validator rejects.

What changed

 compileEvidenceUnitExtraction
   validateLtmEvidenceUnits
   deduplicateUnits
+  dropLocalCharactersOutsideRoleplay   # Roleplay not selected → drop new local units + diagnostic
   closeSourceEventGraph                # also drops changes that depended on them
   compileLtmEvidenceUnits
     create_note
-      modes: selected modes
+      modes: local subject ? ["roleplay"] : selected modes
+  warning: local_character_restricted_to_roleplay
  • Package: long-term-memory 1.4.6. Source changes are in evidence-unit-compiler.ts and evidence-unit-extraction.ts. A regression test is added in tests/long-term-memory-local-characters.regression.ts.
  • If Roleplay is among the selected modes, the new local character note becomes Roleplay-only with a warning.
  • If Roleplay is not selected, that memory is dropped. The drop is recorded as a local_character_requires_roleplay dropped candidate and diagnostic, and counted under validationRejections. The other memories from the same source are still proposed.
  • Trusted character and persona subjects keep every selected mode. Existing notes are not affected. The Roleplay-only validator is unchanged.
  • Generated outputs rebuilt from source: manifest, server.mjs, artifacts/long-term-memory-1.4.6.zip, and the catalogs and release notes (root, v2, v3). The CHANGELOG has a 1.4.6 entry.

Package and security impact

  • Affected package IDs: long-term-memory
  • Engine compatibility impact: none. The range is still >=2.4.1 <4.0.0.
  • New or changed permissions/entrypoints: none
  • Restart, storage, update, or uninstall impact: none. Only new drafts are affected, and the stored note schema is unchanged.

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

Agent-run checks, not manual verification. All ran on fd866dfe2 with an explicit MARINARA_AGENTS_ROOT and MARINARA_ENGINE_ROOT:

  • Before: the new local-characters case failed with the issue's error:
    ZodError [{ code: "custom", path: ["note","modes"], message: "Local character subjects are available only in Roleplay mode." }]
  • After: the following passed:
    • LTM regressions: local-characters, extraction-graph, extraction-reliability, conversation-summary-import, routes-imports, candidate-reconciliation
    • test-fast.sh, npm run check, typecheck:packages
    • test-catalog-lanes, validate-package-locales, validate-catalog, catalog-release-notes
    • git diff --check

Regression cases:

compile(units = [Jordan (local), Mara (character), Sam Carter (persona)])
  modes [conversation, roleplay, game] → Jordan [roleplay] + warning; Mara and Sam keep all three; outcome success
  modes [conversation, game]           → Jordan dropped + diagnostic; Mara and Sam proposed; partial_success

Not run: an install or update through Marinara Engine, browser checks, and the full test-ltm.sh all suite.

Merge danger

Door: two-way. Drafts are only proposals, and no stored data is migrated.

Blast radius: narrow. Only LTM extraction drafts that create a new local character note change.

Documentation impact

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

UI evidence (if applicable)

Not applicable. The diagnostics appear through the existing extraction outcome UI.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Imports containing memories for newly encountered minor characters no longer fail when those memories can’t be used in the selected modes.
    • If Roleplay is selected alongside Conversation or Game, those memories are limited to Roleplay and a warning explains the restriction.
    • If Roleplay isn’t selected, those memories are skipped with an explanation; other memories from the source can still be proposed.
  • Updates
    • Long-Term Memory updated to version 1.4.6.

🔄 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/1238 **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)/local-character-roleplay-modes` --- ### 📝 Commits (1) - [`fd866df`](https://github.com/Pasta-Devs/Marinara-Agents/commit/fd866dfe2a60ccb204bd4fdcdb31a462739ccb7c) fix(long-term-memory): 1.4.6 — keep local character memories Roleplay-only instead of failing the import (#1226) ### 📊 Changes **14 files changed** (+227 additions, -70 deletions) <details> <summary>View changed files</summary> ➕ `artifacts/long-term-memory-1.4.6.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` (+4 -0) 📝 `packages/long-term-memory/manifest.json` (+3 -3) 📝 `packages/long-term-memory/server.mjs` (+28 -28) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/evidence-unit-compiler.ts` (+2 -1) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/evidence-unit-extraction.ts` (+56 -1) 📝 `scripts/build-feature-packages.mjs` (+1 -1) 📝 `tests/long-term-memory-local-characters.regression.ts` (+97 -0) </details> ### 📄 Description # Pull request > [!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 #1226 ## Why this change - In a Roleplay chat, a newly met minor character (for example "Jordan the innkeeper") resolves to a `local_character:` subject. The compiler gave every new note all of the selected availability modes. With Conversation or Game also selected, the note failed the Roleplay-only validator, and the **whole source** failed (`requested 1, wrote 1, succeeded 0, failed 1`). Retrying failed the same way. - The validator is correct. The pipeline was creating a note that its own validator rejects. ## What changed ```diff compileEvidenceUnitExtraction validateLtmEvidenceUnits deduplicateUnits + dropLocalCharactersOutsideRoleplay # Roleplay not selected → drop new local units + diagnostic closeSourceEventGraph # also drops changes that depended on them compileLtmEvidenceUnits create_note - modes: selected modes + modes: local subject ? ["roleplay"] : selected modes + warning: local_character_restricted_to_roleplay ``` - Package: `long-term-memory` **1.4.6**. Source changes are in `evidence-unit-compiler.ts` and `evidence-unit-extraction.ts`. A regression test is added in `tests/long-term-memory-local-characters.regression.ts`. - If Roleplay is among the selected modes, the new local character note becomes Roleplay-only with a warning. - If Roleplay is not selected, that memory is dropped. The drop is recorded as a `local_character_requires_roleplay` dropped candidate and diagnostic, and counted under `validationRejections`. The other memories from the same source are still proposed. - Trusted character and persona subjects keep every selected mode. Existing notes are not affected. The Roleplay-only validator is unchanged. - Generated outputs rebuilt from source: manifest, `server.mjs`, `artifacts/long-term-memory-1.4.6.zip`, and the catalogs and release notes (root, v2, v3). The CHANGELOG has a 1.4.6 entry. ## Package and security impact - Affected package IDs: `long-term-memory` - Engine compatibility impact: none. The range is still `>=2.4.1 <4.0.0`. - New or changed permissions/entrypoints: none - Restart, storage, update, or uninstall impact: none. Only new drafts are affected, and the stored note schema is unchanged. ## 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 Agent-run checks, not manual verification. All ran on `fd866dfe2` with an explicit `MARINARA_AGENTS_ROOT` and `MARINARA_ENGINE_ROOT`: - **Before:** the new `local-characters` case failed with the issue's error: `ZodError [{ code: "custom", path: ["note","modes"], message: "Local character subjects are available only in Roleplay mode." }]` - **After:** the following passed: - LTM regressions: `local-characters`, `extraction-graph`, `extraction-reliability`, `conversation-summary-import`, `routes-imports`, `candidate-reconciliation` - `test-fast.sh`, `npm run check`, `typecheck:packages` - `test-catalog-lanes`, `validate-package-locales`, `validate-catalog`, `catalog-release-notes` - `git diff --check` Regression cases: ```text compile(units = [Jordan (local), Mara (character), Sam Carter (persona)]) modes [conversation, roleplay, game] → Jordan [roleplay] + warning; Mara and Sam keep all three; outcome success modes [conversation, game] → Jordan dropped + diagnostic; Mara and Sam proposed; partial_success ``` Not run: an install or update through Marinara Engine, browser checks, and the full `test-ltm.sh all` suite. ### Merge danger **Door:** two-way. Drafts are only proposals, and no stored data is migrated. **Blast radius:** narrow. Only LTM extraction drafts that create a new local character note change. ## Documentation impact - [ ] No documentation changes needed - [ ] Updated this README catalog and package guidance - [ ] Updated linked Marinara Engine documentation ## UI evidence (if applicable) Not applicable. The diagnostics appear through the existing extraction outcome UI. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Imports containing memories for newly encountered minor characters no longer fail when those memories can’t be used in the selected modes. * If Roleplay is selected alongside Conversation or Game, those memories are limited to Roleplay and a warning explains the restriction. * If Roleplay isn’t selected, those memories are skipped with an explanation; other memories from the source can still be proposed. * **Updates** * Long-Term Memory updated to version 1.4.6. <!-- 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:43 +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#1361
No description provided.