rosegold-botlab

A lab where AI coding agents race to build blind CivMC-legal Minecraft bots, judged by a world-state oracle

rosegold-botlab

A test lab for Minecraft bots written in Crystal with rosegold-civmc, the restricted CivMC-legal facade over Rosegold. A bot built on the facade is blind: it cannot read the world, only its own inventory, position and a few other signals, so it has to farm from a known layout and confirm its work indirectly. The lab gives a bot (or an AI coding agent writing one) a short task prompt, runs the result against a local offline server, and judges the world afterwards. With Claude Code you can race several models on the same prompt, each in its own lane, and get a scorecard of who passed, how fast, at what cost, and what went wrong.

Seven bots farming their lanes at once, each written by a different model, seen through rosegold-viewer

Every builder gets the same short prompt, and nothing else about the farm:

The tree farm task prompt

A bake-off is just a Claude Code session running one builder agent per lane, plus helpers that re-verify and diagnose each lane:

A Claude Code session running a bake-off

bin/race keeps the standings while it runs:

Race standings from bin/race

And here is one of the bots doing the whole farm (sped up, glass panes show as pink strips in the viewer for now):

One bot cutting and replanting the whole farm

A recent race

Eight builders, one prompt, one shared server, 2026-11-30. Each had 8 verify runs. Builder time is from the agent starting to its first PASS; verify time is the passing verify, build plus bot run.

Builder Verify runs used Builder time Verify time
GPT-6.1 Terra 1 4:30 2:46
Claude Sonnet 1 4:42 2:39
Claude Opus 1 5:21 3:04
GPT-6.2 Sol 1 7:17 3:23
GPT-6 Luna 2 9:25 2:34
Claude Haiku 4 12:52 4:08
DeepSeek V4.1 Flash 1 19:27 2:37
DeepSeek V4 Pro - - -

DeepSeek V4 Pro never got started: its API rejected the tool blocks Claude Code sends, so that lane has no result. Re-running all seven passing bots at once afterwards, six passed again and Sol's bot got stuck once on a walkway, which is the kind of flake the lab is here to find.

How it works

  • A challenge is a prompt, a fixture and an oracle. The only challenge so far is tree_farm: three rows of five oaks on glass-pane walkways over a pit. Cut every log, replant every dirt block, break no glass.
  • bin/verify lints the bot, builds it, resets the lane, lets the bot join, starts it, records viewer frames, and judges the lane with op accounts that read the world directly. The bot itself may only use the facade.
  • Eight lanes share one server, so up to eight bots run side by side.

Requirements

  • Docker, for the Minecraft server (itzg/minecraft-server, Minecraft 26.1 by default)
  • Crystal 1.19.1 or later, with Shards
  • Node.js 20 or later, for the headless viewer that saves frames
  • Python 3, for bin/bench, bin/builder-prompt and lab/cost.py
  • For bake-offs: Claude Code and the rosegold-skills plugin (see Bake-offs)
shards install
npm ci
npx playwright install chromium

Quickstart

Start the server. It binds to 127.0.0.1:25565 (LAB_PORT changes the port) and keeps its world in server/data/.

bin/server up

Write src/tree_farm.cr. A lab bot must join with the name it is given, start the viewer, wait for the go signal, print DONE when finished, and hold the viewer for a moment before it exits. This skeleton does all of that and passes lint; the farming is up to you:

require "rosegold-civmc"
require "rosegold-civmc/viewer"

bot = Rosegold::CivMC::Bot.new(ENV["SERVER_ADDRESS"], offline: ENV["BOT_NAME"])
bot.join_game
bot.start_viewer(port: ENV["VIEWER_PORT"].to_i) if ENV["VIEWER_PORT"]?

go = ENV["GO_FILE"]
2400.times do
  break if File.exists?(go)
  bot.wait_tick
end
raise "no GO file after 2 minutes" unless File.exists?(go)

# Farm here: cut every log, replant each dirt block, keep the glass intact.

puts "DONE"
bot.wait_ticks(ENV["VIEWER_HOLD_SECONDS"].to_i * 20)
bot.stop_viewer
bot.disconnect("done")

Read the task prompt for the farm. Its {{START}} is the lane's start square; for lane 0 that is 2 -60 4, facing east. The facade's agent guide covers digging, placing, movement and what a blind bot may observe.

Run it on lane 0:

bin/verify tree_farm --lane 0

