GitHub Actions Run Ledger:PR/Docs Health 运行态事件实验¶
生成时间:2026-06-14T15:20:00+08:00
数据分类:synthetic_internal_demo。样例基于本次 GitHub Actions 失败与修复流程做脱敏建模,不包含 run id、完整 URL、完整 commit sha 或外部响应正文。
实验定位¶
这个实验把 GitHub Actions workflow run 状态投影成项目看板可以读取的运行态事件。它承接 PR/Docs Health Loop:本地 CI 门禁证明仓库内契约,Actions Run Ledger 证明外部 CI 状态可以安全进入同一事件 Timeline。
它不是 live GitHub API adapter,而是先固定外部 CI 状态进入 Framework 的安全 contract。
当前结果¶
- Case 数:3
- 通过数:3
- 失败数:0
- 通过率:100%
- Ledger event:3
- 成功 run:2
- 失败 run:1
- Pending run:0
- 安全输出泄漏:0
| Case | Event Type | 结果 | 说明 |
|---|---|---|---|
alpc91_mirror_mkdocs_failed_on_locked_mirror_dependency |
github-actions-run-failure | pass | ALPC91 mirror workflow failed during dependency sync before the public PyPI lockfile fix. |
alpc91_mirror_mkdocs_succeeded_after_public_pypi_lock |
github-actions-run-success | pass | ALPC91 mirror workflow succeeded after uv.toml and uv.lock were moved back to public PyPI artifacts. |
team_repo_pull_request_mkdocs_success |
github-actions-run-success | pass | Team repository pull request check succeeded and proves branch context can be represented without leaking PR URLs or raw run IDs. |
关键结论¶
- GitHub Actions run 不能把原始 run id、完整 URL、完整 commit sha 或 job 日志直接投到公开看板;看板只需要 workflow、branch、短 SHA、状态、结论、耗时和 hash 引用。
- 同一 PR/Docs Health Loop 可以表达失败和修复:失败 run 进入
github-actions-run-failure,修复 run 进入github-actions-run-success,团队成员不需要只靠邮件追溯。 - ALPC91 发布镜像、团队仓库 PR 检查和未来 Cloudflare 构建都应先投影为安全 runtime event,再由看板决定是否触发 review、重试或 handoff。
- 后续 live adapter 只需要替换数据来源,仍然复用同一脱敏、校验和 project timeline contract。
没证明什么¶
- 这还没有调用 GitHub API 或 webhook。
- 这还没有解析 job-level annotation、review comment 或 Cloudflare deployment 状态。
- 这还没有把失败原因自动归因到具体依赖源、文档生成物或测试模块;目前只固定安全事件入口。
代码入口¶
- Fixture:
vault/90-system/github-actions-runs.json - 实现:
framework/governance/github_actions_run_ledger.py - 测试:
tests/test_github_actions_run_ledger.py - 运行:
python scripts/github_actions_run_ledger.py --write-report - 输出:
vault/50-outputs/github-actions-run-ledger-analysis.md - Timeline source:
vault/50-outputs/github-actions-run-ledger-results.json
下一步¶
- 把
gh run list/ GitHub App webhook 接到同一 ledger contract,替换合成 fixture。 - 增加 job annotation 摘要 adapter,但仍只输出安全错误类别和文件位置,不输出完整日志或原始 URL。
- 把失败 run 事件接入 Semantic Review Queue 或 LoopRun retry policy,让 PR/Docs Health Loop 能自动提出下一步动作。