[PR #3860] [MERGED] fix: enforce dynamic NPC portrait rewrites #6132

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/3860
Author: @SpicyMarinara
Created: 7/20/2026
Status: ✅ Merged
Merged: 7/20/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/game-portrait-dynamic-generator-routing


📝 Commits (2)

  • d7bbb8d fix: enforce dynamic NPC portrait rewrites
  • ea7f785 fix: strip remaining reputation metadata

📊 Changes

4 files changed (+178 additions, -32 deletions)

View changed files

📝 CHANGELOG.md (+1 -1)
📝 packages/server/src/routes/game.routes.ts (+78 -18)
📝 packages/server/src/services/game/game-asset-generation.ts (+19 -13)
📝 scripts/regressions/prompt.regression.ts (+80 -0)

📄 Description

Why

The staging retest for #3846 showed that enabled dynamic portrait rewriting could still fall back to the deterministic compiler without telling the user. That fallback reintroduced legacy reputation notes and the canonical-profile header, while the compact tag compiler did not recognize Xenomorph and similar non-human identities.

What changed

  • Resolve available Game prompt connections in order and fall back to the configured default agent text connection.
  • Fail an enabled dynamic rewrite instead of silently sending the deterministic prompt when initialization or generation fails.
  • Stop forcing provider-level JSON mode so custom Prompt Directors can return their requested plain tag format.
  • Strip legacy Notable details and reputation-event text at the shared portrait appearance boundary.
  • Preserve explicit Xenomorph, alien, biomechanical, synth, and related non-human cues before tagged prompt compilation.
  • Add regression coverage for the exact staging payload shape, connection fallback, custom output format, failure behavior, and species preservation.

Closes #3846

Automated evidence

  • pnpm regression:prompt passed.
  • pnpm check passed.

Validation checklist

  • Run pnpm regression:prompt.
  • Run pnpm check.
  • Manually verify a custom Game Image Prompt Director returns clean tags for an NPC with reputation history.
  • Manually verify a Xenomorph portrait retains its species and biomechanical traits.

Docs and release impact

  • Updated the existing #3846 changelog entry.
  • No version-bearing files changed.

Summary by CodeRabbit

  • Bug Fixes
    • Improved dynamic image prompt connection selection, including fallback behavior when scene connections are unavailable.
    • Dynamic prompt failures now surface clearly instead of silently falling back or disabling prompting.
    • Added support for custom non-JSON prompt output.
    • Cleaned NPC portrait details by removing reputation and legacy metadata leakage.
    • Preserved explicit non-human species cues in generated portraits.
  • Tests
    • Added regression coverage for prompt sanitization, connection fallback, output handling, and failure scenarios.

🔄 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/3860 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 7/20/2026 **Status:** ✅ Merged **Merged:** 7/20/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/game-portrait-dynamic-generator-routing` --- ### 📝 Commits (2) - [`d7bbb8d`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d7bbb8dd5939f59952d583e1c31e27d28914853b) fix: enforce dynamic NPC portrait rewrites - [`ea7f785`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ea7f785d583e50248f0b8e03c7f0ebbb82834ae4) fix: strip remaining reputation metadata ### 📊 Changes **4 files changed** (+178 additions, -32 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -1) 📝 `packages/server/src/routes/game.routes.ts` (+78 -18) 📝 `packages/server/src/services/game/game-asset-generation.ts` (+19 -13) 📝 `scripts/regressions/prompt.regression.ts` (+80 -0) </details> ### 📄 Description ## Why The staging retest for #3846 showed that enabled dynamic portrait rewriting could still fall back to the deterministic compiler without telling the user. That fallback reintroduced legacy reputation notes and the canonical-profile header, while the compact tag compiler did not recognize Xenomorph and similar non-human identities. ## What changed - Resolve available Game prompt connections in order and fall back to the configured default agent text connection. - Fail an enabled dynamic rewrite instead of silently sending the deterministic prompt when initialization or generation fails. - Stop forcing provider-level JSON mode so custom Prompt Directors can return their requested plain tag format. - Strip legacy `Notable details` and reputation-event text at the shared portrait appearance boundary. - Preserve explicit Xenomorph, alien, biomechanical, synth, and related non-human cues before tagged prompt compilation. - Add regression coverage for the exact staging payload shape, connection fallback, custom output format, failure behavior, and species preservation. Closes #3846 ## Automated evidence - `pnpm regression:prompt` passed. - `pnpm check` passed. ## Validation checklist - [ ] Run `pnpm regression:prompt`. - [ ] Run `pnpm check`. - [ ] Manually verify a custom Game Image Prompt Director returns clean tags for an NPC with reputation history. - [ ] Manually verify a Xenomorph portrait retains its species and biomechanical traits. ## Docs and release impact - Updated the existing #3846 changelog entry. - No version-bearing files changed. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Improved dynamic image prompt connection selection, including fallback behavior when scene connections are unavailable. - Dynamic prompt failures now surface clearly instead of silently falling back or disabling prompting. - Added support for custom non-JSON prompt output. - Cleaned NPC portrait details by removing reputation and legacy metadata leakage. - Preserved explicit non-human species cues in generated portraits. - **Tests** - Added regression coverage for prompt sanitization, connection fallback, output handling, and failure scenarios. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:07:23 +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#6132
No description provided.