Skip to content

feat(workflow-run): add frontend execution foundation - #6

Draft
huyanxius wants to merge 11 commits into
feat/58-frontend-module-skeletonfrom
feat/workflow-run-core
Draft

feat(workflow-run): add frontend execution foundation#6
huyanxius wants to merge 11 commits into
feat/58-frontend-module-skeletonfrom
feat/workflow-run-core

Conversation

@huyanxius

@huyanxius huyanxius commented Jul 30, 2026

Copy link
Copy Markdown
Owner

Title: feat(workflow-run): add frontend execution foundation

Dependency

Feature Description

  • Add a frontend-owned WorkflowRun store with versioned local persistence and runtime validation.
  • Implement the first controller slice from character setup through character-template generation to candidate selection.
  • Recover in-flight backend tasks without allowing stale results or duplicate submissions.
  • Keep the controller facade stable while separating pure state transitions and the asynchronous task runtime.

Implementation Approach

  • Keep WorkflowRun state in memory with localStorage used only as a refresh-recovery mirror.
  • Call backend behavior only through injected GenerationApis and TaskApis; no fake success path is included.
  • Keep Workflow Editor, Quick Start automation, candidate selection, and the remaining five steps out of scope.
  • Align Character Setup with the workflow step input contract without introducing a cross-Feature dependency.

Testing

  • npm run format:check — passed (47 files)
  • npm run lint — passed
  • npm run typecheck — passed
  • npm run test — passed (5 files, 32 tests)
  • npm run build — passed
  • git diff --check 7a6515e...HEAD — passed
  • GitHub Actions Frontend CI — passed
  • Vercel — passed

[CX] Prompt & Review

  • Prompt summary: build the frontend-only WorkflowRun foundation first, integrate backend behavior only through existing entity APIs, and defer editor/page implementation.
  • AI review: architecture, unnecessary complexity, hardcoding, maintainability, and async race paths were checked; no blocker or major finding remained.
  • Human review: pending; keep this PR in Draft.

Refs 1024XEngineer#58

Workflow execution needs a stable boundary between generation records and backend tasks.

Parse character-template results and bind generation IDs to task IDs.

Require subscriptions to replay a current snapshot before later updates.
Workflow execution needs a frontend-owned snapshot that can survive page refreshes.

Add the fixed step model, versioned local storage, and runtime hydration validation.

Keep memory authoritative when persistence fails or stored data is invalid.
Quick Start and the editor need one frontend-owned progression boundary.

Add character setup updates, generation submission, task recovery, and interruption handling.

Advance valid results to candidate selection without exposing unfinished steps.
Workflow state and async recovery need regression coverage before page integration.

Test persistence, submission deduplication, task replay, and interruption races.

Verify the first generation slice through the real store and controller.
The skeleton documentation no longer reflects the implemented workflow slice.

Record controller scope, recovery behavior, task replay, and local persistence limits.

Keep editor, Quick Start automation, and later steps explicitly out of scope.
The workflow controller mixed process coordination, state transitions, and asynchronous task recovery in one file.

Extract pure WorkflowRun transitions and the character-template task lifecycle behind the existing controller facade.

Keep the public API and runtime behavior unchanged while making later workflow steps easier to add.
The new pure state boundary needs direct regression coverage alongside the existing controller tests.

Cover fixed workflow creation, character setup normalization, and activation of the character-template step.

Protect the extracted rules without changing production behavior.
The Character Setup feature exposed the asset creation DTO while the workflow controller expects step-local input.

Change the submit callback to accept CharacterSetupStepInput.

Allow Quick Start and Workflow Editor to connect without translating through an unrelated asset contract.
The Character Setup boundary previously drifted to an unrelated asset DTO.

Add a type assertion for the submit callback parameter.

Prevent the page-to-workflow contract from regressing.
xiaocheny214 and others added 2 commits July 31, 2026 09:54
* feat: add backend skeleton

* ci: add backend CI workflow and naming convention gates

* feat: add backend skeleton

* docs: add module split document

