WIP: 修复 AGC 原生壳 CI:同步 npm/Phaser 4 迁移与需求驱动视觉合同 #308
Reference in New Issue
Block a user
Delete Branch "fix/ci-native-shell-tests"
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?
背景
master 的 CI 从 2026-09-08 起持续红:
456cc42dd)成功1498247e9「AGC产物迁移npm与Phaser4」)Native shell tests 31 条失败1f904d28e#274「AGC 客户端 MCP 能力暴露」)Native shell tests 52 条失败失败原因
1. 产物迁移未同步测试(31 条)
1498247e9让新项目默认播种game/package.json+game/dist,预览、game.static_smoke和导出统一只认 dist;测试仍按init_local_game_project_at+game/index.html单文件布局造夹具,于是报「游戏目录不存在:.../game/dist」或「JSON Generator 仅支持已有的单文件 HTML 项目」。2. 固定视觉门禁退役未同步测试(21 条)
1f904d28e退役了固定视觉资产完成门禁、固定图片合同和 grid-2x2 切片合同,并把 prompt 改成需求驱动;旧断言仍在验证已删除的行为(visual_asset_completion_blocker_at_locked已直接return None,delegation 不再要求固定 expectedArtifacts,art-director / design-foundation / art-asset-plan 的 canonical options 被移除)。3. Backend job 的 cargo 502 是基础设施抖动
crates.io下载报CONNECT tunnel failed, response 502;run 1845 / 1865 该 job 通过,1869 / 1871 失败。本 PR 不涉及,建议重跑确认。落地方案
tests::init_legacy_single_html_project_at:先写game/index.html再调用init_local_game_project_at,避免播种 npm 脚手架,明确表达“已有单文件 HTML 项目”这一受支持布局。game.static_smoke、预览和导出相关用例改用它。accepted_generation_is_authoritatively_failed_once)。std::env::var("HOME")改为std::env::temp_dir(),Windows 本地也能跑。前后对照
验证
cargo test --locked --manifest-path apps/ai-game-creator-shell/src-tauri/Cargo.toml(定向 76 条)通过node scripts/check-encoding.mjs通过cargo fmt --check、git diff --check通过#[cfg(unix)]符号链接用例只能在 Linux CI 覆盖风险 / 待跟进
project_gates.rs的visual_asset_completion_blocker_at_locked现在是return None;+ 不可达块,但main_loop.rs、autonomous_completion.rs仍直接调用validate_manifest_required_visual_asset,门禁口径不一致,建议单独跟进。情况说明:与 #307 重复,本 PR 关闭
发现 lhk229 在 #307 的最新提交
1b4f0ed20(「修复原生应用CI测试与持久化图片生成恢复」,2026-09-09 11:17,run 1877)已经在修同一批 CI 失败,为避免两条修复同时改到 20+ 个相同文件产生冲突,关闭本 PR。两条修复的关系
同一批 52 条失败(31 条 npm / Phaser 4 迁移夹具 + 21 条 #274 退役固定视觉门禁):
init_legacy_single_html_project_at;把已退役视觉门禁用例改写成断言当前需求驱动行为;对齐恢复扫描用例的 options。1b4f0ed20:同样修夹具和提示词断言,并额外改了生产代码——新增recover_persisted_visual_generation_options,从持久化请求快照为 art-director / design-foundation / art-asset-plan 恢复缺省 outputPath / aspectRatio / imageSize / assetKind / assetLabel,解决「升级后旧 accepted 账本因 prompt 重算不一致无法恢复」这个真实迁移风险;对纯退役门禁用例则直接删除。结论
以 #307 为准:
fix/ci-native-shell-tests(提交7e4b404d5)保留在远端,不再推进。给 #307 的提醒
init_existing_html_project_at(...).expect(...)需要拆行),合并前需要cargo fmt;cargo fetchCONNECT tunnel failed, response 502是 runner 代理瞬时抖动,不是代码问题;Pull request closed