Skip to content

refactor(workflow-run): align persisted six-node graph - #175

Open
xyh202131 wants to merge 2 commits into
1024XEngineer:mainfrom
xyh202131:feat/workflow-run-six-node-graph
Open

refactor(workflow-run): align persisted six-node graph#175
xyh202131 wants to merge 2 commits into
1024XEngineer:mainfrom
xyh202131:feat/workflow-run-six-node-graph

Conversation

@xyh202131

@xyh202131 xyh202131 commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

改动内容

  • WorkflowRunApis 增加 listByProject(projectId, query)
  • 对齐后端 GET /workflow-runs?project_id=...&page=...&page_size=... 的分页响应。
  • 补充响应映射、查询参数和软删除列表语义测试。
  • 更新契约说明:后端当前提供项目内列表,但仍没有按 Character 查询或订阅接口;version 只是递增序号,不宣称并发冲突保护。
  • 为已合并的 WorkflowController 测试夹具补齐新增接口,不修改 Controller 业务逻辑。

为什么修改

PR #176 已在后端提供项目内 WorkflowRun 分页列表。前端需要真实暴露这项能力,避免先拉取单条或虚构按 Character 查询接口。

范围

仅 5 个文件:4 个 entities/workflow-run 文件和 1 个 Controller 测试夹具。已移除此前错误叠入的 Quick Start、Media、Generation、Asset Library、App 与 Shared API 变更。

验证

  • TypeScript 类型检查通过
  • oxlint 通过
  • 改动文件格式检查通过
  • 前端全量测试:27 个测试文件、192 项测试通过
  • 生产构建通过

@vercel

vercel Bot commented Aug 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
windup Ready Ready Preview Aug 10, 2026 3:23pm

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found two persisted-contract regressions in the six-node decoder. The targeted Vitest run could not be executed in this workspace because the local vitest binary returned Permission denied.

function isWorkflowNode(value: unknown): value is WorkflowNode {
return isCharacterNode(value) || isActionNode(value)
return (
isCharacterSetupNode(value) ||

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Preserve or migrate already-persisted two-node runs. The backend stores nodes as opaque JSON, and the previous frontend persisted type: 'character' / type: 'action' nodes with the old phases and generation roles. After this decoder only accepts the six new types, every existing WorkflowRun becomes an invalid-response on get/update. Add a legacy decoder plus migration/versioning before enforcing the new shape.

value.type === 'action-full-frame' &&
hasValidCommonNodeFields(value) &&
['ready', 'generating', 'completed'].includes(String(value.phase)) &&
hasOnlyGenerationRole(value, 'complete_animation')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Require a completed full-frame node to retain its animation reference. hasOnlyGenerationRole returns true for an empty generations array, so a passed/completed action-full-frame with no complete_animation task is accepted. Because this node has no separate output URL, that leaves the completed asset unrecoverable while the run still validates; require at least one reference when the phase is completed (or persist the output elsewhere).

@xyh202131

Copy link
Copy Markdown
Contributor Author

@fennoai 复审

@fennoai

fennoai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

复审结论

发现 3 个需要处理的问题:

  • P1 frontend/src/pages/workflow-editor/service.ts:1533d-to-2d 在调用 Controller 前直接抛错,因此用户的路线选择不会写入 action-generation-method 节点。PR 说明要求 3D 接口未提供时“只保存选择,不伪装已接通”;建议先持久化选择,再在启动完整动画生成前明确返回“接口尚未提供”,或让页面以未接通状态展示。
  • P1 frontend/src/entities/workflow-run/store.ts:436:PATCH 请求把顶层 status 硬编码为 'active'。完成、失败或中断的 Run 保存后,后端顶层状态仍会被覆盖成 active;这会让后端的状态筛选/列表结果与节点快照不一致。这里应发送 run.status,并补充非 active 状态的持久化测试。
  • P1 frontend/src/entities/workflow-run/store.ts:409frontend/src/entities/workflow-run/store.ts:422getByCharacterlist 固定只读取 page=1&page_size=100,但接口文档和 Store 注释承诺返回项目下“全部” Run。超过 100 条时,既可能找不到已存在的 Character 绑定 Run,也会静默丢失列表数据;建议按分页元数据继续拉取,或改用后端提供的精确查询接口。

验证

  • git diff --check 通过。
  • 未能运行 Vitest/TypeScript 检查:当前工作区未安装 frontend/node_modules,对应命令报 vitest/tsc: Permission denied

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant