# RateRight Infrastructure & Team Report

> Generated: 2026-03-12 | Source: Full codebase analysis (deep pass)

---

## 1. All Websites & Domains

| Domain | What It Is | Stack | Hosting | Status |
|--------|-----------|-------|---------|--------|
| **rateright.com.au** | The $50 App — construction hiring marketplace | Next.js 14 + Supabase + Stripe | VPS nginx → port 3000 (systemd: `rateright-app`) | **LIVE** |
| **cc.rateright.com.au** | Control Centre — fleet mission control dashboard | React 19 + Vite 7 + TailwindCSS 4 + Supabase realtime | VPS nginx → port 3100 | **READY (needs nginx config on VPS)** |
| **admin.rateright.com.au** | Admin dashboard — sales CRM, leads, calls, SMS, scripts | React + Vite 7 + TailwindCSS + Supabase + Twilio Voice SDK | VPS nginx → static build or dev server | **LIVE** |
| **rivet.rateright.com.au** | Legacy app URL (V2 backup, /join worker landing) | Same as rateright.com.au | VPS nginx → port 3334 (Clawdbot webhook) | **LIVE (being phased out)** |
| **app.rateright.com.au** | Legacy v1 site | Unknown (old) | Unknown | **Should redirect** |
| **rateright-growth-production.up.railway.app** | Growth Engine API — backend for everything | Node.js / Express.js | Railway (auto-deploy on main push) | **LIVE** |
| **docs.rateright.com.au** | Documentation site | Docusaurus | Vercel | **LIVE** |
| **rateright.com.au** (Flask) | Main marketing/company site | Flask | Fly.io ($189/mo) | **LEGACY (may consolidate)** |

### DNS & SSL
- **DNS Provider:** GoDaddy (ns57/ns58.domaincontrol.com)
- **SSL:** Let's Encrypt (auto-renewing via certbot on VPS)
- **A Records:** `rivet` → 134.199.153.159, `cc` → 134.199.153.159
- **Nginx sites:** `/etc/nginx/sites-available/rivet.rateright.com.au`, `/etc/nginx/sites-available/cc.rateright.com.au`

---

## 2. All Deployed Services

### 2.1 Growth Engine API

The central nervous system — a 46-route Express.js API handling leads, SMS, voice, fleet operations, council dispatch, analytics, gamification, and more.

- **URL:** https://rateright-growth-production.up.railway.app
- **Stack:** Node.js / Express.js
- **Port:** 3000
- **Entry:** `src/index.js`
- **Deploy:** Railway auto-deploy on `main` branch push
- **Health:** `GET /health/ping`
- **Database:** Supabase project `memscjotxrzqnhrvnnkc`

**Middleware Stack:**
1. Compression (gzip)
2. Helmet (security headers)
3. CORS (whitelisted origins)
4. Raw body capture (webhook signature validation)
5. JSON/URL parsers
6. Request logger (Pino)
7. Rate limiters (global, AI, SMS, webhook, dashboard, write, tracking)
8. Auth (Supabase JWT + API key fallback via `requireApiKeyOrAuth()`)

**WebSocket Endpoints:**
- `/api/transcribe/ws` — Deepgram proxy (live call transcription)
- `/api/twilio-media` — Twilio media streams (call audio)

**Full Route Map (46 route files):**

| Category | Routes | Purpose |
|----------|--------|---------|
| **Leads** | leads, import, export, enrichment, tags, dossier | Lead CRUD, bulk import, Apollo enrichment, tagging |
| **Communication** | sms, calls, voice, voicemail, vapi, notifications, outboundWebhooks | SMS campaigns, voice calls, Deepgram proxy, VAPI webhooks |
| **Sales Tools** | callList, callAnalytics, callScoring, scripts, prompts, sequences, objections, coaching | Call prioritization, AI scoring, playbooks, automation |
| **Analytics** | dashboard, analytics, intelligence, dealIntelligence, activation, frontendTracking | Metrics, BI, market intel, funnel tracking, WebVitals |
| **Fleet** | fleet, council, notion, jobs | Agent control (systemd ops), multi-agent dispatch, Notion sync |
| **Gamification** | battleground, battlegroundV2, achievements, xp | Leaderboards, challenges, duels, badges, XP |
| **Users** | users, team, manager | User management, team performance, manager tools |
| **System** | health, webhooks (Twilio), bugReport, dev, sync | Health checks, inbound webhooks, bug reports, platform sync |

