Commit f2938a1
committed
fix(adapter): require day-aligned start for hybrid route; tighten purge boundary widening
Two boundary-alignment bugs Greptile flagged after the prior daily-route
hardening landed:
- selectAggregateSource() required day-aligned bounds for the closed-day
'daily' route but not for 'hybrid' (windows straddling today). A
non-midnight start would route to hybrid; buildDailyTimeFilters then
floored the lower bound to start-of-day, over-counting the AM hours of
the start day on the daily branch. Fix: hoist isDayAligned(start) before
the hybrid decision so any mid-day start falls back to raw.
- translateTimeQueriesToDayBoundaries (rollup-purge translation) widened
bounds outward: lower bounds floored to start-of-day, upper bounds
ceiled to start-of-next-day. That over-deleted rollup rows for any day
not entirely covered by the user's purge range. Switched to the
conservative direction: lower bounds ceil to next-day-start unless
already at midnight, upper bounds floor to start-of-day. Daily rollup
purges now only touch days fully inside the caller's window; partial
start/end days are left untouched (their rollup rows go slightly stale
until the next ingest cycle, which is acceptable since the purge path
isn't on the hot read flow).
testWindowStraddlesTodayRoutesHybrid pinned to UTC midnight to actually
exercise the hybrid route. testHybridSumFloorsDailyLowerBoundToStartOfDay
was asserting the old buggy floor-to-midnight behavior; replaced with
testMidDayStartWithHybridWindowFallsBackToRaw which proves the fix
excludes pre-start events on the start day.1 parent 5c113d0 commit f2938a1
2 files changed
Lines changed: 35 additions & 27 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2313 | 2313 | | |
2314 | 2314 | | |
2315 | 2315 | | |
| 2316 | + | |
| 2317 | + | |
| 2318 | + | |
| 2319 | + | |
2316 | 2320 | | |
2317 | 2321 | | |
2318 | 2322 | | |
2319 | 2323 | | |
2320 | | - | |
| 2324 | + | |
2321 | 2325 | | |
2322 | 2326 | | |
2323 | 2327 | | |
| |||
2494 | 2498 | | |
2495 | 2499 | | |
2496 | 2500 | | |
2497 | | - | |
2498 | | - | |
2499 | | - | |
2500 | | - | |
| 2501 | + | |
| 2502 | + | |
| 2503 | + | |
| 2504 | + | |
| 2505 | + | |
2501 | 2506 | | |
2502 | 2507 | | |
2503 | 2508 | | |
| |||
2515 | 2520 | | |
2516 | 2521 | | |
2517 | 2522 | | |
2518 | | - | |
2519 | | - | |
| 2523 | + | |
| 2524 | + | |
2520 | 2525 | | |
2521 | 2526 | | |
2522 | 2527 | | |
2523 | | - | |
| 2528 | + | |
2524 | 2529 | | |
2525 | 2530 | | |
2526 | 2531 | | |
2527 | 2532 | | |
2528 | | - | |
2529 | | - | |
| 2533 | + | |
| 2534 | + | |
2530 | 2535 | | |
2531 | 2536 | | |
2532 | 2537 | | |
2533 | | - | |
| 2538 | + | |
2534 | 2539 | | |
2535 | 2540 | | |
2536 | 2541 | | |
2537 | 2542 | | |
2538 | | - | |
2539 | | - | |
| 2543 | + | |
| 2544 | + | |
2540 | 2545 | | |
2541 | 2546 | | |
2542 | 2547 | | |
| |||
2553 | 2558 | | |
2554 | 2559 | | |
2555 | 2560 | | |
2556 | | - | |
2557 | | - | |
2558 | | - | |
| 2561 | + | |
| 2562 | + | |
| 2563 | + | |
| 2564 | + | |
2559 | 2565 | | |
2560 | | - | |
| 2566 | + | |
2561 | 2567 | | |
2562 | | - | |
2563 | | - | |
| 2568 | + | |
2564 | 2569 | | |
2565 | 2570 | | |
2566 | 2571 | | |
2567 | | - | |
| 2572 | + | |
2568 | 2573 | | |
2569 | 2574 | | |
2570 | 2575 | | |
2571 | | - | |
| 2576 | + | |
| 2577 | + | |
| 2578 | + | |
| 2579 | + | |
2572 | 2580 | | |
2573 | 2581 | | |
2574 | 2582 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | | - | |
| 139 | + | |
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| |||
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
194 | | - | |
| 194 | + | |
195 | 195 | | |
196 | | - | |
197 | | - | |
| 196 | + | |
| 197 | + | |
198 | 198 | | |
199 | 199 | | |
200 | 200 | | |
| |||
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
212 | | - | |
213 | | - | |
| 212 | + | |
| 213 | + | |
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
| |||
0 commit comments