Skip to content

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

Merged
Promansis merged 1 commit into
Pasta-Devs:stagingfrom
Promansis:fix(long-term-memory)/local-character-roleplay-modes
Oct 6, 2026
Merged

Promansis merged 1 commit into
Pasta-Devs:stagingfrom
Promansis:fix(long-term-memory)/local-character-roleplay-modes

Conversation

@Promansis

@Promansis Promansis commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

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.

…-only instead of failing the import (Pasta-Devs#1226)

Extraction created every new note with all selected availability modes. A new local character subject with
Conversation or Game selected therefore failed the Roleplay-only note validator, and the whole source failed.

New local character notes are now created with Roleplay only and a `local_character_restricted_to_roleplay`
warning. When Roleplay is not selected, those units are dropped before event-graph closure with a
`local_character_requires_roleplay` diagnostic and are counted as validation rejections. The rest of the
source is still proposed. The Roleplay-only validator is unchanged, and trusted character and persona subjects
keep every selected mode.

Regression: local-characters covers both cases plus trusted and persona subjects. Rebuilt manifest, bundle,
artifact, catalog, and notes from source.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Promansis Promansis self-assigned this Oct 6, 2026
@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: Pasta-Devs/Marinara-Agents/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 8522f587-728c-4b87-9a1a-cb2768a55d9d
📥 Commits

Reviewing files that changed from the base of the PR and between 3e4acd5 and fd866df.

⛔ Files ignored due to path filters (2)
  • artifacts/long-term-memory-1.4.6.zip is excluded by !**/*.zip, !artifacts/**
  • packages/long-term-memory/server.mjs is excluded by !packages/**/server.mjs
📒 Files selected for processing (12)
  • catalog/catalog.json
  • catalog/notes.json
  • catalog/v2/catalog.json
  • catalog/v2/notes.json
  • catalog/v3/catalog.json
  • catalog/v3/notes.json
  • packages/long-term-memory/CHANGELOG.md
  • packages/long-term-memory/manifest.json
  • packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/evidence-unit-compiler.ts
  • packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/evidence-unit-extraction.ts
  • scripts/build-feature-packages.mjs
  • tests/long-term-memory-local-characters.regression.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Long-Term Memory now restricts new local-character memories to Roleplay availability or skips them with a diagnostic when Roleplay is not selected. Other source memories remain proposed. The package and its catalog entries are updated to version 1.4.6.

Changes

Long-Term Memory local-character import

Layer / File(s) Summary
Filter and compile local-character memories
packages/long-term-memory/src/engine/.../evidence-unit-compiler.ts, packages/long-term-memory/src/engine/.../evidence-unit-extraction.ts, tests/long-term-memory-local-characters.regression.ts
New local-character notes use Roleplay availability. Extraction drops new local-character units if Roleplay is not selected and includes diagnostics and rejection accounting. Regression tests cover the Roleplay and non-Roleplay cases, including trusted character and persona subjects.
Publish version 1.4.6 metadata
packages/long-term-memory/manifest.json, packages/long-term-memory/CHANGELOG.md, scripts/build-feature-packages.mjs, catalog/*/catalog.json, catalog/*/notes.json
Package and catalog metadata advance to version 1.4.6 with updated checksums, sizes, and artifact URLs. Release notes describe the local-character behavior. The catalog notes remove the version 1.3.26 entry.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix · Severity of issue fixed: Medium

Sequence Diagram(s)

sequenceDiagram
  participant compileEvidenceUnitExtraction
  participant dropLocalCharactersOutsideRoleplay
  participant sourceEventGraph
  compileEvidenceUnitExtraction->>dropLocalCharactersOutsideRoleplay: Filter deduplicated units by selected modes
  dropLocalCharactersOutsideRoleplay-->>compileEvidenceUnitExtraction: Return retained units and rejection details
  compileEvidenceUnitExtraction->>sourceEventGraph: Close graph with retained units
Loading

Merge Risk: ⚪ Minimal · up to fd866

No concrete issue remains that prevents merging after normal checks.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 4 files. (8 skipped: 8… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed #1226 is closed and completed, so it provides historical context only. No active directly linked issue imposes coding requirements on this pull request.
Out of Scope Changes check ✅ Passed The reported compiler and extraction changes, regression test, package version updates, generated package metadata, and release notes support the current pull request’s local-character extraction fix.…
Title check ✅ Passed The title clearly identifies the 1.4.6 change and its main purpose: keeping local-character memories Roleplay-only instead of failing the import.
Description check ✅ Passed The description covers the linked issue, problem, implementation, package impact, and validation results. It also identifies checks that were not run. The documentation-impact checkboxes are left unse…
Full details: Docstring Coverage

Explanation

Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 4 files. (8 skipped: 8 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added bugfix Bug fix docs packages Agent package sources and manifests artifacts Generated downloadable package artifacts catalog Official catalog and package schemas build Build scripts, snapshots, and validation labels Oct 6, 2026
@Promansis
Promansis marked this pull request as ready for review October 6, 2026 11:37
@Promansis
Promansis merged commit f140047 into Pasta-Devs:staging Oct 6, 2026
22 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

artifacts Generated downloadable package artifacts bugfix Bug fix build Build scripts, snapshots, and validation catalog Official catalog and package schemas docs packages Agent package sources and manifests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant