[PR #995] [MERGED] feat(ltm): add optional guardrails #1230

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

📋 Pull Request Information

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

Base: staging ← Head: feature/ltm-optional-guardrails


📝 Commits (6)

  • 7a199c5 feat(ltm): add optional guardrails (#984)
  • 7c16b83 fix(ltm): repair fork guardrails (#984)
  • 43c6edf Merge branch 'staging' into feature/ltm-optional-guardrails
  • 471c633 Merge remote-tracking branch 'upstream/staging' into feature/ltm-optional-guardrails
  • 310fcdd Merge remote-tracking branch 'origin/feature/ltm-optional-guardrails' into feature/ltm-optional-guardrails
  • ebe229d fix(ltm): preserve unicode fork matching (#984)

📊 Changes

26 files changed (+1003 additions, -103 deletions)

View changed files

➕ artifacts/long-term-memory-1.3.7.zip (+0 -0)
📝 catalog/catalog.json (+8 -8)
📝 catalog/notes.json (+6 -0)
📝 catalog/v2/catalog.json (+8 -8)
📝 catalog/v2/notes.json (+6 -0)
📝 catalog/v3/catalog.json (+8 -8)
📝 catalog/v3/notes.json (+6 -0)
📝 packages/long-term-memory/CHANGELOG.md (+6 -0)
📝 packages/long-term-memory/client.js (+18 -18)
📝 packages/long-term-memory/manifest.json (+5 -5)
📝 packages/long-term-memory/server.mjs (+46 -45)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/draft-projector.ts (+2 -1)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/draft-review.ts (+52 -1)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/evidence-unit-extraction.ts (+2 -0)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/evidence-unit-validation.ts (+27 -0)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/maintenance.ts (+43 -0)
➕ packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/note-fork-repair.ts (+319 -0)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/routes.ts (+40 -0)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/scoped-targets.ts (+17 -0)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/section-contributions.ts (+22 -8)

...and 6 more files

📄 Description

Linked issue

Closes #984

Why this change

  • Add optional Long-Term Memory guardrails for identity, extraction, scoped drafts, and note-fork repair while preserving existing package behavior.

What changed

  • Added I20/I21 diagnostics and I22 note-fork preview/apply, rollback, stale-preview, scope, mode, lifecycle, provenance, and contribution safeguards.
  • Repaired dropped-candidate accounting, maintenance compatibility filtering, deterministic canonical selection, metadata/link merging, typed route errors, contribution grouping, and rollback regression coverage.
  • Rebuilt the Long-Term Memory package and catalogs as 1.3.7; preserved the existing 1.3.6 artifact.

Package and security impact

  • Affected package IDs: long-term-memory
  • Engine compatibility impact: Uses the existing Engine-backed LTM runtime; no compatibility range expansion.
  • New or changed permissions/entrypoints: No new permissions; adds guarded LTM routes.
  • Restart, storage, update, or uninstall impact: Storage mutations use existing transactional and backup/restore paths.

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

  • Full validation completed on final HEAD: test-ltm.sh all, test-ci.sh, focused delta/extraction/routes/storage regressions, package typecheck, catalog/locale/release-note validation, and formatting/diff checks.
  • Repair commit: 7c16b830.

Documentation impact

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

UI evidence (if applicable)

  • Not applicable.

Summary by CodeRabbit

  • New Features

    • Added preview and apply workflows for repairing duplicate or conflicting long-term-memory notes, with backups, conflict checks, and rollback protection.
    • Improved contribution deduplication while preserving source and manual evidence.
  • Bug Fixes

    • Corrected fork review scope, provenance, stale-preview, conflict, and rollback handling.
    • Added warnings for suspicious resolved-thread creation and stricter event validation.
    • Improved resolved-thread diagnostics and character-alias validation.
  • Release

    • Updated the long-term-memory package to version 1.3.7.

🔄 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/995 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 9/20/2026 **Status:** ✅ Merged **Merged:** 9/20/2026 **Merged by:** [@Promansis](https://github.com/Promansis) **Base:** `staging` ← **Head:** `feature/ltm-optional-guardrails` --- ### 📝 Commits (6) - [`7a199c5`](https://github.com/Pasta-Devs/Marinara-Agents/commit/7a199c583f635e7450f601d4a4e281017d69a4ce) feat(ltm): add optional guardrails (#984) - [`7c16b83`](https://github.com/Pasta-Devs/Marinara-Agents/commit/7c16b8300bd1a37e4c2e6539803366ad22f0f6a4) fix(ltm): repair fork guardrails (#984) - [`43c6edf`](https://github.com/Pasta-Devs/Marinara-Agents/commit/43c6edf1ca3ea7180223bc02c0fe23a9bb72a959) Merge branch 'staging' into feature/ltm-optional-guardrails - [`471c633`](https://github.com/Pasta-Devs/Marinara-Agents/commit/471c6338c5f73237b14a59d2b1ccaa3cd500ceeb) Merge remote-tracking branch 'upstream/staging' into feature/ltm-optional-guardrails - [`310fcdd`](https://github.com/Pasta-Devs/Marinara-Agents/commit/310fcddc84e517c0e1c66fc910dd4455c3d837b5) Merge remote-tracking branch 'origin/feature/ltm-optional-guardrails' into feature/ltm-optional-guardrails - [`ebe229d`](https://github.com/Pasta-Devs/Marinara-Agents/commit/ebe229dd6756d43c7912ca6dcc22904a1fbce30f) fix(ltm): preserve unicode fork matching (#984) ### 📊 Changes **26 files changed** (+1003 additions, -103 deletions) <details> <summary>View changed files</summary> ➕ `artifacts/long-term-memory-1.3.7.zip` (+0 -0) 📝 `catalog/catalog.json` (+8 -8) 📝 `catalog/notes.json` (+6 -0) 📝 `catalog/v2/catalog.json` (+8 -8) 📝 `catalog/v2/notes.json` (+6 -0) 📝 `catalog/v3/catalog.json` (+8 -8) 📝 `catalog/v3/notes.json` (+6 -0) 📝 `packages/long-term-memory/CHANGELOG.md` (+6 -0) 📝 `packages/long-term-memory/client.js` (+18 -18) 📝 `packages/long-term-memory/manifest.json` (+5 -5) 📝 `packages/long-term-memory/server.mjs` (+46 -45) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/draft-projector.ts` (+2 -1) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/draft-review.ts` (+52 -1) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/evidence-unit-extraction.ts` (+2 -0) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/evidence-unit-validation.ts` (+27 -0) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/maintenance.ts` (+43 -0) ➕ `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/note-fork-repair.ts` (+319 -0) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/routes.ts` (+40 -0) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/scoped-targets.ts` (+17 -0) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/section-contributions.ts` (+22 -8) _...and 6 more files_ </details> ### 📄 Description ## Linked issue Closes #984 ## Why this change - Add optional Long-Term Memory guardrails for identity, extraction, scoped drafts, and note-fork repair while preserving existing package behavior. ## What changed - Added I20/I21 diagnostics and I22 note-fork preview/apply, rollback, stale-preview, scope, mode, lifecycle, provenance, and contribution safeguards. - Repaired dropped-candidate accounting, maintenance compatibility filtering, deterministic canonical selection, metadata/link merging, typed route errors, contribution grouping, and rollback regression coverage. - Rebuilt the Long-Term Memory package and catalogs as `1.3.7`; preserved the existing `1.3.6` artifact. ## Package and security impact - Affected package IDs: `long-term-memory` - Engine compatibility impact: Uses the existing Engine-backed LTM runtime; no compatibility range expansion. - New or changed permissions/entrypoints: No new permissions; adds guarded LTM routes. - Restart, storage, update, or uninstall impact: Storage mutations use existing transactional and backup/restore paths. ## 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 - Full validation completed on final HEAD: `test-ltm.sh all`, `test-ci.sh`, focused delta/extraction/routes/storage regressions, package typecheck, catalog/locale/release-note validation, and formatting/diff checks. - Repair commit: `7c16b830`. ## Documentation impact - [ ] No documentation changes needed - [ ] Updated this README catalog and package guidance - [ ] Updated linked Marinara Engine documentation ## UI evidence (if applicable) - Not applicable. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added preview and apply workflows for repairing duplicate or conflicting long-term-memory notes, with backups, conflict checks, and rollback protection. - Improved contribution deduplication while preserving source and manual evidence. - **Bug Fixes** - Corrected fork review scope, provenance, stale-preview, conflict, and rollback handling. - Added warnings for suspicious resolved-thread creation and stricter event validation. - Improved resolved-thread diagnostics and character-alias validation. - **Release** - Updated the long-term-memory package to version 1.3.7. <!-- 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:06:19 +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#1230
No description provided.