Well, retrofits are one of the first things to occur each turn. Ship construction comes later.
It may be that the retrofits happen before the host takes a look at the turns and sorts out all of the new designs.
It could be that the build queues are referenced by design name, or some other method.
As I said below, I have no way of knowing how Aaron actually went about implementing all that code; the examples are to show how very easy it is to have wonky things happen when you're doing things simultaneously.
