# conservation/1 — conformance Test vectors for any implementation claiming to implement the JouleClaw Information Conservation Law (`conservation/1`). The reference [`DeterministicVerifier`] in this crate passes every vector; any other implementation (alternate verifier, FFI binding, re-implementation in another language) is conformant iff it produces the same `Vec` — same variants, same field values, same order — for every input fixture. ## Files - `vectors.json` — the canonical fixture set. 5 vectors covering every finding variant (`conforming`, `below_spec`, `hallucination`, `missing_delta`) plus one multi-finding case. ## Verifier `../tests/conformance.rs` is the Rust verifier. It is wired into this crate's standard test target: ``` cargo test -p jouleclaw-conservation --test conformance ``` Other-language verifiers (Python, Go, JavaScript, …) MUST parse `vectors.json` directly, compute the findings, and assert byte- equality against `expected_findings` under the same snake_case- tagged enum serialization the reference uses. The order of findings in the output MUST match the order in `expected_findings`. ## Encoding - `spec_bytes_utf8` / `output_bytes_utf8` — UTF-8 bytes to measure. - `delta_fields` — a JSON object of name → string value. The reference verifier sums per-field byte counts in BTreeMap iteration order (sorted), so the choice is deterministic. - `substrate_*` — the amortized arrangement store id, optional content hash, and the bytes contributed to the output by the substrate (not by the spec or delta). - `residual_tolerance` — bytes of acceptable shortfall on `output ≥ spec`. `0` for strict conservation. - `required_slots` — names that MUST appear in `delta_fields` with a non-empty value; missing or empty fields produce a `missing_delta` finding. ## Adding a vector Add an entry to `vectors`, bump `vector_count`, and re-run the verifier. Any added vector becomes part of the conformance contract for every implementer.