Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

[codex] Add verification report library (#16649)

Arvin Xu6ca0deaae42e
diff --git a/apps/server/src/routers/lambda/verify.ts b/apps/server/src/routers/lambda/verify.ts
index d668cc96d81..b65d297578d 100644
--- a/apps/server/src/routers/lambda/verify.ts
+++ b/apps/server/src/routers/lambda/verify.ts
@@ -477,6 +477,35 @@ export const verifyRouter = router({
listRuns: verifyProcedure.query(async ({ ctx }) => ctx.runModel.query()),
+ listReportSummaries: verifyProcedure.query(async ({ ctx }) => {
+ const runs = await ctx.runModel.query();
+ const reports = await Promise.all(runs.map((run) => ctx.reportModel.findByRun(run.id)));
+
+ return runs.map((run, index) => {
+ const report = reports[index];
+
+ return {
+ report: report
+ ? {
+ createdAt: report.createdAt,
+ failedChecks: report.failedChecks,
+ generatedAt: report.generatedAt,
+ id: report.id,
+ overallConfidence: report.overallConfidence,
+ passedChecks: report.passedChecks,
+ reviewedByUser: report.reviewedByUser,
+ summary: report.summary,
+ totalChecks: report.totalChecks,
+ uncertainChecks: report.uncertainChecks,
+ verdict: report.verdict,
+ verifyRunId: report.verifyRunId,
+ }
+ : null,
+ run,
+ };
+ });
+ }),
+
listResultsByRun: verifyProcedure.input(verifyRunIdInputSchema).query(async ({ ctx, input }) => {
const run = await resolveVerifyRun(ctx, input.verifyRunId);
return ctx.resultModel.listByRun(run.id);
diff --git a/eslint-suppressions.json b/eslint-suppressions.json
index 1628c9f6c0c..1bfc792dffa 100644
--- a/eslint-suppressions.json
+++ b/eslint-suppressions.json
@@ -824,11 +824,6 @@
"count": 2
}
},
- "src/features/Verify/ReportViewer.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
"src/features/Verify/RunResult.tsx": {
"no-restricted-imports": {
"count": 1
diff --git a/locales/en-US/electron.json b/locales/en-US/electron.json
index 1fa906d124d..09e22d9675b 100644
--- a/locales/en-US/electron.json
+++ b/locales/en-US/electron.json
@@ -65,6 +65,7 @@
"navigation.tasks": "Tasks",
"navigation.topics": "Topics",
"navigation.unpin": "Unpin",
+ "navigation.verifyReports": "Verification Reports",
"notification.finishChatGeneration": "AI message generation completed",
"proxy.auth": "Authentication Required",
"proxy.authDesc": "If the proxy server requires a username and password",
diff --git a/locales/en-US/verify.json b/locales/en-US/verify.json
index 72257f1c7c1..ad02133baaa 100644
--- a/locales/en-US/verify.json
+++ b/locales/en-US/verify.json
@@ -39,6 +39,75 @@
"input.hint": "This goes to the next repair round as checker input — it will not appear as a chat message.",
"input.label": "Extra input for the next repair round",
"input.placeholder": "e.g. run type-check first; if it still fails, just add a risk note.",
+ "list.failedCount": "{{count}} failed",
+ "list.running": "Verifying…",
+ "report.actions.retry": "Retry",
+ "report.check.optional": "Optional",
+ "report.document.failed": "Failed to load document.",
+ "report.document.openOriginal": "Open original",
+ "report.document.view": "View document",
+ "report.error.description": "The report could not be loaded. Check your connection and try again.",
+ "report.error.title": "Unable to load report",
+ "report.evidence.count": "{{count}} evidence",
+ "report.evidence.view": "View evidence ({{count}})",
+ "report.filter.all": "All",
+ "report.filter.failed": "Failed",
+ "report.filter.passed": "Passed",
+ "report.filter.uncertain": "Uncertain",
+ "report.filterEmpty": "No checks match this filter.",
+ "report.missing.description": "Open a verification report with a valid run id.",
+ "report.missing.title": "Missing report id",
+ "report.notFound.description": "This report may have been deleted, or the link is not available to you.",
+ "report.notFound.title": "Report not found",
+ "report.scope.branch": "Branch",
+ "report.scope.commit": "Commit",
+ "report.scope.date": "Date",
+ "report.scope.entry": "Entry",
+ "report.scope.focus": "Focus",
+ "report.scope.surface": "Surface",
+ "report.sections.checks": "Checks",
+ "report.sections.details": "Details",
+ "report.sections.evidence": "Evidence",
+ "report.stats.confidence": "confidence",
+ "report.stats.failed": "failed",
+ "report.stats.passed": "passed",
+ "report.stats.total": "total",
+ "report.stats.uncertain": "uncertain",
+ "report.status.planned": "Verification is planned. The report will update when checks run.",
+ "report.status.repairing": "A repair round is running. This report refreshes automatically.",
+ "report.status.unverified": "Verification has not started yet.",
+ "report.status.verifying": "Verification is running. This report refreshes automatically.",
+ "report.titleFallback": "Verification report",
+ "report.verdict.failed": "Failed",
+ "report.verdict.passed": "Passed",
+ "report.verdict.uncertain": "Uncertain",
+ "reports.actions.refresh": "Refresh",
+ "reports.actions.retry": "Retry",
+ "reports.dateUnknown": "Date unknown",
+ "reports.empty.action": "Configure task checks",
+ "reports.empty.description": "Reports appear here after a delivery checker run finishes or a standalone verification is ingested.",
+ "reports.empty.title": "No verification reports yet",
+ "reports.error.description": "The report list could not be loaded. Try again to refresh it.",
+ "reports.error.title": "Unable to load reports",
+ "reports.noSummary": "No report summary yet.",
+ "reports.stats.failed": "failed",
+ "reports.stats.passed": "passed",
+ "reports.stats.total": "total",
+ "reports.stats.uncertain": "uncertain",
+ "reports.status.delivered": "Delivered",
+ "reports.status.failed": "Failed",
+ "reports.status.passed": "Passed",
+ "reports.status.planned": "Planned",
+ "reports.status.repairing": "Repairing",
+ "reports.status.unverified": "Unverified",
+ "reports.status.verifying": "Verifying",
+ "reports.subtitle": "Review every verification session in this workspace and reopen the evidence behind each result.",
+ "reports.title": "Verification reports",
+ "reports.untitled": "Untitled verification",
+ "reports.verdict.failed": "Failed",
+ "reports.verdict.passed": "Passed",
+ "reports.verdict.pending": "No report",
+ "reports.verdict.uncertain": "Uncertain",
"result.failed.sub": "This result is held back. The delivery checker found verification insufficient and triggered a repair.",
"result.failed.title": "Draft result",
"result.foot": "A snapshot of this run’s result — not an assistant or user message.",
@@ -56,5 +125,23 @@
"status.idle": "Delivery Checker: not generated",
"status.passed": "Delivery Checker: passed {{passed}}/{{total}}",
"status.repairing": "Delivery Checker: repairing",
- "status.verifying": "Delivery Checker: waiting for run to finish"
+ "status.verifying": "Delivery Checker: waiting for run to finish",
+ "templates.count": "{{count}} saved",
+ "templates.empty": "Save checks as a template from a task to reuse them here.",
+ "templates.savedTemplate": "Reusable verification template",
+ "templates.subtitle": "Templates are saved delivery standards. Apply them from a task checker, then every run keeps its own frozen snapshot.",
+ "templates.title": "Reusable templates",
+ "workspace.clearSearch": "Clear search",
+ "workspace.collapse": "Collapse report list",
+ "workspace.emptyDetail.description": "Pick a verification report from the list to see its verdict, checks, and evidence.",
+ "workspace.emptyDetail.title": "No report selected",
+ "workspace.expand": "Show report list",
+ "workspace.listEmpty": "Reports appear here after a checker run finishes or a report is ingested.",
+ "workspace.search": "Search reports",
+ "workspace.searchEmptyPrefix": "No reports match “",
+ "workspace.searchEmptySuffix": "”.",
+ "workspace.standardsHint": "Saved delivery standards will appear here.",
+ "workspace.tabs.reports": "Reports",
+ "workspace.tabs.standards": "Standards",
+ "workspace.title": "Verify Reports"
}
diff --git a/locales/zh-CN/electron.json b/locales/zh-CN/electron.json
index 6818ce3e414..b3694970ea9 100644
--- a/locales/zh-CN/electron.json
+++ b/locales/zh-CN/electron.json
@@ -65,6 +65,7 @@
"navigation.tasks": "任务",
"navigation.topics": "话题",
"navigation.unpin": "取消固定",
+ "navigation.verifyReports": "验证报告",
"notification.finishChatGeneration": "AI 消息已生成完毕",
"proxy.auth": "需要认证",
"proxy.authDesc": "如果代理服务器需要用户名和密码",
diff --git a/locales/zh-CN/verify.json b/locales/zh-CN/verify.json
index 9278950b3fb..429b5d41235 100644
--- a/locales/zh-CN/verify.json
+++ b/locales/zh-CN/verify.json
@@ -39,6 +39,75 @@
"input.hint": "这会作为检查器输入进入下一轮修复 —— 不会作为聊天消息显示。",
"input.label": "下一轮修复的补充输入",
"input.placeholder": "例如:先跑 type-check;若仍失败,补一条风险说明即可。",
+ "list.failedCount": "{{count}} 项未通过",
+ "list.running": "验证中…",
+ "report.actions.retry": "重试",
+ "report.check.optional": "可选",
+ "report.document.failed": "文档加载失败。",
+ "report.document.openOriginal": "打开原始文件",
+ "report.document.view": "查看文档",
+ "report.error.description": "报告加载失败,请检查网络后重试。",
+ "report.error.title": "无法加载报告",
+ "report.evidence.count": "{{count}} 条证据",
+ "report.evidence.view": "查看证据({{count}})",
+ "report.filter.all": "全部",
+ "report.filter.failed": "未通过",
+ "report.filter.passed": "已通过",
+ "report.filter.uncertain": "不确定",
+ "report.filterEmpty": "没有符合该筛选的检查项。",
+ "report.missing.description": "请使用有效的运行 ID 打开验证报告。",
+ "report.missing.title": "缺少报告 ID",
+ "report.notFound.description": "该报告可能已被删除,或当前链接不可用。",
+ "report.notFound.title": "未找到报告",
+ "report.scope.branch": "分支",
+ "report.scope.commit": "提交",
+ "report.scope.date": "日期",
+ "report.scope.entry": "入口",
+ "report.scope.focus": "重点",
+ "report.scope.surface": "范围",
+ "report.sections.checks": "检查项",
+ "report.sections.details": "详情",
+ "report.sections.evidence": "证据",
+ "report.stats.confidence": "置信度",
+ "report.stats.failed": "未通过",
+ "report.stats.passed": "通过",
+ "report.stats.total": "总数",
+ "report.stats.uncertain": "不确定",
+ "report.status.planned": "验证已规划,检查运行后报告会自动更新。",
+ "report.status.repairing": "修复轮次正在运行,本报告会自动刷新。",
+ "report.status.unverified": "验证尚未开始。",
+ "report.status.verifying": "验证正在运行,本报告会自动刷新。",
+ "report.titleFallback": "验证报告",
+ "report.verdict.failed": "未通过",
+ "report.verdict.passed": "已通过",
+ "report.verdict.uncertain": "不确定",
+ "reports.actions.refresh": "刷新",
+ "reports.actions.retry": "重试",
+ "reports.dateUnknown": "日期未知",
+ "reports.empty.action": "配置任务检查",
+ "reports.empty.description": "交付检查器完成运行,或独立验证被导入后,报告会出现在这里。",
+ "reports.empty.title": "暂无验证报告",
+ "reports.error.description": "报告列表加载失败,请重试刷新。",
+ "reports.error.title": "无法加载报告列表",
+ "reports.noSummary": "暂无报告摘要。",
+ "reports.stats.failed": "未通过",
+ "reports.stats.passed": "通过",
+ "reports.stats.total": "总数",
+ "reports.stats.uncertain": "不确定",
+ "reports.status.delivered": "已交付",
+ "reports.status.failed": "未通过",
+ "reports.status.passed": "已通过",
+ "reports.status.planned": "已规划",
+ "reports.status.repairing": "修复中",
+ "reports.status.unverified": "未验证",
+ "reports.status.verifying": "验证中",
+ "reports.subtitle": "查看当前工作区内的验证会话,并重新打开每次结果背后的证据。",
+ "reports.title": "验证报告",
+ "reports.untitled": "未命名验证",
+ "reports.verdict.failed": "未通过",
+ "reports.verdict.passed": "已通过",
+ "reports.verdict.pending": "暂无报告",
+ "reports.verdict.uncertain": "不确定",
"result.failed.sub": "本轮结果暂不交付。交付检查器判定验证不充分,已触发修复。",
"result.failed.title": "结果草稿",
"result.foot": "这是本轮运行的结果快照,不属于 assistant / user 消息。",
@@ -56,5 +125,23 @@
"status.idle": "交付检查器:未生成",
"status.passed": "交付检查器:已通过 {{passed}}/{{total}}",
"status.repairing": "交付检查器:修复中",
- "status.verifying": "交付检查器:等待运行完成"
+ "status.verifying": "交付检查器:等待运行完成",
+ "templates.count": "已保存 {{count}} 个",
+ "templates.empty": "可在任务中将检查项另存为模板,之后会显示在这里。",
+ "templates.savedTemplate": "可复用验证模板",
+ "templates.subtitle": "模板是已保存的交付标准。从任务检查器应用模板后,每次运行都会保留自己的冻结快照。",
+ "templates.title": "可复用模板",
+ "workspace.clearSearch": "清除搜索",
+ "workspace.collapse": "收起报告列表",
+ "workspace.emptyDetail.description": "从左侧列表选择一份验证报告,查看其结论、检查项与证据。",
+ "workspace.emptyDetail.title": "未选择报告",
+ "workspace.expand": "显示报告列表",
+ "workspace.listEmpty": "检查器运行完成或导入报告后,报告会显示在这里。",
+ "workspace.search": "搜索报告",
+ "workspace.searchEmptyPrefix": "没有报告匹配「",
+ "workspace.searchEmptySuffix": "」。",
+ "workspace.standardsHint": "已保存的交付标准会显示在这里。",
+ "workspace.tabs.reports": "报告",
+ "workspace.tabs.standards": "标准",
+ "workspace.title": "验证报告"
}
diff --git a/packages/locales/src/default/electron.ts b/packages/locales/src/default/electron.ts
index 2387933d5ed..5869685b543 100644
--- a/packages/locales/src/default/electron.ts
+++ b/packages/locales/src/default/electron.ts
@@ -32,6 +32,7 @@ export default {
'navigation.tasks': 'Tasks',
'navigation.topics': 'Topics',
'navigation.unpin': 'Unpin',
+ 'navigation.verifyReports': 'Verification Reports',
'fleet.addColumn': 'Add column',
'fleet.createTask': 'Create task',
'fleet.reply': 'Reply',
diff --git a/packages/locales/src/default/verify.ts b/packages/locales/src/default/verify.ts
index b0600f1b87b..9bcc774ae84 100644
--- a/packages/locales/src/default/verify.ts
+++ b/packages/locales/src/default/verify.ts
@@ -47,6 +47,82 @@ export default {
'input.label': 'Extra input for the next repair round',
'input.placeholder': 'e.g. run type-check first; if it still fails, just add a risk note.',
+ 'list.failedCount': '{{count}} failed',
+ 'list.running': 'Verifying…',
+
+ 'report.actions.retry': 'Retry',
+ 'report.check.optional': 'Optional',
+ 'report.document.failed': 'Failed to load document.',
+ 'report.document.openOriginal': 'Open original',
+ 'report.document.view': 'View document',
+ 'report.error.description':
+ 'The report could not be loaded. Check your connection and try again.',
+ 'report.error.title': 'Unable to load report',
+ 'report.evidence.count': '{{count}} evidence',
+ 'report.evidence.view': 'View evidence ({{count}})',
+ 'report.filter.all': 'All',
+ 'report.filter.failed': 'Failed',
+ 'report.filter.passed': 'Passed',
+ 'report.filter.uncertain': 'Uncertain',
+ 'report.filterEmpty': 'No checks match this filter.',
+ 'report.missing.description': 'Open a verification report with a valid run id.',
+ 'report.missing.title': 'Missing report id',
+ 'report.notFound.description':
+ 'This report may have been deleted, or the link is not available to you.',
+ 'report.notFound.title': 'Report not found',
+ 'report.scope.branch': 'Branch',
+ 'report.scope.commit': 'Commit',
+ 'report.scope.date': 'Date',
+ 'report.scope.entry': 'Entry',
+ 'report.scope.focus': 'Focus',
+ 'report.scope.surface': 'Surface',
+ 'report.sections.checks': 'Checks',
+ 'report.sections.details': 'Details',
+ 'report.sections.evidence': 'Evidence',
+ 'report.stats.confidence': 'confidence',
+ 'report.stats.failed': 'failed',
+ 'report.stats.passed': 'passed',
+ 'report.stats.total': 'total',
+ 'report.stats.uncertain': 'uncertain',
+ 'report.status.planned': 'Verification is planned. The report will update when checks run.',
+ 'report.status.repairing': 'A repair round is running. This report refreshes automatically.',
+ 'report.status.unverified': 'Verification has not started yet.',
+ 'report.status.verifying': 'Verification is running. This report refreshes automatically.',
+ 'report.titleFallback': 'Verification report',
+ 'report.verdict.failed': 'Failed',
+ 'report.verdict.passed': 'Passed',
+ 'report.verdict.uncertain': 'Uncertain',
+
+ 'reports.actions.refresh': 'Refresh',
+ 'reports.actions.retry': 'Retry',
+ 'reports.dateUnknown': 'Date unknown',
+ 'reports.empty.action': 'Configure task checks',
+ 'reports.empty.description':
+ 'Reports appear here after a delivery checker run finishes or a standalone verification is ingested.',
+ 'reports.empty.title': 'No verification reports yet',
+ 'reports.error.description': 'The report list could not be loaded. Try again to refresh it.',
+ 'reports.error.title': 'Unable to load reports',
+ 'reports.noSummary': 'No report summary yet.',
+ 'reports.stats.failed': 'failed',
+ 'reports.stats.passed': 'passed',
+ 'reports.stats.total': 'total',
+ 'reports.stats.uncertain': 'uncertain',
+ 'reports.status.delivered': 'Delivered',
+ 'reports.status.failed': 'Failed',
+ 'reports.status.passed': 'Passed',
+ 'reports.status.planned': 'Planned',
+ 'reports.status.repairing': 'Repairing',
+ 'reports.status.unverified': 'Unverified',
+ 'reports.status.verifying': 'Verifying',
+ 'reports.subtitle':
+ 'Review every verification session in this workspace and reopen the evidence behind each result.',
+ 'reports.title': 'Verification reports',
+ 'reports.untitled': 'Untitled verification',
+ 'reports.verdict.failed': 'Failed',
+ 'reports.verdict.passed': 'Passed',
+ 'reports.verdict.pending': 'No report',
+ 'reports.verdict.uncertain': 'Uncertain',
+
'result.failed.sub':
'This result is held back. The delivery checker found verification insufficient and triggered a repair.',
'result.failed.title': 'Draft result',
@@ -69,4 +145,27 @@ export default {
'status.passed': 'Delivery Checker: passed {{passed}}/{{total}}',
'status.repairing': 'Delivery Checker: repairing',
'status.verifying': 'Delivery Checker: waiting for run to finish',
+
+ 'templates.count': '{{count}} saved',
+ 'templates.empty': 'Save checks as a template from a task to reuse them here.',
+ 'templates.savedTemplate': 'Reusable verification template',
+ 'templates.subtitle':
+ 'Templates are saved delivery standards. Apply them from a task checker, then every run keeps its own frozen snapshot.',
+ 'templates.title': 'Reusable templates',
+
+ 'workspace.clearSearch': 'Clear search',
+ 'workspace.collapse': 'Collapse report list',
+ 'workspace.emptyDetail.description':
+ 'Pick a verification report from the list to see its verdict, checks, and evidence.',
+ 'workspace.emptyDetail.title': 'No report selected',
+ 'workspace.expand': 'Show report list',
+ 'workspace.listEmpty':
+ 'Reports appear here after a checker run finishes or a report is ingested.',
+ 'workspace.search': 'Search reports',
+ 'workspace.searchEmptyPrefix': 'No reports match “',
+ 'workspace.searchEmptySuffix': '”.',
+ 'workspace.standardsHint': 'Saved delivery standards will appear here.',
+ 'workspace.tabs.reports': 'Reports',
+ 'workspace.tabs.standards': 'Standards',
+ 'workspace.title': 'Verify Reports',
};
diff --git a/src/features/Verify/ReportViewer.tsx b/src/features/Verify/ReportViewer.tsx
index 973e0c1bad2..c089b1f9a1a 100644
--- a/src/features/Verify/ReportViewer.tsx
+++ b/src/features/Verify/ReportViewer.tsx
@@ -4,28 +4,42 @@ import type { VerifyRunContext } from '@lobechat/types';
import {
Block,
Center,
- Drawer,
+ Empty,
Flexbox,
Highlighter,
Icon,
Image,
Markdown,
- Tag,
Text,
} from '@lobehub/ui';
-import { createStyles } from 'antd-style';
-import { Check, CircleHelp, FileText, X } from 'lucide-react';
-import { memo, useState } from 'react';
+import { Button, Modal } from '@lobehub/ui/base-ui';
+import { createStaticStyles, cssVar } from 'antd-style';
+import type { TFunction } from 'i18next';
+import {
+ AlertTriangle,
+ Check,
+ ChevronRight,
+ CircleHelp,
+ Clock3,
+ FileText,
+ Paperclip,
+ RefreshCw,
+ X,
+} from 'lucide-react';
+import { memo, type ReactNode, useEffect, useMemo, useState } from 'react';
+import { useTranslation } from 'react-i18next';
import { useParams } from 'react-router';
import Loading from '@/components/Loading/BrandTextLoading';
import { useTextFileLoader } from '@/features/FileViewer/hooks/useTextFileLoader';
-import { useIsMobile } from '@/hooks/useIsMobile';
import type { VerifyEvidenceWithUrl, VerifyResultWithEvidence } from '@/services/verify';
import { getLanguageFromFilename } from '@/utils/fileLanguage';
import { useVerifyReportBundle } from './hooks';
+type Verdict = 'passed' | 'failed' | 'uncertain';
+type Filter = 'all' | Verdict;
+
/** Best-effort filename from a (possibly signed) file URL, for syntax highlighting. */
const filenameFromUrl = (url: string): string => {
try {
@@ -35,185 +49,409 @@ const filenameFromUrl = (url: string): string => {
}
};
-const useStyles = createStyles(({ css, token }) => ({
- container: css`
+const styles = createStaticStyles(({ css }) => ({
+ scroll: css`
+ overflow: auto;
width: 100%;
- max-width: 880px;
- margin-block: 0;
- margin-inline: auto;
- padding: 24px;
+ height: 100%;
`,
- containerMobile: css`
+ page: css`
width: 100%;
- max-width: 100%;
- margin-block: 0;
+ max-width: 840px;
margin-inline: auto;
- padding: 16px;
+ padding-block: 32px 64px;
+ padding-inline: 32px;
`,
- docTrigger: css`
- cursor: pointer;
+ /* hero */
+ heroLine: css`
+ display: flex;
+ flex-wrap: wrap;
+ gap: 12px;
+ align-items: center;
+ `,
+ pill: css`
+ display: inline-flex;
+ gap: 6px;
+ align-items: center;
+
+ padding-block: 5px;
+ padding-inline: 13px;
+ border-radius: 999px;
+
+ font-size: 13px;
+ font-weight: 600;
+ line-height: 1;
+ `,
+ summary: css`
+ max-width: 64ch;
+ color: ${cssVar.colorTextSecondary};
+ `,
+ meta: css`
+ display: flex;
+ flex-wrap: wrap;
+ gap: 8px 16px;
+ margin-block-start: 4px;
+ `,
+ metaItem: css`
display: inline-flex;
gap: 6px;
+ align-items: baseline;
+
+ font-size: 12px;
+ color: ${cssVar.colorTextTertiary};
+
+ code {
+ font-family: ${cssVar.fontFamilyCode};
+ font-size: 12px;
+ color: ${cssVar.colorTextSecondary};
+ word-break: break-word;
+ }
+ `,
+ liveBanner: css`
+ display: inline-flex;
+ gap: 8px;
align-items: center;
width: fit-content;
- max-width: 100%;
+ margin-block-start: 4px;
padding-block: 6px;
- padding-inline: 10px;
- border: 1px solid ${token.colorBorderSecondary};
- border-radius: ${token.borderRadius}px;
+ padding-inline: 12px;
+ border: 1px solid ${cssVar.colorInfoBorder};
+ border-radius: 999px;
- font-size: 13px;
- color: ${token.colorText};
- text-align: start;
+ font-size: 12px;
+ color: ${cssVar.colorInfoText};
+
+ background: ${cssVar.colorInfoBg};
+ `,
+
+ /* sticky filter chips */
+ stats: css`
+ position: sticky;
+ z-index: 10;
+ inset-block-start: 0;
+
+ display: flex;
+ flex-wrap: wrap;
+ gap: 8px;
+ align-items: center;
- background: ${token.colorFillQuaternary};
+ margin-block: 20px 12px;
+ padding-block: 12px;
+
+ background: color-mix(in srgb, ${cssVar.colorBgLayout} 88%, transparent);
+ backdrop-filter: blur(8px);
+ `,
+ chip: css`
+ cursor: pointer;
+
+ display: inline-flex;
+ gap: 7px;
+ align-items: center;
+
+ height: 28px;
+ padding-inline: 12px;
+ border: 1px solid ${cssVar.colorBorderSecondary};
+ border-radius: 999px;
+
+ font-size: 12px;
+ color: ${cssVar.colorTextSecondary};
+
+ background: transparent;
+
+ transition: background 0.12s ease;
+
+ b {
+ font-family: ${cssVar.fontFamilyCode};
+ font-weight: 600;
+ font-variant-numeric: tabular-nums;
+ color: ${cssVar.colorText};
+ }
&:hover {
- border-color: ${token.colorLink};
- color: ${token.colorLink};
+ background: ${cssVar.colorFillTertiary};
}
- span {
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
+ &[data-active='true'] {
+ border-color: ${cssVar.colorBorder};
+ color: ${cssVar.colorText};
+ background: ${cssVar.colorFillTertiary};
}
`,
- docViewer: css`
- overflow: auto;
- height: 100%;
- padding-block: 12px;
+ dot: css`
+ width: 7px;
+ height: 7px;
+ border-radius: 999px;
+ `,
+ score: css`
+ cursor: default;
+ margin-inline-start: auto;
+ border-color: transparent;
+ color: ${cssVar.colorTextTertiary};
+
+ b {
+ color: ${cssVar.colorTextSecondary};
+ }
+ `,
+
+ /* checks */
+ checks: css`
+ overflow: hidden;
+ border: 1px solid ${cssVar.colorBorderSecondary};
+ border-radius: ${cssVar.borderRadius};
+ background: ${cssVar.colorBgContainer};
+ `,
+ row: css`
+ border-block-end: 1px solid ${cssVar.colorBorderSecondary};
+
+ &:last-child {
+ border-block-end: none;
+ }
+ `,
+ rowHead: css`
+ cursor: pointer;
+
+ display: grid;
+ grid-template-columns: 20px minmax(0, 1fr) auto;
+ gap: 10px;
+ align-items: center;
+
+ width: 100%;
+ padding-block: 11px;
padding-inline: 16px;
+ border: none;
+
+ text-align: start;
+
+ background: none;
+
+ &:hover {
+ background: ${cssVar.colorFillQuaternary};
+ }
+ `,
+ rowTitle: css`
+ overflow: hidden;
+
+ font-size: 14px;
+ color: ${cssVar.colorText};
+ text-overflow: ellipsis;
+ white-space: nowrap;
+
+ &[data-failed='true'] {
+ font-weight: 600;
+ }
+ `,
+ rowSide: css`
+ display: flex;
+ gap: 8px;
+ align-items: center;
+ `,
+ softTag: css`
+ padding-block: 1px;
+ padding-inline: 7px;
+ border-radius: 4px;
+
+ font-size: 12px;
+ color: ${cssVar.colorTextTertiary};
+
+ background: ${cssVar.colorFillTertiary};
+ `,
+ chev: css`
+ color: ${cssVar.colorTextQuaternary};
+ transition: transform 0.15s ease;
+
+ &[data-open='true'] {
+ transform: rotate(90deg);
+ }
+ `,
+ rowBody: css`
+ display: flex;
+ flex-direction: column;
+ gap: 12px;
+
+ padding-block: 2px 16px;
+ padding-inline: 46px 16px;
+ `,
+ reasoning: css`
+ max-width: 70ch;
+ font-size: 13px;
+ line-height: 1.6;
+ color: ${cssVar.colorTextSecondary};
+ `,
+ suggestion: css`
+ max-width: 70ch;
+ padding-inline-start: 10px;
+ border-inline-start: 2px solid ${cssVar.colorBorder};
+
+ font-size: 13px;
+ line-height: 1.6;
+ color: ${cssVar.colorTextSecondary};
+ `,
+
+ /* narrative */
+ narrative: css`
+ margin-block-start: 24px;
+ `,
+ narrativeSummary: css`
+ cursor: pointer;
+ user-select: none;
+
+ display: inline-flex;
+ gap: 6px;
+ align-items: center;
+
+ font-size: 12px;
+ color: ${cssVar.colorTextTertiary};
+ list-style: none;
+
+ &::-webkit-details-marker {
+ display: none;
+ }
+
+ &:hover {
+ color: ${cssVar.colorText};
+ }
`,
+ narrativeBody: css`
+ margin-block-start: 12px;
+ padding: 16px;
+ border: 1px solid ${cssVar.colorBorderSecondary};
+ border-radius: ${cssVar.borderRadius};
+
+ background: ${cssVar.colorBgContainer};
+ `,
+
+ /* evidence */
evidenceText: css`
overflow: auto;
max-height: 200px;
padding-block: 8px;
padding-inline: 12px;
- border-radius: ${token.borderRadius}px;
+ border-radius: ${cssVar.borderRadius};
- font-family: ${token.fontFamilyCode};
+ font-family: ${cssVar.fontFamilyCode};
font-size: 12px;
white-space: pre-wrap;
- background: ${token.colorFillQuaternary};
+ background: ${cssVar.colorFillQuaternary};
`,
evidenceVideo: css`
align-self: flex-start;
width: auto;
max-width: 100%;
- height: auto;
max-height: 360px;
- border: 1px solid ${token.colorBorderSecondary};
- border-radius: ${token.borderRadiusLG}px;
+ border: 1px solid ${cssVar.colorBorderSecondary};
+ border-radius: ${cssVar.borderRadiusLG};
object-fit: contain;
`,
- resultCard: css`
- padding-block: 10px;
- padding-inline: 14px;
- border: 1px solid ${token.colorBorderSecondary};
- border-radius: ${token.borderRadiusLG}px;
+ evidenceTrigger: css`
+ cursor: pointer;
- background: ${token.colorBgContainer};
- `,
- scopeBlock: css`
- padding-block: 10px;
- padding-inline: 14px;
- border: 1px solid ${token.colorBorderSecondary};
- border-radius: ${token.borderRadiusLG}px;
+ display: inline-flex;
+ gap: 6px;
+ align-items: center;
+
+ width: fit-content;
+ max-width: 100%;
+ padding-block: 5px;
+ padding-inline: 10px;
+ border: 1px solid ${cssVar.colorBorderSecondary};
+ border-radius: 4px;
+
+ font-size: 13px;
+ color: ${cssVar.colorTextSecondary};
+
+ background: ${cssVar.colorFillQuaternary};
- background: ${token.colorFillQuaternary};
+ &:hover {
+ border-color: ${cssVar.colorLink};
+ color: ${cssVar.colorLink};
+ }
`,
- scopeKey: css`
- flex-shrink: 0;
+ evChip: css`
+ display: inline-flex;
+ gap: 4px;
+ align-items: center;
- width: 56px;
+ padding-block: 1px;
+ padding-inline: 6px;
+ border-radius: 999px;
+ font-family: ${cssVar.fontFamilyCode};
font-size: 12px;
- line-height: 20px;
- color: ${token.colorTextTertiary};
+ font-variant-numeric: tabular-nums;
+ color: ${cssVar.colorTextTertiary};
+
+ background: ${cssVar.colorFillTertiary};
`,
- scopeValue: css`
- font-family: ${token.fontFamilyCode};
- font-size: 12px;
- line-height: 20px;
- color: ${token.colorTextSecondary};
- word-break: break-word;
+ evidenceDoc: css`
+ overflow: hidden;
+
+ width: 100%;
+ height: 320px;
+ border: 1px solid ${cssVar.colorBorderSecondary};
+ border-radius: ${cssVar.borderRadius};
`,
- stat: css`
- font-size: 20px;
- font-weight: 700;
- font-variant-numeric: tabular-nums;
+ docViewer: css`
+ overflow: auto;
+ height: 100%;
+ padding-block: 12px;
+ padding-inline: 16px;
`,
}));
-const VERDICT_META = {
- failed: { color: 'error', icon: X, label: 'Failed' },
- passed: { color: 'success', icon: Check, label: 'Passed' },
- uncertain: { color: 'warning', icon: CircleHelp, label: 'Uncertain' },
-} as const;
+const VERDICT_META: Record<
+ Verdict,
+ { bg: string; color: string; dot: string; icon: typeof Check; labelKey: string }
+> = {
+ failed: {
+ bg: cssVar.colorErrorBg,
+ color: cssVar.colorErrorText,
+ dot: cssVar.colorError,
+ icon: X,
+ labelKey: 'report.verdict.failed',
+ },
+ passed: {
+ bg: cssVar.colorSuccessBg,
+ color: cssVar.colorSuccessText,
+ dot: cssVar.colorSuccess,
+ icon: Check,
+ labelKey: 'report.verdict.passed',
+ },
+ uncertain: {
+ bg: cssVar.colorWarningBg,
+ color: cssVar.colorWarningText,
+ dot: cssVar.colorWarning,
+ icon: CircleHelp,
+ labelKey: 'report.verdict.uncertain',
+ },
+};
const imageEvidenceTypes = new Set(['gif', 'screenshot']);
+const terminalRunStatuses = new Set(['delivered', 'failed', 'passed']);
+const liveStatusLabelKey = {
+ planned: 'report.status.planned',
+ repairing: 'report.status.repairing',
+ unverified: 'report.status.unverified',
+ verifying: 'report.status.verifying',
+} as const;
-const VerdictTag = memo<{ verdict?: string | null }>(({ verdict }) => {
- const meta = VERDICT_META[(verdict ?? 'uncertain') as keyof typeof VERDICT_META];
- if (!meta) return null;
- return (
- <Tag color={meta.color} icon={<Icon icon={meta.icon} />}>
- {meta.label}
- </Tag>
- );
-});
-
-/** A single labelled row in the scope header (e.g. "Branch docs/foo"). */
-const ScopeRow = memo<{ label: string; value?: string | null }>(({ label, value }) => {
- const { styles } = useStyles();
- if (!value) return null;
- return (
- <Flexbox horizontal gap={8}>
- <span className={styles.scopeKey}>{label}</span>
- <span className={styles.scopeValue}>{value}</span>
- </Flexbox>
- );
-});
-
-/**
- * Scope header — the report's "范围" block. Rendered per `scenario`; today only
- * `coding` (branch / commit / surfaces / …). Returns null when there's nothing
- * to show so the page stays clean for runs without context.
- */
-const ScopeBlock = memo<{ context?: VerifyRunContext | null; scenario?: string | null }>(
- ({ context, scenario }) => {
- const { styles } = useStyles();
- if (scenario !== 'coding' || !context) return null;
-
- const { branch, commit, surfaces, entry, focus, testedAt } = context;
- const date = testedAt ? new Date(testedAt).toLocaleString() : undefined;
- const surface = surfaces && surfaces.length > 0 ? surfaces.join(' / ') : undefined;
- if (!branch && !commit && !surface && !entry && !focus && !date) return null;
+/** Severity-first sort: failed → uncertain → passed. */
+const SEVERITY_RANK: Record<Verdict, number> = { failed: 0, passed: 2, uncertain: 1 };
- return (
- <Block className={styles.scopeBlock} gap={2}>
- <ScopeRow label="Focus" value={focus} />
- <ScopeRow label="Branch" value={branch} />
- <ScopeRow label="Surface" value={surface} />
- <ScopeRow label="Date" value={date} />
- <ScopeRow label="Commit" value={commit} />
- <ScopeRow label="Entry" value={entry} />
- </Block>
- );
- },
-);
+const checkVerdict = (result: VerifyResultWithEvidence): Verdict => {
+ const v = result.verdict ?? result.status;
+ if (v === 'passed' || v === 'failed' || v === 'uncertain') return v;
+ return 'uncertain';
+};
-/** Fetches a file-backed text evidence and renders it decoded (avoids the raw
- * download's mojibake) with syntax highlighting. */
+/** A file-backed text evidence, decoded + syntax highlighted (avoids mojibake). */
const DocumentViewer = memo<{ url: string }>(({ url }) => {
- const { styles } = useStyles();
+ const { t } = useTranslation('verify');
const { fileData, loading, error } = useTextFileLoader(url);
if (loading)
@@ -226,9 +464,9 @@ const DocumentViewer = memo<{ url: string }>(({ url }) => {
if (error || fileData === null)
return (
<Center flex={1} gap={8} height={'100%'}>
- <Text type="secondary">Failed to load document.</Text>
+ <Text type="secondary">{t('report.document.failed')}</Text>
<a href={url} rel="noreferrer" target="_blank">
- Open original
+ {t('report.document.openOriginal')}
</a>
</Center>
);
@@ -247,191 +485,350 @@ const DocumentViewer = memo<{ url: string }>(({ url }) => {
);
});
-/** A file-backed (non-media) evidence — opens its decoded content in a right-side
- * detail drawer instead of navigating to the raw file. */
-const DocumentEvidence = memo<{ evidence: VerifyEvidenceWithUrl }>(({ evidence }) => {
- const { styles } = useStyles();
- const [open, setOpen] = useState(false);
- const title = evidence.description || filenameFromUrl(evidence.fileUrl!);
-
- return (
- <>
- <button className={styles.docTrigger} type={'button'} onClick={() => setOpen(true)}>
- <Icon icon={FileText} />
- <span>View document</span>
- </button>
- <Drawer
- open={open}
- styles={{ body: { padding: 0 } }}
- title={title}
- width={'min(720px, 80vw)'}
- onClose={() => setOpen(false)}
- >
- {open && <DocumentViewer url={evidence.fileUrl!} />}
- </Drawer>
- </>
- );
-});
-
-/**
- * Renders a check's evidence artifacts (screenshots / video / documents / inline
- * text). Screenshots are capped at `imageMaxHeight` and constrained to the
- * container width so a wide capture never overflows on a narrow viewport.
- */
-const EvidenceList = memo<{
- evidence: VerifyResultWithEvidence['evidence'];
- imageMaxHeight?: number;
-}>(({ evidence, imageMaxHeight = 360 }) => {
- const { styles } = useStyles();
- if (evidence.length === 0) return null;
- return (
- <Flexbox gap={8}>
+/** One evidence artifact rendered by its type: zoomable image/gif, video, doc, text. */
+const EvidenceItem = memo<{ evidence: VerifyEvidenceWithUrl }>(({ evidence: e }) => (
+ <Flexbox gap={6}>
+ {e.description && (
+ <Text fontSize={13} type={'secondary'}>
+ {e.description}
+ </Text>
+ )}
+ {e.fileUrl && imageEvidenceTypes.has(e.type) ? (
+ <Flexbox align={'flex-start'} style={{ maxWidth: '100%' }}>
+ <Image
+ preview
+ alt={e.description ?? e.type}
+ objectFit={'contain'}
+ src={e.fileUrl}
+ style={{ maxWidth: '100%' }}
+ variant={'outlined'}
+ />
+ </Flexbox>
+ ) : e.fileUrl && e.type === 'video' ? (
+ <video controls className={styles.evidenceVideo} src={e.fileUrl} />
+ ) : e.fileUrl ? (
+ <div className={styles.evidenceDoc}>
+ <DocumentViewer url={e.fileUrl} />
+ </div>
+ ) : e.content ? (
+ <div className={styles.evidenceText}>{e.content}</div>
+ ) : (
+ <span className={styles.softTag}>{e.type}</span>
+ )}
+ </Flexbox>
+));
+
+/** Modal gallery of one check's evidence — one section per artifact, by type. */
+const EvidenceModal = memo<{
+ evidence: VerifyEvidenceWithUrl[];
+ onClose: () => void;
+ open: boolean;
+ title: string;
+}>(({ evidence, onClose, open, title }) => (
+ <Modal
+ footer={null}
+ open={open}
+ title={title}
+ width={'min(760px, 92vw)'}
+ onCancel={() => onClose()}
+ >
+ <Flexbox gap={20} style={{ maxHeight: '68vh', overflow: 'auto', paddingBlock: 4 }}>
{evidence.map((e) => (
- <Flexbox gap={4} key={e.id}>
- {e.description && (
- <Text fontSize={12} type="secondary">
- {e.description}
- </Text>
- )}
- {e.fileUrl && imageEvidenceTypes.has(e.type) ? (
- <Flexbox align={'flex-start'} style={{ maxWidth: '100%' }}>
- <Image
- alt={e.description ?? e.type}
- maxHeight={imageMaxHeight}
- objectFit={'contain'}
- src={e.fileUrl}
- style={{ maxWidth: '100%' }}
- variant={'outlined'}
- />
- </Flexbox>
- ) : e.fileUrl && e.type === 'video' ? (
- <video controls className={styles.evidenceVideo} src={e.fileUrl} />
- ) : e.fileUrl ? (
- <DocumentEvidence evidence={e} />
- ) : e.content ? (
- <div className={styles.evidenceText}>{e.content}</div>
- ) : (
- <Tag>{e.type}</Tag>
- )}
- </Flexbox>
+ <EvidenceItem evidence={e} key={e.id} />
))}
</Flexbox>
- );
-});
+ </Modal>
+));
+
+/** One check — an expandable row; evidence opens in a per-check modal gallery. */
+const CheckRow = memo<{ defaultOpen: boolean; result: VerifyResultWithEvidence }>(
+ ({ defaultOpen, result }) => {
+ const { t } = useTranslation('verify');
+ const [open, setOpen] = useState(defaultOpen);
+ const [evidenceOpen, setEvidenceOpen] = useState(false);
+ const verdict = checkVerdict(result);
+ const meta = VERDICT_META[verdict];
+ const evidenceCount = result.evidence.length;
+ const hasBody =
+ Boolean(result.toulmin?.evidence) || Boolean(result.suggestion) || evidenceCount > 0;
+
+ return (
+ <div className={styles.row}>
+ <button
+ className={styles.rowHead}
+ type={'button'}
+ onClick={() => hasBody && setOpen((o) => !o)}
+ >
+ <span style={{ color: meta.dot, display: 'flex' }}>
+ <Icon icon={meta.icon} size={16} />
+ </span>
+ <span className={styles.rowTitle} data-failed={verdict === 'failed'}>
+ {result.checkItemTitle || result.checkItemId}
+ </span>
+ <span className={styles.rowSide}>
+ {evidenceCount > 0 && (
+ <span
+ className={styles.evChip}
+ title={t('report.evidence.count', { count: evidenceCount })}
+ >
+ <Icon icon={Paperclip} size={12} />
+ {evidenceCount}
+ </span>
+ )}
+ {!result.required && (
+ <span className={styles.softTag}>{t('report.check.optional')}</span>
+ )}
+ {hasBody && (
+ <Icon className={styles.chev} data-open={open} icon={ChevronRight} size={14} />
+ )}
+ </span>
+ </button>
+ {open && hasBody && (
+ <div className={styles.rowBody}>
+ {result.toulmin?.evidence && (
+ <p className={styles.reasoning}>{result.toulmin.evidence}</p>
+ )}
+ {result.suggestion && <p className={styles.suggestion}>{result.suggestion}</p>}
+ {evidenceCount > 0 && (
+ <>
+ <button
+ className={styles.evidenceTrigger}
+ type={'button'}
+ onClick={() => setEvidenceOpen(true)}
+ >
+ <Icon icon={Paperclip} size={13} />
+ {t('report.evidence.view', { count: evidenceCount })}
+ </button>
+ <EvidenceModal
+ evidence={result.evidence}
+ open={evidenceOpen}
+ title={result.checkItemTitle || t('report.sections.evidence')}
+ onClose={() => setEvidenceOpen(false)}
+ />
+ </>
+ )}
+ </div>
+ )}
+ </div>
+ );
+ },
+);
-/** A single check — a stacked card with its title, verdict, reasoning and evidence. */
-const ResultCard = memo<{ result: VerifyResultWithEvidence }>(({ result }) => {
- const { styles } = useStyles();
+const ReportPageState = memo<{
+ action?: ReactNode;
+ description: string;
+ icon: typeof AlertTriangle;
+ title: string;
+}>(({ action, description, icon, title }) => (
+ <Center gap={16} height={'100%'} style={{ minHeight: '70vh' }} width={'100%'}>
+ <Empty description={description} icon={icon} title={title} />
+ {action}
+ </Center>
+));
+
+/** Build the meta row (branch / commit / surface / verified) from the run scope. */
+const scopeToMeta = (
+ context: VerifyRunContext | null | undefined,
+ scenario: string | null | undefined,
+ t: TFunction<'verify'>,
+): { label: string; value: string }[] => {
+ if (scenario !== 'coding' || !context) return [];
+ const { branch, commit, surfaces, entry, focus, testedAt } = context;
+ const surface = surfaces && surfaces.length > 0 ? surfaces.join(' / ') : undefined;
+ const date = testedAt ? new Date(testedAt).toLocaleString() : undefined;
return (
- <Block className={styles.resultCard} gap={6}>
- <Flexbox horizontal align="center" gap={8} justify="space-between">
- <Text strong>{result.checkItemTitle || result.checkItemId}</Text>
- <Flexbox horizontal align="center" gap={8}>
- {!result.required && <Tag>soft</Tag>}
- <VerdictTag verdict={result.verdict ?? result.status} />
- </Flexbox>
- </Flexbox>
- {result.toulmin?.evidence && (
- <Text fontSize={13} type="secondary">
- {result.toulmin.evidence}
- </Text>
- )}
- {result.suggestion && (
- <Text fontSize={13} type="secondary">
- {result.suggestion}
- </Text>
- )}
- <EvidenceList evidence={result.evidence} />
- </Block>
- );
-});
+ [
+ { label: t('report.scope.focus'), value: focus },
+ { label: t('report.scope.branch'), value: branch },
+ { label: t('report.scope.surface'), value: surface },
+ { label: t('report.scope.entry'), value: entry },
+ { label: t('report.scope.commit'), value: commit },
+ { label: t('report.scope.date'), value: date },
+ ] as { label: string; value?: string | null }[]
+ ).filter((m): m is { label: string; value: string } => Boolean(m.value));
+};
/**
- * Standalone viewer for a verification session's report, addressed purely by
- * `?id=<verifyRunId>` — no Agent Run / chat context required. Renders the report
- * narrative plus every check result and its evidence. Checks render as stacked
- * cards (the screenshot is the most valuable part, so it stays full-width and
- * prominent); the layout just tightens padding and wraps the stats row on
- * mobile so a narrow viewport never overflows horizontally.
+ * The report detail pane. Renders the verdict hero, a sticky verdict-filter bar,
+ * every check as a severity-ordered expandable row (failed rows open by default),
+ * and the full narrative behind a collapsed disclosure. Addressed by `:runId`;
+ * refreshes itself while the run is non-terminal.
*/
const ReportViewer = memo(() => {
- const { styles, cx } = useStyles();
- const isMobile = useIsMobile();
+ const { t } = useTranslation('verify');
const { runId } = useParams<{ runId: string }>();
const verifyRunId = runId ?? null;
- const { data, isLoading } = useVerifyReportBundle(verifyRunId);
+ const { data, error, isLoading, mutate } = useVerifyReportBundle(verifyRunId);
+ const [filter, setFilter] = useState<Filter>('all');
+
+ useEffect(() => {
+ const status = data?.run.status;
+ if (!status || terminalRunStatuses.has(status)) return;
+ const timer = window.setInterval(() => void mutate(), 5000);
+ return () => window.clearInterval(timer);
+ }, [data?.run.status, mutate]);
+
+ const ordered = useMemo(() => {
+ if (!data) return [];
+ return [...data.results].sort(
+ (a, b) => SEVERITY_RANK[checkVerdict(a)] - SEVERITY_RANK[checkVerdict(b)],
+ );
+ }, [data]);
- if (!verifyRunId)
- return <Text type="danger">Missing report id (/verify/&lt;verifyRunId&gt;).</Text>;
+ if (!verifyRunId) {
+ return (
+ <ReportPageState
+ description={t('report.missing.description')}
+ icon={AlertTriangle}
+ title={t('report.missing.title')}
+ />
+ );
+ }
if (isLoading) return <Loading debugId="verify-report-viewer" />;
- if (!data) return <Text type="danger">Report not found.</Text>;
+ if (error) {
+ return (
+ <ReportPageState
+ description={t('report.error.description')}
+ icon={X}
+ title={t('report.error.title')}
+ action={
+ <Button icon={<RefreshCw size={16} />} onClick={() => void mutate()}>
+ {t('report.actions.retry')}
+ </Button>
+ }
+ />
+ );
+ }
+ if (!data) {
+ return (
+ <ReportPageState
+ description={t('report.notFound.description')}
+ icon={FileText}
+ title={t('report.notFound.title')}
+ />
+ );
+ }
- const { run, report, results } = data;
+ const { run, report } = data;
+ const liveStatus =
+ run.status && !terminalRunStatuses.has(run.status)
+ ? (run.status as keyof typeof liveStatusLabelKey)
+ : null;
+
+ const counts = ordered.reduce(
+ (acc, r) => {
+ acc[checkVerdict(r)] += 1;
+ return acc;
+ },
+ { failed: 0, passed: 0, uncertain: 0 } as Record<Verdict, number>,
+ );
+ const total = report?.totalChecks ?? ordered.length;
+ const passed = report?.passedChecks ?? counts.passed;
+ const failed = report?.failedChecks ?? counts.failed;
+ const uncertain = report?.uncertainChecks ?? counts.uncertain;
+ const verdict = (report?.verdict as Verdict | null) ?? null;
+ const visible = filter === 'all' ? ordered : ordered.filter((r) => checkVerdict(r) === filter);
+ const meta = scopeToMeta(run.context, run.scenario, t);
+
+ const chips: { count: number; dot?: string; key: Filter; label: string }[] = [
+ { count: total, key: 'all', label: t('report.filter.all') },
+ { count: failed, dot: cssVar.colorError, key: 'failed', label: t('report.filter.failed') },
+ {
+ count: uncertain,
+ dot: cssVar.colorWarning,
+ key: 'uncertain',
+ label: t('report.filter.uncertain'),
+ },
+ { count: passed, dot: cssVar.colorSuccess, key: 'passed', label: t('report.filter.passed') },
+ ];
return (
- <Flexbox className={cx(isMobile ? styles.containerMobile : styles.container)} gap={24}>
- <Flexbox gap={12}>
- <Text as="h2">{run.title || 'Verification report'}</Text>
- {run.scenario !== 'coding' && run.goal && <Text type="secondary">{run.goal}</Text>}
- <ScopeBlock context={run.context} scenario={run.scenario} />
- {report?.summary && <Text type="secondary">{report.summary}</Text>}
- <Flexbox
- horizontal
- align="center"
- gap={isMobile ? 16 : 24}
- wrap={isMobile ? 'wrap' : 'nowrap'}
- >
- <VerdictTag verdict={report?.verdict} />
- <Flexbox>
- <span className={styles.stat}>{report?.totalChecks ?? results.length}</span>
- <Text fontSize={12} type="secondary">
- total
- </Text>
- </Flexbox>
- <Flexbox>
- <Text className={styles.stat} type="success">
- {report?.passedChecks ?? results.filter((r) => r.verdict === 'passed').length}
- </Text>
- <Text fontSize={12} type="secondary">
- passed
- </Text>
- </Flexbox>
- <Flexbox>
- <Text className={styles.stat} type="danger">
- {report?.failedChecks ?? results.filter((r) => r.verdict === 'failed').length}
+ <div className={styles.scroll}>
+ <div className={styles.page}>
+ <Flexbox gap={12}>
+ <div className={styles.heroLine}>
+ {verdict && (
+ <span
+ className={styles.pill}
+ style={{ background: VERDICT_META[verdict].bg, color: VERDICT_META[verdict].color }}
+ >
+ <Icon icon={VERDICT_META[verdict].icon} size={15} />
+ {t(`report.verdict.${verdict}`)}
+ </span>
+ )}
+ <Text as={'h1'} style={{ fontSize: 24, lineHeight: 1.3, margin: 0 }}>
+ {run.title || t('report.titleFallback')}
</Text>
- <Text fontSize={12} type="secondary">
- failed
- </Text>
- </Flexbox>
- {typeof report?.overallConfidence === 'number' && (
- <Flexbox>
- <span className={styles.stat}>{Math.round(report.overallConfidence * 100)}</span>
- <Text fontSize={12} type="secondary">
- score
- </Text>
- </Flexbox>
- )}
- </Flexbox>
- </Flexbox>
+ </div>
- <Flexbox gap={8}>
- <Text as="h3">Checks</Text>
- {results.map((r) => (
- <ResultCard key={r.id} result={r} />
- ))}
- </Flexbox>
+ {run.scenario !== 'coding' && run.goal && (
+ <Text className={styles.summary}>{run.goal}</Text>
+ )}
+ {report?.summary && <Text className={styles.summary}>{report.summary}</Text>}
+
+ {meta.length > 0 && (
+ <div className={styles.meta}>
+ {meta.map((m) => (
+ <span className={styles.metaItem} key={m.label}>
+ {m.label} <code>{m.value}</code>
+ </span>
+ ))}
+ </div>
+ )}
- {/* Narrative detail (verification commands / score / notes). The scope and
- per-check cards are already structured above, so a well-formed report
- body carries only the non-duplicate prose. */}
- {report?.content && (
- <Flexbox gap={8}>
- <Text as="h3">Details</Text>
- <Markdown>{report.content}</Markdown>
+ {liveStatus && (
+ <div className={styles.liveBanner}>
+ <Icon icon={Clock3} size={14} />
+ {t(liveStatusLabelKey[liveStatus])}
+ </div>
+ )}
</Flexbox>
- )}
- </Flexbox>
+
+ <div className={styles.stats}>
+ {chips.map((c) => (
+ <button
+ className={styles.chip}
+ data-active={filter === c.key}
+ key={c.key}
+ type={'button'}
+ onClick={() => setFilter(c.key)}
+ >
+ {c.dot && <span className={styles.dot} style={{ background: c.dot }} />}
+ {c.label} <b>{c.count}</b>
+ </button>
+ ))}
+ {typeof report?.overallConfidence === 'number' && (
+ <span className={`${styles.chip} ${styles.score}`}>
+ {t('report.stats.confidence')} <b>{Math.round(report.overallConfidence * 100)}%</b>
+ </span>
+ )}
+ </div>
+
+ {visible.length > 0 ? (
+ <div className={styles.checks}>
+ {visible.map((r) => (
+ <CheckRow defaultOpen={checkVerdict(r) === 'failed'} key={r.id} result={r} />
+ ))}
+ </div>
+ ) : (
+ <Block align={'center'} padding={24}>
+ <Text type={'secondary'}>{t('report.filterEmpty')}</Text>
+ </Block>
+ )}
+
+ {report?.content && (
+ <details className={styles.narrative}>
+ <summary className={styles.narrativeSummary}>
+ <Icon icon={ChevronRight} size={13} />
+ {t('report.sections.details')}
+ </summary>
+ <div className={styles.narrativeBody}>
+ <Markdown>{report.content}</Markdown>
+ </div>
+ </details>
+ )}
+ </div>
+ </div>
);
});
diff --git a/src/features/Verify/Workspace/EmptyDetail.tsx b/src/features/Verify/Workspace/EmptyDetail.tsx
new file mode 100644
index 00000000000..10f7da3f756
--- /dev/null
+++ b/src/features/Verify/Workspace/EmptyDetail.tsx
@@ -0,0 +1,24 @@
+'use client';
+
+import { Center, Empty } from '@lobehub/ui';
+import { ClipboardCheck } from 'lucide-react';
+import { memo } from 'react';
+import { useTranslation } from 'react-i18next';
+
+/** Right-pane placeholder shown at `/verify` when no report is selected yet. */
+const EmptyDetail = memo(() => {
+ const { t } = useTranslation('verify');
+ return (
+ <Center height={'100%'} width={'100%'}>
+ <Empty
+ description={t('workspace.emptyDetail.description')}
+ icon={ClipboardCheck}
+ title={t('workspace.emptyDetail.title')}
+ />
+ </Center>
+ );
+});
+
+EmptyDetail.displayName = 'EmptyDetail';
+
+export default EmptyDetail;
diff --git a/src/features/Verify/Workspace/ReportListPanel.tsx b/src/features/Verify/Workspace/ReportListPanel.tsx
new file mode 100644
index 00000000000..4a3f1280f61
--- /dev/null
+++ b/src/features/Verify/Workspace/ReportListPanel.tsx
@@ -0,0 +1,408 @@
+'use client';
+
+import type { VerifyRunStatus, VerifyVerdict } from '@lobechat/types';
+import { DraggablePanel, DraggablePanelContainer, type DraggablePanelProps } from '@lobehub/ui';
+import { Icon, Text } from '@lobehub/ui';
+import { ScrollArea } from '@lobehub/ui/base-ui';
+import { createStaticStyles, cssVar, useResponsive } from 'antd-style';
+import dayjs from 'dayjs';
+import isEqual from 'fast-deep-equal';
+import {
+ CircleCheck,
+ CircleHelp,
+ CircleX,
+ LoaderCircle,
+ PanelLeftClose,
+ Search,
+} from 'lucide-react';
+import { memo, useMemo, useState } from 'react';
+import { useTranslation } from 'react-i18next';
+import { useNavigate, useParams } from 'react-router';
+
+import type { VerifyReportSummary } from '@/services/verify';
+import { useGlobalStore } from '@/store/global';
+import { systemStatusSelectors } from '@/store/global/selectors';
+
+import { useVerifyReportSummaries } from '../hooks';
+
+const PANEL_MIN = 260;
+const PANEL_MAX = 420;
+
+const styles = createStaticStyles(({ css }) => ({
+ panel: css`
+ height: 100%;
+ background: ${cssVar.colorBgLayout};
+ `,
+ head: css`
+ flex: none;
+ padding-block: 14px 6px;
+ padding-inline: 12px;
+ `,
+ titleRow: css`
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ padding-inline: 4px;
+ `,
+ collapseBtn: css`
+ cursor: pointer;
+
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+
+ width: 26px;
+ height: 26px;
+ border: none;
+ border-radius: 4px;
+
+ color: ${cssVar.colorTextTertiary};
+
+ background: none;
+
+ &:hover {
+ color: ${cssVar.colorText};
+ background: ${cssVar.colorFillTertiary};
+ }
+ `,
+ search: css`
+ display: flex;
+ gap: 7px;
+ align-items: center;
+
+ height: 32px;
+ margin-block: 8px 4px;
+ margin-inline: 4px;
+ padding-inline: 10px;
+ border: 1px solid ${cssVar.colorBorderSecondary};
+ border-radius: ${cssVar.borderRadius};
+
+ background: ${cssVar.colorBgContainer};
+
+ svg {
+ flex: none;
+ color: ${cssVar.colorTextQuaternary};
+ }
+
+ input {
+ width: 100%;
+ min-width: 0;
+ border: none;
+
+ font-size: 13px;
+ color: ${cssVar.colorText};
+
+ background: none;
+ outline: none;
+
+ &::placeholder {
+ color: ${cssVar.colorTextQuaternary};
+ }
+ }
+ `,
+ list: css`
+ display: flex;
+ flex-direction: column;
+ gap: 2px;
+
+ padding-block: 6px 16px;
+ padding-inline: 8px;
+ `,
+ item: css`
+ cursor: pointer;
+
+ display: grid;
+ grid-template-columns: 18px minmax(0, 1fr);
+ gap: 10px;
+ align-items: start;
+
+ width: 100%;
+ padding-block: 9px;
+ padding-inline: 10px;
+ border: none;
+ border-radius: ${cssVar.borderRadius};
+
+ text-align: start;
+
+ background: none;
+
+ &:hover {
+ background: ${cssVar.colorFillQuaternary};
+ }
+
+ &[data-active='true'] {
+ background: ${cssVar.colorFillSecondary};
+ }
+ `,
+ glyph: css`
+ display: flex;
+ margin-block-start: 2px;
+ `,
+ spin: css`
+ animation: verify-spin 1.1s linear infinite;
+
+ @keyframes verify-spin {
+ to {
+ transform: rotate(360deg);
+ }
+ }
+ `,
+ itemTitle: css`
+ overflow: hidden;
+
+ font-size: 13px;
+ line-height: 1.4;
+ color: ${cssVar.colorText};
+ text-overflow: ellipsis;
+ white-space: nowrap;
+
+ &[data-active='true'] {
+ font-weight: 600;
+ }
+ `,
+ itemSub: css`
+ display: flex;
+ gap: 8px;
+
+ margin-block-start: 2px;
+
+ font-size: 12px;
+ color: ${cssVar.colorTextTertiary};
+ `,
+ counts: css`
+ font-family: ${cssVar.fontFamilyCode};
+ font-variant-numeric: tabular-nums;
+
+ em {
+ font-style: normal;
+ color: ${cssVar.colorError};
+ }
+ `,
+ empty: css`
+ display: flex;
+ flex-direction: column;
+ gap: 10px;
+ align-items: flex-start;
+
+ padding-block: 24px;
+ padding-inline: 12px;
+ `,
+ emptyMsg: css`
+ font-size: 12px;
+ line-height: 1.6;
+ color: ${cssVar.colorTextTertiary};
+ word-break: break-word;
+ `,
+ queryHl: css`
+ font-weight: 600;
+ color: ${cssVar.colorTextSecondary};
+ word-break: break-all;
+ `,
+ clearBtn: css`
+ cursor: pointer;
+
+ padding-block: 4px;
+ padding-inline: 10px;
+ border: 1px solid ${cssVar.colorBorder};
+ border-radius: 4px;
+
+ font-size: 12px;
+ color: ${cssVar.colorTextSecondary};
+
+ background: ${cssVar.colorBgContainer};
+
+ &:hover {
+ border-color: ${cssVar.colorTextTertiary};
+ color: ${cssVar.colorText};
+ }
+ `,
+}));
+
+type Glyph = 'ok' | 'bad' | 'unsure' | 'running';
+
+const runningStatuses = new Set<VerifyRunStatus>(['planned', 'repairing', 'verifying']);
+
+const glyphOf = (
+ status: VerifyRunStatus | null,
+ verdict: VerifyVerdict | null | undefined,
+): Glyph => {
+ if (status && runningStatuses.has(status)) return 'running';
+ if (verdict === 'passed' || status === 'passed' || status === 'delivered') return 'ok';
+ if (verdict === 'failed' || status === 'failed') return 'bad';
+ return 'unsure';
+};
+
+const glyphMeta: Record<Glyph, { color: string; icon: typeof CircleCheck }> = {
+ bad: { color: cssVar.colorError, icon: CircleX },
+ ok: { color: cssVar.colorSuccess, icon: CircleCheck },
+ running: { color: cssVar.colorInfo, icon: LoaderCircle },
+ unsure: { color: cssVar.colorWarning, icon: CircleHelp },
+};
+
+const relativeTime = (value?: Date | string | null) => {
+ if (!value) return '';
+ const d = dayjs(value);
+ return dayjs().diff(d, 'day') < 7 ? d.fromNow() : d.format('MMM D');
+};
+
+const ReportListItem = memo<{ active: boolean; item: VerifyReportSummary }>(({ active, item }) => {
+ const { t } = useTranslation('verify');
+ const navigate = useNavigate();
+ const status = item.run.status ?? null;
+ const glyph = glyphOf(status, item.report?.verdict);
+ const meta = glyphMeta[glyph];
+
+ const planCount = Array.isArray(item.run.plan) ? item.run.plan.length : 0;
+ const total = item.report?.totalChecks ?? planCount;
+ const passed = item.report?.passedChecks ?? 0;
+ const failed = item.report?.failedChecks ?? 0;
+ const title = item.run.title || t('reports.untitled');
+ const time =
+ glyph === 'running'
+ ? t('list.running')
+ : relativeTime(item.report?.generatedAt ?? item.run.createdAt);
+
+ return (
+ <button
+ className={styles.item}
+ data-active={active}
+ type={'button'}
+ onClick={() => navigate(`/verify/${item.run.id}`)}
+ >
+ <span className={styles.glyph} style={{ color: meta.color }}>
+ <Icon
+ className={glyph === 'running' ? styles.spin : undefined}
+ icon={meta.icon}
+ size={15}
+ />
+ </span>
+ <span style={{ minWidth: 0 }}>
+ <span className={styles.itemTitle} data-active={active}>
+ {title}
+ </span>
+ <span className={styles.itemSub}>
+ {time ? <span>{time}</span> : null}
+ {total > 0 && glyph !== 'running' ? (
+ <span className={styles.counts}>
+ {passed}/{total}
+ {failed > 0 ? (
+ <>
+ {' '}
+ · <em>{t('list.failedCount', { count: failed })}</em>
+ </>
+ ) : null}
+ </span>
+ ) : null}
+ </span>
+ </span>
+ </button>
+ );
+});
+
+ReportListItem.displayName = 'ReportListItem';
+
+const ReportListPanel = memo(() => {
+ const { t } = useTranslation('verify');
+ const { runId } = useParams<{ runId: string }>();
+ const { md = true } = useResponsive();
+ const { data } = useVerifyReportSummaries();
+ const reports = useMemo(() => data ?? [], [data]);
+
+ const [query, setQuery] = useState('');
+
+ const [showPanel, panelWidth, updateSystemStatus] = useGlobalStore((s) => [
+ systemStatusSelectors.showVerifyReportPanel(s),
+ systemStatusSelectors.verifyReportPanelWidth(s),
+ s.updateSystemStatus,
+ ]);
+ const [tmpWidth, setTmpWidth] = useState(panelWidth);
+ if (tmpWidth !== panelWidth) setTmpWidth(panelWidth);
+
+ const filtered = useMemo(() => {
+ const q = query.trim().toLowerCase();
+ if (!q) return reports;
+ return reports.filter((r) => (r.run.title || '').toLowerCase().includes(q));
+ }, [reports, query]);
+
+ const handleSizeChange: DraggablePanelProps['onSizeChange'] = (_, size) => {
+ if (!size) return;
+ const w = typeof size.width === 'string' ? Number.parseInt(size.width) : size.width;
+ if (!w || isEqual(w, panelWidth)) return;
+ setTmpWidth(w);
+ updateSystemStatus({ verifyReportPanelWidth: w });
+ };
+
+ return (
+ <DraggablePanel
+ className={styles.panel}
+ defaultSize={{ width: tmpWidth }}
+ expand={showPanel}
+ maxWidth={PANEL_MAX}
+ minWidth={PANEL_MIN}
+ mode={md ? 'fixed' : 'float'}
+ placement={'left'}
+ size={{ height: '100%', width: panelWidth }}
+ onExpandChange={(expand) => updateSystemStatus({ showVerifyReportPanel: expand })}
+ onSizeChange={handleSizeChange}
+ >
+ <DraggablePanelContainer style={{ flex: 'none', height: '100%', minWidth: PANEL_MIN }}>
+ <div className={styles.head}>
+ <div className={styles.titleRow}>
+ <Text strong style={{ fontSize: 15 }}>
+ {t('workspace.title')}
+ </Text>
+ <button
+ aria-label={t('workspace.collapse')}
+ className={styles.collapseBtn}
+ title={t('workspace.collapse')}
+ type={'button'}
+ onClick={() => updateSystemStatus({ showVerifyReportPanel: false })}
+ >
+ <Icon icon={PanelLeftClose} size={16} />
+ </button>
+ </div>
+ <label className={styles.search}>
+ <Icon icon={Search} size={13} />
+ <input
+ placeholder={t('workspace.search')}
+ type={'search'}
+ value={query}
+ onChange={(e) => setQuery(e.target.value)}
+ />
+ </label>
+ </div>
+
+ <ScrollArea style={{ flex: 1, minHeight: 0 }}>
+ {filtered.length === 0 ? (
+ <div className={styles.empty}>
+ {query.trim() ? (
+ <>
+ <span className={styles.emptyMsg}>
+ {t('workspace.searchEmptyPrefix')}
+ <b className={styles.queryHl}>{query.trim()}</b>
+ {t('workspace.searchEmptySuffix')}
+ </span>
+ <button className={styles.clearBtn} type={'button'} onClick={() => setQuery('')}>
+ {t('workspace.clearSearch')}
+ </button>
+ </>
+ ) : (
+ <span className={styles.emptyMsg}>{t('workspace.listEmpty')}</span>
+ )}
+ </div>
+ ) : (
+ <div className={styles.list}>
+ {filtered.map((item) => (
+ <ReportListItem active={item.run.id === runId} item={item} key={item.run.id} />
+ ))}
+ </div>
+ )}
+ </ScrollArea>
+ </DraggablePanelContainer>
+ </DraggablePanel>
+ );
+});
+
+ReportListPanel.displayName = 'ReportListPanel';
+
+export default ReportListPanel;
diff --git a/src/features/Verify/Workspace/index.tsx b/src/features/Verify/Workspace/index.tsx
new file mode 100644
index 00000000000..091deda9472
--- /dev/null
+++ b/src/features/Verify/Workspace/index.tsx
@@ -0,0 +1,88 @@
+'use client';
+
+import { Flexbox, Icon } from '@lobehub/ui';
+import { createStaticStyles, cssVar } from 'antd-style';
+import { PanelLeftOpen } from 'lucide-react';
+import { memo } from 'react';
+import { useTranslation } from 'react-i18next';
+import { Outlet } from 'react-router';
+
+import { RouteMetaBridge } from '@/features/RouteMeta';
+import { useGlobalStore } from '@/store/global';
+import { systemStatusSelectors } from '@/store/global/selectors';
+
+import ReportListPanel from './ReportListPanel';
+
+const styles = createStaticStyles(({ css }) => ({
+ expandBtn: css`
+ cursor: pointer;
+
+ position: absolute;
+ z-index: 20;
+ inset-block-start: 12px;
+ inset-inline-start: 12px;
+
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+
+ width: 28px;
+ height: 28px;
+ border: 1px solid ${cssVar.colorBorderSecondary};
+ border-radius: 6px;
+
+ color: ${cssVar.colorTextTertiary};
+
+ background: ${cssVar.colorBgContainer};
+
+ &:hover {
+ border-color: ${cssVar.colorBorder};
+ color: ${cssVar.colorText};
+ }
+ `,
+ main: css`
+ position: relative;
+ flex: 1;
+ min-width: 0;
+ height: 100%;
+ `,
+}));
+
+/**
+ * Verify workspace shell — a master-detail layout: a persistent, collapsible /
+ * drag-resizable report-list panel on the left, and the selected report (or the
+ * empty placeholder) rendered through the router `Outlet` on the right.
+ */
+const VerifyWorkspace = memo(() => {
+ const { t } = useTranslation('verify');
+ const [showPanel, updateSystemStatus] = useGlobalStore((s) => [
+ systemStatusSelectors.showVerifyReportPanel(s),
+ s.updateSystemStatus,
+ ]);
+
+ return (
+ <Flexbox horizontal height={'100dvh'} style={{ overflow: 'hidden' }} width={'100%'}>
+ {/* Standalone route (outside the app main layout): drive the tab title here. */}
+ <RouteMetaBridge />
+ <ReportListPanel />
+ <div className={styles.main}>
+ {!showPanel && (
+ <button
+ aria-label={t('workspace.expand')}
+ className={styles.expandBtn}
+ title={t('workspace.expand')}
+ type={'button'}
+ onClick={() => updateSystemStatus({ showVerifyReportPanel: true })}
+ >
+ <Icon icon={PanelLeftOpen} size={16} />
+ </button>
+ )}
+ <Outlet />
+ </div>
+ </Flexbox>
+ );
+});
+
+VerifyWorkspace.displayName = 'VerifyWorkspace';
+
+export default VerifyWorkspace;
diff --git a/src/features/Verify/hooks.ts b/src/features/Verify/hooks.ts
index 9c58ea37c74..a6d9ff18ec9 100644
--- a/src/features/Verify/hooks.ts
+++ b/src/features/Verify/hooks.ts
@@ -21,6 +21,10 @@ export const useVerifyReportBundle = (verifyRunId: string | null) =>
verifyService.getReportBundle(verifyRunId!),
);
+/** Current user's recent verification sessions with report rollup fields. */
+export const useVerifyReportSummaries = () =>
+ useClientDataSWR(verifyKeys.reportSummaries(), () => verifyService.listReportSummaries());
+
/** Model / token / latency for an LLM verifier judgment. Pass null to skip. */
export const useVerifierTracing = (tracingId: string | null | undefined) =>
useClientDataSWR(tracingId ? verifyKeys.tracing(tracingId) : null, () =>
diff --git a/src/features/Verify/index.ts b/src/features/Verify/index.ts
index d26cd695a5b..0a16df7a996 100644
--- a/src/features/Verify/index.ts
+++ b/src/features/Verify/index.ts
@@ -1,4 +1,7 @@
export { default as CheckerDock } from './CheckerDock';
-export { useVerifyResults, useVerifyState } from './hooks';
+export { useVerifyReportSummaries, useVerifyResults, useVerifyState } from './hooks';
+export { default as ReportViewer } from './ReportViewer';
export { default as RunResult } from './RunResult';
export { countResults, isDraftUnconfirmed, phaseFromStatus } from './utils';
+export { default as VerifyWorkspace } from './Workspace';
+export { default as VerifyEmptyDetail } from './Workspace/EmptyDetail';
diff --git a/src/features/Verify/routeMeta.ts b/src/features/Verify/routeMeta.ts
index 9ba761a4c30..884f1fc618e 100644
--- a/src/features/Verify/routeMeta.ts
+++ b/src/features/Verify/routeMeta.ts
@@ -1,4 +1,5 @@
import { ClipboardCheckIcon } from 'lucide-react';
+import { useTranslation } from 'react-i18next';
import { usePublishDynamicRouteMeta } from '@/features/RouteMeta/usePublishDynamicRouteMeta';
import type { DynamicRouteMetaProps } from '@/spa/router/routeMeta';
@@ -7,11 +8,12 @@ import { routeMeta } from '@/spa/router/routeMeta';
import { useVerifyReportBundle } from './hooks';
const VerifyDynamicMeta = ({ onResolve, params }: DynamicRouteMetaProps) => {
+ const { t } = useTranslation('verify');
const { data } = useVerifyReportBundle(params.runId ?? null);
usePublishDynamicRouteMeta(
{
- title: data?.run.title || 'Verification report',
+ title: data?.run.title || t('report.titleFallback'),
},
onResolve,
);
@@ -28,3 +30,8 @@ export const verifyRouteMeta = routeMeta({
DynamicMeta: VerifyDynamicMeta,
icon: ClipboardCheckIcon,
});
+
+export const verifyReportsRouteMeta = routeMeta({
+ icon: ClipboardCheckIcon,
+ titleKey: 'navigation.verifyReports',
+});
diff --git a/src/libs/swr/keys.ts b/src/libs/swr/keys.ts
index 92f7d50d1e5..a9c2530ed8f 100644
--- a/src/libs/swr/keys.ts
+++ b/src/libs/swr/keys.ts
@@ -658,6 +658,7 @@ export const verifyKeys = {
'verify:reportBundle',
verifyRunId,
]),
+ reportSummaries: def('verify:reportSummaries', () => ['verify:reportSummaries']),
results: def('verify:results', (operationId: string) => ['verify:results', operationId]),
rubric: def('verify:rubric', (rubricId: string) => ['verify:rubric', rubricId]),
rubricCriteria: def('verify:rubricCriteria', (rubricId: string) => [
diff --git a/src/proxy.ts b/src/proxy.ts
index 3ed15c8e524..09e9c0041fe 100644
--- a/src/proxy.ts
+++ b/src/proxy.ts
@@ -48,6 +48,7 @@ export const config = {
'/signin(.*)',
'/verify-email(.*)',
'/verify-im(.*)',
+ '/verify',
'/verify/(.*)',
'/reset-password(.*)',
'/auth-error(.*)',
diff --git a/src/routes/(main)/verify/empty.tsx b/src/routes/(main)/verify/empty.tsx
new file mode 100644
index 00000000000..fa27ec42897
--- /dev/null
+++ b/src/routes/(main)/verify/empty.tsx
@@ -0,0 +1,3 @@
+'use client';
+
+export { VerifyEmptyDetail as default } from '@/features/Verify';
diff --git a/src/routes/(main)/verify/index.tsx b/src/routes/(main)/verify/index.tsx
new file mode 100644
index 00000000000..aa7f98b21fd
--- /dev/null
+++ b/src/routes/(main)/verify/index.tsx
@@ -0,0 +1,3 @@
+'use client';
+
+export { VerifyWorkspace as default } from '@/features/Verify';
diff --git a/src/routes/verify/[runId]/index.tsx b/src/routes/verify/[runId]/index.tsx
index 9e16be76572..cd95683d94c 100644
--- a/src/routes/verify/[runId]/index.tsx
+++ b/src/routes/verify/[runId]/index.tsx
@@ -1,17 +1,3 @@
'use client';
-import { Flexbox } from '@lobehub/ui';
-
-import { RouteMetaBridge } from '@/features/RouteMeta';
-import ReportViewer from '@/features/Verify/ReportViewer';
-
-/** Standalone verification-report page: `/verify/:runId`. */
-const VerifyReportPage = () => (
- <Flexbox height={'100dvh'} style={{ overflow: 'auto' }} width={'100%'}>
- {/* Outside the main layout, so mount the route-meta bridge here to drive the tab title. */}
- <RouteMetaBridge />
- <ReportViewer />
- </Flexbox>
-);
-
-export default VerifyReportPage;
+export { ReportViewer as default } from '@/features/Verify';
diff --git a/src/services/verify.ts b/src/services/verify.ts
index bb4780f41f5..79184208825 100644
--- a/src/services/verify.ts
+++ b/src/services/verify.ts
@@ -82,6 +82,25 @@ export interface VerifyReportBundle {
run: VerifyRunItem;
}
+export interface VerifyReportSummary {
+ report: Pick<
+ VerifyReport,
+ | 'createdAt'
+ | 'failedChecks'
+ | 'generatedAt'
+ | 'id'
+ | 'overallConfidence'
+ | 'passedChecks'
+ | 'reviewedByUser'
+ | 'summary'
+ | 'totalChecks'
+ | 'uncertainChecks'
+ | 'verdict'
+ | 'verifyRunId'
+ > | null;
+ run: VerifyRunItem;
+}
+
export interface GenerateDraftPlanInput {
context?: string;
enableAiGeneration?: boolean;
@@ -140,6 +159,10 @@ export class VerifyService {
verifyRunId,
}) as Promise<VerifyReportBundle | null>;
+ /** Current user's recent verification sessions with report rollup fields. */
+ listReportSummaries = (): Promise<VerifyReportSummary[]> =>
+ lambdaClient.verify.listReportSummaries.query() as Promise<VerifyReportSummary[]>;
+
executeVerify = (input: {
batchLlm?: boolean;
deliverable: string;
diff --git a/src/spa/router/desktopRouter.config.desktop.tsx b/src/spa/router/desktopRouter.config.desktop.tsx
index 7949a46d4e3..7fbb5e76f9f 100644
--- a/src/spa/router/desktopRouter.config.desktop.tsx
+++ b/src/spa/router/desktopRouter.config.desktop.tsx
@@ -19,7 +19,7 @@ import { agentDocumentRouteMeta } from '@/features/AgentDocumentPage/routeMeta';
import { taskRouteMeta, tasksRouteMeta } from '@/features/AgentTasks/routeMeta';
import { fleetRouteMeta } from '@/features/Fleet/routeMeta';
import { pageRouteMeta } from '@/features/Pages/routeMeta';
-import { verifyRouteMeta } from '@/features/Verify/routeMeta';
+import { verifyReportsRouteMeta, verifyRouteMeta } from '@/features/Verify/routeMeta';
import { workspaceHomeRouteMeta } from '@/features/Workspace/routeMeta';
import DesktopOnboarding from '@/routes/(desktop)/desktop-onboarding';
// Layouts — sync import (Electron local, no network overhead)
@@ -122,6 +122,8 @@ import { settingsRouteMeta } from '@/routes/(main)/settings/features/routeMeta';
import { ProviderDetailPage, ProviderLayout } from '@/routes/(main)/settings/provider';
import TaskDetailRoute from '@/routes/(main)/task/[taskId]';
import AllTasksPage from '@/routes/(main)/tasks';
+import VerifyWorkspace from '@/routes/(main)/verify';
+import VerifyEmptyDetail from '@/routes/(main)/verify/empty';
import SharePagePage from '@/routes/share/page/[id]';
import ShareTopicPage from '@/routes/share/t/[id]';
import ShareTopicLayout from '@/routes/share/t/[id]/_layout';
@@ -769,12 +771,23 @@ export const desktopRoutes: RouteObject[] = [
path: '/verify-im',
},
- // Standalone verification-report viewer (outside main layout)
+ // Verify report workspace — standalone master-detail (outside main layout)
{
- element: <VerifyReportPage />,
+ children: [
+ {
+ element: <VerifyEmptyDetail />,
+ index: true,
+ },
+ {
+ element: <VerifyReportPage />,
+ handle: { meta: verifyRouteMeta },
+ path: ':runId',
+ },
+ ],
+ element: <VerifyWorkspace />,
errorElement: <ErrorBoundary />,
- handle: { meta: verifyRouteMeta },
- path: '/verify/:runId',
+ handle: { meta: verifyReportsRouteMeta },
+ path: '/verify',
},
// Devtools route (outside main layout, dev-only)
diff --git a/src/spa/router/desktopRouter.config.tsx b/src/spa/router/desktopRouter.config.tsx
index 3e5105cc1d8..e98b06bd7a5 100644
--- a/src/spa/router/desktopRouter.config.tsx
+++ b/src/spa/router/desktopRouter.config.tsx
@@ -19,7 +19,7 @@ import { agentDocumentRouteMeta } from '@/features/AgentDocumentPage/routeMeta';
import { taskRouteMeta, tasksRouteMeta } from '@/features/AgentTasks/routeMeta';
import { fleetRouteMeta } from '@/features/Fleet/routeMeta';
import { pageRouteMeta } from '@/features/Pages/routeMeta';
-import { verifyRouteMeta } from '@/features/Verify/routeMeta';
+import { verifyReportsRouteMeta, verifyRouteMeta } from '@/features/Verify/routeMeta';
import { workspaceHomeRouteMeta } from '@/features/Workspace/routeMeta';
import { agentRouteMeta, topicsRouteMeta } from '@/routes/(main)/agent/features/routeMeta';
import { groupRouteMeta } from '@/routes/(main)/group/features/routeMeta';
@@ -990,12 +990,26 @@ export const desktopRoutes: RouteObject[] = [
path: '/verify-im',
},
- // Standalone verification-report viewer (outside main layout)
+ // Verify report workspace — standalone master-detail (outside main layout)
{
- element: dynamicElement(() => import('@/routes/verify/[runId]'), 'Desktop > VerifyReport'),
+ children: [
+ {
+ element: dynamicElement(
+ () => import('@/routes/(main)/verify/empty'),
+ 'Desktop > Verify Empty',
+ ),
+ index: true,
+ },
+ {
+ element: dynamicElement(() => import('@/routes/verify/[runId]'), 'Desktop > VerifyReport'),
+ handle: { meta: verifyRouteMeta },
+ path: ':runId',
+ },
+ ],
+ element: dynamicElement(() => import('@/routes/(main)/verify'), 'Desktop > Verify'),
errorElement: <ErrorBoundary />,
- handle: { meta: verifyRouteMeta },
- path: '/verify/:runId',
+ handle: { meta: verifyReportsRouteMeta },
+ path: '/verify',
},
// Devtools route (outside main layout, dev-only)
diff --git a/src/spa/router/mobileRouter.config.tsx b/src/spa/router/mobileRouter.config.tsx
index a0fd0e3131d..7b6306851e2 100644
--- a/src/spa/router/mobileRouter.config.tsx
+++ b/src/spa/router/mobileRouter.config.tsx
@@ -7,7 +7,7 @@ import {
BusinessMobileRoutesWithoutMainLayout,
} from '@/business/client/BusinessMobileRoutes';
import { mobileAgentSettingsRouteMeta } from '@/features/RouteMeta/mobileRouteMeta';
-import { verifyRouteMeta } from '@/features/Verify/routeMeta';
+import { verifyReportsRouteMeta, verifyRouteMeta } from '@/features/Verify/routeMeta';
import { agentRouteMeta } from '@/routes/(main)/agent/features/routeMeta';
import { shareTopicRouteMeta } from '@/routes/share/t/[id]/routeMeta';
import { dynamicElement, dynamicLayout, ErrorBoundary, redirectElement } from '@/utils/router';
@@ -540,11 +540,25 @@ export const mobileRoutes: RouteObject[] = [
path: '/verify-im',
},
- // Standalone verification-report viewer (outside main layout)
+ // Verify report workspace — standalone master-detail (outside main layout)
{
- element: dynamicElement(() => import('@/routes/verify/[runId]'), 'Mobile > VerifyReport'),
+ children: [
+ {
+ element: dynamicElement(
+ () => import('@/routes/(main)/verify/empty'),
+ 'Mobile > Verify Empty',
+ ),
+ index: true,
+ },
+ {
+ element: dynamicElement(() => import('@/routes/verify/[runId]'), 'Mobile > VerifyReport'),
+ handle: { meta: verifyRouteMeta },
+ path: ':runId',
+ },
+ ],
+ element: dynamicElement(() => import('@/routes/(main)/verify'), 'Mobile > Verify'),
errorElement: <ErrorBoundary />,
- handle: { meta: verifyRouteMeta },
- path: '/verify/:runId',
+ handle: { meta: verifyReportsRouteMeta },
+ path: '/verify',
},
];
diff --git a/src/store/global/initialState.ts b/src/store/global/initialState.ts
index e963778b77e..c04d71f7104 100644
--- a/src/store/global/initialState.ts
+++ b/src/store/global/initialState.ts
@@ -245,6 +245,11 @@ export interface SystemStatus {
* Independent from `showRightPanel` so toggling it does not affect other pages.
*/
showTaskAgentPanel?: boolean;
+ /**
+ * Visibility of the Verify workspace left-side report-list panel.
+ * Independent from the nav rail so collapsing the report list does not affect other pages.
+ */
+ showVerifyReportPanel?: boolean;
showVideoPanel?: boolean;
showVideoTopicPanel?: boolean;
/**
@@ -288,6 +293,10 @@ export interface SystemStatus {
* number of topics to display per page
*/
topicPageSize?: number;
+ /**
+ * Width of the Verify workspace left-side report-list panel.
+ */
+ verifyReportPanelWidth: number;
videoPanelWidth: number;
videoTopicPanelWidth?: number;
videoTopicViewMode?: 'grid' | 'list';
@@ -425,12 +434,14 @@ export const INITIAL_STATUS = {
showRightPanel: false,
showSystemRole: false,
showTaskAgentPanel: false,
+ showVerifyReportPanel: true,
showVideoPanel: true,
showVideoTopicPanel: true,
sidebarExpandedKeys: [...DEFAULT_HOME_SIDEBAR_EXPANDED_KEYS],
systemRoleExpandedMap: {},
tokenDisplayFormatShort: true,
topicPageSize: 20,
+ verifyReportPanelWidth: 300,
videoPanelWidth: 320,
videoTopicViewMode: 'grid' as const,
videoTopicPanelWidth: 80,
diff --git a/src/store/global/selectors/systemStatus.ts b/src/store/global/selectors/systemStatus.ts
index f2ac0a5739b..f73fddbf94f 100644
--- a/src/store/global/selectors/systemStatus.ts
+++ b/src/store/global/selectors/systemStatus.ts
@@ -364,6 +364,7 @@ const showLeftPanel = (s: GlobalState) => s.status.showLeftPanel;
const showPageAgentPanel = (s: GlobalState) => s.status.showPageAgentPanel;
const showTaskAgentPanel = (s: GlobalState) => s.status.showTaskAgentPanel;
const showFilePanel = (s: GlobalState) => s.status.showFilePanel;
+const showVerifyReportPanel = (s: GlobalState) => s.status.showVerifyReportPanel ?? true;
const showImagePanel = (s: GlobalState) => s.status.showImagePanel;
const showImageTopicPanel = (s: GlobalState) => s.status.showImageTopicPanel;
const hidePWAInstaller = (s: GlobalState) => s.status.hidePWAInstaller;
@@ -385,6 +386,7 @@ const groupAgentBuilderPanelWidth = (s: GlobalState) => s.status.groupAgentBuild
const imagePanelWidth = (s: GlobalState) => s.status.imagePanelWidth;
const imageTopicViewMode = (s: GlobalState) => s.status.imageTopicViewMode || 'grid';
const imageTopicPanelWidth = (s: GlobalState) => s.status.imageTopicPanelWidth;
+const verifyReportPanelWidth = (s: GlobalState) => s.status.verifyReportPanelWidth || 300;
const videoPanelWidth = (s: GlobalState) => s.status.videoPanelWidth;
const videoTopicViewMode = (s: GlobalState) => s.status.videoTopicViewMode || 'grid';
const videoTopicPanelWidth = (s: GlobalState) => s.status.videoTopicPanelWidth;
@@ -473,9 +475,11 @@ export const systemStatusSelectors = {
showRightPanel,
showSystemRole,
showTaskAgentPanel,
+ showVerifyReportPanel,
showVideoPanel,
showVideoTopicPanel,
systemStatus,
+ verifyReportPanelWidth,
tokenDisplayFormatShort,
topicGroupKeys,
topicPageSize,