Appearance
geo-check.mjs
Generates a fixed set of named planets and checks each one's geography against the engine's own rules for biomes, landmarks, flows, the abyss, and replay determinism.
Contributor tooling › geo-check.mjs
What it does
Generates the three planets in NAMED_PLANETS (anvil, kiln, tidewrack). For each one, checks biome legality and coverage, secondary-biome compatibility, landmark placement and wealth correlation, flow terminals, abyss depth, and canyon integrity.
Also checks that two generations of the same seed hash identically, both plain and after replaying a fixed event log. Forces each planet's least-eligible biome to confirm the force takes effect. Sweeps every biome on anvil to confirm every landmark type and flow kind appears somewhere. Runs two fixed-config probes confirming a dry planet grows no rivers and a land-choked sea never reads as abyss.
Exits 1 and prints every failure it finds when any check fails. Exits 0 and prints a summary otherwise.
Usage
Run through its npm run alias:
bash
npm run geo:checkOr directly:
bash
node tools/geo-check.mjsOptions
| Flag | Value | What it does | Default |
|---|---|---|---|
--map | no value | Prints an ASCII biome map under each named planet's report, with a letter-to-biome legend. | Off. Reports print their numbers without a map. |
Inputs and outputs
Takes no file input. Every planet is generated in memory from the fixed seeds and configs in NAMED_PLANETS, resolved through src/engine/bake.mjs and src/engine/worldgen.mjs. Writes nothing to disk; every result prints to stdout, or stderr for failures.
On success, exit 0. Prints a per-planet report covering kind counts, biome shares, coverage against the main-biome floor, determinism checks, replay and settlement counts, landmarks, flows, abyss and trench stats, and the forced-biome probe. Then prints the type-reach sweep across anvil, the dry-planet and narrow-sea probes, and a green summary line.
On failure, exit 1. Each violation prints as its own FAIL line under the planet's report. A dry-planet or narrow-sea probe failure prints as a RED line and stops the run early. A missing landmark type or flow kind across the whole anvil sweep also stops the run there. Otherwise the run ends by naming every planet that failed.
Examples
After changing anything under src/engine/geo.mjs, geo-seam.mjs, geo-events.mjs, or geo-rifts.mjs, confirm the three named planets still hold:
bash
npm run geo:checkRead the terrain by eye while debugging a placement rule:
bash
node tools/geo-check.mjs --mapNotes
Not part of npm run check. Run it directly after touching the geography engine.
The forced-biome probe targets each planet's least-eligible biome, the one furthest from qualifying naturally. A planet whose biomes are all comfortably eligible can still legitimately report wasEligible: true for its forced pick. The probe still checks that the force took effect, stayed legal, and reproduced identically.
Source
tools/geo-check.mjs — part of Contributor tooling