Skip to content

fix(dungeo): melee blank-output + MDL-canonical Low Room carousel; add Phrase Algebra primer#173

Merged
ChicagoDave merged 1 commit into
mainfrom
v2_dungeo_melee_carousel
Jul 1, 2026
Merged

fix(dungeo): melee blank-output + MDL-canonical Low Room carousel; add Phrase Algebra primer#173
ChicagoDave merged 1 commit into
mainfrom
v2_dungeo_melee_carousel

Conversation

@ChicagoDave

Copy link
Copy Markdown
Owner

Summary

Two root fixes for dungeo walkthrough failures introduced by the Phrase Algebra text-emission change (ADRs 192–206), plus a durable reference doc. Story-level only — no platform changes.

Walkthrough chain: 402/648 → clean 885/885 pass.

1. Melee combat blank output

  • stories/dungeo/src/messages/npc-messages.ts: removed empty-string template registrations for the dynamic melee IDs. Under Phrase Algebra an '' template makes getTemplate return '' (not undefined), so renderViaPhrase returns a blank non-null block and shadows the inline-text fallback the melee interceptor relies on → blank combat output. Unregistered IDs now fall through to the inline-text path.
  • stories/dungeo/src/combat/melee-messages.ts: getHeroAttackMessage now substitutes {the villain} as well as {villain} (the old regex left {the villain} literal).
  • Result: wt-01 32/99 → 36/36; combat text renders correctly.

2. Low Room carousel (MDL-canonical)

  • Verified against MDL source (act1.254 CAROUSEL-EXIT, act3.199 MAGNET-ROOM-EXIT + TRBUT): the single CAROUSEL-FLIP!-FLAG drives the two rooms oppositely — the triangular button toggles it TRUE, which fixes the Round Room but randomizes the Low Room (<PROB 50>). So robot-entity.ts setting carousel.active=true is correct; the bug was that wt-10's return path crosses the Low Room after the button push with no retry loop.
  • stories/dungeo/walkthroughs/wt-10-tea-room.transcript: wrapped the Low Room return in a WHILE-loop retry to Tea Room, exactly like the existing Round Room loop.
  • stories/dungeo/CLAUDE.md: corrected the backwards Low Room note.
  • This cascaded to fix wt-11 → wt-17 (all were inheriting broken save state via $restore).

3. Phrase Algebra primer

  • docs/reference/phrase-algebra-primer.md (new): as-built reference for the text-rendering system (ADRs 192–206) — Phrase model, template grammar, atom catalog, Assembler, emission pipeline, Structural Realization Mandate, failure modes, melee case study.

Acceptance

Per the project rule "one good run is acceptable" (thief + carousel RNG make some chain runs flaky by design), the chain reaches clean full-green runs (885/885). Residual per-run flakiness is inherent thief (wt-13) / carousel (wt-10/wt-17) randomness.

🤖 Generated with Claude Code

…d Phrase Algebra primer

Two root fixes:

1. Empty-template shadowing: npc-messages.ts was registering empty-string
   templates for melee message IDs, causing the lang-en-us inline-text
   fallback to be silently bypassed and producing blank combat output.
   Removed the empty registrations so the fallback now fires correctly.

2. Low Room carousel direction: the FLIP flag in robot-entity.ts drives
   Round Room and Low Room oppositely. Added MDL-canonical comment to
   document this intentional asymmetry; wt-10-tea-room.transcript updated
   with WHILE-loop retry to handle the randomized room sequence reliably.

Full walkthrough chain now passes 885/885.

Also adds docs/reference/phrase-algebra-primer.md — as-built reference for
the Phrase Algebra pattern used in melee-messages.ts.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ChicagoDave ChicagoDave merged commit b720b06 into main Jul 1, 2026
1 check failed
@ChicagoDave ChicagoDave deleted the v2_dungeo_melee_carousel branch July 1, 2026 05:51
@sonarqubecloud

sonarqubecloud Bot commented Jul 1, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
B Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant