"""Phase 12 site 4: _list_anthropic_models Result migration. Site 4 (L1337): try: anthropic = _require_warmed('anthropic'); ... client.models.list() ... except Exception as exc: raise _classify_anthropic_error(exc) from exc BUG: _classify_anthropic_error(exc) returns ErrorInfo (not an Exception). 'raise ErrorInfo from exc' would fail at runtime. Migrate to Result. """ import sys sys.path.insert(0, ".") def test_phase12_site4_list_anthropic_models_result_exists(): import src.ai_client assert hasattr(src.ai_client, "_list_anthropic_models_result"), \ "_list_anthropic_models_result helper missing" def test_phase12_site4_helper_returns_result(): import src.ai_client import inspect fn = src.ai_client._list_anthropic_models_result sig = inspect.signature(fn) assert "Result" in str(sig.return_annotation), \ f"_list_anthropic_models_result return must be Result, got {sig.return_annotation}" def test_phase12_site4_legacy_obliterated(): """_list_anthropic_models wrapper OBLITERATED by cruft-removal Phase 4.""" import src.ai_client assert not hasattr(src.ai_client, "_list_anthropic_models"), ( "_list_anthropic_models wrapper must be DELETED; " "callers must use _list_anthropic_models_result(...).ok directly." )