Repository navigation
fix(daemon): act on an overdue review-due record nothing else will catch - #14
Merged
Merged
Conversation
An approval writes the next review's due time moments ahead. The daemon reads the review-due directory 500 ms after a change, by which point that time has passed, and a change ignored every overdue record so it would not override a retry already booked. With nothing booked, the review waited for the interval poll. A change now leaves an overdue record alone only when something already brings the peer back: a sync in flight, a booked round trip, or a backoff. Otherwise the round trip goes now. Co-Authored-By: Claude <noreply@anthropic.com>
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.
Problem
The daemon reads the review-due directory 500 ms after any change to it (
watchReviewDue). A"change"scan ignored every overdue record, so it wouldn't override a retry already booked for that peer.But an external
sidecar review approvewrites the next review's due time only moments ahead. By the time the debounced scan reads it, that time has passed. If the peer had no round trip booked, the record was ignored and the next review waited for the interval poll (10 minutes by default). That breaks whatdocs/review.mdpromises: the daemon "comes back for it when the floor passes even if nothing else happens".Found by Codex while reviewing #13; introduced in #12.
Fix
reviewDueAttakes acomingBackflag. It is true when a sync for the peer is in flight (its end re-checks the record), a round trip is booked, or the peer is in failure backoff (the interval poll ends that). On a change, an overdue record is left alone only whencomingBackis true; otherwise the round trip goes now. Due times still ahead,"start", and"after-sync"behave as before.Can this loop? A round trip booked now either clears the record, or ends in after-sync (a retry one debounce later), a failure backoff, or a family-busy rebooking. Each of those sets
comingBack.Tests
bun run checkpasses.bun run test: 287 passed, 23 skipped (integration tests not run). ThereviewDueAtunit tests cover overdue on change with and without something already coming back.🤖 Generated with Claude Code