Repository navigation
Inbox Reviews: server index of review threads - #2629
Merged
Merged
Conversation
Adds the per-thread review index (every thread with a review card: first and latest review message, round, latest verdict, the guide's source, updated time), a verdict-aware whose-move rule, and GET /api/inbox/reviews, which lists review threads merged with the PRs they own plus listed PRs flagged as not reviewed. Refused before any git/gh/glab runs while Code review is off. Review guide refs gain an optional source field; older reviews read it from their snapshot on read. No UI yet.
…ed and mentioned PRs - A review sent after the archive brings the thread back to Reviews. - Once the latest review has a verdict, the verdict decides whatever chat follows. - A thread whose PRs all merged or closed leaves Reviews (the list's merged PRs). - A URL link claims a PR only when the thread's review is of it (source PR, or its branch is the PR's head); an owner link always does. - A verdict on an earlier review card no longer answers the newest. - The source cache holds only the indexed threads' latest reviews, so no blob is read twice. Tests for each, and for a deleted thread leaving Reviews.
…h only on the person's own PR - A thread whose PRs all merged leaves Reviews only while its latest review is no newer than the latest merge; round 2 after the merge is listed. - inboxReviewIsOf matches a review to a PR by branch only for the person's own PR, from the repository itself (not a fork), never a long-lived branch (INBOX_PULL_LONG_LIVED, now exported from inbox-pulls). Failing-first tests for each (A, B1, B2, the branch rule).
# Conflicts: # docs/agent-guides/server-and-storage.md # packages/core/inbox-pulls.ts # packages/server/inbox.ts
This was referenced Nov 5, 2026
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.
This is PR 2 of about 7 for the approved Inbox Reviews page (DESIGN "Estimate", item 2, "Server index"). It adds the server side only. There is no UI yet.
What it adds:
A per-thread review index. It covers every thread where an agent sent a review card, whatever started the thread. For each one it records the first and latest review message, the round, the latest verdict, the person's latest answer, the guide's source (kind, repo, branch, base, PR) and the last update. The index is built from the messages on read. Nothing is stored and nothing is rewritten.
Whose move, using the verdict. A review waiting on the person is On you. Once the latest review has a verdict, the verdict decides, whatever chat follows it. Changes requested is With your agents. An approval is Ready to land, unless the forge still holds the person's own PR. A teammate's PR is never Ready to land. This fixes the audit finding that an approved linked PR stays On you.
GET /api/inbox/reviews. It returns:A thread owns a PR the person handed it, or a PR its review is of. A review is of a PR when its source names the PR, or when it reviews the head branch of the person's own PR: not a fork and not a long-lived branch like
main. A PR only mentioned in the thread stays its own row. A thread whose PRs all merged leaves Reviews, until a review newer than the merge arrives. An archived thread leaves Reviews until a newer review brings it back. While Code review is off, the endpoint refuses before any git, gh or glab runs.An optional
sourcefield on review guide refs. Older reviews get their source from their snapshot when the index reads them.The docs are in
server-and-storage.md(the API table) andinbox-files-and-guides.md("Reviews").Tests:
packages/core/inbox-reviews.test.ts,packages/server/inbox-reviews.test.ts.Follow-up (not in this PR, and it must land before the Reviews page PR): the PR list does not read closed PRs, and it reads merged PRs for only 14 days. After that, a thread whose PR landed no longer sees the PR and reads as a local review again. The fix is to record "landed" with the owner link.