Do you have a building of class BUILDINGCLASS_CAPITAL_SHIPYARD?
Around line 451 in CvAI, which is in doCityAIProduction, it is checking to see if the system has one of those.
If your mod doesn't have one, then it will be checking for a building of class -1, which sounds like the problem.
The Python AI code in doCityAIProduction specifically uses buildings of these classes:
BUILDINGCLASS_HABITATION_SYSTEM
BUILDINGCLASS_EXTENDED_HABITATION_SYSTEM
BUILDINGCLASS_CAPITAL_SHIPYARD
BUILDINGCLASS_TRAINING_COMPOUND
BUILDINGCLASS_SPORTS_ARENA
BUILDINGCLASS_RECYCLING_CENTER
BUILDINGCLASS_NUTRITION_FACILITY
BUILDINGCLASS_MINING_FACILITY
BUILDINGCLASS_NANOEXTRACTION_UPGRADE
BUILDINGCLASS_MAG_LEV_NETWORK
BUILDINGCLASS_COMMERCIAL_SATELLITES
BUILDINGCLASS_SQUADRON_FACTORY
BUILDING_SCHOOL_OF_ZEALOTS
These are all the ones that regular FF does something with plus a few more: extended habitation system, nanoextraction upgrade, squadron factory, and school of zealots (which it doesn't force to be built but the more of them there are in the system the higher the military weight is in the build decision, just like for training compounds).
It also uses these units:
UNITCLASS_MISSILE_I
UNITCLASS_MISSILE_II
UNITCLASS_MISSILE_III
UNITCLASS_MISSILE_Q
UNITCLASS_CARRIER_I
UNITCLASS_CARRIER_II
UNITCLASS_CARRIER_III
UNITCLASS_SPACE_FIGHTER_I
UNITCLASS_SPACE_FIGHTER_II
UNITCLASS_SPACE_FIGHTER_III
UNITCLASS_SQUADRON_Q
UNITCLASS_SPACE_BOMBER_I
UNITCLASS_SPACE_BOMBER_II
UNITCLASS_SPACE_BOMBER_III
and what the global value of CONSTRUCT_SHIP is set to (UNITCLASS_CONSTRUCT_SHIP)
All of these except the construction ship are new in the FF+ code, which can force a few squadrons to be built once there is a squadron factory in the system. Currently it won't force the build of a carrier unless the AI is using the Squadron Doctrine civic (since they are currently useless for the AI).
If your building list is significantly different you should probably just consider the doCityAIProduction to be an example of how to get it to overcome problems it is likely to have if instead of the actual code you should use. It assigns weights to various issues and then tries to do something relating to the highest weighted issue. More specifically, it has weights for:
- Happiness : if there are angry citizens it wants to build sports arenas
- Healthiness: if the system is unhealthy it wants to build recycling centers
- Military: it likes to build capital shipyards and, once it has one of those, a squadron factory (and once it has one it can force building of some squadrons, and maybe carriers)
- Population: if there are more people than places for them to work on planets it wants to build a habitation facility or extended habitation facility
- Food: the less excess food the system produces the more it wants to build a nutrition facility
- Production: it likes to maintain a good level of production per population point, if it is below that then it wants to build a mining facility or nanoextraction upgrade
- Commerce: it likes to maintain a good level of commerce per population point, if it is below that then it wants to build a mag-lev network or commercial satellites
On any given turn when this is called for a system it only attempts to deal with the one with the highest weight, and if it can't do anything about it then it is entirely up to the regular DLL based AI as to what to produce.
Except that first there is a flat 15% chance that it will force a construction ship to be built if the player has more than one star system system, this system has a population of at least 4, and there are not already more than half as many construction ships as there are star systems. And there is a chance (ranging from 25 to 40% depending on some factors) that it will force building of the resource related building if the system has a planet with a resource and it hasn't got the building yet. And if the AI is at war there is a 40% chance per team it is at war with (checks each separately) that it will bail out of the Python AI code without doing anything. I think that's all the special cases that bypass the weight based system.
If your mod doesn't have one or more of the buildings or units listed above, then the details of how the wight is calculated and/or what is done for the affected weight will have to be adjusted. Well, you could remove it all completely, but the regular AI is not incredibly good at dealing with basic problems with health and happiness and it doesn't know anything at all about planets or their yields so it doesn't know how to increase food, commerce, or production via planet yield changing buildings (although it does seem to build some entirely by random accident). The one category that could be most easily left out is actually the military one, although it is likely to be a little worse without it than it is with it since it apparently doesn't prioritize the capital shipyard and squadron factory enough.
And that is about the shortest explanation of doCityAIProduction that I can give that actually provides useful information about how it works.