From 47d23e5fc7bf592b49bca577154eb80a5fb5f668 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 6 Nov 2025 21:47:31 +0000 Subject: [PATCH] fix: Update tests to reflect vocabulary improvements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed 2 failing pytest tests after vocabulary tuning: 1. test_intent_from_function_name: - "status" now maps to "wisdom" (not a separate concept) - Updated expected concepts from {"wisdom", "power", "status"} to {"wisdom", "power"} 2. test_execution_error_handling: - "log" now recognized as "wisdom" from vocabulary - Updated expected concepts from {"justice", "love", "power"} to {"justice", "love", "power", "wisdom"} All 59 pytest tests now pass ✅ All 4 standalone tests pass ✅ These changes reflect the vocabulary tuning done to reduce false positives, where boolean predicates and state-checking operations were moved from Justice to Wisdom dimension. --- tests/test_parser.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/test_parser.py b/tests/test_parser.py index b52a7d1..5463695 100644 --- a/tests/test_parser.py +++ b/tests/test_parser.py @@ -23,8 +23,8 @@ def test_intent_from_function_name(parser): Tests that concepts are correctly extracted from a function name. """ name = "get_user_by_id_and_update_status" - # 'get' -> wisdom, 'update' -> power - expected_concepts = {"wisdom", "power", "status"} + # 'get' -> wisdom, 'update' -> power, 'status' -> wisdom + expected_concepts = {"wisdom", "power"} concepts = parser.get_intent_concepts(name, None) assert set(concepts) == expected_concepts @@ -102,7 +102,8 @@ def test_execution_error_handling(parser): log_error("Division by zero") raise ValueError("Invalid operation") """ - expected_concepts = {"justice", "love", "power"} + # try -> justice, except -> love, log -> wisdom, raise -> power + expected_concepts = {"justice", "love", "power", "wisdom"} body = ast.parse(code).body _, concepts = parser.get_execution_map(body) assert set(concepts) == expected_concepts