From 676d7b13a9bb1c388cd60298e4098f5afdfcac85 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 2 Apr 2026 16:33:20 +0100 Subject: [PATCH] ax(node): remove prose description lines from PeerRegistry method comments AX Principle 2: comments show usage examples, not prose descriptions. Five methods (AddPeer, UpdatePeer, RemovePeer, UpdateMetrics, UpdateScore) had a redundant "Note: Persistence is debounced..." prose line appended after the usage example. The usage example already communicates intent; the prose line restated implementation detail without adding value. Co-Authored-By: Charon --- pkg/node/peer.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/pkg/node/peer.go b/pkg/node/peer.go index be92919..0a7effd 100644 --- a/pkg/node/peer.go +++ b/pkg/node/peer.go @@ -236,7 +236,6 @@ func (registry *PeerRegistry) ListAllowedPublicKeys() []string { } // registry.AddPeer(&Peer{ID: "abc123", Name: "worker-1", Address: "10.0.0.2:9090", Role: RoleWorker}) -// Persistence is debounced — call Close() before shutdown to flush all pending writes. func (registry *PeerRegistry) AddPeer(peer *Peer) error { registry.mutex.Lock() @@ -272,7 +271,6 @@ func (registry *PeerRegistry) AddPeer(peer *Peer) error { } // registry.UpdatePeer(peer) // after handshake completes and real ID is known -// Note: Persistence is debounced. Call Close() to flush before shutdown. func (registry *PeerRegistry) UpdatePeer(peer *Peer) error { registry.mutex.Lock() @@ -289,7 +287,6 @@ func (registry *PeerRegistry) UpdatePeer(peer *Peer) error { } // registry.RemovePeer(peer.ID) // on manual disconnect or ban -// Note: Persistence is debounced. Call Close() to flush before shutdown. func (registry *PeerRegistry) RemovePeer(id string) error { registry.mutex.Lock() @@ -335,7 +332,6 @@ func (registry *PeerRegistry) ListPeers() []*Peer { } // registry.UpdateMetrics(peer.ID, rtt, peer.GeoKM, peer.Hops) // after PingPeer -// Note: Persistence is debounced. Call Close() to flush before shutdown. func (registry *PeerRegistry) UpdateMetrics(id string, pingMS, geoKM float64, hops int) error { registry.mutex.Lock() @@ -357,7 +353,6 @@ func (registry *PeerRegistry) UpdateMetrics(id string, pingMS, geoKM float64, ho } // registry.UpdateScore(peer.ID, 75.0) // clamps to 0-100 -// Note: Persistence is debounced. Call Close() to flush before shutdown. func (registry *PeerRegistry) UpdateScore(id string, score float64) error { registry.mutex.Lock()