Expose evaluation agents in the web console

This commit is contained in:
2026-06-30 14:55:46 +08:00
parent b913877929
commit 4d0c26be05
6 changed files with 189 additions and 9 deletions

View File

@@ -42,7 +42,7 @@ def _fetch(url: str, timeout: int = 5) -> dict:
return {"url": url, "error": str(exc), "passed": False}
def validate_project(run_build: bool = False) -> dict:
def validate_project(run_build: bool = False, run_acceptance: bool | None = None, run_deep: bool | None = None) -> dict:
"""Validate current runtime readiness without launching heavy training."""
checks = []
catalog = get_catalog()
@@ -140,10 +140,12 @@ def validate_project(run_build: bool = False) -> dict:
checks.append({"name": "live_coverage_api", "passed": live_coverage["passed"] and '"task_build_passed":true' in live_coverage.get("body", "").replace(" ", ""), "detail": live_coverage})
checks.append({"name": "live_training_curves_api", "passed": live_curves["passed"] and live_curves.get("body", "").lstrip().startswith("["), "detail": live_curves})
checks.append({"name": "live_frontend_index", "passed": frontend["passed"] and "Seg Data Server" in frontend.get("body", ""), "detail": frontend})
if os.getenv("SEG_VALIDATE_ACCEPTANCE", "1") == "1":
acceptance_enabled = run_acceptance if run_acceptance is not None else os.getenv("SEG_VALIDATE_ACCEPTANCE", "1") == "1"
deep_enabled = run_deep if run_deep is not None else os.getenv("SEG_VALIDATE_DEEP", "1") == "1"
if acceptance_enabled:
acceptance = run_live_acceptance(backend_url)
checks.append({"name": "live_acceptance_smoke", "passed": acceptance["passed"], "detail": acceptance})
if os.getenv("SEG_VALIDATE_DEEP", "1") == "1":
if deep_enabled:
deep_acceptance = run_deep_acceptance()
checks.append({"name": "deep_training_acceptance", "passed": deep_acceptance["passed"], "detail": deep_acceptance})