How Geometra evolves the server/client wire contract without breaking the core pipeline: Tree → Yoga WASM → Geometry → Pixels.
PROTOCOL_VERSIONinpackages/server/src/protocol.tsmust increment when message JSON shape changes in a way that older peers cannot safely ignore or parse.- Peers with a newer
protocolVersionthan the local maximum are rejected with an explicit error (seeisProtocolCompatibleand client handling).
- Text frames — UTF-8 JSON. Default and always supported.
- GEOM v1 binary envelope — Same JSON bytes wrapped with a fixed header; negotiated via
resize.capabilities.binaryFraming. Does not change semantics orprotocolVersion.
Future true binary layout (non-JSON payload) would be a new capability and likely a new PROTOCOL_VERSION or a versioned sub-envelope, with fixtures in both packages/server and packages/client.
- Prefer optional fields with safe defaults.
- Reuse capability objects on handshake-style messages (as with
binaryFraming) instead of silent behavior changes.
- Update
PROTOCOL_COMPATIBILITY.mdand, when applicable,TRANSPORT_1_4.md. - Add or extend conformance tests (
protocol-*,binary-frame, client protocol tests). - Document migration in release notes for any observable behavior change.
PROTOCOL_COMPATIBILITY.md— current rules and GEOM v1 negotiation.fixtures/protocol/v1/— shared JSON fixtures.