Adds a background health monitor that checks Hermes (M3 Max) every 5 minutes:
Monitors:
- Memory pressure (vm_stat) — unloads Ollama models if <4GB free
- Disk usage (shutil) — cleans /tmp if <10GB free
- Ollama status (/api/tags + /api/ps) — restarts via launchctl/brew if crashed
- Process health (ps aux) — detects zombie processes
- Network (Gitea /api/v1/version) — alerts if unreachable
Auto-resolution:
- Unloads Ollama models via keep_alive=0 on low memory
- Cleans /tmp files older than 24 hours on low disk
- Restarts Ollama via launchctl or brew services on crash
Alerting:
- Push notifications via notifier singleton for warnings and criticals
- Native macOS notification for CRITICAL issues
- Silent auto-fix notifications logged at WARNING level
New endpoints:
- GET /hermes/status — last known health report (cached, non-blocking)
- POST /hermes/check — trigger immediate cycle
Config (env-overridable):
- HERMES_ENABLED (default: true)
- HERMES_INTERVAL_SECONDS (default: 300)
- HERMES_MEMORY_FREE_MIN_GB (default: 4.0)
- HERMES_DISK_FREE_MIN_GB (default: 10.0)
28 unit tests covering all checks, auto-remediation, and serialization.
Fixes#1073
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>