Skip to content

feat(workflow-run): add versioned history store - #85

Closed
xyh202131 wants to merge 3 commits into
1024XEngineer:mainfrom
xyh202131:feat/workflow-run-core
Closed

feat(workflow-run): add versioned history store#85
xyh202131 wants to merge 3 commits into
1024XEngineer:mainfrom
xyh202131:feat/workflow-run-core

Conversation

@xyh202131

@xyh202131 xyh202131 commented Aug 3, 2026

Copy link
Copy Markdown

目的

只提交 WorkflowRun Entity 核心,为 Quick Start、Workflow Editor 和 History 提供同一份可恢复状态。

包含

  • WorkflowRun / WorkflowRevision / WorkflowStep 运行模型
  • 固定步骤顺序和状态常量
  • 版本化 localStorage Store
  • 按运行订阅与历史列表订阅
  • Revision 来源、重开步骤和引用步骤完整性校验
  • 防御性快照、异常存储降级和订阅隔离
  • 10 项 Store 单元测试

不包含

  • WorkflowController
  • Generation 请求或轮询
  • Quick Start / Workflow Editor / History 页面
  • Asset Library / Character 页面
  • Playtest
  • 架构文档或 README 修改
  • 后端改动

History 后续读取 WorkflowRun.revisions;Asset Library 后续读取确认后的 Character 资产树,二者保持独立。

验证

  • npm test(10 tests)
  • npm run lint
  • npm run typecheck
  • npm run build

本 PR 仅供审核,不执行合并。

@vercel

vercel Bot commented Aug 3, 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 3, 2026 6:57am

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

I found one issue in the workflow-run store validation.

Verification: npm run typecheck, npm run test, and npm run lint pass after npm ci (npm emitted a Node engine warning because this workspace is on Node v20.20.2 while react-router@8.3.0 declares Node >=22.22.0).

typeof value.id === 'string' &&
value.id.length > 0 &&
typeof value.projectId === 'string' &&
isNullableString(value.characterId) &&

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.

CreateWorkflowRunInput makes characterId and outfitId required for purpose: 'add_action', and the generation/export contracts rely on those IDs to target an existing character/outfit. This validator currently accepts nullable values for both fields regardless of purpose, so save() and hydration can persist an add_action run with null IDs; that run cannot safely generate first frames/animations or recover after refresh. Please make the run validation purpose-aware, with a save/hydration test covering the add_action case.

@xyh202131 xyh202131 Aug 3, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

已独立核对并修复。WorkflowRun 现在按 purpose 使用判别联合:add_action 在类型层必须携带非空 characterId 和 outfitId;Store 运行时校验也要求两者同时存在,create_character 则只允许二者同时为空或同时存在。新增测试覆盖合法保存、缺失引用时拒绝保存,以及非法持久化数据无法 hydration。

@xyh202131

Copy link
Copy Markdown
Author

按拆分目录重新整理,本 PR 关闭且不合并;相同 WorkflowRun 核心将从新的独立分支重新提交审核。

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