The oneshot
108 edits to Rust code I can't write, from a plan I could
February 2026
I don't know Rust.
I know what factorioctl does because I built the Factorio mod it talks to, the bridge that pipes messages between them, and the Deep Bore telemetry dashboard that monitors everything. I've read the Rust code enough to understand the architecture. I know that game.surfaces[1] means Nauvis, that every Lua command goes through RCON, that character preambles resolve the agent before running any tool. I know the code. I can't write it.
Factorio: Space Age added multiple planets. Every tool in factorioctl hardcoded game.surfaces[1] — Nauvis, the starting planet. 55 occurrences across 3 files. An agent on Vulcanus would try to mine from Nauvis. Useless.
So I wrote the plan. Not "make it work on other planets." A plan with file paths, line numbers, function names, exact code snippets for the new preamble, a list of every function that needed changes, and a verification strategy. Architecture understanding I had. Rust syntax I didn't. At 4:23 AM I pasted it in and said "implement the following plan."
14 minutes
It started at 04:23:49. Read the files I pointed it at. Grepped for every game.surfaces[1] occurrence. Found all 42 in lua.rs, all 12 in mod.rs, the 1 in mcp.rs. Created 6 tasks. Started editing.
The edit cascade for lua.rs alone:
local surface = c.surface
04:25:44 Edit surface_preamble — new helper, fallback to surfaces[1]
04:25:47 Edit start_mining — game.surfaces[1] → surface
04:25:57 Edit mine_at — 3 replacements
04:26:02 Edit mine_nearest
04:26:06 Edit place_entity — 3 replacements
04:26:21 Edit place_underground_belt — 3 replacements
04:26:25 Edit place_ghost
04:26:32 Edit clear_area — restructure surface resolution
04:26:57 Edit find_entities — add agent_id param + surface_preamble
04:27:12 Edit get_entity
04:27:25 Edit get_entity_inventory
04:27:40 Edit find_resources
04:27:53 Edit find_nearest_resource — 2 replacements
04:28:18 Edit get_tiles
04:28:23 Edit get_tile
04:28:36 Edit remove_entity_at
04:28:48 Edit remove_entity
04:29:06 Edit rotate_entity
04:29:11 Edit insert_items
04:29:24 Edit extract_items
04:29:32 Edit set_recipe
04:30:07 Edit create_native_blueprint
04:30:25 Edit save_blueprint
04:30:38 Edit place_blueprint
04:30:49 Edit import_blueprint
04:31:00 Edit get_research_status — convert from raw string to format!
04:31:27 Edit get_available_research
04:31:57 Edit start_research
04:32:03 Edit get_power_status
04:32:17 Edit get_power_networks
04:32:30 Edit find_power_issues
04:32:44 Edit get_power_coverage
04:32:58 Edit get_alerts
04:33:09 Edit get_belt_lane_contents
04:33:25 Grep — verify remaining game.surfaces[1] all intentional
✓ 5 remain: character creation, fallback, init — correct
66 edits in 8 minutes. One function every 7 seconds on average. Read the function signature, understand the Lua template string, add the agent_id parameter, prepend the surface preamble, replace game.surfaces[1] with surface, fix the format arguments. Repeat.
Then it went dark
At 04:37:43, the final action: cargo build --release. The Rust compiler started. The laptop battery didn't care about compile times.
Four hours and twenty-two minutes later I plugged in, opened the laptop, and typed "centinue please" because apparently I also can't spell at 9 AM.
The session resumed exactly where it stopped. The build hadn't completed — the process died with the laptop — so it ran cargo build --release again. The Rust compiler found what the plan missed: three CLI modules (map.rs, power.rs, research.rs) that also called the updated functions. 21 more tool calls. Fixed. Rebuilt. Clean compile.
The approach
The clever part wasn't the code. It was the plan's core insight: every agent already has a character, and every character already has a .surface property. Instead of adding a surface_name parameter to every MCP tool — which would mean changing every tool's schema, every call site, every test — just derive it from the character.
One line added to the preamble. Every function that already called character_preamble gets surface for free. Then it's mechanical: find game.surfaces[1], replace with surface. Zero changes to MCP tool schemas. Zero changes to the mod. Zero changes to the bridge. An agent on Vulcanus just works.
I knew that because I built the mod, the bridge, and the dashboard. I understood the architecture from every angle except the one that writes .rs files. The plan had file paths, line numbers, function names, exact code snippets. It had a list of what stays unchanged and why. It had a verification strategy that used the Rust compiler itself as the test suite — cargo build catches every missing agent_id argument.
Architecture knowledge wrote the plan. Rust syntax filled it in. Different skills, different sources.
Files modified
src/client/lua.rs — 66 edits. 42 game.surfaces[1] replacements. New surface_preamble. agent_id param added to ~26 functions.
src/client/mod.rs — 27 edits. 12 inline Lua fixes. &self.agent_id passed to ~16 call sites.
src/bin/mcp.rs — 8 edits. Research/power tool call sites. broadcast_thought flying text.
src/cli/power.rs — 3 edits. CLI call sites the compiler caught.
src/cli/research.rs — 2 edits. Same.
src/world/entity.rs — 1 edit. Add surface field to CharacterStatus.
src/cli/map.rs — 1 edit. Same.
What stayed unchanged: every MCP tool parameter struct. Every CLI command interface. Character auto-creation (still spawns on Nauvis). The get_surfaces() function. The mod. The bridge. The dashboard.
What this means
I don't know Rust. I do know what my system needs to do on other planets. Those are different kinds of knowledge and they live in different places. The plan came from months of building adjacent layers — the mod, the bridge, the dashboard — where I learned the architecture by using it, not by reading it.
The implementation came from 19 minutes of an LLM doing something it's good at: mechanical, high-volume edits with consistent pattern application across a large codebase. Read function, add parameter, change surface reference, fix format args, move to next function. 108 times. With the Rust compiler as the final check.
The laptop dying in the middle is the detail that makes it real. Not a polished demo. Not a curated example. A session that ran at 4 AM, got interrupted by dead hardware, and picked up 4 hours later with a typo. The code compiled anyway.