修复 #599:首页建项不再等待 AI 项目命名,改为后台条件改名 #606

Merged
suzmii merged 14 commits from fix/home-project-naming-async into master 2026-10-05 16:06:48 +08:00

14 Commits

Author SHA1 Message Date
suzmii a299252f2a 收口 #599 评审:文档补面板补读的门控条件、PR 正文用例数字与真实计数对齐
Project CI / AI game creator shell Rust crates (pull_request) Successful in 4m47s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 7m14s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 6m17s
Project CI / Frontend tests (pull_request) Successful in 3m16s
Project CI / Backend tests (pull_request) Successful in 7m37s
Project CI / AI game creator shell web tests (pull_request) Successful in 3m7s
Project CI / Repository checks (pull_request) Successful in 6m46s
Project CI / Native shell tests (pull_request) Successful in 9m3s
- 文档口径对齐:pitfalls 的「前端读快照的时序」边界与 decision-log 同段补上门控条件——面板打开时**仅当列表里确实存在在途命名行时才补读**(不给没有命名任务的项目多打一次账本 IPC,避免改变「轮询计数」这类外部可观测行为);不再写成「无条件补读」。
- PR #606 正文数字统一为实测值:测试节 asset_generation_task 22 例 → 27 例、conditional_project_rename_tests 6 例 → 7 例(并补上新用例名),验证节全量 1934 → 1964 passed / 17 skipped,合并段补上 76cd1f057(merge f47a8f305)。
- 用例计数命令与输出:cargo test … asset_generation_task → running 27 tests / 27 passed;cargo test … conditional_project_rename_tests → running 7 tests / 7 passed;静态计数(按测试模块内 #[test] 计数)同为 27 / 7;前端 npx vitest run homeProjectNamingAsync projectNamingGenerationTaskRow → 12 + 3 passed,appSurface.test.ts → 209 tests(200 passed / 9 skipped)。
- 本轮同时把分支合并到最新 origin/master tip 76cd1f057(merge f47a8f305,含 #608 Direct 交付合同重构与临时文档清理)——与本文档/hunk 无冲突,合并后 git merge-base --is-ancestor origin/master HEAD 返回 0。
- 未改动项(评审判定非阻塞):useHomeProjectCreation.ts 的改名 revision 回写沿用既有改名路径同形写法,本轮无改动。
- 门禁:cargo 定向 27 + 7、cargo fmt --check、agc:typecheck、lint:eslint(0 problems)、check:encoding、check:spacetime-schema(91 表)、git diff --check 全过;前端命名/面板 15 passed、appSurface 200 passed / 9 skipped。
2026-10-05 15:51:41 +08:00
suzmii f47a8f3054 Merge remote-tracking branch 'origin/master' into fix/home-project-naming-async 2026-10-05 15:45:05 +08:00
suzmii 67d06bc168 独立评审收口 #599:命名行事件时序、命名任务 update 门禁、失败关闭与 legacy 用例
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 8m1s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 5m35s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 4m21s
Project CI / Frontend tests (pull_request) Successful in 3m36s
Project CI / Backend tests (pull_request) Successful in 7m48s
Project CI / AI game creator shell web tests (pull_request) Successful in 3m12s
Project CI / Repository checks (pull_request) Successful in 7m2s
Project CI / Native shell tests (pull_request) Successful in 8m41s
- P2-2:命名行的账本订阅与恢复读合并为同一次 effect 的「先订阅、后读、只读一次」(与素材队列先订阅后派发同口径),并在「生成任务」面板打开且**确有在途命名行**时补读一次兜底——多读会改变既有生成任务链路可观测的轮询计数,因此不给没有命名任务的项目加读。新增 2 条 appSurface 用例(错过终态事件仍到终态 / 面板打开补读),并做了「改前红」验证:退回「先读后订阅 + 面板不补读」两条即红。
- P2-3:update_local_project_naming_task 补 project.rename 权限门禁(与 enqueue 同口径)、校验记录 project_id 与项目一致、终态只接受同状态幂等重放(completed→failed 一律 Err 且不写盘);新增 3 条 Rust 用例。
- P2-4:新增失败关闭与 schema 分支用例——超长项目名条件改名 Err 且 manifest/revision 不变、不支持 schemaVersion Err、缺 schemaVersion 按 v1 接受。
- P3-1:legacy v1 兼容用例改为断言兼容性质(字段原样保留),不再引用 phase 文案常量。
- 文档:pitfalls 补「兼容是单向的(旧构建读含命名记录的账本会整份失败,含影响面/触发条件/潜在低成本正向兼容方向)」与「先订阅后读快照」「update 门禁与终态语义」三条边界;decision-log 同步边界与数字。
- 门禁:AGC 全量 1964 passed / 17 skipped(appSurface 200 passed / 9 skipped);cargo asset_generation_task 27 passed、conditional_project_rename_tests 7 passed;agc:typecheck、lint:eslint(0 problems)、check:encoding、check:spacetime-schema、cargo fmt --check、git diff --check 全过。
2026-10-05 00:55:29 +08:00
suzmii d550d882d4 合并 master 6c9566058:保留 v2 账本/命名任务与 master 侧改动
Project CI / AI game creator shell Rust crates (pull_request) Successful in 4m17s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 5m44s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 7m26s
Project CI / Frontend tests (pull_request) Successful in 2m58s
Project CI / Backend tests (pull_request) Successful in 7m24s
Project CI / Repository checks (pull_request) Successful in 6m23s
Project CI / AI game creator shell web tests (pull_request) Successful in 3m47s
Project CI / Native shell tests (pull_request) Successful in 9m34s
- 冲突仅在 docs/project-memory/shared-memory/decision-log.md 与 pitfalls.md(双方都在顶部追加条目):两边条目全部保留——本分支的 Issue 599 条目(AI 项目命名解耦 / 生成任务账本 taskType + live 集合)在前,master 侧新增条目(发布版本标签派生、随包 plugins feature 档位、.worktrees 下 Vite 忽略规则、并发 dev 栈、Windows 阻塞模态用例)原样保留,逐条核对无丢失。
- 其余文件(desktop.rs、check-config.mjs、view/project-development/index.tsx、src-tauri 多处、admin-web、game distribution 等)均为自动合并,无冲突。
- 合并后自证:v2 账本常量/命令注册/命名任务命令名/条件改名空 expected 校验/entrySettled 顺序/命名行与事件刷新/三个测试文件的关键断言全部在位(脚本逐条核对 ALL_OK)。
2026-10-04 23:37:57 +08:00
suzmii 93deb694b0 Merge remote-tracking branch 'origin/master' into fix/home-project-naming-async
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 8m30s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 5m18s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 6m25s
Project CI / Frontend tests (pull_request) Successful in 2m33s
Project CI / Backend tests (pull_request) Successful in 7m46s
Project CI / AI game creator shell web tests (pull_request) Successful in 3m33s
Project CI / Repository checks (pull_request) Successful in 7m33s
Project CI / Native shell tests (pull_request) Successful in 10m6s
2026-10-04 18:56:12 +08:00
suzmii cd07b7375a 修复 Repository checks 的 ESLint 报错:import 顺序按 simple-import-sort 归位
Project CI / Backend tests (pull_request) Failing after 22s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 7m33s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 5m30s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 4m14s
Project CI / Repository checks (pull_request) Failing after 34s
Project CI / Frontend tests (pull_request) Successful in 3m39s
Project CI / AI game creator shell web tests (pull_request) Successful in 3m43s
Project CI / Native shell tests (pull_request) Successful in 9m12s
- CI「Repository checks」红在 lint:eslint:apps/ai-game-creator-shell/src/view/project-development/index.tsx 的 import 顺序未按 simple-import-sort 排序(type 导入与值导入混排)。
- 只调整该文件 import 顺序(1 行),无行为改动;已实跑 npm run lint:eslint(0 problems)、npx prettier --check、homeProjectNamingAsync + projectNamingGenerationTaskRow 15 passed、npm run agc:typecheck。
2026-10-04 18:35:55 +08:00
suzmii 160b7e6cfa Merge remote-tracking branch 'origin/master' into fix/home-project-naming-async
Project CI / AI game creator shell Rust crates (pull_request) Successful in 6m11s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 6m33s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 8m34s
Project CI / Frontend tests (pull_request) Successful in 2m35s
Project CI / Backend tests (pull_request) Successful in 9m11s
Project CI / AI game creator shell web tests (pull_request) Successful in 3m20s
Project CI / Repository checks (pull_request) Failing after 4m28s
Project CI / Native shell tests (pull_request) Successful in 8m8s
2026-10-04 17:25:27 +08:00
suzmii 3dcfbb1d10 合并 origin/master(33552d2ed):文档冲突两边条目都保留
- 冲突仅在 docs/project-memory/shared-memory/decision-log.md 与 pitfalls.md(双方都在文件顶部追加最新条目)。
- 解决方式:两边条目全部保留——本分支的 Issue 599 条目(AI 项目命名解耦 / 生成任务账本 taskType)在前,master 侧的新条目(#604 游戏游玩次数两条、#602 AGC 画布引用、AGC 渠道更新两条)原样保留,逐条核对无丢失。
2026-10-04 17:17:30 +08:00
suzmii a554b0c7ca 把 AI 项目命名接进「生成任务」体系:账本 v2 任务类型、命名任务入队与推进、面板命名行
- 账本 v2:记录新增 taskType(asset-generation / project-naming,缺省 asset-generation,旧壳按素材任务读回),kind 改为可选;schema 升 agc-asset-generation-task.v2,读取同时接受 v1 与 v2。
- 新增 enqueue_local_project_naming_task / update_local_project_naming_task:命名任务入队时登记 live、终态写盘后摘除(写盘失败只回滚本轮插入),中断残留按命名口径收口为 failed(文案不含「目标素材」)。
- 首页命名链路改为推进这条任务:入队 → 命名中 → 已完成(已应用 AI 名称 / 建议名与现状一致 / 用户已手动改名而跳过)或失败(无可用名称 / 自动改名失败,均保留兜底名);账本只作展示旁路,推进失败只写诊断日志。
- 前端模型与面板支持命名行:按 taskType 把命名记录从素材任务分支剔除,命名行固定展示名「AI 项目命名」、只在终态显示结论、不渲染缩略图/提示词/定位动作;命令名写字面量以满足 check-config 静态枚举门禁。
- 工作台订阅账本变更事件做一次受控快照读取刷新命名行(不新增固定频率轮询);另修:命名行的 useLiveNow 收进独立组件,避免行种类变化导致 hooks 数量变化。
- 测试:homeProjectNamingAsync 12 例(新增入队→命名中→终态推进序列断言)、projectNamingGenerationTaskRow 3 例、appSurface 建项后命名行可见 + 事件刷新出终态结论 + 标题/列表同步;Rust asset_generation_task 22 例(含 naming_task_stays_in_flight_across_ledger_reads_until_terminal、legacy_v1_ledger_reads_back_*)。
- 文档:decision-log 改写为「生成任务体系里的后台任务」、pitfalls 新增 taskType/live 集合条目、实施计划专题补任务接入口径。
- 门禁:AGC 全量 1925 passed / 17 skipped;cargo 定向 22 + 6;npm run agc:typecheck(含 check:tests:types 与 check-config);cargo fmt --check;check:encoding;git diff --check。
2026-10-04 16:59:59 +08:00
suzmii 459fe5b432 Merge remote-tracking branch 'origin/fix/ci-master-red' into fix/home-project-naming-async
Project CI / AI game creator shell Rust crates (pull_request) Successful in 2m8s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 3m35s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 5m51s
Project CI / Frontend tests (pull_request) Successful in 3m17s
Project CI / Backend tests (pull_request) Successful in 6m24s
Project CI / Native shell tests (pull_request) Successful in 7m27s
Project CI / AI game creator shell web tests (pull_request) Successful in 2m56s
Project CI / Repository checks (pull_request) Successful in 6m15s
2026-10-04 03:39:42 +08:00
suzmii 4144c04b1c 自审收口 #599:空 expected 失败关闭、异步回填生命周期守卫、合并 master 后过测试类型门禁
Project CI / AI game creator shell Rust crates (pull_request) Successful in 3m0s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 3m49s
Project CI / Backend tests (pull_request) Failing after 3m43s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 6m23s
Project CI / Frontend tests (pull_request) Successful in 3m11s
Project CI / Repository checks (pull_request) Failing after 4m13s
Project CI / AI game creator shell web tests (pull_request) Successful in 3m5s
Project CI / Native shell tests (pull_request) Successful in 7m13s
- 合并 origin/master tip ccd271572(merge commit eeac2c759),无冲突;本分支不修 master 既有共享红(check:nginx-spa-routes / external_mcp::semantic 32 与 30 / http_tracing 偶发 / AGC Rust shard 4/4,由 fix/ci-master-red 处理)。
- 按 master 新增的测试类型门禁(check:tests:types)把两处直接赋值 window.__TAURI__ 迁到 installTauriRuntime / resetTauriRuntime(tests/tauriRuntimeFake.ts 是全仓唯一安装点),否则 appSurface/home.suite.ts 报 TS2322。
- Rust:rename_local_game_project_if_unchanged_at 对空 expectedProjectId / expectedName 按仓库同类入口口径失败关闭(不再静默 renamed:false);非空但不匹配仍是正常跳过。新增 1 条单测,含「非空不匹配不是错误」的反向保护。
- 前端:applyAutomaticProjectName 在 await entrySettled 之后加壳生命周期守卫(mounted + 代次,与 enterProjectDevelopment 同口径):关窗 / 卸载后只保留已落盘的改名,不再写当前项目上下文、不再重检最近项目。新增 2 条 hook 用例(unmount / pagehide),去掉守卫即变红。
- 注释口径:把 suggestName 判据与 ProjectStartMode 的映射写清(planning 覆盖「做方案」与勾选「策划补全」的「做游戏」,见 view/home/homeStartMode.ts),行为不变。
- 文档:decision-log 的验证数字更新为 12 例 / 6 例 / 全量 1922 passed,并补记生命周期守卫与空 expected 口径。
- 定向验证:homeProjectNamingAsync 12 passed;appSurface.test.ts 197 passed / 9 skipped;AGC 全量 1922 passed / 17 skipped;cargo conditional_project_rename_tests 6 passed;cargo fmt --check、npm run agc:typecheck(含 check:tests:types)、check:encoding、git diff --check 全过。
2026-10-04 00:38:34 +08:00
suzmii eeac2c759a Merge remote-tracking branch 'origin/master' into fix/home-project-naming-async 2026-10-04 00:21:43 +08:00
suzmii 6c7033221d 补充 #599 自审回归用例:用户已切到别的工作区时后台改名不劫持上下文
Project CI / Backend tests (pull_request) Failing after 22s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 3m5s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 4m14s
Project CI / Repository checks (pull_request) Failing after 15s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 4m46s
Project CI / Frontend tests (pull_request) Successful in 2m7s
Project CI / Native shell tests (pull_request) Successful in 7m10s
Project CI / AI game creator shell web tests (pull_request) Successful in 3m3s
- 新增用例 does not hijack the project the user already moved to when the AI name lands:后台 AI 名称落定时若当前项目上下文已是另一个工作区(看门狗解围后打开别项目走同一条「上下文已被接管」判据),只重检刚建工作区的最近项目行,不把用户切走的上下文换成刚建的工作区。
- 该用例经反向证伪:临时去掉 applyAutomaticProjectName 的项目路径守卫后失败(projectName 由 另一个项目 变成 星河远征),随后已还原源码。
- 自审复核结论(无代码改动):entrySettled 在预检失败、建项失败、看门狗让位、进项目失败、成功五条路径都由建项主体的 finally 落定;看门狗与后台 creation 竞速没有重复 rememberRecentWorkspace、没有未捕获拒绝;expectedName 取建项回传的 manifest.name(与宿主落盘同源,宿主侧 trim 为 no-op);新命令已注册且旧 rename_local_game_project 的调用方未受影响。
- 定向验证:homeProjectNamingAsync 10 passed;appSurface 两条相关用例 passed;cargo conditional_project_rename_tests 5 passed;cargo fmt --check 与 npm run agc:typecheck 通过。
2026-10-04 00:11:25 +08:00
suzmii e3c91c4e2c 修复 #599:首页建项不再等待 AI 项目命名,改为后台条件改名
Project CI / Backend tests (pull_request) Failing after 17s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 2m31s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 4m6s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 5m9s
Project CI / Repository checks (pull_request) Failing after 30s
Project CI / Frontend tests (pull_request) Successful in 3m21s
Project CI / AI game creator shell web tests (pull_request) Successful in 3m24s
Project CI / Native shell tests (pull_request) Successful in 7m5s
- 首页自动建项:预检通过后立即以宿主兜底名创建工作区并进入项目,create_automatic_local_game_project 固定传 name: null,不再等待 suggest_automatic_project_name。
- 命名请求在建项前并行打出,结果交给后台任务;命名慢、超时、失败或返回非法内容都不影响建项、附件导入与首轮创作。
- 新增 Rust 命令 rename_local_game_project_if_unchanged(expectedProjectId + expectedName 条件改名):项目 ID 不符、用户已手动改名、名称未变一律返回 renamed: false 并保持现状,空名/控制字符/超长失败关闭,改名不推进项目 revision。
- 后台改名结果等「建项主体收尾」再写当前项目上下文与最近项目行重检,避免被进项目的兜底上下文覆盖。
- 新增前端时序测试 tests/homeProjectNamingAsync.test.tsx(9 例,promise 闸门而非 sleep)与 appSurface 客户端流程用例。
- 新增 Rust 条件改名单测 5 例;更新实施计划专题、decision-log、pitfalls。

验证:npx vitest run apps/ai-game-creator-shell/tests/homeProjectNamingAsync.test.tsx(9 passed);npm run test -- apps/ai-game-creator-shell/tests(1910 passed / 17 skipped);cargo test --features=cocos-editor-execute,unity-editor-execute,godot-editor-execute --bin genarrative-ai-game-creator-shell conditional_project_rename_tests(5 passed);cargo check 同 features 通过;npm run agc:typecheck、cargo fmt --check、npm run check:encoding、git diff --check 全绿。
2026-10-03 19:44:00 +08:00