From f49095a6cc9adfbfe2b86bcbdf4b0e06a5bfe9d9 Mon Sep 17 00:00:00 2001 From: randypanding Date: Wed, 19 Aug 2026 04:43:38 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=C2=A78=20=E7=9B=B4=E6=8E=A8=E6=A3=80?= =?UTF-8?q?=E6=B5=8B=E5=A2=9E=E5=8A=A0=E5=88=9D=E5=A7=8B=E5=BB=BA=E4=BB=93?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E8=B1=81=E5=85=8D=E6=B8=85=E5=8D=95=EF=BC=88?= =?UTF-8?q?ADR-0016=20=E9=99=84=E5=BD=95=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- governance/drift-check.sh | 7 +++++++ governance/expected-state.json | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/governance/drift-check.sh b/governance/drift-check.sh index 375c09a..1a62b5b 100755 --- a/governance/drift-check.sh +++ b/governance/drift-check.sh @@ -204,11 +204,18 @@ for r in $REPOS; do rm -f "$COMMITS_TMP" continue fi + # §8 豁免清单(ADR-0016 附录:初始建仓导入的破玻璃回填——expected-state.json + # direct_push_exemptions 逐 SHA 登记,豁免须有 ADR 背书,不得口头/临时豁免) + EXEMPT=$(jq -r --arg r "$r" '.direct_push_exemptions[$r] // [] | join(" ")' "$EXPECTED") DIRECT_FOUND=0 while IFS= read -r row; do [[ -n "$row" ]] || continue sha=$(jq -r .sha <<<"$row") cdate=$(jq -r .date <<<"$row") + if grep -qF "$sha" <<<"$EXEMPT"; then + ok "repo '$r' commit ${sha:0:8} 初始建仓导入(§8 豁免清单,ADR-0016 附录回填)" + continue + fi # 关联 PR 复核(全 SHA;响应须为数组——error 对象/传输失败均为无法验证) PRS=$(api "https://api.github.com/repos/$ORG/$r/commits/$sha/pulls?per_page=5" \ | jq -r 'if type == "array" then (if length > 0 then "has-pr" else "none" end) else "error" end' 2>/dev/null || echo error) diff --git a/governance/expected-state.json b/governance/expected-state.json index 2b36899..9713d50 100644 --- a/governance/expected-state.json +++ b/governance/expected-state.json @@ -47,5 +47,12 @@ "workflows", "administration" ] + }, + "direct_push_exemptions": { + "comment": "§8 直推检测豁免=初始建仓导入(flows.new_repo step1-2:gh repo create+push 初始治理树,彼时仓库与 gate/PR 机制尚不存在,初始 commit 结构上无法走 PR)。豁免逐一登记完整 SHA,GM-2 破玻璃回填的机器可读形式(决策背书见 ADR-0016 附录)。", + ".github": [ + "9b056b3a925038484a8f6655ea45f81f071d5df6", + "416f5f57fd459f6ece3587f3aa20b772148ad335" + ] } }