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.mergeAtlasSkipsIntoPolicyLocked() c.mu.Unlock() } 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() c.mergeAtlasSkipsIntoPolicyLocked() } func (c *AgentClient) mergeAtlasSkipsIntoPolicyLocked() { 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) } }