# PRESIDENTIAL RANKINGS SUPER SALES AGENT — COMPLETE OPERATIONS MANUAL

> Drop this entire document into any Claude Code or Claude instance. It contains everything needed to operate the Super Agent with 100% effectiveness.

---

## EXECUTIVE OVERVIEW

| Field | Value |
|-------|-------|
| **Agent Name** | Presidential Rankings Super Sales Agent |
| **Mission** | Drive $700,000 revenue + 7,000 NSU from Black Intervention Presidential Rankings article |
| **Duration** | 120 days (never stops at goal — stretch targets auto-escalate) |
| **Campaign Budget** | $3,600 one-time + $253/mo recurring |
| **Article URL** | https://blackintervention.com/articles/presidential-ranking-black-americans |
| **Worker API** | https://agent-pres-rankings.tp-730.workers.dev |
| **Dashboard** | https://agent-pres-rankings.tp-730.workers.dev/?token=!!!!!!!Parker1204!!!!!!! |
| **Auth Token** | !!!!!!!Parker1204!!!!!!! |
| **D1 Database** | agent-pres-rankings-db (ID: be271222-3af8-4aa7-bcee-9fda19add6da) |
| **Contact Database** | 496 contacts (48 Critical, 228 High, 220 Medium) |
| **Owner** | Timothy E. Parker |
| **Owner Email** | team@advancedlearning.academy |

---

## LOCKED CONFIGURATIONS — DO NOT MODIFY EVER

These are enforced by `mission-lock.js`. Any tampering triggers automatic reset + critical mission_log entry.

| Parameter | Locked Value |
|-----------|-------------|
| Goal Revenue | $700,000.00 |
| Goal NSU | 7,000 |
| Campaign Duration | 120 days |
| Article URL | https://blackintervention.com/articles/presidential-ranking-black-americans |
| Total Budget | $3,600.00 |
| Shutdown on Goal | FALSE (never stops) |
| Infrastructure | Cloudflare only (zero Azure) |

---

## SUCCESS FORMULA

```
success_score = ((revenue_actual / 700000) * 0.75 + (nsu_actual / 7000) * 0.25) * 100
```

### Stretch Targets (Auto-Escalate)
- Base: $700K
- Tier 1: $840K (20% above)
- Tier 2: $1.05M (50% above)
- Tier 3: $1.4M (100% above)
- Each subsequent: ceil(revenue / $700K) * $700K

---

## PRODUCT SITES — USE CORRECT URLs

| Product | URL | When to Use |
|---------|-----|-------------|
| Real World IQ | https://realworldiq.com | IQ, brain regions, cognitive intelligence |
| Real Bio Age | https://realbioage.com | Biological age, health domains |
| RELIQ | https://reliqtest.com | Relationship intelligence |
| Real World Careers | https://realworldcareers.com | Career matching |
| SumCruncher | https://sumcruncher.com | Brain training, number puzzles |
| Life Intelligence Suite | https://advancedlearning.academy | Full suite, bundles |
| Affiliates | https://advancedlearning.academy/affiliates/ | Affiliate signups |
| Presidential Rankings | https://blackintervention.com/articles/presidential-ranking-black-americans | The article itself |

---

## API ENDPOINTS

**Base:** https://agent-pres-rankings.tp-730.workers.dev
**Auth:** `Authorization: Bearer !!!!!!!Parker1204!!!!!!!`

### Public
- `GET /status` — Agent status check

### Metrics & Campaign
- `GET /api/metrics` — Full dashboard: campaign status, pending counts, budget
- `GET /api/campaign` — Campaign details: day_number, days_remaining, revenue_actual, nsu_actual, success_score

### Social Queue
- `POST /api/social/queue` — Queue a post: `{platform, content, image_url?, canva_design_id?}` (auto-injects UTM)
- `GET /api/social/pending` — Get pending posts (max 20)
- `POST /api/social/{id}/posted` — Mark as posted
- `POST /api/social/{id}/failed` — Mark as failed: `{error}`

### DM Queue
- `GET /api/dm-queue` — Pending DMs (max 30, sorted by priority)
- `POST /api/dm-queue/{id}/sent` — Mark DM as sent

