From 4b59d06479bd8f223e5bfd603e8b4e4c1b0730dd Mon Sep 17 00:00:00 2001 From: mARTin-B78 Date: Sun, 20 Sep 2026 16:13:50 +0200 Subject: [PATCH] fix(characters): map tricorn hats to a period helm in image prompts Co-Authored-By: Claude Sonnet 5 --- routes/conversation.py | 1 + tests/test_character_identity.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/routes/conversation.py b/routes/conversation.py index 4621cde..a9a1680 100644 --- a/routes/conversation.py +++ b/routes/conversation.py @@ -1740,6 +1740,7 @@ _PERIOD_WORDING = ( (r"jacken?\b|jacket\w*", "wool tunic"), (r"westen?\b|waistcoat\w*|vest\b", "sleeveless leather jerkin"), (r"schals?\b|scarf|scarves", "wool neck-wrap"), + (r"dreispitz\w*|dreimaster|tricorn\w*|dreieckshut|three-cornered hat", "plain iron helm"), (r"h[üu]te?\b(?!\w)|\bhats?\b", "soft wool hood"), (r"sporen|spurs?", "stitched leather boots"), (r"hosen?\b|trousers|pants", "wool leggings"), diff --git a/tests/test_character_identity.py b/tests/test_character_identity.py index 3b91039..67197c8 100644 --- a/tests/test_character_identity.py +++ b/tests/test_character_identity.py @@ -189,6 +189,9 @@ class PromptHygieneTests(unittest.TestCase): self.assertNotIn("blut", text.lower()) self.assertNotIn("verbunden", text.lower()) + def test_a_tricorn_hat_becomes_a_helm(self): + self.assertNotIn("dreispitz", self.facts(clothing="Rüstung mit Dreispitz").lower()) + def test_soot_and_dirt_are_not_painted_on(self): text = self.facts(physical="Wallendes Haar, rußverschmierte Backen.") self.assertIn("Wallendes Haar", text)