Skip to content

Review Desk: PR factory and a diffmap Map tab - #5

Merged
ishandhanani merged 15 commits into
mainfrom
review-desk/pr-factory
Nov 2, 2026
Merged

ishandhanani merged 15 commits into
mainfrom
review-desk/pr-factory

Conversation

@ishandhanani

@ishandhanani ishandhanani commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner

Turns Review Desk into a PR factory: paste a PR link and it moves itself from AI review to your review to CI babysitting. The PR page is rebuilt around a diffmap walkthrough.

This branch builds on #2 (the PR board) and includes it, so merging this supersedes #2.

PR factory

paste link ─► AI review ── round 1 posts "### Round 1 AI review" (COMMENT, under your gh login)
                 │  each settled push runs a targeted round over what the PR itself changed,
                 │  and marks earlier findings fixed / open / obsolete (fixed threads get resolved)
                 ▼  after aiReviewMaxRounds (2), or as soon as a round leaves only nits
            Human review ─► your approval ─► Babysit (small model re-runs flaky CI; never pushes)
                         └► your comment  ─► Changes requested ─► author pushes ─► Human review
  • Reviewer: discovers and uses the review skills it has, both yours and the repository's (CLAUDE.md, AGENTS.md, project skills). Only the output contract is fixed. The optional settings aiReviewSkills and aiReviewEmpirical add to this.
  • Incremental rounds: they compare the PR's diff before and after, not head to head. A merge from main no longer drags main's changes into the round.
  • Hand-offs: each hand-off surfaces the thread unread in the sidebar. It can also post to a Slack incoming webhook, or to an event webhook as signed JSON.
  • Sidebar: every thread Review Desk starts goes in a "Review Desk" section (threadSection).
  • Board: new columns Unreviewed, AI review, Human review, Changes requested, and Babysit. A card's brain button runs the next round now. bb review-desk factory start|stop|show|ping|resolve.

PR page: Map, Diff, Comments

  • Map (default): diffmap's own viewer. The helper writes the spec with the bundled generate-diffmap skill (MIT). The host builds diffmap's static gist app once at a pinned commit with a three-line patch, and the server serves it from plugin routes along with a gist.json built from the worktree with diffmap's own source. diffmap's reference checks feed back to the helper, up to 2 fixes per map. Text shows the spec as Markdown.
  • Diff: commits and file cards. Comments: description and discussion.
  • Removed: the tree-sitter codemap, the Codemap tab, the brief, the guide, and symbol pills. Their tables stay declared for the append-only migrations.

Fixes found on the way

  • Approvals: a reviewer's approval no longer disappears when they later comment. Approval state now comes from each reviewer's latest decision, not gh's latestReviews.
  • Card moves: submitting a review re-syncs right away, so the card moves without waiting for the 15-minute refresh.

Validation

  • Live run on [Fix] scheduler: Publish KV metrics when idle sgl-project/sglang#45785:
    • Round 1 posted 2 majors.
    • After a push that merged main, round 2 reviewed 3 files and 2 commits rather than main's 22 files and 7 commits. It marked both majors fixed and handed off.
    • Thread auto-resolve worked.
    • Approval moved the card to Babysit. The babysitter correctly reported the 5 failures as missing-label gates.
  • Map tab: the viewer builds in about 17s on first load (410 files). The #45785 map rendered in the bb UI in headless Chromium with no page errors, after one diffmap-driven fix.
  • Types: npx tsc -p . --noEmit is clean.

Summary by CodeRabbit

  • New Features
    • Added a pull-request board with review stages, drag-and-drop card movement, status updates, and options to add PRs or start AI reviews.
    • Added a Map tab for PR walkthroughs, with maps generated when PRs are added and refreshed for new commits when automatic mapping is enabled.
    • Added Diff and Comments tabs, plus commit views. File diffs are path-ordered, collapsed by default, and wrap long lines.
    • Comments start with their original text; individual comments can show an available rewrite or request one.
  • Documentation
    • Updated setup, settings, and command-line guides for the board, maps, and review workflows.

ishandhanani and others added 15 commits October 12, 2026 01:00
bb plugin types repinned @get-bb/plugin-sdk from 0.4.47 to the running bb's
0.6.39; tsc against the new declarations flagged the removed composer view
and insertMention/updateText methods, replaced in the next commit.
…of bb storage

