From 13efe5b786f32e8a49c710f456e430160406c210 Mon Sep 17 00:00:00 2001 From: GJ Date: Sat, 7 Nov 2026 21:19:41 +0800 Subject: [PATCH] =?UTF-8?q?feat(short-drama-agent-front):=20=E6=8E=A5?= =?UTF-8?q?=E5=85=A5=E7=8B=AC=E7=AB=8B=E6=9D=A5=E6=BA=90=E5=A4=8D=E6=A0=B8?= =?UTF-8?q?=E9=97=AD=E7=8E=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/b04-12-source-review-integration.md | 34 ++ .../production/components/KeyframeCard.vue | 26 +- .../components/KeyframeValidationHistory.vue | 3 + .../components/SourceReviewDrawer.vue | 378 ++++++++++++++++++ src/features/production/keyframe-vision.ts | 38 ++ src/features/production/quality.types.ts | 2 + src/features/production/source-review.ts | 193 +++++++++ src/features/production/useSourceReview.ts | 363 +++++++++++++++++ .../features/production/source-review.test.ts | 276 +++++++++++++ 9 files changed, 1312 insertions(+), 1 deletion(-) create mode 100644 docs/b04-12-source-review-integration.md create mode 100644 src/features/production/components/SourceReviewDrawer.vue create mode 100644 src/features/production/source-review.ts create mode 100644 src/features/production/useSourceReview.ts create mode 100644 tests/features/production/source-review.test.ts diff --git a/docs/b04-12-source-review-integration.md b/docs/b04-12-source-review-integration.md new file mode 100644 index 0000000..241f422 --- /dev/null +++ b/docs/b04-12-source-review-integration.md @@ -0,0 +1,34 @@ +# B04-12 旧主图独立新来源复核 + +## 接入范围 + +依据后端 dev 的 b04-12-primary-source-review-frontend-prompt.md、公开 shot-keyframe-source-review.md、正式 Router、SourceVisionApprovalSchema 和 service 实现。仅修改前端,未调用真实 Provider。 + +首帧卡片中的“按当前来源人工复核”适用于已完成 Primary,即使原来源过期仍可免费预检。复用 AppDrawer 固定底栏、内容滚动、NMessage、现有项目范围 WorkflowExecution/SSE 和正式分页执行历史。 + +- 原图、原件 SHA、原始 Provider 输入、旧 Vision、sourceChanges 与当前参考分开显示;新参考保留全部 bindings,不冒充原生成输入。 +- 每张物理参考逐项填写身份、结构、空间、动作、连续性;初始全部 unknown,不推断门轴,不将开关门当固定结构变化。 +- 人工保存绑定 expectedFingerprint、真实审核人、理由和全部观察;保存后回读原记录,原 status、原观察与当前 reviewStatus/current 分开。 +- 只有当前且 passed 的人工记录才读取免费机器计划;原图和计划的所有指纹、模型、全部步骤可审阅。 +- 费用批准独立登记。真实批准人、操作人、批准材料 SHA、CNY 范围均由用户填写;maxRequests 严格等于步骤数。更改范围撤销旧授权。 +- 执行必须再次明确确认,携带本次 authorizationId;恢复只携带正式历史提供的原 task ID 和 request fingerprint。未知费用不提供恢复。 +- 202 复用已有观察器;200 复用完整结果(含失败)。并发和断线沿用同候选提交保护,不自动重试、换模型或生图。 +- sourceReviewId 标识独立审核,按原 validationTaskId 展开完整执行历史;旧 Vision 的通过不显示为新来源通过。原 Primary 不被修改,仍需独立三镜/Production 验收。 +- 关闭、项目/镜头/候选切换取消免费查询,拒绝旧结果;人工回读先比对当前主图预检指纹,避免引用其他主图记录。 + +## 浏览器验收 + +自动化检查通过:105 个测试文件、782 项测试;lint、格式检查、类型检查和生产构建通过。新增 8 项来源审核测试,覆盖默认未知、明确批准、参数变更、范围切换、并发、断线保护、失败复用及真实组件的只读打开行为。 + +复用 localhost:4312 已有 Chrome 项目标签,真实操作全部为只读: + +- 2.1 人工记录显示人工来源观察通过;免费机器计划显示 qwen3.8-max、general/physical 两步。批准人、批准材料和金额无默认值,没有发起授权或 Vision。 +- 2.2 保留原 insufficient_evidence,展示 needs_review,机器计划入口禁用。 +- 原图与本次参考分区、逐图初始未知、旧 Vision 不冒充新来源、桌面和 375×667 内容滚动/固定底栏已核对。 +- 未提交人工观察、未签发真实费用批准、未执行模型、未改原 Primary 或旧 Vision。 + +## 已知契约边界 + +- 当前没有按首帧列出人工来源记录的接口,已有人工记录需输入真实 reviewId 回读;新机器任务的 sourceReviewId 可从正式审核历史追溯。不使用本机历史缓存补齐列表。 +- 人工记录 GET 未返回 shotId/keyframeId,页面用当前主图免费预检与原 expectedFingerprint 交叉核对,不匹配的原记录仅供追溯。 +- 当前计划不提供报价,金额及批准摘要必须来自真实人工批准,不自动估价或生成批准材料。 diff --git a/src/features/production/components/KeyframeCard.vue b/src/features/production/components/KeyframeCard.vue index 98e2b59..f0139f2 100644 --- a/src/features/production/components/KeyframeCard.vue +++ b/src/features/production/components/KeyframeCard.vue @@ -4,7 +4,8 @@ import ContextNotice from '../../../components/ui/ContextNotice.vue' import IssueHint from '../../../components/ui/IssueHint.vue' import { productionMessage } from '../production-messages' import { useKeyframeVision } from '../keyframe-vision' -import { computed, watch } from 'vue' +import { computed, ref, watch } from 'vue' +import SourceReviewDrawer from './SourceReviewDrawer.vue' import { useQuery } from '../../../composables/useQuery' import { qualityApi } from '../quality-api' import { NButton, NTag } from 'naive-ui' @@ -31,6 +32,15 @@ const props = defineProps<{ validationPassed: boolean | null confirming: boolean }>() +/** 用户显式打开来源复核,不能自动调用模型。 */ +const sourceReviewOpen = ref(false) +watch( + () => JSON.stringify([props.projectId, props.shotId, props.item.id]), + () => { + sourceReviewOpen.value = false + }, + { flush: 'sync' } +) /** 用户显式触发候选审核、确认或免费恢复。 */ const emit = defineEmits<{ recover: [] @@ -181,6 +191,13 @@ const canSelect = computed(

+ 按当前来源人工复核

{{ { recorded: '已保存生成输入', 'not-recorded': '历史生成输入未记录', invalid: '生成输入证据已失效' }[ @@ -244,4 +261,11 @@ const canSelect = computed( + diff --git a/src/features/production/components/KeyframeValidationHistory.vue b/src/features/production/components/KeyframeValidationHistory.vue index 8b293a5..dc5f0a9 100644 --- a/src/features/production/components/KeyframeValidationHistory.vue +++ b/src/features/production/components/KeyframeValidationHistory.vue @@ -445,6 +445,9 @@ const records = computed(() =>

{{ userFacingText(record.recoveryReason) }}

{{ userFacingText(record.error) }}

+

+ 独立新来源审核 · 人工记录 {{ record.sourceReviewId }}(与旧 Vision 分开存证) +