Calibrating against a chaos brain

Before trusting a real model with the village, every notable is fed a random whim each time they are asked. If two villages cannot survive three years of that, a real model will kill them on a bad afternoon.

Run it
BRAIN=chaos bun scripts/village-dry-run.ts DAYS=36
Bar
three years of random whims, villages still growing
A year headless
under a second

A model is not adversarial, but it is unpredictable, and a simulation that only survives sensible decisions has never really been tested. The chaos brain answers every question at random and the economy has to hold.

What it found

  • The essential-trade guard: the trades that feed the village cannot all wander off at once.
  • Labour reallocation: hands move to the thinnest trade daily, and not when somebody decides to.
  • The clerk's storehouse failsafe: the grain opens even if the reeve says no.
  • The yard's hard priorities: doubled-up families and ruins before upgrades, or the yard builds sixty-six households a manor and no houses.

The ways a village has died

Eleven thousand grain in a market with no flour and no bread, because the model kept sending the millers to the inn. People eating only on arriving home. Grain gone by spring. Coin pooled in producer households until nobody could buy anything. Children's portions giving children's satiety. Seventy-four building sites and zero finished houses. The reeve moving the wheat farmers to the bakehouse until the harvest failed. The crowd's storms knocking a tenth off every roof.

Each of those is now a commented rule that says which run killed the village and how. The comment is the test's real output.

Calibrate by running it, not by reasoning about it

bun scripts/village-dry-run.ts plays a year in under a second and prints the day-by-day ledger, and DAYS=36 plays three. If you change a rate, play a year and look at deaths-by-cause before trusting it. Every rule in sim.ts that reads oddly is there because a run without it killed the village.

This is the same instinct as measuring a threshold instead of guessing it, applied to an economy instead of a probability.

Read next

More on the village