# EzyGas Paperclip - Day 1 Operations Guide

## Overview

You now have a **distributed autonomous operating system** running on your Hostinger VPS. This guide tells you exactly what to monitor, what to expect, and how to intervene in the first 48 hours.

---

## IMMEDIATE POST-DEPLOYMENT (First 2 Hours)

### 1. **Verify All Services Are Running**

```bash
# SSH into your VPS
ssh root@72.60.215.210

# Navigate to deployment directory
cd /opt/ezygas

# Check container status
docker compose ps

# Expected output:
# NAME                 STATUS
# ezygas-paperclip     Up (healthy)
# ezygas-postgres      Up (healthy)
# ezygas-weaviate      Up (healthy)
# ezygas-nginx         Up (healthy)
# ezygas-backup        Up
```

If any container shows "Unhealthy" or "Exited":
```bash
# View logs for that service
docker compose logs [service-name]

# Restart if needed
docker compose restart [service-name]
```

### 2. **Access the Dashboard**

Open your browser to:
```
https://72.60.215.210
```

(Note: Self-signed certificate warning is expected on first visit)

**Default Access**:
- Dashboard available at port 3000
- Username/Password: Set in .env file during deployment

### 3. **Verify Database Connection**

```bash
# Check PostgreSQL is accessible
docker compose exec postgres psql -U paperclip -d ezygas -c "SELECT version();"

# Expected: PostgreSQL version info (no errors)
```

### 4. **Import EzyGas Configuration**

The company configuration is in `/opt/ezygas/ezygas-config.json`

Steps:
1. Login to Paperclip dashboard
2. Go to **Settings → Company Setup**
3. Click **Import Configuration**
4. Select `ezygas-config.json`
5. Review the org chart, agents, goals
6. Click **Confirm & Deploy**

This will create:
- ✓ Your 6-person AI team (CEO, CFO, HR, Supply Chain, Gov Relations, Content/Brand)
- ✓ 5-year mission structure
- ✓ Budget controls ($1,950/month)
- ✓ Heartbeat schedules (staggered to prevent resource contention)

---

## FIRST 24 HOURS - What to Expect

### **Agent Startup Sequence**

Your agents will begin operating on their scheduled heartbeats. Here's when each one fires:

| Agent | Schedule | First Execution | What It Does |
|-------|----------|-----------------|-------------|
| **CEO** | 6 AM UTC | Today 6 AM | Reviews 5-year mission, sets daily priorities |
| **HR** | Midnight UTC | Tomorrow midnight | Analyzes hiring bottlenecks, drafts recruitment plan |
| **Supply Chain** | Every hour | In ~1 hour | Forecasts demand for 1M cylinders, identifies capacity gaps |
| **Gov Relations** | Every 12 hours | In ~2 hours | Maps regulatory landscape, priority stakeholders |
| **Content/Brand** | Every 6 hours | In ~4 hours | Drafts brand narrative, creates messaging framework |
| **CFO** | 8 AM UTC | Tomorrow 8 AM | Tracks budgets, alerts on spending |

### **Monitor the Dashboard**

1. Go to **Agents** view
2. Watch agent status as they come online
3. Click each agent to see their latest output
4. Track **Budget Utilization** (should be 0% at start, gradually increase)

### **Check the Logs**

```bash
cd /opt/ezygas

# Watch real-time logs as agents execute
docker compose logs -f paperclip

# Or specific agent logs
docker compose logs -f paperclip | grep "supply-chain"
```

### **Expected First Agent Outputs**

**CEO (6 AM UTC)**:
```
Strategic briefing for day 1
- Mission: 1M cylinders, 50M refillings
- Current status: Deployment complete, agents online
- Priority 1: Validate supply chain can scale to 50K Year 1 target
- Priority 2: Confirm gov relations strategy
- Budget: All agents within limits
```

**Supply Chain (Every hour)**:
```
Supply chain status report
- Current inventory: [to be populated]
- Demand forecast (next 30 days): [analysis]
- Capacity constraints identified: [analysis]
- Recommended actions: [recommendations]
- Budget used: $X
```

---

## FIRST 48 HOURS - Critical Monitoring Checklist

### ✓ **Budget Tracking**

Check the **Finance Dashboard**:
- [ ] Total spend is < $50 (first day should be minimal)
- [ ] No agent has exceeded budget
- [ ] CFO agent has generated first budget report
- [ ] No warnings/alerts on overspend

If any agent hits 80% of monthly budget: You'll get an alert. Review their execution and consider pausing if inefficient.

