open-standards/jouleclaw/jouleclaw-rs/crates/jouleclaw-cone/conformance/README.md
Transaction Science 0055f59b3c jouleclaw: conformance vectors for the triangle's four primitives
JCR-1 ships ten conformance vectors with three independent verifier
implementations byte-equal. The triangle primitives (conservation,
cone, oracle, elicitor) had no equivalent — implementers in other
languages had to read the Rust source to know what "compliant" means.

This commit closes that gap. Each primitive gets:

  conformance/vectors.json — the canonical fixture set
  conformance/README.md    — the conformance contract spec
  tests/conformance.rs     — Rust verifier wired into cargo test

Vectors:

  conservation/1  — 5 vectors: conforming, below_spec, hallucination,
                    missing_delta, plus a multi-finding case
  cone/1          — 6 vectors: every datum_default band entry,
                    jouleclaw_cascade_default L0, escalate-lut-to-
                    formulaic, escalate-from-apex (refused)
  oracle/1        — 5 vectors: always_pass, always_fail, composite
                    all-pass with chain dedup, composite short-
                    circuit on first fail, empty-composite trivial-
                    pass
  elicitor/1      — 5 vectors: empty-walker-done, single-required-
                    ask, two-required-fill-first-ask-second, fully-
                    filled-done, optional-slot-never-asked

Each verifier asserts byte-equality between the reference impl's
serde_json output and the vector's `expected_*`. Adding a vector
extends the conformance contract for every implementer.

The Python and Go reference verifiers (the JCR-1 multi-language
pattern) are roadmap, not part of this commit — the vectors are
language-neutral so other-language verifiers can be added without
changing the contract.

4 new tests, one per primitive — all green.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
2026-06-04 03:32:06 -04:00

31 lines
1 KiB
Markdown

# cone/1 — conformance
Test vectors for any implementation claiming to dispatch over a
JouleClaw `NoveltyBand`. The reference [`BandDispatch`] in this
crate passes every vector; any other implementation is conformant
iff it produces the same `entry_tier` (and matching `escalate_to`
or `AtApex` error) for every input fixture.
## Files
- `vectors.json` — the canonical fixture set. 6 vectors covering
every band entry condition (`datum_default` lut/formulaic/
stochastic, `jouleclaw_cascade_default` L0) plus the escalate-to-
next-tier and escalate-from-apex paths.
## Verifier
```
cargo test -p jouleclaw-cone --test conformance
```
Other-language verifiers MUST construct the named band preset
(`datum_default` or `jouleclaw_cascade_default`), pick the entry
tier given the `novelty` value, and — if `escalate_from` is
present — call escalate and compare to `escalate_to` (string) or
the `at_apex` error tag.
## Adding a vector
Add an entry to `vectors`, bump `vector_count`, and re-run the
verifier.