Add onion contingency miner tree with orchestrator and Seer telemetry.
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
Single-host branch runner complements fallback chain under Fleet AI Control: persona ghost forks, onion_miner_log hops, server exhaustion splice from graft mining genome, Crucible depth badge, and hospice retire after max cycles.
This commit is contained in:
54
server/internal/ai/persona_mining_test.go
Normal file
54
server/internal/ai/persona_mining_test.go
Normal file
@@ -0,0 +1,54 @@
|
||||
package ai
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"crypto-miner-server/internal/strategy"
|
||||
)
|
||||
|
||||
func TestPersonaMiningTierOrderDistinctFromSpread(t *testing.T) {
|
||||
spread := PersonaSpreadTierOrder(PersonaAggressive)
|
||||
mine := PersonaMiningTierOrder(PersonaAggressive)
|
||||
if len(mine) == 0 {
|
||||
t.Fatal("empty mining order")
|
||||
}
|
||||
if mine[0] == spread[0] {
|
||||
t.Fatalf("mining front %q should differ from spread front %q", mine[0], spread[0])
|
||||
}
|
||||
}
|
||||
|
||||
func TestPersonaContingencyBranchOrder(t *testing.T) {
|
||||
silent := PersonaContingencyBranchOrder(PersonaSilent)
|
||||
if silent[0] != "container" {
|
||||
t.Fatalf("silent=%v", silent)
|
||||
}
|
||||
agg := PersonaContingencyBranchOrder(PersonaAggressive)
|
||||
if agg[0] != "inprocess" {
|
||||
t.Fatalf("aggressive=%v", agg)
|
||||
}
|
||||
}
|
||||
|
||||
func TestBuildContingencyPolicyRequiresAIControl(t *testing.T) {
|
||||
if BuildContingencyPolicy(false, PersonaBalanced) != nil {
|
||||
t.Fatal("expected nil when ai control off")
|
||||
}
|
||||
p := BuildContingencyPolicy(true, PersonaSilent)
|
||||
if p == nil || p["enabled"] != true {
|
||||
t.Fatalf("policy=%v", p)
|
||||
}
|
||||
}
|
||||
|
||||
func TestComposeContingencyBranchParamsUsesGraftNotSpread(t *testing.T) {
|
||||
graft := &strategy.GraftPolicy{
|
||||
GraftTier: "docker",
|
||||
TierOrder: []string{"docker", "wsl"},
|
||||
}
|
||||
out := ComposeContingencyBranchParams(PersonaBalanced, graft, "test")
|
||||
if out["force_method"] != "container" {
|
||||
t.Fatalf("force=%v", out["force_method"])
|
||||
}
|
||||
tiers, _ := out["mining_tiers"].([]string)
|
||||
if len(tiers) == 0 {
|
||||
t.Fatal("expected mining_tiers")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user