diff --git a/opax-mcp/test_capability_bridge.py b/opax-mcp/test_capability_bridge.py index 3605eb2..4821b5f 100644 --- a/opax-mcp/test_capability_bridge.py +++ b/opax-mcp/test_capability_bridge.py @@ -46,7 +46,7 @@ class TestCapabilityBridge(unittest.TestCase): planned_capabilities = [ c for c in list_capabilities() if c.availability == Availability.PLANNED ] - self.assertEqual(len(planned_capabilities), 17) + self.assertEqual(len(planned_capabilities), 18) planned_capability_ids = {c.id for c in planned_capabilities} self.assertIn("gitea.list_repo_files", planned_capability_ids) @@ -152,12 +152,20 @@ class TestServerIntegrationContract(unittest.TestCase): ) self.assertTrue(has_system_context_kw, "system_context is not passed to canonical_emma.run") - # 3. Preserves history=[] + # 3. Normalizes history before the canonical Emma call has_history_kw = any( - kw.arg == 'history' and isinstance(kw.value, ast.List) and not kw.value.elts + kw.arg == "history" + and isinstance(kw.value, ast.Call) + and isinstance(kw.value.func, ast.Name) + and kw.value.func.id == "_normalize_emma_history" + and len(kw.value.args) == 1 + and len(kw.value.keywords) == 0 for kw in call_to_run.keywords ) - self.assertTrue(has_history_kw, "history=[] is not preserved in call to canonical_emma.run") + self.assertTrue( + has_history_kw, + "history must be normalized via _normalize_emma_history before canonical_emma.run", + ) # 4. Preserves prompt argument structure prompt_kw = next((kw for kw in call_to_run.keywords if kw.arg == 'prompt'), None) diff --git a/opax-mcp/test_capability_registry.py b/opax-mcp/test_capability_registry.py index 5a8c0df..f8316cd 100644 --- a/opax-mcp/test_capability_registry.py +++ b/opax-mcp/test_capability_registry.py @@ -20,9 +20,9 @@ class TestCapabilityRegistry(unittest.TestCase): def setUp(self): self.capabilities = list_capabilities() - def test_registry_contains_exactly_twenty_capabilities(self): - self.assertEqual(len(self.capabilities), 20) - self.assertEqual(len(CAPABILITIES), 20) + def test_registry_contains_exactly_twenty_one_capabilities(self): + self.assertEqual(len(self.capabilities), 21) + self.assertEqual(len(CAPABILITIES), 21) def test_identifiers_are_unique(self): identifiers = [capability.id for capability in self.capabilities]