# Cron Health Check Instructions

When this job runs, perform these checks:

## 1. List All Crons
Use `cron action=list` to get current state of all jobs.

## 2. Check Each Recurring Job
For each job with `schedule.kind = "cron"` or `schedule.kind = "every"`:
- Check `state.lastRunAtMs` timestamp
- Calculate hours since last run
- Compare against expected frequency:
  - Daily jobs (0 X * * *): alert if >26 hours
  - Twice daily: alert if >14 hours  
  - Weekly jobs: alert if >8 days
  - Hourly jobs: alert if >2 hours

## 3. Check for Failed Jobs
Look for `state.lastStatus != "ok"` - these need attention.

## 4. Report
- If all healthy: log silently to memory/cron-health.log
- If issues found: alert Rob via Telegram with:
  - Which job(s) missed their window
  - How long overdue
  - Last known status

## 5. Self-Healing (Optional)
If a job missed its window but is still enabled:
- Consider triggering it manually with `cron action=run jobId=X`
- Only do this for idempotent jobs (scans, reviews)
- Never auto-retry jobs that send emails or make external changes

## Expected Jobs (as of Feb 2026)
- Daily memory review (06:00)
- Daily X trends (08:00)
- Daily self-improvement scan (09:00)
- OpenClaw Twitter scan morning (09:00)
- Security scan morning (10:00)
- OpenClaw Twitter scan evening (18:00)
- Security scan evening (19:00)
- Weekly newsletter (Mon 08:00)
