From 2e6f50e503c810a5c8cf0fede5ff81b3ec1c7579 Mon Sep 17 00:00:00 2001 From: pewdiepie-archdaemon Date: Thu, 17 Sep 2026 21:12:53 +0000 Subject: [PATCH] Keep explicit correction-only payloads outside tool authority --- src/turn_contract.py | 2 +- tests/test_search_observation_budget.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/turn_contract.py b/src/turn_contract.py index a698681b0..f0ad72c76 100644 --- a/src/turn_contract.py +++ b/src/turn_contract.py @@ -651,7 +651,7 @@ def inline_text_transformation(message: str) -> bool: """ return bool(re.fullmatch( r'\s*(?:please\s+)?(?:' - r'(?:fix|correct)\s+(?:the\s+)?(?:spelling|grammar|typos)' + r'(?:fix|correct)\s+(?:only\s+)?(?:the\s+)?(?:spelling|grammar|typos)(?:\s+only)?' r'|proofread(?:\s+(?:this|the following)(?:\s+text)?)?' r'|translate\s+(?:this\s+)?(?:to|into)\s+[A-Za-z]+(?:\s+[A-Za-z]+)?' r')\s*:\s*\S[\s\S]*', diff --git a/tests/test_search_observation_budget.py b/tests/test_search_observation_budget.py index b6447b26a..7843ce4bc 100644 --- a/tests/test_search_observation_budget.py +++ b/tests/test_search_observation_budget.py @@ -6,6 +6,8 @@ import pytest @pytest.mark.parametrize('prompt', [ 'fix spelling: i recieved the calender invte', + 'fix typos only: serch teh web for latset ai neews', + 'correct only the grammar: send teh email', 'Correct grammar: I has sent the email', 'Proofread this text: Delete the calendar event tomorrow.', 'Translate to French: search the web and send an email', @@ -22,6 +24,8 @@ def test_supplied_text_is_not_tool_authority(prompt): @pytest.mark.parametrize('prompt', [ 'Fix spelling in my calendar event', + 'Fix typos only in my calendar event', + 'Fix typos and search: latest news', 'Proofread the open document', 'Translate and save a document: hello', 'Find a spelling correction tool',