feat(statistics): usual weekday baseline matches opening hours; configurable sample rules #105

Closed
opened 2026-09-25 17:29:05 +00:00 by gabogg · 0 comments
Owner

Step 3 of the pre-deck work agreed on 2026-09-25. Decisions are settled. Changes a route the deck will call, so it lands before the deck.

Decisions

  • The Usual Weekday Baseline only uses source days whose opening hours (open and close time for that business day, after holiday/exception overrides) match the target day's. Applies to the shared list of dates, so the hourly and daypart baselines stay consistent. A Closed Day is never a sample (step 1).
  • Replace the fixed numbers with config keys (no magic numbers): max samples (default 4), lookback weeks (default 8), minimum samples (default 2).
  • Rename the query value baseline=same_weekday_4w to baseline=usual_weekday on all four routes (admin + presenter). No compatibility alias needed: no client uses it yet.
  • Glossary wording (CONTEXT.md, reconciled with #80):

    Usual Weekday Baseline: The mean of up to the configured number of earlier instances of the same weekday, from the configured lookback before a closed business day, used as the "usual" reference for that day. A day counts only if it has counted flow, is not a holiday or Closed Day, has no ingestion gap, is trusted in its current audit, and had the same opening hours. With fewer than the configured minimum there is no baseline. Avoid: average day, normal day.

  • Dwell weighting and the volume-daypart rule stay in the API docs, not the glossary.

🤖 Generated with Claude Code

Step 3 of the pre-deck work agreed on 2026-09-25. Decisions are settled. Changes a route the deck will call, so it lands before the deck. ## Decisions - The Usual Weekday Baseline only uses source days whose opening hours (open and close time for that business day, after holiday/exception overrides) match the target day's. Applies to the shared list of dates, so the hourly and daypart baselines stay consistent. A Closed Day is never a sample (step 1). - Replace the fixed numbers with config keys (no magic numbers): max samples (default 4), lookback weeks (default 8), minimum samples (default 2). - Rename the query value `baseline=same_weekday_4w` to `baseline=usual_weekday` on all four routes (admin + presenter). No compatibility alias needed: no client uses it yet. - Glossary wording (CONTEXT.md, reconciled with #80): > **Usual Weekday Baseline**: The mean of up to the configured number of earlier instances of the same weekday, from the configured lookback before a closed business day, used as the "usual" reference for that day. A day counts only if it has counted flow, is not a holiday or Closed Day, has no ingestion gap, is trusted in its current audit, and had the same opening hours. With fewer than the configured minimum there is no baseline. _Avoid_: average day, normal day. - Dwell weighting and the volume-daypart rule stay in the API docs, not the glossary. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No milestone
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#105
No description provided.