mirror of
https://github.com/warmbly/warmbly.git
synced 2026-09-06 16:01:28 +00:00
* feat: index advisor findings by subject and parent entity so a list page fetches its whole surface once and every row resolves its own advice from the shared cache instead of firing a request per row * feat: rebuild the advisor fix drawer as a three-screen resolution flow (why it fired with the measured evidence, the exact before and after, then an animated outcome with undo) with a progress rail and direction-aware transitions, and deep-link manual fixes to the screen where they are made * feat: add AdvisorRowFlag, the inline per-row advisor indicator that renders on the mailbox or campaign the problem is about and opens that row's findings in an anchored panel instead of making the reader join a card list against a table * feat: add AdvisorSummaryBar, a one-line collapsible page summary that replaces the stack of advisor cards above a list, counts the distinct rows implicated rather than the findings, and forces itself open only for critical or workspace-level advice no row flag can carry * feat: put advisor advice on the mailbox row it is about in the accounts list, replace the card stack above the table with the collapsible summary bar, and support ?mailbox=<id> so a finding can deep-link straight to the mailbox detail instead of the top of the list * feat: flag advisor findings on the campaign row in the campaigns list, including step-level copy problems which index onto their parent campaign since a step has no row of its own, and add the collapsible summary bar above the list * feat: move the deliverability and contacts pages onto the collapsible advisor summary bar so their findings stop pushing the numbers they describe below the fold * feat: add an ordered Steps field to advisor findings, persisted as text[] and always refreshed from the current build, and write real how-to steps for the deliverability checks that have no one-click fix (bounce rate, spam placement, tracking domain, and per-record SPF/DKIM/DMARC instructions) * feat: write ordered how-to steps for the manual advisor findings where the remedy alone leaves someone stuck (broken template syntax, missing first-name fallback, unsubscribed contacts still enrolled, a campaign with no resolvable sender, and a mailbox that lost warmup pool standing) and correct the personalization detail that named a merge syntax this product does not use * feat: show a mailbox's advisor findings at the top of its detail drawer, which is where both the row flag and the ?mailbox deep link now land * feat: open the resolution flow from findings that have no one-click fix too, since the ordered how-to lives there and a card with no Fix button previously left the steps unreachable * docs: document the per-row advisor flags, the collapsible page summary, the three-screen resolution flow, and the ordered manual steps for findings with no one-click fix * feat: align the advisor summary bar to the px-5 page gutter used by SectionBar and the list rows on all four surfaces, instead of sitting flush against the edge while the table it describes is indented * fix: stop the resolution drawer collapsing to zero height between screens by switching the step transition to popLayout with a layout-animated container, so the dialog resizes into the next screen instead of snapping shut and reopening * feat: wire the advisor repository, narrator, service, tool registration, and background runner into the backend boot path so findings evaluate on a schedule and the assistant can read them * docs: register the advisor guide in the sidebar, add its endpoint scope table to the API reference, and document the sandbox advisor showcase * fix: darken the advisor nav badge to solid orange-600 on white instead of a pale amber-100 chip that read as a disabled control beside the sidebar's saturated indicators, and drop the critical badge to rose-600 so the two stay in the same weight class * fix: use orange-500 for the advisor nav badge, matching the high-severity dot on the row it points at, rather than the darker orange-600 * feat: add an Auto safety class to advisor actions and mark the seven fixes autopilot may apply unattended (the cap cuts, the send-gap widen, the campaign limit matches, and the unsubscribe header), with a test pinning the boundary so nothing that halts sending or generates new outbound mail can drift into it * feat: add advisor autopilot, which applies the auto-safe fixes unattended as the member who switched it on, resolving their live permissions each run so it fails closed when they leave the org, bounded to 10 changes per evaluation and audited per fix like any hand-made change * feat: add the advisor agent fix, a bounded per-finding agent run that resolves the problems a settings change cannot (broken template syntax, bulk-reading copy, shared-inbox lists) as the calling member inside a tool allowlist scoped to the finding's category, metered per iteration and marked applied only when it actually called a write tool * feat: surface autopilot and the agent fix in the dashboard, adding the workspace toggle that names exactly which changes it may make, an Auto chip on the findings it is allowed to take, and an agent-fix path in the resolution drawer that reports the tools it actually called rather than only its own account of them * docs: document the agent fix and autopilot, naming the exact set of changes autopilot may make, that it acts as the member who enabled it and stops when they leave, and why the agent-fix endpoint is JWT only * fix: gate the agent fix per detector instead of per category, so a missing DMARC record no longer offers a Fix-with-agent button it can never satisfy and then reports failure; findings whose fix lives in DNS or a provider console now show their manual steps, and the client is told which is which via agent_fixable * feat: soften the advisor surfaces to translucent washes, replacing the filled nav badge with a tinted pill that carries its colour in the text, frosting the row panel and the resolution drawer, and turning the severity chips and cards into layers the page shows through * docs: correct the agent-fix scope to name the findings it cannot resolve, and why a DNS record shows steps instead of a button * feat: ship the actual DNS records for the findings that live outside the platform, with the provider's SPF include resolved, the DMARC record scoped to the sending domain and starting at p=none, the DKIM host plus the console that generates its value, and a tracking CNAME pointing at this install's own tracking host * feat: render advisor snippets as labelled copy-button rows so a DNS record is one click per field rather than a text-selection exercise, with no copy affordance on a value the server could not supply * docs: document the pasteable DNS records and the guarantee that every check offers a fix, an agent, or ordered steps * fix: bump golang.org/x/text to 0.39.0 to clear CVE-2026-56852, a HIGH-severity infinite loop in norm.Iter that Trivy started failing the security scan on
130 lines
4.9 KiB
Go
130 lines
4.9 KiB
Go
package advisor
|
|
|
|
// Thresholds. Every value here traces to the sending-safety and paid-pool
|
|
// policy in CLAUDE.md, or to the provider guidance that policy cites. They are
|
|
// deliberately stricter than the point where mailbox providers start
|
|
// penalising a sender: advice that arrives at the same moment Google throttles
|
|
// you is advice that arrived too late.
|
|
const (
|
|
// --- sample floors -----------------------------------------------------
|
|
// Below these, a rate is noise and the detector stays silent. A single
|
|
// bounce out of three sends is not a 33% bounce rate worth alarming about.
|
|
|
|
// minSendsForRate is the floor for bounce/complaint rates on a mailbox or
|
|
// campaign. CLAUDE.md's complaint floor is 100 delivered in 30 days; we use
|
|
// a lower bar for bounces because hard bounces are unambiguous and a bad
|
|
// list shows itself early.
|
|
minSendsForComplaintRate = 100
|
|
minSendsForBounceRate = 50
|
|
// minWarmupDeliveriesForPlacement mirrors the documented spam-placement
|
|
// floor: at least 20 warmup deliveries in the last 7 days.
|
|
minWarmupDeliveriesForPlacement = 20
|
|
// minSendsForEngagement is the floor for reply/open-rate advice. Copy
|
|
// feedback on 30 sends is superstition.
|
|
minSendsForEngagement = 200
|
|
// minStepSendsForDropoff is the per-step floor for follow-up advice.
|
|
minStepSendsForDropoff = 100
|
|
|
|
// --- deliverability bands ---------------------------------------------
|
|
// Google: keep user-reported spam below 0.10%, never reach 0.30%.
|
|
// SES: complaint 0.1% puts an account under review, 0.5% can pause it.
|
|
complaintRateWarn = 0.03
|
|
complaintRateCritical = 0.10
|
|
|
|
// SES: bounce below 5%; 5% is review, 10% can pause sending.
|
|
bounceRateWarn = 3.0
|
|
bounceRateCritical = 5.0
|
|
|
|
// Spam-folder placement, from the paid-pool policy bands.
|
|
spamPlacementWarn = 10.0
|
|
spamPlacementQuarantine = 20.0
|
|
spamPlacementBlock = 40.0
|
|
|
|
// --- mailbox volume ----------------------------------------------------
|
|
// The repo defaults: 50/day cold cap, 600s minimum gap.
|
|
defaultColdCap = 50
|
|
defaultMinGap = 600
|
|
safeColdCapBand = 50
|
|
// newMailboxDays is how long a mailbox counts as new. Postmark puts domain
|
|
// warmup at 3-6 weeks; 30 days is the conservative middle.
|
|
newMailboxDays = 30
|
|
// newMailboxSafeCap is the recommended ceiling for a mailbox in that
|
|
// window: the documented "start cold outreach around 10-20/day".
|
|
newMailboxSafeCap = 20
|
|
// minSafeGapSeconds is the floor below which sends read as bursty from one
|
|
// mailbox regardless of the daily total.
|
|
minSafeGapSeconds = 300
|
|
|
|
// --- warmup ------------------------------------------------------------
|
|
// Repo defaults: base 10/day, ceiling 40/day, +1/day ramp, 30% reply rate.
|
|
defaultWarmupBase = 10
|
|
defaultWarmupMax = 40
|
|
minWarmupBase = 5
|
|
minWarmupReplyRate = 20
|
|
// warmupCeilingFloorRatio is the share of a mailbox's cold cap that its
|
|
// warmup ceiling should at least match. A mailbox sending 50 cold/day on a
|
|
// 10/day warmup ceiling has almost no positive signal to offset the cold
|
|
// traffic.
|
|
warmupCeilingFloorRatio = 0.5
|
|
|
|
// --- campaign performance ---------------------------------------------
|
|
// Cold outreach reply rates below this, at volume, mean the offer or the
|
|
// list is wrong; more sending will not fix it and will cost reputation.
|
|
replyRateWeak = 1.0
|
|
replyRateVeryLow = 0.3
|
|
// stepDropoffFactor: a follow-up step whose reply rate is this many times
|
|
// worse than the campaign's best step is worth rewriting.
|
|
stepDropoffFactor = 4.0
|
|
|
|
// --- sequence shape ----------------------------------------------------
|
|
// A single-email cold campaign leaves most of its replies unclaimed.
|
|
minRecommendedSteps = 3
|
|
// Follow-ups closer together than this read as pestering.
|
|
minFollowUpDays = 2
|
|
// And further apart than this lose the thread entirely.
|
|
maxFollowUpDays = 14
|
|
|
|
// --- list hygiene ------------------------------------------------------
|
|
roleAddressShareWarn = 15.0
|
|
freeMailShareWarn = 40.0
|
|
suppressedShareWarn = 10.0
|
|
missingNameShareWarn = 10.0
|
|
// listExhaustionDays: a running campaign with fewer than this many days of
|
|
// leads left needs more list before it silently goes quiet.
|
|
listExhaustionDays = 7
|
|
|
|
// --- copy --------------------------------------------------------------
|
|
subjectTooLong = 60
|
|
bodyTooLongWords = 200
|
|
maxLinksInBody = 2
|
|
)
|
|
|
|
// spamTriggerPhrases are the phrases that most reliably move cold B2B mail into
|
|
// spam filters and, more importantly, read as bulk mail to a human. The list is
|
|
// deliberately short: a 200-word spam-word list produces noise findings on
|
|
// perfectly good copy, which trains people to ignore the Advisor.
|
|
var spamTriggerPhrases = []string{
|
|
"act now",
|
|
"buy now",
|
|
"click here",
|
|
"congratulations",
|
|
"credit card",
|
|
"dear friend",
|
|
"double your",
|
|
"earn extra cash",
|
|
"free trial",
|
|
"guarantee",
|
|
"limited time",
|
|
"make money",
|
|
"no obligation",
|
|
"no strings attached",
|
|
"once in a lifetime",
|
|
"risk free",
|
|
"special promotion",
|
|
"this is not spam",
|
|
"urgent",
|
|
"winner",
|
|
"100% free",
|
|
"$$$",
|
|
}
|