feat(statistics): present approved historical flow and baselines #165

Open
opened 2026-09-27 23:30:26 +00:00 by gabogg · 0 comments
Owner

Part of #160.
Blocked by: #164. Coordinate holiday/event presentation and baseline rules with #161.

Result

The statistics deck reads approved historical hourly aggregates alongside locally observed data without double-counting and explains their source and limits. Staging and private monthly drafts remain invisible.

Acceptance

  • Extend read-only statistics queries and day/week/month views to combine local rollups/events with approved camera-hour aggregates using the source precedence approved in #160. Use historical business-cycle schedule and closed-day semantics; preserve local data for any observed camera-hour. Support visitor-count totals, entrances, and hourly flow on imported or mixed-source days.
  • Expose day coverage as Complete, Partial or Missing. A Complete imported day shows an hourly historical source qualifier; a Partial day shows the existing Estimate marker and its unresolved-gap reason; Missing days remain visibly missing. Never present an empty source response as zero or count a single recovered hour as a complete day.
  • On any day affected by hourly aggregates, mark peak occupancy, dwell, dayparts and 15/30-minute series unavailable with a source-resolution reason rather than fabricating passage timing or interpolated peaks. Other days keep their existing behavior.
  • Allow a Complete, independently quality-checked imported day to supply count and hourly-flow Usual Weekday Baselines when it is not a holiday/event and has matching operating hours. Partial/Missing days and days with unresolved quality cannot supply those baselines. Dwell-based baselines remain unavailable for hourly-only source days. Imported and mixed-source days remain excluded from calibration even when statistics treat their measured counts as trustworthy.
  • Reapproved counts or historical context update statistics and eligible baselines from the current approved revision without rewriting prior source/audit records or already-applied calibration. Ensure period totals and year-over-year comparisons use the retained aggregates after raw live events age out.
  • Add deterministic repository/service/API and deck tests for full/partial/missing days, local/imported mixing, coverage markers, unavailable measures, baseline eligibility, historical corrections, and no double-counting. Run required documentation, Ruff and pytest checks.

Do not add an event KPI or automatic future gap repair in this issue.

Part of #160. Blocked by: #164. Coordinate holiday/event presentation and baseline rules with #161. ## Result The statistics deck reads approved historical hourly aggregates alongside locally observed data without double-counting and explains their source and limits. Staging and private monthly drafts remain invisible. ## Acceptance - Extend read-only statistics queries and day/week/month views to combine local rollups/events with approved camera-hour aggregates using the source precedence approved in #160. Use historical business-cycle schedule and closed-day semantics; preserve local data for any observed camera-hour. Support visitor-count totals, entrances, and hourly flow on imported or mixed-source days. - Expose day coverage as Complete, Partial or Missing. A Complete imported day shows an `hourly historical source` qualifier; a Partial day shows the existing Estimate marker and its unresolved-gap reason; Missing days remain visibly missing. Never present an empty source response as zero or count a single recovered hour as a complete day. - On any day affected by hourly aggregates, mark peak occupancy, dwell, dayparts and 15/30-minute series unavailable with a source-resolution reason rather than fabricating passage timing or interpolated peaks. Other days keep their existing behavior. - Allow a Complete, independently quality-checked imported day to supply count and hourly-flow Usual Weekday Baselines when it is not a holiday/event and has matching operating hours. Partial/Missing days and days with unresolved quality cannot supply those baselines. Dwell-based baselines remain unavailable for hourly-only source days. Imported and mixed-source days remain excluded from calibration even when statistics treat their measured counts as trustworthy. - Reapproved counts or historical context update statistics and eligible baselines from the current approved revision without rewriting prior source/audit records or already-applied calibration. Ensure period totals and year-over-year comparisons use the retained aggregates after raw live events age out. - Add deterministic repository/service/API and deck tests for full/partial/missing days, local/imported mixing, coverage markers, unavailable measures, baseline eligibility, historical corrections, and no double-counting. Run required documentation, Ruff and pytest checks. Do not add an event KPI or automatic future gap repair in this issue.
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gabogg/hikcentral#165
No description provided.