Extend glossary term protection to the initial glossary LLM stage

This commit is contained in:
2026-04-22 11:15:36 -05:00
parent 183f8ba31d
commit 13b81aab2a
6 changed files with 149 additions and 6 deletions

View File

@@ -22,7 +22,10 @@ def _vocabulary():
def test_protection_blocks_replacing_protected_term():
vocabulary = _vocabulary()
assert vocabulary.violation_reason("Hrank moves.", "Frank moves.") is not None
assert (
vocabulary.violation_reason("Hrank moves.", "Frank moves.")
== "correction changes protected glossary term usage"
)
def test_protection_blocks_replacing_possessive_protected_term():
@@ -34,7 +37,10 @@ def test_protection_blocks_replacing_possessive_protected_term():
def test_protection_blocks_lowercasing_protected_term():
vocabulary = _vocabulary()
assert vocabulary.violation_reason("Hrank moves.", "hrank moves.") is not None
assert (
vocabulary.violation_reason("Hrank moves.", "hrank moves.")
== "correction changes protected glossary term capitalization"
)
def test_protection_blocks_noncanonical_uppercase_protected_term():