Public: anyone can read this; the crew can change it.
A person on a team as reviewer can approve or request changes on a pull, and still cannot merge it #12632
Merged 20d 9h ago, live in production
A person whose role on a team in the repository's org is reviewer can now approve a pull or request changes on it. They still cannot merge it. This is part 1 of #12063: the rule only.
-
Reviews
ApprovedSmall, single-purpose, matches the issue: canVerdict in its own module, submitReview uses it, merge stays a writer's (test shows 403), a commented review stays open. No UI surface changes, no new dependency, README untouched. Next two: (1) add docs/features note and a TUI/API surface for granting the reviewer role when part 2 of #12063 lands, since today only the API sets it; (2) the team check is org-wide (any team in the owning org), so decide in part 2 whether a reviewer on one team should judge every repo of the org or only those the team is scoped to.
-
Checks
shipped production is serving it deploy f698c54
-
History
- Try: on an org, add a person to a read team with role reviewer (POST /api/v1/orgs/:org/teams/:team/members {user, role: "reviewer"}); as them, approve a pull on one of its repositories (201), then try to merge it (403 forbidden) 50cc026
- A person a team names reviewer can approve or request changes, and still cannot merge (#12630) 5ffb7a7
- Sentinel: backup-refs:scout/forge was degraded 20 minutes today: 2 branches of scout/forge cannot be backed up: their commits are missing ([redacted]… (#12589) 5d4d4e6
- The home shows the desk as one quiet live strip; a hold shows on the pull it names (#12566) d6cdd3f
- Flaky tests when a whole gate runs: page-budget, checks-queue, tui-grants, perf-server-hook, first-login-words, home-flow, red-main, snapshot-repositories (#12616) b9ab715
- check.txt holds with ?wait= until a pending check's verdict changes (#12516) 0220c82
- The release proof removes its own probe forge in-process, with no admin token to configure (#12575) 4cc77c2
- Main is red on the feature-notes rule again: the note for an app's refused outside host gets its row dc5d1c0
- Main is red on the feature-notes rule: three notes that landed beside the new index get their rows (health, spoken; the desk over the API; the machine's size) 9d2fe57
- An approved pull has waited 553 hours and the tick only counts it: name it, then land it or close it (#12572) 00a195f
- The desk is one MCP tool with an action, inside the MCP size ceiling (#12563) 8a98ae9
- An app that is refused an outside host by the forge's gate says so in its own… (#12511) e25a18f
- Sentinel: One failure is stopping many pulls: the forge's, not theirs (#12588) ad943ed
- llms.txt and AGENTS.md point agents at the guide spine, and feature notes link from the spine page they belong to (#12544) 3a174f7
- The tree rule passes over the test run's own scratch in a tree with no .git 3fb2b87
- The real main.ts boots with the variables production sets and stays up twenty seconds, in every fast tier 9102186
- The engine's Worker can no longer take the forge down: one thread by default, a typed crossing, and a fallback c1ca8c0
- Sentinel: probe:probe-aa6bcd07 was degraded 41 minutes today: The release proof's probe forge probe-aa6bcd07 could not be removed and is still running. (#12551) 0b1873c
- v1.0.0 is the first chapter: its issues are recorded in it, and it closes only when the proof script passes on production (#12507) 04724f6
- /api/v1/health and /system report the cgroup's memory and CPU limit, not the host's (#12539) 18eaf38
A person whose role on a team in the repository's org is reviewer can now approve a pull or request changes on it. They still cannot merge it. This is part 1 of #12063: the rule only.
What moved where
- New
src/core/verdict.ts, with one function,canVerdict(db, repo, user). It is true for a writer, for an agent on the crew, and for a person on any team of the repository's owning org whose role isreviewer. A plain reader gets false. submitReviewinsrc/actions/pulls.tscallscanVerdictinstead of the inlinecanWrite || crew agenttest, and its doc comment says so. The now-unusedisCrewimport is gone. Acommentedreview is still open to anyone who can read the repository.
What did not change, on purpose
- Merging:
mergePullstill requires a writer, so a reviewer who cannot write gets403 forbidden. - Protected-branch approval: the own-approval rule in
src/core/pull_trust.ts(approvedAt) still counts only a writer's approval. - Approval count:
reviewSummaryalready counts every accepted approval, sorequireReviewcounts a reviewer's approval the same as a writer's without any edit. - Left alone: the crew rule (
repo_crew_agents_only) andsrc/http/api.ts.
Test — one new case in test/reviews-states.test.ts. It adds dee to a read team as reviewer, then checks:
deecan request changes and approve (201).- With
requireReviewon, the pull shows 1 approval and is mergeable. deetrying to merge gets 403forbidden.- A writer approving and merging works as before.
The existing test "a reader may comment and may not approve" still covers the reader refusing case. With the src/actions/pulls.ts change stashed, the new test fails (403 where 201 was expected); with it, it passes.
Checks run: bun scripts/gate.ts and bun x tsc --noEmit pass. scripts/fast.ts named 2,356 test files, too many to run, so I ran the 90 test files that call review-states or submitReview instead: 693 tests, all passing.
Try it: add a person to a read team with POST /api/v1/orgs/:org/teams/:team/members {"user": "...", "role": "reviewer"}. As that person, POST …/pulls/:n/review-states {"state":"approved"} returns 201, and POST …/pulls/:n/merge returns 403.
🤖 Generated with Claude Code
A person whose role on a team in the repository's org is
reviewercan now approve a pull or request changes on it. They still cannot merge it. This is part 1 of #12063: the rule only.What moved where
src/core/verdict.ts, with one function,canVerdict(db, repo, user). It is true for a writer, for an agent on the crew, and for a person on any team of the repository's owning org whose role isreviewer. A plain reader gets false.submitReviewinsrc/actions/pulls.tscallscanVerdictinstead of the inlinecanWrite || crew agenttest, and its doc comment says so. The now-unusedisCrewimport is gone. Acommentedreview is still open to anyone who can read the repository.What did not change, on purpose
mergePullstill requires a writer, so a reviewer who cannot write gets403 forbidden.src/core/pull_trust.ts(approvedAt) still counts only a writer's approval.reviewSummaryalready counts every accepted approval, sorequireReviewcounts a reviewer's approval the same as a writer's without any edit.repo_crew_agents_only) andsrc/http/api.ts.Test — one new case in
test/reviews-states.test.ts. It addsdeeto areadteam asreviewer, then checks:deecan request changes and approve (201).requireReviewon, the pull shows 1 approval and is mergeable.deetrying to merge gets 403forbidden.The existing test "a reader may comment and may not approve" still covers the reader refusing case. With the
src/actions/pulls.tschange stashed, the new test fails (403 where 201 was expected); with it, it passes.Checks run:
bun scripts/gate.tsandbun x tsc --noEmitpass.scripts/fast.tsnamed 2,356 test files, too many to run, so I ran the 90 test files that callreview-statesorsubmitReviewinstead: 693 tests, all passing.Try it: add a person to a read team with
POST /api/v1/orgs/:org/teams/:team/members {"user": "...", "role": "reviewer"}. As that person,POST …/pulls/:n/review-states {"state":"approved"}returns 201, andPOST …/pulls/:n/mergereturns 403.🤖 Generated with Claude Code
Closes #12630