Plan draft schedule (Feature 20) #175

Member

Maestro task 598184a8-56fe-4ed8-887b-7780c0aebf12 — Plan draft schedule, third task of Feature 20 (Scheduler and Weekly Automation).

Registers the plan_draft schedule through the scheduler core: fires at household plan_draft_dow/time (default Fri 09:00) in the household timezone with period key plan_draft:YYYY-Www of the NEXT week; drafts next week through the same plan service draft job the API uses and emits one plan_ready:{weekStart} when no plan exists; does nothing when a plan already exists; an AI failure records in ai_runs and emits no plan_ready. Fake-clock tests cover drafting when absent, skipping when present, no duplicate after restart, the failure path, and a settings change taking effect without restart.

Head: 7783971bc14d39c2fd9dcd0f7877405c316f5ede.

Checks: gofmt clean, go vet OK, CGO_ENABLED=0 go build OK, make sqlc-check OK, go test -race -count=1 -timeout 20m ./... all packages OK except one pre-existing internal/recipes TestFetchTimeout timing flake under full-suite load (passes in isolation, 10/10; this branch does not touch internal/recipes).

Maestro task `598184a8-56fe-4ed8-887b-7780c0aebf12` — Plan draft schedule, third task of Feature 20 (Scheduler and Weekly Automation). Registers the `plan_draft` schedule through the scheduler core: fires at household `plan_draft_dow`/time (default Fri 09:00) in the household timezone with period key `plan_draft:YYYY-Www` of the NEXT week; drafts next week through the same plan service draft job the API uses and emits one `plan_ready:{weekStart}` when no plan exists; does nothing when a plan already exists; an AI failure records in `ai_runs` and emits no `plan_ready`. Fake-clock tests cover drafting when absent, skipping when present, no duplicate after restart, the failure path, and a settings change taking effect without restart. Head: `7783971bc14d39c2fd9dcd0f7877405c316f5ede`. Checks: gofmt clean, `go vet` OK, `CGO_ENABLED=0 go build` OK, `make sqlc-check` OK, `go test -race -count=1 -timeout 20m ./...` all packages OK except one pre-existing `internal/recipes` `TestFetchTimeout` timing flake under full-suite load (passes in isolation, 10/10; this branch does not touch `internal/recipes`).
orchestrator-agent added 1 commit 2026-10-10 11:10:46 -04:00
Add plan_draft schedule drafting next week (Feature 20)
CI / ci (push) Successful in 7m12s
CI / ci (pull_request) Successful in 7m25s
7783971bc1
Register plan.Service.DraftSchedule() as the plan_draft schedule: at the
household's plan_draft_dow/time it runs StartScheduledDraft for the ISO
week after the fire date (period plan_draft:YYYY-Www of that week), which
enqueues the same draft_week job as POST /plans/{weekStart}/draft. A
stored draft emits plan_ready:{weekStart} from the job; an AI failure is
recorded in ai_runs and emits nothing. A week that already has a plan is
left as it is.

Fake-clock tests in internal/scheduler cover drafting when absent,
skipping when present, no duplicate after restart, the AI failure path
and a settings change without restart.

Maestro task 598184a8-56fe-4ed8-887b-7780c0aebf12.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
review_agent left a comment
Member

Independent Codex gpt-6-sol review: APPROVED for this exact commit.

Independent Codex gpt-6-sol review: APPROVED for this exact commit.
approver_agent merged commit 15860fbbaf into feature/46305394-a839-4259-a639-85c99eca46af-scheduler-and-weekly-automation 2026-10-10 12:34:07 -04:00
Sign in to join this conversation.
No Reviewers
No labels
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Maniacs_Mansion/MealQuest#175