-
Notifications
You must be signed in to change notification settings - Fork 0
fix(drift): secret 期望对齐 kimi 切换 + §10 正本拉取双通道(#261 终修,ADR-0083 关联) #342
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 |
|---|---|---|
|
|
@@ -324,8 +324,14 @@ adr_substantive() { # $1=四位编号 → stdout: missing|ok|shell|unreadable | |
| while IFS= read -r apath; do | ||
| [[ -n "$apath" ]] || continue | ||
| if [[ -n "${ADR_INDEX_MODE:-}" ]]; then | ||
| # 索引世界:archive raw 正本(公开仓,字节保真原件);拉取失败留空→按不可判定处理 | ||
| decoded=$(curl -sSf --max-time 20 "https://raw.githubusercontent.com/$ORG/archive/main/${apath}" 2>/dev/null || true) | ||
| # 索引世界:archive raw 正本(公开仓,字节保真原件)。raw 在 runner 上有 | ||
| # 瞬时拒连抖动(2026-08-24 实测整批 unreadable)——重试 3 次后回退 | ||
| # contents API(api.github.com 通道稳定),双通道皆失败才按不可判定处理。 | ||
| decoded=$(curl -sSf --retry 3 --retry-delay 2 --max-time 20 "https://raw.githubusercontent.com/$ORG/archive/main/${apath}" 2>/dev/null || true) | ||
| if [[ -z "$decoded" ]]; then | ||
| _c=$(api "https://api.github.com/repos/$ORG/archive/contents/${apath}" 2>/dev/null | jq -r '.content // empty' 2>/dev/null || true) | ||
| [[ -n "$_c" ]] && decoded=$(base64 -d <<<"$_c" 2>/dev/null || true) | ||
|
Comment on lines
+332
to
+333
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. 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- target file context ---'
sed -n '1,45p;300,350p' governance/drift-check.sh
printf '%s\n' '--- workflows/scripts references ---'
rg -n --hidden --glob '!node_modules' --glob '!dist' 'drift-check\.sh|timeout-minutes|api\(' .github governance scripts 2>/dev/null || true
printf '%s\n' '--- candidate files ---'
git ls-files '.github/**' 'governance/**' 'scripts/**' | sed -n '1,160p'
printf '%s\n' '--- read-only verifier ---'
python3 - <<'PY'
from pathlib import Path
p = Path("governance/drift-check.sh")
text = p.read_text()
for i, line in enumerate(text.splitlines(), 1):
if "api()" in line or "curl" in line or "archive/contents" in line or "decoded" in line:
print(f"{i}: {line}")
PYRepository: Cloudbird-Software/.github Length of output: 16263 🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- governance-drift workflow ---'
sed -n '1,100p' .github/workflows/governance-drift.yml
printf '%s\n' '--- timeout and invocation context ---'
rg -n -C 4 'governance/drift-check\.sh|timeout-minutes|defaults:|timeout' .github/workflows .github governance 2>/dev/null | sed -n '1,220p'
printf '%s\n' '--- independent curl-control-flow probe ---'
tmp="$(mktemp -d)"
trap 'rm -rf "$tmp"' EXIT
cat >"$tmp/curl" <<'SH'
#!/bin/sh
printf '%s\n' "$*" >"${MOCK_ARGS_FILE:?}"
case " $* " in
*" --max-time "*) exit 28 ;;
*) sleep "${MOCK_SLEEP:-0}"; exit 28 ;;
esac
SH
chmod +x "$tmp/curl"
args_file="$tmp/args"
: >"$args_file"
start="$(date +%s)"
PATH="$tmp:$PATH" MOCK_ARGS_FILE="$args_file" MOCK_SLEEP=1 \
bash -c '
api() { curl -sS -H "Authorization: Bearer token" \
-H "Accept: application/vnd.github+json" "$@"; }
decoded=""
_c=$(api "https://api.github.com/repos/Cloudbird-Software/archive/contents/ADR-0001.md" 2>/dev/null |
jq -r ".content // empty" 2>/dev/null || true)
[[ -n "$_c" ]] && decoded=$(base64 -d <<<"$_c" 2>/dev/null || true)
[[ -z "$decoded" ]]
'
elapsed="$(( $(date +%s) - start ))"
printf 'mock_elapsed_seconds=%s\n' "$elapsed"
printf 'mock_curl_args='; cat "$args_file"Repository: Cloudbird-Software/.github Length of output: 17741 为 Contents API 回退设置请求超时。 当 raw 请求失败且 🤖 Prompt for AI Agents |
||
| fi | ||
| else | ||
| content=$(api "https://api.github.com/repos/$ORG/agent-registry/contents/$apath" | jq -r '.content // empty') | ||
| [[ -z "$content" ]] && continue | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -101,7 +101,7 @@ | |
| "CB_APP_ID", | ||
| "AGENT_APP_SECRET", | ||
| "GOVERNANCE_TOKEN", | ||
| "LLM_API_KEY" | ||
| "LLM_API_KEY1" | ||
|
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. 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win 同步组织密钥名称与 workflow 消费者。 Line 104 现在要求组织密钥 请将 workflow 右侧表达式更新为 🤖 Prompt for AI AgentsThere 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. 4. Secret name spec drift expected-state.json now requires LLM_API_KEY1, but governance/spec documents still state the org secret is LLM_API_KEY, leaving conflicting sources of truth for provisioning and incident response. This increases the risk of misconfigured org secrets and repeated drift alerts during onboarding or secret rotation. Agent Prompt
|
||
| ], | ||
| "github_app": { | ||
| "name": "cloudbrid-agent", | ||
|
|
||
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.
3. Fallback branch mismatch
🐞 Bug≡ CorrectnessAgent Prompt
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools