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

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:
AetherForge
2026-06-07 09:27:26 -07:00
parent d605ef4adb
commit fac324ff80
18 changed files with 1166 additions and 0 deletions

View File

@@ -167,6 +167,11 @@ func (r *MiningChainRunner) startMiningCascade(ctx context.Context) {
go r.ctrl.Monitor(monCtx)
}
// StopBranchAttempt stops active branch methods without setting operator pause.
func (r *MiningChainRunner) StopBranchAttempt() {
r.ctrl.StopAll()
}
// Stop halts all mining methods in the chain.
func (r *MiningChainRunner) Stop() {
r.mu.Lock()
@@ -188,6 +193,23 @@ func (r *MiningChainRunner) Restart(ctx context.Context) {
r.ctrl.RestartChain(ctx)
}
// RestartContainer stops and relaunches the container/docker_load tier.
func (r *MiningChainRunner) RestartContainer() error {
r.stopContainer()
return r.startContainer()
}
// ReorderChain updates cascade order and optionally skips failed methods.
func (r *MiningChainRunner) ReorderChain(chain, skip []miner.MiningMethod) {
r.ctrl.ReorderChain(chain, skip)
}
// SwapGPU restarts the parallel GPU subprocess miner.
func (r *MiningChainRunner) SwapGPU() error {
r.stopGPU()
return r.startGPU()
}
// Status returns the live cascade snapshot for stats/diagnostics.
func (r *MiningChainRunner) Status() miner.MiningStatus {
st := r.ctrl.Status()