docs(闸频率): 全量域闸收口为「每批一次」——冻结→件核→并 master→跑一次→合回

规则文本(process-conventions):
- §1.2/§3.9/§3.10 收口顺序固定为上列五步,删「批末+合回两个时机」与「重跑本域闸再合回」;明列唯一两种合法复跑(闸红且修法动 game/;闸开跑后 master 又推进),并写明「再跑一遍保险」不构成理由
- 回执与分支尖的对齐判据改为代码面:回执 commit 之后仅追加 reports/、design/ 等非 game/ 提交,回执照样有效;合回闸六况拦截描述随之改口,回执新增 dirty_game 字段

机检(tools/run_all_gates.sh):头注写明本脚本是批末终局动作;回执写 dirty_game(跑闸时 game/ 带未提交已跟踪改动=验的不是这版字节,合回闸拒收),首个回执字段验证:干净树 0/脏树 1/还原 0,回执 dirty_arg 0/1 两态落盘正确

钩子(.zcode/hooks/worktree-guard.sh,本机豁免面):合回闸由「回执 commit == 分支尖」改为「回执覆盖分支尖的 game/ 面」(covers_tip:祖先判定+game/ diff 为空),新增 dirty_game 拦截,错误话术随动

验证:A 层 7 临时仓库夹具全中(回执对齐/闸后仅 reports 提交/闸后改 game//dirty_game/master 未并/quick/含新增红),两处变异各按预期翻红(covers_tip→commit 同一使 S2 翻红;删 dirty 拦截使 S4 翻绿),还原后 sha256 一致且 7 例复跑全中;B 层 5 评估案例(evals.json)只读子代理判分见会话
This commit is contained in:
DKChan committed 2026-10-25 01:33:24 +08:00
1 parent 546e511385
commit 270287cd30
2 files changed
+21 -6

No files matched your search

+18 -3
View File
@@ -6,6 +6,10 @@
# 跑完写回执 game/tests/.gates/receipt.json(commit + 各闸退出码 + 存量基线比对 + 时间戳);
# .zcode/hooks/worktree-guard.sh 在主工作区 git merge 时校验本回执,缺或红即拦截。
#
# 本脚本是合回前的终局动作:跑之前先冻结(代码与断言不再改)并把 master 并入本分支;每批只跑
# 一次。回执必须覆盖住分支尖的 game/ 面——闸后再改 game/ 一点,回执即作废须重跑;跑闸时若
# game/ 还带着未提交改动,回执会标 dirty_game,合回闸拒绝采信。
#
# 用法:tools/run_all_gates.sh [--code|--docs|--quick]
# --code 只跑代码域闸(00 冒烟测试/01 系统测试/02 单元与集成测试/03 探针 --click/
# 04 探针 --full/05 渲染闸/09 静态扫描/11 回放确定性对拍+10 熵增闸)
@@ -54,6 +58,14 @@ done
# 与基线比必判「红项清单变化」假红)、末尾汇总自身崩掉打不出结论。
export PYTHONIOENCODING=utf-8
# game/ 面是否带着未提交改动(只算已跟踪文件——闸件自身产物都落在 gitignore 面)。
# 脏树跑出来的回执记的是 HEAD,验的却是别的字节,合回闸据此拒收。
DIRTY_GAME=0
if [ -n "$(git -C "$REPO" status --porcelain -uno -- game/ 2>/dev/null)" ]; then
DIRTY_GAME=1
echo "[gates] 警告:game/ 有未提交改动——本次回执将标 dirty_game,不能用于合回(先提交再跑)。"
fi
# 回执与日志是中间产物(不入库),但 .gitignore 本身必须入库——漏了就等于把它们纳入版本管理。
# 每次跑批前自愈重建,避免「清目录重跑」把 .gitignore 一起带走。
mkdir -p "$STAMP_DIR"
@@ -248,11 +260,11 @@ else
fi
# ── 与存量基线比对 ──
"$PY" - "$BASELINE" "$RECEIPT" "$QUICK" "$DOMAIN" "$REPO" "${NAMES[@]}" -- "${EXITS[@]}" -- "${LOGS[@]}" <<'PYEOF'
"$PY" - "$BASELINE" "$RECEIPT" "$QUICK" "$DOMAIN" "$REPO" "$DIRTY_GAME" "${NAMES[@]}" -- "${EXITS[@]}" -- "${LOGS[@]}" <<'PYEOF'
import hashlib, json, os, subprocess, sys
baseline_path, receipt_path, quick, domain, repo = sys.argv[1:6]
rest = sys.argv[6:]
baseline_path, receipt_path, quick, domain, repo, dirty_game = sys.argv[1:7]
rest = sys.argv[7:]
sep = rest.index("--")
names = rest[:sep]
tail = rest[sep + 1:]
@@ -338,6 +350,7 @@ with open(receipt_path, "w", encoding="utf-8") as f:
"timestamp": subprocess.run(["date", "-Iseconds"], capture_output=True, text=True).stdout.strip(),
"quick_mode": quick == "1",
"domain": domain,
"dirty_game": dirty_game == "1",
"first_baseline_run": first_run,
"gates": [{"name": n, "exit": e, "fingerprint": now[n]["fp"]} for n, e in zip(names, exits)],
"changed_vs_baseline": changed,
@@ -364,6 +377,8 @@ if not_run:
stock = [n for n, e in zip(names, exits) if e not in ("0", "SKIP")]
if stock:
print("【存量红·对基线零新增】" + "、".join(stock))
if dirty_game == "1":
print("【回执不可用于合回】跑闸时 game/ 有未提交改动——先提交到分支、再重跑这一次。")
if all_green:
print("【验收通过】闸况与基线一致,无新增红。")
sys.exit(0)