### 2.2 RateRight Marketplace ("The $50 App")

- **URL:** https://rateright.com.au
- **Stack:** Next.js 14 + Supabase + Stripe
- **Database:** Supabase project `eciepjpcyfurbkfzekok` (separate from Growth Engine)
- **Repo:** `/home/ccuser/the-50-dollar-app` (VPS, separate git repo)
- **Port:** 3000 on VPS (systemd: `rateright-app`)
- **Nginx:** Reverse proxy at `rateright.com.au`
- **Payment:** Flat $50 per successful hire via Stripe
- **Key pages:** `/join` (worker acquisition landing), `/dashboard` (contractor/worker portal)

### 2.3 RateRight Main Site (Legacy)

- **URL:** rateright.com.au (shared domain, Flask handles some routes)
- **Stack:** Flask (Python)
- **Hosting:** Fly.io ($189/month)
- **Repo:** `/home/ccuser/rateright-main-site` (VPS, separate git repo)
- **Status:** Legacy — ongoing cost, may be consolidated or deprecated

### 2.4 Control Centre Dashboard (cc.rateright.com.au)

Config-driven mission control for the 8-agent fleet.

- **Path:** `/control-centre/` in this repo
- **Stack:** React 19 + Vite 7 + TailwindCSS 4 + Supabase realtime
- **Port:** 3100 (dev)
- **Config:** `fleet.config.js` (config-driven — no code changes needed for new deployments)
- **Auth:** Supabase auth
- **Pages:** Command Centre, Fleet management, Tasks (Kanban with drag-and-drop), Council (multi-agent chat), Projects, Calendar, Memories, Documents, Water Cooler
- **Database tables:** `cc_tasks`, `cc_council_messages`, `cc_council_topics`, `cc_council_rounds`, `cc_activity_log`, `cc_approvals`, `cc_agent_snapshots`, `cc_projects`
- **Key deps:** `@hello-pangea/dnd` (Kanban), `@tanstack/react-query`, `framer-motion`, `lucide-react`
- **Deployment status:** Built, needs nginx reverse proxy config on VPS to go live at cc.rateright.com.au

### 2.5 Admin Dashboard (admin.rateright.com.au)

Sales rep CRM — leads, calls, SMS, scripts, insights.

- **Path:** `/admin/` in this repo
- **Stack:** React 19 + Vite 7 + TailwindCSS 4 + Supabase
- **Build:** Static files → `/admin/dist/` via `npm run build`
- **Key deps:** `@twilio/voice-sdk` (in-browser calling), `@tanstack/react-query`, `fuse.js` (fuzzy search), `html2canvas`, `framer-motion`, `web-vitals`
- **Auth:** Supabase auth + API key middleware

### 2.6 Voice AI — System 1: VAPI (Phone Receptionist)

AI phone receptionist for inbound lead qualification.

- **Service:** VAPI platform (hosted)
- **Model:** OpenAI GPT Realtime API (`gpt-realtime-2025-08-28`)
- **Voice:** OpenAI `alloy` (natural male voice)
- **Config:** `/phone-ai/vapi-config.json`
- **Scripts:** `setup-vapi.js` (create/update assistant), `test-vapi.js` (testing)
- **Webhook:** `https://rateright-growth-production.up.railway.app/api/vapi/webhook`
- **Route:** `/src/routes/vapi.js`
- **Flow:** Inbound call → VAPI handles conversation → `end-of-call-report` webhook → AI parses transcript → saves to `vapi_tasks` table → `taskExecutor.js` runs async tasks
- **First message:** "Hi there! Thanks for calling RateRight..."
- **Temperature:** 0.7 (natural conversation)
- **Max tokens:** 250 (concise responses)

### 2.7 Voice AI — System 2: Pipecat + Twilio (Rivet Personal Assistant)

Real-time voice AI for Michael's morning/evening briefing calls with Rivet.

