feat(v2): 完善配置中心与可替换轨迹质检并联动预审依据

This commit is contained in:
2026-10-01 17:13:02 +08:00
parent 1adbe16cb3
commit e604d177cb
42 changed files with 1285 additions and 83 deletions
+3 -3
View File
@@ -4,7 +4,7 @@ import json
from pathlib import Path
from datetime import datetime, timezone, timedelta
from services.assistant_store import transaction, initialize, get, put, listing, event, uid, now, digest, Conflict, time_event, time_listing, finish_time_event
from services import component_registry as registry, review_plan
from services import component_registry as registry, review_plan, catalog_configuration
from services.assistant_materials import demo_material, demo_assets, material, apply_candidate, FIELDS
from services.assistant_data import load_catalog
from services.assistant_model import configuration
@@ -153,7 +153,7 @@ class ProjectAssistantService(DocumentsMixin, ExperiencesMixin):
@staticmethod
def public_run(run):
return {k: v for k, v in run.items() if k not in ("identity", "components", "model_config", "experience_versions")}
return dict({k: v for k, v in run.items() if k not in ("identity", "components", "model_config", "experience_versions")}, report_template=(run.get("components", {}).get("template") or {}).get("id"))
def list_projects(self):
with self.connect() as db:
@@ -347,7 +347,7 @@ class ProjectAssistantService(DocumentsMixin, ExperiencesMixin):
project["events"] = [{"seq": r[0], **json.loads(r[1])} for r in db.execute("SELECT seq,body FROM assistant_events WHERE project_id=? ORDER BY seq DESC LIMIT 100", (project_id,))]
project["plans"] = [{"id": v["component_id"], "name": v["name"], "version": v["version"],
"audience": v.get("audience", []), "run_kind": v.get("run_kind", "pre_review"), "template": v.get("template")}
for v in listing(db, "component_version") if v["kind"] == "plan" and v["scope"] == project["data_domain"] and get(db, "release", v["component_id"])["version_id"] == v["id"]]
for v in listing(db, "component_version") if v["kind"] == "plan" and v["scope"] == project["data_domain"] and v.get("project_id") in (None,"",project_id) and catalog_configuration.available_plan(db,v) and get(db, "release", v["component_id"])["version_id"] == v["id"]]
project["timeline"] = time_listing(db, [project_id])
for item in project["timeline"]:
item["duration_hours"] = self._hours(item["started_at"], item["ended_at"])