feat: 查标第 1 步——上传投标分册 → 检查 → 逐条处理 → 复查沿用

后端
- check 模块:检查预览、发起、进度、取消、记录;六个阶段(准备投标文件、响应匹配、规则、证据校验、
  状态沿用、汇总);问题列表、处理、撤销、批量处理(只限提示级)。
- 每条清单项的检查结论 check_item_result(C9,迁移 0005):「已响应」也带投标原文出处;
  没有校验通过的证据不能判已响应(C3)。级别从清单项算,不让模型定;说明不写整改建议。
- 响应匹配先只有第三层:内存 BM25 检索候选句 + check.match v1 提示词,检索不到不调模型,
  漏答记 missing_answer,模型临时错误只影响那一批。
- 计费:免费版不记流水;专业版 24 小时内复查免扣(记一行 0);expected_charge 不一致时拒绝不扣点;
  失败、取消退回;投标文件读不出文字按输入问题失败、不扣点。
- 投标分册:类型(volume_kind)和版本;电子投标平台加密格式在上传时拦下。
- 解析流水线前几个阶段拆到 document/pipeline/normalize.py,解析和检查共用。
- ops 模块:反馈接口;致命问题确认无误的说明自动进误报反馈(U4)。
- SK1:Valkey 客户端短超时、SSE 连接池上限。SK2:CI 加 Gotenberg、直接跑 init-roles.sh。

前端
- 上传投标文件并检查页、查标页(进度、覆盖范围、按级别筛选、逐条处理和行内说明、撤销、原文抽屉、
  已处理、本次已解决);项目头抽成公共组件,加「查标」标签页;工作台「下一步」覆盖查标阶段。

契约、文档:openapi.yaml 加 item-results、volume_kind、coverage 字段;data-model、api-design §10、
架构 §8 / §13(SK14)、AGENTS.md 同步。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
YANG JIANKUAN
2026-11-04 11:48:10 +08:00
parent 6ab42959df
commit e499de7486
56 changed files with 3735 additions and 183 deletions

View File

