Tell a scheduler when the next slice is actually takeable - #164
Merged
Conversation
The manifest advertised `nextWindowOpensAt` as `windowEnd(latestClosedWindow())` — the same value as `latestWindowEnd` on the line above it, and an instant that has already passed. It is the boundary that *closed* the window being served. A buyer's pipeline keying on it would wake immediately, re-pull the slice it already had, and spin until the real boundary arrived. The window starting at that moment is the one still filling, so there is nothing new to take until it closes, one window further on. Renamed to `nextWindowAvailableAt` while it is a day old and nobody is reading it yet: the old name described when a window opens, which is not a fact anyone needs, and reads as the answer to the question they were actually asking. The test asserts the property rather than a fixed string — the served window's own end is in the past, the next slice's is in the future — so it fails for any `now` and cannot be satisfied by the value it replaced. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Pij2tFcRgqceMpheotFSoX
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.
Follow-up to #163, caught while verifying the live deploy.
The manifest advertised
nextWindowOpensAtaswindowEnd(latestClosedWindow())— which is the same value aslatestWindowEndon the line directly above it, and an instant that has already passed. It is the boundary that closed the window being served.Live right now, before this fix:
A buyer's scheduler keying on that field wakes at 16:00, re-pulls the identical
12:00slice, and spins until the real boundary arrives. The window starting at 16:00 is the one still filling, so there is nothing new to take until it closes — one window further on, at 20:00.Renamed to
nextWindowAvailableAtwhile the field is a day old and nobody is depending on it yet. "When a window opens" is not a fact any caller needs; it just happens to read like the answer to the question they were asking.The test asserts the property rather than a fixed timestamp — the served window's own end is in the past, the next slice's is in the future — checked at five offsets across a window, so it fails for any
nowand cannot be satisfied by the value it replaced.Full suite green on Node 22,
pnpm buildclean.🤖 Generated with Claude Code
https://claude.ai/code/session_01Pij2tFcRgqceMpheotFSoX