Maestro, a coding agent delivery pipeline
An issue lands on the board, one agent implements, another reviews and a third validates in staging. If it breaks, the revert is automatic.
My role
I designed and wrote all of it. 122 commits, all mine, and 110 test files.
- 122
- commits, all mine
- 110
- test files
- 11
- typed fields in the machine contract
Problem
In the first version of our agent pipeline, runtimes crashed 14 times a week, 125 orphan processes piled up, serial rebases took 72 to 115 minutes per issue and merges happened based on a regex over comments.
Solution
I rewrote the control plane as a single daemon in stdlib-only Python, with state in SQLite and a transactional outbox. No transaction spans network or git I/O, and intent is recorded before any irreversible effect, like a merge or a revert push. If it crashes halfway, it reconciles on restart.
Highlights
- A speculative merge queue. CI for the next issue runs on a synthetic branch while the current one is validated in staging.
- Validation is done by the other partner's agent, which checks that the validated SHA is the one deployed. A regression triggers a revert on main and sends the issue back.
- A machine contract of 11 typed fields on the board instead of regexes over comments.
- Two Telegram bots, with one live card per issue, a "needs you" inbox with buttons, daily summaries and a deduplicated incident channel.
- Nightly maintenance that waits for agents to finish, updates tooling with rollback and resumes the pipeline.
Result
It is the pipeline that ships Alliomed today.