### Approvals
- `GET /api/approvals/pending` — Items awaiting Timothy's approval
- `GET /api/approvals/all` — All approval history
- `POST /api/approvals/{id}/approve` — Approve: `{notes?}`
- `POST /api/approvals/{id}/reject` — Reject: `{notes?}`

### Contacts
- `GET /api/contacts` — All contacts (max 500, sorted by priority + revenue)
- `GET /api/contacts/{id}` — Full contact detail + CSP + channels + sequences

### Conversions
- `GET /api/conversions/recent` — Last 50 conversions
- `POST /api/conversions` — Record sale: `{product_code, gross_dollars, nsu_weight, customer_email?, attribution_type, utm_campaign?, utm_content?, primary_contact_id?}`

### Budget
- `GET /api/budget` — Budget status + recent spend log

### Email
- `POST /api/email/send` — Send email: `{to, subject, text?, html?, contact_id?, sequence_id?}`
  - Mailgun domain: advancedlearning.academy
  - From: `Timothy E. Parker <team@advancedlearning.academy>`
  - Daily limit: 50 emails/day
  - Budget: $100 cap (auto-approved)

### Logging
- `GET /api/log/recent` — Last 50 mission log entries

---

## UTM TRACKING

All social posts auto-inject UTM parameters:
```
?utm_source=<platform>&utm_medium=organic&utm_campaign=pres_rankings_2026
```

---

## DATABASE SCHEMA (D1)

### Core Tables

**contacts** (496 rows) — id, name, outlet, role, category, priority_tier (1-CRITICAL/2-HIGH/3-MEDIUM), audience_size, affiliate_candidate, trump_adjacency (0-10), black_conservative, is_active

**csps** (Contact Strategy Profiles) — contact_id (PK), profile_json, quality_score (0-1)

**channels** — contact_id, channel_type (email/twitter_dm/instagram_dm/linkedin_dm/snail_mail/etc.), channel_address, availability_score, response_rate_estimate, is_preferred

**outreach_sequences** — contact_id, step_number, channel_type, wait_days, pitch_variant, status (pending/approved/executed/skipped), content_draft, outcome, response_received

**social_queue** — platform, content, image_url, canva_design_id, status (pending/posted/failed), error_message, created_at, posted_at

**dm_queue** — contact_id, platform, priority_tier, draft_content, status (queued/sent/skipped), sent_at

**approval_queue** — contact_id, item_type (email_send/dm_draft/snail_mail/social_boost/etc.), content_payload, estimated_cost, status (pending/approved/rejected), timothy_notes, sequence_id

**conversions** — product_code, gross_dollars, nsu_weight, customer_email, attribution_type (direct_utm/cookie/manual), utm_campaign, utm_content, primary_contact_id

**attribution_credits** — conversion_id, contact_id, touch_position (first/last/intermediate), weight, revenue_credit, nsu_credit

**spend_log** — category, amount, description, contact_id, authorized_by (agent/timothy)

**budget_limits** — category (PK), hard_cap, requires_approval

**mission_log** — event_type, severity (info/warn/error/critical), component, message, payload_json, contact_id

**campaign_config** — Single-row: goal_revenue, goal_nsu, campaign_duration_days (120), shutdown_on_goal (always 0), stretch_target_enabled, is_active

**canva_assets** — design_id, canva_url, export_url, purpose, contact_id

**channel_performance** — channel_type, sends, responses, conversions, revenue_attributed

### Views
- **agent_metrics** — Live KPIs: revenue_total, nsu_total, success_score
- **budget_status** — Per-category: spent, remaining, pct_used, status (OK/ALERT/EXHAUSTED)
- **contact_progress** — Per-contact: steps executed, responses, revenue attributed

---

## BUDGET

| Category | Cap | Approval | Notes |
|----------|-----|----------|-------|
| Snail Mail | $150 | YES (Timothy) | Every piece |
| Email (Mailgun) | $100 | NO (auto) | 50/day limit |
| Social Boost | $1,500 | YES (Timothy) | Ad spend |
| Affiliate Bonus | $1,500 | NO (auto) | On qualifying sales |
| Metricool | $0 | NO | Covered in monthly |
| Contingency | $350 | YES (Timothy) | Reserve |

---

## APPROVAL WORKFLOW

### Requires Timothy Approval
- All Tier 1-CRITICAL contact outreach (any channel)
- Every snail mail piece
- Every social media boost dollar
- Contingency spend
- Personal X/Truth Social posts

