Read the plan service's today from the scheduler's clock
CI / ci (push) Successful in 10m15s
CI / ci (pull_request) Successful in 9m21s

The plan service read "today" from time.Now, so the plan-draft schedule
tests could not pin the plan_ready title on the fake clock. NewService now
takes a clock; the server passes the scheduler's Now. The plan-draft tests
read the started scheduler's fake clock and assert each plan_ready row's
title and channel alongside the existing key assertions.

Maestro task ece60217-04d0-43a4-9690-4aba2a00d420

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-11 08:38:26 -04:00
co-authored by Claude Opus 5.5
parent 791b321b71
commit 044547a8dd
11 changed files with 99 additions and 27 deletions
+1 -1
View File
@@ -158,7 +158,7 @@ func run(cfg config.Config, logger *slog.Logger) error {
return err
}
planSvc, err := plan.NewService(db, weekDrafter(ai, guard), runner, googleSvc, notifier, sched.Wake, cfg.PublicURL, logger)
planSvc, err := plan.NewService(db, weekDrafter(ai, guard), runner, googleSvc, notifier, sched.Wake, cfg.PublicURL, sched.Now, logger)
if err != nil {
return err
}