We think we found a bug in the OS-HPXML-Calibration overlap check (hpxml.py, lines 441-453). It compares utility bill periods by list index, assuming the list is already in chronological order — but it never sorts the list or validates that it is sorted. If bills arrive out of order, it flags unrelated periods as overlapping when they don't.
We hit this on a real home. The error claimed two periods seven months apart overlapped ("2024-09-08 to 2024-10-08" vs. "2024-01-05 to 2024-02-08"), which made no sense once we checked the actual submitted data — those two periods aren't even adjacent. We traced it to the unsorted-list assumption in the index-based comparison.
(Side note, not a bug: the "off by one" end dates in the error message are intended behavior — the code shifts the end timestamp to midnight to make the range inclusive of the full final day, which is why the displayed date looks shifted.)
Suggested fix: sort the list by start date before running the overlap check, or validate it's sorted and raise a clearer error if not.
We've worked around it on our end — we fixed our database query to always return utility bills in sorted order, so this isn't blocking us. Flagging in case it's useful for OS-HPXML-Calibration more broadly.


