[PR #601] [MERGED] Fix Memory Nag candidate quota and present-scene recall #1039

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Agents/pull/601
Author: @SpicyMarinara
Created: 8/25/2026
Status: ✅ Merged
Merged: 8/25/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/600-memory-nag-shared-quota


📝 Commits (2)

  • 5cf2d81 chore: start memory nag quota fix
  • d8de605 fix(memory-nag): count shared recall candidates

📊 Changes

10 files changed (+85 additions, -34 deletions)

View changed files

➕ artifacts/memory-nag-1.0.17.zip (+0 -0)
📝 catalog/catalog.json (+8 -8)
📝 catalog/v2/catalog.json (+8 -8)
📝 catalog/v3/catalog.json (+8 -8)
📝 packages/memory-nag/agents.json (+1 -1)
📝 packages/memory-nag/manifest.json (+5 -5)
📝 packages/memory-nag/server.mjs (+1 -1)
📝 packages/memory-nag/src/engine/packages/server/src/services/memory-nag/retrieval.ts (+1 -2)
📝 scripts/build-feature-packages.mjs (+2 -1)
📝 tests/memory-nag-selection.regression.ts (+51 -0)

📄 Description

Linked issue

Closes #600

Why this change

  • Memory Nag could exceed its configured per-character candidate cap because a shared memory was deduplicated before it consumed the later character's quota.
  • A nag that merely repeats the immediate scene is redundant; recall should surface relevant prior history.

What changed

  • Count every associated shared memory toward each relevant character's shortlist quota while keeping the emitted candidate list deduplicated.
  • Tell the recall model not to choose a memory that merely repeats the immediate scene or an action happening now.
  • Add a regression covering two relevant characters, a shared memory, and a per-character cap.
  • Rebuild Memory Nag 1.0.17, its artifact, manifest hashes, and catalog lanes.

Package and security impact

  • Affected package IDs: memory-nag
  • Engine compatibility impact: none; remains >=2.4.4 <4.0.0
  • New or changed permissions/entrypoints: none
  • Restart, storage, update, or uninstall impact: normal package update; no storage/schema changes

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

Local automated proof completed:

  • tsx tests/memory-nag-selection.regression.ts
  • npm run check (0 errors; existing warnings only)
  • node scripts/test-catalog-lanes.mjs
  • node scripts/validate-package-locales.mjs
  • node scripts/validate-catalog.mjs
  • git diff --check

Manual package install/update, restart, offline restart, and uninstall remain for maintainer verification.

Documentation impact

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

No user-facing setup or catalog-membership documentation changed.

UI evidence (if applicable)

Not applicable.

Summary by CodeRabbit

  • New Features
    • Memory Nag now recalls earlier story events instead of repeating the immediate scene.
  • Bug Fixes
    • Improved memory selection to prevent duplicate memories and correctly apply per-character limits.
  • Tests
    • Added coverage for shared-memory quota handling and historical recall instructions.
  • Chores
    • Updated Memory Nag to version 1.0.17 with refreshed package metadata and integrity information.

🔄 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/601 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 8/25/2026 **Status:** ✅ Merged **Merged:** 8/25/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/600-memory-nag-shared-quota` --- ### 📝 Commits (2) - [`5cf2d81`](https://github.com/Pasta-Devs/Marinara-Agents/commit/5cf2d815872f4062f27c3bcf5655124d37733678) chore: start memory nag quota fix - [`d8de605`](https://github.com/Pasta-Devs/Marinara-Agents/commit/d8de6050e021667c71f1a9bd296429d8a605bc45) fix(memory-nag): count shared recall candidates ### 📊 Changes **10 files changed** (+85 additions, -34 deletions) <details> <summary>View changed files</summary> ➕ `artifacts/memory-nag-1.0.17.zip` (+0 -0) 📝 `catalog/catalog.json` (+8 -8) 📝 `catalog/v2/catalog.json` (+8 -8) 📝 `catalog/v3/catalog.json` (+8 -8) 📝 `packages/memory-nag/agents.json` (+1 -1) 📝 `packages/memory-nag/manifest.json` (+5 -5) 📝 `packages/memory-nag/server.mjs` (+1 -1) 📝 `packages/memory-nag/src/engine/packages/server/src/services/memory-nag/retrieval.ts` (+1 -2) 📝 `scripts/build-feature-packages.mjs` (+2 -1) 📝 `tests/memory-nag-selection.regression.ts` (+51 -0) </details> ### 📄 Description ## Linked issue Closes #600 ## Why this change - Memory Nag could exceed its configured per-character candidate cap because a shared memory was deduplicated before it consumed the later character's quota. - A nag that merely repeats the immediate scene is redundant; recall should surface relevant prior history. ## What changed - Count every associated shared memory toward each relevant character's shortlist quota while keeping the emitted candidate list deduplicated. - Tell the recall model not to choose a memory that merely repeats the immediate scene or an action happening now. - Add a regression covering two relevant characters, a shared memory, and a per-character cap. - Rebuild Memory Nag 1.0.17, its artifact, manifest hashes, and catalog lanes. ## Package and security impact - Affected package IDs: `memory-nag` - Engine compatibility impact: none; remains `>=2.4.4 <4.0.0` - New or changed permissions/entrypoints: none - Restart, storage, update, or uninstall impact: normal package update; no storage/schema changes ## 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 Local automated proof completed: - `tsx tests/memory-nag-selection.regression.ts` - `npm run check` (0 errors; existing warnings only) - `node scripts/test-catalog-lanes.mjs` - `node scripts/validate-package-locales.mjs` - `node scripts/validate-catalog.mjs` - `git diff --check` Manual package install/update, restart, offline restart, and uninstall remain for maintainer verification. ## Documentation impact - [ ] No documentation changes needed - [ ] Updated this README catalog and package guidance - [ ] Updated linked Marinara Engine documentation No user-facing setup or catalog-membership documentation changed. ## UI evidence (if applicable) Not applicable. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Memory Nag now recalls earlier story events instead of repeating the immediate scene. * **Bug Fixes** * Improved memory selection to prevent duplicate memories and correctly apply per-character limits. * **Tests** * Added coverage for shared-memory quota handling and historical recall instructions. * **Chores** * Updated Memory Nag to version 1.0.17 with refreshed package metadata and integrity information. <!-- 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-20 17:33:27 +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#1039
No description provided.