Any machine learning experts here? How is the problem of finding empty slots in your calendar formulated as an ML problem? This is an honest question to learn.
Also there's some constraint satisfaction. You probably don't want to do your thing twice in one day. You probably don't want to do it during established office hours. Maybe you want your framework to learn what office hours are (to implicitly support people without that office lifestyle). And you want to aim for having something be done N times a week.
Also, you can use the times that tasks are actually completed as feedback into new suggestions. I.e. if historically you've committed to your hobby every Tuesday night, then we should be that you will continue to do that, ergo, keep scheduling for Tuesday night. Similarly, Defer actions for the same times of day could be taken as an anti-signal (i.e. office hours).