Expand description
Canonical Rigorix contracts as a consumable crate.
@canonical schemas/README.md — the contract corpus this crate embeds
(strategy freeze D-1: schemas/ is the single source of truth; D-2:
schemas + verifiers). ADR-0001 freezes the rigorix.* catalog within it.
This crate embeds the entire [schemas/] corpus — the JSON Schemas
(envelope.json, claims.json, policy.json, api/*.json, …) and the
conformance fixture corpus (fixtures/**) — at build time, and exposes it
by relative path. It is the distributable form of the single source of
truth (strategy freeze D-1/D-2), consumed by rigorix-verifier, the
Python/TypeScript verifiers, and both servers — one copy, no vendoring.
The crate is data + lookup: no engine dependency, no runtime filesystem
access. The embedded table is generated by build.rs from the repo-root
schemas/ (a symlink to it lives in this crate so cargo package ships the
dereferenced corpus); a sync test fails if the embedded set diverges from
the on-disk contract.
use rigorix_schemas::{fixture, schema, schema_by_id};
let envelope = schema("envelope.json").expect("envelope schema");
let chain = fixture("integrity/chain.json").expect("integrity fixture");
let id = schema_by_id("https://rigorix.eu/schemas/envelope-v2.json");
assert_eq!(id, Some("envelope.json"));Statics§
- FILES
- Every embedded file:
(path relative to schemas/, contents). - IDS
$id-> path for every schema that declares an$id.- NAMES
- Every embedded path, sorted (same order as
FILES).
Functions§
- fixture
- Return the embedded conformance fixture at
rel_path, relative tofixtures/(e.g."integrity/chain.json","envelope/envelope-rich-signed.json"). - schema
- Return the embedded contract at
rel_path, relative toschemas/(e.g."envelope.json","api/catalog.json","fixtures/integrity/chain.json"). - schema_
by_ id - Resolve a schema
$id(e.g.https://rigorix.eu/schemas/envelope-v2.json) to its embedded path — for registering cross-file$refresources. - schema_
ids - The
$id -> pathmap exposed by the corpus. - schema_
names - Every embedded path, sorted (
NAMES[i]corresponds toFILES[i].0).