feat(app): add PoolStrategy Protocol to application ports

This commit is contained in:
2026-07-12 22:34:47 -04:00
parent 0d0f275134
commit cd5c9c01fb
2 changed files with 49 additions and 1 deletions
+23
View File
@@ -65,3 +65,26 @@ def test_plain_object_does_not_satisfy() -> None:
assert not isinstance(object(), LLMProvider)
assert not isinstance(object(), VLMProvider)
assert not isinstance(object(), TelemetryRecorder)
from app.ports import PoolStrategy
class TestPoolStrategyProtocol:
"""PoolStrategy Protocol runtime_checkable 验证。"""
def test_pool_strategy_is_runtime_checkable(self) -> None:
"""PoolStrategy 支持 isinstance 检查。"""
from app.harness.pools import Pools
class FakeStrategy:
def build(self, questions, correctness, config):
return Pools(
diagnosis=[], validation=[], test=[],
baseline_run_id="", baseline_val_accuracy=0.0,
)
def build_incremental(self, new_task_types, questions, correctness, config):
return {}
assert isinstance(FakeStrategy(), PoolStrategy)