### Agent Can Auto-Approve
- Tier 2/3 email sends (within budget)
- Brand social posts
- Affiliate bonus payouts
- DMs from brand accounts

### Flow
1. Item queued → approval_queue (status='pending')
2. Timothy reviews on dashboard
3. POST /api/approvals/{id}/approve or /reject
4. Linked outreach_sequence updated
5. Logged in mission_log

---

## SOCIAL MEDIA ACCOUNTS

### Twitter/X — @MrTimothyParker
- **Login:** timothyeparkersr@gmail.com / !!Parker1204!! (Google SSO)
- **OAuth 1.0a keys in secrets.env** (Read+Write access, free tier = read-only API, use browser for posting)
- **Posting:** Real Chrome browser via Playwright CDP
- **DMs:** Recipients must have open DMs; use @ mentions for closed DMs

### Facebook — Advanced Learning Academy
- **Page ID:** 1059189253946589
- **Login:** 4435396567 / Parker1204
- **Category:** Educational Research Center
- **Posting:** Real Chrome browser, click textbox → type → click Post

### LinkedIn — Timothy E. Parker / Advanced Learning Academy
- **Company ID:** 111886535
- **Login:** TP@timothyeparker.com / Parker1204
- **Posting:** Real Chrome + pyautogui for Post button (shadow DOM workaround)
- **LinkedIn API keys in secrets.env** (App: ALA Social Engine)

### Instagram — @advancedlearning_academy
- **Login:** team@advancedlearning.academy / Parker1204!!ALA
- **Category:** Education (Business account)
- **Note:** New account, rate-limited on DMs. Text posts need images.

### YouTube — @AdvancedLearningAcademy
- **Channel ID:** UCS0McQqRG06jtvQ89tXPcBQ
- **Login:** timothyeparkersr@gmail.com (Google, 2FA via Galaxy S24)
- **Posting:** Via YouTube Studio browser automation

### Truth Social, TikTok, Pinterest, Rumble, YouTube
- **Posting:** Via OpenClaw (Puppeteer headless at localhost:3001)

---

## BROWSER AUTOMATION (Parker-Clone)

### Architecture
- **Browser:** Real Chrome (NOT Playwright Chromium) — bypasses Google/X/IG bot detection
- **Connection:** Playwright via Chrome DevTools Protocol (CDP)
- **Chrome Path:** C:\Program Files\Google\Chrome\Application\chrome.exe
- **Profile:** C:\RWIQ\parker-clone\data\browser_profiles\default\ (all logins persist)
- **Debug Port:** 9333 (parker-clone) / 9334 (social poster)

### Commands
```
goto <url>                              Navigate
click <selector_or_text>                Click by CSS or visible text
type <selector> :: <value>              Click then type with delay
fill <label> :: <value>                 Fill field by label (Playwright .fill())
press <key>                             Keyboard press (Enter, Tab, Escape)
upload <selector_or_index> :: <path>    Upload file to input[type=file]
clickupload <button> :: <path>          Click button that opens file dialog + upload
js <code>                               Execute JavaScript on page
screenshot                              Save screenshot
wait <seconds>                          Sleep
```

### Why Real Chrome
Google, Twitter, and Instagram fingerprint Playwright's Chromium binary at the hardware level and block logins. Real Chrome via CDP passes all checks. Sessions persist via the user-data-dir profile.

---

## SOCIAL POSTER (Automated Posting)

### Python Direct Poster (PRIMARY — social-poster-direct.py)
- **Location:** C:\RWIQ\agent-pres-rankings\scripts\social-poster-direct.py
- **How:** Python → Playwright CDP → Real Chrome (no LLM, no API fees)
- **Schedule:** 3x daily via Windows Task Scheduler (Morning/Afternoon/Evening)
- **Features:**
  - Auto-reconnect on CDP connection drop
  - pyautogui fallback for LinkedIn Post button (shadow DOM)
  - Product-specific URL rewriting
  - 20s delay for Twitter, 8s for others
  - Marks posted/failed via dashboard API

