Skip to content

fix(daemon): act on an overdue review-due record nothing else will catch - #14

Merged
rt2zz merged 1 commit into
mainfrom
fix/daemon-review-due-wakeup
Oct 21, 2026
Merged

rt2zz merged 1 commit into
mainfrom
fix/daemon-review-due-wakeup

Conversation

@rt2zz

@rt2zz rt2zz commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

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 approve writes 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 what docs/review.md promises: 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

reviewDueAt takes a comingBack flag. 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 when comingBack is 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 check passes. bun run test: 287 passed, 23 skipped (integration tests not run). The reviewDueAt unit tests cover overdue on change with and without something already coming back.

🤖 Generated with Claude Code

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>
@rt2zz
rt2zz merged commit e1c516e into main Oct 21, 2026
1 check passed
@rt2zz
rt2zz deleted the fix/daemon-review-due-wakeup branch October 21, 2026 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant