[PR #4398] [MERGED] Fix storyboard matching for prefixed NPC names #6360

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/4398
Author: @thetopham
Created: 8/1/2026
Status: ✅ Merged
Merged: 8/1/2026
Merged by: @thetopham

Base: staging ← Head: fix/4397-storyboard-npc-prefix-aliases


📝 Commits (1)

  • 202257a Fix storyboard matching for prefixed NPC names

📊 Changes

2 files changed (+93 additions, -12 deletions)

View changed files

📝 packages/server/src/routes/game.routes.ts (+44 -12)
📝 scripts/regressions/prompt.regression.ts (+49 -0)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository 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 #4397

Why this change

  • Tracked NPCs such as Old Grish lost storyboard appearance and avatar context when later GM narration used the shorter name Grish.
  • Broad per-word fuzzy matching is not safe for storyboard visibility because ordinary narration words can promote unrelated NPCs.

What changed

  • Extended the controlled leading-prefix aliases with old, young, elder, great, and captain.
  • Reused one leading-prefix helper for avatar lookup and storyboard visibility.
  • Allowed shortened storyboard aliases only when they uniquely identify one allowed roster entry, preventing Grish from selecting both Old Grish and Young Grish.
  • Added regression coverage for shortened names, all new prefixes, unrelated descriptive narration, ambiguous aliases, full-name disambiguation, and a one-word NPC named Old.

Validation

  • pnpm check passes locally
  • 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

Commands completed:

  • pnpm check
  • pnpm regression:prompt
  • git diff --check

Manual verification notes

  • No browser or live Game-mode verification was performed. The original matcher failure and its negative controls are covered by deterministic prompt regression assertions.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) 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)

No docs or release metadata changes are needed for this internal matcher fix.

UI evidence (if applicable)

Not applicable; this is a server-side storyboard selection fix.

Summary by CodeRabbit

  • Bug Fixes

    • Improved storyboard character matching for names with descriptors such as “old,” “young,” “elder,” “great,” and “captain.”
    • Prevented ambiguous shortened names from selecting multiple similarly named characters.
    • Improved character selection across storyboard narration and appearance matching.
  • Tests

    • Added regression coverage for prefixed names, exact matches, ambiguous aliases, color and material terms, and multi-character narration.

🔄 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/4398 **Author:** [@thetopham](https://github.com/thetopham) **Created:** 8/1/2026 **Status:** ✅ Merged **Merged:** 8/1/2026 **Merged by:** [@thetopham](https://github.com/thetopham) **Base:** `staging` ← **Head:** `fix/4397-storyboard-npc-prefix-aliases` --- ### 📝 Commits (1) - [`202257a`](https://github.com/Pasta-Devs/Marinara-Engine/commit/202257aa95b1ae8cfc5508c3a9943dfed254cbe4) Fix storyboard matching for prefixed NPC names ### 📊 Changes **2 files changed** (+93 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `packages/server/src/routes/game.routes.ts` (+44 -12) 📝 `scripts/regressions/prompt.regression.ts` (+49 -0) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository 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 #4397 ## Why this change - Tracked NPCs such as `Old Grish` lost storyboard appearance and avatar context when later GM narration used the shorter name `Grish`. - Broad per-word fuzzy matching is not safe for storyboard visibility because ordinary narration words can promote unrelated NPCs. ## What changed - Extended the controlled leading-prefix aliases with `old`, `young`, `elder`, `great`, and `captain`. - Reused one leading-prefix helper for avatar lookup and storyboard visibility. - Allowed shortened storyboard aliases only when they uniquely identify one allowed roster entry, preventing `Grish` from selecting both `Old Grish` and `Young Grish`. - Added regression coverage for shortened names, all new prefixes, unrelated descriptive narration, ambiguous aliases, full-name disambiguation, and a one-word NPC named `Old`. ## Validation - [x] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [x] 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` Commands completed: - `pnpm check` - `pnpm regression:prompt` - `git diff --check` ### Manual verification notes - No browser or live Game-mode verification was performed. The original matcher failure and its negative controls are covered by deterministic prompt regression assertions. ## Docs and release impact - [x] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) 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) No docs or release metadata changes are needed for this internal matcher fix. ## UI evidence (if applicable) Not applicable; this is a server-side storyboard selection fix. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Improved storyboard character matching for names with descriptors such as “old,” “young,” “elder,” “great,” and “captain.” - Prevented ambiguous shortened names from selecting multiple similarly named characters. - Improved character selection across storyboard narration and appearance matching. - **Tests** - Added regression coverage for prefixed names, exact matches, ambiguous aliases, color and material terms, and multi-character narration. <!-- 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:09:40 +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#6360
No description provided.