Moving failures to the cheapest stage
To stop game design data mistakes before they become live incidents, I extended server boot validation and moved validation forward step by step to compile time and the data repository's CI.
Situation
Game designers manage game data in Excel. It is converted to protobuf and loaded by the server. Input mistakes such as broken references or reversed periods turn into live incidents like “an item nobody can obtain”, and most of the people who edit the data are not engineers.
Decisions
Server boot validation: From my first month, I added per-content rules and shared helpers to the boot validator a colleague had built, and I wrote about a third of the current validator code. I check new rules against real data. For example, I added the rate table rule only after confirming it caught exactly the earlier data that had the problem.
Compile time: So that an empty id cannot slip in silently as 0, I wrote a custom WartRemover rule that blocks constructing ids directly without validation. An approach that walks all the data increased compile time, so we rejected it in a team discussion. After a bug where the declaration order of two enums diverged and flipped a grade comparison, I wrote a Scala 3 macro that fails compilation when the order differs, and applied it where needed.
Data repository CI: I added CI to the game design data repository that checks enum/table pairs and numbers that must stay fixed. I designed it so designers would not get extra work, and wrote the failure messages in words designers can read easily.
AI data review: I attached an AI review action built by another team to the data repository, and ran per-domain prompts and a Slack feedback loop.
Result
The point where mistakes get caught moved earlier step by step, from live to server boot, compile time and data commit. The data CI found one real omission on its first run.