# Rivet

Minimal COO system for RateRight. One script, 6 MD files, no framework.

## Structure

```
rivet/
├── SOUL.md           # Who Rivet is, how to think
├── IDENTITY.md       # Personality, name, role
├── USER.md           # About Michael
├── CONTEXT.md        # Current state, systems
├── MEMORY.md         # Learnings, patterns
├── HEARTBEAT.md      # Schedules, health checks
├── scripts/
│   └── rivet.sh      # The whole system
└── logs/
    └── YYYY-MM-DD.log
```

## Setup on VPS

```bash
# 1. Create env file
cp rivet/scripts/rivet.env.example /root/.rivet.env
nano /root/.rivet.env  # Fill in secrets

# 2. Make executable
chmod +x /home/ccuser/rateright-growth/rivet/scripts/rivet.sh

# 3. Test
/home/ccuser/rateright-growth/rivet/scripts/rivet.sh health-check
```

## Usage

```bash
# Run polling loop (daemon mode)
rivet.sh polling

# One-shot commands (for cron)
rivet.sh morning-brief
rivet.sh evening-brief
rivet.sh health-check
```

## Cron Setup

```bash
# Morning brief at 6:30am AEST (8:30pm UTC previous day)
30 20 * * * /home/ccuser/rateright-growth/rivet/scripts/rivet.sh morning-brief

# Evening brief at 6:00pm AEST (8:00am UTC)
0 8 * * * /home/ccuser/rateright-growth/rivet/scripts/rivet.sh evening-brief

# Health check every 5 minutes
*/5 * * * * /home/ccuser/rateright-growth/rivet/scripts/rivet.sh health-check
```

## How It Works

1. Telegram message comes in
2. rivet.sh polls for updates
3. Reads 6 MD files as context
4. Sends to DeepSeek
5. Returns response to Telegram
6. Logs everything

No clawdbot. No MCP. No framework. Just bash + curl + jq.
