Add real workspace acceptance

This commit is contained in:
2026-06-30 17:33:15 +08:00
parent 4eb9452760
commit 53b81dd04d
11 changed files with 418 additions and 18 deletions

View File

@@ -102,6 +102,12 @@ def evaluate_project() -> dict:
"deep_acceptance_ui": "runDeepAcceptance" in frontend_text and "深度训练" in frontend_text,
"deep_yolo_heatmap_validation": "yolo_tiny_heatmap_generation" in acceptance_text,
"uploaded_yolo_workflow_acceptance": "uploaded_yolo_predict_job_runner" in acceptance_text and "uploaded_yolo_heatmap_job_runner" in acceptance_text,
"real_workspace_acceptance": "/api/acceptance/real" in backend_text
and "runRealAcceptance" in frontend_text
and "真实数据" in frontend_text
and "real_workspace_yolo_predict_job_runner" in acceptance_text
and "real_workspace_yolo_heatmap_job_runner" in acceptance_text
and "real_workspace_stack_job_runner" in acceptance_text,
"agent_api": "/api/agents/evaluate" in backend_text and "/api/agents/validate" in backend_text,
"agent_panel_ui": "runAgentValidation" in frontend_text and "评价建议" in frontend_text and "Validation Agent" in frontend_text,
"coverage_api": "/api/coverage" in backend_text and coverage["task_build_passed"],
@@ -126,7 +132,7 @@ def evaluate_project() -> dict:
if coverage["unmapped_user_scripts"]:
suggestions.append(f"Map remaining user-facing scripts: {len(coverage['unmapped_user_scripts'])}")
if not suggestions:
suggestions.append("Current platform covers the requested control-plane features, uploaded YOLO dataset train/predict/heatmap actions, live uploaded-data YOLO predict/heatmap acceptance, and synthetic deep training acceptance; next focus is a real non-synthetic dataset run.")
suggestions.append("Current platform covers the requested control-plane features, uploaded YOLO dataset train/predict/heatmap actions, live uploaded-data YOLO predict/heatmap acceptance, real workspace data acceptance, and synthetic deep training acceptance; next focus is a longer operator-run task on a full dataset.")
score = sum(1 for item in checks if item["passed"]) / max(len(checks), 1)
return {

View File

@@ -8,7 +8,7 @@ import urllib.error
import urllib.request
from pathlib import Path
from ..acceptance import run_deep_acceptance, run_live_acceptance
from ..acceptance import run_deep_acceptance, run_live_acceptance, run_real_dataset_acceptance
from ..capabilities import get_capability_matrix
from ..catalog import get_catalog
from ..config import settings
@@ -42,7 +42,12 @@ def _fetch(url: str, timeout: int = 5) -> dict:
return {"url": url, "error": str(exc), "passed": False}
def validate_project(run_build: bool = False, run_acceptance: bool | None = None, run_deep: bool | None = None) -> dict:
def validate_project(
run_build: bool = False,
run_acceptance: bool | None = None,
run_deep: bool | None = None,
run_real: bool | None = None,
) -> dict:
"""Validate current runtime readiness without launching heavy training."""
checks = []
catalog = get_catalog()
@@ -143,9 +148,13 @@ def validate_project(run_build: bool = False, run_acceptance: bool | None = None
checks.append({"name": "live_frontend_index", "passed": frontend["passed"] and "Seg Data Server" in frontend.get("body", ""), "detail": frontend})
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"
real_enabled = run_real if run_real is not None else os.getenv("SEG_VALIDATE_REAL", "0") == "1"
if acceptance_enabled:
acceptance = run_live_acceptance(backend_url)
checks.append({"name": "live_acceptance_smoke", "passed": acceptance["passed"], "detail": acceptance})
if real_enabled:
real_acceptance = run_real_dataset_acceptance(backend_url)
checks.append({"name": "real_workspace_acceptance", "passed": real_acceptance["passed"], "detail": real_acceptance})
if deep_enabled:
deep_acceptance = run_deep_acceptance()
checks.append({"name": "deep_training_acceptance", "passed": deep_acceptance["passed"], "detail": deep_acceptance})