WIP: 作品管理与Phaser4客户端发布 #565
Draft
suzmii
wants to merge 36 commits from
feat/game-works-management into master
pull from: feat/game-works-management
merge into: GenarrativeAI:master
GenarrativeAI:master
GenarrativeAI:fix/agc-composer-layout
GenarrativeAI:fix/home-project-naming-async
GenarrativeAI:fix/agc-canvas-reference-insert
GenarrativeAI:contract-lease-refactor
GenarrativeAI:feat/pricing-plan
GenarrativeAI:feat/play-count-with-cache
GenarrativeAI:feat/pricing-plan-limit
GenarrativeAI:codex/payment-service-20261003
GenarrativeAI:codex/profile-invite-gate-fix
GenarrativeAI:codex/profile-invite-entry
GenarrativeAI:feat/agc-ui-motion-ux
GenarrativeAI:feat/ui-editor-model-override
GenarrativeAI:fix/agc-release-gate-channel
GenarrativeAI:fix/dev-loopback-token-trust
GenarrativeAI:feat/tribo3d-integeration
GenarrativeAI:fix/api-timeout
GenarrativeAI:codex/admin-gray-game-publish
GenarrativeAI:codex/remove-agc-codex-restrictions
GenarrativeAI:feat/gptimage2to2.5
GenarrativeAI:backup/agc-macos-dualarch-node-runtime
GenarrativeAI:feat/Crt_Ws
GenarrativeAI:codex/preview-llm-router-config
GenarrativeAI:fix/stroke-width-regression-from-285
GenarrativeAI:agent-organize
GenarrativeAI:feat/game-agent-canvas-resource-workbench-v2
GenarrativeAI:feat/agc-new-workflow
GenarrativeAI:fix/agc-release-version-sync
GenarrativeAI:codex/shared-components-followup
GenarrativeAI:codex/game-agent-runtime-interaction-design
GenarrativeAI:feat/spine-sequence-export-v2
GenarrativeAI:codex/game-agent-run
GenarrativeAI:codex/ui-spritesheet-durable-transaction-latest
GenarrativeAI:feat/art-agent-more-tools
GenarrativeAI:codex/editor-canvas-null-source-repair
GenarrativeAI:hotfix/editor-layout-2mib
GenarrativeAI:codex/showcase
No Reviewers
Labels
Clear labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Breaking change that won't be backward compatible
Something is not working
Documentation changes
Improve existing functionality
New functionality
This is security issue
Issue or pull request related to testing
Priority
Critical
1
The priority is critical
Priority
High
2
The priority is high
Priority
Low
4
The priority is low
Priority
Medium
3
The priority is medium
Reviewed
Confirmed
1
Issue has been confirmed
Reviewed
Duplicate
2
This issue or pull request already exists
Reviewed
Invalid
3
Invalid issue
Reviewed
Won't Fix
3
This issue won't be fixed
Status
Abandoned
3
Somebody has started to work on this but abandoned work
Status
Blocked
1
Something is blocking this issue or pull request
Status
Need More Info
2
Feedback is required to reproduce issue or to continue work
No Label
Milestone
No items
No Milestone
Projects
Clear projects
No project
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: GenarrativeAI/Genarrative#565
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "feat/game-works-management"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
关联 Issue: #470
状态
WIP。先建立持续可见的实现入口,后续按客户端上传、Web 作者管理、后台作品管理和真实栈验收逐步补齐。
当前范围
不变式
验收
真实 Phaser4 工程完成构建→归一化 ZIP→分片上传→送审;中断/重启恢复不重复创建游戏或版本;作者不能越权读取私有作品;后台可筛选分页并执行审核/下架/恢复;补齐定向测试、类型检查、schema、编码、文档索引、diff 和真实本地栈/客户端 smoke。
详细实施计划:docs/project-memory/plans/【实施计划】游戏作品管理与客户端发布收口-2026-09-30.md
- api-server 新增 GET /api/game-distribution/my-games/{gameId},作者可读自己名下审核中/被驳回/已下架/已撤回的作品 - 抽取 owner_game_entry_payload 统一作者条目形状,公开投影继续不携带版本私有状态 - 版本私有状态补 entryUrl 与 packageFileCount,供客户端作品详情展示版本历史与公开链接 - 主规范路由表登记新路由,并修正 /my-games 的错名 - 新增里程碑实施计划【实施计划】游戏作品管理与客户端发布收口-2026-09-30本轮实现已完成,仍保持 WIP:
自动验证:主站/后台/AGC typecheck;Web/后台 104 个定向测试;AGC 发布 27 个定向测试;api-server 游戏分发 33 个测试、spacetime-module 262 个过滤测试、shared-contracts 4 个测试;Rust fmt、schema、generated bindings、DTO parity、encoding、doc-index、diff check 均通过。真实 Web 未登录作者入口与后台登录入口已用 Chromium 冒烟;真实 AGC GUI 发布、生产开闸和 OSS 清理策略仍未验证。
补充修正:客户端发布现已对无 npm build 工作区的单文件项目主动失败,只支持 Phaser 4 + Vite;对应 Rust 门禁与导出测试已通过。
更正测试统计:spacetime-module 本次命令匹配到 0 个测试(262 个被过滤),不是 262 个通过;api-server 游戏分发 33 passed,shared-contracts 4 passed,AGC Phaser 门禁 5 + 4 passed。
真实验证边界不变:Web/后台已验证未登录入口与视觉渲染;作者登录后作品操作、后台登录后管理列表、真实 AGC GUI 发布、生产开闸和 OSS 清理仍待具备 warm token/真实客户端与生产条件后验证。
已同步最新 master 到功能分支并推送:\n- 合并提交:e471d4505(包含主线 DirectProject/Codex 相关更新);\n- 修复主线将 game_package_upload 拆到 runtime 后的发布进度接线冲突;\n- 合并后 Web/后台 104 个定向测试、AGC 发布 27 个定向测试、主站类型检查、AGC cargo check、Rust fmt、编码/文档/diff 门禁通过。
已按需求移除 AGC 发布入口的前端灰度阻断。DirectProject 工作台现在直接传递发布回调;仍保留 Tauri 宿主、项目原型完成、封面/资料校验、服务端鉴权与审核校验。
同时删除 read_game_publish_availability 原生命令、配置白名单与对应测试夹具。验证:入口/发布定向测试 29 passed,AGC typecheck、check-config、ESLint、Prettier、Rust fmt 和 encoding/diff 门禁通过。提交:618c69e76。
- 改动文件:apps/ai-game-creator-shell/tests/gameDistributionPublishPanel.test.tsx(仅此一个文件) - 写法替换:把 `Promise.withResolvers<unknown>()` 换成本地手写 deferred(`let settlePending` + `new Promise((resolve) => { settlePending = resolve })`),resolve 仍由外部持有、promise 仍交回测试,与原 onResolve/onReject 语义一致(原 reject 未被使用) - 为什么不改 tsconfig:`Promise.withResolvers` 需要 lib ES2024,而 apps/ai-game-creator-shell/tsconfig.json 是 target/lib ES2022;为单个测试把 lib 提到 ES2024 会改整个 AGC 客户端的编译目标与运行时假设,影响面远大于此处需求,故只在测试内手写等价 deferred - 验证:npm run agc:typecheck 五步全 0(check:tests:types → tsc -p tsconfig.json → skill-pack:check → bundled-resources:check → check-config.mjs)- export.rs:npm_export_tests 的 2 条用例(npm_package_contains_dist_project_root_assets_and_publish_readme、本批新增的 built_project_publish_payload_includes_uploaded_assets_and_prefers_dist_assets)不再用 std::env::var("HOME") 拼临时根,改用仓库既有约定的 crate::tests::canonical_test_tempdir - 动机:Windows 只设 USERPROFILE、不设 HOME 时,std::env::var("HOME").unwrap() 会以 NotPresent panic;改后与本批另 5 条 publish_export_tests 的临时根口径一致 - 未动断言:两条用例的断言与语义保持不变,只替换临时根来源(canonical_test_tempdir 同样返回 tempfile::TempDir,root.path() 用法不变) - 验证(同一命令 cargo test --locked --manifest-path apps/ai-game-creator-shell/src-tauri/Cargo.toml --bin genarrative-ai-game-creator-shell -- --test-threads=1 project::export::):HOME 未设置(env -u HOME)→ exit 0,test result: ok. 12 passed; 0 failed;HOME=C:/Users/dongy → exit 0,test result: ok. 12 passed; 0 failed - 顺带核对:project/verification.rs 仍有 1 处同名 HOME 写法,属其它模块范围,本次不动CI run 3295 结论(head
0bf84e288)一句话:CI run 3295 = 6 passed / 2 failed;两处失败均为 master 既有缺陷,与本 PR 无因果关系;本 PR 此前唯一的真实门禁红(AGC shell lane 的旧导出断言)已修复并转绿。
本轮失败项与出处
Backend tests(run 3295 / job 19355)cargo test --locked --workspace --exclude spacetime-module --no-fail-fast --manifest-path server-rs/Cargo.tomlcrates/api-server/src/external_mcp/semantic/tests.rs:33→assertion \left == right` failed/left: 32/right: 30`4b529a895「新增支付服务接入与订单收银台」(PR #597) 在docs/openapi/genarrative-external-v1.openapi.json追加了/api/external/v1/payment/orders与/api/external/v1/payment/orders/{orderId}两条外部操作,未标x-mcp-excluded,因此经external_mcp.rs的自动派生进入 MCP 工具表;而semantic/tests.rs的期望值未同步(MCP_OPERATIONS.len() == 30)。master 自身 run 3268 / job 19139 逐字相同。 紧随的names.len() == 45(实际 47)亦已过期,同源。Repository checks(run 3295 / job 19358)npm run check:repository-ci[check:nginx-spa-routes] FAILED - deploy/nginx/genarrative.conf 缺少 SPA 路由: /pay, /profile/payment(共 15 条诊断,涉及deploy/nginx/genarrative.conf、deploy/nginx/genarrative-dev-http.conf、deploy/container/nginx.conf)/pay、/profile/payment加进src/routing/activeAppPageRoutes.ts,但未同步 nginx 模板与 Pingora 网关 SPA 清单。master 自身 run 3268 / job 19142 相同。check:pingora-route-parity因 npm 链在该步中断而未执行;同一缺口同样存在于server-rs/crates/pingora-gateway/src/main.rs的MAIN_SPA_PATHS(12 条 vs 应为 14 条)。deploy/**、src/routing/**、server-rs/crates/api-server/src/external_mcp/**零差异,可在 master 上独立复现。本 PR 本轮修掉的门禁红
AI game creator shell Rust lane 2/2(run 3295 / job 19353)→ success。原用例project::export::npm_export_tests::npm_package_contains_only_dist_and_publish_readme的期望(仅 3 条目、不含项目根assets/**)与生产行为冲突;其对应的真实回归用例已随一次 master 合并被删除。现已改名为npm_package_contains_dist_project_root_assets_and_publish_readme并按契约文档口径扩断言,另补回 6 条发布前工程栈/导出用例。本轮主要内容
manifest.versions条数派生、面板只读;拆除projectVersion写链路与该手改命令。pitfalls.md4 条新条目)。真机核验(非测试替代)
真实 AGC 客户端(WebView2 + CDP)实测发布面板:「项目版本」输入框
value=4、readOnly=true、aria-readonly=true,与get_local_game_manifest的versions.length=4一致;面板并列显示「线上最近提交 v6 · 审核中」;面板内可编辑版本号输入框数量为 0;磁盘清单中遗留的projectVersion键已被抹除。本机环境项(不经由 CI,避免误读)
Windows 本机
check:git-hooks因临时目录EBUSY失败;AGC rust 分片 runner 会被一个 Windows 阻塞模态用例挂死(Linux CI 不受影响,本地改用等价分块跑)。两者均不经由 CI;本机 cargo 类门禁已在 featureless 档位下实跑通过。补充:CI run 3297(head
c4b3d2204)Backend tests←crates/api-server/src/external_mcp/semantic/tests.rs:33期望 30 实际 32;Repository checks←check:nginx-spa-routes缺/pay、/profile/payment;本批引入 = 0。check:pingora-route-parity仍因 npm 链在前一步中断而未执行(无报错原文,推定同类)。c4b3d2204补回 AGC 客户端发布/导出路径的 10 条机器级用例(project::export::本机 19 passed / 0 failed),CI 用例数1884 → 1894,两个 AGC Rust lane 均 success。base is ancestor of head满足(origin/master = ccd271572,盯梢期间未推进)。View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.