Skip to content

refactor(workflow-controller): align six-node asset generation graph - #107

Open
xyh202131 wants to merge 8 commits into
1024XEngineer:mainfrom
xyh202131:feat/workflow-controller-coordinator
Open

refactor(workflow-controller): align six-node asset generation graph#107
xyh202131 wants to merge 8 commits into
1024XEngineer:mainfrom
xyh202131:feat/workflow-controller-coordinator

Conversation

@xyh202131

@xyh202131 xyh202131 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

本次更新

  • 工作流统一为六个真实节点:角色设定、角色母版、动作首帧、生成方式、完整动画、审核。
  • 节点关系通过 dependsOnNodeIds 明确保存,不再使用 Step、假 root 或数组位置推断边。
  • 动作首帧确认后必须选择 video-cropping3d-to-2d,再进入完整动画生成。
  • 多个 Action 以独立四节点分支并行存在;节点推进规则由前端 Controller 负责,后端只保存 WorkflowRun 图快照。
  • 已发布 Action 删除后不擦除历史:对应首帧、生成方式、完整动画和审核节点统一写入 deletedAt,角色母版及其他 Action 不受影响。
  • 异步持久化失败通过必填错误回调暴露,避免页面继续显示未落库的成功状态。

与 WorkflowRun 的关系

  • refactor(workflow-run): persist explicit node graph #86 已合并,无法继续追加提交;本 PR 是当前六节点 WorkflowRun 与 Controller 联动的开放审查入口。
  • 后端 CRUD 尚未真正实现前,不把内存运行态伪装成已完成服务端落库。
  • 旧 WorkflowRun 没有 deletedAt 时按未删除处理;空删除标记会被响应校验拒绝。

验证

  • TypeScript 类型检查通过。
  • oxlint(deny warnings)通过。
  • 全量前端测试:26 files / 169 tests 通过。
  • 生产构建通过。

@vercel

vercel Bot commented Aug 4, 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 8, 2026 4:44pm

@xyh202131
xyh202131 marked this pull request as ready for review August 4, 2026 06:45

@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.

Three concrete issues keep this flow from being reliable as-is.

}

const taskIds = requireStep(run, 'first-frame').candidateTaskIds
const terminals = await Promise.all(

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.

High: waitForTerminal subscribes only after it has already observed a non-terminal snapshot. If the generation completes in the gap between get() and subscribe(), that terminal event is missed and the promise can hang forever, which leaves start*/resume* calls stuck.

nextType: WorkflowStepType,
updatedAt: string,
): WorkflowRun {
return editCurrentRevision(run, updatedAt, (revision) => {

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.

High: this helper advances the current revision without checking whether the run was interrupted meanwhile. interruptRun() only flips the run status, so an in-flight generation that finishes later can still move an interrupted workflow forward behind the user's back.

if (current.status !== expectedRevisionStatus) return false
if (revisions.slice(0, -1).some((revision) => revision.status === 'active')) return false

// 运行中/已中断保留唯一当前步骤;终态不得继续挂着 active 步骤。

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.

Medium: the terminal-state check only looks for active steps. A completed run can still contain failed steps and pass validation, so corrupted or partially failed history can be hydrated/saved as if it were valid.

@huyanxius
huyanxius requested review from huyanxius and nighca August 7, 2026 07:04
@xyh202131
xyh202131 force-pushed the feat/workflow-controller-coordinator branch from 98daef0 to 2f73825 Compare August 7, 2026 07:37
@xyh202131 xyh202131 changed the title feat(workflow-controller): add resumable workflow coordination feat(workflow-controller): coordinate one workflow run Aug 7, 2026
@1024XEngineer 1024XEngineer deleted a comment from huyanxius Aug 7, 2026
@xyh202131

Copy link
Copy Markdown
Contributor Author

@fennoai 复审

@fennoai

fennoai Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Re-review Result

Found 1 issue on the updated PR.

  • Medium frontend/src/entities/workflow-run/api.ts:85: the WorkflowRun response validator accepts nodes whose status and phase contradict each other. For example, a character node with status: 'passed', phase: 'configuring_character', and selectedImageUrl: null passes validation because the selected image is required only when phase === 'completed'. The controller treats dependencies as satisfied solely via status === 'passed', so a corrupted persisted node can unlock downstream Action nodes without the confirmed character asset. Please make the validator enforce the status/phase matrix, especially passed => phase: 'completed' plus the selected asset, and add a regression test for this mismatch.

Verification:

  • Reviewed the fixed range ab6e8d1e31385bcccc9cd9c18b38469fd4b4a22b...2f73825642a0954c3536f0b247a27c16b7c84e99.
  • Confirmed the prior FennoAI findings were against an outdated file and the replacement controller addresses the subscription-before-GET and interrupt settlement races.
  • git diff --check passed locally.
  • Focused local Vitest run could not start in this checkout: vitest: Permission denied, with no local node_modules/vitest present. Collected GitHub checks for the head commit are green, including frontend checks and lint/test.

View job run

* 调用、后者等待用户逐步点击。Controller 不识别入口,也不保存第二份流程模型。
*/
export interface WorkflowController {
create(input: CreateWorkflowRunInput): Promise<WorkflowRun>

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.

有基于这套接口试着写一下 UI(如 Quick Start)那边的代码吗,会长成什么样?

问这个主要是发现这个 controller 不仅提供了 getWorkflow 用于读取 WorkflowRun 数据,还会让每一个修改方法也都返回 WorkflowRun 数据;我不确定哪个是使用方主要的获取 workflow-run 数据的渠道

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.

另外上面 AI review comment 记得处理 & resolve 下

@xyh202131
xyh202131 force-pushed the feat/workflow-controller-coordinator branch from 82ad6e4 to f603a04 Compare August 7, 2026 10:34
@xyh202131
xyh202131 force-pushed the feat/workflow-controller-coordinator branch from f603a04 to 3666fdb Compare August 8, 2026 07:52
@xyh202131 xyh202131 changed the title feat(workflow-controller): coordinate one workflow run refactor(workflow-controller): align five-node workflow graph Aug 8, 2026
@xyh202131 xyh202131 changed the title refactor(workflow-controller): align five-node workflow graph refactor(workflow-controller): align six-node asset generation graph Aug 8, 2026
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.

2 participants