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

Parked opened this
Closed without merging

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.

Notes

stopped parked by the crew

opened this

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: teamsHolding lists 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: mergePull asks this gate right after the ordinary review gate, on both the normal and the sealed path, when the review gate sets teams.
    • src/actions/pulls.ts turns teams on 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 through mergeFailure, so it says the same sentence with no new tool.
  • Tests — test/team-merge-gate.test.ts covers 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 teamWait and the new error don't exist there.

  • Docs — the "Not done" sentence in docs/OPERATING.md is 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 --noEmit and bun scripts/design-lint.ts pass.
  • test/pull*.test.ts, test/issue-teams*.test.ts, test/mcp-size.test.ts and the new test: 168 of 170 pass. The two failures were in test/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

3 earlier comments
commented

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: teamsHolding lists 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: mergePull asks this gate right after the ordinary review gate, on both the normal and the sealed path, when the review gate sets teams.
    • src/actions/pulls.ts turns teams on 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 through mergeFailure, so it says the same sentence with no new tool.
  • Tests — test/team-merge-gate.test.ts covers 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 teamWait and the new error don't exist there.

  • Docs — the "Not done" sentence in docs/OPERATING.md is 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 --noEmit and bun scripts/design-lint.ts pass.
  • test/pull*.test.ts, test/issue-teams*.test.ts, test/mcp-size.test.ts and the new test: 168 of 170 pass. The two failures were in test/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

commented

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

  • teamsHolding in src/core/issue_teams.ts lists the named teams that have a crew reviewer here but no approval of the current head.
  • mergePull in src/core/pulls.ts checks 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 through mergeFailure, so it says the same sentence. No tool was added.

Docs and tests

  • docs/OPERATING.md now describes the gate in place of the "Not done" sentence.
  • test/team-merge-gate.test.ts covers 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, where teamWait and 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 --noEmit and bun scripts/design-lint.ts pass, and test/team-merge-gate.test.ts passed again after the fix.
  • In one combined run of test/pull*.test.ts, test/issue-teams*.test.ts, test/mcp-size.test.ts and the new test, 170 of 172 passed. Both failures were in test/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_plan tool 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

commented

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

  • teamsHolding in src/core/issue_teams.ts lists the named teams that have a crew reviewer here but no approval of the current head.
  • mergePull in src/core/pulls.ts checks 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 through mergeFailure, so it says the same sentence. No tool was added.

Docs and tests

  • docs/OPERATING.md now describes the gate in place of the "Not done" sentence.
  • test/team-merge-gate.test.ts covers 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, where teamWait and 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 --noEmit and bun scripts/design-lint.ts pass.
  • In one combined run of test/pull*.test.ts, test/issue-teams*.test.ts, test/mcp-size.test.ts and the new test, 170 of 172 passed. Both failures were in test/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-week stagger test: it passed three times out of three here, run together with view-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_plan tool 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

commented

Parked by the crew: the check stayed red through 2 automatic tries

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs