The Protocol Digest & Version Verification =========================================== In decentralized and peer-to-peer networks, "silent protocol drift" is a primary vector for consensus failure, broken receipt chains, and state bifurcation. When software updates alter constants, rate limits, or message structures without an explicit protocol negotiation, nodes begin rejecting each other's messages without obvious cause. Fleetmesh eliminates protocol ambiguity through the **Protocol Digest** mechanism, defined in ``schema/DIGEST``. How the Digest is Computed -------------------------- The protocol digest is a SHA-256 cryptographic hash generated deterministically over the canonical serialized representations of three foundational schema files: .. code-block:: text ┌───────────────────────────────┐ │ schema/constants.json │ ───► Canonical JSON └───────────────────────────────┘ │ ┌───────────────────────────────┐ ├─► SHA-256 Hashing ──► schema/DIGEST │ schema/kinds.json │ ───► Canonical JSON (e.g., 81d90966...) └───────────────────────────────┘ │ ┌───────────────────────────────┐ │ │ schema/messages.json │ ───► Canonical JSON └───────────────────────────────┘ To ensure byte-for-byte reproducibility across operating systems and toolchains: 1. All JSON keys are sorted alphabetically at every level of nesting. 2. All whitespace outside of string literals is stripped. 3. Strings are UTF-8 encoded with strict escape normalization. 4. The three canonical string representations are hashed in deterministic sequence. Authoritative Protocol Version ------------------------------ The current normative protocol version string and digest: .. code-block:: text Version: fleetmesh/0.1-draft Digest : 81d909663c01e4280f6699723ceb396349fa8fd480b343efdbbf063e34b9c481 How the Digest is Enforced -------------------------- 1. Peering Handshake ^^^^^^^^^^^^^^^^^^^^ During the `peering/1.0/offer` and `accept` exchange, both nodes declare their active protocol digest in the message body: .. code-block:: json { "body": { "protocol_digest": "81d909663c01e4280f6699723ceb396349fa8fd480b343efdbbf063e34b9c481" } } If the digests do not match, the receiving node refuses higher peering tiers (downgrading to untrusted bootstrap Tier-0 or declining entirely with ``PROTOCOL_MISMATCH``). This prevents nodes with mismatched pricing ladders or window rules from entering into binding credit contracts. 2. Fleet Monitoring (meshctl watch) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The `meshctl watch` command compares the digests declared by all monitored nodes. A divergence in the digest is treated as a severe operational fault, prompting the operator to re-deploy or synchronize versions before state divergence occurs. 3. Automated CI Tripwire Verification ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The repository tripwire checkers enforce digest integrity on every commit. If a developer edits `constants.json`, `kinds.json`, or `messages.json` without updating `DIGEST`, the test suite fails immediately: .. code-block:: sh python3 fleetmesh.org/scripts/check-vectors.py