Created lifecycle package with foundational types for future extraction: 1. internal/worker/lifecycle/runloop.go (117 lines) - TaskExecutor interface for task execution contract - RunLoopConfig for run loop configuration - RunLoop type with core orchestration logic - MetricsRecorder and Logger interfaces for dependencies - Start(), Stop() methods for loop control - executeTask() method for task lifecycle management 2. internal/worker/lifecycle/health.go (52 lines) - HealthMonitor type for health tracking - RecordHeartbeat(), IsHealthy(), MarkUnhealthy() methods - Heartbeater interface for heartbeat operations - HeartbeatLoop() function for background heartbeats Note: These are interface/type foundations for Phase 5. The actual Worker struct methods remain in runloop.go until Phase 5 when they'll migrate to use these abstractions. Build status: Compiles successfully |
||
|---|---|---|
| .. | ||
| health.go | ||
| runloop.go | ||