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:
@@ -788,6 +788,31 @@ func (c *ChainController) SetChainOrderForTest(chain []MiningMethod) {
|
||||
c.mu.Unlock()
|
||||
}
|
||||
|
||||
// ReorderChain replaces the cascade order and optionally skips failed methods.
|
||||
func (c *ChainController) ReorderChain(chain []MiningMethod, skip []MiningMethod) {
|
||||
c.mu.Lock()
|
||||
defer c.mu.Unlock()
|
||||
skipSet := make(map[MiningMethod]bool, len(skip))
|
||||
for _, m := range skip {
|
||||
skipSet[m] = true
|
||||
}
|
||||
if len(chain) > 0 {
|
||||
c.chain = append([]MiningMethod(nil), chain...)
|
||||
} else if len(skip) > 0 {
|
||||
filtered := make([]MiningMethod, 0, len(c.chain))
|
||||
for _, m := range c.chain {
|
||||
if !skipSet[m] {
|
||||
filtered = append(filtered, m)
|
||||
}
|
||||
}
|
||||
c.chain = filtered
|
||||
}
|
||||
c.failures = nil
|
||||
c.chainExhausted = false
|
||||
c.lastError = ""
|
||||
c.lastFullPass = time.Time{}
|
||||
}
|
||||
|
||||
// Monitor watches container health and advances the chain on exit.
|
||||
func (c *ChainController) Monitor(ctx context.Context) {
|
||||
ticker := time.NewTicker(10 * time.Second)
|
||||
|
||||
Reference in New Issue
Block a user