Align listing windows with day boundaries - #168
Merged
Conversation
P3: windowStart = windowEnd with an inclusive date-only created filter put the seam day in BOTH windows — boundary runs were double-listed, double-hydrated, double-counted by the rate budget, and double-saved (~4 duplicated days per default 30d scan). The next window now starts the day after the previous ends; pinned by a disjoint-and-contiguous test over the captured created params. P4: relative --since forms (7d, 2w, 3mo) now truncate to UTC midnight. GitHub's created filter is date-only, so a mid-day since timestamp disagreed with what the API returned: runs from the since-day's morning were listed every scan but never matched RunsSince's timestamp comparison — cached yet re-hydrated on every invocation, forever. --since 0d is still rejected (validated before truncation). Live: two consecutive 7d scans of cli/cli went from a steady '21 to fetch' on every run to 808 cached / 0 to fetch. (ROADMAP P3 + P4)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes ROADMAP P3 and P4 — the two halves of the same seam: GitHub's
createdfilter is date-only and inclusive, and both bugs came from mixing it with timestamp arithmetic.P3 (window overlap):
windowStart = windowEndput the seam day in both windows — boundary runs double-listed, double-hydrated, double-counted by the budget, double-saved (~4 duplicated days per 30d scan). Next window now starts the day after. Red test captures thecreatedparams and asserts disjoint + contiguous; the old sliding-window test's "3 calls for 15 days" expectation encoded the overlap and is updated to 2.P4 (perpetual boundary re-fetch): a mid-day
--sincetimestamp meant the API listed the since-day's morning runs on every scan whileRunsSince's timestamp comparison never recognized them as cached — the steady "21 to fetch" visible in every earlier verbose run, re-hydrated forever. Relative forms now truncate to UTC midnight so filter and cache agree.--since 0dstays rejected (validated pre-truncation, caught by the existing U7 test on the first cut).Live proof: two consecutive
--since 7d -vscans of cli/cli: before —783 cached, 21 to fetchon every run; after —808 cached, 0 to fetchon the second run. Estimated GraphQL calls: ~0.