[PR #1316] [MERGED] Fix conversation scene awareness gating #5034

Closed
opened 2026-10-22 04:12:39 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1316
Author: @cha1latte
Created: 5/26/2026
Status: ✅ Merged
Merged: 5/26/2026
Merged by: @cha1latte

Base: refactor ← Head: fix/refactor-issue-1274-awareness-gate


📝 Commits (2)

  • 0662ce2 Fix conversation scene awareness gating
  • ef908d0 Merge remote-tracking branch 'upstream/refactor' into fix/refactor-issue-1274-awareness-gate

📊 Changes

2 files changed (+158 additions, -1 deletions)

View changed files

📝 src/engine/generation/prompt-assembly.test.ts (+149 -0)
📝 src/engine/generation/prompt-assembly.ts (+9 -1)

📄 Description

Linked issue

Closes #1274

Why this change

  • Conversation mode could still include prior roleplay scene continuity through lastRoleplaySceneSummary even when Cross-Chat Awareness was explicitly off, Memory Recall was disabled, and the chat memory bank was empty.

What changed

  • Gated lastRoleplaySceneSummary out of conversation prompt summaries when metadata.crossChatAwareness === false.
  • Kept normal same-chat summaries, default-on cross-chat awareness behavior, roleplay scene continuity, and hidden character characterMemories behavior covered with prompt assembly regression tests.

Refactor impact

Primary owner:

  • Engine generation / prompt assembly

Impact areas reviewed:

  • Conversation prompt summaries
  • Roleplay prompt scene continuity
  • Memory recall insertion
  • Character-card hidden scene memories

Boundary notes:

  • The change stays inside React-free engine prompt assembly. It does not touch UI, storage schema, Rust storage, shared API wrappers, dependencies, or release metadata.

Pressure points touched:

  • src/engine/generation/prompt-assembly.ts

Validation

  • pnpm check passes locally
  • pnpm typecheck passes locally
  • pnpm build passes locally
  • pnpm check:architecture passes locally
  • pnpm check:docs passes locally
  • cargo check --manifest-path src-tauri/Cargo.toml --workspace passes locally
  • Rust clippy/tests were run for Rust behavior changes
  • Browser or Tauri app manual verification completed
  • Playwright, screenshot, or recording evidence added for UI changes
  • Remote runtime smoke checked when relevant

Manual verification notes

  • Codex reproduced the bug before the fix with pnpm exec vitest run src/engine/generation/prompt-assembly.test.ts; the new regression failed because the conversation prompt contained stale lastRoleplaySceneSummary while crossChatAwareness=false and enableMemoryRecall=false.
  • Codex verified the original repro and edge rows after the fix with pnpm exec vitest run src/engine/generation/prompt-assembly.test.ts:
    • conversation mode with Cross-Chat Awareness off and Memory Recall off omits prior scene summaries and <memories>;
    • same-chat conversation summaries remain when Cross-Chat Awareness is off;
    • default-on conversation Cross-Chat Awareness still includes prior scene summaries;
    • roleplay prompts still preserve prior scene summaries;
    • hidden characterMemories on a conversation card do not leak into the prompt.
  • Codex ran pnpm check; it passed architecture, frontend typecheck, Rust cargo check, and docs checks.
  • Codex ran the Marinara proof gate against scratch/bugfix-verification.json; it passed.

Docs and release impact

  • No docs changes needed
  • Updated README.md
  • Updated CONTRIBUTING.md
  • Updated docs/developer/
  • Updated repo skills or AGENTS.md
  • Confirmed this PR does not restore old staging/package-workspace/release claims

UI evidence

N/A - non-UI prompt assembly fix. Verification is covered by the targeted prompt assembly regression test and pnpm check.

Summary by CodeRabbit

  • Tests

    • Added comprehensive test coverage for conversation mode scene awareness and memory recall behavior, including validation of stale scene summaries and character memory injection based on settings.
  • Refactor

    • Improved conditional logic for including past scene context in conversation mode based on awareness and memory recall settings.

Review Change Stack


🔄 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/1316 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 5/26/2026 **Status:** ✅ Merged **Merged:** 5/26/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `refactor` ← **Head:** `fix/refactor-issue-1274-awareness-gate` --- ### 📝 Commits (2) - [`0662ce2`](https://github.com/Pasta-Devs/Marinara-Engine/commit/0662ce29be221af8500d8b1218a87603702d34eb) Fix conversation scene awareness gating - [`ef908d0`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ef908d090d662505c0222ce2e068331fb2658ac7) Merge remote-tracking branch 'upstream/refactor' into fix/refactor-issue-1274-awareness-gate ### 📊 Changes **2 files changed** (+158 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/engine/generation/prompt-assembly.test.ts` (+149 -0) 📝 `src/engine/generation/prompt-assembly.ts` (+9 -1) </details> ### 📄 Description <!-- Target branch: `refactor`. Change the base to `refactor` before submitting unless a maintainer explicitly asked for another base. --> <!-- Keep all checkboxes unchecked until a human has actually verified them. --> ## Linked issue Closes #1274 ## Why this change - Conversation mode could still include prior roleplay scene continuity through `lastRoleplaySceneSummary` even when Cross-Chat Awareness was explicitly off, Memory Recall was disabled, and the chat memory bank was empty. ## What changed - Gated `lastRoleplaySceneSummary` out of conversation prompt summaries when `metadata.crossChatAwareness === false`. - Kept normal same-chat summaries, default-on cross-chat awareness behavior, roleplay scene continuity, and hidden character `characterMemories` behavior covered with prompt assembly regression tests. ## Refactor impact Primary owner: - Engine generation / prompt assembly Impact areas reviewed: - Conversation prompt summaries - Roleplay prompt scene continuity - Memory recall insertion - Character-card hidden scene memories Boundary notes: - The change stays inside React-free engine prompt assembly. It does not touch UI, storage schema, Rust storage, shared API wrappers, dependencies, or release metadata. Pressure points touched: - `src/engine/generation/prompt-assembly.ts` ## Validation - [ ] `pnpm check` passes locally - [ ] `pnpm typecheck` passes locally - [ ] `pnpm build` passes locally - [ ] `pnpm check:architecture` passes locally - [ ] `pnpm check:docs` passes locally - [ ] `cargo check --manifest-path src-tauri/Cargo.toml --workspace` passes locally - [ ] Rust clippy/tests were run for Rust behavior changes - [ ] Browser or Tauri app manual verification completed - [ ] Playwright, screenshot, or recording evidence added for UI changes - [ ] Remote runtime smoke checked when relevant ### Manual verification notes - Codex reproduced the bug before the fix with `pnpm exec vitest run src/engine/generation/prompt-assembly.test.ts`; the new regression failed because the conversation prompt contained stale `lastRoleplaySceneSummary` while `crossChatAwareness=false` and `enableMemoryRecall=false`. - Codex verified the original repro and edge rows after the fix with `pnpm exec vitest run src/engine/generation/prompt-assembly.test.ts`: - conversation mode with Cross-Chat Awareness off and Memory Recall off omits prior scene summaries and `<memories>`; - same-chat conversation summaries remain when Cross-Chat Awareness is off; - default-on conversation Cross-Chat Awareness still includes prior scene summaries; - roleplay prompts still preserve prior scene summaries; - hidden `characterMemories` on a conversation card do not leak into the prompt. - Codex ran `pnpm check`; it passed architecture, frontend typecheck, Rust `cargo check`, and docs checks. - Codex ran the Marinara proof gate against `scratch/bugfix-verification.json`; it passed. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [ ] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [ ] Confirmed this PR does not restore old staging/package-workspace/release claims ## UI evidence N/A - non-UI prompt assembly fix. Verification is covered by the targeted prompt assembly regression test and `pnpm check`. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Tests** * Added comprehensive test coverage for conversation mode scene awareness and memory recall behavior, including validation of stale scene summaries and character memory injection based on settings. * **Refactor** * Improved conditional logic for including past scene context in conversation mode based on awareness and memory recall settings. <!-- review_stack_entry_start --> [![Review Change Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/Pasta-Devs/Marinara-Engine/pull/1316?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack) <!-- review_stack_entry_end --> <!-- 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-22 04:12:39 +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#5034
No description provided.