From 6c87cd12b6110d45098b6915ac536f3fffd7872b Mon Sep 17 00:00:00 2001 From: yumoqing Date: Thu, 3 Sep 2026 18:37:32 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20start=5Fqc=E5=90=8C=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E5=BC=80=E8=BD=AE=E5=AE=88=E5=8D=AB=E2=80=94?= =?UTF-8?q?=E2=80=94=E5=B7=B2=E8=90=BD=E5=88=86=E4=B8=94=E4=BA=A7=E5=87=BA?= =?UTF-8?q?=E6=9C=AA=E6=9B=B4=E6=96=B0=E5=A4=8D=E7=94=A8=E8=AF=A5=E8=BD=AE?= =?UTF-8?q?=E4=B8=8D=E7=83=A7=E8=BD=AE=EF=BC=88doc=5Frequirements=E5=90=8C?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E8=BF=9E=E5=BC=804/5=E8=BD=AE=E5=AE=9E?= =?UTF-8?q?=E6=B5=8B=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pipeline_bidding/bid_qc_capability.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/pipeline_bidding/bid_qc_capability.py b/pipeline_bidding/bid_qc_capability.py index baba630..c834c09 100644 --- a/pipeline_bidding/bid_qc_capability.py +++ b/pipeline_bidding/bid_qc_capability.py @@ -133,6 +133,32 @@ async def start_qc(qc_type, project_id="", who=None, agent_id=None, task_id=""): "round": _lr.get("round"), "fit_score": _lr.get("fit_score"), "message": "该类型第 %s 轮已通过契合度审核(%.2f 分 > 通过分),无需重审。" "直接完成任务即可。" % (_lr.get("round"), to_float(_lr.get("fit_score")))} + # 同任务重复开轮守卫(2026-09-03):本任务已有落分记录且产出未在其后更新 → + # 复用该轮,不开新轮。根治:QC agent 对同一产出自我重试连烧轮次 + # (doc_requirements 实测:同一任务 18:08 开第4轮 5.5 分后 18:32 又开第5轮)。 + if task_id and not open_r: + my_r = await sor.sqlExe( + "SELECT id, round, fit_score, passed, updated_at FROM bid_qc_reviews " + "WHERE project_id=${p}$ AND qc_type=${t}$ AND task_id=${tid}$ " + "AND fit_score IS NOT NULL ORDER BY round DESC LIMIT 1", + {"p": project_id, "t": qc_type, "tid": task_id}) + await sor.sqlExe("COMMIT", {}) + if my_r: + _mr = rec_to_dict(my_r[0]) + rev_t = str(_mr.get("updated_at") or "") + out_rec = await sor.sqlExe( + "SELECT MAX(GREATEST(created_at, IFNULL(updated_at, created_at))) AS mt " + "FROM " + QC_OUTPUT_TABLE[qc_type] + " WHERE project_id=${p}$", + {"p": project_id}) + await sor.sqlExe("COMMIT", {}) + out_t = str(getattr(out_rec[0], 'mt', '') or '') if out_rec else "" + if not (out_t and rev_t and out_t > rev_t): + return True, {"status": "same_task_reviewed", "qc_type": qc_type, + "review_id": _mr.get("id"), "round": _mr.get("round"), + "fit_score": _mr.get("fit_score"), + "message": "本任务第 %s 轮已审核(%.2f 分)且产出未更新," + "不重复开轮。请完成本任务。" + % (_mr.get("round"), to_float(_mr.get("fit_score")))} # 空产出守卫(2026-09-02):产出被 QC 清空、重做未完成 → 不开新轮。 # 根治:QC 审核任务比分析重做任务先跑时对着空表开轮打 0 分,白白烧一轮 # (cost_benefit 实测:第2轮对着零记录表打 0.00)。