feat(frontend): add MS2 module skeleton with API contracts - #70
Merged
nighca merged 22 commits intoJul 31, 2026
Conversation
The MS2 frontend needs a reproducible workspace before any module code can land. Add the Vite entry, the pinned dependency manifest and lockfile, the three referenced TypeScript configs, and the ignore rules. The workspace installs and builds from a clean checkout.
Style and lint rules should be fixed before contributors start writing modules. Add the oxlint rule set and the oxfmt formatting profile for the frontend workspace. Formatting and lint results are identical on every machine and in CI.
The skeleton carries no test suite yet, but the test runner has to be wired for later work. Add the vitest config so it resolves the same path aliases as the application build. Tests can be added to any module without further setup.
Every upper layer needs a place for cross-module primitives that belong to no single domain. Add the shared layer with its pagination contract and a README stating what may live here. Modules have one agreed home for shared primitives instead of duplicating them.
The frontend has to state which business objects it owns and how each one is reached. Add one contract file per entity for character, project, task, generation, media, action template, playtest inspection and workflow run, plus the aggregate export. Upper layers depend on declared entity interfaces rather than on transport details.
The workflow steps the mentor reviewed need an explicit home separate from both entities and pages. Add contracts for character setup, generation, review, export and the workflow controller. Each use case has a named boundary that pages call instead of reaching into entities.
Routing targets have to exist before the application shell can wire them together. Add the home, projects, project detail, quick start, workflow editor, asset library, playtest and not found page modules. Every route in the product design maps to exactly one page module.
The page modules need a composition root that owns routing and layout. Add the app shell with its layout and route table, the browser entry point, and the base stylesheet. The application runs end to end and every page is reachable.
Reviewers need the branch checked automatically and a running preview to look at. Add the frontend workflow running lint, typecheck, test and build, and scope Vercel previews to frontend changes. Every pull request reports its own build status and preview URL.
The module boundaries and the interfaces expected from the backend must be reviewable without reading the code. Add the architecture document, the frontend README, and the API contract listing every endpoint the frontend calls. Backend and frontend can align on one written list of interfaces.
|
@huyanxius is attempting to deploy a commit to the huyan's projects Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
There was a problem hiding this comment.
Summary
No actionable findings in the PR diff. The frontend skeleton and its contracts are internally consistent for the stated scope.
Verification
npm run format:checkpasses.npm run lintpasses.npm run typecheckpasses.npm run testpasses with no test files.npm run buildpasses.- The reported Vercel status is blocked by external deployment authorization, not by a repository check failure.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
A run reopened after a refresh could not tell that a generation was still running, so the page had to either resubmit it or stall. Record the in-flight task id on WorkflowStep so it is saved with the run, and drop WorkflowTaskLink, which no structure ever held. Reopening a run recovers the pending task from its step instead of starting a second generation.
The vitest config sat outside every tsconfig include, so a type error in it would only surface when the runner started. Add it to the node project alongside the vite config. Both build-side configs are now covered by tsc -b.
A character is written when the user exports to the asset library, so it cannot hold work-in-progress state; the backend also returns no QC verdict and the product has no per-frame reject. Drop the action generation status, the frame qc and rejected fields, and the standalone playtest inspection entity; review now only reads frames. The asset tree describes confirmed assets only, and review results no longer need a second home.
Three structures carried assumptions a reader could not distinguish from settled decisions. State that multi-direction frame storage is undefined, that the MVP runs a single revision, and that an action id is unique only inside its outfit. Open questions are visible in the contracts instead of being rediscovered later.
The reduced module skeleton no longer includes playtest inspection or shared UI. Remove obsolete API and entity references and align the layout comment with app ownership. Documentation now matches the contracts and directories present in this branch.
The backend character contract has no standalone name field. Remove name from Character and CreateCharacterInput. The frontend now matches the confirmed character payload boundary.
The fixed workflow is not a backend resource. Remove WorkflowRunApis and update the public and controller contracts. Backend responsibilities now stop at generation and confirmed asset storage.
The API notes still described stale workflow and generation assumptions. Document frontend-owned workflow state, generation mapping, and assigned follow-ups. The architecture now reflects the latest backend reference and team decisions.
huyanxius
requested review from
johnnyzhang-eng,
minorcell,
nighca,
xiaocheny214 and
xyh202131
July 30, 2026 13:11
The backend scopes generation-task queries by both project and task identifiers. Add projectId to generation reads and task reads and subscriptions. Callers can now map directly to the documented task query endpoint.
Task lookup ownership is now confirmed against the backend API. Mark projectId plus taskId as resolved and remove the stale mismatch and question. Reviewers can see the current task query boundary without reopening the decision.
This was referenced Jul 30, 2026
This was referenced Jul 30, 2026
nighca
reviewed
Jul 31, 2026
后端 server 层只有 generation 一个模块,GenerationTask 是其中唯一的任务记录,
`/generation/tasks/{task_id}` 里的 tasks 只是路径段。前端却拆成 Generation 和
Task 两个平级实体,各带一半接口:前者有 create 和按 type 收窄的 result,
后者有 subscribe 但 result 是 unknown,两边还各维护一份逐字相同的 type 联合。
删除 entities/task,TaskStatus 与订阅接口并入 generation:
- TaskStatus 原名保留,后端枚举同名;与 WorkflowRevision.generationStatus 划界
- TaskEvent 改为 GenerationEvent,去掉 projectId——后端事件 payload 里没有
- Task、TaskType、TaskApis.get 删除,与 Generation 一侧完全重复
- WorkflowStep.taskId 类型改为 Generation['id'],字段名沿用后端 task_id
Generation.type 仍是前端三值、对不上后端两值,这在合并前就存在,另行处理。
nighca
approved these changes
Jul 31, 2026
nighca
left a comment
Contributor
There was a problem hiding this comment.
@huyanxius 因为 backend 的 PR 先合了,有冲突需要处理下
后端 1024XEngineer#64 合入 main 后根 .gitignore 出现 add/add 冲突。 根 .gitignore 取 main 版本(已含 .DS_Store),前端的依赖与构建产物由 frontend/.gitignore 负责。
Collaborator
Author
ok,冲突已解决 |
This was referenced Aug 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

取代 #69。内容与 #69 完全一致(逐字节比对无差异),区别只在提交历史:#69 是 84 个 commit 的迭代过程(加了又删的 provider session、加了又删的测试、多份中途作废的设计稿),这条分支从
main最新提交重新起,压成 10 条原子提交。Refs #58
Change Description
shared → entities → features → pages → app自底向上分层,每层只有一个index契约文件,不含业务实现。package-lock.json单文件占 3630 行)。Implementation Approach
index契约引用下层,不穿透到内部实现。add action/confirm action一类接口、造型与动作数据跟随 character 不单独建模。frontend/API_CONTRACT.md逐条列出前端调用的接口,其中若干条是前端预期有、后端 PR feat:module api skeletons #64 目前没有的,需要后端明确做或不做。Testing
本地执行了 CI 工作流中的全部步骤:
npm run format:check— 通过(38 个文件)npm run lint— 通过,无告警npm run typecheck— 通过npm run test— 通过(No test files found,退出码 0)npm run build— 通过(233.99 kB,146ms)Follow-ups