[GH-ISSUE #2013] Generate request schema omits amend guide source #986

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

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

Originally assigned to: @Xelvanis on GitHub.

Problem

The refactor branch has three current owners that treat amend as a valid generation guide source:

  • src/engine/shared/text/generation-guide.ts includes amend in GenerationGuideSource.
  • src/shared/lib/slash-commands.ts sends generationGuideSource: "amend" from /amend.
  • src/engine/generation/generation-replay.ts records and replays amend.

src/engine/contracts/schemas/chat.schema.ts validates generationGuideSource as narrator | guide | game_start | game_turn | game_retry, so generateRequestSchema.safeParse({ chatId, generationGuideSource: "amend" }) fails.

startGeneration currently bypasses this schema, so the live slash command may still work today. The risk is contract drift: any shared API, remote boundary, replay validation, or future caller that uses generateRequestSchema would reject the current /amend request shape.

Expected behavior

The generate request schema should accept the same guide-source values used by current runtime and replay code, including amend. Ideally the duplicated enum should derive from the shared generation-guide source of truth or have focused proof that catches future drift.

Acceptance criteria

  • generateRequestSchema accepts generationGuideSource: "amend".
  • Existing legacy-compatible values still pass: narrator, guide, and game_start.
  • Current game values still pass: game_turn and game_retry.
  • Focused proof covers the schema/source alignment.

Context

Found during the Target 1 contracts-and-schemas batch-2 parityscan in #2011. A focused local probe showed generation parameter additions and game_turn/game_retry pass, while amend is rejected by the request schema.

Originally created by @Xelvanis on GitHub (Jun 3, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2013 Originally assigned to: @Xelvanis on GitHub. ## Problem The refactor branch has three current owners that treat `amend` as a valid generation guide source: - `src/engine/shared/text/generation-guide.ts` includes `amend` in `GenerationGuideSource`. - `src/shared/lib/slash-commands.ts` sends `generationGuideSource: "amend"` from `/amend`. - `src/engine/generation/generation-replay.ts` records and replays `amend`. `src/engine/contracts/schemas/chat.schema.ts` validates `generationGuideSource` as `narrator | guide | game_start | game_turn | game_retry`, so `generateRequestSchema.safeParse({ chatId, generationGuideSource: "amend" })` fails. `startGeneration` currently bypasses this schema, so the live slash command may still work today. The risk is contract drift: any shared API, remote boundary, replay validation, or future caller that uses `generateRequestSchema` would reject the current `/amend` request shape. ## Expected behavior The generate request schema should accept the same guide-source values used by current runtime and replay code, including `amend`. Ideally the duplicated enum should derive from the shared generation-guide source of truth or have focused proof that catches future drift. ## Acceptance criteria - `generateRequestSchema` accepts `generationGuideSource: "amend"`. - Existing legacy-compatible values still pass: `narrator`, `guide`, and `game_start`. - Current game values still pass: `game_turn` and `game_retry`. - Focused proof covers the schema/source alignment. ## Context Found during the Target 1 contracts-and-schemas batch-2 parityscan in #2011. A focused local probe showed generation parameter additions and `game_turn`/`game_retry` pass, while `amend` is rejected by the request schema.
bsakaguchi 2026-10-21 05:24:49 +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#986
No description provided.