I have been thinking on this well before this thread popped up.
But the 'change gear' catalyst is mainly either post or pre a drop in cadence.
The
Enviolo system (as referenced above) uses cadence as the independent variable which the rider sets.
I envisage electronic shifting with a protocol which shifts to an easier (or harder) gear when the rider's cadence drops/exceeds a range (specified and input by the rider) say 75-90rpm.
Increased or decreased torque (not power) would 'merely' mean the speed goes up/down.
Maybe there are systems (adaptions of eTap or Di2 assumed) that do this - please point/link to any.
A manual (bars) overide would seem advantageous so the rider can, for example increase cadence while maintaining torque in anticipation in the immediate approach to a hill, and vice versa. Not sure how freewheeling would be dealt with: perhaps if the rider freewheels, the default is no gear change till x seconds after resumption of pedalling.