diff --git a/tools/run_all_gates.sh b/tools/run_all_gates.sh index 97b625e0..943d227a 100644 --- a/tools/run_all_gates.sh +++ b/tools/run_all_gates.sh @@ -439,7 +439,7 @@ fi # ── 与存量基线比对 ── "$PY" - "$BASELINE" "$RECEIPT" "$QUICK" "$DOMAIN" "$REPO" "$DIRTY_GAME" "$SCOPE" "$ONLY_TERMS" "${NAMES[@]}" -- "${EXITS[@]}" -- "${LOGS[@]}" <<'PYEOF' -import hashlib, json, os, subprocess, sys +import hashlib, json, os, re, subprocess, sys baseline_path, receipt_path, quick, domain, repo, dirty_game, scope, only_terms = sys.argv[1:9] rest = sys.argv[9:] @@ -468,7 +468,8 @@ def tree_hash(): return "unknown" def fingerprint(exit_code, log): - """红项指纹:只取 exit!=0 时的 FAIL 关键行集合,忽略时序/耗时噪声。 + """红项指纹:只取 exit!=0 时的 FAIL 关键行集合,忽略时序/耗时噪声 + (超时挂死行的 pid=NNN 随跑批变化,归一化为 pid=N 后再入哈希——否则存量红指纹逐轮漂移)。 绿闸一律记 'green'——绿闸日志里的「零红」「全绿」等字样不是红项,采进来只会造噪声。""" # SKIP / NEED-APPROVAL 都属「本闸未实跑」状态,指纹一律记 skip—— # 两者互变不是闸况变化(同是没跑),只有「未跑 → 跑出结果」或「绿 → 红」才算变化。 @@ -485,7 +486,7 @@ def fingerprint(exit_code, log): s = line.strip() if not s or "FAIL" not in s: continue - keys.append(s[:160]) + keys.append(re.sub(r"pid=\d+", "pid=N", s)[:160]) if not keys: return "red-nokeys" return hashlib.sha1("\n".join(sorted(set(keys))).encode("utf-8")).hexdigest()[:12]