Public: anyone can read this; the crew can change it.
Game servers: Minecraft Java as a ready-made /infra design (#16696) #17341
Merged 2d 6h ago, live in production
This adds Minecraft Java as a ready-made /infra design, reachable from the infra MCP tool and the terminal but not from the web page. I haven't run the full suite. tsc is clean and the Minecraft test plus the MCP, llms-tools and hollow tests pass.
-
Reviews
Changes requested — before the latest pushNothing high on the security side: the plan goes through
planWants, so the admin check, ceiling and read-only switch are the plan's own. The input checks (domain, repo, name, players, dns account) are tight, and the compose file is built from validated values only. Three changes for one round:- Test the success path (fix first).
test/minecraft-design.test.tsnever reaches a successfulplanMinecraft. The only action-level test is the 'place not read' refusal. Nothing checks that a kept place is found, that the machine want and the SRV want both reachplanWants, or thatcomposeandnotecome back. The MCP test only covers the 'incomplete' answer, and the terminal test only covers the 'no Cloudflare account' stop. Seed a kept place and a Cloudflare write account, as the neighbouring infra tests do. Then assert: (a)planMinecraftreturns a plan with both wants, plus the compose and note; (b) the MCPplanwith a fullwantreturnscomposeandsteps; (c) a non-admin gets the plan's refusal; (d) the terminal'sMflow reaches the plan screen with the compose text. Without these, the wiring inactions/minecraft.ts, the MCP branch andcomposeMinecraftcould break and the tests would still pass. - Do not ship
itzg/minecraft-server:latestunpinned.minecraftComposealso setsVERSION: LATEST. Every restart of the box can pull a new image and a new Minecraft version, and can upgrade or corrupt the world with no one asking. Pin the image to a tag, and either pinVERSIONor make it an input. Add a test for it. - Small cleanups.
- The
minecraftDesigndoc comment says 'a place ofmemoryMiBandarch', but the parameter is{memoryMiB, size}. Make the comment true. - The terminal flow always names the server
mcand silently takes the first Cloudflare account (accounts[0]). A second server therefore collides on name, and a person with two accounts cannot choose. Ask for the name, or pick the account when there is more than one. - Keep the import order in
src/http/mcp/tools/infra.tsandsrc/tui/screens/infra.tsconsistent with the surrounding imports.
- The
Not blocking, and I am not asking for them: the web page door is absent. The docs say so, and the tool and the terminal both work. The gate's 0.70 similarity note on
minecraftComposeis fine.ApprovedApproved. Earlier asks, all met in the diff since f02e17fef: the success path is now tested at the action, MCP tool and terminal doors, and the non-admin refusal is tested. The image is pinned to a tag and VERSION is pinned and validated, with
latestrefused. The terminal asks for the server name, and asks for the Cloudflare account only when there is more than one. The imports are grouped, and theminecraftDesigndoc comment is corrected.Security: every input is validated at the boundary (players digits only, domain, repo, name, version and the Cloudflare account by regex), so no user text reaches the compose file unchecked. The EULA is accepted only by an explicit
eula === trueor the terminal confirm. The plan goes throughplanWants, so the admin gate and the ceiling are the plan's own. TheRCON_MCsecret is interpolated, not written into the file.aka.msis correctly listed in egress NOT_CALLED because it is never requested.Doors: the MCP tool and the terminal both have it, and the how-to is in
docs/features/infra.md, not in the README.Non-blocking: confirm that the
itzg/minecraft-server:2025.4.0tag exists on Docker Hub before the first real use. The web page does not offer the design yet; the docs say so. - Test the success path (fix first).
-
Checks
shipped production is serving it deploy 93c7c3d
-
History
- Rewrap comments (#17076) a358590
- Minecraft design: pin the image and version, test the success path, ask the name and account in the terminal (#17076) 1f4dc0d
- Merge remote-tracking branch 'origin/main' into scout/17076-game-servers-minecraft-java-as-a-ready-m f02e17f
- Egress literals: aka.ms is the EULA link, never requested (#17076) 9ca2198
- Revert #17320: the bundle boot's CPU share doesn't separate bundle from source on Linux (#17346) 2e737a7
- A spawn whose first proof answered still settles it, so the new home is asked… (#17331) 8485415
- Full-suite report files every tally echo under the budget note's file (failed… (#17333) 466ceda
- The crew falls back to the capped key when every plan's window is full, and Settings → Crew shows and steers it (#17168) 4cad6ca
- The bundle's boot is held to a share of the source boot's CPU, measured in the same run, not a wall-clock bound (#17320) 252f7b6
- server.ts imports page, studio, render and API modules on the first request to their prefix (#17313) 9f6e1c4
- The test budget is CPU time: a test starved on a loaded box is not red, one that spends its seconds is (#17310) 3814902
- Advisory integrations: notify on a new exploited advisory (#17326) 31c05ee
- A workspace's dev checkout is synced with the forge's own git, never the operator's environment (#17318) 9a612d3
- Fix the infra tool doc string's quoting (#17076) d3b24f4
- fork-flows: the test's forks do not follow, so the background fast-forward cannot move them between two reads (#17328) fe88e40
- Minecraft design: name it in the infra tool's doc, wrap comments, drop an unused line (#17076) 4d48344
- Games: Minecraft Java as a ready-made infra design, sized by players, A + SRV address (#17076) 9f6baf3
- sweepSoon starts its sweep on the next turn of the loop, so "sweeping a check… (#17327) 1c9fc4c
- Move the accessors out of looks/service.ts (keepLook, lookUrl, memoryPressure) so it leaves the boot's static closure (#17277) 3bdad32
- Shards are packed by the verification's times first: the committed table's stale ones no longer win (#17296) 0d8a7ee
2 earlier comments
This adds Minecraft Java as a ready-made /infra design, reachable from the infra MCP tool and the terminal but not from the web page. I haven't run the full suite. tsc is clean and the Minecraft test plus the MCP, llms-tools and hollow tests pass. bun scripts/gate.ts still prints a both-doors refusal for the new files. I put a No door: line in the last two commit messages but didn't re-run the gate after the final one.
What changed
- Design module (
src/games/minecraft.ts): it takes players, place, domain, repository and an EULA acceptance, and returns theitzg/minecraft-servercompose file plus two wants. The wants are a game box with hostplay.<domain>(its A record) and an SRV record_minecraft._tcp.play.<domain>→play.<domain>:25565through a named Cloudflare account. - Sizing: players set the heap (1–5 players get 2 GB, up to 10 get 3, 20 get 4, 40 get 6, 80 get 8, up to 150 get 12). The place needs the heap plus 2 GB, and Arm sizes (Hetzner CAX) are refused.
- EULA: it is accepted only by an explicit
eula: trueor the terminal's confirm, never filled in for the person. - Planning (
src/actions/minecraft.ts): it reads the place from the kept catalog and plans through the existingplanWants, so the ceiling, read-only and admin-only refusals are the ones every plan already has. - Doors:
infraplanwithwant: {design: "minecraft", players, where, domain, dns, repo, eula, name?}returns the plan,composeand anote. In the terminal,Mon the Infrastructure screen asks for each answer, then shows the plan with the compose file and Build. I used capitalMbecausegis the list's jump-to-top key. - Docs and tests: the how-to is a new section in
docs/features/infra.md.test/minecraft-design.test.tscovers the sizing, the compose file, the wants, each refusal, a place the forge hasn't read, the tool's incomplete answer and the terminal'sM.
Left out
- Web page: there is no form on
/infra. - Compose file: the forge doesn't commit it. The person puts it as
docker-compose.ymlon the named repository's main branch, and the plan'snotesays so. - Not built yet: sleep and wake, backups and the Steam catalog, as the issue says.
- Place not x86-checked: DigitalOcean and OVH shapes aren't checked beyond memory, because the place catalog has no architecture field.
Slips on my side: my second commit broke the quoting in the MCP tool's doc string, and I pushed it without re-running tsc. The third commit fixes it. The gate also flags minecraftCompose as 0.70 similar to securityBody in src/web/standards.ts. I judged that a false positive and left it, and reused no existing function.
Try it: call the infra tool's plan with the want above on the preview, or press M on the terminal's Infrastructure screen. Without a Cloudflare account that allows writes, M says so and stops.
I fixed the egress-literals failure and pushed. The CPU-share failure I did not fix, and I haven't confirmed it's gone.
- Egress literals: the Minecraft design text links the EULA at
https://aka.ms/MinecraftEULAinsrc/games/minecraft.tsandsrc/tui/screens/infra.ts. Nothing requests it, so I addedaka.mstoNOT_CALLEDintest/egress-literals.test.tswith that reason. I did not add it toforge.jsonegress. The test passes now. - Bundle CPU share (0.97 against a 0.6 limit): my branch doesn't touch the bundle or boot code. My branch's copy of
test/bundle-boot-time.test.tshas no CPU-share test, so the check was running a newer version from main. I mergedorigin/maininto the branch, and the merged file still has no CPU-share test either. I didn't run the bundle-boot tests, so I can't say whether that test is gone from main or the check will still run it. If the next check run still fails on it, the failing test isn't coming from this change. - Local checks:
bun x tsc --noEmitis clean and the egress and Minecraft design tests pass.bun scripts/gate.ts --fixfound only comment lines over 100 columns in two files, which the nightly rewrap handles. - Gate note: the gate flagged
minecraftComposeinsrc/games/minecraft.tsas 0.70 similar tosecurityBodyinsrc/web/standards.ts. I left it alone; it's a note, not a failure.
Pull description
Minecraft Java is now a ready-made infra design, sized by player count, with an A + SRV address. It's reachable from the infra MCP tool, the terminal infra screen and the docs. The EULA must be accepted explicitly (eula is true). This push adds aka.ms to the egress test's NOT_CALLED list, because the EULA link is shown to people and never fetched. I didn't add any outside host to forge.json.
Round two of #17076 is pushed: the success path is tested, the image and version are pinned, and the three cleanups are done. The tests pass for test/minecraft-design.test.ts, infra-dns, games, egress-literals and unused-exports. tsc --noEmit and bun scripts/gate.ts are clean. I did not run the 478 test files scripts/fast.ts named, because the estimate was about 34 minutes. The forge's check runs the whole suite.
Tests (test/minecraft-design.test.ts)
- Setup: the doors suite now seeds a kept DigitalOcean place with 8 GB, plus DigitalOcean and Cloudflare accounts that allow writes.
- (a)
planMinecraft: it returns a plan with the machine want and the SRV want, a game-box step and a record step, the compose text, the address and the note. - (b) MCP
plan: with a fullwantit returnscompose,stepsandnote. The 'incomplete' answer is still covered. - (c) Non-admin: a non-admin gets the plan's own
not_found. - (d) Terminal
Mflow: it runs name → players → place → domain → repo → EULA → "The plan", and the screen shows the compose text. The "no Cloudflare account" stop is kept. - Pinning: a new test checks that the compose file has no
:latest, noVERSION: LATEST, and thatlatestand malformed versions are refused.
Pinning
- Image: it is now
itzg/minecraft-server:2025.4.0. VERSION: it is an optional input,version, defaulting to1.21.4. It must be numeric like1.21.4;latestis refused in a sentence. It is on the MCPwantand indocs/features/infra.md. The terminal does not ask for it and uses the default.- Please check: I could not reach Docker Hub from the sandbox, so please confirm the
2025.4.0tag exists before merging.
Cleanups
- Doc comment: the
minecraftDesigncomment now describes{memoryMiB, size}. - Terminal flow: it now asks for the server's name, with no default, so a second server does not collide. It asks which Cloudflare account to use only when there is more than one.
- Imports: the
planMinecraftimports insrc/http/mcp/tools/infra.tsandsrc/tui/screens/infra.tssit with the otheractions/imports. - Comment rewrap: I also committed the gate's comment rewrap.
Left out: the web page door, as before. The gate's similarity notes (minecraftCompose and the test's ctxOf) are left alone. The 100-column comment note on infra.ts and tui/screens/infra.ts was not touched either; it is the nightly rewrap's. unused-exports reports two exports as no longer dead, in src/spawn/watch_probe_default.ts and src/spawn/reach_default.ts; those are not from this change.
Try it: bun test test/minecraft-design.test.ts. In the terminal, open Infrastructure and press M.
This adds Minecraft Java as a ready-made
/infradesign, reachable from theinfraMCP tool and the terminal but not from the web page. I haven't run the full suite.tscis clean and the Minecraft test plus the MCP, llms-tools and hollow tests pass.bun scripts/gate.tsstill prints a both-doors refusal for the new files. I put aNo door:line in the last two commit messages but didn't re-run the gate after the final one.What changed
src/games/minecraft.ts): it takes players, place, domain, repository and an EULA acceptance, and returns theitzg/minecraft-servercompose file plus two wants. The wants are a game box with hostplay.<domain>(its A record) and an SRV record_minecraft._tcp.play.<domain>→play.<domain>:25565through a named Cloudflare account.eula: trueor the terminal's confirm, never filled in for the person.src/actions/minecraft.ts): it reads the place from the kept catalog and plans through the existingplanWants, so the ceiling, read-only and admin-only refusals are the ones every plan already has.infraplanwithwant: {design: "minecraft", players, where, domain, dns, repo, eula, name?}returns the plan,composeand anote. In the terminal,Mon the Infrastructure screen asks for each answer, then shows the plan with the compose file and Build. I used capitalMbecausegis the list's jump-to-top key.docs/features/infra.md.test/minecraft-design.test.tscovers the sizing, the compose file, the wants, each refusal, a place the forge hasn't read, the tool's incomplete answer and the terminal'sM.Left out
/infra.docker-compose.ymlon the named repository's main branch, and the plan'snotesays so.Slips on my side: my second commit broke the quoting in the MCP tool's doc string, and I pushed it without re-running
tsc. The third commit fixes it. The gate also flagsminecraftComposeas 0.70 similar tosecurityBodyinsrc/web/standards.ts. I judged that a false positive and left it, and reused no existing function.Try it: call the
infratool'splanwith thewantabove on the preview, or pressMon the terminal's Infrastructure screen. Without a Cloudflare account that allows writes,Msays so and stops.Closes #17076