# When does a boundary event fall into two adjacent windows or neither? **Date of Record:** 2026 November 1 **Scope:** Applies to time or value windows aggregated independently and then summed, where each window decides boundary membership on its own. Excludes systems with a single global assignment step. ## Core Distinction **Predicate.** Adjacent windows partition the timeline if and only if their intervals are half-open and the convention is identical on both sides: window i is [start_i, end_i) and window i+1 is [end_i, end_{i+1}). An event at exactly end_i belongs to exactly one window by construction. If either side uses a closed boundary, an event at the seam belongs to two windows or to none. **Failure.** Two aggregators, each internally correct, disagree on boundary inclusivity. The event at the seam is counted twice (both inclusive) or dropped (both exclusive). The aggregate over all windows does not equal the aggregate over the whole range. **Asymmetry.** Each window's total is correct for its own convention. The error exists only in the sum, which is usually computed by a different system than the one that produced the windows. ## What Was Observed **Signature.** Sum-of-windows differing from whole-range total by exactly the events at window boundaries. The delta is proportional to the number of windows times the boundary event rate. Drilling into a single window shows no error. **Trace.** Producer emits at timestamp t=60. Window 0 covers [0,60] closed, window 1 covers [60,120] closed. The event at 60 appears in both. Sum over windows = total + boundary events. With one-minute windows and a boundary-crossing rate of 10 events per minute, the aggregate is inflated by 10 events per minute of range. **Why monitoring stays green.** Every window is internally consistent and passes its own checks. The whole-range total is computed less often, and when it is, the difference is attributed to timing rather than convention. ## Condition of Validity Window sums are exact only while at least one holds: 1. **Half-open everywhere.** Every window is [start, end), enforced at the assignment step rather than by convention. 2. **Single assigner.** One component assigns events to windows, and windows aggregate what they are given rather than filtering independently. 3. **Boundary audit.** The sum over windows is compared against the whole-range total on a schedule, and any delta is alerted. Condition 1 is necessary; 2 makes it robust; 3 detects violations of either. ## Decision Boundary - All windows half-open: exact partition. - Mixed inclusive and exclusive: double count or gap at every seam. - Closed windows with events that never land exactly on a boundary: works in practice, breaks when the event rate or resolution changes so that collisions become common. - Single assigner with any convention: exact, because assignment happens once. ## Operational Effect The defect is a convention mismatch between components that never negotiate, so it appears when a new aggregator is added rather than when existing ones change. Remediation is to assign once and aggregate the assignment, or to enforce half-open at the shared boundary. The trap is to add an epsilon to one side. That converts a clean double count into an unpredictable gap whose size depends on the epsilon and the event rate. ```python from dataclasses import dataclass class BoundaryAssignmentError(ValueError): """Raised when adjacent windows do not partition the timeline exactly.""" @dataclass(frozen=True) class WindowGate: left_closed: bool right_closed: bool single_assigner: bool = False def verify(self) -> bool: if self.single_assigner: return True if self.left_closed and self.right_closed: raise BoundaryAssignmentError("closed-closed window double counts its end boundary") if not self.left_closed and not self.right_closed: raise BoundaryAssignmentError("open-open window drops its end boundary") return True def dispatch_window_convention(gate: WindowGate) -> str: try: gate.verify() except BoundaryAssignmentError: return "single-assigner" return "half-open" ```