generate.py: validate that infra and env are coherent