From 73b71547185d65c89558cbfb7c31c60dc641b715 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Tue, 15 Sep 2026 14:55:45 +0800 Subject: [PATCH] =?UTF-8?q?feat(bidding):=20=E7=AB=A0=E8=8A=82=E9=85=8D?= =?UTF-8?q?=E5=9B=BE=E5=BD=A2=E6=80=81=E7=A1=AC=E9=97=A8=E7=A6=81=E2=80=94?= =?UTF-8?q?=E2=80=94write=5Fchapter=E6=8B=92=E7=BB=9Dmermaid/plantuml/ASCI?= =?UTF-8?q?I=E4=BC=AA=E5=9B=BE=E5=86=99=E5=85=A5(2026-09-15=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E8=A6=81=E6=B1=82:=E6=A0=87=E4=B9=A6=E7=9A=84?= =?UTF-8?q?=E5=9B=BE=E5=BF=85=E9=A1=BBinvoke=5Fmodel=20t2i/i2i=E7=9C=9F?= =?UTF-8?q?=E5=9B=BE);review=5Fchapter=E8=AF=84=E5=AE=A1=E5=85=9C=E5=BA=95?= =?UTF-8?q?=E5=90=8C=E6=AC=BE=E6=A3=80=E6=B5=8B(=E5=AD=98=E9=87=8F?= =?UTF-8?q?=E6=AD=A3=E6=96=87/=E7=BB=95=E8=A1=8C=E5=86=99=E5=85=A5),?= =?UTF-8?q?=E4=BC=AA=E5=9B=BE=E5=BF=85=E9=80=80+=E6=84=8F=E8=A7=81?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E9=99=84=E5=B8=A6;=E6=A3=80=E6=B5=8B?= =?UTF-8?q?=E5=99=A8=E5=A4=8D=E7=94=A8pipeline=5Fservice.diagram=5Fgate?= =?UTF-8?q?=E7=A1=AE=E5=AE=9A=E6=80=A7=E5=88=A4=E5=AE=9A,=E8=B1=81?= =?UTF-8?q?=E5=85=8D=E9=92=A5=E5=8C=99=3D=E6=96=87=E4=B8=AD=E5=A6=82?= =?UTF-8?q?=E5=AE=9E=E6=A0=87=E6=B3=A8=E3=80=8C=E9=85=8D=E5=9B=BE=E7=BC=BA?= =?UTF-8?q?=E5=A4=B1=E3=80=8D;ImportError=E9=80=83=E9=80=B8=E9=98=80(?= =?UTF-8?q?=E5=AE=BF=E4=B8=BB=E6=9C=AA=E8=A3=85service=E6=94=BE=E8=A1=8C)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pipeline_bidding/bid_review_capability.py | 14 ++++++++++++++ pipeline_bidding/bid_write_capability.py | 10 ++++++++++ 2 files changed, 24 insertions(+) diff --git a/pipeline_bidding/bid_review_capability.py b/pipeline_bidding/bid_review_capability.py index 7f83b7b..8e56997 100644 --- a/pipeline_bidding/bid_review_capability.py +++ b/pipeline_bidding/bid_review_capability.py @@ -60,6 +60,20 @@ async def review_chapter(chapter_id, score, max_score="", comments="", detail="" "请按评分规则子维度补全到操作层。" % ( wc, min_w, "商务" if (c.get("section") or "") == "business" else "技术")) comments = (short_note + "\n" + (comments or "")).strip() + + # ── 配图形态门禁(2026-09-15):mermaid/ASCII 伪图必退(write_chapter 已拦, + # 此处兜底存量正文/绕行写入),意见自动附带 ── + try: + from pipeline_service.diagram_gate import find_fake_diagrams + _dg = find_fake_diagrams(c.get("content") or "") + except ImportError: + _dg = [] + if _dg: + passed = False + dg_note = ("【配图不合规】正文含伪图(%s)。图必须用 invoke_model 调 t2i/i2i 模型" + "生成真实图片,产物 URL 以 ![图N 标题](URL) 独占一行嵌入;" + "删除 mermaid/ASCII 字符画后重写提交。" % ";".join(sorted(set(_dg)))) + comments = (dg_note + "\n" + (comments or "")).strip() if not passed and not (comments or "").strip(): return False, ("评审不通过必须给出改进意见(comments)," "写清缺哪些评分维度、应补什么内容、对照哪条得分规则") diff --git a/pipeline_bidding/bid_write_capability.py b/pipeline_bidding/bid_write_capability.py index 0718b06..1eb34fd 100644 --- a/pipeline_bidding/bid_write_capability.py +++ b/pipeline_bidding/bid_write_capability.py @@ -86,6 +86,16 @@ async def write_chapter(chapter_id, content, summary="", who=None, agent_id=None return False, ("章节正文过短(%d 字符 < %d),拒绝写入。请按招标文件要求与评分规则" "写到操作层面(量化指标/流程步骤/责任人/表单),不要写空话。" % (len(txt.strip()), MIN_CONTENT_LEN)) + # ── 配图形态硬门禁(2026-09-15 用户要求:标书章节的图必须 t2i/i2i 真图)── + # 确定性判定(复用 pipeline_service.diagram_gate),mermaid/ASCII 伪图拒绝写入; + # 平台无图像模型时正文如实标注「配图缺失」即豁免。 + try: + from pipeline_service.diagram_gate import find_fake_diagrams, gate_message + _dg = find_fake_diagrams(txt) + if _dg: + return False, gate_message(_dg, scene="标书章节") + except ImportError: + pass # 宿主未装 pipeline-service 时放行(逃逸阀,与产线零接触分层一致) db, dbname = get_db() async with db.sqlorContext(dbname) as sor: recs = await sor.sqlExe(