Coding-Autopilot-System/ci-autopilot
GitHub: Coding-Autopilot-System/ci-autopilot
一个 hardened 的 CI worker 运行时,通过只读的 Python agent 监控 GitHub Actions 失败并以 issue 队列形式实现可审计的运维交接。
Stars: 0 | Forks: 0
# ci-autopilot
[](https://github.com/Coding-Autopilot-System/ci-autopilot/actions/workflows/ci.yml) [](https://github.com/Coding-Autopilot-System/ci-autopilot/actions/workflows/codeql.yml)
CI autopilot worker/runtime - 通过 Python agent 检测 GitHub Actions 失败并盘点排队的修复 issue
[](https://github.com/Coding-Autopilot-System/ci-autopilot/actions/workflows/ci.yml)
[](https://www.python.org/)
[](LICENSE)
## 概述
`ci-autopilot` 打包了平台的 worker/runtime 端。它监控 GitHub Actions 工作流,检测失败,并通过 issue 队列将其暴露出来。当前的 Python worker 是刻意设计为只读的:它在自托管 runner 上盘点排队的 issue。自主修复调度和队列状态转换尚未实现。
agent (`agent/poll_once.py`) 是一个仅使用 Python 3.12 stdlib 的程序,它会轮询 issue 队列并列出排队的修复任务以供运维人员查看。不需要任何外部依赖。
## 仓库边界
- `autopilot-core` 是用于组织级别调度、发布和 PR 治理的控制平面。
- `ci-autopilot` 是用于 runner 执行和只读队列轮询的 worker/runtime 实现。
- `autopilot-demo` 是用于演示 runtime 和控制平面协同工作的演示目标。
## 架构
```
flowchart LR
A["GitHub Actions\nfailure detected"] --> B["autopilot-failure-intake\n(intake workflow)"]
B --> C["Issue queue\n(runner-offline label)"]
C --> D["agent/poll_once.py\n(Python 3.12)"]
D --> E["Operator visibility\n(read-only inventory)"]
E -. "future guarded dispatcher" .-> F["PR-only repair path"]
```
**核心组件:**
- **autopilot-failure-intake.yml** - 在 `workflow_run` 失败事件时触发的接收工作流;创建一个排队的 issue
- **autopilot-create-issue.yml** - 当受监控的工作流失败时,通过 `actions/github-script` 创建 GitHub issue
- **fixer.yml** - 在自托管 Windows runner 上运行只读的 `agent/poll_once.py` 队列盘点
- **agent/poll_once.py** - Python 3.12 stdlib agent;验证仓库输入并盘点 issue 队列
- **runner-smoke-test.yml** - 按需对自托管 runner 进行冒烟测试
- **runner-health.yml** - 定期和按需的 runner 健康检查
## 企业级验证点
- 刻意保持极小的 runtime 接口面:仅使用 Python 3.12 stdlib 的 agent,更易于审计和重建。
- 明确的关注点分离:issue 的接收和治理保留在控制平面中;worker 执行和未来的受保护修复调度保留在 worker 边界上。
- 自托管 runner 模型支持企业网络边界、受管工具链和最小权限 token 处理。
- 队列驱动的接收在 CI 失败检测和运维审查之间创建了可审计的交接。
## 快速开始
```
# 前提条件:Python 3.12 和已认证的 GitHub CLI
$env:GH_TOKEN = gh auth token
python -m agent.poll_once
```
该 worker 仅读取并列出排队的 issue。它不执行 issue 内容、修改仓库或调度 Codex。
有关完整的 runner 注册、服务设置和本地开发说明,请参阅 [设置指南](https://github.com/Coding-Autopilot-System/ci-autopilot/wiki/Setup-Guide) wiki 页面。
## 运维手册路径
1. 阅读 [docs/control-plane.md](docs/control-plane.md) 了解与 `autopilot-core` 的 issue 队列契约。
2. 使用 [docs/runner-setup.md](docs/runner-setup.md) 配置 worker 主机。
3. 使用 [docs/operations.md](docs/operations.md) 和 [docs/troubleshooting.md](docs/troubleshooting.md) 获取 day-2 支持。
## 文档
| 来源 | 描述 |
|--------|-------------|
| [docs/architecture.md](docs/architecture.md) | 系统架构和设计目标 |
| [docs/runner-setup.md](docs/runner-setup.md) | Runner 注册和服务设置 |
| [docs/operations.md](docs/operations.md) | Day-2 运维手册 |
| [docs/security.md](docs/security.md) | 安全态势和访问模型 |
| [docs/control-plane.md](docs/control-plane.md) | 故障接收和 issue 控制平面 |
| [docs/troubleshooting.md](docs/troubleshooting.md) | 轻量级故障排除指南 |
| [GitHub Pages](https://coding-autopilot-system.github.io/ci-autopilot/) | 专业文档落地页 |
**Wiki:** [首页](https://github.com/Coding-Autopilot-System/ci-autopilot/wiki/Home) | [设置指南](https://github.com/Coding-Autopilot-System/ci-autopilot/wiki/Setup-Guide) | [架构](https://github.com/Coding-Autopilot-System/ci-autopilot/wiki/Architecture) | [配置参考](https://github.com/Coding-Autopilot-System/ci-autopilot/wiki/Configuration-Reference)
## 生态系统
属于 [Coding-Autopilot-System](https://github.com/Coding-Autopilot-System) 生态系统的一部分,与相邻的 autopilot 仓库并立:[autopilot-core](https://github.com/Coding-Autopilot-System/autopilot-core) | [autopilot-demo](https://github.com/Coding-Autopilot-System/autopilot-demo)
标签:GitHub Actions, Python, 无后门, 智能代理, 模块化设计, 自动化修复, 自动化运维, 自动笔记