- **Service:** `rivet-voice.service` (systemd on VPS)
- **Framework:** Pipecat (real-time voice AI pipeline, Python)
- **STT:** Deepgram (Australian English, nova-2 model)
- **LLM:** Claude Opus 4.5 (Anthropic)
- **TTS:** ElevenLabs ("Charlie" voice, ID: `IKne3meq5aSn9XLyUdCD`)
- **Twilio:** Media Streams WebSocket connection
- **Phone:** +61238205443
- **WebSocket port:** 8765 on VPS
- **Main script:** `/voice-assistant/voice_assistant.py`
- **Outbound:** `/voice-assistant/make_call.py`
- **Logs:** `/voice-assistant/logs/YYYY-MM-DD.log` (7-day retention)
- **Call types:**
  - Morning (6:30 AM): Site brief + daily priorities + hard questions
  - Evening (5:30 PM): Business debrief + accountability
  - Sunday: Weekly review
- **System prompt persona:** "You are Rivet, the COO system for RateRight..."
- **Context:** Reads `todays-hard-questions.md` before each call

### 2.8 CC VPS (Claude Code VPS Instance)

Always-on Claude Code instance launched by Rivet for coding tasks.

- **Location:** 134.199.153.159 (DigitalOcean Sydney, 4 vCPU, 8GB RAM)
- **Launch method:** `claude -p` with direct task prompt from Rivet
- **Notification on completion:** `clawdbot gateway wake --text "Done: [summary]" --mode now`
- **Responsibilities:** Code & maintain Rivet system, RateRight v2, Growth Engine API, fix VPS issues
- **Comms with Rivet:**
  - CC VPS → Rivet: Write to `/rivet/CC-VPS-INBOX.md`
  - Rivet → CC VPS: Write to `/rivet/RIVET-TO-CCVPS.md`
- **No polling** — direct process control (Rivet launches, CC VPS executes, notifies completion)

### 2.9 8-Agent Autonomous Fleet (VPS)

All running as systemd services orchestrated by OpenClaw gateway (successor to Clawdbot).

| Agent | Role | Port | Model | Provider | Fallback | Service |
|-------|------|------|-------|----------|----------|---------|
| **Rivet** | Chief of Staff / Orchestrator | 18789 | DeepSeek-chat (temp — target: GPT-5.4 OpenAI) | DeepSeek | MiniMax M2.5 | `clawdbot-gateway` |
| **Builder** | Code Engineer | 18790 | Claude Opus 4.6 | LocalCC → Max plan | Codex 5.3 (OpenRouter) | `clawdbot-builder` |
| **Susan** | Sales & Marketing | 18792 | Kimi K2.5 | Moonshot | DeepSeek | `clawdbot-susan` |
| **Harper** | Finance & Legal | 18796 | GPT-5.2 | OpenRouter | DeepSeek | `clawdbot-harper` |
| **Sentinel** | DevSecOps | 18800 | DeepSeek-chat | DeepSeek | MiniMax | `clawdbot-sentinel` |
| **Radar** | Research & Intelligence | 18804 | Grok-3 | OpenRouter / xAI | DeepSeek | `clawdbot-radar` |
| **Herald** | Communications | 18808 | Gemini 3.1 Pro | Google (direct) | Moonshot | `clawdbot-herald` |
| **Cog** | Operations | 18812 | MiniMax M2.5 | MiniMax | DeepSeek | `clawdbot-cog` |

**Design principle:** No two agents share the same primary + fallback provider. Fallbacks diversified across providers.

**Gateway config:** `/root/.openclaw/clawdbot.json` (openclaw.json symlinked to it)
**Agent configs:** `/root/.openclaw-{agent}/clawdbot.json`
**Auth:** `/root/.openclaw/agents/main/agent/auth-profiles.json`
**Sessions:** `/root/.openclaw/agents/main/sessions/sessions.json`

**Management:**
```bash
systemctl status clawdbot-{agent}
systemctl restart clawdbot-{agent}
journalctl -u clawdbot-{agent} -f
```

### 2.10 LocalCC Bridge

Exposes local Claude Code (Max plan) as an HTTP API so Builder can call it remotely.

- **Script:** `scripts/localcc-bridge.js`
- **Port:** 18950 (`LOCALCC_PORT`)
- **Token:** `LOCALCC_TOKEN` (required)
- **Endpoints:** `GET /status`, `POST /run`, `GET /logs`
- **Logs:** `./logs/localcc/localcc-YYYY-MM-DD.log`
- **Start:** `LOCALCC_TOKEN=xxx npm run localcc:serve`
- **Expose:** `cloudflared tunnel --url http://localhost:18950`
- **Note:** Unsets `CLAUDECODE` env var for child process (already handled in code)

