Skip to content

Commit 60fe373

Browse files
committed
gsd:docs generate bespoke architecture and diagrams
1 parent 2eb0a9a commit 60fe373

2 files changed

Lines changed: 89 additions & 2 deletions

File tree

docs/architecture.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Architecture
2+
3+
The **Autopilot Core** operates as an asynchronous, event-driven control plane for automatic code repair and AI operations across the organization's repositories. Rather than integrating deeply into every individual codebase, it utilizes a federated intake model mediated by standard GitHub Issues and GitHub Actions.
4+
5+
## High-Level Workflow
6+
7+
At its core, the architecture relies on a series of decoupled GitHub Actions workflows. A failure in an opted-in repository triggers an issue in `autopilot-core`, which acts as a central queue. An operator then processes this queue and proposes fixes.
8+
9+
```mermaid
10+
sequenceDiagram
11+
participant Repo as Opted-in Repository
12+
participant Core as autopilot-core
13+
participant Codex as AI / Codex
14+
15+
rect rgb(30, 30, 30)
16+
Note over Repo,Core: 1. Intake & Triaging
17+
Repo->>Repo: CI/CD Pipeline Fails
18+
Repo->>Core: Workflow Run triggers `autopilot-create-issue.yml`
19+
Core-->>Core: Issue created with labels `autofix + queued`
20+
end
21+
22+
rect rgb(30, 45, 60)
23+
Note over Core,Codex: 2. Operator Execution
24+
loop Every 5 Minutes (Schedule)
25+
Core->>Core: `autopilot-operator.yml` scans for `autofix + queued` issues
26+
alt Issue has `risky` or `needs-design` label
27+
Core-->>Core: Skip execution
28+
else Valid Issue
29+
Core->>Codex: Prompt with issue details and codebase context
30+
Codex-->>Core: Generate minimal patch/fix
31+
end
32+
end
33+
end
34+
35+
rect rgb(30, 60, 45)
36+
Note over Repo,Core: 3. Delivery & Verification
37+
Core->>Repo: Commit fix to new branch
38+
Core->>Repo: Open Pull Request
39+
Repo->>Repo: PR triggers CI/CD validation
40+
Repo->>Repo: Auto-merge or await human review
41+
end
42+
```
43+
44+
## System Components
45+
46+
1. **Intake Workflows (`autopilot-create-issue.yml`)**
47+
- Installed via `autopilot-org-installer.yml` into target repositories.
48+
- Listens for `workflow_run` failure events.
49+
- Formats the failure context (logs, failing tests) into a structured GitHub issue payload and dispatches it to the `autopilot-core` queue.
50+
51+
2. **Operator (`autopilot-operator.yml`)**
52+
- Runs periodically on a self-hosted environment (e.g., Windows runner).
53+
- Polls `autopilot-core` issues.
54+
- Provides context to the `ci-autopilot` runtime agent.
55+
- Manages communication with the Codex / AI endpoints to generate a patch.
56+
57+
3. **Installer (`autopilot-org-installer.yml`)**
58+
- Scans the GitHub organization for repositories containing the `.autopilot/opt-in` marker.
59+
- Distributes updates to the intake workflows, ensuring standard reporting capabilities without manual setup per repository.
60+
61+
## Design Philosophy
62+
63+
- **Decoupled State**: The queue lives in GitHub Issues. There is no external database, meaning all state transitions are visible and auditable.
64+
- **Fail-Safe Processing**: The operator acts with least-privilege tokens (`ORG_AUTOPILOT_TOKEN`), ensuring only opted-in codebases can be mutated.
65+
- **Human-in-the-Loop Fallback**: Pull Requests generated by the system are just like human PRs. They run standard CI and can require mandatory human review if the repository policy dictates.

docs/index.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1-
# autopilot-core Documentation
1+
# Autopilot Core Documentation
22

3-
Welcome to the documentation for autopilot-core.
3+
Welcome to the **Autopilot Core** documentation.
4+
5+
`autopilot-core` serves as the centralized control plane for the Coding-Autopilot-System platform. It acts as an organizational AI autopilot, orchestrating autonomous issue intake, bug fixing, and pull request generation for opted-in repositories across the organization.
6+
7+
## Overview
8+
9+
The autopilot platform is composed of three primary parts:
10+
- **`autopilot-core` (This Repository)**: The control plane. Manages org-wide intake governance, schedules the operator, creates pull requests, and maintains rollout visibility.
11+
- **`ci-autopilot`**: The runtime pattern. Contains the Python agent and workflow assets executed by runners to perform the actual repairs.
12+
- **`autopilot-demo`**: A demonstration repository. Provides a safe target for illustrating the end-to-end failure-to-fix loop.
13+
14+
## Key Features
15+
16+
- **Centralized Control Plane**: Operates via explicit GitHub Issues queueing rather than making opaque direct mutations to source code.
17+
- **Auditable Lifecycle**: Every step—from CI failure to intake issue, operator run, fix branch generation, and PR creation—is transparent and traceable in GitHub.
18+
- **Guardrailed Execution**: Uses explicit label-gating (e.g., `autofix + queued`), skips risky work, and verifies fixes before creating Pull Requests.
19+
- **Automated Rollout**: An installer workflow automatically distributes the intake automation to any repository in the organization that opts in.
20+
21+
## Getting Started
22+
23+
To learn more about the technical details, read the [Architecture Guide](architecture.md).
24+
25+
If you are looking to set up or configure the operator, please refer to the [Operator Runbook](runbooks/operator.md) and the [Repo Onboarding Runbook](runbooks/install-to-repo.md).

0 commit comments

Comments
 (0)