feat(qa-ops): 完成复检留档与人工复核闭环
治理侧保存输入观测版本、自动复检及人工复核历史,输入变化失效、版本冲突和幂等重放不覆盖人工记录。批量质量数量使用完整筛选元数据,未采集原文不伪造快照,延迟旧扫描不回退新输入。 验证:全仓 make verify 退出码0,Go656及前端253通过;五包竞态、源/组织/质量隔离PG、真实只读源和隔离网页读回复核通过。默认91个可选集成跳过不计通过。未接AI模型,不写DobotAI源库,未推送、未合并、未部署。
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { parseQAQuality } from './qaQuality'
|
||||
import type { QAQuality } from './qaQuality'
|
||||
export const qaColumns = [
|
||||
{ key: 'question_chinese', label: '中文问题' },
|
||||
{ key: 'answer', label: 'AI答案' },
|
||||
@@ -69,6 +71,7 @@ export function mergeQAPages(current: QARecordPage, next: QARecordPage): QARecor
|
||||
}
|
||||
}
|
||||
export interface QARecord {
|
||||
quality?: QAQuality
|
||||
organization?: QARecordOrganization
|
||||
id: string
|
||||
status: string
|
||||
@@ -145,6 +148,7 @@ export function parseQARecord(value: unknown): QARecord {
|
||||
const askerValue = text(feedback.asker_value)
|
||||
if (!['', 'up', 'down'].includes(askerValue)) return invalid()
|
||||
const item: QARecord = {
|
||||
...(row.quality === undefined ? {} : { quality: parseQAQuality(row.quality) }),
|
||||
id: text(row.id),
|
||||
status: text(row.status),
|
||||
question: text(row.question),
|
||||
@@ -279,6 +283,24 @@ export async function fetchQAStatus(signal?: AbortSignal): Promise<QAStatus> {
|
||||
}
|
||||
|
||||
export function qaCellValue(item: QARecord, column: QAColumn): string | null {
|
||||
const f = item.quality?.effective
|
||||
if (f) {
|
||||
if (column === 'coverage')
|
||||
return f.coverage
|
||||
? (
|
||||
{ covered: '是', uncovered: '否', partial: '部分覆盖', pending: '待确认', excluded: '不计入' } as Record<
|
||||
string,
|
||||
string
|
||||
>
|
||||
)[f.coverage]
|
||||
: null
|
||||
if (column === 'is_correct')
|
||||
return f.correctness
|
||||
? ({ correct: '是', incorrect: '否', pending: '待确认' } as Record<string, string>)[f.correctness]
|
||||
: null
|
||||
if (column === 'product_category' || column === 'problem_type' || column === 'root_cause') return f[column] || null
|
||||
}
|
||||
|
||||
if (column === 'coverage') return item.coverage.verdict === 'uncovered' ? '否' : null
|
||||
if (column === 'is_correct') return typeof item.is_correct === 'boolean' ? (item.is_correct ? '是' : '否') : null
|
||||
if (column === 'feedback') {
|
||||
|
||||
Reference in New Issue
Block a user