Now let's look at economic / budgeting logic.
First of all, sector AI should not emphasize on something it has no control of. That includes building spaceport for anything other than solar panel / orbital farm / observatory. Fleet capacity or ship building modules are meaningless to sector as it doesn't operate fleets. That also includes building security assets like military stations or armies or synchronized defense module. Sector does no diplomacy so it has no knowledge how valuable security assets are. Those all are responsibilities of empire AI / player. They are directly accessible to empire AI / player anyway. Sector should put resources into those aspects only when either a) there's no worthier economic project left, or b) empire AI (and maybe player) pushes an order down and there are no high-priority economic projects now.
Second, redevelopment is generally wasteful of minerals. Do it only in specific situations. Those situations include:
a) Redevelop farms (but not frontier clinic / hospital or paradise dome) when planet is fully grown and there's a lot of excess food. Bonus food from happiness should be excluded from calculation of excess food, to prevent starvation caused by happiness drop.
b) Redevelop Symbol of Unity when planet is full, all pops follow national ethos, and their ethos divergence is below -10%.
c) Redevelop normal power plant on Be stone tile to Be power plant. Similarly, redevelop tier 1 or tier 2 research lab on xeno pet tile to xeno zoo.
d) Redevelop non-unique building into power plants when sector energy income is negative, sector energy stockpile is running low, and there is no [suitable*] empty tile in all planets of the sector to construct power plants. [suitable*] here means the tile has less than +2 food / mineral / research, as well as a pop on the same planet working on non-food non-energy tile (so that it can be reassigned to new power plant once it completes).
e) When sector mineral stockpile is more than half full and no better economic option available on planet, redevelopment is fine. Mineral efficiency is not of concern in this case.
Now let's see general priorities of sector AI.
1) Ensuring each planet has at least +1 food until it's full grown shall be sector AI's top priority. When there are multiple ways to boost food production, choose one based on mineral efficiency.
2) Ensuring population growth is never stopped by removable tile blockers shall be the second top priority. This implies sector should strive to always have 100 energy ready to remove tile blocker.
3) Ensuring sector not running low on energy shall be the third top priority. Running low means has negative energy income and a stockpile lasts less than 30 months (enough time to complete whatever building on construction and then a power plant). With "Subsidize sector" function, sector running out of energy isn't disastrous end of day, so securing energy supply isn't topmost priority.
After above three, it's usually about mineral efficiency.
Tier 1 buildings for a pop on empty tile has mineral efficiency (output/mineral) of 1/30 (farm and mine) to 1/20 (energy and research). Tier 0s' are 1/30 (farm and mine) to 1/15 (energy). Tier 1 special buildings (energy hub / mineral processing plant / frontier clinic) have lower efficiency. Though even if we completely disregard their special effects, their efficiency is still at 1/75. On the other hand, upgrading building to tier 2 is 1/90, to tier 3 is 1/120, tier 4 1/150. So obviously, unless top priorities interfere, constructing new building (including three special buildings) for pop on empty tile always precedes upgrading building.
Is upgrading colony shelter when planet reaches 5 pops an exception to that rule? Upgrading colony shelter to planet administration cost 350 minerals, while provides 4 extra output and up to 4 adjacency bonus. So that's average 6 output / 350 minerals, or efficiency 1/58.3. The total efficiency of building tier 0 then upgrading to tier 1 is 1/45 (farm and mine) to 1/30 (energy). So no exception here.
What about upgrading planet administration to planet capital? It costs 500 minerals and provides 2 extra output and usually 4 extra adjacency bonus. So its efficiency is about 1/83.3. Given it also confers other benefits, its priority should be a little higher than upgrading building to tier 2.
When there's a pop working on an empty tile, barring top priorities, how to decide to construct what building on which tile, then? It should aim to maximize output of this pop. So naturally it should respect tile deposit, and favors tile with higher value ones. In cases both tier 0 and tier 1 buildings are available, tile with tier 0 building should calculate its effective deposit value with -1.5. (-1 due to 1 less output than tier 1, -0.5 due to efficiency loss in future upgrade.) Useful special buildings have higher priority than normal ones. If all other are equal, mineral > energy >= research > food.
Space mining / research station of +2 has efficiency of 1/45. Of +3, 1/30. Those are most common instances. So their (as well as constructor ship itself's) general priority is lower than new building and higher than upgrading building.
Spaceport modules themselves have good mineral efficiency comparable to tier 1 buildings, so they have similar priorities when there is empty module slot(s). However, opening slot itself, especially opening the first slot (ie. building spaceport lv 1), is quite expensive, which pushes its total efficiency to just above tier 2 buildings. In case of first slot, it's even lower than that.
Assembling robots is hard to measure by mineral efficiency. It is more energy dependent. Two things are of certain, though. One is that when there is already a pop on an empty tile, building a robot is not an efficient action. The other is that total mineral efficiency of a mine and a robot is lower than a space mining station of +2. So effectively, priority of assembling robots is lower than both tier 1 buildings and space mining / research stations.
Colony ship costs about the same as lv 1 spaceport, comes with no short term benefit, but quite a lot short term burdens (maintenance cost for ship and colony establishment phase, tech cost penalty for new world). So its priority should be at least lower than spaceport lv 1, that is, lower than tier 2 buildings. Perhaps even lower than tier 3.
As for priorities of orders from empire AI, I think it's safe to draw it below mining / research stations and above spaceport upgrade and tier 2 buildings.
How does the sector AI use all these priorities, then? Once per every months, it should check every idling planet / spaceport / constructor ship, each produces a highest priority project that affordable from possible ones to form a list, then process the list from high to low. Next month, get a new list.