Agent-reviewed pull request
The agent review loop, up to three attempts, then a pull request and a CI wait. No person acts inside the run; it ends when CI is green, and the pull request waits for a person to merge like every other.
| Template | agent-reviewed-pr |
| Works on | A git repository, cloned into an isolated Docker sandbox |
| Where a person acts | Nobody inside the run. The pull request it opens is merged by a person, outside it. |
| Waits on systems | CI result, up to 4h |
The workflow
Section titled “The workflow”Drawn from the template spec at build time. Bookkeeping nodes that only record status are left out; amber nodes are where a person acts.
flowchart TD
n_validate["Validate"]
n_implement["Implement"]
n_review["Review"]
n_checkApproval{"Check approval?"}
n_openPR["Open PR"]
n_checkReviewLimit{"Check review limit?"}
n_waitForCI[/"Wait for CI<br/><small>waits up to 4h: CI result</small>"/]
n_lessonReviewFailed["Lesson review failed"]
n_reviewFix["Review fix"]
n_checkCI{"Check CI?"}
n_terminateCITimedOut(["Timed out<br/><small>ci timed out</small>"])
n_terminateReviewFailed(["Failed<br/><small>review failed</small>"])
n_done(["Done"])
n_checkCILimit{"Check CI limit?"}
n_lessonCIFailed["Lesson CI failed"]
n_fetchLogs["Fetch logs"]
n_terminateCIFailed(["Failed<br/><small>ci failed</small>"])
n_ciFix["CI fix"]
n_repushAfterCIFix["Repush after CI fix"]
n_validate --> n_implement
n_implement --> n_review
n_review --> n_checkApproval
n_checkApproval -->|"yes"| n_openPR
n_checkApproval -->|"no"| n_checkReviewLimit
n_openPR --> n_waitForCI
n_checkReviewLimit -->|"yes"| n_lessonReviewFailed
n_checkReviewLimit -->|"no"| n_reviewFix
n_waitForCI -->|"received"| n_checkCI
n_waitForCI -->|"timed out"| n_terminateCITimedOut
n_lessonReviewFailed --> n_terminateReviewFailed
n_reviewFix --> n_review
n_checkCI -->|"yes"| n_done
n_checkCI -->|"no"| n_checkCILimit
n_checkCILimit -->|"yes"| n_lessonCIFailed
n_checkCILimit -->|"no"| n_fetchLogs
n_lessonCIFailed --> n_terminateCIFailed
n_fetchLogs --> n_ciFix
n_ciFix --> n_repushAfterCIFix
n_repushAfterCIFix --> n_waitForCI
class n_waitForCI wait
Maturity: built from the flagship steps
Section titled “Maturity: built from the flagship steps”Ships as a built-in template and reuses the engineering steps the flagship flow runs. This particular arrangement of them is not separately exercised end to end against a real repository. See product overview §8.
Use it
Section titled “Use it”Every built-in template is seeded into the workflow library and can be cloned, edited on the visual canvas, and versioned — see architecture for the node types. The spec lives in packages/shared/src/workflow/templates/agentReviewedPr.ts.
© 2026 Jorge Barnaby
Source-available under FSL-1.1-MIT