Add mining self-surgery for on-host recovery when AI control detects stalls.
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
When ai_control_enabled and mining interrupts or hashrate drops, the server composes same-agent fix plans (container restart, chain reorder, GPU swap, idle tune, RandomX restart) with Seer and oath ledger audit — no spread or lateral escalation.
This commit is contained in:
29
agent/miner/fallback_chain_reorder_test.go
Normal file
29
agent/miner/fallback_chain_reorder_test.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package miner
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"crypto-miner-agent/config"
|
||||
)
|
||||
|
||||
func TestReorderChainSkipsFailedMethods(t *testing.T) {
|
||||
c := NewChainController(config.RuntimeConfig{}, ChainHooks{}, nil)
|
||||
c.SetChainOrderForTest([]MiningMethod{MethodContainer, MethodInProcess, MethodGPUSubprocess})
|
||||
c.ReorderChain(nil, []MiningMethod{MethodContainer})
|
||||
st := c.Status()
|
||||
if len(st.ChainOrder) != 2 {
|
||||
t.Fatalf("chain=%v", st.ChainOrder)
|
||||
}
|
||||
if st.ChainOrder[0] != MethodInProcess {
|
||||
t.Fatalf("first=%v want inprocess", st.ChainOrder[0])
|
||||
}
|
||||
}
|
||||
|
||||
func TestReorderChainReplacesOrder(t *testing.T) {
|
||||
c := NewChainController(config.RuntimeConfig{}, ChainHooks{}, nil)
|
||||
c.ReorderChain([]MiningMethod{MethodInProcess, MethodWSL}, nil)
|
||||
st := c.Status()
|
||||
if len(st.ChainOrder) != 2 || st.ChainOrder[0] != MethodInProcess {
|
||||
t.Fatalf("chain=%v", st.ChainOrder)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user