Skip to content

Commit f0bb0b6

Browse files
Copilotmrjf
andauthored
Add Mermaid architecture diagram to README
Agent-Logs-Url: https://github.com/githubnext/autoloop/sessions/ba5a5adf-9978-40e8-954f-dba2e471cc1d Co-authored-by: mrjf <180956+mrjf@users.noreply.github.com>
1 parent e13f130 commit f0bb0b6

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,48 @@ All state — scheduling, iteration history, lessons learned, current priorities
4747

4848
**You stay in control.** Each program gets its own long-running branch (`autoloop/<program-name>`) that you can merge whenever you're ready. You can provide feedback or steer the direction at any time by commenting on the program's issue or editing the state file on the memory branch.
4949

50+
### Architecture
51+
52+
The diagram below shows what happens during a single Autoloop run — how the scheduler picks a program, how the agent proposes and evaluates a change, and how state is persisted across the program issue, the `memory/autoloop` branch, and the program's draft PR.
53+
54+
```mermaid
55+
flowchart TD
56+
subgraph Pre["Pre-step (scheduler)"]
57+
S[autoloop_scheduler.py] -->|reads| PD[".autoloop/programs/{name}/program.md"]
58+
S -->|reads| SF[("memory/autoloop branch<br/>{name}.md state file")]
59+
S -->|writes| AJ["/tmp/gh-aw/autoloop.json"]
60+
end
61+
62+
subgraph Agent["Agent step"]
63+
AJ -->|selected program| A1["Steps 1-2: Read program,<br/>state file, target files,<br/>issue comments"]
64+
A1 --> A3["Step 3: Checkout autoloop/{name}<br/>fast-forward to main"]
65+
A3 --> A4["Step 4: Propose change,<br/>run evaluation command"]
66+
A4 -->|metric improved| A5a["Step 5a: Commit → push<br/>via create_pull_request /<br/>push_to_pull_request_branch"]
67+
A4 -->|no improvement| REJ["Reject: update state,<br/>no push"]
68+
A5a -->|CI green| A5c["Step 5c: Accept<br/>update state, post to issue"]
69+
A5a -->|CI red| A5b["Step 5b: Fix loop<br/>(up to 5 attempts)"]
70+
A5b -->|fixed| A5a
71+
A5b -->|exhausted| PAUSE["Pause program"]
72+
end
73+
74+
subgraph Safe["Safe-outputs step"]
75+
A5a -->|patch artifact| SO["Apply patch to remote branch<br/>Create/update PR<br/>Post comments to issue"]
76+
end
77+
78+
subgraph Persist["Persistence"]
79+
A5c -->|writes| SF
80+
REJ -->|writes| SF
81+
SO -->|pushes| BR["autoloop/{name} branch"]
82+
SO -->|creates/updates| PR["Draft PR"]
83+
SO -->|comments on| ISS["Program issue<br/>[Autoloop: {name}]"]
84+
end
85+
86+
subgraph Support["Supporting workflows"]
87+
EV["Evergreen (every 5m)"] -->|fixes CI / merges main| PR
88+
CI["CI workflow"] -->|runs on push| BR
89+
end
90+
```
91+
5092
### Scheduling
5193

5294
The workflow runs on a fixed schedule (every 6 hours by default) and runs **one program per trigger**. Each run, it picks the most-overdue program — so if you have 5 programs, they take turns rather than all running at once. Programs can set their own `schedule:` in their frontmatter (e.g. `every 1h`, `daily`, `weekly`), but they still only run when the workflow fires and it's their turn. To run more programs more often, you can increase the workflow's trigger frequency.

0 commit comments

Comments
 (0)