RIPLEY — How The Operation Works (outline for Connor)

This is a how-it-works outline so you can build/integrate your own version. You run your own infrastructure and your own API keys (Meta app, RedTrack, OpenAI, etc.) — nothing here needs Ryan's credentials. It just describes the architecture and the gotchas worth copying.

1. What the op is

Media-buying bizopp on Facebook. The structure: a stack of ad accounts (workhorse "MAIN" accounts + "DFU" done-for-you stacks + a separate Business-Manager stack) running across a large pool of fan pages (2 pages per ad — one male, one female persona). Traffic → RedTrack (cloaking + attribution) → JVZoo affiliate offers (bizopp pays ~$90/conversion). Two offers run side by side: the real bizopp VSL and a safe Amazon fallback used for non-English language cloaking.

Goal: a self-running machine ("MOTHER") that generates creative, builds/tests ads, auto-kills losers, and scales winners — so the operator focuses on offers/backend/capital.

2. Data sources (the part that matters for a dashboard)

⚠️ RedTrack attribution gotchas (cost us real debugging — bake these into any dash query)

3. The autonomous system (MOTHER) — cron modules in peak-system/scripts/

Script Cadence Job
spend_pacer.py every 20m sets spend_cap = max(lifetime,today)+$500 buffer; dayparting + bid-backoff; $10k/day circuit-breaker
kill_monitor.py every 30m RT-truth pause rules (no-IC/no-sale/high-CPA) + reviver + dead-winner alert
health_monitor.py every 30m scans for DISAPPROVED/WITH_ISSUES ads, swaps creative to a safe puppy image
comment_moderation.py every 30m Claude classifies post comments, auto-hides negatives (feedback-score/CPM lever), drafts replies
product_research.py (NBRT) every 3h reads TG steering, mines Reddit, ranks true winners (RT sub6/ROAS), Claude generates 5 fresh brief ideas
morning_digest.py 8am Thailand per-CBO spend/sales/CPA/ROAS + killed-ads recap
update_status.py / ops_report.py / spend_snapshot.py 2–10m refresh live state files the dash reads

All run detached/cron, never agent-babysat. Telegram bot (@terrenceisabot) = mobile control + alerts.

4. Dashboard architecture (the pattern to copy)

Two Flask/gunicorn web apps reading the same JSON state + live API pulls: - Main dash — gunicorn-served, simple auth. Blueprint-per-tab structure (smm.py, auth.py). Has an SMM tab: fan pages + post-IDs + comment viewer/approve. - Picker / creative dash — separate service. Routes like /dash (creatives), /dash/smm (pages+ads+winners), /dash/comments (live comment viewer via page tokens), /briefs/... (gallery pages). - ⚠️ Display convention to copy: any Meta "Checkouts" column over-reports; the RedTrack Conv / RT Rev columns are the truth. Label them so nobody trusts the Meta number.

5. Key data files (JSON the dash/crons read)

6. State-doc pattern (how the system stays coherent across sessions)

The op keeps a few flat markdown/JSON state files as the single source of truth, so any operator or script can pick up context instantly: - a live status file auto-refreshed every ~10m (what's running now), - a stable handoff brief (architecture + account map — credentials kept out of band), - a one-page playbook diagram. The principle: the chat/agent is disposable, the state files ARE the system.

7. Hard rules (the guardrails worth copying)