### 2.11 Council Router (Multi-Agent Fan-Out)

3-phase dispatch engine for multi-agent problem-solving.

- **Backend:** `src/services/councilRouter.js` (fan-out engine), `src/services/agentBridge.js` (programmatic agent control), `src/routes/council.js`
- **Database:** `cc_council_rounds`, `cc_council_dispatches`, `cc_council_messages`
- **Phases:** Fan-out → Discussion → Consolidation
- **Features:** Idempotent dispatch, retry logic, timeout watchers, structured response collection
- **Frontend:** Council.jsx in Control Centre (fan-out toggle, RoundStatusBar, StructuredDataCard)

---

## 3. Scheduled Jobs & Cron

### Growth Engine Jobs (Node-cron, runs on Railway)

| Job | Schedule | Purpose |
|-----|----------|---------|
| `processSequences` | Every 60 sec | SMS/email sequence automation |
| `processScheduledMessages` | Every 60 sec | Scheduled message delivery |
| `runCriticalAudit` | Every 15 min | DB/API health check |
| `platformSync` | Every 15 min | RateRight app data sync |
| `runHourlyAudit` | Every 60 min | External services audit (Twilio, OpenAI, Deepgram) |
| `recalculateAllScores` | Every 60 min | Lead score recalculation |
| `releaseStaleAssignments` | Every 60 min | Unlock stale lead assignments |
| `saveLeaderboardSnapshot` | Every 60 min | Leaderboard snapshots |
| `refreshCallListScores` | Every 4 hours | Call list priority re-ranking |
| `activationMetrics` | Every 6 hours | Customer funnel metrics |
| `runDailyMetricsAggregation` | Daily 1am AEST | Metrics rollup |
| `dailyQualityAudit` | Daily 6am AEST | QA on customer interactions |
| `dailySummary` | Daily | Fleet summary reports |
| `awardWeeklyBadges` | Friday 3pm AEST | Gamification badges |
| `weeklyReport` | Monday 7am AEST | Weekly report (DISABLED — moved to VPS) |
| `weeklyExcellenceReport` | Monday 7:15am AEST | Excellence metrics (DISABLED) |
| `runMonthlyDeepDive` | 1st of month 8am AEST | Deep analysis (DISABLED) |
| `promptEvolution` | 15th of month 9am AEST | AI prompt optimization (DISABLED — was causing spam) |
| `impactMeasurement` | Daily | Campaign impact tracking |
| `runFrictionDetection` | Periodic | UX pain point detection |

### Fleet Monitoring (VPS Cron)

| Script | Interval | Purpose |
|--------|----------|---------|
| `stall-detector.js` | 5 min | Agent liveness detection |
| `health-check.js` | 5 min | HTTP health pings |
| `buddy-check.js` | 30 min | Cross-agent health verification |
| `context-monitor.js` | 10 min | Context window usage tracking |
| `crash-loop-guard.js` | 2 min | Crash loop prevention |

---

## 4. Team Members

### Human (Layer 0)

| Name | Role | Contact | Authority |
|------|------|---------|-----------|
| **Michael (Rocky)** | Founder | mcloughinmichael.r@gmail.com | Final decision-maker on all external, financial, and strategic matters |

### AI Agent Fleet (Layer 1–3)

| Agent | Layer | Role | Primary Focus | Status (Mar 12) |
|-------|-------|------|---------------|-----------------|
| **Rivet** | 1 | Chief of Staff | Fleet coordination, strategy, Telegram interface | Active (7/8 fleet) |
| **Builder** | 2 | Code Engineer | Implementation, bug fixes, technical execution | Idle (awaiting tasks) |
| **Susan** | 2 | Sales Pipeline | Lead outreach, contractor verification, CRM | Idle (quiet hours) |
| **Harper** | 2 | Finance & Legal | Regulatory compliance, grants (MVP Ventures), financial analysis | Active (API limits) |
| **Sentinel** | 2 | DevSecOps | Infrastructure monitoring, security (36+ attacks blocked) | Active |
| **Radar** | 2 | Research & Intel | Market research, competitive analysis, legal monitoring | Active |
| **Herald** | 2 | Communications | Content creation, messaging, internal comms | Active (API limits) |
| **Cog** | 2 | Operations | Task execution, data processing, ops support | Active |
| **CC VPS** | 3 | Claude Code Instance | Code changes, deployment, VPS maintenance | On-demand (launched by Rivet) |

**Communication Hub:** Telegram group (`-1003505625266`) with 11 topic channels

---

## 5. All Integrations

### Payment & Billing
| Service | Purpose | Monthly Cost |
|---------|---------|-------------|
| **Stripe** | $50/hire payment processing | Transaction fees |
| **Xero** | Accounting | $10 |

### SMS & Voice Communications
| Service | Purpose | Details | Monthly Cost |
|---------|---------|---------|-------------|
| **Twilio** | SMS campaigns + voice API | Phone: +61468087171, Media Streams for call transcription | $76 |
| **VAPI** | AI phone receptionist (inbound) | GPT Realtime API, hosted platform | Usage-based |
| **Deepgram** | Real-time speech transcription | Australian English, nova-2 model | Usage-based |
| **ElevenLabs** | Text-to-speech | "Charlie" voice for Rivet persona | $22 |

### Databases
| Service | Project ID | Purpose |
|---------|-----------|---------|
| **Supabase (Growth Engine)** | `memscjotxrzqnhrvnnkc` | Primary DB — PostgreSQL + RLS + realtime subscriptions |
| **Supabase (RateRight App)** | `eciepjpcyfurbkfzekok` | Marketplace database (separate project) |
| **Redis** (optional) | — | Caching layer (configured via `redis`, `ioredis`, `cache-manager-redis-store`) |
| **Amazon S3** | — | Database backups | Usage-based |

### AI & LLM Providers (7 providers)
| Provider | Models | Used By | Purpose |
|----------|--------|---------|---------|
| **OpenAI** | GPT-5.4, GPT-4o, GPT Realtime | Rivet, Growth Engine AI, VAPI voice | Fleet orchestration, AI features, voice |
| **Anthropic** | Claude Opus 4.6, 4.5 | Builder, Pipecat voice | Code engineering, voice assistant LLM |
| **Google** | Gemini 3.1 Pro | Herald | Communications agent |
| **Moonshot** | Kimi K2.5 | Susan | Sales agent |
| **DeepSeek** | deepseek-chat | Sentinel + fallback for 5 agents | DevSecOps + resilience |
| **OpenRouter** | GPT-5.2, Grok-3, Codex 5.3 | Harper, Radar, Builder fallback | Finance, research, code fallback |
| **MiniMax** | M2.5 | Cog + fallback for Sentinel | Operations |
| **Perplexity** | Research API | Growth Engine | Company/person web research |

### Data & Intelligence
| Service | Purpose | Monthly Cost |
|---------|---------|-------------|
| **Apollo.io** | Lead enrichment (contact data, company info) | $85 |
| **Notion** | Knowledge base, dashboard sync, planning | Free tier |
| **PostHog** | Product analytics (configured, not fully active) | Free tier |

### Notifications & Control
| Service | Purpose | Details |
|---------|---------|---------|
| **Slack** | Team notifications | Webhook: `hooks.slack.com/services/T09EQSQRZTJ/...` |
| **Telegram** | Primary fleet control interface | Group: `-1003505625266` (11 topic channels) |
| **Web Push** | Browser push notifications | Via `web-push` npm package |

### Infrastructure & Hosting
| Service | Purpose | Monthly Cost |
|---------|---------|-------------|
| **Railway** | Growth Engine API hosting | Usage-based |
| **DigitalOcean** | VPS — agent fleet, voice, nginx | ~$48 |
| **Fly.io** | Main Flask site (legacy) | $189 |
| **Cloudflared** | Tunnel for LocalCC bridge exposure | Free |
| **GoDaddy** | DNS management | Annual |
| **Let's Encrypt** | SSL certificates (certbot auto-renew) | Free |

### Source Control (GitHub)
| Repo | Path (VPS) | Purpose |
|------|------------|---------|
| `rateright-growth-deploy` | `/home/ccuser/rateright-growth` | Growth Engine + Rivet fleet + Control Centre + Admin |
| `the-50-dollar-app` | `/home/ccuser/the-50-dollar-app` | RateRight v2 marketplace |
| `rateright-main-site` | `/home/ccuser/rateright-main-site` | Flask main site |

---

## 6. Database Schema

### Growth Engine (Supabase: `memscjotxrzqnhrvnnkc`)

**Core Business:**
| Table | Purpose |
|-------|---------|
| `leads` | Lead records with scoring, status, phone, metadata |
| `calls` | Voice call history and AI scoring |
| `messages` | SMS conversation log |
| `callbacks` | Callback scheduling |
| `lead_notes` | Notes on leads |
| `sequences` | Email/SMS automation sequences |

**Intelligence & Enrichment:**
| Table | Purpose |
|-------|---------|
| `lead_intel` | Cached Perplexity person research |
| `company_intel` | Cached Perplexity company research |
| `enrichment_cache` | Apollo.io cached enrichment data |
| `enrichment_config` | Apollo API key + usage tracking |
| `enrichment_usage` | Monthly enrichment credit tracking |

**Fleet & Operations (cc_ prefix):**
| Table | Purpose |
|-------|---------|
| `cc_activity_log` | Real-time fleet activity tracking |
| `cc_tasks` | Task management for fleet |
| `cc_agent_snapshots` | Fleet status snapshots |
| `cc_approvals` | Approval workflows |
| `cc_projects` | Project management |
| `cc_council_topics` | Discussion topics |
| `cc_council_messages` | Council conversation log (with round_id, message_type, reply_to, structured_data, dispatch_status) |
| `cc_council_rounds` | Multi-agent discussion rounds |
| `cc_council_dispatches` | Individual agent task dispatch tracking |
| `vapi_tasks` | Parsed voice tasks from VAPI calls |

**Notifications:**
| Table | Purpose |
|-------|---------|
| `push_subscriptions` | Web push notification endpoints |
| `notification_preferences` | User alert settings |

---

## 7. Security Architecture

### Secrets Management
- **Primary vault:** Doppler (never committed to git)
- **Local:** `.env` files (gitignored)
- **VPS gateway:** `/root/.openclaw/` configs
- **VPS secrets:** `/root/.clawdbot/secrets.json` (service credentials)

### API Security (Growth Engine)
- **Helmet:** Security headers on all responses
- **CORS:** Whitelisted origins only
- **Rate limiting:** 7 tiers (global, AI, SMS, webhook, dashboard, write, tracking)
- **Input validation:** `express-validator`, `express-mongo-sanitize`, `xss`, `hpp`
- **Auth:** Supabase JWT + API key fallback (`requireApiKeyOrAuth()`)
- **Webhook validation:** Twilio signature + VAPI signature verification
- **Monitoring:** Sentinel agent active, 36+ attacks blocked in recent period

### Required API Keys
| Key | Service |
|-----|---------|
| `SUPABASE_URL` + `SUPABASE_SERVICE_ROLE_KEY` | Database access |
| `TWILIO_ACCOUNT_SID` + `TWILIO_AUTH_TOKEN` | SMS/voice |
| `TWILIO_API_KEY_SID` + `TWILIO_API_KEY_SECRET` | Browser calling |
| `TWILIO_TWIML_APP_SID` | TwiML voice app |
| `OPENAI_API_KEY` | AI features |
| `PERPLEXITY_API_KEY` | Web research |
| `DEEPGRAM_API_KEY` | Live transcription |
| `VAPI_API_KEY` + `VAPI_PUBLIC_KEY` | Voice AI |
| `VAPI_ASSISTANT_ID` + `VAPI_PHONE_NUMBER_ID` | Voice AI config |
| `SLACK_WEBHOOK_URL` | Notifications |
| `CLAWDBOT_API_KEY` | Fleet gateway access |
| `INTERNAL_JOB_KEY` | Scheduled job triggers |
| `RATERIGHT_API_URL` + `RATERIGHT_ADMIN_API_KEY` | Platform sync |

---

## 8. Current State of Development (Mar 12, 2026)

### Codebase Structure

```
rateright-growth-deploy/
├── src/
│   ├── index.js              # Express server entry (Growth Engine)
│   ├── routes/               # 46 route modules
│   ├── services/             # 45+ service modules
│   ├── jobs/                 # 20+ scheduled jobs
│   ├── middleware/            # Auth, rate limiting, validation
│   └── config/               # Fleet, models, env config
├── admin/                    # React admin dashboard (Vite build)
├── control-centre/           # Fleet management UI (React/Vite)
├── phone-ai/                 # VAPI voice assistant config + scripts
├── voice-assistant/          # Pipecat + Twilio voice (Python, systemd)
├── rivet/                    # Rivet orchestration system
│   ├── SYSTEM.md             # Architecture reference
│   ├── COMPANY.md            # Company state & priorities
│   ├── CONTEXT.md            # Live operational state
│   ├── LESSONS.md            # Operational lessons
│   ├── CC-WORKFLOW.md        # How Rivet launches CC VPS
│   ├── CC-VPS-INBOX.md       # CC VPS → Rivet messages
│   ├── RIVET-TO-CCVPS.md     # Rivet → CC VPS tasks
│   ├── memory/               # Fleet memory & plans
│   └── setup/nginx-ssl/      # Nginx + SSL setup docs
├── scripts/                  # localcc-bridge.js, utilities
├── supabase/migrations/      # SQL migration files
├── vault/                    # Obsidian vault (notes, SOPs, fleet docs)
├── docs/plans/               # Design docs, specs
└── .github/AGENTS.md         # Agent coordination protocols
```

### Key Dependencies (package.json)

**Core:** express, compression, cors, helmet, hpp, dotenv, pino
**Database:** @supabase/supabase-js, redis, ioredis, cache-manager
**Comms:** twilio, @vapi-ai/server-sdk, web-push
**AI:** openai
**Security:** xss, express-validator, express-mongo-sanitize, express-rate-limit, express-slow-down
**Real-time:** ws (WebSocket)
**Testing:** jest, @playwright/test
**Deploy:** @railway/cli

### Recently Completed
- Council Router (Phase 1–3) — Multi-agent fan-out dispatch engine
- Real-data backend — Activity logger + fleet snapshots + Supabase migrations
- Fleet restoration — 7/8 agents active after memory pressure incident
- Security hardening — 36+ attacks blocked
- Terms/Privacy pages deployed
- Payment flow verification complete
- Business intelligence dashboard deployed
- Launch metrics dashboard (30s refresh)

### In Progress
- Control Centre deployment to cc.rateright.com.au (needs nginx on VPS)
- MVP Ventures grant application (Harper, deadline Apr 5, $0–75K)
- Contractor verification calls (Susan)
- OpenRouter API limit mitigation (Harper, Herald, Builder hitting limits)

### Critical Issues
| Issue | Severity | Detail |
|-------|----------|--------|
| Pipeline empty | CRITICAL | Only 1 hot lead (score 85), 5 callbacks 32+ days stale |
| Worker supply | CRITICAL | 304 contractors, 0 workers in marketplace |
| API rate limits | URGENT | Harper, Herald, Builder hitting OpenRouter monthly limits |
| Overdue callback | URGENT | Pawel Wolonciej callback 969 hours overdue |
| Support missing | HIGH | No customer support protocols exist |
| Insurance | HIGH | Decision package pending |
| HIA regulatory | HIGH | Fair Work Closing Loopholes review |

### Financial Summary

| Metric | Value |
|--------|-------|
| Monthly burn | ~$700 (down from $6,461) |
| Cash in bank | $24,408 |
| Runway | ~3 years |
| Breakeven | 11 hires/month at $65 blended |
| Revenue model | $50 flat fee per successful hire |

**Active monthly costs:**
| Service | Cost |
|---------|------|
| Claude Max | $340 |
| Fly.io (legacy) | $189 |
| Apollo.io | $85 |
| Twilio | $76 |
| DigitalOcean VPS | ~$48 |
| ElevenLabs | $22 |
| Xero | $10 |
| Google Workspace | $5 |
| **Total** | **~$775** |

---

*Report covers 7 domains/URLs, 3 repos, 2 voice AI systems, 8 AI agents + CC VPS, 7 LLM providers, 2 Supabase projects, 46 API routes, 20+ scheduled jobs, 5 fleet monitors, and 25+ external service integrations.*
