[data-veracity] Event timestamps are poll time, not traversal time — outages collapse into a single bucket #31
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#31
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
Every ingested event is stamped with the moment the poll ran, not the moment anyone walked through a door:
At the normal 3-second cadence (
monitor_service.py,last_passenger_sync >= 3.0) this is harmless — 3 s of skew is invisible in an hourly bucket.It stops being harmless the moment a poll does not run.
sync_passenger_flow_from_artemis_asyncreturns early on a failed resource-group fetch (:1786), a failed real-time-count fetch (:1845), or any exception (:1951), and the loop's outerexcept(monitor_service.py) swallows errors and sleeps. Deltas keep accumulating upstream and are then attributed in full to the single timestamp of the next successful poll.A 20-minute Artemis outage therefore produces a 20-minute hole followed by one timestamp holding 20 minutes of traffic.
KPIs corrupted
ν_max = max_h(I_h + E_h)) — the recovery hour wins, permanently.evaluate_cycle_integrity_async—FLAG_TRUNCATED_HOURS(fewer than 10 active hours) andFLAG_BURST_COUNTER_FLUSH(any hour above 35% of volume) will both fire, so the cycle is auto-excluded fromklearning and the month's Trust Index drops. The trust engine correctly detects the symptom but attributes it to the sensors rather than to our own polling gap.Suggested fix
Three options, in order of preference:
.../people/advance/...over a time range), poll that on recovery and backfill events at their true buckets. This is the only option that actually restores the data.[last_successful_poll, now]rather than piling it on one instant, and mark those events with araw_payloadflag so they are identifiable as reconstructed.Whichever is chosen,
evaluate_cycle_integrity_asyncshould distinguishFLAG_INGESTION_GAP(our fault) fromFLAG_BURST_COUNTER_FLUSH(sensor fault). Right now they are indistinguishable in the calibration ledger.Decision needed
Which of the three. Option 1 depends on an upstream endpoint we have not yet confirmed exists.
✅ Design settled (grilling session)
Chosen: Option 2 + Option 3 combined. Option 1 (backfill from a historical query) is dropped — the Artemis catalog exposes no per-interval passenger-count history: only
people/resourceGroupRealTimeCount(realtime cumulative),people/advance/resourceGroupList, andpeople/statisticsHeatMapByTime(a spatial camera heatmap, not a time series). There is no endpoint to backfill from.Settled spec
now— harmless.raw_payloadas reconstructed.FLAG_INGESTION_GAP(our fault) distinct fromFLAG_BURST_COUNTER_FLUSH(sensor fault).klearning (it is not measured data) but is not counted as a sensor fault — it must not tank the monthly Trust Index the way a real burst-flush does.(start, end, delta); the deck widens its 95% CI band across reconstructed spans so reconstructed hours never read with measured confidence.Added to scope
Acceptance criteria (supersede the "Decision needed" section)
now.raw_payload.FLAG_INGESTION_GAPexists and is distinct fromFLAG_BURST_COUNTER_FLUSH.klearning but not penalising the Trust Index as sensor faults.CONTEXT.mddocuments ingestion gap vs burst counter flush.FLAG_INGESTION_GAP— and does not drop the Trust Index as a sensor fault.Re-tagged
ready-for-agent.Being addressed in draft PR #68 together with #26, #31 and #30 (passenger flow ingestion honesty). The PR description lists the settled spec plus the open design points that still need a decision (restart cold start, a floor for the adaptive cap, a shared anomaly/gap ledger table, and how trust rules see reconstructed hours).
gabogg referenced this issue2026-09-24 13:13:51 +00:00
gabogg referenced this issue2026-09-24 13:13:53 +00:00