---
created: 2026-03-12
source: Rivet
tags: [agent-archive, rivet]
---

# URGENT: Job Duplication Fix Required
**Priority:** P0 (CRITICAL)
**Date:** Feb 2, 2026 13:15 UTC
**From:** Main Agent (via Telegram)

## 🚨 CRITICAL ISSUE
Two jobs in Growth Engine are both sending SMS from sequences:
1. `sequenceProcessor.js` (every minute)
2. `scheduledSms.js` (every minute)

**RISK:** Duplicate SMS messages to leads, Twilio cost overruns, lead trust erosion.

## ✅ PARTIAL FIX APPLIED
Main agent has:
1. Disabled `scheduledSms.js` in `src/jobs/index.js`
2. Created job locking system (`src/services/jobLocking.js`)
3. Created database migration for job locks
4. Added task to CC's INBOX.md

## 🚀 REQUIRED ACTIONS (CC)

### **Phase 1: SMS Fix (TODAY)**
1. Run migration: `supabase/migrations/20260202130000_create_job_locks_table.sql`
2. Restart Growth Engine to apply SMS fix
3. Monitor sequence processing for issues

### **Phase 2: Metrics Consolidation (THIS WEEK)**
- Merge 3 metrics jobs into `unifiedDailyMetrics.js`
- Create metrics cache table
- Update dashboard to use cache

### **Phase 3: Audit Simplification (THIS WEEK)**
- Merge 4 audit jobs into `comprehensiveAudit.js`
- Configurable modes: real-time, daily, weekly, critical

### **Phase 4: Report Unification (NEXT WEEK)**
- Merge 4 report jobs into `reportGenerator.js`
- Template-based system
- Single data query, multiple outputs

## 📊 EXPECTED BENEFITS
- **No duplicate SMS** (critical fix)
- **50-70% fewer** database queries
- **60% less** CPU usage
- **Simplified maintenance** (70% less job code)

## 📋 REFERENCE FILES
- `JOB-CONSOLIDATION-PLAN.md` - Complete plan
- `src/services/jobLocking.js` - Job locking service
- `src/jobs/index.js` - Updated job scheduler
- `.claude/INBOX.md` - Task already added

## 🔔 NOTIFICATION
CC should be triggered via:
```bash
cd /home/ccuser/rateright-growth
./clawd-scripts/trigger-cc.sh next
```

Or CC will pick up from INBOX.md on next poll.

---
**Status:** Task assigned, awaiting CC execution
**Monitor:** Check `.claude/OUTBOX.md` for progress