refactor(workflow-run): align persisted six-node graph - #175
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| function isWorkflowNode(value: unknown): value is WorkflowNode { | ||
| return isCharacterNode(value) || isActionNode(value) | ||
| return ( | ||
| isCharacterSetupNode(value) || |
There was a problem hiding this comment.
[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') |
There was a problem hiding this comment.
[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).
|
@fennoai 复审 |
复审结论发现 3 个需要处理的问题:
验证
|
fe59987 to
e9033c0
Compare
8db0488 to
367a856
Compare
改动内容
WorkflowRunApis增加listByProject(projectId, query)。GET /workflow-runs?project_id=...&page=...&page_size=...的分页响应。version只是递增序号,不宣称并发冲突保护。为什么修改
PR #176 已在后端提供项目内 WorkflowRun 分页列表。前端需要真实暴露这项能力,避免先拉取单条或虚构按 Character 查询接口。
范围
仅 5 个文件:4 个
entities/workflow-run文件和 1 个 Controller 测试夹具。已移除此前错误叠入的 Quick Start、Media、Generation、Asset Library、App 与 Shared API 变更。验证