[PR #2206] [MERGED] Fix game party recruit card generation #5470

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

📋 Pull Request Information

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

Base: refactor ← Head: fix/issue-2134-party-recruit-cards


📝 Commits (1)

  • dda60ec Fix game party recruit card generation

📊 Changes

5 files changed (+431 additions, -21 deletions)

View changed files

➕ scratch/issue-2134-party-card-proof.mjs (+36 -0)
📝 src/engine/modes/game/prompts/gm-prompts.ts (+80 -0)
📝 src/features/modes/game/api/game-api.ts (+252 -12)
📝 src/features/modes/game/components/GameSurface.tsx (+40 -9)
📝 src/features/modes/game/hooks/use-game.ts (+23 -0)

📄 Description

Linked issue

Closes #2134

Why this change

  • Game mode recruits created from [party_change: change="add"] were stored as static boilerplate Adventurer sheets instead of context-grounded companion cards.
  • The sheet modal's existing regenerate path was not wired, so malformed or outdated companion cards could not be refreshed from game context.

What changed

  • Added a React-free GM prompt builder for recruit/regenerate party cards.
  • Routed gameApi.upsertPartyCard through the existing LLM JSON path with world, story arc, plot twist, current-state, party-card, and recent-transcript context.
  • Normalized generated party-card JSON before storing it, including RPG attributes and HP.
  • Passed the chat LLM connection into automatic party recruit mutations and wired the character sheet regenerate button.
  • Added party_card handling to the game JSON repair apply flow.

Refactor impact

Primary owner:

game mode, engine generation

Impact areas reviewed:

  • Game mode party card metadata, GM prompt assembly, JSON repair apply flow, GameSurface party-change handling, and character sheet regenerate wiring.

Boundary notes:

  • Engine prompt logic stays React-free in src/engine.
  • Feature code continues to use gameApi and focused hooks.
  • No raw Tauri calls, raw remote-runtime fetches, Rust changes, schema changes, or dependency changes.

Pressure points touched:

  • GameSurface
  • gameApi
  • GM prompt module
  • Game JSON repair apply switch

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

  • node scratch\issue-2134-party-card-proof.mjs passes.
  • pnpm typecheck passes.
  • pnpm check:architecture passes.
  • pnpm check passes.
  • Manual Tauri desktop gameplay verification not run: I did not start a game and recruit a companion against a live LLM connection in the desktop app.

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:

  • N/A; this restores existing game companion card generation/regeneration behavior.

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. No visible layout change; the sheet regenerate control already existed and is now wired to the repaired generation path.


🔄 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/2206 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 6/4/2026 **Status:** ✅ Merged **Merged:** 6/4/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `refactor` ← **Head:** `fix/issue-2134-party-recruit-cards` --- ### 📝 Commits (1) - [`dda60ec`](https://github.com/Pasta-Devs/Marinara-Engine/commit/dda60ecc0d9b35831d232dbc396b83052b855f1f) Fix game party recruit card generation ### 📊 Changes **5 files changed** (+431 additions, -21 deletions) <details> <summary>View changed files</summary> ➕ `scratch/issue-2134-party-card-proof.mjs` (+36 -0) 📝 `src/engine/modes/game/prompts/gm-prompts.ts` (+80 -0) 📝 `src/features/modes/game/api/game-api.ts` (+252 -12) 📝 `src/features/modes/game/components/GameSurface.tsx` (+40 -9) 📝 `src/features/modes/game/hooks/use-game.ts` (+23 -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 Closes #2134 ## Why this change - Game mode recruits created from `[party_change: change="add"]` were stored as static boilerplate `Adventurer` sheets instead of context-grounded companion cards. - The sheet modal's existing regenerate path was not wired, so malformed or outdated companion cards could not be refreshed from game context. ## What changed - Added a React-free GM prompt builder for recruit/regenerate party cards. - Routed `gameApi.upsertPartyCard` through the existing LLM JSON path with world, story arc, plot twist, current-state, party-card, and recent-transcript context. - Normalized generated party-card JSON before storing it, including RPG attributes and HP. - Passed the chat LLM connection into automatic party recruit mutations and wired the character sheet regenerate button. - Added `party_card` handling to the game JSON repair apply flow. ## Refactor impact Primary owner: game mode, engine generation Impact areas reviewed: - Game mode party card metadata, GM prompt assembly, JSON repair apply flow, GameSurface party-change handling, and character sheet regenerate wiring. Boundary notes: - Engine prompt logic stays React-free in `src/engine`. - Feature code continues to use `gameApi` and focused hooks. - No raw Tauri calls, raw remote-runtime fetches, Rust changes, schema changes, or dependency changes. Pressure points touched: - GameSurface - `gameApi` - GM prompt module - Game JSON repair apply switch ## 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 - `node scratch\issue-2134-party-card-proof.mjs` passes. - `pnpm typecheck` passes. - `pnpm check:architecture` passes. - `pnpm check` passes. - Manual Tauri desktop gameplay verification not run: I did not start a game and recruit a companion against a live LLM connection in the desktop app. ## 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: - N/A; this restores existing game companion card generation/regeneration behavior. ## 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. No visible layout change; the sheet regenerate control already existed and is now wired to the repaired generation path. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:16: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#5470
No description provided.