Skip to content

feat: a review posted from diffity marks the pull request handled, and handled pull requests stay listed - #105

Merged
fiddur merged 2 commits into
developfrom
inbox-handled
Sep 8, 2026
Merged

feat: a review posted from diffity marks the pull request handled, and handled pull requests stay listed#105
fiddur merged 2 commits into
developfrom
inbox-handled

Conversation

@fiddur

@fiddur fiddur commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

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:@me stops returning it.

  • The mark is written by 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.
  • New status 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" — badged updated. 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.
  • The tick adopts a handled pull request it has no row for, at one gh pr view each.
  • New Handled section on the page and in 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 section

Or 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

fiddur and others added 2 commits September 8, 2026 15:21
…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
@fiddur
fiddur marked this pull request as ready for review September 8, 2026 13:32
@fiddur
fiddur merged commit 6ffd5d2 into develop Sep 8, 2026
2 checks passed
@fiddur
fiddur deleted the inbox-handled branch September 8, 2026 13:32
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.

Inbox: a review posted from diffity marks the pull request handled, and handled pull requests stay listed

1 participant