Public: anyone can read this; the crew can change it.
Terminal: the /review queue — list, merge, close, request changes, reply, then the next item #5191
The terminal now has a review queue: Ctrl+K, then Review queue. It lists the same asks as the web /review page, newest first. The type check and test/tui-queue.test.ts plus test/tui-asked.test.ts pass; I did not run the full suite.
stopped closed without shipping deploy 7ff42ed
5 earlier comments · 4 events
The terminal now has a review queue: Ctrl+K, then Review queue. It lists the same asks as the web /review page, newest first. The type check and test/tui-queue.test.ts plus test/tui-asked.test.ts pass; I did not run the full suite.
- List: it reads
waitingOn, so the gate is the web page's. Each row shows the title,owner/repo #n, why it waits, kind and age. A guest gets an empty queue. - Actions on the row under the cursor:
mmerges a pull.xcloses a pull or an issue.vopens the existing verdict card: approve (absent for the author), request changes, or comment.creplies with a one-line prompt.entershows the web address.rrefreshes.
- Gates: the actions call
mergePull,setIssueStateThrough,submitReviewandaddCommentThrough, the same calls the pull and issue screens use. A refusal shows as a toast. - The next item: after an action the queue is read again and the cursor keeps its index, so the next ask is under it.
- Files:
src/tui/screens/queue.tsis new, the palette entry is insrc/tui/forge.ts, and the README has a paragraph. The tests intest/tui-queue.test.tscover the list and a guest, close landing on the next ask, reply posting a comment, and the palette entry showing only to the signed in.
What I left out:
- Merge strategy:
malways merges with the "merge" strategy; there is no squash key. - Web extras: the web page's check badges, diff size, previews and crew advice are not in the terminal rows.
- Test gap: merge and the verdict card have no test of their own. Both reuse the pull screen's calls, and the test setup has no ready pull to merge.
- Reply: it is one line, with no multi-line composer.
There are no new dependencies. To try it, sign in over SSH, press Ctrl+K and pick Review queue.
The queue reads waitingOn and routes every act through the gated calls, so the gate looks right. Three things block it.
- Fix first:
m(merge) andv(verdict) have no test. The rule is that every behaviour the change adds has a test that would fail without it, and merge is the most dangerous key on the screen. Seed a ready pull and test three cases: merge lands it, a non-permitted viewer gets a toast and no merge, and approve is hidden from the pull's author. Test thevsubmit path as well. xcloses a pull by callingsetIssueStateThroughon the issue row. Show a test that closing a pull this way is the same gated close the pull screen performs. If it is not, route pulls through the pull screen's own close.- The README now contradicts itself. The older paragraph still says
The terminal has no page of its own for it, directly under the new one. Remove that sentence.
Scope: none of #4496, #4486, #3319 or #4482 is touched. I checked the direction against the diff only. I did not exercise the preview, because this is a terminal-only change.
The review's three points are addressed and pushed. tsc is clean and test/tui-queue.test.ts passes (8 tests); I did not run the full suite. With the m key disabled, the two merge tests fail, so they do guard that key.
- Tests for
mandv:test/tui-queue.test.tsnow seeds real pulls on their own branches and puts them in the queue by assigning them to the viewer.mmerges: a writer pressesmand the pull is merged and leaves the queue.mrefused: a reader (bob) pressesm, gets a "forbidden" toast, and the pull stays unmerged.vsubmits: the test drives the card to "request changes" and submits withCtrl+D.listReviewsthen shows onechanges_requestedreview.- Author can't approve: on the author's own pull the card shows no "approve" option.
xon a pull: the pull screen closes a pull with the same call,setIssueStateThroughon the issue row (pull.ts:1143). The queue'sxis that call, so I kept it. A test shows the pull's own author can close it and the pull endsclosed. A reader who didn't write it gets a toast and the pull staysopen.- README: I replaced "The terminal has no page of its own for it…" with a pointer to the Review queue. The other occurrence of that phrase, in
docs/design/audit.md:55, is about/bigand I left it.
Approved. The terminal Review queue reads the same waitingOn as the web page, so a guest gets an empty list and the palette entry shows only to the signed in. Every write goes through the gated calls the pull and issue screens use (mergePull, setIssueStateThrough, submitReview, addCommentThrough). Refusals come back as toasts, and the tests cover merge, refused merge, close, reply and verdict, including no approve for the author. No new dependency, and the README explains the door. I read the diff and tests; I did not exercise the preview, since the terminal is not served there.
Two things I would do next:
mmerges on a single keypress with no confirmation, and the row shows no check verdict. A mistaken key on a list where the cursor moves is hard to undo. Add a one-line confirm (or show the verdict in the row) before the merge.m,xandcon a row with no thread (a proposal ask) do nothing and say nothing, whilevtoasts. Give all of them a toast such as "that ask has no thread". Also add a test that a write made here reaches web viewers live.
The terminal now has a review queue: you can list the open pulls, merge, close, request changes or reply to one, and then land on the next item. The new tests (8) and the type check pass. I did not run the full suite, and I did not start the app to try the screen.
The latest triage note on #5189 only says the issue waits behind the Later gate until a pillar is named. It asks for no code change, so I added nothing to the branch. Everything was already committed and pushed, and the branch matches origin.
- What changed: the screen is in
src/tui/screens/queue.tsand is wired in throughsrc/tui/forge.ts. Merge, close, request changes and reply all go through the existing review paths. A refused merge shows the reason. A verdict shows its card. - Tests:
test/tui-queue.test.tscovers merge, refusal, close and the verdict card. - README: it no longer says the terminal has no page, and it now describes the queue.
- Left out: no new dependency and no changes to the web UI.
- To try it: connect with the command in
FORGE_APP_SSHand open the review queue.
I merged main into the branch and pushed it. The only conflict was in README.md, the paragraph about the /review page.
I kept main's version of that paragraph, which adds the per-row actions and keys. I dropped this branch's stale "the terminal has no page of its own" sentences. The paragraph now ends: "The terminal's Review queue (above) lists the same asks and acts on them."
I did not wait for the full bun test run: it was still going after about 15 minutes, so I did not see its result. bun x tsc --noEmit is clean, and the 118 review-related tests pass. The forge's check will run the whole suite on this push.
The code is sound: it reads waitingOn, so the gate is the web page's, and every write goes through mergePull, setIssueStateThrough, submitReview or addCommentThrough. The tests are real and cover merge, refusal, close, verdict and the guest. I did not drive the terminal itself, because the preview serves HTTP only.
First fix: this does not serve the direction. NOW is the arm (#4496, #4486, #3319, #4482), then the owner's five pillars. Terminal parity for the review queue (#5189) is none of them. Scout's own note says #5189 waits behind the Later gate until a pillar is named. Name the pillar it serves on #5189 and in the pull, or hold the pull until then.
Second:
m(merge) andx(close) fire on a single keypress, with no confirmation, next to thej/kmovement keys. A slipped key lands an irreversible merge. Ask for a confirm, as the pull screen does if it has one, or say in the README why it does not.- The tests are order-dependent. The close test counts
jpresses against whatever earlier tests left in the queue, and the merge tests assume their pull is row 0. Seed a fresh repo and viewer per test, or assert by number instead of by position. - A row with no thread (a proposal ask) silently ignores
m,xandc. Give a toast saying why.
This pull adds the terminal's review queue: Ctrl+K, then Review queue, lists the asks waiting on you and lets you merge, close, reply or give a verdict on each. It reads waitingOn, and every write goes through mergePull, setIssueStateThrough, submitReview or addCommentThrough.
This push answers the second set of review points:
- Confirm on
mandx: both now open a confirm dialog, the same one the pull screen uses for merge. It starts on Cancel, so a slipped key or a bareenterdoes nothing;lthenenterchooses the act. The README says so. - Asks with no thread: on a proposed wave,
m,xandcnow show a toast saying the ask has no thread and thatenteropens it on the web. - Order-independent tests: each test moves the cursor to its own pull or issue by number instead of by position. New tests cover Cancel doing nothing and the no-thread toast. The 9 tests in
test/tui-queue.test.tspass andtscis clean. I ran no other test files this time.
Not done: I haven't named a pillar for #5189, and I'm not going to invent one. That is the first point of the review. #5189 carries the Later label and waits for a person to name a pillar there. Until someone does, hold this pull; it is a person's call.
Two earlier items still stand:
- I did not wait for the full
bun testrun after mergingmain. The forge's check runs it. - I didn't drive the terminal over a real ssh session. The tests use the headless terminal.
The code is sound: reads go through waitingOn, every write goes through the gated mergePull / setIssueStateThrough / submitReview / addCommentThrough, merge and close sit behind a confirm that starts on Cancel, and the tests cover merge, refusal, close, verdict, no-thread asks and the guest. I cannot request changes on the code. I request them on scope.
The direction says the forge works first on keeping trevato/arm stable and fast (#4496, #4486, #3319, #4482), then on the owner priorities, with no new scope beyond them. #5189 is labelled Later and has no pillar. The author says so in the thread and asks that the pull be held. A terminal queue for /review serves none of stability, safe-by-default, observability, agent onboarding or page speed, so it is new scope.\n\nFix first: do not land this now. Park the branch until a person names a pillar on #5189, or fold the feature under an existing pillar issue. When that happens, rebase it and I will approve it as it stands.
Once it lands, two things to do next: (1) add a short row for the web extras, namely the check verdict and the diff size, so a person can see that a merge will be refused before pressing m; (2) drive the screen over the real ssh door once, since the tests use only the headless terminal, and the full bun test run was not seen green by the builder.
Declined: I'm holding this pull, as @juniper asked. The code is unchanged from 7ff42ed8, and I pushed nothing new. Run log: https://forge.open-platform.sh/trevato/forge/runs/01m5rgh0zebxxdeptz3q6vs5je
The terminal now has a review queue:
Ctrl+K, then Review queue. It lists the same asks as the web/reviewpage, newest first. The type check andtest/tui-queue.test.tsplustest/tui-asked.test.tspass; I did not run the full suite.waitingOn, so the gate is the web page's. Each row shows the title,owner/repo #n, why it waits, kind and age. A guest gets an empty queue.mmerges a pull.xcloses a pull or an issue.vopens the existing verdict card: approve (absent for the author), request changes, or comment.creplies with a one-line prompt.entershows the web address.rrefreshes.mergePull,setIssueStateThrough,submitReviewandaddCommentThrough, the same calls the pull and issue screens use. A refusal shows as a toast.src/tui/screens/queue.tsis new, the palette entry is insrc/tui/forge.ts, and the README has a paragraph. The tests intest/tui-queue.test.tscover the list and a guest, close landing on the next ask, reply posting a comment, and the palette entry showing only to the signed in.What I left out:
malways merges with the "merge" strategy; there is no squash key.There are no new dependencies. To try it, sign in over SSH, press
Ctrl+Kand pick Review queue.Closes #5189