diff --git a/src/polygateway/__init__.py b/src/polygateway/__init__.py index b7b1f9e..fb1c1ad 100644 --- a/src/polygateway/__init__.py +++ b/src/polygateway/__init__.py @@ -22,7 +22,12 @@ from polygateway.errors import ( ) from polygateway.ocr import OcrClient from polygateway.pricing import ModelPrice, PricingTable -from polygateway.providers import DEFAULT_PROFILES, ProviderProfile, register_provider +from polygateway.providers import ( + DEFAULT_PROFILES, + ProviderProfile, + ThinkingWire, + register_provider, +) from polygateway.telemetry.schema import telemetry_schema_sql from polygateway.thinking import ( ThinkingCapability, diff --git a/tests/unit/test_package.py b/tests/unit/test_package.py index 7730a97..52866a4 100644 --- a/tests/unit/test_package.py +++ b/tests/unit/test_package.py @@ -66,6 +66,7 @@ def test_thinking_public_surface_exported(): "ThinkingCapability", "ThinkingObservation", "ThinkingUnsupportedError", + "ThinkingWire", "get_capability", "register_capability", "resolve_thinking", @@ -74,3 +75,14 @@ def test_thinking_public_surface_exported(): assert name in polygateway.__all__, name assert "observe_thinking" not in polygateway.__all__ assert "reconcile_thinking" not in polygateway.__all__ + + +def test_every_promised_export_is_actually_importable(): + """`__all__` 里的每个名字都必须真的绑在包上。 + + 只维护 `__all__` 而漏掉 import,`from polygateway import X` 与 `import *` + 都会当场炸,而逐个点名的用例只覆盖它当时想到的符号——2026-09-04 的 + `ThinkingWire` 正是这样漏进来的(在 `__all__` 里躺了一个提交却 import 不到)。 + """ + missing = [name for name in polygateway.__all__ if not hasattr(polygateway, name)] + assert not missing, f"__all__ 承诺了但没绑上的符号: {missing}"