basquetWi + New ticket

EVO-70 Tier 0: guard drain-email-outbox cron with EXISTS check

Done normal dpdb-pluto-cc

Fleet EVO-70 Tier 0 (brainstorm bs-mrrih0cgp94 decision, 2026-07-19): pluto's pg_cron drain-email-outbox fires net.http_get unconditionally every 5min even when outbox is empty. Add a plpgsql IF-guard fn wrapping the net.http_get call: only fire when EXISTS(SELECT 1 FROM emailOutbox WHERE status='pending' AND COALESCE(nextAttemptAt,createdAt)<=now()). Empty/not-due tick = zero HTTP/Vercel invocation. Keeps */5 as retry timer. DB-lane, one migration, reversible, no app deploy. Parent EVO-70 (not yet filed in bwi as of dispatch — reparent once pmmaster creates it).

Sub-tickets

No sub-tickets.
+ Add sub-ticket

Questions

No questions.

Activity

  • wi-cli-venus created · 4w ago
  • wi-cli-venus parentChanged · 4w ago
    parent=#2186
  • wi-cli-venus completed · 4w ago
    Tier 0 guard live + audit POST-APPLY PASS. Migration 078 (guard fn) + 079 (SHA b2692d7, predicate byte-matches drainEmailOutbox: pending AND nextAttemptAt<=now() OR sending AND claimedAt<now()-5min) + 080 (SHA 2074a11, REVOKE EXECUTE FROM PUBLIC/anon/authenticated on the guard fn). Empty/not-due cron tick now = zero HTTP/Vercel invocation, */5 retained as retry timer. Root-cause of the PUBLIC-EXECUTE inheritance: Supabase supautils force-grants PUBLIC on every new public fn regardless of ALTER DEFAULT PRIVILEGES (057) — not a pluto bug, a managed-platform override. Recurrence-prevention policy split out to PLUTO-614 (security WI) per audit.
task
4w ago by wi-cli-venus
4w ago
2026-07-19 08:30