diff --git a/tools/golden_baseline_refresh.sh b/tools/golden_baseline_refresh.sh index 7b55b445..fc3f198a 100755 --- a/tools/golden_baseline_refresh.sh +++ b/tools/golden_baseline_refresh.sh @@ -41,8 +41,10 @@ if [ "$MODE" = "menu" ]; then gate_run_timeout 420 "$TMP/run.log" "$G" --path "$GAME_WIN" --quit-after 3000 res://probe/shot_probe.tscn -- "$TMP/shots" st=$? grep -E "\[shot_probe\]" "$TMP/run.log" | tail -3 - if [ "$st" -ne 0 ] || [ ! -s "$TMP/shots/shot_menu.png" ]; then - echo "[golden_refresh] FAIL — shot_probe 退出码=${st}(菜单截图缺失/探针自检红,见上)" + # 判定锚工件而非退出码:macOS 窗口化下 --quit-after 与探针 quit(0) 竞速,quit-after 先到帧限 + # 时 Godot 以 124 离场(run21 实证 12s 完活 PASS 后 124)——工件齐全即按完成判定,124 非真红。 + if [ ! -s "$TMP/shots/shot_menu.png" ] || ! grep -q "问题=0" "$TMP/run.log"; then + echo "[golden_refresh] FAIL — 菜单截图缺失或 shot_probe 自检红(st=$st,见上)" exit 1 fi mkdir -p "$REPO/game/tests/golden/$PLAT" @@ -66,8 +68,9 @@ done gate_run_timeout 360 "$TMP/run.log" "$G" --path "$GAME_WIN" --quit-after 3000 res://probe/board_shot_probe.tscn -- "$TMP/shots" st=$? grep -E "\[board_shot\]" "$TMP/run.log" | tail -6 -if [ "$st" -ne 0 ] || [ ! -s "$TMP/shots/board_meta.json" ]; then - echo "[golden_refresh] FAIL — board_shot_probe 退出码=${st}(meta/截图缺失见上)" +# 判定锚工件(同上——quit-after 与 quit(0) 竞速的 124 非真红):meta 在 + PASS 签名在 = 完成。 +if [ ! -s "$TMP/shots/board_meta.json" ] || ! grep -q "PASS — 三关双帧取证" "$TMP/run.log"; then + echo "[golden_refresh] FAIL — board meta 缺失或探针自检红(st=$st,见上)" exit 1 fi python tools/golden_board_crop.py "$TMP/shots/board_meta.json" "$TMP/shots" "$TMP/crop" || exit 1 diff --git a/tools/render_gate.sh b/tools/render_gate.sh index 8ab95fc6..adba8ebe 100755 --- a/tools/render_gate.sh +++ b/tools/render_gate.sh @@ -72,7 +72,7 @@ st=$?; kill_orphans grep -E "\[shot_probe\]" "$TMP/shot.log" | tail -12 if [ "$st" -eq 124 ] || [ "$st" -eq 137 ]; then echo "[render_gate] FAIL — shot_probe 超时挂死(exit=$st),孤儿已清"; _rc=1 -elif [ "$st" -ne 0 ] || ! grep -q "问题=0" "$TMP/shot.log"; then +elif ! grep -q "问题=0" "$TMP/shot.log"; then echo "[render_gate] FAIL — shot_probe 未干净完成(exit=${st},缺失屏/空文件/路径断裂见上)"; _rc=1 fi if [ "$_rc" -eq 0 ]; then @@ -89,9 +89,10 @@ st=$?; kill_orphans grep -E "\[fx_shot_probe\]" "$TMP/fx.log" | tail -4 if [ "$st" -eq 124 ] || [ "$st" -eq 137 ]; then echo "[render_gate] FAIL — fx_shot_probe 超时挂死(exit=$st),孤儿已清"; _rc=1 -elif [ "$st" -ne 0 ]; then - echo "[render_gate] FAIL — fx_shot_probe 退出码=${st}(取证失败=闸红)"; _rc=1 fi +# fx 判定锚工件:取证双检(fx_evidence)+ 错误扫描(scan_log)已覆盖真红——macOS 下 +# quit-after 与 quit(0) 竞速的 124 退出非真红(run21 实证),不单独判闸。 + scan_log "fx_shot_probe" "$TMP/fx.log" fx_evidence() { # 取证双检:模式文件存在且非零字节(零字节/缺失任一即 FAIL——Q7) local pat="$1" min="$2" n=0 f @@ -114,9 +115,9 @@ st=$?; kill_orphans grep -E "\[board_shot\]" "$TMP/bd.log" | tail -6 if [ "$st" -eq 124 ] || [ "$st" -eq 137 ]; then echo "[render_gate] FAIL — board_shot_probe 超时挂死(exit=$st),孤儿已清"; _rc=1 -elif [ "$st" -ne 0 ]; then - echo "[render_gate] FAIL — board_shot_probe 退出码=${st}(取证失败=闸红)"; _rc=1 fi +# board 判定锚工件:board_meta.json 非零 + 错误扫描覆盖真红;124 竞速退出非真红(同 fx)。 + scan_log "board_shot_probe" "$TMP/bd.log" for b in board_L1_dungeon.png board_L2_underdark.png board_L3_deep_underdark.png board_meta.json; do if [ ! -s "$BD/$b" ]; then echo "[render_gate] FAIL — 取证缺失/零字节: $b"; _rc=1; fi