[PR #6738] [MERGED] fix(memory): recover reviewed and deleted scene summaries #7304

Closed
opened 2026-10-23 04:18:27 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/6738
Author: @SpicyMarinara
Created: 9/26/2026
Status: ✅ Merged
Merged: 9/27/2026
Merged by: @SpicyMarinara

Base: staging ← Head: codex/advanced-memory-recovery-sept27


📝 Commits (7)

  • 384b470 test(memory): reproduce correction and deleted-scene recovery failures
  • 083d4d9 fix(memory): unblock correction reviews and regenerate deleted scenes
  • 1a75b0f fix(memory): notify again when a cleared failure recurs
  • 3e533f1 fix(memory): keep failure notices readable on small screens
  • 4a1e522 fix(memory): reuse recovery work and follow failure actions across chats
  • 061d56c test(memory): verify repeated recovery against the scene recap
  • 8a49fe7 Merge staging into Advanced Memory recovery

📊 Changes

10 files changed (+371 additions, -115 deletions)

View changed files

📝 CHANGELOG.md (+2 -0)
📝 e2e/advanced-memory.e2e.ts (+152 -91)
📝 packages/client/src/components/chat/AdvancedMemoryInspector.tsx (+19 -7)
📝 packages/client/src/hooks/use-advanced-memory.ts (+33 -1)
📝 packages/client/src/hooks/use-generate.ts (+2 -1)
📝 packages/client/src/localization/locales/en.json (+5 -0)
📝 packages/server/src/services/advanced-memory.ts (+43 -12)
📝 packages/shared/src/types/advanced-memory.ts (+2 -0)
📝 scripts/regressions/advanced-memory-core.regression.ts (+3 -3)
📝 scripts/regressions/advanced-memory-recovery.regression.ts (+110 -0)

📄 Description

Linked issue

Closes #6737

Why this change

A legacy scene with partial character visibility could request a correction while the inspector called it valid and disabled Save correction. Saving left the previous job error visible. Deleting a scene to recover left a permanent exclusion with no way to regenerate that one scene, and background preparation failures produced no toast.

What changed

  • Use the existing visibility-review check in inspector status and allow unchanged text to be saved for the blocked record. Acknowledging the correction clears its error and leaves interrupted preparation resumable. Visibility-specific errors explain character access instead of claiming source messages changed.
  • Show deleted scene ranges with Regenerate scene, reuse targeted preparation, and keep routine maintenance from resurrecting deleted summaries. Keep scene numbering stable across missing/deleted ranges.
  • Reuse paid preparation work when a single-scene recovery is interrupted; a later deletion starts a fresh recovery.
  • Display a compact, deduplicated failure toast with Review memory from existing status polling and generation events. Clear it when processing resumes, and notify again if the failure returns.

No additional recall model calls, polling, dependencies, storage migration, or change to constant-summary source coverage. Recovery generates only the selected scene; deleted wording cannot be recovered without a backup.

Validation

Validated revision: 8a49fe7ee7cdeb1cf5a85b2a244cfcdac1e82d87, including the latest staging changes. Type/build checks, all 10 Advanced Memory suites, and the 18 passing browser cases were rerun on this revision.

  • New server regressions failed before the fix, then passed. node scripts/run-regressions.mjs --filter advanced-memory: all 10 suites passed, including recovery, hidden-history coverage, character access, actual generation and large-archive performance.
  • pnpm check passed; localization, touched-client ESLint and e2e type checks also passed after the final notification copy change.
  • pnpm regression:prompt passed.
  • Final browser run: 18 passed (10 desktop Chromium, 8 iPhone-sized WebKit); 2 desktop-only smoke cases were intentionally skipped on WebKit. All focused recovery/notification cases passed on both browsers. These cover unchanged saves, deleted-scene regeneration, repeated failures, cross-chat toast navigation, actionable notices, and light/dark screenshots.
  • Docker built locally at 3e533f117 before the two review follow-ups; isolated container health and client endpoints both returned HTTP 200. No real profile was mounted.
  • A disposable local copy of the supplied export reproduced the visibility-review failure. Saving unchanged text cleared it without model/network requests; unrelated memories, constant summaries, correction text and audience stayed unchanged. Private files are excluded from this PR and all published evidence.

Local CodeRabbit completed three reviews. Fixed its notification-reset finding and verified recurrence in the browser. Declined unconditional error clearing for audience-only saves: those intentionally do not acknowledge stale private sections or refresh their visibility marker; clearing the error would hide an unresolved review. The requested-review UI submits the unchanged content to explicitly acknowledge it. A third local review of the follow-up fixes reported no findings. The two inline GitHub findings were fixed: stable recovery cache identity and a toast action that returns to the affected chat after switching chats. The final review also suggested clearing a visibility review after an audience-only API update removes its partial reader. Kept the explicit acknowledgment boundary: the inspector always includes content when saving a flagged manual correction, even if only access was changed or the text is unchanged; an audience-only API update changes access without acknowledging the text review. This is not a remaining failure of Save correction. The existing API behavior remains conservative and can be completed by submitting the unchanged content. The optional docstring coverage warning was not addressed with boilerplate comments; the focused regressions document and verify the changed behavior.

Manual verification still available to the maintainer

  • In an existing Roleplay chat, review a flagged summary and choose Save correction without changing correct text.
  • Regenerate one deleted scene and compare other saved corrections and character access.
  • Trigger a background memory failure and use Review memory on the toast.

Docs and release impact

User-facing recovery guidance is in the existing inspector. Updated [Unreleased] changelog; no version or release change.

UI evidence

Synthetic desktop/mobile screenshots, before and after recovery, in light and dark themes.


🔄 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-Engine/pull/6738 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 9/26/2026 **Status:** ✅ Merged **Merged:** 9/27/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `codex/advanced-memory-recovery-sept27` --- ### 📝 Commits (7) - [`384b470`](https://github.com/Pasta-Devs/Marinara-Engine/commit/384b470c06fdb93d8240b8b664bd2ff9aab0c27c) test(memory): reproduce correction and deleted-scene recovery failures - [`083d4d9`](https://github.com/Pasta-Devs/Marinara-Engine/commit/083d4d9c5f972737df4a1808644e247141214d56) fix(memory): unblock correction reviews and regenerate deleted scenes - [`1a75b0f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/1a75b0f001fe3721b286d372a1a2778a511d0732) fix(memory): notify again when a cleared failure recurs - [`3e533f1`](https://github.com/Pasta-Devs/Marinara-Engine/commit/3e533f1179855ef069c6eb0b78a39629ae759fc1) fix(memory): keep failure notices readable on small screens - [`4a1e522`](https://github.com/Pasta-Devs/Marinara-Engine/commit/4a1e522b8dc078036b06f264bd801bce9c42a49c) fix(memory): reuse recovery work and follow failure actions across chats - [`061d56c`](https://github.com/Pasta-Devs/Marinara-Engine/commit/061d56cd95d70e75fc463ea67a69d54a39d6f8dc) test(memory): verify repeated recovery against the scene recap - [`8a49fe7`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8a49fe7ee7cdeb1cf5a85b2a244cfcdac1e82d87) Merge staging into Advanced Memory recovery ### 📊 Changes **10 files changed** (+371 additions, -115 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+2 -0) 📝 `e2e/advanced-memory.e2e.ts` (+152 -91) 📝 `packages/client/src/components/chat/AdvancedMemoryInspector.tsx` (+19 -7) 📝 `packages/client/src/hooks/use-advanced-memory.ts` (+33 -1) 📝 `packages/client/src/hooks/use-generate.ts` (+2 -1) 📝 `packages/client/src/localization/locales/en.json` (+5 -0) 📝 `packages/server/src/services/advanced-memory.ts` (+43 -12) 📝 `packages/shared/src/types/advanced-memory.ts` (+2 -0) 📝 `scripts/regressions/advanced-memory-core.regression.ts` (+3 -3) 📝 `scripts/regressions/advanced-memory-recovery.regression.ts` (+110 -0) </details> ### 📄 Description ## Linked issue Closes #6737 ## Why this change A legacy scene with partial character visibility could request a correction while the inspector called it valid and disabled **Save correction**. Saving left the previous job error visible. Deleting a scene to recover left a permanent exclusion with no way to regenerate that one scene, and background preparation failures produced no toast. ## What changed - Use the existing visibility-review check in inspector status and allow unchanged text to be saved for the blocked record. Acknowledging the correction clears its error and leaves interrupted preparation resumable. Visibility-specific errors explain character access instead of claiming source messages changed. - Show deleted scene ranges with **Regenerate scene**, reuse targeted preparation, and keep routine maintenance from resurrecting deleted summaries. Keep scene numbering stable across missing/deleted ranges. - Reuse paid preparation work when a single-scene recovery is interrupted; a later deletion starts a fresh recovery. - Display a compact, deduplicated failure toast with **Review memory** from existing status polling and generation events. Clear it when processing resumes, and notify again if the failure returns. No additional recall model calls, polling, dependencies, storage migration, or change to constant-summary source coverage. Recovery generates only the selected scene; deleted wording cannot be recovered without a backup. ## Validation Validated revision: `8a49fe7ee7cdeb1cf5a85b2a244cfcdac1e82d87`, including the latest `staging` changes. Type/build checks, all 10 Advanced Memory suites, and the 18 passing browser cases were rerun on this revision. - New server regressions failed before the fix, then passed. `node scripts/run-regressions.mjs --filter advanced-memory`: all 10 suites passed, including recovery, hidden-history coverage, character access, actual generation and large-archive performance. - `pnpm check` passed; localization, touched-client ESLint and e2e type checks also passed after the final notification copy change. - `pnpm regression:prompt` passed. - Final browser run: 18 passed (10 desktop Chromium, 8 iPhone-sized WebKit); 2 desktop-only smoke cases were intentionally skipped on WebKit. All focused recovery/notification cases passed on both browsers. These cover unchanged saves, deleted-scene regeneration, repeated failures, cross-chat toast navigation, actionable notices, and light/dark screenshots. - Docker built locally at `3e533f117` before the two review follow-ups; isolated container health and client endpoints both returned HTTP 200. No real profile was mounted. - A disposable local copy of the supplied export reproduced the visibility-review failure. Saving unchanged text cleared it without model/network requests; unrelated memories, constant summaries, correction text and audience stayed unchanged. Private files are excluded from this PR and all published evidence. Local CodeRabbit completed three reviews. Fixed its notification-reset finding and verified recurrence in the browser. Declined unconditional error clearing for audience-only saves: those intentionally do not acknowledge stale private sections or refresh their visibility marker; clearing the error would hide an unresolved review. The requested-review UI submits the unchanged content to explicitly acknowledge it. A third local review of the follow-up fixes reported no findings. The two inline GitHub findings were fixed: stable recovery cache identity and a toast action that returns to the affected chat after switching chats. The final review also suggested clearing a visibility review after an audience-only API update removes its partial reader. Kept the explicit acknowledgment boundary: the inspector always includes content when saving a flagged manual correction, even if only access was changed or the text is unchanged; an audience-only API update changes access without acknowledging the text review. This is not a remaining failure of Save correction. The existing API behavior remains conservative and can be completed by submitting the unchanged content. The optional docstring coverage warning was not addressed with boilerplate comments; the focused regressions document and verify the changed behavior. ### Manual verification still available to the maintainer - [ ] In an existing Roleplay chat, review a flagged summary and choose **Save correction** without changing correct text. - [ ] Regenerate one deleted scene and compare other saved corrections and character access. - [ ] Trigger a background memory failure and use **Review memory** on the toast. ## Docs and release impact User-facing recovery guidance is in the existing inspector. Updated `[Unreleased]` changelog; no version or release change. ## UI evidence [Synthetic desktop/mobile screenshots, before and after recovery, in light and dark themes](https://gist.github.com/SpicyMarinara/935230ab63bcce25f3b567f98aee3162). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:18:27 +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-Engine#7304
No description provided.