You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(iac): several scheduled tasks are not scheduled; delayed purchases never fire on GCP/Azure #712
Several scheduled tasks the server supports are not scheduled by Terraform. process_scheduled_purchases, send_notifications, finalize_revocations and analytics_refresh are unscheduled everywhere. reap_stuck_purchases, fire_scheduled_purchases, ladder_run and analytics_collect are unscheduled on GCP and Azure, so delayed purchases never fire there.
Where
At commit b50ca38: internal/server/handler.go:32-89 (task list) against the scheduler resources in terraform/modules/compute/*. The per-platform matrix is in the arch H4 report of the review fleet.
Failure scenario
A user schedules a purchase with purchase_delay_hours > 0 on GCP or Azure. No scheduler job drives the fire sweep, so it never executes. Notification, revocation-finalize and analytics-refresh tasks likewise never run. Found by source reading. Verify first: confirm there is no other driver on the Terraform stacks (for example an in-process ticker).
Suggested fix
Add a per-task required flag plus an IaC coverage test that every required task has a schedule on each platform. Reject purchase_delay_hours > 0 on platforms with no fire sweep.
Severity
High: delayed purchases and background sweeps silently never run on the affected platforms.
Related: #784 (HTTP-triggered scheduled tasks run on the request context and can be cancelled mid-purchase). It must be resolved before the money sweeps are scheduled over HTTP on GCP/Azure. #710 is fixed in #783.
A coverage test that classifies every server task and fails when a required task is unscheduled on a platform (known gaps listed explicitly, shrinking with each PR).
A small CI/docs housekeeping PR (runs terraform test for the AWS modules; corrects the cleanup claims in docs/DEPLOYMENT.md and known_issues/33).
AWS Lambda schedules, then Lambda cleanup.
CloudFormation schedules (with cleanup as its own commit).
fire_scheduled_purchases, process_scheduled_purchases, send_notifications and cleanup ship opt-in (default off). Enabling them changes live purchasing or deletes execution history older than 30 days, so each deployment opts in deliberately. Flipping fire/process on by default waits on a due-row age cap; this issue stays open until then.
analytics_refresh is exempt (analytics_collect already refreshes the views); ri_exchange_reshape and ladder_run stay opt-in as today.
Status update (2026-10-28): merged so far: #1549 (scheduled purchases due more than 24h ago are refused, not bought, so enabling a sweep can't fire a stale backlog) and #1550 (Fargate now schedules reap, analytics, finalize, process, notifications and cleanup, with purchase-firing tasks opt-in). Cloud Run, GKE and Container Apps schedules are in review next.
Left after that: turning fire/process on by default, which needs owner sign-off.
Status update (2026-10-28): #1573 merged: Cloud Run, GKE and Container Apps now schedule the sweeps (reap, analytics, finalize, process, notifications, cleanup) with Cloud Scheduler / Logic Apps; purchase-firing tasks stay opt-in. With #1549 (24h age cap) and #1550 (Fargate) every platform now schedules every task.
Left: turning the fire/process sweeps on by default, which needs owner sign-off (D33 in the acting-owner report; the recommendation is fire on, process still opt-in). GKE deployed from the GCP environment root still passes no enable_scheduled_tasks/app_url, so it schedules nothing until someone picks the URL Cloud Scheduler should call.
Acting-owner decision (D33, IAmJSD, 2026-10-28): now that the 24h age cap (#1549) is merged, turn the fire sweep (delayed purchases a person approved) on by default on every platform. The process sweep (automatic plan buying) stays opt-in. Fargate keeps Lambda's sweep defaults as merged in #1550 (D31). A PR is in progress.
Status (IAmJSD, acting owner, 2026-10-28): #1580 merged. The fire sweep is now on by default on every Terraform platform (D33). The 24h age cap (#1549) and the sweep schedules on every platform (#1550, #1573) were already in. The process sweep stays opt-in by decision. #1587 corrects the setting descriptions: the sweep carries out delayed human approvals. It does not run auto-approved purchases.
The one item left is reporting when no fire sweep runs (sweep off, or GKE deployed from the GCP environment). That moves to #1588, so I'm closing this issue.
Activity
cristim commentedon Oct 9, 2026
Related: #784 (HTTP-triggered scheduled tasks run on the request context and can be cancelled mid-purchase). It must be resolved before the money sweeps are scheduled over HTTP on GCP/Azure. #710 is fixed in #783.
cristim commentedon Oct 15, 2026
Scope for #712, re-checked against current main before implementation.
Still valid: #710 fixed the names and paths of jobs that already existed (#783), but most server tasks are still not scheduled on most platforms.
Plan, one PR per slice, each "Part of #712":
terraform testfor the AWS modules; corrects the cleanup claims in docs/DEPLOYMENT.md and known_issues/33).Decisions:
fire_scheduled_purchases,process_scheduled_purchases,send_notificationsandcleanupship opt-in (default off). Enabling them changes live purchasing or deletes execution history older than 30 days, so each deployment opts in deliberately. Flipping fire/process on by default waits on a due-row age cap; this issue stays open until then.analytics_refreshis exempt (analytics_collect already refreshes the views);ri_exchange_reshapeandladder_runstay opt-in as today.test(iac): count only scheduler resources as wiring a task
test(iac): cover escaped and single-quoted strings in the comment str…
test(iac): preallocate the stripped file list
test(iac): resolve scheduler locals only from locals blocks
test(iac): check AWS env wiring of scheduled task variables
test(iac): tighten AWS env wiring test fixtures
13 remaining items
fix(cfn): schedule the missing server tasks on the CloudFormation sta…
fix(iac/azure): schedule the server tasks on AKS with CronJobs (#1114)
fix(purchase): skip scheduled purchases due more than 24h ago in the …
fix(fargate): schedule the reap, analytics, process, notification, fi…
IAmJSD commentedon Oct 28, 2026
Status update (2026-10-28): merged so far: #1549 (scheduled purchases due more than 24h ago are refused, not bought, so enabling a sweep can't fire a stale backlog) and #1550 (Fargate now schedules reap, analytics, finalize, process, notifications and cleanup, with purchase-firing tasks opt-in). Cloud Run, GKE and Container Apps schedules are in review next.
Left after that: turning fire/process on by default, which needs owner sign-off.
fix(iac): schedule the server sweeps on Cloud Run, GKE and Container …
IAmJSD commentedon Oct 28, 2026
Status update (2026-10-28): #1573 merged: Cloud Run, GKE and Container Apps now schedule the sweeps (reap, analytics, finalize, process, notifications, cleanup) with Cloud Scheduler / Logic Apps; purchase-firing tasks stay opt-in. With #1549 (24h age cap) and #1550 (Fargate) every platform now schedules every task.
Left: turning the fire/process sweeps on by default, which needs owner sign-off (D33 in the acting-owner report; the recommendation is fire on, process still opt-in). GKE deployed from the GCP environment root still passes no
enable_scheduled_tasks/app_url, so it schedules nothing until someone picks the URL Cloud Scheduler should call.IAmJSD commentedon Oct 28, 2026
Acting-owner decision (D33, IAmJSD, 2026-10-28): now that the 24h age cap (#1549) is merged, turn the fire sweep (delayed purchases a person approved) on by default on every platform. The process sweep (automatic plan buying) stays opt-in. Fargate keeps Lambda's sweep defaults as merged in #1550 (D31). A PR is in progress.
revert(cfn): leave the CloudFormation install stack to its retirement
test(iac): give the schedule-default test its own default regex
fix(iac): fire delayed purchases by default; collect AWS recommendati…
IAmJSD commentedon Oct 28, 2026
Status (IAmJSD, acting owner, 2026-10-28): #1580 merged. The fire sweep is now on by default on every Terraform platform (D33). The 24h age cap (#1549) and the sweep schedules on every platform (#1550, #1573) were already in. The process sweep stays opt-in by decision. #1587 corrects the setting descriptions: the sweep carries out delayed human approvals. It does not run auto-approved purchases.
The one item left is reporting when no fire sweep runs (sweep off, or GKE deployed from the GCP environment). That moves to #1588, so I'm closing this issue.
docs(iac): purchase_delay_hours defaults to 0, and a stopped sweep ne…
docs(iac): describe the fire sweep as carrying out delayed human appr…