[PR #778] [MERGED] fix(long-term-memory): allow discarding invalidated drafts (#777) #1131

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

📋 Pull Request Information

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

Base: staging ← Head: fix(long-term-memory)/discard-invalidated-drafts


📝 Commits (1)

  • b2eb3ef fix(long-term-memory): allow discarding invalidated drafts (#777)

📊 Changes

15 files changed (+263 additions, -45 deletions)

View changed files

➕ artifacts/long-term-memory-1.2.25.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 (+4 -0)
📝 packages/long-term-memory/client.js (+14 -14)
📝 packages/long-term-memory/manifest.json (+3 -3)
📝 packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/ReviewQueue.tsx (+29 -8)
📝 packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/locales/en.json (+3 -0)
📝 scripts/build-feature-packages.mjs (+1 -1)
📝 tests/long-term-memory-browser.regression.ts (+135 -1)
📝 tests/long-term-memory-routes.regression.ts (+38 -0)

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

Why this change

  • Invalidated extraction drafts containing proposed mutations remained visible in the Review Queue but could not be discarded: mutation-level discard is restricted to pending drafts, while whole-draft dismissal was only exposed for zero-mutation reports.
  • Obsolete invalidated drafts accumulated indefinitely with no way to remove them from the UI.
  • Reuses the existing authenticated draft-deletion endpoint (DELETE /api/long-term-memory/drafts/:id) to expose a confirmed whole-draft discard action, allowing cleanup without modifying saved memories or allowing invalidated proposals to apply.

What changed

  • packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/ReviewQueue.tsx: Exposed whole-draft dismissal for diagnosticsOnly || item.draft.status === "invalidated". When invalidated, requires confirmation ("Saved memories will not be changed"), calls DELETE /drafts/:id, invalidates queries on success, and presents localized failure messages.
  • packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/locales/en.json: Added English strings for discard title, description, and error.
  • scripts/build-feature-packages.mjs: Bumped Long-Term Memory version from 1.2.24 to 1.2.25.
  • packages/long-term-memory/CHANGELOG.md: Added release notes for 1.2.25.
  • Generated outputs rebuilt via builder: packages/long-term-memory/client.js, packages/long-term-memory/manifest.json, catalog/catalog.json, catalog/notes.json, catalog/v2/catalog.json, catalog/v2/notes.json, catalog/v3/catalog.json, catalog/v3/notes.json, and artifacts/long-term-memory-1.2.25.zip.
  • tests/long-term-memory-browser.regression.ts: Added browser tests for 3-mutation invalidated draft dismissal, confirmation cancellation, network failure retry, keyboard activation, and empty-report dismissal.
  • tests/long-term-memory-routes.regression.ts: Added HTTP tests for unauthorized rejection (403), invalidated accept rejection (409), draft deletion, queue removal, and saved note preservation.

Package and security impact

  • Affected package IDs: long-term-memory (v1.2.25)
  • Engine compatibility impact: none (engine.min: 2.4.1, maxExclusive: 4.0.0 unchanged).
  • New or changed permissions/entrypoints: none (permissions remain agent-runtime, chat-read, chat-write, routes, storage, ui).
  • Restart, storage, update, or uninstall impact: no vault format or schema change. Existing draft deletion removes only the draft file under the vault lock; saved memories and notes are not modified.

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

  • Rebuilt the package with node scripts/build-feature-packages.mjs long-term-memory.
  • Ran test-fast.sh (npm run check format & lint): passed with 0 errors.
  • Ran test-ci.sh (catalog validation, lane routing, determinism, path safety, release notes): passed.
  • Ran test-ltm.sh all with Marinara Engine 2.4.5: passed browser lifecycle with exact 1.2.25 artifact, routes scenarios, installation lifecycle, offline restart, backup, uninstall, and reinstall durable-byte preservation.
  • Inspected compiled styles at mobile (390px) and desktop (1280px) viewports; confirmed button is legible and causes no layout issues.
  • Note: physical Android/Termux device verification and the in-app Download Agents live update flow were not run.

Documentation impact

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

UI evidence (if applicable)

  • Added whole-draft action: "Discard invalidated draft" button rendered directly under the "Draft invalidated" banner for non-empty invalidated drafts.

Summary by CodeRabbit

  • New Features

    • Long-Term Memory now supports discarding invalidated drafts from the review queue.
    • Discarding requires confirmation and removes the invalidated draft without changing saved memories.
    • Invalidated drafts can be dismissed directly from the workbench.
  • Bug Fixes

    • Added clearer feedback when draft disposal fails, allowing users to retry.
    • Improved review-queue handling after drafts are successfully discarded.
  • Chores

    • Released Long-Term Memory version 1.2.25 with updated downloadable package metadata.

🔄 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/778 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 9/9/2026 **Status:** ✅ Merged **Merged:** 9/9/2026 **Merged by:** [@Promansis](https://github.com/Promansis) **Base:** `staging` ← **Head:** `fix(long-term-memory)/discard-invalidated-drafts` --- ### 📝 Commits (1) - [`b2eb3ef`](https://github.com/Pasta-Devs/Marinara-Agents/commit/b2eb3ef42d91bcf74b77f1982b2f46503dd19f9c) fix(long-term-memory): allow discarding invalidated drafts (#777) ### 📊 Changes **15 files changed** (+263 additions, -45 deletions) <details> <summary>View changed files</summary> ➕ `artifacts/long-term-memory-1.2.25.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` (+4 -0) 📝 `packages/long-term-memory/client.js` (+14 -14) 📝 `packages/long-term-memory/manifest.json` (+3 -3) 📝 `packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/ReviewQueue.tsx` (+29 -8) 📝 `packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/locales/en.json` (+3 -0) 📝 `scripts/build-feature-packages.mjs` (+1 -1) 📝 `tests/long-term-memory-browser.regression.ts` (+135 -1) 📝 `tests/long-term-memory-routes.regression.ts` (+38 -0) </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`. <!-- Open as a draft while implementation is in progress. Mark Ready for review only after validation and self-review. --> ## Linked issue <!-- Every PR should reference an issue or feature request. --> Closes #777 ## Why this change <!-- What user problem, package bug, or catalog goal does this solve? --> - Invalidated extraction drafts containing proposed mutations remained visible in the Review Queue but could not be discarded: mutation-level discard is restricted to pending drafts, while whole-draft dismissal was only exposed for zero-mutation reports. - Obsolete invalidated drafts accumulated indefinitely with no way to remove them from the UI. - Reuses the existing authenticated draft-deletion endpoint (`DELETE /api/long-term-memory/drafts/:id`) to expose a confirmed whole-draft discard action, allowing cleanup without modifying saved memories or allowing invalidated proposals to apply. ## What changed <!-- Include affected package IDs and generated outputs. --> - `packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/ReviewQueue.tsx`: Exposed whole-draft dismissal for `diagnosticsOnly || item.draft.status === "invalidated"`. When invalidated, requires confirmation ("Saved memories will not be changed"), calls `DELETE /drafts/:id`, invalidates queries on success, and presents localized failure messages. - `packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/locales/en.json`: Added English strings for discard title, description, and error. - `scripts/build-feature-packages.mjs`: Bumped Long-Term Memory version from `1.2.24` to `1.2.25`. - `packages/long-term-memory/CHANGELOG.md`: Added release notes for `1.2.25`. - Generated outputs rebuilt via builder: `packages/long-term-memory/client.js`, `packages/long-term-memory/manifest.json`, `catalog/catalog.json`, `catalog/notes.json`, `catalog/v2/catalog.json`, `catalog/v2/notes.json`, `catalog/v3/catalog.json`, `catalog/v3/notes.json`, and `artifacts/long-term-memory-1.2.25.zip`. - `tests/long-term-memory-browser.regression.ts`: Added browser tests for 3-mutation invalidated draft dismissal, confirmation cancellation, network failure retry, keyboard activation, and empty-report dismissal. - `tests/long-term-memory-routes.regression.ts`: Added HTTP tests for unauthorized rejection (403), invalidated accept rejection (409), draft deletion, queue removal, and saved note preservation. ## Package and security impact - Affected package IDs: `long-term-memory` (v1.2.25) - Engine compatibility impact: none (`engine.min: 2.4.1`, `maxExclusive: 4.0.0` unchanged). - New or changed permissions/entrypoints: none (permissions remain `agent-runtime`, `chat-read`, `chat-write`, `routes`, `storage`, `ui`). - Restart, storage, update, or uninstall impact: no vault format or schema change. Existing draft deletion removes only the draft file under the vault lock; saved memories and notes are not modified. ## Validation <!-- These are human tasks. Never tick a box for a check that was not actually performed. --> - [x] `node scripts/validate-catalog.mjs` passes locally - [x] `git diff --check` passes locally - [x] Rebuilt every affected manifest, payload, artifact, and catalog entry - [x] Installed or updated the affected package through Marinara Engine - [x] Checked supported modes, restart behavior, and uninstall cleanup - [x] Read and followed `CONTRIBUTING.md` ### Manual verification notes <!-- Describe exactly what you tested, step by step. --> - Rebuilt the package with `node scripts/build-feature-packages.mjs long-term-memory`. - Ran `test-fast.sh` (`npm run check` format & lint): passed with 0 errors. - Ran `test-ci.sh` (catalog validation, lane routing, determinism, path safety, release notes): passed. - Ran `test-ltm.sh all` with Marinara Engine 2.4.5: passed browser lifecycle with exact 1.2.25 artifact, routes scenarios, installation lifecycle, offline restart, backup, uninstall, and reinstall durable-byte preservation. - Inspected compiled styles at mobile (390px) and desktop (1280px) viewports; confirmed button is legible and causes no layout issues. - Note: physical Android/Termux device verification and the in-app Download Agents live update flow were not run. ## Documentation impact - [x] No documentation changes needed - [ ] Updated this README catalog and package guidance - [ ] Updated linked Marinara Engine documentation ## UI evidence (if applicable) <!-- Add before/after screenshots or recordings for package UI changes. --> - Added whole-draft action: "Discard invalidated draft" button rendered directly under the "Draft invalidated" banner for non-empty invalidated drafts. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Long-Term Memory now supports discarding invalidated drafts from the review queue. - Discarding requires confirmation and removes the invalidated draft without changing saved memories. - Invalidated drafts can be dismissed directly from the workbench. - **Bug Fixes** - Added clearer feedback when draft disposal fails, allowing users to retry. - Improved review-queue handling after drafts are successfully discarded. - **Chores** - Released Long-Term Memory version 1.2.25 with updated downloadable package metadata. <!-- 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:03:34 +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#1131
No description provided.