Available on crate feature
quality only.Expand description
Data-quality checks: declarative per-record and per-batch assertions that
quarantine violating records to the DLQ or abort the run. Pure evaluation;
the pipeline wires the DLQ routing in run_stream.
See docs/superpowers/specs/2026-05-29-quality-checks-design.md.
Modules§
- batch
- Per-batch check evaluation over the survivor slice. Aggregate checks return
a single pass/fail;
uniquereturns the indices of the duplicate rows (row-attributable). - compile
- Compile a
QualitySpecinto aCompiledQuality: parse paths/regexes/ schemas once, validate theon_failuresubset and numeric bounds. Failures surface asFaucetError::Config. - config
- Config-shaped types for the data-quality layer. Pure declarations — no
evaluation logic (that lives in
record.rs/batch.rs) and no compilation (that lives incompile.rs). - record
- Per-record check evaluation. Pure functions over
&Value. A check returnsOk(())on pass orErr(message)on fail; the message is surfaced in the DLQ envelope or the abort error.
Structs§
- Check
Tally - Per-check counters + elapsed time, keyed by check name. Emitted as metrics by the observability wrapper.
- Compiled
Quality - A fully compiled quality spec. Built once via
CompiledQuality::compile. - Quality
Outcome - Result of applying the quality pass to one page.
- Quality
Spec - The
quality:config block. Per-record checks run first (partitioning the page into survivors + quarantined); per-batch checks then run over the survivors. - Quarantined
Record - A record removed from the page by a quality check, destined for the DLQ.
Enums§
- Batch
Check - A per-batch check, evaluated per page over the survivors of the per-record pass.
- Compare
Op - Ordering / equality operator for the
comparecheck. - Json
Type - Expected JSON type for the
type_ischeck. - OnFailure
- What to do when a check fails. The allowed subset is validated per check
at compile time (see
compile.rs). - Record
Check - A per-record check. Addressed field accepts the filter/explode path subset
(bare key,
dot.path,$['bracketed']).
Functions§
- apply_
quality - Apply the full per-page quality pass. Pure: no metrics, no DLQ I/O.