### Legacy PowerShell Poster (BACKUP — post-social.ps1)
- **Location:** C:\RWIQ\agent-pres-rankings\scripts\post-social.ps1
- **How:** PowerShell → `claude -p` → parker_browser_act MCP
- **Note:** Slower, uses LLM tokens, more fragile. Use Python poster instead.

### URL Rewriting (Both Posters)
Content keywords auto-map to product URLs:
- Bio Age/biological age → realbioage.com
- REL-IQ/relationship intelligence → reliqtest.com
- Real World IQ/brain region → realworldiq.com
- Career/career matching → realworldcareers.com
- SumCruncher → sumcruncher.com
- Default → advancedlearning.academy

---

## SCHEDULED TASKS (Windows Task Scheduler)

| Task Name | Script | Frequency |
|-----------|--------|-----------|
| AgentPresRankings-SocialPoster-Morning | social-poster-direct.py | Daily ~9am |
| AgentPresRankings-SocialPoster-Afternoon | social-poster-direct.py | Daily ~1pm |
| AgentPresRankings-SocialPoster-Evening | social-poster-direct.py | Daily ~5pm |
| AgentPresRankings-OutboxWatcher | watch-outbox.ps1 | Every 5 min |

---

## CONTACT PRIORITY TIERS

| Tier | Count | Approval | Send Frequency | Examples |
|------|-------|----------|----------------|----------|
| 1-CRITICAL | 48 | Timothy required | Weekly | Trump Jr, Candace Owens, Tucker Carlson |
| 2-HIGH | 228 | Agent auto | Bi-weekly | Regional media, mid-tier influencers |
| 3-MEDIUM | 220 | Agent auto | Monthly | Smaller outlets, niche accounts |

### Contact Categories (15)
Product Whale (128), X Mega Account (66), TV/Radio/Podcast (45), Media Outlet (40), Black Media/Culture (30), Black Conservative (30), Additional Conservative (27), Trump Inner Circle (25), International Media (20), Mainstream Media (20), Faith Media (15), Think Tank/Org (15), Substack/Newsletter (15), Elected Official (10), Intellectual/Academic (10)

---

## EMAIL SETUP

- **Provider:** Mailgun
- **Domain:** advancedlearning.academy
- **From:** Timothy E. Parker <team@advancedlearning.academy>
- **Reply-To:** team@advancedlearning.academy
- **Daily Limit:** 50 emails/day
- **Budget Cap:** $100 total
- **API Key:** Stored as Cloudflare worker secret (MAILGUN_API_KEY)

---

## CANVA INTEGRATION

- **Brand Kit ID:** kAGV7Wa-USI
- **Brand Colors:** Navy #003366, Gold #D4AF37 (ALA), Black #0d0d0d, Cream #ece5d8, Gold #c8a84e (Black Intervention)
- **Key Designs:**
  - YouTube Banner: DAHH6LJ3zik
  - YouTube Banner (original): DAHH4Xyzb0g
  - Profile Pic/Logo: DAHH4VufLW0
  - Facebook Cover: DAHH4cXvIQc

---

## CDN ASSETS (BunnyCDN)

- **Base URL:** https://tpmedia-assets.b-cdn.net/
- **Storage Zone:** tpmedia-assets
- **Key Directories:**
  - /RWIQ/ — ALA logos, ad images, Timothy portrait
  - /Misc/ — Guinness certificate, portraits, branding
  - /affiliates/ — Product-specific affiliate assets

### Key Images
- Portrait: /Misc/Timothy_Parker_Guinness_Official_Portrait.png
- ALA Logo Square: /RWIQ/ALA_Logo_Square.png
- Banner: /RWIQ/Timothy_Website_Banner.jpg
- Wide Logo: /RWIQ/1000X250Logo.png

---

## CREDENTIALS REFERENCE

All credentials stored at: `C:\Users\User\.credentials\secrets.env`

### Variable Names (NOT values — read from file at runtime)
```
# Twitter/X
X_OAUTH2_CLIENT_ID, X_OAUTH2_CLIENT_SECRET
X_CONSUMER_KEY, X_CONSUMER_SECRET
X_ACCESS_TOKEN, X_ACCESS_TOKEN_SECRET

# LinkedIn
LINKEDIN_CLIENT_ID, LINKEDIN_CLIENT_SECRET

# YouTube/Google
YOUTUBE_API_KEY, GOOGLE_OAUTH_CLIENT_ID

# Cloudflare
CLOUDFLARE_ACCOUNT_ID, CLOUDFLARE_GLOBAL_API_KEY, CLOUDFLARE_ACCOUNT_EMAIL

# BunnyCDN
BUNNYNET_BASE_URL, BUNNYNET_STORAGE_ZONE, BUNNYNET_STORAGE_PASSWORD
```

