-
Notifications
You must be signed in to change notification settings - Fork 0
Architecture
GSD Planner edited this page May 26, 2026
·
1 revision
ci-autopilot is an autonomous CI repair agent built on GitHub Actions and a Python 3.12 stdlib agent. It detects GitHub Actions failures, queues them as GitHub Issues, and dispatches repair operations via Codex. The system runs on a self-hosted Windows runner and coordinates the full lifecycle from failure detection to a merged PR fix.
flowchart LR
A["GitHub Actions\nfailure detected"] --> B["autopilot-failure-intake\n(intake workflow)"]
B --> C["Issue queue\n(queued label)"]
C --> D["agent/poll_once.py\n(Python 3.12)"]
D --> E["Codex\n(repair dispatch)"]
E --> F["PR / fix\ncommitted"]
F --> G["CI passes\n(ci.yml)"]
G --> H["Merge"]
Step-by-step:
- A workflow run (
fixer.yml,runner-smoke-test.yml) fails -
autopilot-failure-intake.ymlfires onworkflow_runcompleted with failure conclusion - The intake workflow creates a GitHub Issue labeled
queuedwith failure context -
agent/poll_once.pyruns on the self-hosted runner (triggered byfixer.yml) - The agent polls
/repos/{owner}/{repo}/issues?state=open&labels=queued - For each queued issue, the agent dispatches a repair task to Codex
- Codex opens a PR with the fix
-
ci.ymlvalidates the PR (Python 3.12 syntax check onubuntu-latest) - On CI pass, the PR is eligible for merge
| Workflow | Trigger | Purpose |
|---|---|---|
ci.yml |
push/PR to main |
Python 3.12 syntax check; provides CI badge |
fixer.yml |
workflow_dispatch, repository_dispatch, daily 02:00 |
Main autopilot: runs agent on self-hosted runner |
autopilot-failure-intake.yml |
workflow_run completed (failure) |
Captures failures as queued issues |
autopilot-create-issue.yml |
workflow_run completed |
Creates issues via actions/github-script
|
runner-smoke-test.yml |
workflow_dispatch |
Validates self-hosted runner is operational |
runner-health.yml |
workflow_dispatch |
Manual runner health check |
agent/poll_once.py — Python 3.12 stdlib-only agent.
- Uses only:
json,os,subprocess,sys,urllib,typing - No external packages;
requirements.txtis comment-only - Reads
GITHUB_TOKEN/GH_TOKENfrom environment - Falls back to
ghCLI if no token in environment - Polls the issue queue and logs queued issues for repair dispatch
- Reads target repo from
GITHUB_REPOSITORYenv var (default:Coding-Autopilot-System/ci-autopilot)
agent/__init__.py — Empty package marker.
ci-autopilot uses GitHub Issues as a lightweight control plane:
| Label | Meaning |
|---|---|
queued |
Issue is waiting to be processed by the agent |
autofix |
Issue is eligible for automated remediation |
in-progress |
Being processed by the runner |
done |
Resolved or superseded |
runner-offline |
Runner health alert (legacy — cron trigger removed) |
-
Host: Windows machine (
MyLocalPC) running as a GitHub Actions self-hosted runner service -
Location:
C:\actions-runner -
Scope: Registered to
Coding-Autopilot-System/ci-autopilot - CI jobs (ubuntu-latest): Run on GitHub-hosted ephemeral runners (not the self-hosted runner)
- Deterministic execution on a dedicated host
- Clear separation between orchestration (GitHub Actions) and execution (Python agent)
- Safe automation — all fixes go through PRs; CI must pass; no direct merges
- Audit trail — GitHub Actions logs are the primary source of truth
- Minimal dependencies — stdlib-only agent; no pip install required in CI
-
CI badge:
ci.ymlonmainbranch — visible on README - GitHub Actions logs: Actions tab is the primary audit trail
-
Host logs:
C:\src\ci-autopilot\logs(if agent logging is enabled) -
Runner status:
gh api repos/Coding-Autopilot-System/ci-autopilot/actions/runners
- docs/architecture.md — Source architecture doc
- docs/control-plane.md — Control plane detail
- Setup Guide — Runner registration and local dev
- Configuration Reference — Secrets and operations runbook