fix(realism): use minute-precision datetime in in_active_hours

personas.in_active_hours was discarding the minute component of the
active-hours window, making "09:30-17:45" behave as "09:00-17:00".
Rewrote it to delegate to diurnal.in_work_hours (which uses full
minute arithmetic) and updated the scheduler caller to pass the full
datetime instead of now_dt.hour.
This commit is contained in:
2026-04-30 21:14:36 -04:00
parent f6422f2529
commit f597d70430
3 changed files with 41 additions and 29 deletions

View File

@@ -175,7 +175,7 @@ async def pick(
)
return None
active = [p for p in personas if in_active_hours(p, now_dt.hour)]
active = [p for p in personas if in_active_hours(p, now_dt)]
if len(active) < 2:
logger.debug(
"emailgen pick: source=%s mail_decky=%s only %d personas in-hours",