Files
bid-doctor/server/migrations/versions/0007_check_layer_presence.py
YANG JIANKUAN 47c6a1258e feat(check): 文件要在、扫描件兜底(C10);响应方式存进清单并可改(C12)
- check/presence.py:「提供《授权委托书》」「须提交投标函」这类要求按标题里有没有这个文件名判断,不调模型。
- 扫描件兜底:要附证明材料的要求没找到、投标文件里有扫描件页时,改为提示级「可能在扫描件里,请人工核对」。
- 响应方式解析时识别、带依据句子存进 checklist.response_modes(迁移 0008);清单页显示、可改(写审计,
  重新解析不覆盖人工改过的);查标用存下来的。新接口 PUT /projects/{id}/checklist/response-modes/{category}。
- check_item_result.layer 加 presence(迁移 0007);契约同步默认接受的两种结论。

开发集 17 份:规矩投标文件的致命问题 120 → 51,致命级召回不变(22 / 32)(docs/architecture/check-eval.md §5)。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 15:53:45 +08:00

28 lines
816 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"""查标结论的来源加 presence:「文件要在」类要求按文件在不在判断,不调模型。
Revision ID: 0007
"""
from __future__ import annotations
from alembic import op
revision = "0007"
down_revision = "0006"
LAYERS = "'deviation_table', 'rule_compare', 'model', 'retrieval'"
def upgrade() -> None:
op.get_bind().exec_driver_sql(f"""
ALTER TABLE check_item_result DROP CONSTRAINT check_item_result_layer_check;
ALTER TABLE check_item_result ADD CONSTRAINT check_item_result_layer_check CHECK (layer IN ({LAYERS}, 'presence'));
""")
def downgrade() -> None:
op.get_bind().exec_driver_sql(f"""
ALTER TABLE check_item_result DROP CONSTRAINT check_item_result_layer_check;
ALTER TABLE check_item_result ADD CONSTRAINT check_item_result_layer_check CHECK (layer IN ({LAYERS}));
""")