feat(short-drama-agent-front): 接入正式审核执行历史
This commit is contained in:
1 parent
518b630a46
commit
c808a58a3f
17 files changed
+1129
-175
No files matched your search
@@ -0,0 +1,181 @@
|
||||
import { mount, flushPromises, type VueWrapper } from '@vue/test-utils'
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest'
|
||||
import KeyframeExecutionHistory from '@/features/production/components/KeyframeExecutionHistory.vue'
|
||||
import KeyframeValidationHistory from '@/features/production/components/KeyframeValidationHistory.vue'
|
||||
import ReadonlyInspection from '@/components/ui/ReadonlyInspection.vue'
|
||||
import {
|
||||
physicalHistoryFixture,
|
||||
validationExecutionFixture,
|
||||
validationHistoryFixture
|
||||
} from '../../fixtures/validation-executions'
|
||||
|
||||
/** 只操作隔离挂载,浏览器布局另在本地 Chrome 验收。 */
|
||||
let wrapper: VueWrapper
|
||||
/**
|
||||
* 通过实际折叠标题触发按需查询,不直接调用组件私有方法。
|
||||
* @param label 可见折叠标题
|
||||
*/
|
||||
async function expand(label: string) {
|
||||
const heading = wrapper.findAll('.n-collapse-item__header-main').find(item => item.text().includes(label))
|
||||
expect(heading).toBeDefined()
|
||||
await heading!.trigger('click')
|
||||
await flushPromises()
|
||||
}
|
||||
/**
|
||||
* 包装正式响应。
|
||||
* @param data 公开返回值
|
||||
* @returns Mock HTTP
|
||||
*/
|
||||
function response(data: unknown) {
|
||||
return new Response(JSON.stringify({ data }))
|
||||
}
|
||||
afterEach(() => {
|
||||
wrapper?.unmount()
|
||||
localStorage.clear()
|
||||
sessionStorage.clear()
|
||||
vi.unstubAllGlobals()
|
||||
})
|
||||
describe('按任务读取执行历史的页面流程', () => {
|
||||
it('无缓存按需分页,原 General 计量只标复用;旧失败和未记录步骤独立展示', async () => {
|
||||
const fetcher = vi.fn<typeof fetch>(async input =>
|
||||
response(
|
||||
String(input).includes('cursor=opaque')
|
||||
? validationHistoryFixture([validationExecutionFixture('old-run')])
|
||||
: validationHistoryFixture([physicalHistoryFixture], { nextCursor: 'opaque' })
|
||||
)
|
||||
)
|
||||
vi.stubGlobal('fetch', fetcher)
|
||||
wrapper = mount(KeyframeExecutionHistory, {
|
||||
props: { projectId: 'project', shotId: 'shot', keyframeId: 'keyframe', validationTaskId: 'task' }
|
||||
})
|
||||
await flushPromises()
|
||||
expect(fetcher).not.toHaveBeenCalled()
|
||||
await expand('执行记录')
|
||||
expect(wrapper.text()).toContain('仅补跑物理专项')
|
||||
expect(wrapper.text()).toContain('执行完成,质量待复核')
|
||||
expect(wrapper.text()).toContain('本次新提交步骤:物理关系;复用已有步骤:通用画面')
|
||||
await expand('通用画面')
|
||||
expect(wrapper.text()).toContain('原调用计量,不重复计入本次')
|
||||
await expand('高级详情')
|
||||
expect(wrapper.text()).toContain('输入词元:100')
|
||||
expect(wrapper.text()).toContain('复用来源执行:old-run')
|
||||
expect(wrapper.text()).not.toContain('合计词元:0')
|
||||
await wrapper
|
||||
.findAll('button')
|
||||
.find(item => item.text() === '加载更多')!
|
||||
.trigger('click')
|
||||
await flushPromises()
|
||||
expect(wrapper.text()).toContain('历史执行') // 显示历史行,具体错误由该执行本身提供
|
||||
expect(wrapper.text()).toContain('未记录本次步骤证据')
|
||||
expect(wrapper.text()).not.toContain('加载更多')
|
||||
expect(fetcher).toHaveBeenCalledTimes(2)
|
||||
expect(fetcher.mock.calls.every(([, init]) => init?.method === 'GET')).toBe(true)
|
||||
})
|
||||
it('当前关联不可用不选择第一条;归档步骤的未知范围不补成空计划', async () => {
|
||||
vi.stubGlobal(
|
||||
'fetch',
|
||||
vi.fn<typeof fetch>(async () =>
|
||||
response(
|
||||
validationHistoryFixture(
|
||||
[validationExecutionFixture('archive', { stepsEvidence: 'archived_audit' })],
|
||||
{ currentExecutionId: null, integrity: { currentExecution: 'unavailable' } }
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
wrapper = mount(KeyframeExecutionHistory, {
|
||||
props: { projectId: 'project', shotId: 'shot', keyframeId: 'keyframe', validationTaskId: 'task' }
|
||||
})
|
||||
await expand('执行记录')
|
||||
expect(wrapper.text()).toContain('当前执行关联需要核查')
|
||||
expect(wrapper.text()).toContain('执行范围未记录')
|
||||
expect(wrapper.text()).toContain('本次新提交步骤:未记录')
|
||||
expect(wrapper.text()).toContain('已核对的历史审计')
|
||||
expect(wrapper.text()).not.toContain('当前执行 ·')
|
||||
})
|
||||
it('只接收同一范围的实时变化,终态只刷新首屏一次,不新建 SSE', async () => {
|
||||
const fetcher = vi.fn<typeof fetch>(async () => response(validationHistoryFixture([physicalHistoryFixture])))
|
||||
vi.stubGlobal('fetch', fetcher)
|
||||
const source = vi.fn<() => void>()
|
||||
vi.stubGlobal('EventSource', source)
|
||||
wrapper = mount(KeyframeExecutionHistory, {
|
||||
props: { projectId: 'project', shotId: 'shot', keyframeId: 'keyframe', validationTaskId: 'task' }
|
||||
})
|
||||
await expand('执行记录')
|
||||
await wrapper.setProps({
|
||||
liveExecution: {
|
||||
...physicalHistoryFixture.execution,
|
||||
id: 'foreign-run',
|
||||
metadata: { validationTaskId: 'other-task', shotId: 'shot', keyframeId: 'keyframe' }
|
||||
}
|
||||
})
|
||||
await flushPromises()
|
||||
expect(fetcher).toHaveBeenCalledTimes(1)
|
||||
await wrapper.setProps({ latestExecutionId: 'new-run' })
|
||||
await flushPromises()
|
||||
expect(fetcher).toHaveBeenCalledTimes(2)
|
||||
await flushPromises()
|
||||
expect(fetcher).toHaveBeenCalledTimes(2)
|
||||
expect(source).not.toHaveBeenCalled()
|
||||
})
|
||||
it('人工终止旧任务可读空列表,刷新候选摘要不卸载已展开的正式执行记录', async () => {
|
||||
let pending = false
|
||||
let resolveHistory!: (value: Response) => void
|
||||
const task = {
|
||||
id: 'task',
|
||||
status: 'running',
|
||||
output: null,
|
||||
error: null,
|
||||
createdAt: '2026-11-07',
|
||||
legacyTermination: {
|
||||
auditId: 'audit',
|
||||
terminatedAt: '2026-11-07',
|
||||
billingFinding: 'unresolved',
|
||||
requiresNewAuthorization: true
|
||||
}
|
||||
}
|
||||
const fetcher = vi.fn<typeof fetch>(async input => {
|
||||
const path = String(input)
|
||||
if (path.includes('/executions?'))
|
||||
return response(
|
||||
validationHistoryFixture([], {
|
||||
total: 0,
|
||||
currentExecutionId: null,
|
||||
taskStatus: 'running',
|
||||
integrity: { currentExecution: 'not_recorded' }
|
||||
})
|
||||
)
|
||||
if (path.includes('/validations'))
|
||||
return pending
|
||||
? new Promise(resolve => {
|
||||
resolveHistory = resolve
|
||||
})
|
||||
: response([task])
|
||||
return response({
|
||||
validationTaskId: 'task',
|
||||
qualityDecision: 'unknown',
|
||||
effectiveQualityStatus: 'unknown',
|
||||
historicalGazePreview: [],
|
||||
manualReviewAvailable: false
|
||||
})
|
||||
})
|
||||
vi.stubGlobal('fetch', fetcher)
|
||||
wrapper = mount(KeyframeValidationHistory, {
|
||||
props: { projectId: 'project', shotId: 'shot', keyframeId: 'keyframe', initialOpen: true }
|
||||
})
|
||||
await flushPromises()
|
||||
await expand('执行记录')
|
||||
expect(wrapper.text()).toContain('暂无已保存的执行记录')
|
||||
expect(wrapper.text()).toContain('历史审核已人工终止')
|
||||
const original = wrapper.findComponent(KeyframeExecutionHistory).vm.$.uid
|
||||
pending = true
|
||||
wrapper.findComponent(ReadonlyInspection).vm.$emit('refresh')
|
||||
await flushPromises()
|
||||
expect(wrapper.findComponent(KeyframeExecutionHistory).vm.$.uid).toBe(original)
|
||||
expect(wrapper.text()).toContain('暂无已保存的执行记录')
|
||||
resolveHistory(response([task]))
|
||||
await flushPromises()
|
||||
expect(fetcher.mock.calls.filter(([input]) => String(input).includes('/executions?'))).toHaveLength(1)
|
||||
expect(fetcher.mock.calls.every(([, init]) => init?.method === 'GET')).toBe(true)
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,230 @@
|
||||
import { effectScope, ref } from 'vue'
|
||||
import { flushPromises } from '@vue/test-utils'
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest'
|
||||
import { useValidationExecutions } from '@/features/production/useValidationExecutions'
|
||||
import { qualityApi } from '@/features/production/quality-api'
|
||||
import type { ValidationExecutionHistory } from '@/features/production/validation-executions.types'
|
||||
|
||||
/** 隔离范围包含完整资源路径,不能复用其他任务的游标。 */
|
||||
const target = ['project', 'shot', 'keyframe', 'task'] as const
|
||||
/** 创建单页正式响应,旧执行保持自己的失败结果。 */
|
||||
function page(ids: string[], current = 'new', cursor: string | null = null): ValidationExecutionHistory {
|
||||
return {
|
||||
projectId: target[0],
|
||||
shotId: target[1],
|
||||
keyframeId: target[2],
|
||||
validationTaskId: target[3],
|
||||
taskStatus: 'running',
|
||||
currentExecutionId: current,
|
||||
total: 3,
|
||||
integrity: { currentExecution: 'valid' },
|
||||
nextCursor: cursor,
|
||||
items: ids.map(id => ({
|
||||
execution: {
|
||||
id,
|
||||
projectId: target[0],
|
||||
workflowName: 'shot-keyframe-validation',
|
||||
status: id === 'new' ? 'running' : 'failed',
|
||||
stage: 'vision',
|
||||
current: 1,
|
||||
total: 2,
|
||||
currentResourceId: null,
|
||||
metadata: { validationTaskId: target[3], shotId: target[1], keyframeId: target[2] },
|
||||
result: null,
|
||||
error: id === 'new' ? null : '旧执行失败',
|
||||
startedAt: null,
|
||||
completedAt: null,
|
||||
createdAt: '2026-11-07T00:00:00Z',
|
||||
updatedAt: '2026-11-07T00:00:00Z'
|
||||
},
|
||||
isCurrent: id === current,
|
||||
mode: 'unknown',
|
||||
scheduledSteps: null,
|
||||
reusedSteps: null,
|
||||
steps: null,
|
||||
stepsEvidence: 'not_recorded'
|
||||
}))
|
||||
}
|
||||
}
|
||||
/** 解包模拟响应,不调用任何真实 API。 */
|
||||
function response(data: unknown, status = 200) {
|
||||
return new Response(
|
||||
JSON.stringify(
|
||||
status === 200 ? { data } : { message: '读取失败', code: 'KEYFRAME_VALIDATION_EXECUTION_CONFLICT' }
|
||||
),
|
||||
{ status }
|
||||
)
|
||||
}
|
||||
let scope = effectScope()
|
||||
afterEach(() => {
|
||||
scope.stop()
|
||||
scope = effectScope()
|
||||
localStorage.clear()
|
||||
vi.unstubAllGlobals()
|
||||
})
|
||||
describe('正式首帧执行分页', () => {
|
||||
it('API 编码完整目标,显式传项目、limit 与原样游标', async () => {
|
||||
const fetcher = vi.fn<typeof fetch>().mockResolvedValue(response(page([])))
|
||||
vi.stubGlobal('fetch', fetcher)
|
||||
await qualityApi.keyframeExecutions(
|
||||
's/a',
|
||||
'k/b',
|
||||
't/c',
|
||||
{ projectId: 'p/d', limit: 20, cursor: 'opaque_A-1' },
|
||||
new AbortController().signal
|
||||
)
|
||||
expect(String(fetcher.mock.calls[0]![0])).toBe(
|
||||
'/api/storyboard-shots/s%2Fa/keyframes/k%2Fb/validations/t%2Fc/executions?projectId=p%2Fd&limit=20&cursor=opaque_A-1'
|
||||
)
|
||||
expect(fetcher.mock.calls[0]![1]?.method).toBe('GET')
|
||||
})
|
||||
it('默认关闭不读取,不读本机缓存;打开后按游标加载并去重,不按 total 猜测页数', async () => {
|
||||
const fetcher = vi
|
||||
.fn<typeof fetch>()
|
||||
.mockImplementation(async input =>
|
||||
response(
|
||||
String(input).includes('cursor=opaque')
|
||||
? { ...page(['new', 'old'], 'later'), total: 9 }
|
||||
: page(['new'], 'new', 'opaque')
|
||||
)
|
||||
)
|
||||
vi.stubGlobal('fetch', fetcher)
|
||||
const key = ref('')
|
||||
localStorage.setItem(
|
||||
'vision-executions:' + JSON.stringify(['shot', 'keyframe', 'project']),
|
||||
JSON.stringify([{ taskId: 'fake', executionId: 'fake' }])
|
||||
)
|
||||
const history = scope.run(() => useValidationExecutions(key))!
|
||||
await flushPromises()
|
||||
expect(fetcher).not.toHaveBeenCalled()
|
||||
key.value = JSON.stringify(target)
|
||||
await flushPromises()
|
||||
expect(history.items.value.map(item => item.execution.id)).toEqual(['new'])
|
||||
await Promise.all([history.loadMore(), history.loadMore()])
|
||||
await flushPromises()
|
||||
expect(history.items.value.map(item => item.execution.id)).toEqual(['new', 'old'])
|
||||
expect(history.data.value?.currentExecutionId).toBe('later')
|
||||
expect(history.items.value.some(item => item.isCurrent)).toBe(false)
|
||||
expect(history.nextCursor.value).toBeNull()
|
||||
await history.loadMore()
|
||||
expect(fetcher).toHaveBeenCalledTimes(2)
|
||||
})
|
||||
it('切项目或任务清空旧页并取消旧请求,迟到 404 不影响新范围', async () => {
|
||||
let resolveOld!: (value: Response) => void
|
||||
let oldSignal: AbortSignal | undefined
|
||||
const fetcher = vi.fn<typeof fetch>().mockImplementation(async (input, init) => {
|
||||
if (String(input).includes('/task/')) {
|
||||
oldSignal = init?.signal as AbortSignal
|
||||
return new Promise(resolve => {
|
||||
resolveOld = resolve
|
||||
})
|
||||
}
|
||||
return response({ ...page(['new']), validationTaskId: 'other-task', items: [] })
|
||||
})
|
||||
vi.stubGlobal('fetch', fetcher)
|
||||
const key = ref(JSON.stringify(target))
|
||||
const history = scope.run(() => useValidationExecutions(key))!
|
||||
await flushPromises()
|
||||
key.value = JSON.stringify(['project', 'shot', 'keyframe', 'other-task'])
|
||||
await flushPromises()
|
||||
resolveOld(response(null, 404))
|
||||
await flushPromises()
|
||||
expect(oldSignal?.aborted).toBe(true)
|
||||
expect(history.data.value?.validationTaskId).toBe('other-task')
|
||||
expect(history.error.value).toBe('')
|
||||
})
|
||||
it('切项目时同时更换完整资源身份,旧页回执和游标不能进入新项目', async () => {
|
||||
let resolveOld!: (value: Response) => void
|
||||
vi.stubGlobal(
|
||||
'fetch',
|
||||
vi.fn<typeof fetch>(async input => {
|
||||
if (new URL(String(input), 'http://localhost').searchParams.get('projectId') === 'project')
|
||||
return new Promise(resolve => {
|
||||
resolveOld = resolve
|
||||
})
|
||||
return response({
|
||||
...page([]),
|
||||
projectId: 'new-project',
|
||||
shotId: 'new-shot',
|
||||
keyframeId: 'new-keyframe',
|
||||
validationTaskId: 'new-task',
|
||||
currentExecutionId: null,
|
||||
integrity: { currentExecution: 'not_recorded' }
|
||||
})
|
||||
})
|
||||
)
|
||||
const key = ref(JSON.stringify(target))
|
||||
const history = scope.run(() => useValidationExecutions(key))!
|
||||
await flushPromises()
|
||||
key.value = JSON.stringify(['new-project', 'new-shot', 'new-keyframe', 'new-task'])
|
||||
await flushPromises()
|
||||
resolveOld(response(page(['new'], 'new', 'old-cursor')))
|
||||
await flushPromises()
|
||||
expect(history.data.value?.projectId).toBe('new-project')
|
||||
expect(history.items.value).toEqual([])
|
||||
expect(history.nextCursor.value).toBeNull()
|
||||
})
|
||||
it('刷新首屏中止旧翻页,新当前指针不被旧页回填,当前不在本页也不选第一条', async () => {
|
||||
let resolveMore!: (value: Response) => void
|
||||
let refreshed = false
|
||||
vi.stubGlobal(
|
||||
'fetch',
|
||||
vi.fn<typeof fetch>(async input => {
|
||||
if (String(input).includes('cursor='))
|
||||
return new Promise(resolve => {
|
||||
resolveMore = resolve
|
||||
})
|
||||
return response(refreshed ? page(['old'], 'outside') : page(['new'], 'new', 'opaque'))
|
||||
})
|
||||
)
|
||||
const history = scope.run(() => useValidationExecutions(ref(JSON.stringify(target))))!
|
||||
await flushPromises()
|
||||
const more = history.loadMore()
|
||||
await flushPromises()
|
||||
refreshed = true
|
||||
await history.refresh()
|
||||
resolveMore(response(page(['older'])))
|
||||
await more
|
||||
expect(history.items.value.map(item => item.execution.id)).toEqual(['old'])
|
||||
expect(history.items.value[0]?.isCurrent).toBe(false)
|
||||
expect(history.data.value?.currentExecutionId).toBe('outside')
|
||||
})
|
||||
it.each([400, 404, 409])('翻页 %i 明确结束旧游标,不自动重试或 POST', async status => {
|
||||
const fetcher = vi.fn<typeof fetch>(async input =>
|
||||
String(input).includes('cursor=') ? response(null, status) : response(page(['new'], 'new', 'opaque'))
|
||||
)
|
||||
vi.stubGlobal('fetch', fetcher)
|
||||
const history = scope.run(() => useValidationExecutions(ref(JSON.stringify(target))))!
|
||||
await flushPromises()
|
||||
await history.loadMore()
|
||||
await history.loadMore()
|
||||
expect(history.nextCursor.value).toBeNull()
|
||||
expect(history.error.value).not.toBe('')
|
||||
expect(fetcher).toHaveBeenCalledTimes(2)
|
||||
expect(fetcher.mock.calls.every(([, init]) => init?.method === 'GET')).toBe(true)
|
||||
expect(history.items.value).toHaveLength(status === 400 ? 1 : 0)
|
||||
})
|
||||
it('损坏的归属和当前标记不进入列表;旧审核空列表合法', async () => {
|
||||
const fetcher = vi
|
||||
.fn<typeof fetch>()
|
||||
.mockResolvedValueOnce(
|
||||
response({ ...page(['old']), items: page(['old']).items.map(item => ({ ...item, isCurrent: true })) })
|
||||
)
|
||||
.mockResolvedValueOnce(
|
||||
response({
|
||||
...page([]),
|
||||
total: 0,
|
||||
currentExecutionId: null,
|
||||
integrity: { currentExecution: 'not_recorded' }
|
||||
})
|
||||
)
|
||||
vi.stubGlobal('fetch', fetcher)
|
||||
const history = scope.run(() => useValidationExecutions(ref(JSON.stringify(target))))!
|
||||
await flushPromises()
|
||||
expect(history.items.value).toEqual([])
|
||||
expect(history.error.value).not.toBe('')
|
||||
await history.refresh()
|
||||
expect(history.error.value).toBe('')
|
||||
expect(history.data.value?.integrity.currentExecution).toBe('not_recorded')
|
||||
})
|
||||
})
|
||||
@@ -167,10 +167,7 @@ describe('审核 GET 与 SSE 项目隔离', () => {
|
||||
)
|
||||
expect(vision.execution.data.value?.id).toBe('new-execution')
|
||||
expect(vision.state.value.active?.id).toBe('same-task')
|
||||
expect(vision.observedExecutions.value.map(item => item.executionId)).toEqual([
|
||||
'old-execution',
|
||||
'new-execution'
|
||||
])
|
||||
expect(localStorage.getItem('vision-executions:' + JSON.stringify(['s', 'k', 'multi']))).toBeNull()
|
||||
const state = visionState([
|
||||
task('new-execution', 'completed'),
|
||||
{ ...task('old-execution', 'failed'), id: 'older-task', recoveryRequired: true }
|
||||
|
||||
+107
@@ -0,0 +1,107 @@
|
||||
import type {
|
||||
ValidationExecutionHistory,
|
||||
ValidationExecutionHistoryItem
|
||||
} from '@/features/production/validation-executions.types'
|
||||
|
||||
/** 隔离任务的完整正式路径身份。 */
|
||||
export const executionHistoryTarget = ['project', 'shot', 'keyframe', 'task'] as const
|
||||
/**
|
||||
* 创建逐次证据的隔离执行,不调用 Provider。
|
||||
* @param id 正式执行编号
|
||||
* @param patch 本次已保存证据覆盖
|
||||
* @returns 执行公开 DTO
|
||||
*/
|
||||
export function validationExecutionFixture(
|
||||
id: string,
|
||||
patch: Partial<ValidationExecutionHistoryItem> = {}
|
||||
): ValidationExecutionHistoryItem {
|
||||
return {
|
||||
execution: {
|
||||
id,
|
||||
projectId: 'project',
|
||||
workflowName: 'shot-keyframe-validation',
|
||||
status: 'failed',
|
||||
stage: 'vision',
|
||||
current: 1,
|
||||
total: 2,
|
||||
currentResourceId: null,
|
||||
metadata: { validationTaskId: 'task', shotId: 'shot', keyframeId: 'keyframe' },
|
||||
result: null,
|
||||
error: '物理步骤回执尚待核查',
|
||||
startedAt: '2026-11-07T00:00:00Z',
|
||||
completedAt: '2026-11-07T00:01:00Z',
|
||||
createdAt: '2026-11-07T00:00:00Z',
|
||||
updatedAt: '2026-11-07T00:01:00Z'
|
||||
},
|
||||
isCurrent: false,
|
||||
mode: 'unknown',
|
||||
scheduledSteps: null,
|
||||
reusedSteps: null,
|
||||
steps: null,
|
||||
stepsEvidence: 'not_recorded',
|
||||
...patch
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 构造正式分页响应,当前指针独立于页内排序。
|
||||
* @param items 本页独立执行证据
|
||||
* @param patch 分页及当前指针覆盖
|
||||
* @returns 隔离接口响应数据
|
||||
*/
|
||||
export function validationHistoryFixture(
|
||||
items: ValidationExecutionHistoryItem[],
|
||||
patch: Partial<ValidationExecutionHistory> = {}
|
||||
): ValidationExecutionHistory {
|
||||
return {
|
||||
projectId: 'project',
|
||||
shotId: 'shot',
|
||||
keyframeId: 'keyframe',
|
||||
validationTaskId: 'task',
|
||||
taskStatus: 'completed',
|
||||
currentExecutionId: 'current-run',
|
||||
total: 2,
|
||||
items,
|
||||
integrity: { currentExecution: 'valid' },
|
||||
nextCursor: null,
|
||||
...patch
|
||||
}
|
||||
}
|
||||
/** 带通用复用与本次物理调用的正式证据。 */
|
||||
export const physicalHistoryFixture = validationExecutionFixture('current-run', {
|
||||
execution: {
|
||||
...validationExecutionFixture('current-run').execution,
|
||||
status: 'completed',
|
||||
current: 2,
|
||||
result: { passed: false, qualityDecision: 'needs_review' },
|
||||
error: null
|
||||
},
|
||||
isCurrent: true,
|
||||
mode: 'physical_retry',
|
||||
scheduledSteps: ['physical'],
|
||||
reusedSteps: ['general'],
|
||||
stepsEvidence: 'execution_snapshot',
|
||||
steps: [
|
||||
{
|
||||
name: 'general',
|
||||
status: 'completed',
|
||||
quality: 'passed',
|
||||
issues: [],
|
||||
error: null,
|
||||
usage: { inputTokens: 100, outputTokens: 10 },
|
||||
executionKind: 'reused',
|
||||
sourceExecutionId: 'old-run',
|
||||
usageAttribution: 'reused'
|
||||
},
|
||||
{
|
||||
name: 'physical',
|
||||
status: 'completed',
|
||||
quality: 'needs_review',
|
||||
issues: [{ code: 'visibility', description: '固定部件部分遮挡', severity: 'warning' }],
|
||||
error: null,
|
||||
usage: { inputTokens: 80 },
|
||||
executionKind: 'executed',
|
||||
sourceExecutionId: null,
|
||||
usageAttribution: 'this_execution'
|
||||
}
|
||||
]
|
||||
})
|
||||
Reference in new issue
Block a user