[PR #8397] [MERGED] fix(images): preserve complete image generation prompts #8574

Closed
opened 2026-11-07 16:45:42 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8397
Author: @SpicyMarinara
Created: 10/27/2026
Status: ✅ Merged
Merged: 10/27/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/8396-complete-image-prompts


📝 Commits (4)

  • 3821ff1 test(images): reproduce omitted tracker portrait details
  • b0fd28b fix(images): retain complete image prompt text
  • 5031f5e fix(images): retain positive sentences after prompt exclusions
  • 0b934a6 fix(images): keep abbreviated names inside prompt exclusions

📊 Changes

16 files changed (+609 additions, -314 deletions)

View changed files

📝 packages/server/src/routes/avatars.routes.ts (+2 -2)
📝 packages/server/src/routes/game.routes.ts (+11 -12)
📝 packages/server/src/services/game/game-asset-generation.ts (+29 -94)
📝 packages/server/src/services/generation/illustrator-background-generation.ts (+1 -1)
📝 packages/server/src/services/generation/illustrator-manual-prompt-generation.ts (+3 -3)
📝 packages/server/src/services/image/character-prompts.ts (+5 -23)
📝 packages/server/src/services/image/illustrator-references.ts (+3 -9)
📝 packages/server/src/services/image/tracker-portrait.ts (+8 -13)
📝 packages/server/src/services/prompt-overrides/registry/game-assets.ts (+6 -2)
📝 packages/shared/src/constants/image-style-profiles.ts (+4 -4)
📝 packages/shared/src/utils/image-prompt-compiler.ts (+32 -118)
➕ scripts/regressions/game-image-prompt-length.regression.ts (+174 -0)
📝 scripts/regressions/illustrator-character-prompts.regression.ts (+27 -17)
➕ scripts/regressions/illustrator-prompt-output.regression.ts (+83 -0)
📝 scripts/regressions/image-appearance-game.regression.ts (+61 -3)
📝 scripts/regressions/prompt.regression.ts (+160 -13)

📄 Description

Linked issue

Closes #8396

Why this change

The report's tracker fields contain height, pink bunny ears, pink hair, blue eyes and body shape, while the sent prompts retain only blue eyes. The same selective loss reproduces on staging: tag-style portrait compilation extracts a small visual subset, limits fragments and ranks them into a 75-token budget. Tracker appearance and outfit fields also have separate hard cuts.

What changed

  • Send complete image prompt text. Providers can reject requests beyond their own capacity; Engine no longer silently cuts these prompts to its own character/token budgets.
  • Preserve the complete Character Tracker appearance and optional outfit, including long fields, through style compilation and the provider request. Keep the Look / Look + Outfit choice and existing portrait save/concurrency guards.
  • Remove the shared 75-token pruning/ranking and retain provider-ready portrait/sprite descriptions instead of extracting only recognized visual phrases. Retain full configured style text, positive/negative tags and composition tags through normalization.
  • Remove downstream Game image output caps, canonical-appearance clipping, character appearance-note clipping, dynamic prompt output cuts and built-in output-length instructions. Full direct user image instructions are included. Existing custom-template variables remain compatible.
  • Preserve complete Illustrator generated prompts, style and negatives, authored appearance references and native per-character captions. Model-specific caption/reference counts, type/name validation, request safety and LLM history/context budgets remain.
  • Keep positive sentences following image exclusions, including quoted/weighted text and consecutive negative sentences. Remove builder-only tracker field labels before submission to tag models.

Validation

Final local candidate: 0b934a6e5e2b47d96f333c70150cabae38c2c0cf.

  • pnpm install completed; final pnpm check passed, including formatting/localization, type/lint checks and production build. One pre-existing HomeProfessorMariChat hook warning remains.
  • pnpm regression:prompt passed: 206 prompt cases, prompt attachments and context fitting.
  • Image regression group: 20/20 files passed. Focused Illustrator output, character caption/appearance and avatar-lead regressions passed. New Game checks pass 8/8; new Illustrator output checks pass 6/6.
  • Actual tracker route to a local HTTP provider capture retains the reported traits and complete appearance/outfit fields for every built-in style, including an appearance over 20,000 characters. Existing failure preservation, upload race, concurrency and outfit opt-out controls pass.
  • Final local pnpm smoke:ui: 7/7 and production Chromium smoke: 1/1 at 0b934a6e5.
  • Before/after proofs retain the original reported failure, Game output truncation, Illustrator output clipping and the inline-negation regression caught during peer review. Existing cap assertions were replaced with full-content assertions; no skips or timeout increases.
  • Local CodeRabbit full review completed. Its duplicate tracker-label findings were fixed. The suggestion to add provider-specific prompt truncation was declined because the maintainer explicitly requested complete prompts; provider rejections continue through the existing error/fallback handling. The repair review identified one abbreviation boundary defect ("Avoid Dr. Smith's glasses" could leak into the positive prompt). That case was reproduced, repaired and covered across built-in profiles; the final delta review completed with zero findings. The cumulative full and repair reviews cover the production changes; the declined provider-cap suggestion is documented above. Independent repair review passed and replayed all four original lost-sentence cases successfully.

A parallel local test attempt ran during a shared-package rebuild and failed on missing compiled modules; the unchanged 20-file group passed after the build and again on the final candidate. The original failure log is retained.

Local Docker build did not complete: the OrbStack daemon disconnected during dependency installation (rpc ... EOF), then its socket was unavailable. Source and test logs were preserved; only task-owned generated caches/dependencies from this and the completed previous task were cleared to recover disk space. Hosted image-build and native ARM64 container API/frontend/native-binding/persistent-data replacement checks passed on final 0b934a6e5. This is separate from the unavailable local Docker daemon.

Manual verification notes

  • Manually verify Character Tracker Look and Look + Outfit with the reporter's actual image connection/workflow.
  • Manually inspect a generated image from a complete long prompt with the chosen provider.

HTTP captures use local fixtures, not a paid provider. These checks prove prompt delivery, not image-model adherence or verification of the reporter's physical setup. No user data, release metadata or downloadable package changes.

Docs and release impact

No documentation or release/version change is needed. Existing LLM input-context and request-validation limits are outside this final-image-prompt truncation fix.

Hosted review

Dottore full review completed on 0b934a6e5 with no defects, one optional dead-code cleanup note, and zero unresolved threads. The full Node run passed 1,125/1,125 files; CodeQL passed both analyses. All eight required contexts passed. The final hosted browser results were 7/7 smoke and 1/1 production; all ten platform jobs passed. Merged to staging as 6c7d839252b77f39f82ba1406ff70131dc64ae51; ancestry and exact equality with the validated feature tree are verified. Post-merge workflows were running at the delivery snapshot.


🔄 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/8397 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/27/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/8396-complete-image-prompts` --- ### 📝 Commits (4) - [`3821ff1`](https://github.com/Pasta-Devs/Marinara-Engine/commit/3821ff1e453aa11158f49bc1f01c1835d34819e7) test(images): reproduce omitted tracker portrait details - [`b0fd28b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b0fd28b12add0224891a153fe60ebf82bb66fb9e) fix(images): retain complete image prompt text - [`5031f5e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/5031f5e598276e19473c27182468ed048df1abc2) fix(images): retain positive sentences after prompt exclusions - [`0b934a6`](https://github.com/Pasta-Devs/Marinara-Engine/commit/0b934a6e5e2b47d96f333c70150cabae38c2c0cf) fix(images): keep abbreviated names inside prompt exclusions ### 📊 Changes **16 files changed** (+609 additions, -314 deletions) <details> <summary>View changed files</summary> 📝 `packages/server/src/routes/avatars.routes.ts` (+2 -2) 📝 `packages/server/src/routes/game.routes.ts` (+11 -12) 📝 `packages/server/src/services/game/game-asset-generation.ts` (+29 -94) 📝 `packages/server/src/services/generation/illustrator-background-generation.ts` (+1 -1) 📝 `packages/server/src/services/generation/illustrator-manual-prompt-generation.ts` (+3 -3) 📝 `packages/server/src/services/image/character-prompts.ts` (+5 -23) 📝 `packages/server/src/services/image/illustrator-references.ts` (+3 -9) 📝 `packages/server/src/services/image/tracker-portrait.ts` (+8 -13) 📝 `packages/server/src/services/prompt-overrides/registry/game-assets.ts` (+6 -2) 📝 `packages/shared/src/constants/image-style-profiles.ts` (+4 -4) 📝 `packages/shared/src/utils/image-prompt-compiler.ts` (+32 -118) ➕ `scripts/regressions/game-image-prompt-length.regression.ts` (+174 -0) 📝 `scripts/regressions/illustrator-character-prompts.regression.ts` (+27 -17) ➕ `scripts/regressions/illustrator-prompt-output.regression.ts` (+83 -0) 📝 `scripts/regressions/image-appearance-game.regression.ts` (+61 -3) 📝 `scripts/regressions/prompt.regression.ts` (+160 -13) </details> ### 📄 Description ## Linked issue Closes #8396 ## Why this change The report's tracker fields contain height, pink bunny ears, pink hair, blue eyes and body shape, while the sent prompts retain only blue eyes. The same selective loss reproduces on staging: tag-style portrait compilation extracts a small visual subset, limits fragments and ranks them into a 75-token budget. Tracker appearance and outfit fields also have separate hard cuts. ## What changed - Send complete image prompt text. Providers can reject requests beyond their own capacity; Engine no longer silently cuts these prompts to its own character/token budgets. - Preserve the complete Character Tracker appearance and optional outfit, including long fields, through style compilation and the provider request. Keep the Look / Look + Outfit choice and existing portrait save/concurrency guards. - Remove the shared 75-token pruning/ranking and retain provider-ready portrait/sprite descriptions instead of extracting only recognized visual phrases. Retain full configured style text, positive/negative tags and composition tags through normalization. - Remove downstream Game image output caps, canonical-appearance clipping, character appearance-note clipping, dynamic prompt output cuts and built-in output-length instructions. Full direct user image instructions are included. Existing custom-template variables remain compatible. - Preserve complete Illustrator generated prompts, style and negatives, authored appearance references and native per-character captions. Model-specific caption/reference counts, type/name validation, request safety and LLM history/context budgets remain. - Keep positive sentences following image exclusions, including quoted/weighted text and consecutive negative sentences. Remove builder-only tracker field labels before submission to tag models. ## Validation Final local candidate: `0b934a6e5e2b47d96f333c70150cabae38c2c0cf`. - `pnpm install` completed; final `pnpm check` passed, including formatting/localization, type/lint checks and production build. One pre-existing HomeProfessorMariChat hook warning remains. - `pnpm regression:prompt` passed: 206 prompt cases, prompt attachments and context fitting. - Image regression group: 20/20 files passed. Focused Illustrator output, character caption/appearance and avatar-lead regressions passed. New Game checks pass 8/8; new Illustrator output checks pass 6/6. - Actual tracker route to a local HTTP provider capture retains the reported traits and complete appearance/outfit fields for every built-in style, including an appearance over 20,000 characters. Existing failure preservation, upload race, concurrency and outfit opt-out controls pass. - Final local `pnpm smoke:ui`: 7/7 and production Chromium smoke: 1/1 at `0b934a6e5`. - Before/after proofs retain the original reported failure, Game output truncation, Illustrator output clipping and the inline-negation regression caught during peer review. Existing cap assertions were replaced with full-content assertions; no skips or timeout increases. - Local CodeRabbit full review completed. Its duplicate tracker-label findings were fixed. The suggestion to add provider-specific prompt truncation was declined because the maintainer explicitly requested complete prompts; provider rejections continue through the existing error/fallback handling. The repair review identified one abbreviation boundary defect ("Avoid Dr. Smith's glasses" could leak into the positive prompt). That case was reproduced, repaired and covered across built-in profiles; the final delta review completed with zero findings. The cumulative full and repair reviews cover the production changes; the declined provider-cap suggestion is documented above. Independent repair review passed and replayed all four original lost-sentence cases successfully. A parallel local test attempt ran during a shared-package rebuild and failed on missing compiled modules; the unchanged 20-file group passed after the build and again on the final candidate. The original failure log is retained. Local Docker build did not complete: the OrbStack daemon disconnected during dependency installation (`rpc ... EOF`), then its socket was unavailable. Source and test logs were preserved; only task-owned generated caches/dependencies from this and the completed previous task were cleared to recover disk space. Hosted image-build and native ARM64 container API/frontend/native-binding/persistent-data replacement checks passed on final `0b934a6e5`. This is separate from the unavailable local Docker daemon. ### Manual verification notes - [ ] Manually verify Character Tracker Look and Look + Outfit with the reporter's actual image connection/workflow. - [ ] Manually inspect a generated image from a complete long prompt with the chosen provider. HTTP captures use local fixtures, not a paid provider. These checks prove prompt delivery, not image-model adherence or verification of the reporter's physical setup. No user data, release metadata or downloadable package changes. ## Docs and release impact No documentation or release/version change is needed. Existing LLM input-context and request-validation limits are outside this final-image-prompt truncation fix. ## Hosted review [Dottore full review](https://github.com/Pasta-Devs/Marinara-Engine/pull/8397#issuecomment-6438564836) completed on `0b934a6e5` with no defects, one optional dead-code cleanup note, and zero unresolved threads. The full Node run passed 1,125/1,125 files; CodeQL passed both analyses. All eight required contexts passed. The final hosted browser results were 7/7 smoke and 1/1 production; all ten platform jobs passed. Merged to staging as `6c7d839252b77f39f82ba1406ff70131dc64ae51`; ancestry and exact equality with the validated feature tree are verified. Post-merge workflows were running at the delivery snapshot. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 16:45:42 +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#8574
No description provided.