[GH-ISSUE #2492] [Issue]: 13-AGENT-RUNTIME-secret-plot-memory parity gaps in prompt injection and reroll memory #1235

Closed
opened 2026-10-21 05:29:32 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @Promansis on GitHub (Jun 6, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2492

Originally assigned to: @Promansis on GitHub.

Summary

13-AGENT-RUNTIME-secret-plot-memory has parity gaps from Batch 8: refactor does not inject Secret Plot arc/directions into the main reply prompt like legacy, full Secret Plot reroll cannot clear an existing arc, and memory state is built from merged agent memory instead of the resolved Secret Plot config.

Expected behavior

Legacy Secret Plot behavior should be preserved:

  • load Secret Plot state from the resolved secret-plot-driver config for the active chat.
  • inject hidden overarching_arc and scene_directions into the main reply prompt.
  • persist successful secret_plot output, including clearing overarchingArc on full reroll when the result explicitly returns null.
  • preserve overarchingArc on turn_only reroll.
  • keep Secret Plot panel edits read/write capable.

Actual behavior

Refactor loads all agent memory rows into one merged bag before deriving _secretPlotState, only exposes that state inside the agent prompt as <secret_plot_state>, and writes overarchingArc only when the value is truthy.

Steps to reproduce

  1. On refactor, use a roleplay chat with Secret Plot Driver memory containing an arc and active scene direction.
  2. Generate or inspect prompt assembly/runtime flow.
  3. Compare with legacy main generation route behavior for Secret Plot prompt injection and reroll persistence.

Impact area

  • App shell, navigation, startup, or providers
  • Catalog resources
  • Chat mode
  • Roleplay mode
  • Game mode
  • Shared mode UI
  • Runtime systems: generation, world-state, visuals, tracker, or haptics
  • Professor Mari or shell tools
  • React-free engine behavior, contracts, agents, or capability ports
  • Shared API wrapper or remote runtime routing
  • Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime
  • Docs, contributor workflow, or templates

Environment

  • Branch or commit: refactor
  • Run mode: Tauri desktop / web shell generation runtime
  • OS + version: not relevant
  • Node + pnpm versions: not relevant
  • Rust version, if relevant: not relevant
  • Remote Runtime URL configured? not relevant
  • Provider, model, or integration, if relevant: generation provider using Secret Plot Driver

Logs, screenshots, or video

Static parity proof from Batch 8:

  • Legacy loads memory only for resolved Secret Plot config and sets _secretPlotState: main:packages/server/src/routes/generate.routes.ts:5503.
  • Legacy persists fresh state after successful secret_plot: main:packages/server/src/routes/generate.routes.ts:6520.
  • Legacy injects hidden overarching_arc and scene_directions into the main reply prompt: main:packages/server/src/routes/generate.routes.ts:6724.
  • Legacy full retry can clear arc while turn_only preserves it: main:packages/server/src/routes/generate/retry-agents-route.ts:1574.
  • Refactor merges memory from all configured agents before deriving _secretPlotState: src/engine/generation/agent-runner.ts:1555.
  • Refactor only emits <secret_plot_state> in agent prompt memory: src/engine/agents-runtime/executor/agent-executor.ts:1751.
  • Refactor only writes overarchingArc when truthy: src/engine/generation/agent-memory-runtime.ts:51.
  • Refactor panel edit path exists: src/features/modes/roleplay/components/SecretPlotPanel.tsx:103, src/features/modes/roleplay/components/SecretPlotPanel.tsx:187, src/shared/api/agent-api.ts:26, src-tauri/src/commands/storage/agents.rs:295.

Regression notes

Legacy source of truth is the main branch. This issue comes from upstream parity tracker #2482, surface 13-AGENT-RUNTIME-secret-plot-memory.

Additional context

Acceptance criteria:

  • Secret Plot memory used for prompt state is scoped to the resolved Secret Plot Driver config for the chat.
  • Main reply prompt receives hidden arc/direction guidance equivalent to legacy overarching_arc and scene_directions.
  • Full Secret Plot reroll can clear overarchingArc when the agent returns an explicit null/empty arc value.
  • turn_only reroll preserves the existing long-running arc while refreshing turn guidance.
  • Secret Plot panel edit/read/write behavior remains intact.
  • Add focused proof for generation and retry paths.

Template check

Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @Promansis on GitHub (Jun 6, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2492 Originally assigned to: @Promansis on GitHub. ## Summary `13-AGENT-RUNTIME-secret-plot-memory` has parity gaps from Batch 8: refactor does not inject Secret Plot arc/directions into the main reply prompt like legacy, full Secret Plot reroll cannot clear an existing arc, and memory state is built from merged agent memory instead of the resolved Secret Plot config. ## Expected behavior Legacy Secret Plot behavior should be preserved: - load Secret Plot state from the resolved `secret-plot-driver` config for the active chat. - inject hidden `overarching_arc` and `scene_directions` into the main reply prompt. - persist successful `secret_plot` output, including clearing `overarchingArc` on full reroll when the result explicitly returns `null`. - preserve `overarchingArc` on `turn_only` reroll. - keep Secret Plot panel edits read/write capable. ## Actual behavior Refactor loads all agent memory rows into one merged bag before deriving `_secretPlotState`, only exposes that state inside the agent prompt as `<secret_plot_state>`, and writes `overarchingArc` only when the value is truthy. ## Steps to reproduce 1. On refactor, use a roleplay chat with Secret Plot Driver memory containing an arc and active scene direction. 2. Generate or inspect prompt assembly/runtime flow. 3. Compare with legacy `main` generation route behavior for Secret Plot prompt injection and reroll persistence. ## Impact area - [ ] App shell, navigation, startup, or providers - [ ] Catalog resources - [ ] Chat mode - [x] Roleplay mode - [ ] Game mode - [ ] Shared mode UI - [x] Runtime systems: generation, world-state, visuals, tracker, or haptics - [ ] Professor Mari or shell tools - [x] React-free engine behavior, contracts, agents, or capability ports - [ ] Shared API wrapper or remote runtime routing - [x] Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime - [ ] Docs, contributor workflow, or templates ## Environment - Branch or commit: `refactor` - Run mode: Tauri desktop / web shell generation runtime - OS + version: not relevant - Node + pnpm versions: not relevant - Rust version, if relevant: not relevant - Remote Runtime URL configured? not relevant - Provider, model, or integration, if relevant: generation provider using Secret Plot Driver ## Logs, screenshots, or video Static parity proof from Batch 8: - Legacy loads memory only for resolved Secret Plot config and sets `_secretPlotState`: `main:packages/server/src/routes/generate.routes.ts:5503`. - Legacy persists fresh state after successful `secret_plot`: `main:packages/server/src/routes/generate.routes.ts:6520`. - Legacy injects hidden `overarching_arc` and `scene_directions` into the main reply prompt: `main:packages/server/src/routes/generate.routes.ts:6724`. - Legacy full retry can clear arc while `turn_only` preserves it: `main:packages/server/src/routes/generate/retry-agents-route.ts:1574`. - Refactor merges memory from all configured agents before deriving `_secretPlotState`: `src/engine/generation/agent-runner.ts:1555`. - Refactor only emits `<secret_plot_state>` in agent prompt memory: `src/engine/agents-runtime/executor/agent-executor.ts:1751`. - Refactor only writes `overarchingArc` when truthy: `src/engine/generation/agent-memory-runtime.ts:51`. - Refactor panel edit path exists: `src/features/modes/roleplay/components/SecretPlotPanel.tsx:103`, `src/features/modes/roleplay/components/SecretPlotPanel.tsx:187`, `src/shared/api/agent-api.ts:26`, `src-tauri/src/commands/storage/agents.rs:295`. ## Regression notes Legacy source of truth is the `main` branch. This issue comes from upstream parity tracker #2482, surface `13-AGENT-RUNTIME-secret-plot-memory`. ## Additional context Acceptance criteria: - Secret Plot memory used for prompt state is scoped to the resolved Secret Plot Driver config for the chat. - Main reply prompt receives hidden arc/direction guidance equivalent to legacy `overarching_arc` and `scene_directions`. - Full Secret Plot reroll can clear `overarchingArc` when the agent returns an explicit null/empty arc value. - `turn_only` reroll preserves the existing long-running arc while refreshing turn guidance. - Secret Plot panel edit/read/write behavior remains intact. - Add focused proof for generation and retry paths. ## Template check Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-21 05:29:32 +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#1235
No description provided.