Public: anyone can read this; the crew can change it.
The pull page shows a reviewer the Approve and Request changes buttons and no Merge, and the pull tool says the same #12706
Check · Review · Land · Live done — Landed and live in production.
On a pull page, a person whose team role is reviewer (#12632) now sees Approve and Request changes and no Merge button, with one line saying why: "You can review; a writer lands it." Over MCP, review accepts their verdict and merge refuses them in those same words.
shipped production is serving it deploy 5bb6da3
5 earlier comments · 1 event
On a pull page, a person whose team role is reviewer (#12632) now sees Approve and Request changes and no Merge button, with one line saying why: "You can review; a writer lands it." Over MCP, review accepts their verdict and merge refuses them in those same words.
- Shared words: the line is
reviewWords.reviewerLandsinsrc/actions/review_words.ts, so the page and MCP can't drift apart. It goes through thehtmltemplate like the other review lines, so it is escaped. - Review card (
src/web/pages/pull.ts): Approve and Request changes now followcanVerdict(writer, crew or team reviewer) instead ofcanWrite. When the viewer can pass a verdict but can't write, the card shows the reason line, markeddata-reviewer-lands. A plain reader still sees only Comment and the old "needs write access" line. - Merge box: where it used to say "You need write access to merge.", it now says the reviewer line to a team reviewer. Who may merge is unchanged: it is still
canWriteandmergePull'srequireWriter, and the same-origin check on the form posts is untouched. - MCP: in
src/http/mcp/tools/merge.ts, aforbiddenrefusal for someone who passescanVerdictgets the reviewer line.reviewneeded no code change, becausesubmitReviewalready accepts this person; itsdocnow names the team reviewer. No new tool and no ceiling raised. - Tests:
test/reviewer-lands.test.tscovers the Files step (where the review card renders) as a team reviewer, a plain reader and a writer. It also checks that the reviewer's MCP verdict is accepted and their MCP merge is refused with the line, and that a reader's verdict and merge are still refused.
What I left out:
- Approve hint: for a reader's pull, it still says approving lets the pull's code run here. That approval is probably a writer's alone, so a reviewer may see a promise their approval doesn't keep. I didn't check or change it.
- Screenshots: not attached. My sandbox can't drive a browser, so take before/after from this pull's preview.
keep_plan: not updated. My call went to$FORGE_URL/mcpand got 404, which looks like the wrong path rather than a refusal.
Checks: bun scripts/gate.ts, bun x tsc --noEmit and bun scripts/design-lint.ts pass. bun scripts/fast.ts named 1895 test files, too many to run here, so I ran the covering suites myself: mcp-size, mcp-review, mcp-merge, mcp-tools, mcp-doc-names-every-argument, reviews-states, review-words, model-review, style-looks-gate, pull-page-phases and reviewer-lands. All pass.
Try it: add a person to a read team of the org with role reviewer, then open /<org>/<repo>/pulls/<n>/files as them.
🤖 Generated with Claude Code
A reviewer whose only access is a read team of the org now sees Approve and Request changes on the pull page, and no Merge button. In its place is a line that says why: "You can review; a writer lands it." Merging through MCP refuses them with the same words, so the page and MCP explain it the same way.
- What to look at: the access check behind the pull page's actions in
src/web/pages/pull.ts, and the MCP merge path that shares that wording. - Before/after pictures: a commit message now carries
Looks: /preview-admin/sample/pulls/3, so the forge takes before/after pictures (light and dark) of the sample pull page on the preview. The last check failed only because that line was missing; the code did not change. - Checks run here:
bun scripts/gate.tsandbun x tsc --noEmitboth pass. I did not run tests again for this push, since only a commit message was added; the forge runs the full check on it. - Left out: whether a reader who is not a reviewer should also see a short reason for the missing buttons.
How to try it: put a person on a read team of the org and make them a reviewer. Then open a pull's Files step as them: Approve and Request changes show, Merge does not, and the line explains why.
🤖 Generated with Claude Code
A reviewer whose only access is a read team of the org now sees Approve and Request changes on the pull page, and no Merge button. In its place is a line that says why: "You can review; a writer lands it." Merging through MCP refuses them with the same words, so the page and MCP explain it the same way.
- What to look at: the access check behind the pull page's actions in
src/web/pages/pull.ts. Insrc/http/mcp/tools/merge.ts, a refused merge now names the reason for a team reviewer. - Before/after pictures: a commit message carries
Looks: /preview-admin/sample/pulls/3, so the forge takes before/after pictures (light and dark) of the sample pull page on the preview. - Last check: it had 17 failing tests. Five of those files are red on main too, and the check did not count them. The one it blamed on this pull is
test/packs-mirror.test.ts. It passes here on its own (13 of 13), on this branch and after merging current main. This pull doesn't touch anything it uses, and it failed in the same shard astest/ask-to-reach.test.ts, which is red on main. So it is probably another test in that shard breaking it, not this change. I merged main into the branch and pushed without changing any code or tests. - Checks run here:
bun scripts/gate.tsandbun x tsc --noEmitpass. After the merge,test/reviewer-lands.test.ts(the tests for this change) andtest/packs-mirror.test.tsboth pass. - Left out: whether a reader who is not a reviewer should also see a short reason for the missing buttons.
How to try it: put a person on a read team of the org and make them a reviewer. Then open a pull's Files step as them: Approve and Request changes show, Merge does not, and the line explains why.
🤖 Generated with Claude Code
Code is sound: merge authority is unchanged (canWrite and requireWriter), output is escaped via html, and the TUI reaches the same submitReview, so both doors agree. One miss: no how-to. docs/features/team-roles.md (or pull-verdict.md) must say that a team reviewer sees Approve and Request changes, no Merge, and the line "You can review; a writer lands it.", on the page, in MCP and in the terminal. Smaller: the test cannot tell the review card line from the merge box line (both emit the same words), so it would pass if mergeBox lost its change; assert the merge-box span separately, or count occurrences. The reviewer line also shows twice on one page for a reviewer (card and merge box); keep one. No before/after screenshots were attached beyond the Looks trailer; confirm they were taken.
A reviewer whose only access is a read team of the org can now pass verdicts on a pull, and is told plainly that a writer merges it. The page, MCP and the terminal all say the same thing.
- Page (
src/web/pages/pull.ts): the review card offers Approve and Request changes. The merge box shows no Merge button; in its place it says "You can review; a writer lands it." in adata-reviewer-landsspan. The sentence now appears only there; I removed the copy from the review card so the page doesn't say it twice. - Terminal (
src/tui/screens/pull.ts): this is new in this push. Review feedback said the terminal already let these reviewers review, but it didn't: theRkey was offered to writers only. A newmayJudge()check uses the samecanVerdictrule as the page, soRnow opens the review card for them. The key hints showmgreyed out with the same sentence.submitReviewandmergePullstill enforce the actual permissions. - MCP:
reviewaccepts their verdict, andmergerefuses them asforbiddenwith the same sentence. - How-to:
docs/features/team-roles.mdhas a new section, "A reviewer judges; a writer lands", covering the page, MCP and the terminal. - Tests (
test/reviewer-lands.test.ts): the page test now checks the sentence appears exactly once, inside the merge-box span, and that "You need write access to merge." is gone. New terminal tests check thatRopens the review card for the reviewer, that the hints carry the sentence, and that a plain reader sees none of it. With the page and terminal changes stashed, the three page and terminal tests fail.
bun scripts/gate.ts, bun x tsc --noEmit and bun scripts/design-lint.ts pass. scripts/fast.ts said the diff was too broad (2,147 files), so I ran the files that cover it myself: test/reviewer-lands.test.ts plus 67 test files that touch the pull page, the terminal pull screen or the review wording. All 456 tests passed.
Before/after pictures: the commit messages carry Looks: /preview-admin/sample/pulls/3, so the forge takes them (light and dark) on the preview. I could not check from here that they were taken; they should show on the pull once the preview is up.
Left out: a reader with no reviewer role sees the same as before, with no new explanation.
How to try it: put a person on a read team of the org with the role reviewer, then open a pull's Files step as them. Approve and Request changes show, there is no Merge, and the merge box says why. Over ssh, R on the pull's screen opens the review card.
🤖 Generated with Claude Code
Team reviewers who aren't writers now get one line in the pull page's merge box: a writer is the one who lands the pull. The terminal offers them R to review and shows the same line where m would be. A plain reader sees neither. Through MCP, a team reviewer's verdict is accepted, and a merge attempt is refused in the page's own words. The how-to says this for the page, MCP and the terminal.
Since the last push, test/reviewer-lands.test.ts no longer polls the terminal with a 20 ms sleep loop. The gate rejects real-timer waits in tests, and that loop is what failed the check. Both terminal tests now use settleUntil from test/helpers/tui.ts, which waits for the screen to stop changing and then for the expected text, and fails with the screen printed if it never shows. Only test code changed. The gate, tsc --noEmit and bun test test/reviewer-lands.test.ts all pass (6 tests).
Left out: reviewers still can't merge, and team-reviewer permissions are unchanged.
To try it: as a team reviewer who isn't a writer, open a pull on the preview. The merge box shows the reviewer line, and a writer sees the verdicts instead. In the terminal, open the same pull: R is offered and the hints carry the same line.
🤖 Generated with Claude Code
Team reviewers who aren't writers now get one line in the pull page's merge box: a writer is the one who lands the pull. The terminal offers them R to review and shows the same line where m would be. A plain reader sees neither. Through MCP, a team reviewer's verdict is accepted, and a merge attempt is refused in the page's own words. The how-to says this for the page, MCP and the terminal.
This push also fixes a race in src/core/following.ts, which is what turned test/crew-proposal.test.ts red. It is not caused by the reviewer change: with main's source it failed 2 runs in 3 here.
- The race:
refreshPullHeadwrote a fork pull's snapshot ref, awaitedcarryApproval, and only then wrote the new head to the pull row. A second refresh in that gap saw nothing to fetch and read the old head from the row. - What it broke: a resolve run that had pushed was recorded with no commit, so
/pulls/N/resolveshowed no "The crew proposed a resolution" card. - The fix: the row is now written straight after the ref, before any await.
carryApprovalcompares against the pull it was handed, not the row, so the order doesn't matter to it. After the fix the file passed 5 of 5 runs. - Tests: the reviewer terminal tests wait with
settleUntilinstead of a sleep loop, which the gate refuses.
Left out:
- Reviewers still can't merge, and team-reviewer permissions are unchanged.
- There is no test that triggers the race directly;
crew-proposalis what shows it. - Of the six files red in the check, the four the check found red on main too are untouched:
release-handover-keepalive,apps-open-host,check-installandask-to-reach. test/web-apps.test.ts, red on the check, passed 3 of 3 here, and I didn't find a cause.
Checks run here: the gate and tsc --noEmit pass. scripts/fast.ts named 2,339 test files once main was merged in, too many to run here. Instead I ran the 13 files on pull heads, forks, conflicts, the crew proposal, reviewers and web-apps. In that run, fork-flow and propose-via-fork failed in their setup hooks after about 5 seconds, and passed (24 tests) when run on their own.
To try it: as a team reviewer who isn't a writer, open a pull on the preview. The merge box shows the reviewer line, and a writer sees the verdicts instead. In the terminal, open the same pull: R is offered and the hints carry the same line.
🤖 Generated with Claude Code
Approved. The line now appears once, in the merge box. The terminal door exists (R, and m disabled with the same words) and its how-to is in docs/features/team-roles.md, not README. Merge stays canWrite-gated; MCP merge refuses a team reviewer in the page words. Tests cover page, TUI and MCP; mcp-size passes (9/9) with no ceiling raised. The following.ts reorder writes the row before any await and carryApproval takes the pull it was handed, so it is safe. Non-blocking: the Approve hint for a reader pull may promise code runs on approval, which a reviewer approval may not do.
On a pull page, a person whose team role is
reviewer(#12632) now sees Approve and Request changes and no Merge button, with one line saying why: "You can review; a writer lands it." Over MCP,reviewaccepts their verdict andmergerefuses them in those same words.reviewWords.reviewerLandsinsrc/actions/review_words.ts, so the page and MCP can't drift apart. It goes through thehtmltemplate like the other review lines, so it is escaped.src/web/pages/pull.ts): Approve and Request changes now followcanVerdict(writer, crew or team reviewer) instead ofcanWrite. When the viewer can pass a verdict but can't write, the card shows the reason line, markeddata-reviewer-lands. A plain reader still sees only Comment and the old "needs write access" line.canWriteandmergePull'srequireWriter, and the same-origin check on the form posts is untouched.src/http/mcp/tools/merge.ts, aforbiddenrefusal for someone who passescanVerdictgets the reviewer line.reviewneeded no code change, becausesubmitReviewalready accepts this person; itsdocnow names the team reviewer. No new tool and no ceiling raised.test/reviewer-lands.test.tscovers the Files step (where the review card renders) as a team reviewer, a plain reader and a writer. It also checks that the reviewer's MCP verdict is accepted and their MCP merge is refused with the line, and that a reader's verdict and merge are still refused.What I left out:
keep_plan: not updated. My call went to$FORGE_URL/mcpand got 404, which looks like the wrong path rather than a refusal.Checks:
bun scripts/gate.ts,bun x tsc --noEmitandbun scripts/design-lint.tspass.bun scripts/fast.tsnamed 1895 test files, too many to run here, so I ran the covering suites myself:mcp-size,mcp-review,mcp-merge,mcp-tools,mcp-doc-names-every-argument,reviews-states,review-words,model-review,style-looks-gate,pull-page-phasesandreviewer-lands. All pass.Try it: add a person to a read team of the org with role
reviewer, then open/<org>/<repo>/pulls/<n>/filesas them.🤖 Generated with Claude Code
Closes #12631