fix(occupancy): PR #69 review follow-ups — quiet windows away from the reset, cycle-bounds API, CI timezone #76
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#76
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?
Accepted P2 (needs a decision)
calibration_cycle_boundspicks the cycle by calendar day. A 21:00–22:00 window calibrates the cycle that ended 17 h earlier. A 23:30–00:30 window waits until midnight and then reads the cycle still in progress. Production (03:30–04:30 around 04:00) is unaffected, and a 3-day minute-by-minute simulation found no skipped or doubled calibration there. The constraint is documented infacility_time.calibration_cycle_bounds, the config field description anddocs/architecture/admin-data-visualization.md. Decide: support arbitrary windows (choose the most recently completed cycle whose end precedes the window), or validate the config so the window must straddle or follow the reset.Behaviour (P3)
daily_reset_time = "00:00", a venue open past midnight (10:00–02:00) is still reported closed after 00:00, and events are stampedis_working_hours = 0. The business-day fix only helps when the reset is at or after closing.last_calibrated_at(cycle_end − 900); e.g. a run at 02:00 is logged as 03:45.timestamp_formatted,peak_time_formatted) still use server time (time.localtime), not facility time.Code quality (P3)
get_business_day_epoch_bounds/get_completed_business_cycle_bounds/ the newget_calibration_cycle_bounds: every caller is a service or a test (the round-2 justification citing AGENTS.md doesn't hold). Their only real use is an argument-order shim for old tests. Inline them or returnCycleBounds; they currently declaretuplereturns.facility_window_containingreturns a raw pair read aswindow[1]. Add a smallWindow(start, end).date.fromisoformat(label)is repeated.CycleBoundscould carry the businessdate. Separately,today_strnow holds the business day, so the name misleads.facility_atre-parses"HH:MM"alongside the existingparse_time_str.Docs and CI (P3)
docs/guides/statistical_occupancy_models.md:49still saysstart + 86400.TZ: America/Caracas(ci.yml:14), and 3mktime-based tests fail underTZ=UTC(test_day_specific_schedule_evaluation,test_holiday_schedule_evaluation,test_business_day_epoch_bounds). CI can't catch a server/facility mismatch outsidetest_facility_time.py. Fix the fixtures, then run CI in UTC (or both).Acceptance criteria
TZ=UTC.Related: #27, PR #69, #74.
Triage decisions (2026-09-24)
daily_reset_time. Saving a window that doesn't returnsVALIDATION_ERRORwith the reason. Production (03:30–04:30 around 04:00) passes. Arbitrary windows are not supported."04:00"; that change is made in #74 (single source of defaults). This item just references it.