@@ -1244,7 +1244,7 @@ paths:
'409':
description: |
`job_already_running`(附 `job_id`)、`quota_exhausted`、`billing_changed`(附最新的 `preview`)、
`no_parsed_tender`、`no_bid_documents`、`project_read_only`
`no_parsed_tender`、`checklist_empty`、`no_bid_documents`、`project_read_only`
content: { application/problem+json: { schema: { $ref: '#/components/schemas/Problem' } } }
/check-runs/{run_id}:
@@ -1309,6 +1309,30 @@ paths:
type: array
items: { $ref: '#/components/schemas/Finding' }
/check-runs/{run_id}/item-results:
parameters:
- $ref: '#/components/parameters/RunId'
get:
tags: [checks]
operationId: listCheckItemResults
summary: 每条清单项的检查结论(C9)
description: |
「已响应」也是 AI 结论,同样带投标侧出处、可以复核、可以反馈判断有误(红线 1、2)。
问题只为没响应好的条目生成;这里列出本批次参与检查的全部清单项。
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
required: [items]
properties:
items:
type: array
items: { $ref: '#/components/schemas/CheckItemResult' }
'404': { $ref: '#/components/responses/NotFound' }
/check-runs/{run_id}/findings/bulk-resolve:
parameters:
- $ref: '#/components/parameters/RunId'
@@ -2137,6 +2161,11 @@ components:
progress: { type: integer }
label: { type: string }
next_action: { $ref: '#/components/schemas/NextAction' }
latest_check_run_id:
oneOf:
- $ref: '#/components/schemas/Id'
- type: 'null'
description: 最近一次完成的检查(「处理致命问题」直接打开它)
updated_at: { $ref: '#/components/schemas/Timestamp' }
ProjectDetail:
allOf:
@@ -2263,13 +2292,20 @@ components:
page_count:
type: [integer, 'null']
description: PDF 能直接读出;Word 要转换后才知道,这里为 null
VolumeKind:
type: string
enum: [whole, qualification, commercial, technical, price, other]
description: 整本 / 资格证明 / 商务 / 技术 / 报价 / 其他(C8)
DocumentCreate:
type: object
required: [upload_id, role]
properties:
upload_id: { $ref: '#/components/schemas/Id' }
role: { $ref: '#/components/schemas/DocumentRole' }
volume_name: { type: string, maxLength: 40, description: '投标分册名:商务 / 技术 / 报价 / 资格证明' }
volume_name: { type: string, maxLength: 40, description: 用户自填的分册名称,不填时按分册类型显示 }
volume_kind:
$ref: '#/components/schemas/VolumeKind'
description: 投标分册类型,默认整本(C8)。只用来排序检索候选和填写「找过哪些分册」,不限制检索范围
replaces_document_id:
$ref: '#/components/schemas/Id'
description: 投标分册重新上传时填上一版的编号,生成新版本(FR-M3-01)
@@ -2282,6 +2318,10 @@ components:
label: { type: string, description: '如「招标文件」「补遗 1」「技术分册 v2」' }
seq_no: { type: integer }
volume_name: { type: [string, 'null'] }
volume_kind:
oneOf:
- $ref: '#/components/schemas/VolumeKind'
- type: 'null'
lineage_id: { $ref: '#/components/schemas/Id' }
is_latest_version: { type: boolean }
original_filename: { type: string }
@@ -2640,7 +2680,7 @@ components:
description: can_start 为 false 的原因
items:
type: string
enum: [no_parsed_tender, no_bid_documents, job_already_running, quota_exhausted, project_read_only]
enum: [no_parsed_tender, checklist_empty, no_bid_documents, job_already_running, quota_exhausted, project_read_only]
billing: { $ref: '#/components/schemas/BillingMode' }
charge: { type: integer, enum: [0, 1], description: 这次检查扣几次 }
charge_unit: { $ref: '#/components/schemas/QuotaUnit' }
@@ -2698,7 +2738,8 @@ components:
items: { $ref: '#/components/schemas/Document' }
coverage:
type: [object, 'null']
description: 查了什么、没查什么(报告首页,FR-M3-09)
description: |
查了什么、没查什么(报告首页、查标页顶部,FR-M3-09、m3-plan §2.5)。认不出、查不了、没查的都写在这里,不静默跳过。
properties:
checked:
type: array
@@ -2706,6 +2747,47 @@ components:
not_checked:
type: array
items: { type: string }
documents:
type: array
description: 本次检查的投标分册;没有文字层(扫描件)的页码
items:
type: object
properties:
id: { $ref: '#/components/schemas/Id' }
label: { type: string }
pages: { type: integer }
pages_without_text:
type: array
items: { type: integer }
chars: { type: integer }
items:
type: object
description: 清单项条数:正式清单、本次查了的、待确认区、不在所投包、没完成判断、证据没通过校验
properties:
formal: { type: integer }
checked: { type: integer }
pending_zone: { type: integer }
other_lot: { type: integer }
undetermined: { type: integer }
evidence_unverified: { type: integer }
checklist_confirmed: { type: boolean }
legal_regime:
type: object
properties:
value: { $ref: '#/components/schemas/LegalRegime' }
rules_verified: { type: boolean, description: 这套法律体系的规则是否经过样本验证(招标投标体系暂无样本) }
rule_set_version: { type: string }
prompt_versions: { type: object }
tokens:
type: object
properties:
in: { type: integer }
out: { type: integer }
model_calls: { type: integer }
verify_failures:
type: object
description: 证据没通过校验的条目数,按原因码计
additionalProperties: { type: integer }
counts:
type: [object, 'null']
properties:
@@ -2781,6 +2863,26 @@ components:
oneOf:
- $ref: '#/components/schemas/Timestamp'
- type: 'null'
CheckItemResult:
type: object
required: [checklist_item_id, verdict, layer, evidence_status, bid_citations, detail, reused]
properties:
checklist_item_id: { $ref: '#/components/schemas/Id' }
title: { type: [string, 'null'] }
verdict:
type: string
enum: [responded, not_found, negative_deviation, suspected_unmet, no_value, undetermined, scanned]
description: |
已响应 / 未找到 / 负偏离未说明 / 疑似不满足 / 未给出具体值 / 未判定(模型漏答或暂时不可用)/ 扫描件请人工核对。
没有校验通过的投标侧证据,不会是 responded(架构 §3.6)
layer: { type: string, enum: [deviation_table, rule_compare, model, retrieval], description: 结论来自哪一层(m3-plan §2.1) }
evidence_status: { type: string, enum: [verified, unverified, none] }
reason_code: { type: [string, 'null'], description: 证据没通过、漏答、模型错误等的原因码 }
bid_citations:
type: array
items: { $ref: '#/components/schemas/Citation' }
detail: { type: object, description: 响应值、模型指的页码、找过哪些分册 }
reused: { type: boolean, description: 24 小时内复查时沿用了上一次的结论(C2) }
ManualCheck:
type: object
required: [check_key, label, checked]