feat(server): 参考 BidEngine 补五项:原因码、截断重跑、项目信息逐项表态、占位符、提示词规则对应校验
- 待确认记原因码(extract.FAILURES,存在 ai_values.failures),解析结果按原因计数 (verify_failures);前端待确认条目显示具体原因 - 相邻分块重叠约 800 字;模型输出被截断或不是合法 JSON 时对半重跑(最多 3 层), 拆到底仍不完整记 output_incomplete。修复:以前截断时整块条目被当成「没有结果」悄悄丢掉 - 项目基本信息提示词 v2:12 个字段逐项表态 found / ambiguous / not_found,跨分块合并为 found / absent / needs_review(info_fields) - 「____元」「××」「( )」「待填」等占位符不算取值 - 提示词 substantive v4,qualification / scoring / schedule / tech_param v3:每条禁止事项 对应一个原因码,对照表在 prompts/README.md - 顾问(Fable)深读参考项目的结论补进 ref-bid-engine-analysis.md §5;架构 §13 SK12 - 待确认:国动 4 → 2,S02 13 → 3,S06 57 → 55 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
import { computed } from "vue";
|
||||
import CitationBlock from "./CitationBlock.vue";
|
||||
import { groupCitations, type CitationGroup } from "@/lib/citations";
|
||||
import { category, IMPORTANCE_MARK, IMPORTANCE_NAME, pendingReason, specFacts } from "@/lib/labels";
|
||||
import { category, failureText, IMPORTANCE_MARK, IMPORTANCE_NAME, pendingReason, specFacts } from "@/lib/labels";
|
||||
import type { ChecklistItem } from "@/lib/queries";
|
||||
|
||||
const props = defineProps<{ item: ChecklistItem; pending?: boolean; selected?: boolean; activeCitation?: string | null }>();
|
||||
@@ -36,7 +36,7 @@ const facts = computed(() => specFacts(props.item.spec));
|
||||
<span v-else class="tag">{{ item.origin_label || (item.origin === "human" ? "人工添加" : "规则") }}</span>
|
||||
<span v-for="c in item.categories" :key="c" class="tag">{{ category(c) }}</span>
|
||||
<span class="tag">{{ item.lot_no ? `采购包 ${item.lot_no}` : "通用" }}</span>
|
||||
<span v-if="pending && item.pending_reason" class="flag">{{ pendingReason(item.pending_reason) }}</span>
|
||||
<span v-if="pending && item.pending_reason" class="flag">{{ [pendingReason(item.pending_reason), failureText(item.ai_values)].filter(Boolean).join(" · ") }}</span>
|
||||
<span v-if="item.no_citation_ack" class="flag">人工确认、无出处</span>
|
||||
<span v-if="item.edited_fields.length" class="flag">已修改</span>
|
||||
</div>
|
||||
|
||||
@@ -53,6 +53,32 @@ export const PENDING_REASON: Dict<Schemas["PendingReason"]> = {
|
||||
};
|
||||
export const pendingReason = (s: string | null | undefined) => pick(PENDING_REASON, s);
|
||||
|
||||
/** 没通过校验的具体原因(服务端 checklist/extract.py 的 FAILURES,记在 ai_values.failures) */
|
||||
export const FAILURE: Record<string, string> = {
|
||||
evidence_missing: "没有给出处",
|
||||
sid_format: "句子编号格式不对",
|
||||
sid_unknown: "句子编号对不上",
|
||||
quote_too_short: "引文太短",
|
||||
quote_not_original: "引文和原文不一致",
|
||||
basis_unmatched: "原文里找不到实质性条款的依据",
|
||||
value_unverified: "取值在原文里找不到",
|
||||
points_unverified: "分值在原文里找不到",
|
||||
date_unverified: "日期时间在原文里找不到",
|
||||
amount_unverified: "金额在原文里找不到",
|
||||
placeholder_value: "原文这里是待填写的空白",
|
||||
marker_uncovered: "",
|
||||
};
|
||||
/** 待确认条目的具体原因,最多列两条;和 pending_reason 重复的不再写 */
|
||||
export function failureText(aiValues: unknown): string {
|
||||
const fs = (aiValues as { failures?: unknown } | null)?.failures;
|
||||
if (!Array.isArray(fs)) return "";
|
||||
return fs
|
||||
.map((f) => FAILURE[String(f)] ?? "")
|
||||
.filter(Boolean)
|
||||
.slice(0, 2)
|
||||
.join("、");
|
||||
}
|
||||
|
||||
/* ---------- 修改记录(审计事件) ---------- */
|
||||
export const HISTORY_ACTION: Record<string, string> = {
|
||||
"checklist_item.extract": "AI 提取",
|
||||
|
||||
Reference in New Issue
Block a user