mirror of
https://github.com/ThearchyHelios/AgentLab.git
synced 2026-11-24 03:42:01 +00:00
合入期 5 前置修复 L3:记录页的工件列表把双盲复算对照、反方审稿记录、质询回答归到「核查记录」一组,窄屏下说明换到第二行、序号不被截掉;运行对比的默认基准接口带上 previous,运行详情的对比入口在基准不是紧挨着的上一次时写明「与上一次成功的运行对比」,和触发历史一致
This commit is contained in:
@@ -12,8 +12,8 @@ const run = (id: string) => `/runs/${encodeURIComponent(id)}`
|
||||
|
||||
export const compare = {
|
||||
/**
|
||||
* 默认的基准:同一定时任务的上一次运行,没有就同一工作流、同一运行类别的上一次。找不到时回 404,ApiError 的
|
||||
* message 是给人看的原因
|
||||
* 默认的基准:同一定时任务上一次成功并封存的运行,没有就同一工作流、同一运行类别的上一次。previous 说它是不是紧挨着
|
||||
* 的上一次(运行详情的菜单项按它定叫法)。找不到时回 404,ApiError 的 message 是给人看的原因
|
||||
*/
|
||||
base: (runId: string, opts?: RequestOptions) => get<RunCompareBase>(`${run(runId)}/compare/base`, opts),
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
import { useMemo, useState, type JSX } from 'react'
|
||||
import { parseServerTime } from '../../lib/format'
|
||||
import { ArtifactsPane, type ArtifactList } from '../../pages/runs/ArtifactsPane'
|
||||
import type { RunArtifact } from '../../pages/runs/model'
|
||||
import { emptyTrace } from '../../run/trace'
|
||||
import type { GraphSpec, NodeType } from '../../types'
|
||||
|
||||
/**
|
||||
* 运行详情「工件」页签(pages/runs/ArtifactsPane)的预览用例,scripts/check-verify.mjs 按它检查分组和窄屏。
|
||||
*
|
||||
* - ?syn=run-artifacts:虚构的「门店周报」一次正式运行,各种工件都有:取数节点的查询快照、表结构快照和产出,循环里
|
||||
* 逐区汇总的三次产出(第二次是重试),口径卡的指标输入、指标集,写周报的报告文档,双盲复算、反方审稿各自执行的查询
|
||||
* 和对照、审稿记录,封存后追加的两条质询回答(一条问题很长)和质询执行的查询。宽窄、深浅色都用这一个,检查脚本换
|
||||
* 视口宽度和主题。
|
||||
*
|
||||
* 工件列表直接交给页签(不走接口);航迹的起止照这次运行的开始、结束时间给:运行期间产出的能跳到航迹里那一刻,封存后
|
||||
* 追加的只写时间。点过的跳转记在 data-fixture-moment 上。门店、片区、金额、数据源都是虚构的。
|
||||
*/
|
||||
|
||||
const STARTED = '2026-10-05T06:00:00'
|
||||
const FINISHED = '2026-10-05T06:12:00'
|
||||
|
||||
const NODES: [string, NodeType, string][] = [
|
||||
['pull', 'tool', '拉取门店销量'],
|
||||
['summarize', 'llm', '逐区汇总'],
|
||||
['caliber', 'metrics', '周报口径'],
|
||||
['write', 'report', '写周报'],
|
||||
['dual', 'dual_check', '双盲复算'],
|
||||
['review', 'challenge', '反方审稿'],
|
||||
]
|
||||
const GRAPH: GraphSpec = {
|
||||
nodes: NODES.map(([id, type, label], i) => ({ id, type, position: { x: i * 220, y: 0 }, data: { label, config: {} } })),
|
||||
edges: NODES.slice(1).map(([id], i) => ({ source: NODES[i][0], target: id })),
|
||||
}
|
||||
const LABELS = Object.fromEntries(NODES.map(([id, , label]) => [id, label]))
|
||||
|
||||
/** 虚构的内容校验值:64 位十六进制,各不相同 */
|
||||
const sha = (n: number) => (n * 2654435761 >>> 0).toString(16).padStart(8, '0').repeat(8)
|
||||
let seq = 0
|
||||
const art = (kind: string, node: string | null, at: string, size: number, meta: Record<string, any> | null = null): RunArtifact => (
|
||||
{ id: sha(++seq), kind, node_id: node, size, meta, created_at: `2026-10-05T${at}` })
|
||||
|
||||
/** 质询的问题:服务端只记前 40 字(engine/inquiry.py 的 QUESTION_BRIEF),满 40 字的说明会很长 */
|
||||
const LONG_QUESTION = '青禾片区的线上订单是按下单门店还是按收货地址归到片区的?如果按收货地址,跨片区配'
|
||||
|
||||
const RUN_ARTIFACTS: RunArtifact[] = [
|
||||
art('schema_snapshot', 'pull', '06:00:05', 3120, { source: '门店库', tables: 3 }),
|
||||
art('query_snapshot', 'pull', '06:00:10', 18_400, { source: '门店库', tables: ['orders', 'stores'] }),
|
||||
art('query_snapshot', 'pull', '06:00:20', 2_060, { source: '门店库', tables: ['refunds'] }),
|
||||
art('node_output', 'pull', '06:00:30', 1_210, { type: 'tool', attempt: 1 }),
|
||||
art('node_output', 'summarize', '06:01:00', 860, { type: 'llm', attempt: 1 }),
|
||||
art('node_output', 'summarize', '06:02:00', 910, { type: 'llm', attempt: 2 }),
|
||||
art('node_output', 'summarize', '06:03:00', 880, { type: 'llm', attempt: 1 }),
|
||||
art('metric_input', 'caliber', '06:04:00', 5_400, { path: 'vars.region_rows' }),
|
||||
art('metric_set', 'caliber', '06:04:30', 2_380, { caliber: '周报口径', version: 'v3' }),
|
||||
art('node_output', 'caliber', '06:04:40', 1_020, { type: 'metrics', attempt: 1 }),
|
||||
art('report_doc', 'write', '06:05:00', 16_820),
|
||||
art('node_output', 'write', '06:05:10', 4_310, { type: 'report', attempt: 1 }),
|
||||
art('query_snapshot', 'dual', '06:06:00', 1_480, { source: '门店库', tables: ['orders'] }),
|
||||
art('dual_check', 'dual', '06:06:30', 6_920, { metrics: 3 }),
|
||||
art('node_output', 'dual', '06:07:00', 740, { type: 'dual_check', attempt: 1 }),
|
||||
art('query_snapshot', 'review', '06:08:00', 1_150, { source: '门店库', tables: ['refunds'] }),
|
||||
art('query_snapshot', 'review', '06:09:00', 1_330, { source: '门店库', tables: ['orders'] }),
|
||||
art('challenge', 'review', '06:10:00', 8_640, { report: 'write' }),
|
||||
art('node_output', 'review', '06:10:30', 690, { type: 'challenge', attempt: 1 }),
|
||||
// 封存后追加的:审批质询(不挂在节点上)
|
||||
art('query_snapshot', null, '07:00:00', 1_260, { source: '门店库', tables: ['orders'] }),
|
||||
art('inquiry_answer', null, '07:01:00', 2_510, { report: 'write', unit: 'u3', question: LONG_QUESTION }),
|
||||
art('inquiry_answer', null, '07:20:00', 1_940, { report: 'write', unit: 'u5', question: '退货率怎么算的?' }),
|
||||
]
|
||||
|
||||
function RunArtifacts(): JSX.Element {
|
||||
const list: ArtifactList = useMemo(() => ({ items: RUN_ARTIFACTS, state: 'ok', error: null, reload: () => undefined }), [])
|
||||
const trace = useMemo(() => ({
|
||||
...emptyTrace(), phase: 'succeeded' as const,
|
||||
startedAt: parseServerTime(STARTED)?.getTime(), endedAt: parseServerTime(FINISHED)?.getTime(),
|
||||
}), [])
|
||||
const [moment, setMoment] = useState<number | null>(null)
|
||||
return (
|
||||
<div className="h-screen min-w-0" data-fixture="run-artifacts" data-fixture-moment={moment ?? ''}>
|
||||
<ArtifactsPane list={list} graph={GRAPH} trace={trace} labelOf={(id) => (id ? LABELS[id] : undefined)}
|
||||
onMoment={(at) => setMoment(at)} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export const cases: Record<string, () => JSX.Element> = {
|
||||
'run-artifacts': () => <RunArtifacts />,
|
||||
}
|
||||
@@ -3202,10 +3202,10 @@ export const SCHEDULE_TEXT = {
|
||||
get compareLink() { return RUN_COMPARE_TEXT.menu },
|
||||
/**
|
||||
* 基准不是紧挨着的上一次(上一次失败了、取消了,比的是再往前成功的那一次)时链接上看得见的叫法:触屏没有悬停,
|
||||
* 键盘聚焦时也不显示 title,只在悬停里说明会让人以为比的就是上一次。运行详情「更多」里的菜单项点之前还不知道基准
|
||||
* 是哪一次,这时仍叫「与上一次对比」,两处叫法不同;进了对比页都写「默认基准:同一定时任务上一次成功的运行」
|
||||
* 键盘聚焦时也不显示 title,只在悬停里说明会让人以为比的就是上一次。运行详情「更多」里的菜单项按服务端给的 previous
|
||||
* 用同一个叫法(同为 getter);进了对比页都写「默认基准:同一定时任务上一次成功的运行」
|
||||
*/
|
||||
compareLinkLastOk: '与上一次成功的运行对比',
|
||||
get compareLinkLastOk() { return RUN_COMPARE_TEXT.menuLastOk },
|
||||
/**
|
||||
* 悬停写各类指标的个数,和 Webhook 通知里那一行同一个写法(服务端 scheduler/auto_compare.py 的 summary_text):
|
||||
* 变化三分法的三类总写上,0 个也写;其余各类有才写,次序同对比页;两边都没有指标时不写一串 0 个。只有个数,
|
||||
@@ -3272,8 +3272,13 @@ export const SCHEDULE_TEXT = {
|
||||
export const RUN_COMPARE_TEXT = {
|
||||
title: '运行对比',
|
||||
hint: '把两次运行的指标变化拆成数据、口径、模板与 SQL 三类',
|
||||
// 入口:运行详情的「更多」菜单
|
||||
// 入口:运行详情的「更多」菜单。叫法看服务端给的 previous(基准是不是紧挨着的上一次),和定时任务触发历史里的同名
|
||||
// 链接一个说法(SCHEDULE_TEXT.compareLink、compareLinkLastOk 取的就是这两条)
|
||||
menu: '与上一次对比',
|
||||
/** 上一次失败、取消、还没结束:基准是再往前成功的那一次,不能说成「上一次」 */
|
||||
menuLastOk: '与上一次成功的运行对比',
|
||||
/** 没有默认基准(多为工作流的第一次运行):没有「上一次」可比,点了去对比页手动选 */
|
||||
menuPick: '选择基准对比…',
|
||||
menuSealedOnly: '运行结束并封存后才能对比',
|
||||
/** 没有 workflow_id 的运行:画布、问数据里没保存就运行的,或者工作流删掉之后被置空的。服务端只比同一个已保存的工作流 */
|
||||
menuNoWorkflow: '工作流未保存或已删除,无法对比',
|
||||
@@ -3320,7 +3325,8 @@ export const RUN_COMPARE_TEXT = {
|
||||
pickGone: (id: string, missing: boolean) => `${id}(${missing ? '记录不存在' : '无法读取'})`,
|
||||
// 页面状态
|
||||
noTarget: '未指定要对比的运行',
|
||||
noTargetHint: '在运行详情的「更多」菜单中选择「与上一次对比」,即可对照本次与上一次成功的运行',
|
||||
/** 不逐个列菜单项的叫法(看有没有默认基准、是不是紧挨着的上一次,有三种),只说在哪里打开、默认比的是哪一次 */
|
||||
noTargetHint: '可从运行详情的「更多」菜单打开对比,默认以上一次成功的运行为基准',
|
||||
toRuns: '前往记录',
|
||||
finding: '正在查找基准运行…',
|
||||
loading: '正在对比两次运行…',
|
||||
@@ -3477,6 +3483,41 @@ export const RUN_COMPARE_TEXT = {
|
||||
notes: '说明',
|
||||
}
|
||||
|
||||
/**
|
||||
* 运行详情「工件」页签(pages/runs/ArtifactsPane.tsx):这次运行按内容校验值存下的每一件东西,按节点分组。筛选按
|
||||
* pages/runs/model.ts 的 artifactGroup 分三组:证据快照是取数、检索的原始结果和口径卡、报告文档、表结构;核查记录是
|
||||
* 双盲复算、反方审稿、审批质询对结论的核查与问答,单独一组;节点产出是过程里的中间值。按种类归组:核查、质询时执行的
|
||||
* 查询仍是查询快照,在证据快照里(一次运行里这类查询可能比流程本身的还多),所以证据快照不能说成「结论里的数字都从
|
||||
* 这里来」。各种工件的名字和说明在 model.ts,后来新加的放在这里(质询回答的在 INQUIRY_TEXT)
|
||||
*/
|
||||
export const RUN_ARTIFACTS_TEXT = {
|
||||
/** 运行详情「工件」页签头上的悬停:人先看到的这句要和页签里的三组对得上。清单还没取回来时不写件数 */
|
||||
tabTitle: (n?: number | null) =>
|
||||
(n == null ? '本次运行保存的证据、核查记录和产出' : `${n} 件:证据快照、核查记录和每个节点每一次的产出`),
|
||||
filterGroup: '按类型筛选工件',
|
||||
filter: { all: '全部', evidence: '证据快照', verify: '核查记录', output: '节点产出' } as Record<string, string>,
|
||||
/**
|
||||
* 筛选按钮的悬停:这一组装的是什么。核查、质询时执行的查询按种类仍是查询快照、在证据快照里,两组都要说一声;
|
||||
* 核查记录这一组列的是行上的种类名(双盲复算对照、反方审稿记录、质询回答)
|
||||
*/
|
||||
filterHint: {
|
||||
evidence: '查询、工具调用、知识检索的原始结果,口径卡、报告文档和表结构;含核查、质询时执行的查询',
|
||||
verify: '对结论的核查与问答:双盲复算对照、反方审稿记录、质询回答;其间执行的查询见「证据快照」',
|
||||
output: '每个节点每执行一次的产出:循环里每一轮都有一件',
|
||||
} as Record<string, string>,
|
||||
/** 同一个节点同一类的第几件:循环里几十件节点产出要分得开 */
|
||||
nth: (n: number) => `#${n}`,
|
||||
attempt: (n: number) => `第 ${n} 次尝试`,
|
||||
/** 打开一件的悬停写全说明:窄屏、长问题的说明在行上会截断 */
|
||||
openTitle: (kind: string, about: string) => `打开${kind}:${about}(读取时按内容校验值重新校验)`,
|
||||
/**
|
||||
* 口径卡里容器型变量(vars.*)输入的完整值(engine/nodes/metrics.py 的 metric_input,工件行的 meta 里有 {path}):
|
||||
* 推演时拿它还原输入。和口径卡一样归在证据快照
|
||||
*/
|
||||
kindMetricInput: '指标输入',
|
||||
aboutMetricInput: (path?: string | null) => (path ? `口径卡输入「${path}」的完整值` : '口径卡输入的完整值'),
|
||||
}
|
||||
|
||||
/**
|
||||
* 可验证报告:把一次已封存运行的报告导出成一个 HTML 文件,收件人不连服务也能在浏览器里核对。
|
||||
* 入口在记录页的封存凭证条上;页面本身的文案在服务端 bundle/verifier.js 里(它是离开系统独立打开的文件)
|
||||
|
||||
@@ -4,12 +4,12 @@ import clsx from 'clsx'
|
||||
import { api } from '../../api/client'
|
||||
import { EmptyState, ErrorState, Skeleton, StatusBadge } from '../../components/ui'
|
||||
import { formatBytes, formatClock, formatDateTime, formatNumber, formatTime, parseServerTime } from '../../lib/format'
|
||||
import { nodeTypeLabel } from '../../lib/terms'
|
||||
import { RUN_ARTIFACTS_TEXT as T, nodeTypeLabel } from '../../lib/terms'
|
||||
import { ArtifactViewer } from '../../run/AssistantStream'
|
||||
import { topology } from '../../run/derive'
|
||||
import type { Trace } from '../../run/trace'
|
||||
import type { GraphSpec } from '../../types'
|
||||
import { artifactDescription, artifactKindLabel, isEvidence, type RunArtifact } from './model'
|
||||
import { artifactDescription, artifactGroup, artifactKindLabel, type ArtifactGroup, type RunArtifact } from './model'
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// 数据
|
||||
@@ -65,22 +65,23 @@ export function useRunArtifacts(runId: string, refreshKey: string): ArtifactList
|
||||
// 页签
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
type KindFilter = 'all' | 'evidence' | 'output'
|
||||
const FILTER_LABEL: Record<KindFilter, string> = { all: '全部', evidence: '证据快照', output: '节点产出' }
|
||||
const FILTER_HINT: Record<KindFilter, string> = {
|
||||
all: '',
|
||||
evidence: '查询、工具调用、知识检索的原始结果:结论里的数字从这里来',
|
||||
output: '每个节点每执行一次的产出:循环里每一轮都有一件',
|
||||
}
|
||||
/** 筛选:全部,或者 model.ts 的三组之一(证据快照、核查记录、节点产出) */
|
||||
type KindFilter = 'all' | ArtifactGroup
|
||||
const FILTERS: readonly KindFilter[] = ['all', 'evidence', 'verify', 'output']
|
||||
/** 一次循环能有上千件:先列这么多,其余点了再展开 */
|
||||
const FIRST_ROWS = 300
|
||||
|
||||
/**
|
||||
* 工件:这次运行按内容哈希存下来的每一件东西——查询和工具调用的原始结果、每个
|
||||
* 节点每一次的产出。审阅出具物时从这里下钻到证据;打开时按哈希复验。
|
||||
* 工件:这次运行按内容哈希存下来的每一件东西——查询和工具调用的原始结果、核查留下的
|
||||
* 记录、每个节点每一次的产出。审阅出具物时从这里下钻到证据;打开时按哈希复验。
|
||||
*
|
||||
* 按节点分组、按执行顺序排,和航迹的泳道同一个顺序。能对上时刻的,一键跳到
|
||||
* 航迹里它产出的那一刻。
|
||||
*
|
||||
* 每一行按列表这一栏自己的宽度排(容器查询,不看视口:详情区在宽屏上也可能很窄)。窄时
|
||||
* 说明换到第二行占满整行,第一行留种类、校验值、大小和时刻;以前挤在一行里,390px
|
||||
* 宽时说明只剩三个字。序号和第几次尝试放在截断的范围外,按钮的悬停写全说明。再窄
|
||||
* (320px 的手机)时收起校验值,每行仍是两行。
|
||||
*/
|
||||
export function ArtifactsPane({ list, graph, trace, labelOf, onMoment }: {
|
||||
list: ArtifactList
|
||||
@@ -96,17 +97,17 @@ export function ArtifactsPane({ list, graph, trace, labelOf, onMoment }: {
|
||||
const items = list.items
|
||||
|
||||
const counts = useMemo(() => {
|
||||
const c: Record<KindFilter, number> = { all: 0, evidence: 0, output: 0 }
|
||||
const c: Record<KindFilter, number> = { all: 0, evidence: 0, verify: 0, output: 0 }
|
||||
for (const a of items ?? []) {
|
||||
c.all += 1
|
||||
c[isEvidence(a.kind) ? 'evidence' : 'output'] += 1
|
||||
c[artifactGroup(a.kind)] += 1
|
||||
}
|
||||
return c
|
||||
}, [items])
|
||||
const bytes = useMemo(() => (items ?? []).reduce((n, a) => n + (a.size ?? 0), 0), [items])
|
||||
|
||||
const groups = useMemo(() => {
|
||||
const shown = (items ?? []).filter((a) => filter === 'all' || (filter === 'evidence') === isEvidence(a.kind))
|
||||
const shown = (items ?? []).filter((a) => filter === 'all' || artifactGroup(a.kind) === filter)
|
||||
const order = graph ? topology(graph).order : []
|
||||
const rank = new Map(order.map((id, i) => [id, i]))
|
||||
const byNode = new Map<string, RunArtifact[]>()
|
||||
@@ -144,14 +145,14 @@ export function ArtifactsPane({ list, graph, trace, labelOf, onMoment }: {
|
||||
return (
|
||||
<div className="flex h-full min-h-0 flex-col" data-run-artifacts="">
|
||||
<div className="flex shrink-0 flex-wrap items-center gap-x-3 gap-y-1 border-b px-4 py-1.5 text-2xs text-faint">
|
||||
<div className="flex gap-0.5" role="group" aria-label="按类型筛选工件">
|
||||
{(Object.keys(FILTER_LABEL) as KindFilter[]).map((k) => (
|
||||
<div className="flex flex-wrap gap-0.5" role="group" aria-label={T.filterGroup}>
|
||||
{FILTERS.map((k) => (
|
||||
<button
|
||||
key={k}
|
||||
type="button"
|
||||
aria-pressed={filter === k}
|
||||
disabled={k !== 'all' && !counts[k]}
|
||||
title={FILTER_HINT[k] || undefined}
|
||||
title={T.filterHint[k]}
|
||||
onClick={() => setFilter(k)}
|
||||
data-artifact-kind={k}
|
||||
className={clsx(
|
||||
@@ -159,7 +160,7 @@ export function ArtifactsPane({ list, graph, trace, labelOf, onMoment }: {
|
||||
filter === k ? 'border-[var(--border-strong)] bg-hover text-fg' : 'border-transparent hover:bg-hover hover:text-dim',
|
||||
)}
|
||||
>
|
||||
{FILTER_LABEL[k]} <span className="tnum">{counts[k]}</span>
|
||||
{T.filter[k]} <span className="tnum">{counts[k]}</span>
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
@@ -169,7 +170,9 @@ export function ArtifactsPane({ list, graph, trace, labelOf, onMoment }: {
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div className="min-h-0 flex-1 overflow-y-auto">
|
||||
{/* 行按这一栏的宽度排(容器查询)。容器设在列表上、不设在整个页签上:查看工件的弹窗挂在页签里、是 fixed 定位,
|
||||
早期实现容器查询的浏览器给容器加布局隔离,会把它当成 fixed 元素的定位参照,弹窗就只盖住这一栏 */}
|
||||
<div className="@container min-h-0 flex-1 overflow-y-auto">
|
||||
{groups.map(([nodeId, rows]) => {
|
||||
if (budget <= 0) return null
|
||||
const take = rows.slice(0, budget)
|
||||
@@ -219,7 +222,8 @@ function Group({ nodeId, rows, total, graph, trace, labelOf, t0, t1, onOpen, onM
|
||||
style={{ background: node ? `var(--nt-${node.type}, var(--text-faint))` : 'var(--text-faint)' }} />
|
||||
<span className="min-w-0 truncate font-medium text-fg">{label}</span>
|
||||
{node && <span className="shrink-0 text-faint">{nodeTypeLabel(node.type)}</span>}
|
||||
{nodeId && label !== nodeId && <span className="mono shrink-0 text-faint">{nodeId}</span>}
|
||||
{/* 窄时让给名字:节点 id 是给对照画布用的,名字和类型已经认得出是哪个节点 */}
|
||||
{nodeId && label !== nodeId && <span className="mono shrink-0 text-faint @max-[35rem]:hidden">{nodeId}</span>}
|
||||
{state && <StatusBadge status={state} size={11} animate={false} />}
|
||||
<span className="flex-1" />
|
||||
<span className="tnum shrink-0 text-faint">{total} 件</span>
|
||||
@@ -228,33 +232,42 @@ function Group({ nodeId, rows, total, graph, trace, labelOf, t0, t1, onOpen, onM
|
||||
const n = (ordinal.get(a.kind) ?? 0) + 1
|
||||
ordinal.set(a.kind, n)
|
||||
const kind = artifactKindLabel(a.kind)
|
||||
const group = artifactGroup(a.kind)
|
||||
const about = artifactDescription(a.kind, a.meta)
|
||||
const attempt = Number(a.meta?.attempt)
|
||||
const created = parseServerTime(a.created_at ?? null)?.getTime()
|
||||
const at = t0 != null && created != null && created >= t0 && (t1 == null || created <= t1) ? created : null
|
||||
const numbered = (perKind.get(a.kind) ?? 0) > 1
|
||||
const title = `${label} · ${kind}${numbered ? ` #${n}` : ''}`
|
||||
// 第几件、第几次尝试:说明再长、截得再短也要看得见,放在截断的范围外
|
||||
const extra = [numbered ? T.nth(n) : '', attempt > 1 ? T.attempt(attempt) : ''].filter(Boolean).join(' · ')
|
||||
return (
|
||||
<div key={a.id} className="flex items-center gap-2 border-b px-4 py-1 last:border-0 hover:bg-hover"
|
||||
data-artifact-id={a.id}>
|
||||
<div key={a.id} className="flex items-center gap-2 border-b px-4 py-1 last:border-0 hover:bg-hover @max-[35rem]:items-start"
|
||||
data-artifact-id={a.id} data-artifact-class={group}>
|
||||
<button
|
||||
type="button"
|
||||
className="flex min-w-0 flex-1 items-center gap-2 rounded py-0.5 text-left outline-none focus-visible:ring-1 focus-visible:ring-[var(--accent)]"
|
||||
className="flex min-w-0 flex-1 items-center gap-2 rounded py-0.5 text-left outline-none focus-visible:ring-1 focus-visible:ring-[var(--accent)] @max-[35rem]:flex-wrap @max-[35rem]:gap-y-0.5"
|
||||
onClick={() => onOpen({ id: a.id, title })}
|
||||
title={`打开${kind}(读取时按内容校验值重新校验)`}
|
||||
title={T.openTitle(kind, extra ? `${about} ${extra}` : about)}
|
||||
data-action="artifact-open"
|
||||
>
|
||||
<span className={clsx('chip shrink-0', isEvidence(a.kind) && 'text-fg')}
|
||||
style={isEvidence(a.kind) ? { borderColor: 'var(--border-strong)' } : undefined}>
|
||||
<span className={clsx('chip shrink-0', group !== 'output' && 'text-fg')}
|
||||
style={group !== 'output' ? { borderColor: 'var(--border-strong)' } : undefined}
|
||||
data-artifact-kind-label="">
|
||||
{kind}
|
||||
</span>
|
||||
<span className="min-w-0 truncate text-xs text-dim">
|
||||
{artifactDescription(a.kind, a.meta)}
|
||||
{numbered && <span className="tnum text-faint"> #{n}</span>}
|
||||
{attempt > 1 && <span className="text-faint"> · 第 {attempt} 次尝试</span>}
|
||||
{/* 宽时排在种类后面、占满中间;窄时换到第二行占满整行(order-last + basis-full),第一行留种类、校验值和大小 */}
|
||||
<span className="flex min-w-0 flex-1 items-baseline gap-1 text-xs text-dim @max-[35rem]:order-last @max-[35rem]:basis-full"
|
||||
data-artifact-about-line="">
|
||||
<span className="min-w-0 truncate" data-artifact-about="">{about}</span>
|
||||
{extra && <span className="tnum shrink-0 text-faint" data-artifact-nth="">{extra}</span>}
|
||||
</span>
|
||||
{/* 校验值和大小一起排、一起折行:分开时更窄的屏上大小会单独折到种类下面、校验值留在右边。窄于 22rem(320px
|
||||
的手机)时收起校验值,第一行才放得下种类和大小;打开后的查看器里写着校验值 */}
|
||||
<span className="flex shrink-0 items-center gap-2 @max-[35rem]:ml-auto">
|
||||
<span className="mono text-2xs text-faint @max-[22rem]:hidden" title={`内容校验值 ${a.id}`}>{a.id.slice(0, 8)}</span>
|
||||
<span className="tnum w-16 text-right text-2xs text-faint" data-artifact-size="">{formatBytes(a.size)}</span>
|
||||
</span>
|
||||
<span className="flex-1" />
|
||||
<span className="mono shrink-0 text-2xs text-faint" title={`内容校验值 ${a.id}`}>{a.id.slice(0, 8)}</span>
|
||||
<span className="tnum w-16 shrink-0 text-right text-2xs text-faint">{formatBytes(a.size)}</span>
|
||||
</button>
|
||||
{at != null && onMoment ? (
|
||||
<button type="button" className="btn btn-xs btn-ghost tnum w-[86px] shrink-0 justify-end"
|
||||
@@ -263,7 +276,8 @@ function Group({ nodeId, rows, total, graph, trace, labelOf, t0, t1, onOpen, onM
|
||||
<History size={11} aria-hidden /> T+{formatClock(Math.round(at - t0!))}
|
||||
</button>
|
||||
) : (
|
||||
<span className="tnum w-[86px] shrink-0 text-right text-2xs text-faint" title={formatDateTime(a.created_at ?? null)}>
|
||||
<span className="tnum w-[86px] shrink-0 text-right text-2xs text-faint @max-[35rem]:mt-1"
|
||||
title={formatDateTime(a.created_at ?? null)} data-artifact-time="">
|
||||
{formatTime(a.created_at ?? null)}
|
||||
</span>
|
||||
)}
|
||||
|
||||
@@ -25,7 +25,7 @@ import {
|
||||
} from './model'
|
||||
import { ArtifactsPane, useRunArtifacts } from './ArtifactsPane'
|
||||
import { EvidencePane } from './EvidencePane'
|
||||
import { EVIDENCE_AUDIT_TEXT } from '../../lib/terms'
|
||||
import { EVIDENCE_AUDIT_TEXT, RUN_ARTIFACTS_TEXT } from '../../lib/terms'
|
||||
import { ClassChip, MoreMenu, RunTabs, TierChip, copyText, type MenuItem, type TabItem } from './parts'
|
||||
import { ProvenanceBar, Telemetry, runClocks } from './Telemetry'
|
||||
import { TracePane } from './TracePane'
|
||||
@@ -63,8 +63,9 @@ export function RunDetailView({ runId, onChange, onDeleted }: {
|
||||
const [feedback, setFeedback] = useState<Feedback | null>(null)
|
||||
const streamBox = useRef<HTMLDivElement>(null)
|
||||
const now = useTicker(60_000)
|
||||
// 「更多」里的「与上一次对比」:查找基准时的状态在这里挂着,菜单项等拿到运行之后再造(下面有提前返回)
|
||||
const compareEntry = useCompareEntry()
|
||||
// 「更多」里的「与上一次对比」:拿到能对比的运行就预先问默认基准(叫法看它是不是紧挨着的上一次),预先查找和点了
|
||||
// 之后查找中的状态都在这里挂着,所以放在下面的提前返回之前。live 同下面的 live
|
||||
const compareItem = useCompareEntry(d.run, d.streaming || isLiveRun(d.run?.status))
|
||||
|
||||
useEffect(() => {
|
||||
if (d.state !== 'missing') return
|
||||
@@ -464,7 +465,7 @@ export function RunDetailView({ runId, onChange, onDeleted }: {
|
||||
key: 'copy-link', label: '复制链接', icon: <Link2 size={12} />,
|
||||
onSelect: () => void copyText(`${location.origin}/runs/${run.id}`, '链接'),
|
||||
},
|
||||
compareEntry(run, live),
|
||||
compareItem,
|
||||
{
|
||||
key: 'delete', label: '删除记录…', icon: <Trash2 size={12} />, danger: true, onSelect: () => void remove(),
|
||||
disabled: live || busy === 'delete',
|
||||
@@ -537,7 +538,7 @@ export function RunDetailView({ runId, onChange, onDeleted }: {
|
||||
{ key: 'evidence', label: EVIDENCE_AUDIT_TEXT.tab, title: EVIDENCE_AUDIT_TEXT.tabTitle },
|
||||
{
|
||||
key: 'artifacts', label: '工件', count: artifactCount, unit: '件', tone: 'quiet',
|
||||
title: artifactCount == null ? '本次运行保存的证据和产出' : `${artifactCount} 件:查询和工具调用的原始结果、每个节点每一次的产出`,
|
||||
title: RUN_ARTIFACTS_TEXT.tabTitle(artifactCount),
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useCallback, useEffect, useRef, useState } from 'react'
|
||||
import { useEffect, useRef, useState } from 'react'
|
||||
import { useNavigate } from 'react-router-dom'
|
||||
import { GitCompareArrows } from 'lucide-react'
|
||||
import { ApiError, api } from '../../../api/client'
|
||||
@@ -6,6 +6,7 @@ import { toast } from '../../../components/ui'
|
||||
import { RUN_COMPARE_TEXT as T } from '../../../lib/terms'
|
||||
import type { Run } from '../../../types'
|
||||
import type { MenuItem } from '../parts'
|
||||
import { compareErrorKind } from './model'
|
||||
|
||||
/** 对比页的地址。via 是默认基准的来历(同一定时任务 / 同一工作流),只跟着这一次跳转走,换了基准就不再显示 */
|
||||
export interface CompareVia { base: string; reason: string }
|
||||
@@ -15,23 +16,49 @@ export const comparePath = (target: string, base?: string | null) =>
|
||||
|
||||
/** 查找超过这么久才挂「正在查找」的提示:答复快的不闪一下 */
|
||||
const NOTE_DELAY_MS = 300
|
||||
/**
|
||||
* 预先问默认基准最多等这么久:连得上却卡着不回(代理、网络卡住)时按没问到算,入口不一直停在不可点的「正在查找」。
|
||||
* 平常一两百毫秒就回来;点了之后那一次不设这个限,慢了有「正在查找」的提示
|
||||
*/
|
||||
const ASK_TIMEOUT_MS = 5000
|
||||
|
||||
/**
|
||||
* 预先问到的默认基准。key 是问的哪一次运行的哪一份封存(运行 id + 清单哈希:失败后接着运行完会重新封存,基准可能跟着
|
||||
* 变)。base:previous 是紧挨着的上一次,earlier 是再往前成功的那一次(上一次失败、取消、还没结束),none 是没有默认
|
||||
* 基准(对比页会写「没有默认基准」、让人手动选);null 是没问到(出错、超时),叫法退回「与上一次对比」,点了照常再问、
|
||||
* 照实说
|
||||
*/
|
||||
interface Known { key: string; base: 'previous' | 'earlier' | 'none' | null }
|
||||
|
||||
/**
|
||||
* 运行详情「更多」菜单里的「与上一次对比」。先问服务端默认的基准(同一定时任务上一次成功的运行,没有就同一工作流、
|
||||
* 同一类别上一次成功的运行;定时任务触发历史里同名的入口由服务端用同一个函数挑,两处比的是同一对运行),找到了再跳到
|
||||
* 对比页;找不到时留在原页,提示服务端给的原因,并给「手动选择基准」去对比页自己挑。
|
||||
* 对比页;点了才发现找不到(预先问时还有)时留在原页,提示服务端给的原因,并给「手动选择基准」去对比页自己挑。
|
||||
* 这几种不给点,点了也只会被拒:没封存、还在运行的(对比只认已封存的运行,409);不属于已保存工作流的——画布、问数据
|
||||
* 里没保存就运行的,和工作流删掉之后 workflow_id 被置空的(服务端找不到同一工作流的运行,手动选也是 422)。
|
||||
*
|
||||
* 菜单点完就收起:查找慢于一眨眼时挂一条提示,接口慢的时候不至于像没反应。离开运行详情(组件卸载)时取消请求、
|
||||
* 收起提示,晚到的答复不再把人带去对比页。卸载取消不了全部:地址已经换了、新页面还没画出来(路由按过渡渲染)的那一下
|
||||
* 答复回来,组件还在,请求也没取消。所以答复回来时再看一眼地址:人已经不在点菜单时的那个运行详情上,就不跳、也不提示。
|
||||
* 叫法和触发历史里的链接一致:基准不是紧挨着的上一次(上一次失败、取消、还没结束)时写「与上一次成功的运行对比」。
|
||||
* 点之前就得知道,所以拿到能对比的运行就预先问一次(previous)。问到之前这一项只写「正在查找」、不给点:菜单开着时不会
|
||||
* 先写一个叫法、问到了再换成另一个,也点不到一个说错了的入口;平常运行一打开就问,人点开菜单时早已问到。问到没有默认
|
||||
* 基准(多为工作流的第一次运行)时写「选择基准对比…」,点了直接去只带本次的对比页手动选:没有上一次可比还写「与上一次
|
||||
* 对比」会误导人,再问一遍、弹一条提示也是多走一步。预先问不到(出错、ASK_TIMEOUT_MS 内没回来)不提示,叫法退回
|
||||
* 「与上一次对比」、可点,点了照常再问一次、照实说。
|
||||
*
|
||||
* 写成 hook(返回造菜单项的函数):运行详情里有提前返回,菜单项本身只能在拿到运行之后造,查找中的状态得在那之前就挂上
|
||||
* 切去别的标签页、窗口再切回来时再问一次:详情页可能开了很久,这期间在别处删掉、接着运行完了哪一次,基准跟着变。再问
|
||||
* 期间保留原来的叫法、照样可点(不退回「正在查找」,菜单开着也不闪),问到了不一样才换,问不到不改。
|
||||
*
|
||||
* 点了总是再问一次、按这一次的答复跳(没有默认基准的除外,对比页自己会再找一次):预先问到的不一定还是现在的。菜单
|
||||
* 点完就收起:查找慢于一眨眼时挂一条提示,接口慢的时候不至于像没反应。离开运行详情(组件卸载)时取消请求、收起提示,
|
||||
* 晚到的答复不再把人带去对比页。卸载取消不了全部:地址已经换了、新页面还没画出来(路由按过渡渲染)的那一下答复回来,
|
||||
* 组件还在,请求也没取消。所以答复回来时再看一眼地址:人已经不在点菜单时的那个运行详情上,就不跳、也不提示。
|
||||
*
|
||||
* 写成 hook、在运行详情的提前返回之前调用:预先查找和点了之后查找中的状态都得在拿到运行之前就挂上。run 为空(还在读
|
||||
* 运行记录)时交回的这一项不会被画出来
|
||||
*/
|
||||
export function useCompareEntry(): (run: Run, live: boolean) => MenuItem {
|
||||
export function useCompareEntry(run: Run | null, live: boolean): MenuItem {
|
||||
const navigate = useNavigate()
|
||||
const [busy, setBusy] = useState(false)
|
||||
const [known, setKnown] = useState<Known | null>(null)
|
||||
// 在路上的那一次:stop 收起(或者不再挂出)「正在查找」的提示
|
||||
const pending = useRef<{ ctrl: AbortController; stop: () => void } | null>(null)
|
||||
useEffect(() => () => {
|
||||
@@ -40,48 +67,88 @@ export function useCompareEntry(): (run: Run, live: boolean) => MenuItem {
|
||||
p?.ctrl.abort()
|
||||
p?.stop()
|
||||
}, [])
|
||||
return useCallback((run: Run, live: boolean): MenuItem => {
|
||||
const orphan = !run.workflow_id
|
||||
const unsealed = live || !run.manifest_hash
|
||||
return {
|
||||
key: 'compare',
|
||||
label: T.menu,
|
||||
icon: <GitCompareArrows size={12} />,
|
||||
disabled: orphan || unsealed || busy,
|
||||
hint: orphan ? T.menuNoWorkflow : unsealed ? T.menuSealedOnly : busy ? T.menuFinding : undefined,
|
||||
onSelect: () => {
|
||||
const ctrl = new AbortController()
|
||||
// 点菜单时所在的运行详情。只比路径:同一页里换视图、改列表筛选(改查询串)不算离开
|
||||
const from = window.location.pathname
|
||||
const left = () => ctrl.signal.aborted || window.location.pathname !== from
|
||||
let note: number | null = null
|
||||
const timer = setTimeout(() => {
|
||||
note = toast.info(T.menuFinding, { sticky: true, key: `compare-finding:${run.id}` })
|
||||
}, NOTE_DELAY_MS)
|
||||
const stop = () => {
|
||||
clearTimeout(timer)
|
||||
if (note != null) toast.dismiss(note)
|
||||
}
|
||||
pending.current = { ctrl, stop }
|
||||
setBusy(true)
|
||||
api.compare.base(run.id, { signal: ctrl.signal }).then((found) => {
|
||||
if (left()) return
|
||||
const via: CompareVia = { base: found.base_run_id, reason: found.reason }
|
||||
navigate(comparePath(run.id, found.base_run_id), { state: via })
|
||||
}, (e: unknown) => {
|
||||
if (left()) return
|
||||
if (e instanceof ApiError && e.kind === 'http' && e.status === 404) {
|
||||
toast.info(e.message, { action: { label: T.pickManually, onClick: () => navigate(comparePath(run.id)) } })
|
||||
} else {
|
||||
toast.error(e)
|
||||
}
|
||||
}).finally(() => {
|
||||
stop()
|
||||
if (pending.current?.ctrl !== ctrl) return
|
||||
pending.current = null
|
||||
setBusy(false)
|
||||
})
|
||||
|
||||
const orphan = !run?.workflow_id
|
||||
const unsealed = live || !run?.manifest_hash
|
||||
// 能对比的才预先问:对比页只认已封存、属于已保存工作流的运行,这两种入口本来就不给点,先问没有用处
|
||||
const target = run && !orphan && !unsealed ? run.id : null
|
||||
const key = target ? `${target}:${run?.manifest_hash}` : null
|
||||
// 切回这一页的次数:每切回来一次再问一次
|
||||
const [round, setRound] = useState(0)
|
||||
useEffect(() => {
|
||||
if (!key) return
|
||||
const onShow = () => { if (document.visibilityState === 'visible') setRound((n) => n + 1) }
|
||||
document.addEventListener('visibilitychange', onShow)
|
||||
return () => document.removeEventListener('visibilitychange', onShow)
|
||||
}, [key])
|
||||
useEffect(() => {
|
||||
if (!target || !key) return
|
||||
const ctrl = new AbortController()
|
||||
api.compare.base(target, { signal: ctrl.signal, timeoutMs: ASK_TIMEOUT_MS }).then(
|
||||
(found) => { if (!ctrl.signal.aborted) setKnown({ key, base: found.previous === false ? 'earlier' : 'previous' }) },
|
||||
(e: unknown) => {
|
||||
if (ctrl.signal.aborted) return
|
||||
// 没有默认基准算问到了(判法同对比页);出错、超时算没问到:头一回退回「与上一次对比」,再问时不改原来的叫法
|
||||
if (compareErrorKind(e, true) === 'no-base') setKnown({ key, base: 'none' })
|
||||
else setKnown((k) => (k?.key === key ? k : { key, base: null }))
|
||||
},
|
||||
}
|
||||
}, [navigate, busy])
|
||||
)
|
||||
return () => ctrl.abort()
|
||||
}, [target, key, round])
|
||||
|
||||
const resolved = known && known.key === key ? known : null
|
||||
// 预先问的那一次还没回来:这一项只写正在查找,不先写一个叫法、问到了再换
|
||||
const asking = !!key && !resolved
|
||||
const label = asking ? T.menuFinding
|
||||
: resolved?.base === 'earlier' ? T.menuLastOk : resolved?.base === 'none' ? T.menuPick : T.menu
|
||||
return {
|
||||
key: 'compare',
|
||||
label,
|
||||
icon: <GitCompareArrows size={12} />,
|
||||
disabled: orphan || unsealed || asking || busy,
|
||||
hint: orphan ? T.menuNoWorkflow : unsealed ? T.menuSealedOnly : busy ? T.menuFinding : undefined,
|
||||
onSelect: () => {
|
||||
if (!run || !key) return
|
||||
// 已经知道没有默认基准:直接去只带本次的对比页,那里自己再找一次(这期间有了就用上),找不到写明、在上方手动选
|
||||
if (resolved?.base === 'none') {
|
||||
navigate(comparePath(run.id))
|
||||
return
|
||||
}
|
||||
const ctrl = new AbortController()
|
||||
// 点菜单时所在的运行详情。只比路径:同一页里换视图、改列表筛选(改查询串)不算离开
|
||||
const from = window.location.pathname
|
||||
const left = () => ctrl.signal.aborted || window.location.pathname !== from
|
||||
let note: number | null = null
|
||||
const timer = setTimeout(() => {
|
||||
note = toast.info(T.menuFinding, { sticky: true, key: `compare-finding:${run.id}` })
|
||||
}, NOTE_DELAY_MS)
|
||||
const stop = () => {
|
||||
clearTimeout(timer)
|
||||
if (note != null) toast.dismiss(note)
|
||||
}
|
||||
pending.current = { ctrl, stop }
|
||||
setBusy(true)
|
||||
api.compare.base(run.id, { signal: ctrl.signal }).then((found) => {
|
||||
if (left()) return
|
||||
// 这一次的答复也定叫法:跳不走(地址没换成)时菜单上写的和刚问到的一致
|
||||
setKnown({ key, base: found.previous === false ? 'earlier' : 'previous' })
|
||||
const via: CompareVia = { base: found.base_run_id, reason: found.reason }
|
||||
navigate(comparePath(run.id, found.base_run_id), { state: via })
|
||||
}, (e: unknown) => {
|
||||
if (left()) return
|
||||
if (e instanceof ApiError && e.kind === 'http' && e.status === 404) {
|
||||
// 点了才发现没有默认基准(这期间基准那一次被删了,或者预先问没问到):照实说,下次打开菜单写「选择基准对比…」
|
||||
setKnown({ key, base: compareErrorKind(e, true) === 'no-base' ? 'none' : null })
|
||||
toast.info(e.message, { action: { label: T.pickManually, onClick: () => navigate(comparePath(run.id)) } })
|
||||
} else {
|
||||
toast.error(e)
|
||||
}
|
||||
}).finally(() => {
|
||||
stop()
|
||||
if (pending.current?.ctrl !== ctrl) return
|
||||
pending.current = null
|
||||
setBusy(false)
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
RUN_STATUS_ORDER, STATUS, resolveStatus, serverStatusOf, type StatusCode,
|
||||
} from '../../lib/status'
|
||||
import { formatSpan, parseServerTime } from '../../lib/format'
|
||||
import { INQUIRY_TEXT } from '../../lib/terms'
|
||||
import { INQUIRY_TEXT, RUN_ARTIFACTS_TEXT } from '../../lib/terms'
|
||||
import { hasPendingApproval } from '../../store/catalog'
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
@@ -336,6 +336,7 @@ export const ARTIFACT_KIND_LABEL: Record<string, string> = {
|
||||
dual_check: '双盲复算对照',
|
||||
challenge: '反方审稿记录',
|
||||
inquiry_answer: INQUIRY_TEXT.artifactKind,
|
||||
metric_input: RUN_ARTIFACTS_TEXT.kindMetricInput,
|
||||
}
|
||||
export const artifactKindLabel = (kind: string): string => ARTIFACT_KIND_LABEL[kind] ?? kind
|
||||
|
||||
@@ -361,12 +362,25 @@ export function artifactDescription(kind: string, meta?: Record<string, any> | n
|
||||
// 审批质询的回答文档(工件行的 meta 里有 {report, unit, question: 问题的前 40 字}):不挂在节点上,靠问题认出是哪一条
|
||||
case 'inquiry_answer': return typeof meta?.question === 'string' && meta.question.trim()
|
||||
? INQUIRY_TEXT.artifactAbout(meta.question) : INQUIRY_TEXT.artifactAboutNone
|
||||
// 口径卡里容器型变量输入的完整值(工件行的 meta 里有 {path})
|
||||
case 'metric_input': return RUN_ARTIFACTS_TEXT.aboutMetricInput(typeof meta?.path === 'string' ? meta.path : null)
|
||||
default: return '工件'
|
||||
}
|
||||
}
|
||||
|
||||
/** 证据:查询、工具、检索的快照。节点产出是过程里的中间值,一次循环就是几十件 */
|
||||
export const isEvidence = (kind: string): boolean => kind !== 'node_output'
|
||||
/**
|
||||
* 工件页签上的三组:evidence 证据快照(查询、工具、检索的快照,口径卡、报告文档、表结构);verify 核查记录(双盲复算、
|
||||
* 反方审稿、审批质询对结论的核查与问答:以前混在证据快照里,和「原始结果」的说明对不上);output 节点产出(过程里的
|
||||
* 中间值,一次循环就是几十件)。按种类分:核查、质询时执行的查询种类仍是查询快照,归在证据快照(两组的悬停说明都写明
|
||||
* 了);认不出的种类也算证据快照,宁可醒目
|
||||
*/
|
||||
export type ArtifactGroup = 'evidence' | 'verify' | 'output'
|
||||
const VERIFY_KINDS: ReadonlySet<string> = new Set(['dual_check', 'challenge', 'inquiry_answer'])
|
||||
export const artifactGroup = (kind: string): ArtifactGroup =>
|
||||
kind === 'node_output' ? 'output' : VERIFY_KINDS.has(kind) ? 'verify' : 'evidence'
|
||||
|
||||
/** 证据快照这一组的(见 artifactGroup) */
|
||||
export const isEvidence = (kind: string): boolean => artifactGroup(kind) === 'evidence'
|
||||
|
||||
/** 三种时长写进 title:「总时长 1 分 27 秒 · 执行时长 7.6 s · 等待审批 1 分 14 秒」 */
|
||||
export function timingTitle(t: RunTiming): string {
|
||||
|
||||
@@ -3439,6 +3439,11 @@ export interface RunCompareBase {
|
||||
base_run_id: string
|
||||
reason: RunCompareBaseReason | (string & {})
|
||||
base: RunCompareRef
|
||||
/**
|
||||
* 基准是不是紧挨着的上一次(服务端 pick_base 算的,同触发历史里自动对比的 previous):上一次失败、取消、还没结束时
|
||||
* 为 false,运行详情「更多」里的入口据此写「与上一次成功的运行对比」。老服务端不给,按 true 算
|
||||
*/
|
||||
previous?: boolean
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user