Files
HSAP/platform/as_platform/agents/graphs/ingest_flow.py
Chengfang Lu 7c43b44c57 feat: initial HSAP platform
Huaxu Sentinel Active Safety Platform with embedded algorithm code,
Docker Compose setup, and vendored dataset scaffolds for clone-and-run.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-25 16:59:59 +08:00

31 lines
1.1 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""ingest_flow感知 returned 批次 → 提交 build 审核。"""
from __future__ import annotations
from typing import Any
from as_platform.agents.tools import invoke_tool, submit_build_for_batch
from as_platform.agents.trace import start_trace, trace_span
def run_ingest_flow(*, task: str = "dam", submitted_by: str = "agent") -> dict[str, Any]:
trace_id = start_trace("ingest_flow", task=task)
with trace_span("list_pending"):
report = invoke_tool("list_pending_batches")
submitted = []
for batch in report.get("batches", []):
if batch.get("task") != task:
continue
if batch.get("stage") != "returned":
continue
with trace_span("submit_build", batch=batch.get("batch")):
apr = submit_build_for_batch(
task=task,
batch=batch["batch"],
pack=batch.get("pack") or "dms_v2",
submitted_by=submitted_by,
)
submitted.append(apr)
return {"trace_id": trace_id, "submitted": submitted, "count": len(submitted)}