From 20647eeafcdf2ac8990e1f92d7464bf5d10f60bf Mon Sep 17 00:00:00 2001 From: prosolis <5590409+prosolis@users.noreply.github.com> Date: Fri, 15 May 2026 07:18:16 -0700 Subject: [PATCH] Phase B1 follow-up: regex catches bare-die notation; blink overlay shim The A1 regex banned \b\d+d\d+\b (e.g. '1d20') but missed bare die notation ('d20', 'd6') with no leading count. SRD's 'blink' Description slipped through with 'Roll a d20 at the end of each of your turns...'. - Add \bd(4|6|8|10|12|20|100)\b ban to the prose regex sweep. - Add hand-authored overlay shim for blink in dnd_spells_data.go. Classes union with SRD preserves Cleric/Sorcerer/Warlock availability. Test now passes the wider sweep; no other reachable spells leak. --- internal/plugin/dnd_spells_data.go | 3 +++ internal/plugin/dnd_spells_prose_test.go | 1 + 2 files changed, 4 insertions(+) diff --git a/internal/plugin/dnd_spells_data.go b/internal/plugin/dnd_spells_data.go index 6c70dba..3e70b19 100644 --- a/internal/plugin/dnd_spells_data.go +++ b/internal/plugin/dnd_spells_data.go @@ -287,6 +287,9 @@ func buildSpellList() []SpellDefinition { {ID: "animate_dead", Name: "Animate Dead", Level: 3, School: "necromancy", Classes: mageCleric, Effect: EffectUtility, CastTime: CastAction, Description: "Three nearby corpses sit up and look at you for orders. Frowned upon at parties; useful in dungeons."}, + {ID: "blink", Name: "Blink", Level: 3, School: "transmutation", + Classes: mage, Effect: EffectUtility, CastTime: CastAction, + Description: "You flicker in and out of reality at random. Foes swing at empty air half the time."}, // ── 3rd level — Cleric ──────────────────────────────────────────────── {ID: "spirit_guardians", Name: "Spirit Guardians", Level: 3, School: "conjuration", diff --git a/internal/plugin/dnd_spells_prose_test.go b/internal/plugin/dnd_spells_prose_test.go index d831138..4545f3d 100644 --- a/internal/plugin/dnd_spells_prose_test.go +++ b/internal/plugin/dnd_spells_prose_test.go @@ -29,6 +29,7 @@ func TestSpellDescriptionsAreJargonFree(t *testing.T) { {"ability modifier", regexp.MustCompile(`(?i)ability modifier`)}, {"hit points equal to", regexp.MustCompile(`(?i)hit points equal to`)}, {"NdN dice notation", regexp.MustCompile(`\b\d+d\d+\b`)}, + {"bare die notation", regexp.MustCompile(`\bd(4|6|8|10|12|20|100)\b`)}, } for id, s := range dndSpellRegistry {