AI-Assisted Coding Fixed 1,013 Bugs in 12 Days

AI-assisted coding audit of the reposurgeon codebase

Eric S. Raymond spent 12 days fixing 1,013 defects in reposurgeon with AI-assisted coding, and he didn’t write a single line of code by hand. The programmer asked an AI model, which he calls Sol 6.2 at xhigh effort, to audit his code and suggest improvements, then fixed whatever it found, 131 times over.

The experiment began after a bug report on reposurgeon, which edits version control histories and translates them between version control systems. Raymond calls it the most complex and original program he has written.

A mature program, a flood of defects

The episode is a rare, detailed look at AI-assisted coding on a serious, long-lived project rather than a demo app.

Reposurgeon is 44,000 lines of Go with more than 1,500 tests, and it has been used in real projects for years. Bug reports are now rare. After fixing the one he received, Raymond did what he now does whenever he touches one of his roughly 65 codebases: he asked the AI to audit the code for bugs.

It kept finding them. Over the next 12 days he ran the loop of asking for defects and fixing all of them 131 times, by the assistant’s count. Each round returned between 6 and 12 reports, and Raymond found the work exhausting. Every report needed a judgment call, starting with whether to let the AI fix it from the description or look into the problem first.

He still reads the diff on most projects. Reposurgeon’s test suite is strong enough that he felt he could be more hands-off here. The AI wrote tests for every fix and new feature, and Raymond’s advice is to tell your assistant to do that if it doesn’t.

Why a well-tested program had so many bugs

The program is an interpreter for a domain-specific language that describes surgical operations on repositories. It has 78 primitives, and at its core it is a structure editor for attributed graphs, full of backpointers and topological algorithms. The state space implied by possible inputs is huge.

Most users stay on well-worn paths, the most common being to read in a Subversion repository, tweak a few things and write it out as a Git repository. Of the 1,013 defects, the assistant found perhaps two or three that could show up in normal use. The rest sat in edge cases. Raymond estimates that up to 80 percent were of the type where misusing the language “will mug you.”

The bugs got odder as the run went on

The real bugs turned up quickly. Later reports came from stranger and stranger edge cases, until, near the end, most of the “defects” could only be triggered by a user who was nearly trying to shoot himself in the foot.

Why he fixed nearly everything

Because the assistant made fixes comparatively easy, Raymond says he can no longer mark edge-case bugs as won’t-fix. If he did, each one would keep appearing as noise in every future audit and could hide a real defect. So he gritted his teeth and fixed almost all of them. He says he will come back to the exceptions.

What this means for maintainers

Raymond’s total also shows the limits of counting. A thousand defects sounds alarming, yet nearly all lived in paths ordinary users never walk, and only two or three could surface in everyday use. Raw counts from an AI audit say little about how risky a release is.

That is a useful lesson for anyone adopting AI-assisted coding on an existing product: expect volume, and plan for triage.

The numbers point to a new kind of workload. An AI auditor never runs out of things to report, and a mature codebase with an excellent test suite still produced a thousand findings. The cost shifts from finding bugs to triaging them: deciding which to trust, which to inspect and which to leave.

That 12-day marathon suggests maintainers will need rules for AI audits, such as how much of the diff to read and when an edge case is worth fixing. Raymond’s account, so far, is that the work was draining but the code is better for it, and the process worked without any hand-written fixes.

Source: X (formerly Twitter)

Written by

Saksham Bhargava

Saksham Bhargava runs Alteroid and has been writing about consumer technology for over five years, covering iPhone, Android, Windows, AI tools and gaming. With an MCA and six years of hands-on web development experience, he tests the features he writes about on his own devices and focuses on clear, practical guides that solve real problems. Away from the screen, he enjoys travelling to places most tourists skip.