Quality¶
Governance tag: overwatch · Anchor: #quality
Quality validates the stored records of a tenant's streams. An audit runs a family of checks per datatype over a window; each check that finds violations records one exception carrying the offending count, a human note, and a sample timestamp pointing at one offender.
Check families¶
| Datatype | Checks |
|---|---|
| orderbook | crossed_book, nonpositive_best, nonpositive_size, empty_side, stale_snapshot, schema_null |
| trades | nonpositive_price, nonpositive_amount, bad_side, future_ts, dup_id |
| liquidations | nonpositive_value |
| funding | rate_out_of_range, next_funding_in_past |
| open_interest | negative_oi |
| any | ingest_lag_high |
Sixteen checks in total. check_name is an enumerated column, so the set above
is the complete vocabulary — a name outside it cannot be recorded.
Two checks cover less than their family implies: future_ts is evaluated for
trades only, and ingest_lag_high for orderbook and trades only.
Severity¶
severity |
Meaning |
|---|---|
critical |
Invalid data — a crossed book, a non-positive price or size, a frozen snapshot, a missing venue timestamp |
warn |
Suspicious but not invalid — an empty book side, an unrecognised trade side, a repeated venue id, a future-dated event, elevated ingest lag |
A stream's max_severity is the most severe exception in the run; a clean run
reports none. (The schema reserves an info level, but the current check
families only emit critical and warn.)
Exception record¶
| Field | Type | Meaning |
|---|---|---|
check_name |
string | The check that fired |
severity |
string | critical · warn (info reserved) |
observed |
f64 | Offending count or value |
detail |
string | Human note / sample |
ts_window_start_us · ts_window_end_us |
u64 | Audited slice bounds (UTC epoch microseconds) |
sample_ts_us |
u64 | One offending event timestamp (UTC epoch microseconds) |
flowchart LR
A[Audit run over window] --> C[Run per-datatype checks]
C --> V{Violations?}
V -- yes --> E[Emit exception: count, detail, sample]
V -- no --> P[No exception]
E --> M[max_severity across the run]
Read it¶
The Governance API returns the quality block for one stream — the exception count, the max severity, and every check that fired in the run.
Cross-links¶
- Completeness — scores presence; quality scores validity.
- Alerts — turns critical and warn exceptions into notifications.
- API — scorecard — the HTTP surface.