[PR #723] [MERGED] fix(long-term-memory): speed up source view loading #1109

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Agents/pull/723
Author: @Promansis
Created: 9/5/2026
Status: ✅ Merged
Merged: 9/5/2026
Merged by: @Promansis

Base: staging ← Head: fix(long-term-memory)/source-view-load-performance


📝 Commits (5)

  • a77bbcc fix(long-term-memory): avoid duplicate review note scans
  • 028ab2d test(long-term-memory): prove review lookup deduplication
  • 052c14d test(long-term-memory): align scope fallback contract
  • c2dc389 fix(long-term-memory): reuse scope target note snapshot
  • 3c74f13 release(long-term-memory): publish 1.2.21

📊 Changes

17 files changed (+152 additions, -92 deletions)

View changed files

➕ artifacts/long-term-memory-1.2.21.zip (+0 -0)
📝 catalog/catalog.json (+6 -6)
📝 catalog/notes.json (+6 -0)
📝 catalog/v2/catalog.json (+6 -6)
📝 catalog/v2/notes.json (+6 -0)
📝 catalog/v3/catalog.json (+6 -6)
📝 catalog/v3/notes.json (+6 -0)
📝 packages/long-term-memory/CHANGELOG.md (+5 -0)
📝 packages/long-term-memory/manifest.json (+3 -3)
📝 packages/long-term-memory/server.mjs (+48 -48)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/draft-review.ts (+5 -4)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/routes.ts (+1 -1)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/subject-identity.ts (+17 -5)
📝 scripts/build-feature-packages.mjs (+1 -1)
📝 tests/long-term-memory-routes.regression.ts (+18 -5)
📝 tests/long-term-memory-scope-fallback-labels.regression.ts (+2 -2)
📝 tests/long-term-memory-storage.regression.ts (+16 -5)

📄 Description

Pull request

Important

Contributions target staging. Only SpicyMarinara may promote staging to main.

Linked issue

Closes #721

Why this change

  • Long-Term Memory 1.2.20 source-oriented surfaces could take a long time to load because Review Queue performed duplicate note lookups and the all-chat scope-target path rescanned the vault once per chat. This caused slow Review Queue, Memory Vault, and Sources loading.

What changed

  • Bumped Long-Term Memory from 1.2.20 to 1.2.21.
  • Combined Review Queue source and mutation-target note lookups into one deduplicated read.
  • Reused the /scope-targets route note snapshot for local-character catalog generation across all chats.
  • Added regression coverage for lookup deduplication, snapshot reuse, and current Memory Vault fallback-label wiring.
  • Rebuilt server.mjs, manifest hashes/sizes, artifact ZIP, catalog lanes, catalog release notes, and builder version.

Package and security impact

  • Affected package IDs: long-term-memory
  • Engine compatibility impact: unchanged; remains Engine 2.4.1 through <4.0.0.
  • New or changed permissions/entrypoints: none.
  • Restart, storage, update, or uninstall impact: package version bump requires the normal package restart/update path; storage format 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

Automated validation notes

  • MARINARA_ENGINE_ROOT=/home/damo/dev/Marinara-Engine ~/.config/opencode/marinara-agents-local/test-ltm.sh all passed, including exact 1.2.21 lifecycle, routes, scope targets, storage, runtime, source tasks, and UI regressions.
  • ~/.config/opencode/marinara-agents-local/test-ci.sh passed all local repository, security, catalog, locale, archive, hash, size, and release-note gates.
  • npm run check passed with 0 errors and 69 pre-existing warnings.
  • Fresh exact-HEAD review passed with no actionable findings.

Manual verification notes

  • Automated lifecycle coverage exercised install, offline restart, backup inclusion, uninstall, reinstall, and durable-byte preservation. Interactive human verification remains unchecked.

Documentation impact

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

UI evidence (if applicable)

  • No new UI behavior or styling was introduced; the source-view performance path is covered by route and lifecycle regressions.

Summary by CodeRabbit

  • Bug Fixes

    • Reduced redundant note scans when loading Review Queue, Memory Vault, and Sources.
    • Preserved local-character scope targets by reusing already loaded note data.
    • Ensured draft review note lookups are performed in a single batch.
  • Release

    • Updated Long-Term Memory to version 1.2.21.

🔄 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/723 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 9/5/2026 **Status:** ✅ Merged **Merged:** 9/5/2026 **Merged by:** [@Promansis](https://github.com/Promansis) **Base:** `staging` ← **Head:** `fix(long-term-memory)/source-view-load-performance` --- ### 📝 Commits (5) - [`a77bbcc`](https://github.com/Pasta-Devs/Marinara-Agents/commit/a77bbcc51647703c3b0142d929d612fd192c6895) fix(long-term-memory): avoid duplicate review note scans - [`028ab2d`](https://github.com/Pasta-Devs/Marinara-Agents/commit/028ab2dc39ca8fdba043d94736b0463b753f46e4) test(long-term-memory): prove review lookup deduplication - [`052c14d`](https://github.com/Pasta-Devs/Marinara-Agents/commit/052c14d7eed6cce256f43debe0c545c8b1c9cfe0) test(long-term-memory): align scope fallback contract - [`c2dc389`](https://github.com/Pasta-Devs/Marinara-Agents/commit/c2dc38976cb33b3f4092222bc09d43e59e289bf5) fix(long-term-memory): reuse scope target note snapshot - [`3c74f13`](https://github.com/Pasta-Devs/Marinara-Agents/commit/3c74f1368123afb242d0de49bf6792c631796127) release(long-term-memory): publish 1.2.21 ### 📊 Changes **17 files changed** (+152 additions, -92 deletions) <details> <summary>View changed files</summary> ➕ `artifacts/long-term-memory-1.2.21.zip` (+0 -0) 📝 `catalog/catalog.json` (+6 -6) 📝 `catalog/notes.json` (+6 -0) 📝 `catalog/v2/catalog.json` (+6 -6) 📝 `catalog/v2/notes.json` (+6 -0) 📝 `catalog/v3/catalog.json` (+6 -6) 📝 `catalog/v3/notes.json` (+6 -0) 📝 `packages/long-term-memory/CHANGELOG.md` (+5 -0) 📝 `packages/long-term-memory/manifest.json` (+3 -3) 📝 `packages/long-term-memory/server.mjs` (+48 -48) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/draft-review.ts` (+5 -4) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/routes.ts` (+1 -1) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/subject-identity.ts` (+17 -5) 📝 `scripts/build-feature-packages.mjs` (+1 -1) 📝 `tests/long-term-memory-routes.regression.ts` (+18 -5) 📝 `tests/long-term-memory-scope-fallback-labels.regression.ts` (+2 -2) 📝 `tests/long-term-memory-storage.regression.ts` (+16 -5) </details> ### 📄 Description # Pull request > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote `staging` to `main`. ## Linked issue Closes #721 ## Why this change - Long-Term Memory 1.2.20 source-oriented surfaces could take a long time to load because Review Queue performed duplicate note lookups and the all-chat scope-target path rescanned the vault once per chat. This caused slow Review Queue, Memory Vault, and Sources loading. ## What changed - Bumped Long-Term Memory from 1.2.20 to 1.2.21. - Combined Review Queue source and mutation-target note lookups into one deduplicated read. - Reused the `/scope-targets` route note snapshot for local-character catalog generation across all chats. - Added regression coverage for lookup deduplication, snapshot reuse, and current Memory Vault fallback-label wiring. - Rebuilt `server.mjs`, manifest hashes/sizes, artifact ZIP, catalog lanes, catalog release notes, and builder version. ## Package and security impact - Affected package IDs: `long-term-memory` - Engine compatibility impact: unchanged; remains Engine `2.4.1` through `<4.0.0`. - New or changed permissions/entrypoints: none. - Restart, storage, update, or uninstall impact: package version bump requires the normal package restart/update path; storage format 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` ### Automated validation notes - `MARINARA_ENGINE_ROOT=/home/damo/dev/Marinara-Engine ~/.config/opencode/marinara-agents-local/test-ltm.sh all` passed, including exact 1.2.21 lifecycle, routes, scope targets, storage, runtime, source tasks, and UI regressions. - `~/.config/opencode/marinara-agents-local/test-ci.sh` passed all local repository, security, catalog, locale, archive, hash, size, and release-note gates. - `npm run check` passed with 0 errors and 69 pre-existing warnings. - Fresh exact-HEAD review passed with no actionable findings. ### Manual verification notes - Automated lifecycle coverage exercised install, offline restart, backup inclusion, uninstall, reinstall, and durable-byte preservation. Interactive human verification remains unchecked. ## Documentation impact - [ ] No documentation changes needed - [ ] Updated this README catalog and package guidance - [ ] Updated linked Marinara Engine documentation ## UI evidence (if applicable) - No new UI behavior or styling was introduced; the source-view performance path is covered by route and lifecycle regressions. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Reduced redundant note scans when loading Review Queue, Memory Vault, and Sources. * Preserved local-character scope targets by reusing already loaded note data. * Ensured draft review note lookups are performed in a single batch. * **Release** * Updated Long-Term Memory to version 1.2.21. <!-- 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:02:53 +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#1109
No description provided.