Repository navigation
Architecture
Design stage. Nothing here is implemented.
One Swift engine process handles all three Minecraft servers and the website. Caddy fronts it on port 8877. The Minecraft servers run under systemd units the engine generates.
:8877 127.0.0.1:8787
browser ──▶ Caddy ──────────────▶ mod engine ──┬──▶ state DB (SQLite)
├──▶ mod store (sha256)
├──▶ Google Sheets
└──▶ test sessions
player ──▶ :25565 / :25566 / :25567 (Minecraft servers, systemd)
Nothing sits between a player and their server. All three servers run continuously.
| Minecraft version | Minecraft port | Role |
|---|---|---|
| 26.1 | 25565 | from the version table |
| 26.2 | 25566 | from the version table |
| 26.3 | 25567 | from the version table |
Ports are allocated from a configured range when a version is added, not assigned by hand. Roles live in a column — see Adding a Version.
| Component | Responsibility |
|---|---|
| Mod engine | One Swift 6.3.3 process: reconciliation for every version, the website API, conflict-test scheduling, Minecraft supervision. See Engine. |
| Minecraft servers | One systemd-managed JVM per version, unit generated from a template. |
| Mod store | Content-addressed jar storage. Server and test mod directories are hardlinks into it. |
| State database | SQLite: versions, modsets, verdicts, conflict graph, deployment history. |
| Caddy | HTTPS on 8877 with HTTP/3, static site, one reverse-proxy route to the engine. See Edge and TLS. |
v1 ran three Swift services on three loopback ports, one per Minecraft version. That meant three systemd units, three Caddy route blocks, three copies of every fix, and nowhere to put logic spanning versions — the conflict graph is worth far more when it accumulates across all of them.
Collapsing to one process means a new Minecraft version adds no service and no Caddy configuration. It adds a row.
The Minecraft servers stay under systemd rather than becoming engine children, because they are long-lived JVMs that must survive an engine restart. The engine generates their units instead of requiring them to be written by hand.
The website shows which servers are up. Status is read by querying each Minecraft server over the Server List Ping protocol on loopback, not by the engine reporting on itself.
One query returns liveness, player count, maximum players and the MOTD, and it exercises the same path a real client uses. A server hung in a way that still satisfies an internal health check will still fail a real ping — which is precisely the case worth detecting.
/var/minecraftai/
├── shared/
│ ├── store/<sha256>.jar content-addressed mod jars
│ └── state.db versions, modsets, verdicts, conflict graph
├── 26.1/
│ ├── sets/<digest>/ materialized mod sets (hardlinks)
│ ├── current -> sets/<digest> the deployed set
│ ├── world/
│ └── logs/
├── 26.2/ …
├── 26.3/ …
├── test/
│ └── <run-id>/ throwaway session, deleted after
└── web/
└── site/public/ served by Caddy
/etc/pummelchen/
├── engine.toml no version strings in here
├── google-service-account.json owner read-only
└── tls/ certificate, obtained externally
Materialized sets are hardlinks into the store, so keeping the last several validated sets for instant rollback costs almost nothing.
Three versions of ~300 mods averaging 8 MB is about 7 GB naive. Deduplicated through the content store — many mods are byte-identical across versions — it is closer to 4–5 GB. A test scratch directory costs essentially zero bytes and materializes instantly.
Store blobs with no referencing modset are prunable, but pruning must keep anything referenced by a retained rollback target.
Test servers are ordinary Minecraft servers with three constraints:
- They may only write beneath
/var/minecraftai/test/, validated by path before launch. - They bind loopback-only scratch ports and run offline-mode.
- They run under
systemd-run --scopewith resource limits and a raisedoom_score_adj.
The last point is not about rationing capacity. It exists so a mod that leaks or spins can never take a live server down with it.
-
No containers. cgroup limits via
systemd-rungive the enforcement that matters without image management. - No client-side testing. v1 ran headless client soaks with a real Minecraft account. They caught real problems but would make every bisection round enormously expensive.
- No proxy in front of the Minecraft ports. Servers stay up, so nothing needs one, and a proxy in the player path is a failure domain with no compensating benefit.
- No per-version service. The thing that made v1 tedious to extend.
Design stage — not implemented
Design
Validation
Trust
Interfaces
Operations
Project
Reference