[PR #2211] [MERGED] Fix game prompt sprite availability #5474

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

📋 Pull Request Information

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

Base: refactor ← Head: fix/issue-2135-character-sprites


📝 Commits (5)

  • d15ac9a Fix game prompt sprite availability
  • be816aa Record issue 2135 PR verification
  • 468d9af Merge remote-tracking branch 'upstream/refactor' into fix/issue-2135-character-sprites
  • 800b8ab Address game sprite prompt review
  • c20cee7 Refresh issue 2135 PR verification

📊 Changes

9 files changed (+382 additions, -73 deletions)

View changed files

📝 scratch/bugfix-verification.json (+62 -71)
📝 src/engine/generation/prompt-assembly.test.ts (+82 -0)
📝 src/engine/generation/prompt-assembly.ts (+6 -0)
📝 src/engine/generation/prompt-preview.ts (+3 -0)
📝 src/engine/generation/start-generation.ts (+3 -0)
➕ src/engine/modes/game/prompts/sprite.service.test.ts (+89 -0)
📝 src/engine/modes/game/prompts/sprite.service.ts (+105 -0)
📝 src/features/catalog/chats/hooks/use-chats.ts (+2 -1)
📝 src/features/modes/game/api/game-api.ts (+30 -1)

📄 Description

Linked issue

Closes #2135

Why this change

  • Game GM and party prompts still had sprite-availability prompt blocks, but the refactor path never populated characterSprites, so models were not told the saved expression names or custom full-body aliases for party characters.

What changed

  • Added a game prompt sprite loader that reads saved character sprites through VisualAssetGateway, buckets expression sprites separately from custom full-body aliases, and keeps engine-reserved automatic full-body poses out of model-visible alias lists.
  • Wired the loader into game prompt assembly, prompt preview, generation entrypoints, and the party-turn prompt path.
  • Added regression coverage for GM prompt assembly and the sprite bucketing/automatic-pose edge case.

Refactor impact

Primary owner:

  • Engine generation / game mode prompt assembly

Impact areas reviewed:

  • src/engine/generation
  • src/engine/modes/game/prompts
  • src/features/modes/game/api
  • Prompt preview via chat catalog hooks

Boundary notes:

  • Engine code depends only on the existing VisualAssetGateway capability.
  • Shared/feature code passes visualAssetsApi; no raw Tauri calls were added to engine code.
  • NPC party members are intentionally skipped because saved sprites are keyed by character/persona owner IDs, not tracked NPC IDs.

Pressure points touched:

  • Game prompt assembly
  • Game party-turn API
  • Prompt preview

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

  • Before proof: copied the new prompt-assembly regression into C:/tmp/Marinara-Engine-issue-2135-before at pristine upstream/refactor; pnpm exec vitest run src/engine/generation/prompt-assembly.test.ts failed because the prompt did not contain Available custom sprites per character.
  • After proof: pnpm exec vitest run src/engine/generation/prompt-assembly.test.ts src/engine/modes/game/prompts/sprite.service.test.ts passed.
  • pnpm typecheck passed.
  • pnpm check passed.
  • node C:/Users/celia/.codex/tools/marinara-proof-gate.mjs scratch/bugfix-verification.json passed.
  • Bunny pass completed locally on the final diff.

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:

  • Bugfix restoring prompt context parity; no new user-discoverable surface.

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. Backend/prompt assembly fix; proof is the before/after prompt regression and full local validation above.


🔄 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/2211 **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-2135-character-sprites` --- ### 📝 Commits (5) - [`d15ac9a`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d15ac9ae462969878cc94be919bc82390a162c79) Fix game prompt sprite availability - [`be816aa`](https://github.com/Pasta-Devs/Marinara-Engine/commit/be816aaf6ae44c8141987e8ded46e70bc9dde54f) Record issue 2135 PR verification - [`468d9af`](https://github.com/Pasta-Devs/Marinara-Engine/commit/468d9afc49bd194fdf1a494c7ee294cc8855c4e7) Merge remote-tracking branch 'upstream/refactor' into fix/issue-2135-character-sprites - [`800b8ab`](https://github.com/Pasta-Devs/Marinara-Engine/commit/800b8ab2f75274c710c01553510c138f7654b9d8) Address game sprite prompt review - [`c20cee7`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c20cee73bca7ed6371c1fbbbd6ea196364c7ff47) Refresh issue 2135 PR verification ### 📊 Changes **9 files changed** (+382 additions, -73 deletions) <details> <summary>View changed files</summary> 📝 `scratch/bugfix-verification.json` (+62 -71) 📝 `src/engine/generation/prompt-assembly.test.ts` (+82 -0) 📝 `src/engine/generation/prompt-assembly.ts` (+6 -0) 📝 `src/engine/generation/prompt-preview.ts` (+3 -0) 📝 `src/engine/generation/start-generation.ts` (+3 -0) ➕ `src/engine/modes/game/prompts/sprite.service.test.ts` (+89 -0) 📝 `src/engine/modes/game/prompts/sprite.service.ts` (+105 -0) 📝 `src/features/catalog/chats/hooks/use-chats.ts` (+2 -1) 📝 `src/features/modes/game/api/game-api.ts` (+30 -1) </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 #2135 ## Why this change - Game GM and party prompts still had sprite-availability prompt blocks, but the refactor path never populated `characterSprites`, so models were not told the saved expression names or custom full-body aliases for party characters. ## What changed - Added a game prompt sprite loader that reads saved character sprites through `VisualAssetGateway`, buckets expression sprites separately from custom full-body aliases, and keeps engine-reserved automatic full-body poses out of model-visible alias lists. - Wired the loader into game prompt assembly, prompt preview, generation entrypoints, and the party-turn prompt path. - Added regression coverage for GM prompt assembly and the sprite bucketing/automatic-pose edge case. ## Refactor impact Primary owner: - Engine generation / game mode prompt assembly Impact areas reviewed: - `src/engine/generation` - `src/engine/modes/game/prompts` - `src/features/modes/game/api` - Prompt preview via chat catalog hooks Boundary notes: - Engine code depends only on the existing `VisualAssetGateway` capability. - Shared/feature code passes `visualAssetsApi`; no raw Tauri calls were added to engine code. - NPC party members are intentionally skipped because saved sprites are keyed by character/persona owner IDs, not tracked NPC IDs. Pressure points touched: - Game prompt assembly - Game party-turn API - Prompt preview ## 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 - Before proof: copied the new prompt-assembly regression into `C:/tmp/Marinara-Engine-issue-2135-before` at pristine `upstream/refactor`; `pnpm exec vitest run src/engine/generation/prompt-assembly.test.ts` failed because the prompt did not contain `Available custom sprites per character`. - After proof: `pnpm exec vitest run src/engine/generation/prompt-assembly.test.ts src/engine/modes/game/prompts/sprite.service.test.ts` passed. - `pnpm typecheck` passed. - `pnpm check` passed. - `node C:/Users/celia/.codex/tools/marinara-proof-gate.mjs scratch/bugfix-verification.json` passed. - Bunny pass completed locally on the final diff. ## 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. - [x] 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: - Bugfix restoring prompt context parity; no new user-discoverable surface. ## 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. Backend/prompt assembly fix; proof is the before/after prompt regression and full local validation above. --- <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:38 +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#5474
No description provided.