export const VERIFY_BLOCKS = [ ['generation', '生成'], ['selfcheck', '剧本自检'], ['conversion', '转换'], ['questions', '出题检查'], ['render', '渲染'], ] as const; export type VerifyBlock = {status: 'ok' | 'warn' | 'fail' | 'none'; summary: string; details: unknown; evidence: string[]; log_tail: string}; export type VerifySegment = {index: number; script_id: string | null; segment_id: string | null; state: string; reason: string | null; seconds: number | null; world: string; tier: string; n: string; observers: string; robots: string; checks: Record}; export type VerifyReport = {schema: 'np-verify-report/1'; run_id: string; root_alias: string; status: string; generator_commit: string | null; segments: VerifySegment[]; errors: unknown; generic_reasons: unknown; evidence: string[]}; export const VERIFY_LABELS = {ok: '已有结果', warn: '需查看', fail: '失败', none: '无记录'}; export const VERIFY_COLORS = {ok: 'ok', warn: 'warn', fail: 'bad', none: ''}; export function evidenceURL(run: string, path: string) { return '/api/v1/np/runs/' + encodeURIComponent(run) + '/file?' + new URLSearchParams({path}); } export function reviewSegmentId(report: VerifyReport, row: VerifySegment) { return row.segment_id || (row.script_id ? report.root_alias + '/' + row.script_id : null); }