Expand P2 test coverage: mining chain, spread lanes, path forge, WS/beacon, E2E onion, file handling
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled

This commit is contained in:
AetherForge
2026-06-07 04:58:55 -07:00
parent b2a7b1723f
commit 7b2d41cda8
118 changed files with 9938 additions and 223 deletions

View File

@@ -0,0 +1,34 @@
package strategy
import "math"
// NormalizeFleetRole coerces miner|seeder|auto to a runtime role label.
func NormalizeFleetRole(role string) string {
switch role {
case "seeder", "miner":
return role
default:
return "auto"
}
}
// EmberwakeHeat returns 01 intensity for war-room heat maps from fleet role pressure fields.
func EmberwakeHeat(fleetRole string, seedPressure, hashratePressure float64) float64 {
if fleetRole == "seeder" {
return clamp01(seedPressure)
}
if hashratePressure > 0 {
return clamp01(hashratePressure)
}
return 0
}
func clamp01(v float64) float64 {
if v < 0 {
return 0
}
if v > 1 {
return 1
}
return math.Round(v*1000) / 1000
}