[PR #1200] [MERGED] fix(long-term-memory): explain injected recall and weighted-lane thresholds #1342

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

📋 Pull Request Information

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

Base: staging ← Head: fix(long-term-memory)/recall-explanation


📝 Commits (2)

  • 150428d fix(long-term-memory): explain injected recall and lane thresholds
  • 2e3445a fix(long-term-memory): keep a bounded prompt-budget rejection slot

📊 Changes

10 files changed (+241 additions, -42 deletions)

View changed files

📝 artifacts/long-term-memory-1.3.39.zip (+0 -0)
📝 catalog/catalog.json (+6 -6)
📝 catalog/v2/catalog.json (+6 -6)
📝 catalog/v3/catalog.json (+6 -6)
📝 packages/long-term-memory/client.js (+1 -1)
📝 packages/long-term-memory/manifest.json (+4 -4)
📝 packages/long-term-memory/server.mjs (+2 -2)
📝 packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/locales/en.json (+1 -1)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/generation-injection.ts (+39 -15)
📝 tests/long-term-memory-runtime.regression.ts (+176 -1)

📄 Description

Pull request

Contributions target staging. Only SpicyMarinara may promote staging to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #1197

Why this change

Recall activity could list memories that serialization never injected, and its score did not distinguish fused ranking from the weighted-lane threshold. This makes tight-budget and threshold decisions misleading to inspect.

What changed

  • Report selected chunks and token usage from the serialized artifact; explain prompt-budget omissions and empty/all-rejected recall.
  • Retain legacy score, adding fusedScore, relevanceScore, and thresholdPassed. Correct English threshold help text without renaming the locale key.
  • Bound combined rejected diagnostics to the existing 20-entry limit, keeping counts and persisted details consistent.
  • Extend the runtime regression and rebuild Long-Term Memory payloads, manifest hashes, ZIP, and generated catalog metadata.
retrieval -> prompt serialization -> artifact-based explanation
                                  -> receipt (unchanged)

Package and security impact

  • Affected package IDs: long-term-memory (version remains 1.3.39).
  • Engine compatibility impact: unchanged, >=2.4.1 <4.0.0; Capability API 1.6.
  • New or changed permissions/entrypoints: none. Existing server/client payloads rebuilt; debug details do not include query, prompt, or memory text.
  • Restart, storage, update, or uninstall impact: no lifecycle or durable-state changes. Ranking, threshold calculations, tiers, dedup, and injected prompt content remain unchanged.
  • Merge danger: two-way door; blast radius is recall diagnostics and threshold help text.

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

Automated evidence

  • Before: tight-budget explanation selected two chunks while the receipt contained one; repair regression then reproduced counts.rejected = 120 versus 80 persisted details. CodeRabbit's one actionable comment on 150428d26 showed a full retrieval rejection list could hide every prompt-budget omission; the test failed with false !== true before the fix.
  • After: runtime regression passes artifact/count/token agreement, partial/full prompt-budget omission, a reserved bounded prompt-budget slot, thresholds 0/0.5/0.6/0.61, equality, legacy-score compatibility, and text redaction. Ranking, threshold calculations, tiers, dedup, and injected prompt content are unchanged.
  • Revalidated final commit 2e3445a2c065818cf708dd6c824d3bc471b4c4db with Node v24.15.0 and clean Engine c164b4741c3df4dd1b0afbb082bb83700c889232, using explicit Agents/Engine roots.
  • Exit 0: node scripts/build-feature-packages.mjs long-term-memory, npm run check (810 lint warnings, no errors), node scripts/typecheck-packages.mjs long-term-memory, catalog lanes/locales/catalog/release-note validators, and worktree/index/base-range whitespace checks.
  • Exit 0: Engine-backed LTM runtime, debug-log, and routes regressions; exact-artifact installation and browser regressions. Installation covers offline restart, backup inclusion, uninstall/reinstall, and durable-byte preservation; browser covers onboarding, review, availability, re-extraction, mobile, and loading.
  • Pre/post-validation and pre-push repository/Engine/dependency snapshots matched. CodeRabbit reviewed 150428d26 and left one actionable comment; that accepted finding is repaired in 2e3445a2c. The push auto-triggers delta review; this command did not dispatch a reviewer.

Manual verification notes

  • No manual installation/update or UI verification performed; automated evidence above is not a manual checklist completion.
  • Full-local aggregate and hosted CI are not claimed. Earlier aggregate runs hit a browser timing assertion; isolated final-commit browser and installation runs pass. Hosted required checks and review remain merge gates.

Documentation impact

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

No README, catalog membership, or Engine documentation changes; existing English UI help text is corrected.

UI evidence (if applicable)

Text-only threshold help change. Automated browser regression passed; no manual screenshots captured.


🔄 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/1200 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 10/2/2026 **Status:** ✅ Merged **Merged:** 10/2/2026 **Merged by:** [@Promansis](https://github.com/Promansis) **Base:** `staging` ← **Head:** `fix(long-term-memory)/recall-explanation` --- ### 📝 Commits (2) - [`150428d`](https://github.com/Pasta-Devs/Marinara-Agents/commit/150428d262a3878bbd51ec0d5686868a383d1dd7) fix(long-term-memory): explain injected recall and lane thresholds - [`2e3445a`](https://github.com/Pasta-Devs/Marinara-Agents/commit/2e3445a2c065818cf708dd6c824d3bc471b4c4db) fix(long-term-memory): keep a bounded prompt-budget rejection slot ### 📊 Changes **10 files changed** (+241 additions, -42 deletions) <details> <summary>View changed files</summary> 📝 `artifacts/long-term-memory-1.3.39.zip` (+0 -0) 📝 `catalog/catalog.json` (+6 -6) 📝 `catalog/v2/catalog.json` (+6 -6) 📝 `catalog/v3/catalog.json` (+6 -6) 📝 `packages/long-term-memory/client.js` (+1 -1) 📝 `packages/long-term-memory/manifest.json` (+4 -4) 📝 `packages/long-term-memory/server.mjs` (+2 -2) 📝 `packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/locales/en.json` (+1 -1) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/generation-injection.ts` (+39 -15) 📝 `tests/long-term-memory-runtime.regression.ts` (+176 -1) </details> ### 📄 Description # Pull request > Contributions target `staging`. Only `SpicyMarinara` may promote `staging` to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. ## Linked issue Closes #1197 ## Why this change Recall activity could list memories that serialization never injected, and its score did not distinguish fused ranking from the weighted-lane threshold. This makes tight-budget and threshold decisions misleading to inspect. ## What changed - Report selected chunks and token usage from the serialized artifact; explain prompt-budget omissions and empty/all-rejected recall. - Retain legacy `score`, adding `fusedScore`, `relevanceScore`, and `thresholdPassed`. Correct English threshold help text without renaming the locale key. - Bound combined rejected diagnostics to the existing 20-entry limit, keeping counts and persisted details consistent. - Extend the runtime regression and rebuild Long-Term Memory payloads, manifest hashes, ZIP, and generated catalog metadata. ```text retrieval -> prompt serialization -> artifact-based explanation -> receipt (unchanged) ``` ## Package and security impact - Affected package IDs: `long-term-memory` (version remains `1.3.39`). - Engine compatibility impact: unchanged, `>=2.4.1 <4.0.0`; Capability API 1.6. - New or changed permissions/entrypoints: none. Existing server/client payloads rebuilt; debug details do not include query, prompt, or memory text. - Restart, storage, update, or uninstall impact: no lifecycle or durable-state changes. Ranking, threshold calculations, tiers, dedup, and injected prompt content remain unchanged. - Merge danger: two-way door; blast radius is recall diagnostics and threshold help text. ## 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` ### Automated evidence - Before: tight-budget explanation selected two chunks while the receipt contained one; repair regression then reproduced `counts.rejected = 120` versus 80 persisted details. CodeRabbit's one actionable comment on `150428d26` showed a full retrieval rejection list could hide every prompt-budget omission; the test failed with `false !== true` before the fix. - After: runtime regression passes artifact/count/token agreement, partial/full prompt-budget omission, a reserved bounded prompt-budget slot, thresholds 0/0.5/0.6/0.61, equality, legacy-score compatibility, and text redaction. Ranking, threshold calculations, tiers, dedup, and injected prompt content are unchanged. - Revalidated final commit `2e3445a2c065818cf708dd6c824d3bc471b4c4db` with Node v24.15.0 and clean Engine `c164b4741c3df4dd1b0afbb082bb83700c889232`, using explicit Agents/Engine roots. - Exit 0: `node scripts/build-feature-packages.mjs long-term-memory`, `npm run check` (810 lint warnings, no errors), `node scripts/typecheck-packages.mjs long-term-memory`, catalog lanes/locales/catalog/release-note validators, and worktree/index/base-range whitespace checks. - Exit 0: Engine-backed LTM `runtime`, `debug-log`, and `routes` regressions; exact-artifact `installation` and `browser` regressions. Installation covers offline restart, backup inclusion, uninstall/reinstall, and durable-byte preservation; browser covers onboarding, review, availability, re-extraction, mobile, and loading. - Pre/post-validation and pre-push repository/Engine/dependency snapshots matched. CodeRabbit reviewed `150428d26` and left one actionable comment; that accepted finding is repaired in `2e3445a2c`. The push auto-triggers delta review; this command did not dispatch a reviewer. ### Manual verification notes - No manual installation/update or UI verification performed; automated evidence above is not a manual checklist completion. - Full-local aggregate and hosted CI are not claimed. Earlier aggregate runs hit a browser timing assertion; isolated final-commit browser and installation runs pass. Hosted required checks and review remain merge gates. ## Documentation impact - [ ] No documentation changes needed - [ ] Updated this README catalog and package guidance - [ ] Updated linked Marinara Engine documentation No README, catalog membership, or Engine documentation changes; existing English UI help text is corrected. ## UI evidence (if applicable) Text-only threshold help change. Automated browser regression passed; no manual screenshots captured. --- <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:13 +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#1342
No description provided.