Skip to content

rohan1402/patchwork

Repository files navigation

Patchwork 🪡

Bug reports in. Regression tests out.

Gemini 2.5 Pro Vercel Next.js TypeScript


What it does

When a bug gets fixed, the regression test almost never gets written. Developers fix the issue, close the ticket, and move on. Six months later the same bug ships again in a slightly different form.

Patchwork fixes this at the source. Install it on a GitHub repo, open an issue describing the bug, and Patchwork automatically reads your codebase, reasons about the failure with Gemini 2.5 Pro, writes a regression test that would catch it, and opens a pull request — before anyone has touched the fix.

The test fails while the bug exists. It passes once the bug is fixed. It lives in your repo forever.


How it works

1. Install the Patchwork GitHub App on your repo

Patchwork receives a webhook for every new issue opened in repos where it's installed.

2. Open a GitHub issue describing the bug

Write it the way you normally would — title, description, reproduction steps. Patchwork reads your existing test files to understand your testing framework and conventions, then uses Gemini 2.5 Pro to reason about the failure and generate a targeted regression test.

3. Patchwork opens a PR with a regression test

A new branch (patchwork/issue-{n}) is created with the test committed to __tests__/regression/. The PR description explains what the test checks, why it will fail before the fix, and what confidence level Patchwork assigned. You review, merge it alongside your fix, and the bug is permanently covered.


Demo

The demo repo is a small e-commerce app with deliberate bugs — cart miscalculations, auth edge cases, order processing errors. Open an issue on it describing one of the bugs and watch Patchwork respond.


Tech stack

Component Purpose
Gemini 2.5 Pro via Vercel AI SDK Reasons about bug reports and generates regression tests matched to your codebase's style and framework
Next.js on Vercel Webhook receiver (/api/webhook/github) and live dashboard
GitHub API via Octokit Reads repo file trees and test files, creates branches, commits, and PRs using GitHub App auth
Supabase Logs completed runs for the live dashboard feed
waitUntil from @vercel/functions Keeps the Vercel function alive for background processing after the webhook response is sent — so GitHub's 10s timeout is never hit

Why not just fix the bug?

Autonomously fixing bugs sounds appealing but it's a hard problem to trust. A wrong fix can silently change behaviour, break other paths, or mask a deeper issue. It's also hard to review — how do you know the fix is correct without a test?

Writing a regression test is a different class of action. It's surgical: it only adds a test that encodes the expected behaviour. It doesn't change production code. It's fully reviewable in a standard PR. And it permanently raises the floor — once the test exists, that specific failure can never silently ship again.

Patchwork doesn't replace the developer. It handles the step that consistently gets skipped.


Built at

Zero to Agent — Vercel × Google DeepMind Hackathon, NYC · March 2026

Built by Rohan Pant

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors