---
created: 2026-03-12
tags: [operations, monitoring]
related: ["[[02-Fleet/Fleet Map]]", "[[03-Projects/Growth Engine]]"]
---

# Fleet Doctor

Diagnostic-first agent recovery script. Replaces 4 legacy crons with one smart script.

**Script:** `rivet/scripts/fleet-doctor.sh`
**Runs:** Every 5 min via cron
**Log:** `/home/ccuser/rateright-growth/rivet/memory/fleet-doctor.log`

## Diagnostic Levels
1. **Level 0:** Service alive? Port responding?
2. **Level 1:** Config valid JSON? Model fallbacks OK?
3. **Level 2:** Telegram offset corrupted? Sessions valid?
4. **Level 3:** Status.json fresh (< 30 min)?
5. **Nuclear:** Reset offset + sessions + restart (after 2+ consecutive failures)

## Philosophy
> Diagnose first, fix specifically, verify, escalate if failed.
> Lesson from Feb 18: Blind restarts corrupted Telegram offsets and CAUSED the fleet outage.

## Escalation
- Writes alerts to Herald's inbox for Telegram notification
- Writes to Rivet's inbox for coordination
- 10-minute cooldown per agent (no double-fixing)

## Also Monitors
- RateRight app on port 3000
- [[03-Projects/Growth Engine]] on Railway (health check only, can't auto-fix)
