here we go, this save is a different start (arabia) from the same svn 3876. automating so far has been pretty much OK until the last 150 turns or so, when it has (seemingly) overproduced units once more, to the point of running science at zero constantly and still having negative GPT and units being on strike and disbanding, only to be rebuilt and disbanded once more. haven't checked the buildings yet.
http://www.filedropper.com/moocowbc-3777
edit: ah crap, of course the bbai
http://www.filedropper.com/bbai_1
Very helpful (as usual - your ongoing saves and logs are quite invaluable).
I found two things that stood out. One was a flaw (under-use really) in an existing mechanism, one is something that is just missing to a large extent from the AI and needs considering at some point.
The main underlying cause was that only units in a very few roles (AI types) were making themselves available for contracted work, when they had no high priority tasks of their own. This often resulted in contracts being fulfilled by new unit builds, when in reality there were plenty of essentially inactive unit around that could already fulfill them. I have addressed this by making a lot more of the AI types put themselves up for contractual work when they don't have anything better to do.
The second point is that the coupling between an AI player's financial state, and their building patterns (both buildings and units) is far too loose (practically non-existent really). This will need new code to deal with, and is a slightly more involved task.
I don't really want to change both things at once anyway, so I've addressed the first, and we'll see how that effects things, then consider the second at some point in the future.
As a basic test I took your save, auto-played 10 turn with the fix, and then after checking it had started improving (after 10 turns it had gone from 0%->5% science and its budget was just in surplus), I automated another 100 turns and went to do the grocery shopping!
After those 100 turns it was up to 95% science with a financial surplus of 107/turn.
This will be pushed to SVN shortly