[PR #1966] [MERGED] Fix Narrative Director reroll cadence #5361

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

📋 Pull Request Information

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

Base: refactor ← Head: fix/issue-1948-narrative-reroll


📝 Commits (1)

  • 76897f9 Fix Narrative Director reroll cadence

📊 Changes

2 files changed (+132 additions, -0 deletions)

View changed files

➕ src/engine/generation/agent-runner.test.ts (+130 -0)
📝 src/engine/generation/agent-runner.ts (+2 -0)

📄 Description

Linked issue

Closes #1948

Why this change

  • Narrative Director guidance could be suppressed during a reroll because the automatic interval gate counted a successful director run attached to the message being regenerated. That left the previous swipe's guidance as the current direction, making regenerated messages repeat the same beat.

What changed

  • Let interval-based agents run again when their latest successful run is attached to regenerateMessageId.
  • Added a focused engine regression test for the reroll target case and the older-run should-not-match cadence case.

Refactor impact

Primary owner:

  • Engine generation

Impact areas reviewed:

  • createGenerationAgentRuntime automatic interval gating
  • Narrative Director pre-generation injection cadence
  • Regeneration/reroll path using regenerateMessageId

Boundary notes:

  • Engine-only change. No React feature code, shared API wrapper, Rust storage, schema, dependency, or release metadata changes.

Pressure points touched:

  • None of the listed UI/Rust pressure points were touched.

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

  • Codex proof: temporarily removed the cadence-line fix and ran pnpm test -- src/engine/generation/agent-runner.test.ts; the reroll-target row failed with expected 1, received 0.
  • Codex proof after fix: pnpm test -- src/engine/generation/agent-runner.test.ts passed, 1 file / 2 tests.
  • Codex baseline: pnpm typecheck passed.
  • Codex baseline: pnpm check passed, including line endings, architecture, frontend typecheck, Rust check, docs, discovery, and unused-code check.
  • Codex proof gate: node C:\Users\celia\.codex\tools\marinara-proof-gate.mjs scratch\bugfix-verification.json passed.
  • Bunny pass completed locally for the current diff before opening this draft.

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:

  • This is a bugfix to existing Narrative Director reroll behavior. No new discoverable feature or setting was added.

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 backend/engine cadence logic with no visible UI surface changed; proof is the targeted engine regression and full repo check.

🔄 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/1966 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 6/2/2026 **Status:** ✅ Merged **Merged:** 6/2/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `refactor` ← **Head:** `fix/issue-1948-narrative-reroll` --- ### 📝 Commits (1) - [`76897f9`](https://github.com/Pasta-Devs/Marinara-Engine/commit/76897f9ccea334e2a420202788bb0a5290a98846) Fix Narrative Director reroll cadence ### 📊 Changes **2 files changed** (+132 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `src/engine/generation/agent-runner.test.ts` (+130 -0) 📝 `src/engine/generation/agent-runner.ts` (+2 -0) </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 <!-- Every user-facing PR should reference a feature request or issue report when practical. --> Closes #1948 ## Why this change <!-- What user problem, bug, refactor goal, or maintenance need does this solve? --> - Narrative Director guidance could be suppressed during a reroll because the automatic interval gate counted a successful director run attached to the message being regenerated. That left the previous swipe's guidance as the current direction, making regenerated messages repeat the same beat. ## What changed <!-- List the key changes in this PR. --> - Let interval-based agents run again when their latest successful run is attached to `regenerateMessageId`. - Added a focused engine regression test for the reroll target case and the older-run should-not-match cadence case. ## Refactor impact Primary owner: <!-- Examples: app shell, catalog, chat mode, roleplay mode, game mode, runtime generation, world-state, shared API, engine generation, Rust storage, imports, remote runtime. --> - Engine generation Impact areas reviewed: - `createGenerationAgentRuntime` automatic interval gating - Narrative Director pre-generation injection cadence - Regeneration/reroll path using `regenerateMessageId` Boundary notes: <!-- Note engine/shared-api/feature/Rust/remote-runtime boundaries. Say "none" only if you checked. --> - Engine-only change. No React feature code, shared API wrapper, Rust storage, schema, dependency, or release metadata changes. Pressure points touched: <!-- Mention ModeSurface, GameSurface, shared mode UI, src-tauri/src/lib.rs command registration, or import modules if touched. --> - None of the listed UI/Rust pressure points were touched. ## 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 <!-- Describe exact commands and manual steps, including typecheck/build/docs/architecture/Rust/browser/remote-runtime checks when they apply. If an AI agent filled this out, verify it yourself before ticking boxes. --> - Codex proof: temporarily removed the cadence-line fix and ran `pnpm test -- src/engine/generation/agent-runner.test.ts`; the reroll-target row failed with `expected 1, received 0`. - Codex proof after fix: `pnpm test -- src/engine/generation/agent-runner.test.ts` passed, 1 file / 2 tests. - Codex baseline: `pnpm typecheck` passed. - Codex baseline: `pnpm check` passed, including line endings, architecture, frontend typecheck, Rust check, docs, discovery, and unused-code check. - Codex proof gate: `node C:\Users\celia\.codex\tools\marinara-proof-gate.mjs scratch\bugfix-verification.json` passed. - Bunny pass completed locally for the current diff before opening this draft. ## 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: - This is a bugfix to existing Narrative Director reroll behavior. No new discoverable feature or setting was added. ## 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 <!-- Add before/after screenshots or recordings for visible UI changes. --> - N/A. This is backend/engine cadence logic with no visible UI surface changed; proof is the targeted engine regression and full repo check. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:15:36 +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#5361
No description provided.