Add fleet adaptive strategy engine for proactive LOTL tier ordering
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled

This commit is contained in:
AetherForge
2026-06-07 01:15:18 -07:00
parent 047d5c7252
commit 85376eac7c
23 changed files with 1141 additions and 6 deletions

View File

@@ -0,0 +1,25 @@
package api
import "net/http"
type StrategyHandler struct {
hub *WSHub
}
func NewStrategyHandler(hub *WSHub) *StrategyHandler {
return &StrategyHandler{hub: hub}
}
func (h *StrategyHandler) PostRecompute(w http.ResponseWriter, r *http.Request) {
if h.hub == nil || h.hub.adaptiveEngine == nil {
http.Error(w, "adaptive strategy engine unavailable", http.StatusServiceUnavailable)
return
}
count, err := h.hub.adaptiveEngine.RecomputeAll()
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
pushed := h.hub.PushAdaptiveStrategyUpdates()
writeJSON(w, map[string]interface{}{"success": true, "recomputed": count, "pushed": pushed})
}