Available on crate feature
contract only.Expand description
Data contracts (issue #204): a declarative, versioned schema + semantic
contract for a pipeline’s output — required fields, types, nullability,
enum sets, regex patterns, numeric/length bounds — enforced per page after
transforms and quality checks and before the sink write. Breaches fail,
quarantine (via the DLQ), or warn per the contract-level policy.
Pure evaluation; the pipeline wires DLQ routing and metrics in
run_stream / instrumented_apply_contract.
Re-exports§
pub use compile::CompiledContract;pub use compile::CompiledField;pub use config::ContractFieldType;pub use config::ContractSpec;pub use config::FieldContract;pub use config::OnBreach;pub use export::OPENLINEAGE_SCHEMA_FACET_URL;pub use export::to_json_schema;pub use export::to_openlineage_facet;
Modules§
- compile
- Compile a
ContractSpecinto aCompiledContract: validate the version, field-name uniqueness, per-type constraint compatibility, and bounds, and compile regexes/enum sets once so the per-record pass is cheap. Failures surface asFaucetError::Configat config-load time, never mid-run. - config
- Config-shaped types for the data-contract layer (issue #204). Pure
declarations — validation and compilation live in
compile.rs, evaluation in the module root. - export
- Machine-readable contract exports: JSON Schema and an OpenLineage
SchemaDatasetFacet. Pure functions over aContractSpec— no I/O. Used byfaucet contract --export …; available to library callers too.
Structs§
- Contract
Outcome - Result of applying the contract pass to one page.
- Contract
Violation - One observed contract breach.
- Violating
Record - A record removed from the page by a
quarantinebreach, destined for the DLQ.
Functions§
- apply_
contract - Apply the contract to one page. Pure: no metrics, no DLQ I/O.