Principle:23blocks OS Ai maestro Mesh Host Registration
| Knowledge Sources | |
|---|---|
| Domains | Mesh_Networking, Peer_Sync |
| Last Updated | 2026-10-26 10:00 GMT |
Overview
A mesh registration pattern where adding a host triggers back-registration, peer exchange, and gossip propagation with a depth limit to prevent infinite loops.
Description
When a new host joins the mesh, `addHostWithSync` performs a four-step dance:
- Local add: add the host to the local config (with duplicate URL/IP detection)
- Back-registration: register ourselves with the remote host
- Peer exchange: exchange known hosts lists
- Propagation: propagate newly discovered peers to existing hosts, with a propagation depth limit to prevent infinite loops
Each propagation carries a unique ID (`generatePropagationId`) and is deduplicated (`markPropagationProcessed`) so a host doesn't reprocess a gossip message it has already seen.
Usage
Use this principle when designing a gossip-based mesh where:
- Adding a peer triggers reciprocal registration
- Peer lists must converge across the mesh
- Gossip must terminate (depth limit + dedup)
Theoretical Basis
The registration is a four-step sync with gossip dedup:
addHostWithSync(host):
1. addHost(host) // local, with dup detection
2. registerWithPeer(host.url, self) // back-registration
3. exchangePeers(host, knownHosts) // peer list exchange
4. for each newPeer: propagate(newPeer, depth+1, propId)
// depth-limited, deduped by propId
The propagation depth limit prevents infinite gossip loops (A→B→A→B...). The propagation ID dedup ensures a host doesn't reprocess the same gossip trace.