[PR #6538] [MERGED] fix(memory): preserve corrected access and complete missing scene ranges #7216

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

📋 Pull Request Information

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

Base: staging ← Head: codex/sept22-memory-gap-access


📝 Commits (4)

  • daca6b9 chore: start focused Advanced Memory recovery fix
  • a73efc1 fix(memory): recover incomplete scenes and preserve corrected access
  • 5a31c65 test(memory): keep legacy access screenshot in the viewport
  • 9001de5 fix(memory): retain shared access when importing legacy backups

📊 Changes

5 files changed (+427 additions, -27 deletions)

View changed files

📝 CHANGELOG.md (+2 -0)
📝 e2e/advanced-memory.e2e.ts (+5 -2)
📝 packages/client/src/components/chat/AdvancedMemoryInspector.tsx (+1 -0)
📝 packages/server/src/services/advanced-memory.ts (+86 -25)
➕ scripts/regressions/advanced-memory-recovery.regression.ts (+333 -0)

📄 Description

Linked issue

Closes #6537

Why this change

“Prepare scene” could report ready while a saved recap covered only the end of its scene. The participant-access update also projected older manual assignments as narrator-only, and deleted duplicate copies could revoke access from the surviving recap. Reindexing consequently appeared to erase the user's corrections.

What changed

  • Complete missing source coverage before reusing a recap. Repair only the requested scene, keep its old text until a replacement succeeds, and never claim a successful repair while that range remains missing.
  • Keep the latest manual correction authoritative, including saves made before the participant marker existed. Reindexing remains embedding-only; deleted copies cannot revoke current access.
  • Ask the helper for participants by character name, with the group roster's names and IDs supplied for matching. Accept names and existing IDs; unknown/ambiguous names grant no access. Unassigned scenes remain narrator-only.
  • Export original stored access data, retain confirmed shared access across imports, and preserve existing local corrections. Invalidate old reusable prompt contexts without rebuilding saved summaries.

Validation

Automated results (checkboxes below remain human verification tasks):

  • pnpm check passed, including localization, formatting, types/lint and production build.

  • All 10 Advanced Memory regression files passed. New cases reproduce partial coverage, legacy manual access, deleted-copy interference, failed repair/resume, named participants, embedding-only reindexing, raw export preservation and shared-access import round trips.

  • pnpm regression:prompt passed.

  • All 27 Advanced Memory browser checks passed across desktop Chromium, mobile Chromium and iPhone-sized WebKit. The pre-fix WebKit run reproduced the incorrect narrator-only review notice on a manually corrected scene.

  • Local CodeRabbit review completed. Its backup round-trip finding was fixed and regression-tested. Its suggestion to block reuse of already-complete manual records on character visibility changes was dismissed: retrieval and constant materialization already enforce source eligibility, while blocking preparation here would reintroduce unnecessary correction errors. The access check remains required when extending a corrected record's source range. A further local review attempt was rate-limited. GitHub CodeRabbit completed its review of 9001de512 with no actionable findings; all eight required checks passed. Its advisory docstring-coverage warning did not require adding unrelated boilerplate.

  • pnpm check passes locally

  • Container (Docker / Podman) built and ran without issue

  • Ran the app, clicked through the changes manually

  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)

  • Above manual verification completed (describe below)

  • Read and followed CONTRIBUTING.md

Manual verification notes

Manually verify the existing archive after updating: open Access memories, check the saved character assignments, then use Prepare scene for the missing range. Do not reset the archive. Reindex should keep the same text and access without summary calls.

Local container build/run was not repeated because host storage has under 3 GiB free; the required CI container build/smoke gate passed. Browser automation uses synthetic data; the maintainer's private chat was inspected read-only and is not included in this PR.

Docs and release impact

Added an Unreleased changelog entry. No install, release metadata, or user-documentation changes.

UI evidence

Before/after iPhone WebKit proof in light and dark themes. Synthetic fixtures only.


