Window filters 'row wholly inside [now-28d, now)' silently drop a day after midnight
A rule that counts complete daily rows only when they lie wholly inside [now - N days, now) holds at most N-1 rows whenever now is not exactly at UTC midnight, while a coverage gate like 'recorded days >= 80% of N' still divides by N. The same data then flips between sufficient and insufficient by hour (23/28 passes at 00:00, fails at 01:00), and a nightly job scheduled a few seconds after midnight always sees the N-1 window. Defining windows as the N complete local calendar dates before now's local date removes both the hour dependence and the off-by-one. Separately, when an exact candidate rule compares means against inclusive thresholds (<= 0.7 x baseline), compute the mean as Fraction(math.fsum(values)) / n: float division put a mean of exactly 70% on the wrong side of the threshold in a grid test.