oficina / docs Public

Clone
git clone https://amadan.net/oficina/docs

Plain git — no account needed to clone.

Download

Download this file

1#!/usr/bin/env bash
2# The wire-compatibility gate, both directions. This is the CRDT half of the
3# spec's §0: two implementations, fixtures as the contract.
4set -euo pipefail
5cd "$(dirname "$0")/.."
6
7echo "--- regenerating fixtures from JS yjs"
8(cd fixtures && node generate.mjs)
9
10echo "--- fixtures must be unchanged (they are the contract, not an output)"
11if ! git diff --quiet -- fixtures/data; then
12 echo "wire-gate: fixtures changed. If deliberate, commit them WITH the rule change." >&2
13 git diff --stat -- fixtures/data >&2
14 exit 1
15fi
16
17echo "--- Rust reads what JS wrote"
18(cd core && cargo test --test wire_compat)
19
20echo "--- JS reads what Rust wrote"
21(cd core && cargo run --quiet --locked --bin emit_update) | node fixtures/verify-rust.mjs
22
23echo "wire-gate: ok"
24