feat: a review posted from diffity marks the pull request handled, and handled pull requests stay listed - #105
Merged
Merged
Conversation
…d handled pull requests stay listed
## What
A pull request used to leave the inbox at the first poll after its review
was posted: GitHub's `review-requested:@me` search drops it, the daemon
retired the row as `hidden`, and nothing retired is listed. The inbox
never learned that the review had happened.
- `POST /api/github/create-review` — the one place diffity writes to the
forge — records a handled mark (`pr_id`, `head_sha`, `event`,
`review_url`, `at`) in the inbox store on a review GitHub accepted,
via the new `recordHandledReview`. A store that cannot be written is a
warning on the server's stderr, never a failed post, and an agent
posting through the route does not count as the reader reviewing.
- `inbox_handled`, an append-only log, with `PRAGMA busy_timeout = 5000`
so the posting server and the daemon's poll do not fail each other.
- New status `handled`, which is not retired: the row is re-polled every
tick, never prepared. The reconcile's not-requested branch keeps it
listed with what was said ("you approved") or what has happened since
("new commits since you approved"), while a dismissal, a bump's
preparation in flight and a fresh review not yet posted all keep their
own hold on the row. A re-request falls through to the queue.
- The tick also adopts a handled pull request it has no row for — one
reviewed from the reviewer's own clone — at one `gh pr view` each.
- A **Handled** section on the page and in `diffity inbox status`,
between Queue and Other: linked to the pull request itself (the
worktree is reclaimed), badged `updated` in the attention colour once
the author has pushed, with ↑ for a fresh review of the current head
and × to set it aside. `BUMPABLE` gains `handled`.
## Testing
The store's log and its cross-process visibility, every reconcile branch
(dismissed-and-handled, bumped-and-not-yet-posted, posted-after-bump,
re-request), the tick's re-poll, its one worktree reclaim, adoption and
merge retirement, the view's section membership and ordering, the page's
parse check, the create-review hook against a temp store, and the
`inbox status` output.
Closes #104
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01Bwp5QefjsjMFeq6CK6cT6w
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Bwp5QefjsjMFeq6CK6cT6w
…reaches the Handled list, and a failed re-preparation stays visible - The adoption pass takes a `hidden` row as well as a missing one, and hands that row to the reconcile as `existing`: a review posted after the request was withdrawn now turns the row `handled` instead of leaving it at "review no longer requested" forever. A `done` row stays out — a merged pull request would be re-asked every tick for the same answer. - `unadoptedHandledIds` replaces `handledIds`: one query for the pull requests no listed row carries, so the pass grows with what is left to adopt rather than with every review ever posted, and the tick needs no `get` per mark per poll. - A bumped preparation that failed on a handled row keeps its reason while the head is unchanged, as it does on a requested row, instead of snapping back to "you approved" at the next poll. The next push turns it back into "new commits since you approved". Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Bwp5QefjsjMFeq6CK6cT6w
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.
What
Every review diffity posts to GitHub now records a handled mark against its pull request — the head it was posted for, the verdict, the review URL — so the pull request stays listed instead of vanishing at the next poll, when
review-requested:@mestops returning it.POST /api/github/create-review, the one place diffity writes to the forge. It counts whichever diffity posted, including a session started on the reviewer's own clone. A store that cannot be written is a warning, never a failed post; an agent posting through the route does not count as the reader having reviewed.handled, not retired: re-polled every tick, never prepared. A handled row reads "you approved" and, once the author pushes, "new commits since you approved" — badgedupdated. A dismissal, a bump's preparation in flight and a fresh review not yet posted each keep their own hold on the row; a re-request puts it back in the queue.gh pr vieweach.diffity inbox status, between Queue and Other: it links to the pull request itself (the worktree is reclaimed), with ↑ for a fresh review of the current head and × to set it aside.Try it
npm run build node packages/cli/dist/index.js inbox status # Handled sectionOr post a review from a diffity session and watch the pull request move from Ready to Handled on the inbox page at the next poll instead of disappearing.
Closes #104
🤖 Generated with Claude Code
https://claude.ai/code/session_01Bwp5QefjsjMFeq6CK6cT6w