feat(check): 同一行按单元格;业绩条款不再误跳;重复条目只合并显示(C5 修订)
- 送给模型的「同一行」在有框线的表格里按单元格分行 - 「以合同签订时间为准」不再被当成「签订合同时才交」,要附合同的业绩评分项照常查 - 重复的要求各自判断,问题接口给出 duplicate_ids,查标页同组折叠显示、一起处理 - 决策 C5 修订记入 decisions.md;开发集召回 74%、致命级 25/32 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -30,6 +30,7 @@ from bid_doctor.core.ids import uuid7
|
||||
from bid_doctor.document import citations
|
||||
from bid_doctor.document import service as documents
|
||||
from bid_doctor.document.models import SourceDocument
|
||||
from bid_doctor.document.pipeline.text_layer import norm
|
||||
from bid_doctor.identity import service as identity
|
||||
from bid_doctor.ops import service as feedback
|
||||
from bid_doctor.project import service as projects
|
||||
@@ -289,6 +290,14 @@ async def _to_api_many(s: AsyncSession, run: CheckRun, rows: list[Finding]) -> l
|
||||
cites = await citations.to_api_many(s, [link.citation_id for ls in by_finding.values() for link in ls])
|
||||
names = await identity.display_names(s, [f.resolved_by for f in rows if f.resolved_by])
|
||||
sort_keys = await checklist.sort_keys(s, [f.checklist_item_id for f in rows if f.checklist_item_id])
|
||||
# 重复的要求(决策 C5 修订):每条照常单独判断,问题类型相同、要求原文完全相同的折叠显示
|
||||
groups: dict[tuple[str, str], list[UUID]] = {}
|
||||
for f in rows:
|
||||
item = items.get(f.checklist_item_id) if f.checklist_item_id else None
|
||||
text = norm(str((item or {}).get("requirement_text") or (item or {}).get("title") or ""))
|
||||
if item and f.presence != "resolved" and len(text) >= 6:
|
||||
groups.setdefault((f.type, text), []).append(f.id)
|
||||
same = {fid: [x for x in ids if x != fid] for ids in groups.values() if len(ids) > 1 for fid in ids}
|
||||
|
||||
def api(f: Finding) -> dict[str, Any]:
|
||||
item = items.get(f.checklist_item_id) if f.checklist_item_id else None
|
||||
@@ -315,6 +324,7 @@ async def _to_api_many(s: AsyncSession, run: CheckRun, rows: list[Finding]) -> l
|
||||
"tender_citations": [cites[x.citation_id] for x in ls if x.side == "tender" and x.citation_id in cites],
|
||||
"bid_citations": [cites[x.citation_id] for x in ls if x.side == "bid" and x.citation_id in cites],
|
||||
"search_scope": f.search_scope,
|
||||
"duplicate_ids": same.get(f.id, []),
|
||||
"presence": f.presence,
|
||||
"carried_status": (f.detail or {}).get("carried_status"),
|
||||
"status": f.status,
|
||||
|
||||
Reference in New Issue
Block a user