Verify prints one JSON verdict and then PASS or FAIL: <reasons>. Exit code 0 is a pass, 1 a fail, and 2 means the harness could not run (server down, lane busy). While the bot runs, verify prints the lane's viewer URL to stderr.

The run's files are archived under tmp/lanes/0/attempts/<n>/, and tmp/lanes/0/verdict.json points at them: bot.log, frames/ saved every 10 seconds, and mid and done screenshots. A run that fails lint or the build stops before the bot starts, so it has no log or frames, and a screenshot can fail or fall back to a JPEG. Use the paths in the verdict. When you are done:

bin/server down

More: verify, verdicts and attempts, lanes and the server.

Bake-offs with Claude Code

/bakeoff races models against each other on one challenge. Start Claude Code in the repo root, install the rosegold-skills plugin once, and run it:

/plugin marketplace add RosegoldMC/rosegold-skills
/plugin install rosegold-skills@rosegold-skills
/bakeoff

By default it races Claude Haiku, Sonnet and Opus on tree_farm. The skill makes the session the coordinator, which runs lab/bakeoff.js as a Claude Code workflow:

  1. Setup. bin/race-setup starts the server and copies the repo into one sanitized worktree per lane in a sibling directory, <repo>-race/<run>/<slot>-<name>/. Each copy has its own Git history, a prebuilt verifier and linter, and no harness sources (no fixture, oracle or lab Crystal code). Builders are told to stay in their lane, and the diagnosis checks their transcripts for reads outside it. Every lane gets a world check before the race.
  2. Race. Each lane gets a builder agent with the task prompt, the build-bot skill, and a budget of 8 verify runs. Builders run bin/verify --start and --wait themselves and iterate on the verdicts and frames.
  3. Re-verify. After each builder round, a separate helper agent re-runs verify on the lane's source. Only that independent check counts. It is free for the builder, and it must name the same attempt and source hash end to end. A lane without an independent pass gets up to 3 rounds, with the failed verdict as feedback.
  4. Diagnose. An Opus agent reads each lane with a result: its source, logs, frames, race log rows and builder transcripts, decides whether the pass is genuine, checks for rule breaks, classifies any failure, and proposes upstream fixes.
  5. Score. A Sonnet agent writes tmp/bakeoff/<run>/scorecard.md: official standings by time from launch to pass (see docs for the fallback), attempts, independent checks, and the diagnoses. The coordinator then adds estimated API cost per lane from lab/cost.py and a speed and reliability run from bin/bench.

Lanes can be overridden, for example /bakeoff tree_farm haiku=general-purpose@haiku opus=general-purpose@opus. Other providers work through your own agent definitions. Details, arguments and outputs: docs/bakeoff.md.

Racing builders by hand

Without the workflow, you can run the same race with Claude Code teammates or any other agent: bin/race-setup makes the lanes, bin/builder-prompt renders each builder's prompt from lab/harness-prompt.md, and you hand one prompt to each agent. See docs/races.md.

Watching a race

bin/race tmp/bakeoff/<run>/race.jsonl          # standings
bin/watch ../rosegold-botlab-race/<run> --race-log tmp/bakeoff/<run>/race.jsonl
bin/peek --lane sonnet                          # one fresh frame; prints its path

bin/watch opens one window with a live tile per lane. bin/peek runs in the lane's own worktree. You can also join the server with a Minecraft 26.1 client and fly over the lanes as a spectator. See docs/races.md and docs/lanes.md.

Adding a challenge

A challenge lives in challenges/<name>/ with a PROMPT.md, a fixture.cr that builds and resets a lane, and an oracle.cr that judges it. The harness is currently wired to tree_farm, so a second challenge also needs changes in lab/verify.cr. See docs/challenges.md.

Other files

  • src/bot.cr is a harmless starter bot: it connects, prints a greeting and disconnects. shards run bot connects to CivMC unless SERVER_ADDRESS is set. Read the CivMC rules before running anything against a real server.
  • examples/elevator.cr and examples/xp.cr are small facade examples. Read each file before running it.
  • docs/known-issues.md lists viewer quirks and other limits found while running the lab.

License

MIT

Repository

rosegold-botlab

Owner
Statistic
  • 0
  • 0
  • 0
  • 0
  • 1
  • 21 minutes ago
  • November 30, 2026
License

MIT License

Links
Synced at

Mon, 30 Nov 2026 16:43:20 GMT

Languages