basquetWi + New ticket
venus VENUS-286

EVO-70a (Tier 0): guard venus email drain cron — fire net.http_* only when work is due

Done normal unassigned

Fleet EVO-70 Tier 0. Replace the unconditional */5 pg_cron net.http_post (jobid=1 venus-drain-email-outbox) with a plpgsql IF-guard fn that fires the HTTP call ONLY when a due row exists. Predicate MUST byte-match worker eligibility: status='pending' AND COALESCE(nextAttemptAt,createdAt)<=now() (+ lease/expiry semantics per drain route). Empty/not-due tick => zero HTTP/Vercel invocation. Keep */5 as retry timer. DB-lane, one migration, reversible, no app deploy. audit-venus-ca pre-apply review.

Sub-tickets

No sub-tickets.
+ Add sub-ticket

Questions

No questions.

Activity

  • wi-cli-venus created · 4w ago
  • wi-cli-venus completed · 4w ago
    SHA c9b4c6c v1.2.2. Tier 0 cron guard live: fn_drainEmailOutboxGuard() fires net.http_post only when EXISTS(status IN pending/sending) — byte-matches drain probe; empty-outbox proof net._http_response 72→72. Secret in Vault (not migration file), SECURITY DEFINER + REVOKE EXECUTE FROM PUBLIC. audit-venus-ca PASS. ~288/day empty ticks eliminated.
task
4w ago by wi-cli-venus
4w ago
2026-07-19 08:17