Inspiration
Software teams lose countless hours waiting for CI, digging through massive logs, reproducing failures, and pushing small fixes—only to repeat the same process when the next build fails. Existing “self-healing CI” tools often stop at diagnosis or retry failed infrastructure without understanding the code itself.
We built Waywright around a simple question: what if CI could do more than report that the road is blocked? What if it could find another way forward?
Waywright turns continuous integration into a continuous, self-correcting engineering loop that can plan, act, observe real results, and safely improve its own work.
## What it does
Waywright autonomously takes a software task from specification to a verified pull request.
It reads a phased implementation plan, creates an isolated branch, writes the required code, and opens a pull request. It then observes actual CI results instead of trusting its own assessment. When a build fails, Waywright retrieves the relevant failure context, distinguishes actionable regressions from infrastructure noise, applies a focused code fix, and runs the checks again.
The loop continues until the change is verified and ready to merge—or until Waywright determines that human judgment is required.
Every cycle is recorded in durable state and an append-only activity log, making the agent’s decisions visible and recoverable. Safety controls include isolated Git worktrees, independent implementation and verification roles, human-comment hard stops, protected-path safeguards, branch- protection awareness, and escalation when the system cannot make responsible progress.
## How we built it
We designed Waywright as a persistent agent loop rather than a one-shot coding prompt.
A structured plan.md provides the objective, files, required changes, and acceptance criteria for each phase. A state machine tracks each phase through implementation, review, correction, verification, and merge. Durable YAML state and an append-only log allow the loop to resume across sessions without losing context.
the pull-request and review workflow, while CI results supply the external evidence used during the observe-and-correct stages.
The core cycle is:
Plan → Implement → Run CI → Inspect Failure → Patch Code → Verify → Merge
Waywright deliberately scopes log retrieval to the failing job and nearby context. This reduces noise and token usage while giving the agent the evidence it needs to diagnose the problem.
## Challenges we ran into
The hardest challenge was preventing autonomy from becoming unpredictability. A coding agent can always produce another patch, but that does not mean another patch is the correct action. We needed clear rules for when to retry, dismiss a false-positive finding, pause, or escalate to a human.
CI output created another challenge. Build logs can be enormous, repetitive, and filled with unrelated information. Passing complete logs to an agent was both inefficient and distracting, so we focused on retrieving only the failing job and the most relevant surrounding lines.
We also had to distinguish genuine regressions from flaky tests and temporary infrastructure failures. Treating every failure as a code defect can cause an autonomous system to “fix” healthy code.
Finally, durable execution required moving critical context out of the chat session. The loop needed an explicit state model so it could recover after interruption and never forget what it had already attempted.
## Accomplishments that we're proud of
We are especially proud that Waywright closes the entire engineering loop. It does not merely summarize an error or suggest a patch—it connects planning, implementation, real CI observation, correction, independent verification, and merge readiness in one coherent system.
We also built safety into the architecture instead of adding it as an afterthought. The agent cannot declare its own work successful without external evidence. Human feedback immediately pauses autonomous action, protected branch rules remain authoritative, and unresolved failures are escalated with enough context for a developer to take over.
Most importantly, Waywright leaves behind a readable history of what it observed, why it acted, and whether the action worked. Autonomy becomes inspectable rather than mysterious.
## What we learned
We learned that the most valuable part of an agent loop is not generation—it is observation and correction. Writing code is relatively easy; reliably determining whether the code works and choosing the right response to failure is the real engineering challenge.
We also learned that state is as important as intelligence. Without durable state, every new agent session begins with partial amnesia. A small, well-designed state file can be more valuable than an enormous conversation history.
Separating the maker from the checker was another major lesson. An agent should not be the sole judge of its own output. Independent verification and real external signals make autonomous engineering substantially more trustworthy.
Finally, we learned that safe autonomy does not mean removing humans. It means involving them only where their judgment has the highest value.
## What's next for Waywright
Next, we want to expand Waywright from a hackathon prototype into a production-ready CI teammate.
We plan to support more CI providers, improve failure classification using historical test data, and add richer visual timelines for every plan–act–observe–correct cycle. We also want to introduce configurable cost and iteration budgets, repository-specific policy controls, and better learning from previously resolved failures.
Longer term, Waywright could coordinate multiple specialized engineering agents across testing, security, performance, and deployment. Our goal is not simply to automate more coding—it is to build a dependable system that continuously finds a safe path from specification to verified software.
Built With
- a-self-directing-agent-that-closes-both-loops:-it-steals-oss-prior-art
- built-kite
- gates-merges-through-pomerium
- implements
- pomerium
- react
- self-corrects-on-real-buildkite-ci
- ts
- zero-xyz
Log in or sign up for Devpost to join the conversation.