[PR #1154] [MERGED] fix(long-term-memory): 1.3.34 — stay active when a vault note fails validation #1315

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

📋 Pull Request Information

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

Base: staging ← Head: fix(long-term-memory)/ltm-activation-malformed-notes


📝 Commits (1)

  • 71887b3 fix(long-term-memory): 1.3.34 — stay active when a vault note fails validation (#1153)

📊 Changes

13 files changed (+156 additions, -74 deletions)

View changed files

➕ artifacts/long-term-memory-1.3.34.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 (+30 -30)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/index-state.ts (+14 -3)
📝 scripts/build-feature-packages.mjs (+1 -1)
📝 tests/long-term-memory-storage.regression.ts (+68 -1)

📄 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 #1153

Why this change

Long-Term Memory failed its activation self-check and rolled back to 1.0.2020 whenever the vault contained a note that no longer passed schema validation. initializeLtmStore -> readLtmNoteSummary -> rebuildLtmNoteSummary hard-parsed every vault note, so a legacy source note without import provenance threw a ZodError and aborted activation before the existing quarantine_malformed_notes repair path could run. Any vault with pre-provenance source notes hits the same wall on upgrade.

What changed

  • packages/long-term-memory/src/engine/.../services/long-term-memory/index-state.ts: rebuildLtmNoteSummary now skips only notes that are present but malformed (SyntaxError/ZodError). Operational file-read failures stay terminal, so the derived summary can never silently undercount a vault it could not read. This mirrors the tolerance already used by readAllNotesUnlocked.
  • tests/long-term-memory-storage.regression.ts: new vault-summary-tolerance scenario proves a malformed source note no longer aborts activation, typed reads still surface it, an unreadable note rejects the rebuild, and no partial summary is cached.
  • scripts/build-feature-packages.mjs: package version 1.3.33 -> 1.3.34.
  • packages/long-term-memory/CHANGELOG.md: 1.3.34 [highlight] release note.
  • Rebuilt generated outputs: server.mjs, manifest.json, catalog/{,v2/,v3/}{catalog,notes}.json, and artifacts/long-term-memory-1.3.34.zip.

Package and security impact

  • Affected package IDs: long-term-memory 1.3.34.
  • Engine compatibility impact: none; engine.min/engine.maxExclusive unchanged (>=2.4.1 <4.0.0).
  • New or changed permissions/entrypoints: none.
  • Restart, storage, update, or uninstall impact: no storage-format change. A malformed note is omitted from the derived notes index; typed and full vault reads still surface the failure, and the quarantine maintenance action still clears it. No trust-boundary validation was weakened; note schemas are 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

  • Reproduced the reported failure first: rebuildLtmNoteSummary -> storage.ts:218 -> selfCheck -> activation, ZodError: Source notes must store import provenance.
  • Ran the storage regression with only the source fix stashed to confirm the new scenario fails for the reported reason (activation aborts); then confirmed it passes with the fix.
  • Local self-review raised one P2: the first version caught file-read failures too, which could cache an undercounted summary. Repaired by narrowing the catch, and added the unreadable-note regression (red -> green).
  • test-fast.sh (Prettier + ESLint + git diff --check): pass.
  • test-ltm.sh storage|runtime|index-keys|routes-notes: pass.
  • test-ltm.sh installation: 1.3.34 installation: install, offline restart, backup inclusion, uninstall, reinstall, durable-byte preservation ok.
  • node scripts/test-catalog-lanes.mjs, node scripts/validate-package-locales.mjs, node scripts/validate-catalog.mjs, node scripts/tests/catalog-release-notes.regression.mjs: pass.
  • Artifact identity: archive members match manifest hashes/sizes, and every catalog lane points at the same 1.3.34 archive hash and byte count.
  • Not run: hosted CI, CodeRabbit, and manual browser interaction.

Documentation impact

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

UI evidence (if applicable)

None; server-side activation and storage recovery only.

Summary by CodeRabbit

  • Bug Fixes
    • Long-Term Memory now skips malformed or schema-invalid vault notes when rebuilding its note index, allowing activation to continue. Vault read failures still surface as errors.

🔄 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/1154 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 9/30/2026 **Status:** ✅ Merged **Merged:** 9/30/2026 **Merged by:** [@Promansis](https://github.com/Promansis) **Base:** `staging` ← **Head:** `fix(long-term-memory)/ltm-activation-malformed-notes` --- ### 📝 Commits (1) - [`71887b3`](https://github.com/Pasta-Devs/Marinara-Agents/commit/71887b37fd75eb0736c62e7c4e1bdd67894dc82f) fix(long-term-memory): 1.3.34 — stay active when a vault note fails validation (#1153) ### 📊 Changes **13 files changed** (+156 additions, -74 deletions) <details> <summary>View changed files</summary> ➕ `artifacts/long-term-memory-1.3.34.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` (+30 -30) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/index-state.ts` (+14 -3) 📝 `scripts/build-feature-packages.mjs` (+1 -1) 📝 `tests/long-term-memory-storage.regression.ts` (+68 -1) </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 #1153 ## Why this change Long-Term Memory failed its activation self-check and rolled back to `1.0.2020` whenever the vault contained a note that no longer passed schema validation. `initializeLtmStore` -> `readLtmNoteSummary` -> `rebuildLtmNoteSummary` hard-parsed every vault note, so a legacy `source` note without import `provenance` threw a `ZodError` and aborted activation before the existing `quarantine_malformed_notes` repair path could run. Any vault with pre-provenance source notes hits the same wall on upgrade. ## What changed - `packages/long-term-memory/src/engine/.../services/long-term-memory/index-state.ts`: `rebuildLtmNoteSummary` now skips only notes that are present but malformed (`SyntaxError`/`ZodError`). Operational file-read failures stay terminal, so the derived summary can never silently undercount a vault it could not read. This mirrors the tolerance already used by `readAllNotesUnlocked`. - `tests/long-term-memory-storage.regression.ts`: new `vault-summary-tolerance` scenario proves a malformed source note no longer aborts activation, typed reads still surface it, an unreadable note rejects the rebuild, and no partial summary is cached. - `scripts/build-feature-packages.mjs`: package version `1.3.33` -> `1.3.34`. - `packages/long-term-memory/CHANGELOG.md`: 1.3.34 `[highlight]` release note. - Rebuilt generated outputs: `server.mjs`, `manifest.json`, `catalog/{,v2/,v3/}{catalog,notes}.json`, and `artifacts/long-term-memory-1.3.34.zip`. ## Package and security impact - Affected package IDs: `long-term-memory` 1.3.34. - Engine compatibility impact: none; `engine.min`/`engine.maxExclusive` unchanged (`>=2.4.1 <4.0.0`). - New or changed permissions/entrypoints: none. - Restart, storage, update, or uninstall impact: no storage-format change. A malformed note is omitted from the derived notes index; typed and full vault reads still surface the failure, and the quarantine maintenance action still clears it. No trust-boundary validation was weakened; note schemas are unchanged. ## Validation <!-- These are human tasks. Never tick a box for a check that was not actually performed. --> - [ ] `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 - Reproduced the reported failure first: `rebuildLtmNoteSummary` -> `storage.ts:218` -> `selfCheck` -> activation, `ZodError: Source notes must store import provenance`. - Ran the storage regression with only the source fix stashed to confirm the new scenario fails for the reported reason (activation aborts); then confirmed it passes with the fix. - Local self-review raised one P2: the first version caught file-read failures too, which could cache an undercounted summary. Repaired by narrowing the catch, and added the unreadable-note regression (red -> green). - `test-fast.sh` (Prettier + ESLint + `git diff --check`): pass. - `test-ltm.sh storage|runtime|index-keys|routes-notes`: pass. - `test-ltm.sh installation`: `1.3.34 installation: install, offline restart, backup inclusion, uninstall, reinstall, durable-byte preservation ok`. - `node scripts/test-catalog-lanes.mjs`, `node scripts/validate-package-locales.mjs`, `node scripts/validate-catalog.mjs`, `node scripts/tests/catalog-release-notes.regression.mjs`: pass. - Artifact identity: archive members match manifest hashes/sizes, and every catalog lane points at the same `1.3.34` archive hash and byte count. - Not run: hosted CI, CodeRabbit, and manual browser interaction. ## Documentation impact - [ ] No documentation changes needed - [ ] Updated this README catalog and package guidance - [ ] Updated linked Marinara Engine documentation ## UI evidence (if applicable) None; server-side activation and storage recovery only. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Long-Term Memory now skips malformed or schema-invalid vault notes when rebuilding its note index, allowing activation to continue. Vault read failures still surface as errors. <!-- 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:08:29 +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#1315
No description provided.