diff --git a/apps/ai-game-creator-shell/src-tauri/src/agent/runtime_protocol/autonomous_completion_contract_tests.rs b/apps/ai-game-creator-shell/src-tauri/src/agent/runtime_protocol/autonomous_completion_contract_tests.rs index fd05506d7..bda8a298f 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/agent/runtime_protocol/autonomous_completion_contract_tests.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/agent/runtime_protocol/autonomous_completion_contract_tests.rs @@ -7044,7 +7044,9 @@ fn canvas_visual_gate_resolves_numeric_constants_by_symbol_scope() { &queue_autonomous_manifest_child_fixture(&root, &parent_state, "code-prototype"), ); let html = "
"; - advance_game_index_revision(&root, &code_state, html); + // 夹具只为数值常量作用域判据构造,缺完整 static-smoke 合同要的目标说明、 + // 主循环与输入监听;补上这层再落盘,被探测的常量引用形状不变。 + advance_game_index_revision(&root, &code_state, &with_static_smoke_contract(html)); mark_verification_passed(&root, &code_state, "game.static_smoke"); assert!(autonomous_game_build_completion_blocker_at_locked(&root, &code_state).is_none()); } @@ -7123,7 +7125,7 @@ fn cli_code_prototype_accepts_linked_inline_and_external_modules_for_canvas_atla advance_game_index_revision( &root, &code_state, - "", + &with_static_smoke_contract(""), ); mark_verification_passed(&root, &code_state, "game.static_smoke"); assert!( @@ -7139,7 +7141,9 @@ fn cli_code_prototype_accepts_linked_inline_and_external_modules_for_canvas_atla advance_game_index_revision( &root, &code_state, - "", + &with_static_smoke_contract( + "", + ), ); mark_verification_passed(&root, &code_state, "game.static_smoke"); assert!( @@ -8105,6 +8109,12 @@ fn autonomous_owner_artifact_runtime_validation_unblocks_real_new_project_withou append_game_creator_agent_runtime_task(&root, &state) .expect("persist running design foundation child"); + // 上面刚断言过占位入口过不了真实 smoke。后面要伪造一次 static-smoke 通过来制造 + // 「过期凭证」,而收口时会按当前磁盘内容复核入口页——占位页必然被拒。先把入口 + // 换成合规页面,再走 owner 产物;verified_revision 仍取最后一次 owner 产物, + // 后续 revision 断言不受影响。 + advance_game_index_revision(&root, &state, cropped_spritesheet_game_html()); + advance_owner_artifact_revision( &root, &state, @@ -8410,7 +8420,11 @@ fn autonomous_gui_cli_code_prototype_terminal_projection_requires_own_static_smo let mutation_revision = advance_game_index_revision( &root, &state, - "", + // 同一份入口后面要被记为 static-smoke 通过,落盘时就得满足完整合同; + // 此处只写一次、revision 不变,前面对 mutation/verified revision 的断言不受影响。 + &with_static_smoke_contract( + "", + ), ); mark_verification_passed(&root, &state, "project.verify"); let project_verified_gate = read_game_creator_agent_runtime_verification_gate( @@ -8495,6 +8509,9 @@ fn autonomous_gui_cli_code_prototype_terminal_projection_requires_own_static_smo legacy_gate.last_verification_status = Some(AGENT_RUNTIME_VERIFICATION_STATUS_PASSED.to_string()); legacy_gate.static_smoke_verified_revision = None; + // 入口摘要与 revision 是一对:仿造 legacy gate 时必须一起清,否则 gate + // 自身的一致性校验会先于被测行为拒收。 + legacy_gate.static_smoke_verified_game_index_sha256 = None; write_game_creator_agent_runtime_verification_gate(&root, &legacy_gate) .expect("persist legacy project.verify-only completed code gate"); let root_blocker = autonomous_game_build_completion_blocker_at_locked(&root, &parent_state) diff --git a/apps/ai-game-creator-shell/src-tauri/src/tests/runtime_actions/planning_strategy/autonomous_build.rs b/apps/ai-game-creator-shell/src-tauri/src/tests/runtime_actions/planning_strategy/autonomous_build.rs index ab4b8b7dc..89082ecec 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/tests/runtime_actions/planning_strategy/autonomous_build.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/tests/runtime_actions/planning_strategy/autonomous_build.rs @@ -1063,6 +1063,15 @@ async fn autonomous_manifest_code_prototype_requires_its_own_static_smoke_after_ .collect::目标:移动角色收集全部目标并获得胜利;碰到危险即失败,按 R 重新开始。
", + ) + .expect("write a smoke-contract compliant game entry before the static smoke credential"); persist_project_verification_for_test( &root, "code-prototype",