Wake me early if I have had enough sleep

I would very much like to be woken up when the app calculates I’ve had enough sleep. It could use the same smart formula as the bedtime reminder.

Of course, there could still be a ‘safety net’ alarm in case I really have to be somewhere.
So I could set my alarm for 7 am but if the app calculates I need 8 hours’ sleep but I go to bed at 10 pm, it would wake me up at six. If it calculates I need 10 hours’ sleep, though, it would wake me at 7 even though I only got 9 hours’ sleep.

Thanks for considering!