### ✓ **Agent Health**

For each agent, verify:
- [ ] Agent came online at scheduled heartbeat
- [ ] No error messages in logs
- [ ] Output quality is coherent (not hallucinating)
- [ ] Each output traces back to the mission
- [ ] Agent is staying within budget

If an agent fails to execute:
```bash
# Check error logs
docker compose logs paperclip | grep "agent-[name]"

# Restart the service
docker compose restart paperclip

# Or pause the agent temporarily via dashboard
# Settings → Agents → [Agent Name] → Pause
```

### ✓ **Database Health**

```bash
# Check database size (should be small initially)
docker compose exec postgres psql -U paperclip -d ezygas \
  -c "SELECT pg_size_pretty(pg_database_size('ezygas'));"

# Expected: < 10MB initially

# Check if backups are running
ls -lh /opt/ezygas/backups/

# Expected: New backup files appearing daily
```

### ✓ **Resource Consumption**

Monitor your VPS for runaway processes:

```bash
# Check container resource usage
docker stats

# Expected for 2 vCPU / 8GB:
# - Paperclip: 300-500MB RAM, 5-15% CPU (during agent execution)
# - PostgreSQL: 200-400MB RAM, 2-5% CPU
# - Weaviate: 400-600MB RAM, 5-10% CPU
# - Total: Should NOT exceed 2GB RAM or 50% CPU

# If CPU/Memory is maxed:
# 1. Check which agent is running
# 2. Review its logs
# 3. Consider pausing inefficient agents
# 4. Stagger heartbeat schedules further apart
```

### ✓ **Network & SSL**

```bash
# Test that Nginx is properly routing traffic
curl -I https://72.60.215.210

# Expected: HTTP/2 200 OK (with self-signed cert warning)

# Check SSL certificate validity
docker compose exec nginx openssl s_client -connect localhost:443 -showcerts

# Eventually you'll want a real certificate:
# See "Setting Up Let's Encrypt" section below
```

---

## IF SOMETHING GOES WRONG (First 48 Hours)

### **Scenario 1: Agent Not Executing**

```bash
# Check if agent is paused
# Dashboard → Agents → [Agent] → Status

# Check logs
docker compose logs paperclip | grep "[agent-name]"

# Restart
docker compose restart paperclip

# If still failing, check Anthropic API key is valid
# Edit .env, verify ANTHROPIC_API_KEY
# Restart: docker compose restart paperclip
```

### **Scenario 2: Database Connection Error**

```bash
# Test database connection
docker compose exec postgres psql -U paperclip -c "SELECT 1;"

# If fails, check database is running
docker compose ps postgres

# If not running, start it
docker compose up -d postgres

# Then restart Paperclip
docker compose restart paperclip
```

### **Scenario 3: Out of Memory**

```bash
# Check what's consuming RAM
docker stats

# If Weaviate is over 1.5GB, restart it
docker compose restart weaviate

# If Paperclip is over 4GB, check which agent is running
# The CEO Opus model is most expensive, might spike to 2GB+
# This is normal but consider pausing if sustained
```

### **Scenario 4: Agent Producing Bad Output**

Example: CEO agent output is incoherent or off-mission.

```bash
# View the full agent output
docker compose logs paperclip | grep -A 50 "agent-ceo"

# Edit agent instructions via dashboard
# Settings → Agents → CEO → Edit Instructions
# Tighten the prompt, emphasize mission alignment

# Or pause the agent temporarily
# Settings → Agents → CEO → Pause
```

---

## SETTING UP LETS ENCRYPT (Days 2-3)

Your current SSL is self-signed (just for initial security). Set up free Let's Encrypt:

```bash
cd /opt/ezygas

# 1. First, configure your domain's DNS to point to this server:
#    A record: your-domain.com → 72.60.215.210

# 2. Update .env with your real domain
# Edit .env, set: DOMAIN_NAME=ezygas.yourcompany.com

# 3. Run certbot in the nginx container
docker compose exec nginx certbot certonly --webroot \
  -w /usr/share/nginx/html \
  --email your-email@company.com \
  -d ezygas.yourcompany.com \
  --agree-tos

# 4. Update nginx.conf to use the certificate
# ssl_certificate /etc/letsencrypt/live/ezygas.yourcompany.com/fullchain.pem;
# ssl_certificate_key /etc/letsencrypt/live/ezygas.yourcompany.com/privkey.pem;

# 5. Restart nginx
docker compose restart nginx

# 6. Test HTTPS
curl https://ezygas.yourcompany.com

# Expected: Valid SSL certificate
```

---

## ONGOING MONITORING (After First 48 Hours)

### **Daily Standup Checklist** (5 minutes)

```bash
cd /opt/ezygas

# 1. Check if CEO report from this morning is in dashboard
# 2. Verify budget is tracking
docker compose exec postgres psql -U paperclip -d ezygas \
  -c "SELECT agent_id, budget_used, budget_monthly FROM agent_budgets;"

# 3. Any error alerts?
docker compose logs paperclip --tail=100 | grep -i error

# 4. Backup running?
ls -l /opt/ezygas/backups/ | tail -5
```

### **Weekly Review** (15 minutes)

```bash
# 1. Review all agent outputs
# Dashboard → Agents → [Each Agent] → Recent Tasks

# 2. Check total spend vs. budget
# Dashboard → Finance → Monthly Summary

# 3. Review CEO strategic briefing
# Dashboard → Agents → CEO → Latest Report

# 4. Check database size (backup growth)
docker compose exec postgres psql -U paperclip -d ezygas \
  -c "SELECT pg_size_pretty(pg_database_size('ezygas'));"

# Expected: Slow growth (~100MB per month)

# 5. Review container health
docker compose ps
docker stats
```

### **Monthly Review** (30 minutes)

- [ ] Total spend against budget
- [ ] Agent efficiency (cost per task)
- [ ] Quality of agent outputs (staying on-mission?)
- [ ] Any policy/compliance issues from Gov Relations agent
- [ ] Supply chain capacity assessment
- [ ] Brand narrative effectiveness from Content agent
- [ ] Adjust agent budgets if needed
- [ ] Review and approve any major agent recommendations

---

## CRITICAL COMMANDS REFERENCE

```bash
cd /opt/ezygas

# STATUS
docker compose ps                    # Check all services
docker stats                         # Real-time resource usage
docker compose logs -f               # Stream all logs
docker compose logs [service]        # Logs for specific service

# CONTROL
docker compose restart [service]     # Restart a service
docker compose pause [service]       # Pause a service
docker compose unpause [service]     # Resume a service
docker compose down                  # Stop all services
docker compose up -d                 # Start all services

# DATABASE
docker compose exec postgres psql -U paperclip -d ezygas   # Connect to DB
# Then: SELECT * FROM agents; (to see agent status)

# BACKUPS
/opt/ezygas/backup.sh               # Manual backup
ls -lh /opt/ezygas/backups/         # View backups

# CONFIGURATION
cat /opt/ezygas/.env                # View environment config
# Edit /opt/ezygas/docker-compose.yml  (then: docker compose up -d to apply)

# MONITORING
docker compose top paperclip         # Top processes in Paperclip container
docker compose events                # Real-time docker events
```

---

## ESCALATION PATH (If Something Breaks)

1. **Check Logs**: `docker compose logs -f`
2. **Restart Service**: `docker compose restart [service]`
3. **Check .env**: Verify API keys, credentials
4. **Reset Containers**: 
   ```bash
   docker compose down
   docker compose up -d
   ```
5. **Check Hostinger VPS Health**:
   - Login to Hostinger control panel
   - Verify server is running
   - Check for resource limits/overages
6. **Manual Backup & Recovery**:
   ```bash
   /opt/ezygas/backup.sh
   # Restore from: /opt/ezygas/backups/ezygas_postgres_*.sql.gz
   ```

---

## Success Criteria for Day 1

By end of first 24 hours, you should see:

✓ All 6 agents are online and responding  
✓ CEO agent generated first strategic briefing  
✓ Supply Chain agent has forecasted initial demand  
✓ No errors in logs (warnings OK)  
✓ Budget tracking is operational  
✓ Database backup is running  
✓ You can access dashboard and see agent outputs  

If all of these are true, your **autonomous EzyGas operating system is live and functional**.

---

## Next Phase: Refinement (Days 3-7)

Once agents are running smoothly:

1. **Fine-tune agent instructions** based on output quality
2. **Adjust heartbeat schedules** if resource usage is high
3. **Set up integrations** (Slack notifications, external data sources)
4. **Begin feeding real operational data** (demand signals, costs, etc.)
5. **Start tracking agent ROI** (is the $1,950/month worth it?)

Your AI team is working for you 24/7. The question now is: **Are they moving the mission forward?**

---

**Questions?** Check logs first. Logs tell the truth.

