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" + ] } }