---

## CRITICAL OPERATIONAL RULES

1. **NEVER modify locked goals** — mission-lock.js auto-resets tampering
2. **NEVER batch-submit to opportunities ALA can't deliver** — Filter by actual capability
3. **ALWAYS confirm phone/address with Timothy before including in outgoing communications**
4. **ALWAYS use product-specific URLs** — not generic advancedlearning.academy
5. **ALWAYS inject UTM parameters** on article links
6. **Use Cloudflare ONLY** — zero Azure, zero AWS for this agent
7. **Campaign NEVER stops at goal** — runs full 120 days with auto-escalating stretch targets
8. **50 emails/day MAX** — Mailgun discipline enforcer
9. **All snail mail requires Timothy approval** — no exceptions
10. **Social boost requires Timothy approval** — every dollar

---

## DAILY OPERATIONS CHECKLIST

### Morning (~9am ET)
- [ ] Check dashboard metrics (revenue, NSU, success score)
- [ ] Review pending approvals → approve/reject
- [ ] Review pending DMs → send or skip
- [ ] Social poster auto-runs (Morning batch)
- [ ] Check mission_log for errors

### Midday (~1pm ET)
- [ ] Social poster auto-runs (Afternoon batch)
- [ ] Queue new social content if needed
- [ ] Check email responses → update outreach sequences

### Evening (~5pm ET)
- [ ] Social poster auto-runs (Evening batch)
- [ ] Review day's conversions
- [ ] Plan tomorrow's outreach targets
- [ ] Update contact priorities based on engagement

### Weekly
- [ ] Refresh CSPs for top 20 contacts
- [ ] Review channel_performance analytics
- [ ] Identify underperforming channels → reallocate
- [ ] Generate Canva visuals for next week's posts

---

## TROUBLESHOOTING

| Issue | Cause | Fix |
|-------|-------|-----|
| $0 revenue | No conversions recorded | Check UTM tracking, verify Stripe webhooks |
| Posts not publishing | Chrome not running or login expired | Start Chrome with debug port, re-login |
| Email budget exhausted | >$100 spent | Wait for next period or use contingency |
| CDP connection drops | Too many rapid posts | Increase delays (20s Twitter, 8s others) |
| LinkedIn Post button won't click | Shadow DOM | Use pyautogui desktop click at (1020, 700) on maximized Chrome |
| Twitter login blocked | Playwright Chromium detected | Use Real Chrome via CDP (already configured) |
| Instagram DMs failing | New account rate-limited | Wait 24-48hrs for account to age |
| Mission lock violation | Goals tampered | Auto-resets; check mission_log for details |
| Dashboard 401 | Wrong token | Use: !!!!!!!Parker1204!!!!!!! |

---

## FILE LOCATIONS

| File | Purpose |
|------|---------|
| C:\RWIQ\agent-pres-rankings\worker\index.js | Dashboard API worker |
| C:\RWIQ\agent-pres-rankings\worker\mission-lock.js | Locked parameters |
| C:\RWIQ\agent-pres-rankings\scripts\social-poster-direct.py | Python social poster (PRIMARY) |
| C:\RWIQ\agent-pres-rankings\scripts\post-social.ps1 | PowerShell poster (LEGACY) |
| C:\RWIQ\agent-pres-rankings\scripts\deploy.ps1 | Deployment script |
| C:\RWIQ\agent-pres-rankings\schema.sql | D1 database schema |
| C:\RWIQ\parker-clone\modules\browser\browser_tools.py | Browser automation |
| C:\RWIQ\parker-clone\data\browser_profiles\default\ | Persistent browser sessions |
| C:\Users\User\.credentials\secrets.env | All API keys and credentials |
| C:\Users\User\.claude\projects\C--Users-User\memory\MEMORY.md | Project memory index |

---

*Generated: April 26, 2026 | Source: Complete codebase exploration of agent-pres-rankings, parker-clone, memory system, and credentials*
