Files
warmbly/internal/infrastructure/db/migrations/000099_cold_ramp.up.sql
T
Matthew Meszaros b9cce2fbdc feat: ease a graduating mailbox into cold volume (#231)
* feat: ease a graduating mailbox into cold volume instead of handing it the full cap the day it joins a campaign: cold sending read warmup HEALTH but never whether the mailbox had actually warmed enough, so one at its 40/day warmup ceiling could send 50 cold the next morning, which is the post-warmup spike providers penalise; effectiveCap gains a min() term that starts the mailbox at 5, 10 or 20 a day by how long it warmed and adds 5 per clean day toward its own cap, freezing on a spam placement through the same union-of-freezes the warmup ramp uses, anchored by a new cold_ramp_started_at stamped idempotently on the first cold send and reset on org import because it raises a ceiling the destination never watched being earned; mailboxes that never warmed are not gated, since capping senders who never opted into warmup is a different decision from smoothing the transition out of it

* feat: anchor the graduation ramp on a CONFIRMED send, and make the hold the drawer reports the hold the scheduler applies: stamping cold_ramp_started_at at dispatch started the clock on a send the worker then failed, so a mailbox climbed on days it had not proven anything, and the stamp moves to the worker's EMAIL_SENT; separately the drawer computed its hold over every placement while ColdCeiling only counts placements after the first cold send, so a placement predating the ramp read as paused while the scheduler kept climbing, and both now go through one ColdHeldUntil

* fix: restore the Callout closing tag my conflict resolution dropped, which types:check and lint both pass and only pnpm build catches
2026-08-28 10:47:03 -07:00

15 lines
737 B
SQL

-- Warmup-to-cold graduation (issue #147).
--
-- A mailbox at its warmup ceiling could join a campaign and send at the full
-- cold cap the same day: 40 warmup/day one morning, 50 cold/day the next. That
-- overnight jump is the post-warmup spike providers warn about.
--
-- cold_ramp_started_at is stamped on the mailbox's first cold send and anchors
-- a per-mailbox ceiling that climbs toward its cold cap over days. NULL means
-- the mailbox has not sent cold mail yet.
ALTER TABLE public.email_accounts
ADD COLUMN cold_ramp_started_at timestamptz;
COMMENT ON COLUMN public.email_accounts.cold_ramp_started_at IS
'First cold send; anchors the graduation ramp toward campaign_limit. NULL until the mailbox sends cold mail.';