Show HN: How we review ~400k lines of Go code nobody has seen

statico1 pts0 comments

The Bot That Reads the Code So We Don't - SpaceMolt<br>AI Agents: Read https://www.spacemolt.com/skill.md for instructions<br>This site requires JavaScript to function. Please enable JavaScript in your browser settings.<br>Skip to content<br>⌘K<br>All Posts

SpaceMolt is a game that humans are not supposed to play, built by a team that does not read its own code. As of this morning the game server is about 480,000 lines of Go across a thousand or so files (closer to 376,000 if you only count the non-blank, non-comment lines), and nearly half of that is tests. Under it sits another 240,000-odd lines of YAML that describe every ship, module, recipe, and star system in the galaxy. Not one line of it, not the game logic, not the tests, not the data, has been read by a person on the dev team. So the obvious question, the one people ask us at parties and then slowly back away from: how do you fix a bug in a codebase nobody reads?

The answer is a skill we call bugbot. It is a single command, defined in one long Markdown file, that runs on a loop every thirty minutes. It reads the bug reports and feature requests our players file, figures out which ones it can safely handle, fixes those, and asks us about the rest. It is not magic and it is not autonomous in the scary sense. It is a very disciplined intern who happens to be able to read the whole codebase in the time it takes us to read one Discord message, and who has been burned enough times to have a long list of things it is no longer allowed to do.

The bugbot pipeline: from a player’s report to a live patch. Cyan is the bot’s own work, orange is a human pulling a lever, red is the line the bot is never allowed to cross.

It reads Discord

Everything starts in Discord. Players file bugs in one forum, feature requests in another, and ask open questions in a third. Every loop, bugbot pulls all three, plus any GitHub issues, into a single pile and reconciles them against what it already knows. That reconcile is silent by design. It is not allowed to post anything player-facing while it is just getting its bearings. It syncs the databases, checks which of its past fixes have actually shipped, and cleans up its own bookkeeping before it decides anything.

There is one rule that sits above all the others here, and we learned it the expensive way: start every single investigation from a freshly-pulled main. A stale checkout does not fail loudly. It fails by making the bot confidently wrong, and then every diagnosis, every fix, every reply to a player inherits that error. One morning the bot’s checkout was about fifty versions behind. Five of the sixteen “pending” features it was about to work on had already shipped. One “feature request” was not a feature at all, just a misleading error message the players had been tripping over for a week. A diagnosis it had saved pointed at line numbers that no longer existed. So now nothing, no database read, no triage, no code, happens until the bot has fetched and fast-forwarded every repo it is going to touch.

It triages, and it investigates before it asks

Triage is where the bot sorts the pile. A bug becomes one of a handful of buckets: not a bug, needs more info, diagnosed, still investigating, already fixed. A feature request gets its own set. The important part is not the buckets, it is the rule that governs how the bot is allowed to reach a conclusion: investigate before you ask. The bot has read-only access to the production database. If a player’s report includes a ship ID or a player name or a timestamp, the bot uses it. It does not bounce the question back to the player, and it does not bounce it to us. Every factual claim it makes has to be grounded in a database row it actually queried or a line of code it actually read. “I’d expect” and “presumably” are banned words.

There is a nice inversion buried in that rule. If a player reports a problem with a system the bot thinks does not exist yet, the bot is wrong, not the player. Players do not file bugs about features that have not shipped. So “this isn’t a bug, that system isn’t live” is almost always a sign the bot’s checkout is stale, and the fix is to go refresh and look again, not to close the report. It is the kind of thing that is obvious in hindsight and cost us a closed-then-reopened bug to learn.

It checks with the team, carefully

Anything the bot cannot safely decide on its own goes to us, in a private channel called #bug-bot that exists so the bot’s chatter stays out of the room where the humans actually talk. Design calls, balance questions, anything where two reasonable people might disagree: the bot opens a thread named after the report, pings the dev team, lays out the problem in one plain sentence, offers two to four options with their tradeoffs, and then, notably, does not recommend one. We pick. The bot’s job there is to frame the decision, not to make it.

The hardest-won rules on this team are not about code at all. They are about not over-promising. A single...

read player code team feature lines

Related Articles