Public: anyone can read this; the crew can change it.
A pull whose issue names a team cannot merge until that team's reviewer approves, when the team has one #9939
The merge now waits for a named team's approval. If the issue a pull closes names a team, and that team has a crew reviewer on the repository, the merge is refused with teamreviewrequired until that team has approved the current head.
stopped parked by the crew
3 earlier comments
The merge now waits for a named team's approval. If the issue a pull closes names a team, and that team has a crew reviewer on the repository, the merge is refused with team_review_required until that team has approved the current head.
What changed
- The gate —
src/core/issue_teams.ts:teamsHoldinglists the named teams that have a crew reviewer here but no current approval of the head.teamWait(names)is the one sentence every door uses: "Waiting on Design's review".src/core/pulls.ts:mergePullasks this gate right after the ordinary review gate, on both the normal and the sealed path, when the review gate setsteams.src/actions/pulls.tsturnsteamson unless the owner's break-glass (pastGate) is used, so Land past the gate skips the team gate.- A team nobody on the crew can ask does not hold the pull, which matches the lapse rule in the docs.
- Doors
- Pull page: the merge box says "Waiting on Design's review." with the button disabled, and its ready state takes the gate into account.
- Studio: its ship decision takes the gate into account too.
- Terminal:
m, the merge-box line and a refused merge all show the same sentence. - API: a 409 with
{"error": "team_review_required", "message", "teams"}. - MCP
merge: it goes throughmergeFailure, so it says the same sentence with no new tool.
- Tests —
test/team-merge-gate.test.tscovers five cases:- the merge is held while the review is awaited, and says the sentence;
- it lands after the team approves;
- an approval of an older head holds it again;
- a team with no reviewer here does not hold it;
- break-glass passes.
It fails on main because
teamWaitand the new error don't exist there. - Docs — the "Not done" sentence in
docs/OPERATING.mdis replaced by a description of the gate.
Left out
- The break-glass form's hint still says "Review and conflicts still count". It doesn't mention that a named team's review is skipped.
- Pull slices (
landSlice) still use only the ordinary review gate. - I couldn't call
keep_plan: the tool wasn't available in this run, so the issue has no plan posted.
Checks
bun scripts/gate.ts,bun x tsc --noEmitandbun scripts/design-lint.tspass.test/pull*.test.ts,test/issue-teams*.test.ts,test/mcp-size.test.tsand the new test: 168 of 170 pass. The two failures were intest/pull-quiet.test.ts; that file passes 4 of 4 run alone, so I think they're flakes from running 44 files together.
To try it: name "design" on an issue (Details → Teams), put one of the crew's reviewers on the Design team, and open a pull that Closes #N. The merge box says "Waiting on Design's review." until that reviewer approves the head.
🤖 Generated with Claude Code
If the issue a pull closes names a team, and that team has a crew reviewer on the repository, the merge is now refused with team_review_required until that team has approved the current head.
The gate
teamsHoldinginsrc/core/issue_teams.tslists the named teams that have a crew reviewer here but no approval of the current head.mergePullinsrc/core/pulls.tschecks it right after the ordinary review gate, on both the normal and the sealed path.- A team with nobody on the crew to ask does not hold the pull, which matches the lapse rule in the docs.
- The owner's break-glass (
pastGate, "Land past the gate") skips the team gate.
One sentence on every door: teamWait produces "Waiting on Design's review" (using the team's name).
- Pull page: the merge box says it and disables the Merge button. Its ready state and the studio's ship decision now count the team gate.
- Terminal:
m, the merge-box line and a refused merge all show it. - API: answers a 409 with
{"error": "team_review_required", "message", "teams"}. - MCP
merge: it already words refusals throughmergeFailure, so it says the same sentence. No tool was added.
Docs and tests
docs/OPERATING.mdnow describes the gate in place of the "Not done" sentence.test/team-merge-gate.test.tscovers five cases: held while the team's review is awaited, lands after approval, held again when the approval was on an older head, not held by a team with no reviewer, and passed by break-glass. It fails on main, whereteamWaitand the new refusal don't exist.
Not done
- The "Land past the gate" form's hint still says "Review and conflicts still count". It doesn't mention that a named team's review is skipped.
- Pull slices (
landSlice) still check only the ordinary review gate.
Checks run
bun scripts/gate.ts,bun x tsc --noEmitandbun scripts/design-lint.tspass, andtest/team-merge-gate.test.tspassed again after the fix.- In one combined run of
test/pull*.test.ts,test/issue-teams*.test.ts,test/mcp-size.test.tsand the new test, 170 of 172 passed. Both failures were intest/pull-quiet.test.ts, which passes 4 of 4 when run alone, so they look like flakes from running 44 files at once. - The previous check failed on a missing
Try:line in the commit messages. It is now in its own commit. Force pushes are refused, so I couldn't amend. - I couldn't keep a plan on the issue: the
keep_plantool wasn't available in this run.
Try: name Design on an issue (Details → Teams) with a crew reviewer on the Design team, and open a pull whose body says Closes #N. Its merge box reads "Waiting on Design's review." until that reviewer approves the head.
🤖 Generated with Claude Code
If the issue a pull closes names a team, and that team has a crew reviewer on the repository, the merge is now refused with team_review_required until that team has approved the current head.
The gate
teamsHoldinginsrc/core/issue_teams.tslists the named teams that have a crew reviewer here but no approval of the current head.mergePullinsrc/core/pulls.tschecks it right after the ordinary review gate, on both the normal and the sealed path.- A team with nobody on the crew to ask does not hold the pull, which matches the lapse rule in the docs.
- The owner's break-glass (
pastGate, "Land past the gate") skips the team gate.
One sentence on every door: teamWait produces "Waiting on Design's review" (using the team's name).
- Pull page: the merge box says it and disables the Merge button. Its ready state and the studio's ship decision now count the team gate.
- Terminal:
m, the merge-box line and a refused merge all show it. - API: answers a 409 with
{"error": "team_review_required", "message", "teams"}. - MCP
merge: it already words refusals throughmergeFailure, so it says the same sentence. No tool was added.
Docs and tests
docs/OPERATING.mdnow describes the gate in place of the "Not done" sentence.test/team-merge-gate.test.tscovers five cases: held while the team's review is awaited, lands after approval, held again when the approval was on an older head, not held by a team with no reviewer, and passed by break-glass. It fails on main, whereteamWaitand the new refusal don't exist.
Not done
- The "Land past the gate" form's hint still says "Review and conflicts still count". It doesn't mention that a named team's review is skipped.
- Pull slices (
landSlice) still check only the ordinary review gate.
Checks run
bun scripts/gate.ts,bun x tsc --noEmitandbun scripts/design-lint.tspass.- In one combined run of
test/pull*.test.ts,test/issue-teams*.test.ts,test/mcp-size.test.tsand the new test, 170 of 172 passed. Both failures were intest/pull-quiet.test.ts, which passes 4 of 4 when run alone. - The latest red check wasn't caused by this pull, as far as I can tell:
crew-weekstagger test: it passed three times out of three here, run together withview-source. Neither file uses anything this pull changes.view-source: its shard was killed for time. The file takes 1.8 s here on this branch and 1.9 s on main's source.
- I pushed an empty commit to run the check again, and haven't seen that result yet. If the stagger test fails again, it may depend on state left by another test in its shard, which I can't reproduce here.
- I couldn't keep a plan on the issue: the
keep_plantool wasn't available in this run.
Try: name Design on an issue (Details → Teams) with a crew reviewer on the Design team, and open a pull whose body says Closes #N. Its merge box reads "Waiting on Design's review." until that reviewer approves the head.
🤖 Generated with Claude Code
Parked by the crew: the check stayed red through 2 automatic tries
The merge now waits for a named team's approval. If the issue a pull closes names a team, and that team has a crew reviewer on the repository, the merge is refused with
team_review_requireduntil that team has approved the current head.What changed
src/core/issue_teams.ts:teamsHoldinglists the named teams that have a crew reviewer here but no current approval of the head.teamWait(names)is the one sentence every door uses: "Waiting on Design's review".src/core/pulls.ts:mergePullasks this gate right after the ordinary review gate, on both the normal and the sealed path, when the review gate setsteams.src/actions/pulls.tsturnsteamson unless the owner's break-glass (pastGate) is used, so Land past the gate skips the team gate.m, the merge-box line and a refused merge all show the same sentence.{"error": "team_review_required", "message", "teams"}.merge: it goes throughmergeFailure, so it says the same sentence with no new tool.test/team-merge-gate.test.tscovers five cases:It fails on main because
teamWaitand the new error don't exist there.docs/OPERATING.mdis replaced by a description of the gate.Left out
landSlice) still use only the ordinary review gate.keep_plan: the tool wasn't available in this run, so the issue has no plan posted.Checks
bun scripts/gate.ts,bun x tsc --noEmitandbun scripts/design-lint.tspass.test/pull*.test.ts,test/issue-teams*.test.ts,test/mcp-size.test.tsand the new test: 168 of 170 pass. The two failures were intest/pull-quiet.test.ts; that file passes 4 of 4 run alone, so I think they're flakes from running 44 files together.To try it: name "design" on an issue (Details → Teams), put one of the crew's reviewers on the Design team, and open a pull that
Closes #N. The merge box says "Waiting on Design's review." until that reviewer approves the head.🤖 Generated with Claude Code
Closes #9930