Add operator user agent and video recorder

This commit is contained in:
2026-07-01 00:44:10 +08:00
parent dcd6f7fd41
commit 1d43efd5b4
9 changed files with 502 additions and 9 deletions

View File

@@ -10,6 +10,7 @@ ROOT = Path(__file__).resolve().parents[1]
sys.path.insert(0, str(ROOT / "backend"))
from app.agents.evaluation_agent import evaluate_project # noqa: E402
from app.agents.user_agent import run_user_agent # noqa: E402
from app.agents.validation_agent import validate_project # noqa: E402
@@ -20,6 +21,7 @@ def main() -> None:
parser.add_argument("--acceptance", action="store_true", help="run the lightweight live acceptance smoke")
parser.add_argument("--real", action="store_true", help="run real workspace data acceptance through the live backend")
parser.add_argument("--real-train", action="store_true", help="run a short real workspace YOLO train/predict/heatmap acceptance")
parser.add_argument("--user", action="store_true", help="run the operator-style user agent on synthetic open data")
parser.add_argument("--no-deep", action="store_true", help="skip synthetic deep training acceptance")
parser.add_argument("--out", default="var/agent_reports/latest.json")
args = parser.parse_args()
@@ -34,11 +36,13 @@ def main() -> None:
run_deep=not args.no_deep,
),
}
if args.user:
report["user"] = run_user_agent()
out = ROOT / args.out
out.parent.mkdir(parents=True, exist_ok=True)
out.write_text(json.dumps(report, ensure_ascii=False, indent=2), encoding="utf-8")
print(json.dumps(report, ensure_ascii=False, indent=2))
if not report["evaluation"]["passed"] or not report["validation"]["passed"]:
if not report["evaluation"]["passed"] or not report["validation"]["passed"] or (args.user and not report["user"]["passed"]):
raise SystemExit(1)