[PR #8305] [MERGED] fix(game): a rolled turn's kept buys are made at the place its draft said #8265

Closed
opened 2026-10-26 04:04:13 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8305
Author: @kolacheee
Created: 10/25/2026
Status: ✅ Merged
Merged: 10/25/2026
Merged by: @kolacheee

Base: staging ← Head: fix/rolled-buys-place


📝 Commits (4)

  • ef62068 fix(game): a rolled turn's kept buys are made at the place its draft said
  • 685eb15 Merge remote-tracking branch 'origin/staging' into fix/rolled-buys-place
  • fb66ec5 fix(game): a new market day the draft began is begun once
  • 1074eee fix(game): a new day is read and taken out however its day is quoted

📊 Changes

4 files changed (+197 additions, -1 deletions)

View changed files

➕ e2e/game-rolled-turn-buys.e2e.ts (+111 -0)
📝 packages/server/src/services/game/dice-rewrite-costs.ts (+20 -1)
📝 packages/shared/src/utils/game-place-tag.ts (+27 -0)
📝 scripts/regressions/game-dice-rewrite-costs.regression.ts (+39 -0)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #8304

Why this change

  • Before: on a rolled turn narrated in a second request, the rewrite usually drops the draft's [place: ...] tag. The draft's buys are kept, but they run before any place is in force, so every one is refused as no-place and nothing is bought.
  • After: the buys are made at the place the draft said, and a buy the purse can't pay for is still told to the player.

What changed

  • A rolled turn's kept trades now carry the draft's place with them: the last [place: ...] tag the draft wrote before them goes in front of them. A place said after the trade, or a draft with no kept trade, adds nothing.
  • When that carried place starts a new market day, the rewrite's own place tags no longer start a second one after the trades. The day is read the way the Engine reads it, however it is quoted (day="new", day='new', day=new).

Validation

  • game-dice-rewrite-costs regression: the place goes in front of kept trades; a later place and a trade-less draft add nothing; a carried new day is begun once for every quoting style; a name containing day=new is left alone.
  • New e2e game-rolled-turn-buys: a place, a check and two buys (one too dear) in one reply, rolled in that reply and rolled in a second request. Both buy the kit, refuse the bicycle as cannot-afford, and show "Bicycle was not bought". The second-request case failed before this change with both buys refused as no-place.
  • Server typecheck passes locally; CI runs the full check.
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

  • Covered by the e2e above, with a local fake model.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

🔄 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/8305 **Author:** [@kolacheee](https://github.com/kolacheee) **Created:** 10/25/2026 **Status:** ✅ Merged **Merged:** 10/25/2026 **Merged by:** [@kolacheee](https://github.com/kolacheee) **Base:** `staging` ← **Head:** `fix/rolled-buys-place` --- ### 📝 Commits (4) - [`ef62068`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ef6206838097ba459d1f0fc8d2bd3d6d9d760022) fix(game): a rolled turn's kept buys are made at the place its draft said - [`685eb15`](https://github.com/Pasta-Devs/Marinara-Engine/commit/685eb152881e5fc83699215f9386242d0462e93f) Merge remote-tracking branch 'origin/staging' into fix/rolled-buys-place - [`fb66ec5`](https://github.com/Pasta-Devs/Marinara-Engine/commit/fb66ec5cb8bc500d2f1e3270ca3025b4f6608423) fix(game): a new market day the draft began is begun once - [`1074eee`](https://github.com/Pasta-Devs/Marinara-Engine/commit/1074eee236abfb4676619fa029b5a2969753ec96) fix(game): a new day is read and taken out however its day is quoted ### 📊 Changes **4 files changed** (+197 additions, -1 deletions) <details> <summary>View changed files</summary> ➕ `e2e/game-rolled-turn-buys.e2e.ts` (+111 -0) 📝 `packages/server/src/services/game/dice-rewrite-costs.ts` (+20 -1) 📝 `packages/shared/src/utils/game-place-tag.ts` (+27 -0) 📝 `scripts/regressions/game-dice-rewrite-costs.regression.ts` (+39 -0) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. ## Linked issue Closes #8304 ## Why this change - Before: on a rolled turn narrated in a second request, the rewrite usually drops the draft's `[place: ...]` tag. The draft's buys are kept, but they run before any place is in force, so every one is refused as `no-place` and nothing is bought. - After: the buys are made at the place the draft said, and a buy the purse can't pay for is still told to the player. ## What changed - A rolled turn's kept trades now carry the draft's place with them: the last `[place: ...]` tag the draft wrote before them goes in front of them. A place said after the trade, or a draft with no kept trade, adds nothing. - When that carried place starts a new market day, the rewrite's own place tags no longer start a second one after the trades. The day is read the way the Engine reads it, however it is quoted (`day="new"`, `day='new'`, `day=new`). ## Validation - [x] `game-dice-rewrite-costs` regression: the place goes in front of kept trades; a later place and a trade-less draft add nothing; a carried new day is begun once for every quoting style; a name containing `day=new` is left alone. - [x] New e2e `game-rolled-turn-buys`: a place, a check and two buys (one too dear) in one reply, rolled in that reply and rolled in a second request. Both buy the kit, refuse the bicycle as `cannot-afford`, and show "Bicycle was not bought". The second-request case failed before this change with both buys refused as `no-place`. - [x] Server typecheck passes locally; CI runs the full check. - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [x] Read and followed `CONTRIBUTING.md` ### Manual verification notes - Covered by the e2e above, with a local fake model. ## Docs and release impact - [x] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-26 04:04:13 +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#8265
No description provided.