Expand description
What each mesh protocol changed, and what this node knows of its peers’ versions: the one place that says what is going on when the team runs more than one borg.
NOTES: per session protocol (borg-mesh sync.rsALPN,borg/mesh/<n>), what a member on an older one misses.borg doctor,borg status, the drone notice and the mesh’s announcement all quote it, so it is stated once. Each new protocol adds its line (a borg-mesh test fails without it).<store>/mesh/versions.json: the borg version and agreed protocol of each member’s last completed session, from its hello (PeerVersion). A member older than 0.7 sends none.<store>/mesh/protocols.json: the members whose last session ended at the handshake because they speak a protocol this node does not (Mismatch): nothing syncs with them.- The announcement: a tell to the collective, sent by the newer node when a session agreed on an
older protocol (borg-mesh sync.rs). Its fixed first words (
announcement_head) are how every node recognises that it was sent. Messages are the one log every node since 0.4 syncs, so it reaches the installs this code is not on.
All three files are written by the mesh process, local, never synced.
Structs§
- Mismatch
- A member’s protocol beside this node’s, both as their ALPN (
borg/mesh/<n>), and when it was seen. - Peer
Version - What a member’s node told this one in its last completed session (
versions_path).
Constants§
- ANNOUNCE_
PREFIX - Protocol: what every session protocol’s name starts with (
borg/mesh/<n>), and so the announcement’s first words (announcement_head). - CRATES
- The crates one release installs, in the order
borg updateinstalls them:borg-ai(theborgbinary) last, so a borg that reports the new version means the mesh and web beside it are new too (update.rscargo, as its tarball path renamesborglast). - ENGINEER_
CHARS - Guard: the longest engineer a version record keeps (an email’s limit, RFC 5321): it is shown to drones and engineers, so a member cannot fill their context through it.
- INSTALL_
SH - Display: the one-line install for a machine without
borg update(scripts/install.sh). - NOTES
- Per spoken session protocol, newest first: what a member on an older one misses. Each protocol
bump adds its line here (borg-mesh sync.rs test
every_spoken_protocol_has_a_note).
Functions§
- announced
- Whether the collective’s message log at
storeholds the announcement forprotocol. - announcement
- The announcement a node on
ourssends after a session agreed ontheirs: who runs which borg, what members ontheirs(or older) miss (missed), and how to update. One line of at most msg.rsV1_TEXTcharacters, so a 0.4 or 0.5 member (borg/mesh/13) is shown it too. - announcement_
head - The announcement’s fixed first words for protocol
protocol(module doc): how a node tells that it was sent. - check
- What
borg doctorsays of memberkey’s version beside this node’s (this, oncurrent): a newer borg (Ok: nothing to do here unless a release has it, update.rs), or an older protocol with what it misses (Warn: that member has to update).Nonefor a member on this node’s footing. - current
- The protocol this build speaks:
NOTES’ first line (borg-mesh sync.rsALPN; a test there holds them equal). - forget_
mismatch - Drops
key’s record: a session with it completed, so it speaks this node’s protocol now. - member
- How every view names member
key: its engineer when known, elsepeer <short node>. - mismatches
- The members whose protocol differs (
protocols_path); empty when none. - missed
- The
NOTESlines a member ontheirsmisses next to one onours: every protocol abovetheirsup toours, oldest first. - misses
missedas every view quotes it (borg doctor,borg status,borg top,borg web, the drone notice, the announcement):/<n>: <line>, joined by;. Empty when nothing is missed.- note
- What a member on a protocol older than
protocolmisses: itsNOTESline. It names one protocol’s line for the bump rule (borg-mesh sync.rsevery_spoken_protocol_has_a_note, which readsNOTESthrough it); every view of a member quotesmisses, which spans the protocols between two. - note_
mismatch - Records that
keyspeaks another protocol (the newest sighting stays). - note_
version - Records what member
keytold this node (the newest session stays),PeerVersion::clean. - number
- The number of a protocol name (
borg/mesh/<n>). - protocols_
path <store>/mesh/protocols.json,{"<member key>": Mismatch}: the members whose last session ended at the handshake because they speak another session protocol (borg-mesh sync.rsALPN), so nothing syncs with them. Written by the mesh daemon;borg doctornames each one. A session with the member that completes drops its record, and so does a membership that no longer lists it.- retain_
mismatches - Keeps only the records of keys
keepstill allows (the mesh calls it when the membership it holds changes: a removed or revoked member never completes another session, so nothing else drops it). - retain_
versions - Keeps only the version records of keys
keepstill allows, asretain_mismatcheskeeps theirs. - runs
- What a member runs, as every view says it:
borg <version>, orolder than 0.7when its hello named none. - update_
commands - The commands an announcement offers, for an install of 0.7 or newer and for an older one.
- versions
- Each member’s last known version (
versions_path), each recordPeerVersion::clean(the file may come from an older build); empty when missing or unreadable. - versions_
path <store>/mesh/versions.json,{"<member key>": PeerVersion}. Written by the mesh process after every completed session; a membership that no longer lists a member drops its record.