- meta_ads_client: filter currently-paused ads from analysis (they have
historic spend in the window but shouldn't get PAUSE recommendations)
- run.py: fetch both 3d and 7d ad metrics; merge cpl_3d/cpl_7d into each ad
- agent.py AD_SYSTEM: base PAUSE on 7d window (more stable for low-volume ads);
treat high cpl_3d with acceptable cpl_7d as statistical noise
- slack_notifier: campaign header shows yesterday's spend/leads explicitly;
ad table shows CPL(3d) and CPL(7d) side by side; labels include time period
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Track v_margins dict per day in daily_totals (one entry per vertical)
- Monthly table now shows one margin column per vertical instead of aggregate Margen
- Verticals ordered by monthly margin (best first)
- Remove separate vertical breakdown section (now redundant)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Refactor send_daily_report: summary in one message, each campaign in its own
message — eliminates the 50-block Slack limit that was silently dropping campaigns
- _post now raises RuntimeError on Slack API errors (was silently returning None)
- send_slack_report.py accepts optional date argument (defaults to yesterday)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Migrate from Airtable to Baserow: BaserowClient with snapshots, actions, creatives, logs
- Claude agents (Haiku for decisions/units, Sonnet for creatives) with cost_cap_eur vs CPL comparison
- Slack bot with colored action emojis, effect text before approval buttons, 500-char justifications
- Streamlit dashboard with date-range navigation, campaign drill-down (adsets/ads), Histórico tab
- Approval server (FastAPI + ngrok) for Slack button callbacks
- backfill.py for historical snapshot regeneration with Claude re-analysis
- Margin fix: 0-lead campaigns contribute -spend (not 0) to margin
- CTR fix: Meta returns CTR as percentage already, removed *100
- Parameter fix: pass decision parameter to Slack action for correct budget effect display
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>