recourse
recourse is the framework-neutral core for versioned failure contracts in
Rust services.
[]
= "=0.0.1-rc.3"
It provides:
- permanent catalog codes and type URIs;
- typed, schema-governed public evidence;
- strict RFC 9457 Problem construction and HTTP policy headers;
- structurally separate public Problems and private reports;
- durable operation diagnostics and health findings;
- bounded tolerant client decoding;
- append-only catalog locks and conservative compatibility classification.
Applications register declarations explicitly with Catalog::builder(). The
core crate has no async runtime or application-framework dependency. Framework
adapters consume its concrete response parts at the edge.
This minimal program declares one permanent diagnostic and encodes its canonical HTTP Problem without a server framework:
use ;
The catalog owns the status, headers, JSON shape, code, and type URI. Public
evidence must explicitly implement PublicEvidence; private source errors use
the structurally separate PrivateReport type.
The evidence-schema profile treats retained string format keywords as runtime
assertions and rejects unknown formats during catalog construction. Fixed-width
numeric formats require their exact JSON type and receive complete
representation bounds. Platform-sized and 128-bit integer formats are rejected
because the protocol's intermediate JSON representation cannot guarantee their
portable, lossless encoding. Runtime numeric evidence must use Rust primitive
integers or finite floats. serde_json::Number and numeric serde_json::Value
variants are intentionally unsupported because their serializer-private raw
tokens bypass that governed emitter domain. The exact vocabularies are exposed
as catalog::SUPPORTED_SCHEMA_FORMATS and
catalog::SUPPORTED_SCHEMA_NUMERIC_FORMATS. Catalog construction also rejects
declared minimum sizes, required members, fixed values, and provably mandatory
nesting that cannot fit the default diagnostic wire profile.
See the repository for the Dispatch reference implementation, executable conformance fixtures, and the canonical verification gate for the workspace and publishable package artifacts.