From eb5e892456bb6d6246e3c0d7ced86349be99e08e Mon Sep 17 00:00:00 2001 From: DKChan <524912269@qq.com> Date: Thu, 15 Oct 2026 22:07:13 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E9=97=B8=E6=94=B6=E6=95=9B=E6=89=B9?= =?UTF-8?q?=E4=B8=89):=20.gates/.gitignore=20=E5=85=A5=E5=BA=93=20+=20?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=E8=87=AA=E6=84=88=E9=87=8D=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 合回 master 时发现:.gates/.gitignore 未入库,receipt.json 被纳入版本管理—— 它是每跑批覆写的当次回执,属中间产物。 成因:重跑闸前用 rm -rf game/tests/.gates 清目录,把 .gitignore 一起带走了; 脚本自身不重建,跑得再多次也不会回来。 - .gates/.gitignore 入库(挡 receipt.json 与 *.log)。 - run_all_gates.sh 启动时自愈:.gitignore 缺失则重建,杜绝复发。 --- game/tests/.gates/.gitignore | 4 +++ game/tests/.gates/receipt.json | 62 ---------------------------------- tools/run_all_gates.sh | 10 +++++- 3 files changed, 13 insertions(+), 63 deletions(-) create mode 100644 game/tests/.gates/.gitignore delete mode 100644 game/tests/.gates/receipt.json diff --git a/game/tests/.gates/.gitignore b/game/tests/.gates/.gitignore new file mode 100644 index 00000000..145f1aa6 --- /dev/null +++ b/game/tests/.gates/.gitignore @@ -0,0 +1,4 @@ +# 本目录只入库 baseline.json(存量基线,需随代码走以保证各 worktree 判定口径一致)。 +# receipt.json 是每跑批覆写的当次回执、*.log 是跑批当场日志——两者都是中间产物,不入库。 +receipt.json +*.log \ No newline at end of file diff --git a/game/tests/.gates/receipt.json b/game/tests/.gates/receipt.json deleted file mode 100644 index 675463a1..00000000 --- a/game/tests/.gates/receipt.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "commit": "1d4ac91e3bda95048e65b7ac17c29a8e6198b80f", - "commit_short": "1d4ac91e", - "timestamp": "2026-10-15T21:42:07+08:00", - "quick_mode": false, - "first_baseline_run": true, - "gates": [ - { - "name": "01 冒烟全量", - "exit": "0", - "fingerprint": "green" - }, - { - "name": "02 单元套件", - "exit": "0", - "fingerprint": "green" - }, - { - "name": "03 探针 --click", - "exit": "0", - "fingerprint": "green" - }, - { - "name": "04 探针 --full", - "exit": "0", - "fingerprint": "green" - }, - { - "name": "05 渲染闸", - "exit": "0", - "fingerprint": "green" - }, - { - "name": "06 gdd_lint", - "exit": "0", - "fingerprint": "green" - }, - { - "name": "07 doc_link", - "exit": "0", - "fingerprint": "green" - }, - { - "name": "08 doc_term", - "exit": "0", - "fingerprint": "green" - }, - { - "name": "09 静态扫描", - "exit": "1", - "fingerprint": "3220614b09c4" - }, - { - "name": "10 熵增闸", - "exit": "0", - "fingerprint": "green" - } - ], - "changed_vs_baseline": [], - "inherited_red": [], - "all_green": true -} \ No newline at end of file diff --git a/tools/run_all_gates.sh b/tools/run_all_gates.sh index c86f7466..3035105b 100644 --- a/tools/run_all_gates.sh +++ b/tools/run_all_gates.sh @@ -28,6 +28,15 @@ QUICK=0 [ "${1:-}" = "--quick" ] && QUICK=1 [ $# -gt 1 ] && { echo "用法: tools/run_all_gates.sh [--quick]"; exit 2; } +# 回执与日志是中间产物(不入库),但 .gitignore 本身必须入库——漏了就等于把它们纳入版本管理。 +# 每次跑批前自愈重建,避免「清目录重跑」把 .gitignore 一起带走(2026-10-15 实踩)。 +mkdir -p "$STAMP_DIR" +if [ ! -f "$STAMP_DIR/.gitignore" ]; then + printf '# 本目录只入库 baseline.json(存量基线,需随代码走以保证各 worktree 判定口径一致)。\n# receipt.json 是每跑批覆写的当次回执、*.log 是跑批当场日志——两者都是中间产物,不入库。\nreceipt.json\n*.log\n' \ + > "$STAMP_DIR/.gitignore" + echo "[gates] 已自愈重建 $STAMP_DIR/.gitignore" +fi + # ── python 解释器解析:优先带 PIL 的 gamedev venv(渲染闸的 shot_checker/golden_compare 依赖), # 回落 PATH 上的 python。渲染闸的三个脚本要 PIL,用错解释器会假红。 PY="" @@ -44,7 +53,6 @@ case "$PY" in */Scripts/python.exe|*/Scripts/python) export PATH="$(dirname "$PY"):$PATH" ;; esac -mkdir -p "$STAMP_DIR" declare -a NAMES=() EXITS=() LOGS=() FAILED=0