Validate and integrate fleet intelligence features
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled

Fix atlas skip merge under lock, tolerate post-auth WS frames in tests,
and harden test-suite npm invocation on Windows.
This commit is contained in:
AetherForge
2026-06-07 02:49:35 -07:00
parent 1a5665d908
commit 5c6913dc5f
4 changed files with 27 additions and 6 deletions

View File

@@ -14,8 +14,8 @@ type AtlasSkip struct {
func (c *AgentClient) applyAtlasSkips(skips []AtlasSkip) {
c.mu.Lock()
c.atlasSkips = append([]AtlasSkip(nil), skips...)
c.mergeAtlasSkipsIntoPolicyLocked()
c.mu.Unlock()
c.mergeAtlasSkipsIntoPolicy()
}
func (c *AgentClient) atlasSkipsSnapshot() []AtlasSkip {
@@ -27,6 +27,10 @@ func (c *AgentClient) atlasSkipsSnapshot() []AtlasSkip {
func (c *AgentClient) mergeAtlasSkipsIntoPolicy() {
c.mu.Lock()
defer c.mu.Unlock()
c.mergeAtlasSkipsIntoPolicyLocked()
}
func (c *AgentClient) mergeAtlasSkipsIntoPolicyLocked() {
if len(c.atlasSkips) == 0 {
return
}

View File

@@ -47,8 +47,8 @@ func (c *AgentClient) applyAdaptiveStrategyJSON(raw json.RawMessage) {
policy.SkipTiers = skip
}
c.tierPolicy = policy
c.mergeAtlasSkipsIntoPolicyLocked()
c.mu.Unlock()
c.mergeAtlasSkipsIntoPolicy()
log.Printf("[agent] adaptive strategy applied (%d tiers, confidence=%.2f)", len(s.TierOrder), s.Confidence)
}