[PR #2241] [MERGED] Fix Secret Plot turn-only reroll memory #5504

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/2241
Author: @cha1latte
Created: 6/4/2026
Status: ✅ Merged
Merged: 6/4/2026
Merged by: @cha1latte

Base: refactor ← Head: fix/issue-2165-secret-plot-turn-reroll


📝 Commits (1)

  • 09ee319 Fix Secret Plot turn-only reroll memory

📊 Changes

2 files changed (+19 additions, -4 deletions)

View changed files

📝 src/engine/generation/agent-memory-runtime.ts (+8 -1)
📝 src/engine/generation/start-generation.ts (+11 -3)

📄 Description

Linked issue

Closes #2165

Why this change

  • Secret Plot's "re-roll this turn only" action promised to preserve the long-running arc, but the refactor engine ignored secretPlotRerollMode and always persisted a new overarchingArc.

What changed

  • Thread secretPlotRerollMode from targeted agent retry into Secret Plot agent-memory persistence.
  • Skip only the overarchingArc write when the reroll mode is turn_only, while keeping scene directions, fulfilled-direction history, pacing, and stale detection updates.
  • Preserve existing behavior for full rerolls and normal Secret Plot persistence.

Refactor impact

Primary owner:

  • engine generation

Impact areas reviewed:

  • Secret Plot targeted retry options
  • Secret Plot agent-memory persistence
  • Full reroll/default persistence behavior

Boundary notes:

  • The fix stays in src/engine; no React UI, shared API wrapper, Rust, storage schema, dependency, or remote-runtime changes.

Pressure points touched:

  • Secret Plot agent-memory persistence in src/engine/generation/agent-memory-runtime.ts
  • Targeted retry persistence wiring in src/engine/generation/start-generation.ts

Validation

  • Matching validation command passes locally (for example pnpm typecheck, pnpm build, pnpm check:architecture, pnpm check:docs, or full pnpm check when warranted)
  • Full pnpm check passes before PR push/handoff
  • Human/manual validation completed by contributor or reviewer

Manual verification notes

  • Before fix, focused scratch Vitest proof failed because turn_only overwrote the existing overarchingArc.
  • After fix, pnpm exec vitest run --config scratch\vitest.issue-2165.config.ts passed 3 cases: turn_only preserves the arc while refreshing per-turn memory, full replaces the arc, and ordinary persistence replaces the arc.
  • pnpm typecheck passed.
  • pnpm check passed.
  • node C:\Users\celia\.codex\tools\marinara-proof-gate.mjs scratch\issue-2165-bugfix-verification.json passed.
  • Bunny review pass completed on the current diff before opening this PR.
  • No human-only verification is currently blocking the core claim.

Feature Discoverability

Check exactly one:

  • Updated src/features/shell/discovery/ because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool.
  • N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find.

Reason:

  • Bugfix for existing Secret Plot behavior; no new user-discoverable capability.

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. This is React-free engine persistence behavior; the core proof is the before/after scratch harness plus full repo validation.

🔄 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/2241 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 6/4/2026 **Status:** ✅ Merged **Merged:** 6/4/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `refactor` ← **Head:** `fix/issue-2165-secret-plot-turn-reroll` --- ### 📝 Commits (1) - [`09ee319`](https://github.com/Pasta-Devs/Marinara-Engine/commit/09ee319b86ac2b5435fdaa6a6ced3d6ce91500b7) Fix Secret Plot turn-only reroll memory ### 📊 Changes **2 files changed** (+19 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `src/engine/generation/agent-memory-runtime.ts` (+8 -1) 📝 `src/engine/generation/start-generation.ts` (+11 -3) </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 #2165 ## Why this change - Secret Plot's "re-roll this turn only" action promised to preserve the long-running arc, but the refactor engine ignored `secretPlotRerollMode` and always persisted a new `overarchingArc`. ## What changed - Thread `secretPlotRerollMode` from targeted agent retry into Secret Plot agent-memory persistence. - Skip only the `overarchingArc` write when the reroll mode is `turn_only`, while keeping scene directions, fulfilled-direction history, pacing, and stale detection updates. - Preserve existing behavior for full rerolls and normal Secret Plot persistence. ## Refactor impact Primary owner: - engine generation Impact areas reviewed: - Secret Plot targeted retry options - Secret Plot agent-memory persistence - Full reroll/default persistence behavior Boundary notes: - The fix stays in `src/engine`; no React UI, shared API wrapper, Rust, storage schema, dependency, or remote-runtime changes. Pressure points touched: - Secret Plot agent-memory persistence in `src/engine/generation/agent-memory-runtime.ts` - Targeted retry persistence wiring in `src/engine/generation/start-generation.ts` ## Validation <!-- Check only what you personally ran or manually verified. Treat unchecked items as explicit TODOs. --> <!-- Do not submit *.test.ts or *.test.tsx files as PR proof; cite existing checks, command output, app/browser/Tauri verification, or manual notes instead. --> - [ ] Matching validation command passes locally (for example `pnpm typecheck`, `pnpm build`, `pnpm check:architecture`, `pnpm check:docs`, or full `pnpm check` when warranted) - [ ] Full `pnpm check` passes before PR push/handoff - [ ] Human/manual validation completed by contributor or reviewer ### Manual verification notes - Before fix, focused scratch Vitest proof failed because `turn_only` overwrote the existing `overarchingArc`. - After fix, `pnpm exec vitest run --config scratch\vitest.issue-2165.config.ts` passed 3 cases: `turn_only` preserves the arc while refreshing per-turn memory, `full` replaces the arc, and ordinary persistence replaces the arc. - `pnpm typecheck` passed. - `pnpm check` passed. - `node C:\Users\celia\.codex\tools\marinara-proof-gate.mjs scratch\issue-2165-bugfix-verification.json` passed. - Bunny review pass completed on the current diff before opening this PR. - No human-only verification is currently blocking the core claim. ## Feature Discoverability Check exactly one: - [ ] Updated `src/features/shell/discovery/` because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool. - [ ] N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find. Reason: - Bugfix for existing Secret Plot behavior; no new user-discoverable capability. ## 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. This is React-free engine persistence behavior; the core proof is the before/after scratch harness plus full repo validation. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:16:53 +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#5504
No description provided.