🔄 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/6538 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 9/22/2026 **Status:** ✅ Merged **Merged:** 9/22/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `codex/sept22-memory-gap-access` --- ### 📝 Commits (4) - [`daca6b9`](https://github.com/Pasta-Devs/Marinara-Engine/commit/daca6b97e36e9acd2346a5ba56bfa2d5fbc13670) chore: start focused Advanced Memory recovery fix - [`a73efc1`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a73efc13e63ceebab6ae8094c9cc2b57835f2257) fix(memory): recover incomplete scenes and preserve corrected access - [`5a31c65`](https://github.com/Pasta-Devs/Marinara-Engine/commit/5a31c6570e261ba8b853c6674bf541b015b20b7b) test(memory): keep legacy access screenshot in the viewport - [`9001de5`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9001de512191932c85af574844b8664866cea15b) fix(memory): retain shared access when importing legacy backups ### 📊 Changes **5 files changed** (+427 additions, -27 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+2 -0) 📝 `e2e/advanced-memory.e2e.ts` (+5 -2) 📝 `packages/client/src/components/chat/AdvancedMemoryInspector.tsx` (+1 -0) 📝 `packages/server/src/services/advanced-memory.ts` (+86 -25) ➕ `scripts/regressions/advanced-memory-recovery.regression.ts` (+333 -0) </details> ### 📄 Description ## Linked issue Closes #6537 ## Why this change “Prepare scene” could report ready while a saved recap covered only the end of its scene. The participant-access update also projected older manual assignments as narrator-only, and deleted duplicate copies could revoke access from the surviving recap. Reindexing consequently appeared to erase the user's corrections. ## What changed - Complete missing source coverage before reusing a recap. Repair only the requested scene, keep its old text until a replacement succeeds, and never claim a successful repair while that range remains missing. - Keep the latest manual correction authoritative, including saves made before the participant marker existed. Reindexing remains embedding-only; deleted copies cannot revoke current access. - Ask the helper for participants by character name, with the group roster's names and IDs supplied for matching. Accept names and existing IDs; unknown/ambiguous names grant no access. Unassigned scenes remain narrator-only. - Export original stored access data, retain confirmed shared access across imports, and preserve existing local corrections. Invalidate old reusable prompt contexts without rebuilding saved summaries. ## Validation Automated results (checkboxes below remain human verification tasks): - `pnpm check` passed, including localization, formatting, types/lint and production build. - All 10 Advanced Memory regression files passed. New cases reproduce partial coverage, legacy manual access, deleted-copy interference, failed repair/resume, named participants, embedding-only reindexing, raw export preservation and shared-access import round trips. - `pnpm regression:prompt` passed. - All 27 Advanced Memory browser checks passed across desktop Chromium, mobile Chromium and iPhone-sized WebKit. The pre-fix WebKit run reproduced the incorrect narrator-only review notice on a manually corrected scene. - Local CodeRabbit review completed. Its backup round-trip finding was fixed and regression-tested. Its suggestion to block reuse of already-complete manual records on character visibility changes was dismissed: retrieval and constant materialization already enforce source eligibility, while blocking preparation here would reintroduce unnecessary correction errors. The access check remains required when extending a corrected record's source range. A further local review attempt was rate-limited. GitHub CodeRabbit completed its review of `9001de512` with no actionable findings; all eight required checks passed. Its advisory docstring-coverage warning did not require adding unrelated boilerplate. - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes Manually verify the existing archive after updating: open Access memories, check the saved character assignments, then use Prepare scene for the missing range. Do not reset the archive. Reindex should keep the same text and access without summary calls. Local container build/run was not repeated because host storage has under 3 GiB free; the required CI container build/smoke gate passed. Browser automation uses synthetic data; the maintainer's private chat was inspected read-only and is not included in this PR. ## Docs and release impact Added an Unreleased changelog entry. No install, release metadata, or user-documentation changes. ## UI evidence [Before/after iPhone WebKit proof in light and dark themes](https://gist.github.com/SpicyMarinara/2e7542ec0f0da80be7e68f5d3a291caa). Synthetic fixtures only. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:17:37 +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#7216
No description provided.