Darwin

Issues in. Pull requests out.

Full-stack engineerTeam projectheydarwin.app

The Darwin board, showing every issue a team has filed laid out on one screen.

01What it does

Darwin is an engineering board with agents on it. A team files an issue. A router gives it to a worker. The agent clones the repo into its own sandbox, makes the fix, proves the fix, and opens a pull request through a GitHub App.

I built the system that runs the agents: the sandbox runner, the leases that keep two machines off one worker, the layer that lets three agent CLIs be swapped, and the checks that prove a fix before a human sees it.

Role
Full-stack engineer. Runners, agent harness, router, guards and the board
Team
A small team of engineers
Stack
Next.js, Express on Bun, BullMQ, Redis, Postgres and E2B sandboxes
Status
Live at heydarwin.app

02The stack

Frontend
Next.js 16React 19Tailwind 4React QueryZustandTipTap
Backend
Express 5 on BunwsBullMQGitHub AppMCP SDK
Data
Postgres 16PrismaRedis 7Object storage
Agents
E2B sandboxesClaude CodeCodexOpenCodePlaywright
Infra
DockerTurborepoHusky checks

03Backend

What I solved on the backend

01

Agent runs that outlive a crash

One issue can take an agent a long time, and the machine driving it can die halfway.

The runner breaks a run into steps: prepare the workspace, plan, wait for approval, run, resume, and finish the pull request. A lost run is found and started again, and the worker reconnects to the sandbox it already had.

  • E2B
  • Resumable runs
  • Failure classes
02

Leases with a fencing number

Two machines must never drive the same worker at the same time.

A machine takes a lease with one conditional update that only works if the old lease has run out. Each take raises a counter. A renew only works if both the holder and the counter still match, so a slow machine cannot write over a newer one.

  • Leases
  • Fencing epochs
  • Conditional writes
03

Three agent CLIs behind one interface

Claude Code, Codex and OpenCode each start, resume and print in their own way.

One harness describes what an agent needs: a pinned version checked at start, where its credentials come from, its tools and how to resume. Each CLI has its own stream parser that turns raw output into the same run log events and token counts.

  • Harness
  • Stream parsers
  • MCP
04

Pull requests that carry proof

An agent saying the bug is fixed is not the same as the bug being fixed.

The agent's claim is checked against a schema, then its tests are run inside the sandbox. For frontend work, the built app is loaded in a headless browser, and page and console errors are recorded and graded.

  • Bug proof
  • Playwright
  • Zod
05

A sweeper for everything that gets stuck

With queues, sandboxes and webhooks, something is always left half done.

A guard service sweeps for stuck claims, orphan issues, stuck dispatches and issues held by dead workers. It also moves finished run logs from Redis to object storage every 15 seconds.

  • Reconciler
  • Log flusher
  • Redis

04Design

What I solved on the design side

01

A board that agents and people share

A team needs to see what the agents are doing without opening a log.

Every issue is a card that shows who holds it, a person or an agent, and what state its run is in. The whole team's work fits on one screen.

  • Kanban
  • Virtual lists
02

A run log you can read

Raw agent output is thousands of lines of noise.

The log groups an agent's work into steps: what it planned, what it ran, what it changed. You can follow a run from the issue to the pull request.

  • Run log
  • Streaming UI