fix(map): load_map rejects two deployment sides bound to the same zone letter (build_states resets its placed set per side, so shared letters deployed camps on top of each other) - fail-fast MapValidationError + README rule, reject/accept tests

This commit is contained in:
2026-09-19 17:12:42 +02:00
parent 2ee19d34e4
commit ba5eb4c95f
3 changed files with 28 additions and 0 deletions
+8
View File
@@ -140,6 +140,14 @@ def _check_deployment(
if missing:
msg = f"deployment zones absent from zones layer: {missing}"
raise MapValidationError(path, msg)
letters = list(deployment.values())
shared = sorted({letter for letter in letters if letters.count(letter) > 1})
if shared:
msg = (
"deployment sides share zone letters (each side needs its own "
f"distinct zone, or they deploy on top of each other): {shared}"
)
raise MapValidationError(path, msg)
def load_map(path: Path) -> MapSpec: