# Clawdbot System Map

*Architecture reference — aligned with rivet/SYSTEM.md (source of truth)*

---

## Architecture Overview

```
CLAUDE (Opus) — Strategic Advisor
    |
CC LOCAL — Technical Manager (manages VPS, deploys, fixes)
    |
VPS (134.199.153.159)
    +-- CLAWDBOT — COO (Telegram, decisions, delegates)
    +-- CC VPS — Worker (executes INBOX.md tasks)
    +-- CURATOR — System health (fixes, improves, cleans)
    +-- PHONECALL AI — Voice (VAPI webhook, future)
         |
         v
+------------------+  +------------------+  +------------------+
|    TELEGRAM      |  |     GITHUB       |  |     NOTION       |
|   (Interface)    |  |   (Comms Hub)    |  |   (Dashboard)    |
+------------------+  +------------------+  +------------------+
```

---

## Agents

| Agent | Role | Triggers |
|-------|------|----------|
| Clawdbot (Rivet) | COO — briefs, decisions, delegation | Telegram commands, cron briefs |
| CC VPS | Worker — executes dev tasks | Polls INBOX.md every 60s |
| Curator | System health — fixes, cleans | Every 2-3 hours (2am UTC cron) |
| Phonecall AI | Voice call processing | VAPI webhook (future) |

---

## File Paths

### VPS
```
/root/.clawdbot/
+-- clawdbot.json         # Main config
+-- memory/main.sqlite    # SQLite memory
+-- .env                  # Clawdbot API keys

/home/ccuser/rateright-growth/   # Repo
+-- rivet/                # Clawdbot brain (SOUL, IDENTITY, USER, etc.)
+-- .claude/              # CC coordination (INBOX, OUTBOX, STATUS)
+-- src/                  # Growth Engine API
+-- admin/                # Admin dashboard
+-- docs/                 # Documentation
+-- clawd-scripts/        # Legacy scripts (deprecated)
+-- scripts/              # Active utility scripts

/home/ccuser/config.env          # Shell credentials (Supabase, etc.)
/home/ccuser/rateright-growth/.env  # Node.js credentials
```

---

## Connections

| Service | Purpose | MCP |
|---------|---------|-----|
| Telegram | User interface | Yes |
| GitHub | Code, agent comms | Yes |
| Notion | Dashboard, tasks | Yes |
| Supabase | Database (job locks) | API |
| Slack | Team comms | Yes |
| Apollo | Lead enrichment | API |

---

## Cron Schedule (UTC)

| Schedule | Job | Purpose |
|----------|-----|---------|
| Every 5 min | rivet health-check | Growth Engine + CC health |
| Every 5 min | cc-vps-auto-sync | CC memory sync |
| Every 30 min | rivet sync | Git backup |
| 8:30pm UTC | rivet morning-brief | 6:30am AEST |
| 8:00am UTC | rivet evening-brief | 6:00pm AEST |
| 2:00am UTC | curator-bot | Knowledge management |
| @reboot | rivet polling | Restart polling daemon |

---

## Services

| Service | Purpose |
|---------|---------|
| clawdbot-gateway | Telegram, main COO |
| cc-poll | Polls INBOX.md every 60s |
| webhook-server | VAPI phone call data |

---

## Quick Commands

```bash
# Check gateway
systemctl status clawdbot-gateway

# View logs
tail -f /tmp/clawdbot/clawdbot-$(date +%Y-%m-%d).log

# Restart gateway
systemctl restart clawdbot-gateway

# Check disk
df -h

# Check memory
free -m

# Check processes
ps aux | grep -E "clawdbot|claude|node"
```

---

*Last updated: 2026-02-03 — aligned with rivet/SYSTEM.md*
