diff --git a/pipeline_bidding/bid_flow.py b/pipeline_bidding/bid_flow.py index 84d95f4..b3e395a 100644 --- a/pipeline_bidding/bid_flow.py +++ b/pipeline_bidding/bid_flow.py @@ -717,6 +717,9 @@ async def diagnose_bid_project(project_id): if not prec: return "项目不存在: %s" % project_id proj = rec_to_dict(prec[0]) + # 门禁:非 in_progress 的项目只诊断不派发(2026-09-02:诊断入口曾绕过 + # paused 排除派发任务,违反"项目 paused 零消耗"铁律) + _proj_paused = proj.get("status") not in ("in_progress", "active", "running") hts = await sor.sqlExe( "SELECT id, task_type, title, status FROM pipeline_human_tasks " "WHERE project_id=${p}$ ORDER BY created_at DESC LIMIT 20", {"p": project_id}) @@ -740,7 +743,9 @@ async def diagnose_bid_project(project_id): counts[tbl] = await _count( sor, "SELECT COUNT(*) AS c FROM " + tbl + " WHERE project_id=${p}$", {"p": project_id}) - acts = await reconcile_project(sor, project_id, proj.get("name", "")) + acts = (["skipped: 项目状态 %s(非 in_progress),只诊断不派发" % proj.get("status")] + if _proj_paused + else await reconcile_project(sor, project_id, proj.get("name", ""))) return json.dumps({ "project": proj, "counts": counts, "chapter_status": {getattr(r, "status", ""): to_int(getattr(r, "c", 0))