Describe the backend package layout (common/framework/app) and the server domain module split: user, project, asset, character with action/character_template/wearable subdomains, generation and media. All modules currently define abstract interfaces only.

* feat: add unified response and global exception

Add the shared response/exception kernel in windup_common: Response/ListResponse unified bodies (HTTP always 200, business code in body), BizException base, ModelException for LLM calls, and the BizCode/ModelErrorType enums. Add the app-level global exception handlers that convert these into Response.fail.

* feat: add framework infrastructure scaffolding

Add windup_framework infrastructure abstractions: SQLAlchemy db base/session, config loaders (database/provider/storage), LLM provider protocols (chat/image/video) and Kodo object storage.

* feat: add server module api skeletons

Add abstract service interfaces and domain models for the server modules: user, project, asset, character (with action/character_template/wearable subdomains), generation and media. Drop the now-obsolete .gitkeep placeholders.

* refactor: remove health endpoint

Drop the placeholder health router and its registration in create_app; the web layer now revolves around the global exception handlers.

* build: add windup entrypoint and python-multipart dependency

Expose the windup CLI entrypoint (windup_app.bootstrap.app:main) and add python-multipart for form/file uploads; refresh uv.lock accordingly.

* docs: fix stale module paths in character service docstring

Point the sub-entity references at the nested character subpackages (character.action / character_template / wearable) instead of the old top-level paths.

* chore: drop unused imports

Remove unused imports flagged by ruff F401 in generation/interface.py and user/model.py.

* ci: split naming gate into its own workflow

将 validate-branch 与 validate-commits 从 backend.yml 拆到独立的 naming.yml。命名规范门禁不局限于 backend 范畴,应作为仓库级 CI 单独维护(PR review:@minorcell 建议)。

backend.yml 仅保留 lint-and-test;naming.yml 用独立 concurrency group 避免与 backend 共用 group 互相取消。

* docs: sync module-split with current design

Reflect character/media/generation/user module redesigns in the split
document.

* feat(generation): refine task types and SSE streaming

Replace strategy pattern with typed submit methods.

- model: add CharacterImageOutput/CharacterActionOutput/CharacterActionFrame
  as typed task results, remove generic GenerationResult
- interface: split submit into generate_character_image and
  generate_character_action with typed inputs
- document SSE streaming flow (GET /generation/tasks/{id}/stream)
  replacing frontend polling

* refactor(user): defer OAuth to future iteration

Remove OAuth abstract methods and models from UserService.

Commented-out methods: get_oauth_authorize_url, login_by_oauth,
bind_oauth, get_oauth_bindings. Related imports OAuthCallbackInput and
UserOAuth removed from interface. The OAuth region is preserved as a
placeholder for future extension.

* feat(media): add file upload to object storage

Add ObjectStorageMediaService implementing MediaService.

- service: upload to Kodo via KodoStorage adapter, auto-generated
  object keys with category prefix, no user filenames in keys
- app: register media router (POST /media/upload) in create_app

* refactor(media): implement Qiniu upload and deduplicate MediaCategory

- Remove dead storage module (empty __init__.py and kodo.py) from framework
- Implement actual Qiniu Kodo SDK upload in ObjectStorageMediaService
- Move MediaCategory to windup_common.enums.media, remove duplicate from media/model
- Update media __init__ to import MediaCategory from common

* fix(media): lazy-import qiniu SDK to avoid import-time failure

Move qiniu import inside upload() so module collection does not fail
when qiniu is not installed (e.g. CI test runs).

* feat(generation): update API contract models to match implementation

- CharacterImageInput: reference_image_url optional, add width/height/num_images
- CharacterImageOutput: unified type field, image_urls list (single element for one image)
- CharacterActionOutput: unified type field
- Generation API endpoint: request/response Pydantic models with size validation
- Stubs marked with TODO for actual implementation
后端 1024XEngineer#64 合入 main 后根 .gitignore 出现 add/add 冲突。
根 .gitignore 取 main 版本(已含 .DS_Store),前端的依赖与构建产物由 frontend/.gitignore 负责。
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