investigate single-camera data loss and statistics quality #199
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#199
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?
Question
What happens when one active counting camera stops providing data while the other cameras continue? Today we know a facility-wide ingestion gap can affect a business day's quality and eligibility for statistics, but we have not established whether a single silent camera is detected, how much it affects published totals, or whether any weighting/coverage policy exists. Do not assume a zero count means a failed camera: a quiet entrance can legitimately have no passages.
Current context to inspect
app/db/occupancy_repository.py); this identifies which cameras count, but does not by itself establish per-camera completeness.CONTEXT.mddefines an ingestion gap as failure to obtain a successful passenger-flow reading and distinguishes missing data from low traffic. Statistics quality markers and calibration eligibility use day-level evidence.Triage / investigation questions
Ready-to-spec outcome
Document the current behavior with a reproducible one-camera failure case, then decide the policy for detection, severity, publication, recovery, and tests. Cover both a truly silent camera and a legitimately quiet camera so the policy does not mistake zero traffic for failure.
Related: statistics data-quality marker work #129 and historical flow coverage/review. This issue is exploratory and does not presume a weighted system already exists.
Triage decision:
needs-triage→ split, thenready-for-agent(phase A)Why split. As written, #199 mixes three kinds of work that need different people:
needs-triage, blocked by #199Leaving it all in one issue would either stall an agent on decisions it may not make, or tempt it to make them. Policy settled by an implementing agent without maintainer sign-off has caused trouble before.
What triage established (redundancy check):
CONTEXT.mdanddocs/for camera-hour, per-camera, coverage and silent/stale-camera concepts.CONTEXT.mdand ADR 0005, HikCentral reports flow per Camera Group, and each group holds exactly one camera. The exception is the Multi-camera group state, which the trace should cover..out-of-scope/entry relates to this.Milestone: "Single silent counting camera" groups #199 and #236, plus the implementation issues #236 will produce.
Agent Brief
Category: enhancement, with
research(needs investigation before it can be specified further)Summary: Document, with a reproducible case, exactly what the app does today when one active counting camera goes silent while the others keep reporting, and contrast it with a legitimately quiet camera. Change no behaviour.
Current behavior (as known before the investigation):
Desired behavior (the deliverables):
Findings document at
docs/research/199-single-camera-outage-behaviour.md. It answers, with evidence:Characterization tests in the test suite, deterministic and offline, with the HikCentral clients mocked as AGENTS.md requires. They feed a facility where one camera returns nothing (or zero) for a business-hours interval while the others report traffic, and a second scenario where one camera is legitimately quiet. They assert today's observable outputs at the stages above: published totals, the day's quality state and marker, comparison eligibility, and calibration inclusion. Each test's docstring says it pins current behaviour pending the #236 policy, so a later behaviour change updates them deliberately.
Optional production evidence, read-only. If the prod DB is reachable over WireGuard, look for real past intervals where one camera reported nothing during open hours while others had traffic, and report how those days were classified. Rules:
mode=roSQLite URI), piping a script over SSH to the app's venv Python;If it isn't reachable, say so and skip this step.
Key interfaces / places to look (by concept):
Acceptance criteria:
docs/research/199-single-camera-outage-behaviour.mdanswers Q1 (the offline part), Q2 and Q3, plus the quiet-camera contrast and the multi-camera note, each with the code concept or test that shows it.docs/research/doesn't exist yet when this lands: adddocs/research/README.md(a one-line index per document) and a link to it fromdocs/README.md. If another research PR got there first, rebase and add a line to its index.scripts/check_docs.pyand the full pytest suite pass. The PR joins the "Single silent counting camera" milestone.Out of scope:
CONTEXT.mdor ADRs. New terms are proposed in the doc for #236's grilling.