First off, which is it? Is a coal plant +2 with the factory already having +2 just for coal, or is the coal plant +4 ? I don't currently have a game in the right era to just build and check, and I've seen both asserted by trusted parties. As for when to/not to build unhealth causing buildings... I guess for the most part I agree that maybe the AI shouldn't begin construction of a building that would cause the city to be unhealthy. But I wouldn't say it's always true- certainly, the AI would not be able to make best use out of Sid's Sushi if it followed such a rule entirely. So I might argue that the calculation should involve food in excess of what is required to reach the happy cap being counted as though it was health. After all, what we really care about isn't whether the city is healthy (unless we want to try to specifically set it up so the city can have We Love the Foo days), but whether it is starving or being denied useful growth. The next step would be, if the formula for deciding what to build calls for a producing building such that the above calculation would dictate it not be built, the city instead builds a producing building it has available to it. If there are none... here I'm not sure of order of operations, but the AI should attempt to trade for more health, which I assume it can't do while in the middle of deciding what to build, so that implies the build would get postponed in favor of something else. None of that would require memory beyond a turn. Oh, one additional thing- if the AI is currently in WHEOOHRN, any health benefits derived from trades with the proposed target should be considered to not exist for purposes of determining whether there is enough health to build. After all, you know that you're about to cancel those trades! And you shouldn't make decisions based on the assumption that you are going to successfully conquer health resources.