The Reviews page is now a board of the pull requests you track. Paste a link
and the PR becomes a card under Unreviewed, Changes requested, Approved, or
Done (merged or closed). The column follows GitHub: the review decision, or
the latest review per reviewer when the repository has no required reviews
(gh reports that as an empty decision); REVIEW_REQUIRED stays Unreviewed even
with approvals because a required reviewer is still missing. Drag a card to
hold it elsewhere; it follows GitHub again once GitHub's state changes
(board_stages keeps the stage with the auto stage it was dragged from).

Cards show the title, owner/repo #N, author, last GitHub activity, and chips
for what is in the way: checks passed/total (red when one fails), unresolved
threads, approvals, reviewers asking for changes, merge conflicts, and
pending comments. Clicking a card opens the PR page as before. Columns wrap
into a grid (2x2 beside bb's side panel, 4 across when wide).

Sync: the board syncs open PRs when it opens if they are more than ten
minutes stale, on Refresh, and on the boardRefresh cron (default every 15
minutes); a sync skips the git fetch when the head did not move. New RPCs
board_move and board_refresh; reviews_list carries the card fields. CLI:
bb review-desk board | move <id> <stage|auto> | refresh.

Worktrees now live under ~/.review-desk/worktrees (setting worktreesDir)
instead of the plugin's host data dir: bb 0.46 refuses to spawn a thread into
an unmanaged path inside its own storage (HTTP 409), which broke the brief,
guide, and chat. repo_prepare takes fetch: false to keep a worktree in place
without the network, removes a clean legacy worktree on the way out, and the
server forgets environments bound to a moved path.

Composer pills use the current insert API (useComposerView, insertMention,
and updateText are gone from the SDK).

Validated on this server with ai-dynamo/dynamo#15599, #15600, #15164: columns,
drag and unpin round trip in a headless browser, refresh in 3 s, worktree
migration, and a brief written by the helper after the move.
Columns are now Unreviewed, Changes requested, and Babysit. Any approval
(the decision, or a reviewer's latest review) puts an open PR in Babysit:
approved by you or others, now watching CI until it merges. A Babysit card
leads with CI: a bar of passed checks, the failing checks by name linking to
their runs, one verdict chip (merge conflicts, CI failing, CI running, needs
a required review, still a draft, or ready to merge), and when the last
commit was pushed. Merged and closed PRs leave the columns (stage null) and
fold into a strip under them with Remove and Remove all.

The board moves out of app.tsx into board.tsx (BoardPage takes an onOpen
callback) and timeAgo/describeError into lib/format.ts, so the board and the
review page stop sharing one file. The summary gains failingChecks and
lastCommitAt; board_move refuses a merged or closed PR; refresh syncs open
PRs and only keeps the worktrees of the others in place.
A clean worktree goes with the card; one with local changes is kept and
logged. Eight of ten worktrees on this host (2.4 GB) belonged to PRs no
longer on the board.
The Brief tab is now just "What it does": the helper writes the summary as a
Markdown bullet list, one bullet per behavior change, followed by the areas
list. The slop meter and its deterministic signals (slop.ts, the signals
columns' use, notes_from_signal, "Clear signal notes") are gone, as are the
"Claims versus diff" and "The helper's read" sections and the matching
fields in brief-spec and the brief prompt. The "Find slop and cleanups"
helper notes stay; the signal source stays in the note enums so existing
rows still load.

Defaults when a PR opens: the Changes list is in path order (guide order is
still a switch away), diffs render split, long lines soft-wrap (Pierre
overflow "wrap") instead of scrolling sideways inside each card, and every
file starts collapsed; Expand all, a card toggle, or a jump from the brief
or codemap opens one. The top-bar Simple English toggle is removed; every
comment starts on the original and keeps its own switch.

Validated with tsc, bb plugin build, and a reload of the running plugin.
…CI babysitter

A PR added to the board enters AI review. A hidden reviewer thread runs
round 1 with the review skills it has (its own and the repository's) and
the server posts the result to GitHub as a COMMENT review headed "Round N
AI review". Each settled push runs a targeted round over the new commits
that also decides which earlier findings are fixed, open, or obsolete.
After aiReviewMaxRounds (2), or as soon as a round leaves only nits, the
PR moves to Human review and the reviewer thread surfaces unread in the
sidebar. Your own non-approving review moves it to Changes requested until
the author pushes; an approval moves it to Babysit, where a small model
re-runs flaky CI and hands anything needing a push back to you. It never
pushes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… conversation

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ds you

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Lets a Devin automation (webhook trigger, Message session into a Slack-synced
session) relay factory events to Slack and answer follow-ups there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…not head to head

A merge from the base branch put all of main's changes into git diff
<prev head> <head> (22 files and 7 commits instead of the PR's 3 files and
2 commits on sglang#45785).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ater comments

- A round that marks a finding fixed or obsolete replies on and resolves the
  factory's own inline thread (bb review-desk factory resolve backfills).
- Reviewers come from each person's latest decision, not gh's latestReviews:
  a comment-only review after an approval (a thread reply) hid the approval
  and dropped sglang#45785 out of Babysit.
- The human-review check ignores empty comment-only reviews, so the
  factory's own thread replies no longer read as your review, and an
  approval wins.
- Submitting a review re-syncs the PR right away, so the card moves without
  waiting for the board refresh.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…, default "Review Desk")

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The PR page is three tabs: Map (a diffmap walkthrough of the PR, first and
default), Diff (commits and file cards), and Comments (description and
discussion). The helper writes the map with diffmap's own generate-diffmap
skill, now bundled under skills/ (MIT), and returns the spec, which is kept
per head; an older map stays on screen while a newer one is written. For now
the Map tab shows the spec as Markdown.

Removed: the tree-sitter codemap (host builder, contract, wasm dependency,
symbol pills), the Codemap side tab, the brief, the guide and guide order,
and their settings, RPCs, and CLI commands. Their tables stay declared so
existing databases still match the append-only migrations.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The host builds diffmap's static gist app once per pinned commit (clone,
a three-line patch, npm ci --ignore-scripts, vite build) in its data dir.
The server mounts the built files on exact-match GET routes under
/diffmap/ and answers the viewer's one data request, gist.json?review=,
with the payload diffmap share would publish, built on the review's
machine from the spec and the worktree with diffmap's own source. The
Map tab frames it; Text shows the spec as Markdown, which is also the
fallback while the viewer builds.

diffmap checks every reference against the repository. A spec it rejects
goes back to the helper with the error, up to two times per map; the map
prompt also spells out the reference forms (a single sha is one commit,
base..head is the PR).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Caution

Review failed

The pull request is closed.

Walkthrough

The pull request adds a PR board, AI review and CI babysitting specifications, and a Map and Diffmap workflow. It updates the review page and removes the Brief, Guide, Codemap, and slop-scoring features.

Changes: Review Desk workflows

Layer / File(s) Summary
Board stages and PR management
review-desk/board-spec.ts, review-desk/board.tsx, review-desk/app.tsx, review-desk/lib/format.ts, review-desk/README.md, review-desk/PLUGIN_OVERVIEW.md
Adds board stages and PR-factory pipeline stages. The board loads and refreshes reviews, supports PR submission, stage moves, removal, and AI-review launch, and displays review and CI status. The app opens the board page.
AI review and CI babysitting
review-desk/factory-spec.ts, review-desk/board.tsx
Defines AI review prompts, reply parsing, finding formatting, and CI babysitting outcomes. Board cards display factory status and can start an AI review.
Map and Diffmap workflow
review-desk/app.tsx, review-desk/host-contract.ts, review-desk/diffmap-toolkit.ts, review-desk/skills/generate-diffmap/*, review-desk/README.md, review-desk/package.json
Adds Map state loading and display, Diffmap host RPCs and payload generation, and a skill describing spec authoring and sharing. Updates the SDK dependency and removes the tree-sitter dependency.
Review page updates and retired features
review-desk/app.tsx, review-desk/host-contract.ts, review-desk/brief-spec.ts, review-desk/guide-spec.ts, review-desk/slop.ts, review-desk/README.md, review-desk/PLUGIN_OVERVIEW.md
Updates review tabs, file ordering, diff wrapping, comment rewrite controls, and composer insertion. Removes Brief, Guide, Codemap, and slop-scoring code and updates related descriptions.

Estimated code review effort: 4 (Complex) | ~60 minutes

Change: Feature

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@ishandhanani
ishandhanani merged commit c89414b into main Nov 2, 2026
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