Public: anyone can read this; the crew can change it.

Game servers: Minecraft Java as a ready-made /infra design (#16696) #17341

opened this

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.

Notes

opened this

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 the itzg/minecraft-server compose file plus two wants. The wants are a game box with host play.<domain> (its A record) and an SRV record _minecraft._tcp.play.<domain> → play.<domain>:25565 through 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: true or 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 existing planWants, so the ceiling, read-only and admin-only refusals are the ones every plan already has.
  • Doors: infra plan with want: {design: "minecraft", players, where, domain, dns, repo, eula, name?} returns the plan, compose and a note. In the terminal, M on the Infrastructure screen asks for each answer, then shows the plan with the compose file and Build. I used capital M because g is 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.ts covers the sizing, the compose file, the wants, each refusal, a place the forge hasn't read, the tool's incomplete answer and the terminal's M.

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.yml on the named repository's main branch, and the plan's note says 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.

Closes #17076

2 earlier comments
commented

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 the itzg/minecraft-server compose file plus two wants. The wants are a game box with host play.<domain> (its A record) and an SRV record _minecraft._tcp.play.<domain> → play.<domain>:25565 through 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: true or 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 existing planWants, so the ceiling, read-only and admin-only refusals are the ones every plan already has.
  • Doors: infra plan with want: {design: "minecraft", players, where, domain, dns, repo, eula, name?} returns the plan, compose and a note. In the terminal, M on the Infrastructure screen asks for each answer, then shows the plan with the compose file and Build. I used capital M because g is 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.ts covers the sizing, the compose file, the wants, each refusal, a place the forge hasn't read, the tool's incomplete answer and the terminal's M.

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.yml on the named repository's main branch, and the plan's note says 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.

commented

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/MinecraftEULA in src/games/minecraft.ts and src/tui/screens/infra.ts. Nothing requests it, so I added aka.ms to NOT_CALLED in test/egress-literals.test.ts with that reason. I did not add it to forge.json egress. 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.ts has no CPU-share test, so the check was running a newer version from main. I merged origin/main into 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 --noEmit is clean and the egress and Minecraft design tests pass. bun scripts/gate.ts --fix found only comment lines over 100 columns in two files, which the nightly rewrap handles.
  • Gate note: the gate flagged minecraftCompose in src/games/minecraft.ts as 0.70 similar to securityBody in src/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.

commented

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 full want it returns compose, steps and note. The 'incomplete' answer is still covered.
  • (c) Non-admin: a non-admin gets the plan's own not_found.
  • (d) Terminal M flow: 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, no VERSION: LATEST, and that latest and malformed versions are refused.

Pinning

  • Image: it is now itzg/minecraft-server:2025.4.0.
  • VERSION: it is an optional input, version, defaulting to 1.21.4. It must be numeric like 1.21.4; latest is refused in a sentence. It is on the MCP want and in docs/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.0 tag exists before merging.

Cleanups

  • Doc comment: the minecraftDesign comment 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 planMinecraft imports in src/http/mcp/tools/infra.ts and src/tui/screens/infra.ts sit with the other actions/ 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.

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs