#!/usr/bin/env bash # The wire-compatibility gate, both directions. This is the CRDT half of the # spec's ยง0: two implementations, fixtures as the contract. set -euo pipefail cd "$(dirname "$0")/.." echo "--- regenerating fixtures from JS yjs" (cd fixtures && node generate.mjs) echo "--- fixtures must be unchanged (they are the contract, not an output)" if ! git diff --quiet -- fixtures/data; then echo "wire-gate: fixtures changed. If deliberate, commit them WITH the rule change." >&2 git diff --stat -- fixtures/data >&2 exit 1 fi echo "--- Rust reads what JS wrote" (cd core && cargo test --test wire_compat) echo "--- JS reads what Rust wrote" (cd core && cargo run --quiet --locked --bin emit_update) | node fixtures/verify-rust.mjs echo "wire-gate: ok"