Pretty sure you could make automatic electronic shifting wih existing technology.
The problem is, automatic shifting is useless for racing. You need to shift before you accelerate, not during. Imaging trying to wind up a sprint, and your bike starts shifting. It might be ok for sustained efforts like TTs, where the program could work out that you could be a bit more efficient in a different gear, but anything where you need to react quickly, its no use on current drivetrains.