-
Notifications
You must be signed in to change notification settings - Fork 0
feat: 全仓公开政策与小时级可见性漂移检测(ADR-0020) #63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -147,12 +147,19 @@ if python3 -c 'import yaml' 2>/dev/null; then | |
| fi | ||
| got_vis=$(jq -r 'if .private then "private" else "public" end' <<<"$RR") | ||
| [[ "$got_vis" == "$want_vis" ]] || drift "repo '$r' visibility=$got_vis 期望=$want_vis" | ||
| [[ "$want_vis" == "public" ]] || drift "repo '$r' 申报 visibility=$want_vis 违反全仓公开政策(ADR-0020)" | ||
| ok "REPOS map '$r'" | ||
| done < <(jq -r '.repos[] | select(.status=="active") | "\(.name)\t\(.visibility)"' <<<"$REPO_MAP") | ||
| # 7b. 线上仓必须在图中申报(任何 status 均可,未申报即漂移) | ||
| # 7b/7c. 线上全量仓合并遍历(每仓一次 API): | ||
| # 7b. 必须在图中申报(任何 status 均可,未申报即漂移) | ||
| # 7c. 全仓公开政策(ADR-0020):private 即漂移——不依赖申报完整性(未申报仓 | ||
| # 同样受检);exempt 状态只豁免治理基线(repo_baseline),不豁免可见性 | ||
| for r in $REPOS; do | ||
| jq -e --arg r "$r" '[.repos[].name] | index($r) != null' <<<"$REPO_MAP" >/dev/null \ | ||
| || drift "线上仓 '$r' 未在 governance/REPOS.yaml 申报(补申报,或标 exempt 注明原因)" | ||
| VR=$(api "https://api.github.com/repos/$ORG/$r") | ||
| [[ "$(jq -r 'if .private then "private" else "public" end' <<<"$VR")" == "public" ]] \ | ||
| || drift "repo '$r' 为 private,违反全仓公开政策(ADR-0020 改回 public,或新 ADR 推翻政策)" | ||
|
Comment on lines
+160
to
+162
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy lift 🧩 Analysis chain🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
classify_current() {
jq -r 'if .private then "private" else "public" end'
}
for payload in \
'{"private":false,"visibility":"internal"}' \
'{"message":"Bad credentials"}'
do
actual="$(classify_current <<<"$payload")"
if [[ "$actual" == "public" ]]; then
printf 'FAIL: non-public/error payload classified as public: %s\n' "$payload" >&2
exit 1
fi
done
rg -n -C3 '\.private|\.visibility|api\(\)' governance/drift-check.shRepository: Cloudbird-Software/.github Length of output: 259 🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
printf '%s\n' '--- relevant functions and checks ---'
cat -n governance/drift-check.sh | sed -n '1,220p'
printf '%s\n' '--- repository enumeration and API call sites ---'
rg -n -C4 'REPOS_TMP|REPOS=|repos/|api\(\)|private|visibility|7a|7c|page|per_page|Link' governance/drift-check.shRepository: Cloudbird-Software/.github Length of output: 19260 [高] 使用 当前 7a 和 7c 只检查 请先验证 API 响应成功,再检查 🤖 Prompt for AI Agents |
||
| done | ||
| else | ||
| echo "SKIP REPOS.yaml 校验(环境缺 python3+pyyaml;GitHub runner 自带)" | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
[高] 同步
GM-1的漂移频率元数据。本段将
GM-4.verify.frequency改为hourly。但GM-1仍描述“每日漂移检测”,并保留cron: "daily 03:00 UTC";工作流现在已改为每小时运行。机器可读的治理契约因此不一致。请同步更新GM-1的意图和cron元数据,或将检测频率集中到唯一来源。🤖 Prompt for AI Agents