refactor: share INFRA stop-reason set from core.evolution

This commit is contained in:
2026-07-16 07:18:14 -04:00
parent b3ba11c7a5
commit 6911c83d66
4 changed files with 20 additions and 10 deletions
+9
View File
@@ -199,6 +199,15 @@ def _make_all_infra_mock(log: HarnessLog, stop_reason: str):
return mock_fn, call_log
def test_infra_stop_reasons_single_source() -> None:
"""app 侧 INFRA_STOP_REASONS 复用 core 常量(同一对象),杜绝未来漂移(M-2)。"""
from app.harness import validate
from core.evolution import diagnose
assert validate.INFRA_STOP_REASONS is diagnose.INFRA_STOP_REASONS
assert frozenset({"error", "parse_error"}) == diagnose.INFRA_STOP_REASONS
# ===========================================================================
# 数据类型测试
# ===========================================================================