Without validation, a single glitch from any source (Stooq returning $0, Coinbase WS sending a partial JSON, a network blip causing a 50%-off price) would feed garbage into the brain's training data. Once garbage is in the model, BSS plummets and recovery requires manual reset.
Every price tick from every source (Stooq, Coinbase, Finnhub WS, Polygon WS, Alpaca, Tradier) now passes through
DataReliability.validate() before reaching
QUOTES. If it fails any rule, it's silently dropped and logged here.
Rules:
- Price must be finite, positive, and < $10M (sanity)
- Price jump from last accepted value must be < 30% (catches glitches + fat-fingers)
- New timestamp must be >= last accepted timestamp (with 1s clock-skew tolerance)
Source-level tracking: 100-sample fetch success rate + average latency per source. A source with <70% success rate is flagged as DEGRADED.
Stale detection: if a symbol hasn't updated for more than its max-age (5min equity / 2min crypto during RTH; 1hr equity off-hours), it's flagged STALE and the brain will not train on predictions made from that price.