Add phenotype cloning, failure atlas, AI court session, and clearance L0-L4
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
This commit is contained in:
45
agent/client/atlas_policy.go
Normal file
45
agent/client/atlas_policy.go
Normal file
@@ -0,0 +1,45 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"crypto-miner-agent/miner"
|
||||
)
|
||||
|
||||
// AtlasSkip is a fleet-learned hard skip from the failure atlas.
|
||||
type AtlasSkip struct {
|
||||
Tier string `json:"tier"`
|
||||
Condition string `json:"condition"`
|
||||
Reason string `json:"reason"`
|
||||
}
|
||||
|
||||
func (c *AgentClient) applyAtlasSkips(skips []AtlasSkip) {
|
||||
c.mu.Lock()
|
||||
c.atlasSkips = append([]AtlasSkip(nil), skips...)
|
||||
c.mu.Unlock()
|
||||
c.mergeAtlasSkipsIntoPolicy()
|
||||
}
|
||||
|
||||
func (c *AgentClient) atlasSkipsSnapshot() []AtlasSkip {
|
||||
c.mu.Lock()
|
||||
defer c.mu.Unlock()
|
||||
return append([]AtlasSkip(nil), c.atlasSkips...)
|
||||
}
|
||||
|
||||
func (c *AgentClient) mergeAtlasSkipsIntoPolicy() {
|
||||
c.mu.Lock()
|
||||
defer c.mu.Unlock()
|
||||
if len(c.atlasSkips) == 0 {
|
||||
return
|
||||
}
|
||||
have := make(map[miner.LOTLTier]bool, len(c.tierPolicy.SkipTiers))
|
||||
for _, t := range c.tierPolicy.SkipTiers {
|
||||
have[t] = true
|
||||
}
|
||||
for _, skip := range c.atlasSkips {
|
||||
tier := miner.LOTLTier(skip.Tier)
|
||||
if tier == "" || have[tier] {
|
||||
continue
|
||||
}
|
||||
have[tier] = true
|
||||
c.tierPolicy.SkipTiers = append(c.tierPolicy.SkipTiers, tier)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user