[GH-ISSUE #612] [Issue]: invalidate drafts after permanent note deletion #317

Closed
opened 2026-10-20 17:26:26 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @Promansis on GitHub (Aug 25, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/612

Originally assigned to: @Promansis on GitHub.

Summary

Review Queue fails closed when a pending draft references a note that was permanently deleted. The stale mutation target is included in the client context-note request, the server omits the missing note, and the client reports unavailable memory context for the entire queue.

Affected package

Long-Term Memory (long-term-memory)

Expected behavior

Permanent deletion should invalidate or remove drafts whose mutations target the deleted note. The review projection should preserve an affected draft as blocked evidence and prevent acceptance rather than making the entire queue unavailable.

Actual behavior

deleteNotesPermanently() removes the note without updating drafts that target it. The review endpoint intentionally keeps invalidated drafts visible. ReviewQueue.tsx collects the stale target ID, requestNotesByIds() throws when the response omits it, and the React Query error state displays Memory context could not load.

Steps to reproduce

  1. Create a note and a pending draft whose mutation targets that note.
  2. Permanently delete the target note.
  3. Open Review Queue and load the review projection.

Environment

  • Marinara Engine version: source checkout
  • Package version: current staging source
  • Install type: source
  • OS + version: Linux
  • Browser or app shell: package test fixture

Logs, screenshots, or video

Long-Term Memory context unavailable for N note(s).

Additional context

The fail-closed behavior was introduced in commit d39abea0 / 62cca901. Existing tests cover HTTP failure and retry, intentionally omitted context notes, route-level partial ID responses, and invalidated drafts after deleting a section. There is no regression test for permanent deletion of a note referenced by a pending draft. The static UI regression passes; the route regression could not start because the neighboring Engine checkout is missing packages/server/src/middleware/privileged-gate.js.

Template check

  • I DID NOT read this template and provide the requested details.
Originally created by @Promansis on GitHub (Aug 25, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/612 Originally assigned to: @Promansis on GitHub. ## Summary Review Queue fails closed when a pending draft references a note that was permanently deleted. The stale mutation target is included in the client context-note request, the server omits the missing note, and the client reports unavailable memory context for the entire queue. ## Affected package Long-Term Memory (`long-term-memory`) ## Expected behavior Permanent deletion should invalidate or remove drafts whose mutations target the deleted note. The review projection should preserve an affected draft as blocked evidence and prevent acceptance rather than making the entire queue unavailable. ## Actual behavior `deleteNotesPermanently()` removes the note without updating drafts that target it. The review endpoint intentionally keeps invalidated drafts visible. `ReviewQueue.tsx` collects the stale target ID, `requestNotesByIds()` throws when the response omits it, and the React Query error state displays `Memory context could not load.` ## Steps to reproduce 1. Create a note and a pending draft whose mutation targets that note. 2. Permanently delete the target note. 3. Open Review Queue and load the review projection. ## Environment - Marinara Engine version: source checkout - Package version: current staging source - Install type: source - OS + version: Linux - Browser or app shell: package test fixture ## Logs, screenshots, or video `Long-Term Memory context unavailable for N note(s).` ## Additional context The fail-closed behavior was introduced in commit d39abea0 / 62cca901. Existing tests cover HTTP failure and retry, intentionally omitted context notes, route-level partial ID responses, and invalidated drafts after deleting a section. There is no regression test for permanent deletion of a note referenced by a pending draft. The static UI regression passes; the route regression could not start because the neighboring Engine checkout is missing `packages/server/src/middleware/privileged-gate.js`. ## Template check - [ ] I DID NOT read this template and provide the requested details.
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#317
No description provided.