[data-veracity] Trust Index conflates sensor faults with quiet business days, on hardcoded thresholds #33
Labels
No labels
blocked
bug
enhancement
high-priority
low-priority
needs-info
needs-triage
ready-for-agent
ready-for-human
referenced
research
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gabogg/hikcentral#33
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The deck publishes Trust Index as a headline Month KPI (
trusted_cycles_ratio,calibration_trust_index) and renders converged/failed nights in the calibration ledger. That index comes fromevaluate_cycle_integrity_async(app/services/occupancy_service.py:826), whose four rules mix two unrelated concepts:R2 and R3 are data-quality signals — they detect counter flushes and directional sensor bias. R1 and R4 are business-activity signals: a genuinely short trading day or a genuinely quiet Tuesday trips them even when every sensor behaved perfectly.
All four collapse into
is_trusted = len(flags) == 0, which decides:AUTO_EXCLUDEDfromcompute_ewma_multiplier(soknever learns from quiet days), andA month with several quiet days reports a degraded Trust Index and a red-marked calibration ledger, implying a sensor problem that does not exist.
Hardcoded site-specific thresholds
5000/1000entries,10active hours,0.35burst share,[0.80, 1.30]ratio bounds — none are inoccupancy_config. A second deployment, a smaller mall, or a renovation period silently mass-quarantines cycles.The same pattern repeats in SQL:
total_in > 40000auto-quarantines any exceptionally busy day as a counter flush. A large mall on a holiday weekend can legitimately exceed that — and the busiest days are precisely the ones whose peak the deck most wants to report.KPIs corrupted
Trust Index (Month headline) ·
trusted_cycles_ratioon every period · the nocturnal calibration ledger's status column ·k̂itself, because quiet and very busy cycles are excluded from EWMA learning, biasing the multiplier toward mid-volume days.Suggested fix
DATA_QUALITY_*(R2, R3, counter-flush, ratio bounds) andLOW_ACTIVITY_*(R1, R4). OnlyDATA_QUALITY_*should clearis_trustedand gate EWMA learning.occupancy_configwith the current values as defaults, and surface them in the admin UI.total_in > 40000a relative rule — e.g. more than 3σ above the trailing 30-cycle mean — so it scales with the site instead of assuming one.Being addressed in draft PR #71, one of four [data-veracity] drafts declared on 2026-09-23 (#68, #69, #70, #71). Each will be triaged, reviewed and implemented in order; the PR description lists the open design points to settle first.
gabogg referenced this issue2026-09-24 13:13:51 +00:00