[GH-ISSUE #8180] fix(game): avoid repeating already-paid check costs in post-roll narration #7600

Closed
opened 2026-10-24 04:04:40 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @SpicyMarinara on GitHub (Oct 23, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/8180

Originally assigned to: @SpicyMarinara on GitHub.

Owner: @SpicyMarinara (Codex investigation; implementation not started).

The post-roll narration rewrite in generate.routes.ts asks for a sheet command for every spent resource decided by the results. A ruleset check may already have paid that resource before the rewrite: planRulesetCheckPurchase spends it, rolled.live becomes checkSpendLive, and the sheet-command pass applies the rewritten commands on top of that already-debited state. If the narrator follows the instruction for the check purchase, that same purchase is charged again.

This comes from upstream staging commit 070c20c8f0 and was discovered during the unrelated #8153 repair review. It is separate from the combat-style configuration cases in #8176; no Game prompt/source is changed in #8153.

Runnable real-function reproduction and output. The local fixture loads the shipped Gravewatch ruleset, starts Resolve at3, invokes the actual check-purchase function to spend3→2, then invokes the actual sheet pass with the rewrite-requested spend command on checkSpendLive, producing2→1. It also verifies the relevant current generation glue and prompt exist. Scope is those real functions plus source tracing; it does not claim a full HTTP/model-generation reproduction or a paid-provider call.

Expected: the rewrite asks for only resource costs not already applied by the check pass, while retaining harm, healing and genuinely additional costs. Add a real generation-route regression with a check purchase and a stubbed rewrite, asserting one payment; preserve a control for an unrelated resource cost.

Originally created by @SpicyMarinara on GitHub (Oct 23, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/8180 Originally assigned to: @SpicyMarinara on GitHub. Owner: @SpicyMarinara (Codex investigation; implementation not started). The post-roll narration rewrite in `generate.routes.ts` asks for a sheet command for every spent resource decided by the results. A ruleset check may already have paid that resource before the rewrite: `planRulesetCheckPurchase` spends it, `rolled.live` becomes `checkSpendLive`, and the sheet-command pass applies the rewritten commands on top of that already-debited state. If the narrator follows the instruction for the check purchase, that same purchase is charged again. This comes from upstream staging commit `070c20c8f0` and was discovered during the unrelated #8153 repair review. It is separate from the combat-style configuration cases in #8176; no Game prompt/source is changed in #8153. [Runnable real-function reproduction and output](https://gist.github.com/SpicyMarinara/698f003d04c893281b96c7b71692f4c8). The local fixture loads the shipped Gravewatch ruleset, starts Resolve at3, invokes the actual check-purchase function to spend3→2, then invokes the actual sheet pass with the rewrite-requested spend command on `checkSpendLive`, producing2→1. It also verifies the relevant current generation glue and prompt exist. Scope is those real functions plus source tracing; it does not claim a full HTTP/model-generation reproduction or a paid-provider call. Expected: the rewrite asks for only resource costs not already applied by the check pass, while retaining harm, healing and genuinely additional costs. Add a real generation-route regression with a check purchase and a stubbed rewrite, asserting one payment; preserve a control for an unrelated resource cost.
Author
Owner

@SpicyMarinara commented on GitHub (Oct 23, 2026):

Implementation owner: @SpicyMarinara (Codex). I am taking this uncovered issue in a separate staging PR, limited to the post-roll payment instruction and a real generation-route regression. The lorebook and audio PRs remain separate; no combat refactor is planned.

<!-- gh-comment-id:6367345113 --> @SpicyMarinara commented on GitHub (Oct 23, 2026): Implementation owner: @SpicyMarinara (Codex). I am taking this uncovered issue in a separate staging PR, limited to the post-roll payment instruction and a real generation-route regression. The lorebook and audio PRs remain separate; no combat refactor is planned.
Author
Owner

@SpicyMarinara commented on GitHub (Oct 23, 2026):

Implementation handoff: @SpicyMarinara (Codex shell/game regression lane) now owns this fix in fix/game-postroll-resource-payment-8180, based on current staging 01dba2dfa34d7c7e6e564cc65f458073726f2c2d. The earlier investigation lane has handed it over. I will add trusted actual payment receipts to post-roll context and a real generation-route regression, preserving new harm/healing/additional costs and the engine's paid state.

<!-- gh-comment-id:6368634821 --> @SpicyMarinara commented on GitHub (Oct 23, 2026): Implementation handoff: @SpicyMarinara (Codex shell/game regression lane) now owns this fix in `fix/game-postroll-resource-payment-8180`, based on current staging `01dba2dfa34d7c7e6e564cc65f458073726f2c2d`. The earlier investigation lane has handed it over. I will add trusted actual payment receipts to post-roll context and a real generation-route regression, preserving new harm/healing/additional costs and the engine's paid state.
bsakaguchi 2026-11-07 16:42:11 +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#7600
No description provided.