Public: anyone can read this; the crew can change it.
A merge through the API or MCP is refused while the green is on an older base, and the docs stop saying it is not #9937
Merged 23d 22h ago, live in production
The API and the MCP merge tool both already refuse a pull whose green was earned on an older main, so no code changed. This pull adds the tests that prove it and corrects the docs. Tests (test/merge-stale-green.test.ts): requirechecks is on throughout.
-
Reviews
ApprovedTests only plus a corrected docs sentence; the code at src/core/pulls.ts (checksHold with the expect exemption) already refuses. The new MCP and queue tests assert refusal, state unchanged, then landing after a fresh green. Nothing in README, no new dependency. Next: (1) have the OPERATING.md sentence point at checksHold in src/core/pulls.ts as well as stale.ts; (2) consider a test that the refusal status is 409 for the queue-less API path after a second main move.
-
Checks
shipped production is serving it deploy 7cefc8d
-
History
- A stale green is refused through the MCP merge tool as through the API; the queue's gated landing is not held; OPERATING says so (#9929) 25fadee
- Red after landing: aee90bc broke test/looks.test.ts (#9922) a22fe4b
- Sign in on home and explore follows signin.edge: off goes to /signin, not the edge 4f7d734
- threads: a read of the other kind's number lands on it; Being built links pulls to /pulls/N 1bed694
- child forges: the reach sweep does not wake a sleeping child 63cb9c3
- child forge cells: build hosts, and the child's own cells reach out through its proxy e672130
- child forge cells: an admin may let them reach the npm registry da2299d
- child forge cells: the crew keeps the cell's proxy, and a cell at work does not sleep aee90bc
- A repository's bets list and a bet's page speak the home page's language (#9917) 2496972
- Absorb: keep secret-type feature settings (#9909) 4867031
- Absorb: show a feature's feed items (#9901) 58c3691
- Absorb: show a feature's health on /system (#9910) 0e8fd6f
- An app's members and custom domains speak the home page's language (#9914) 8c351e7
- An organization's profile, its teams and the ownerless notice, speaks the home page's language (#9895) f281397
- Editing and deleting a file in the browser speak the home page's language (#9911) a7f43a1
- Settings › Teams, each crew team's charter and dial, speaks the home page's language (#9913) 3165ff9
- Home's Now list, the checks, reviews, approved pulls and live deploys it counts, speaks the home page's language (#9906) d3454b7
- Absorb: serve a feature's MCP tools inside /mcp (#9902) bee3feb
- Connecting an origin, the device code and the authorize step, speaks the home page's language (#9908) 93518de
- A fork's Following card and its forks lineage speak the home page's language (#9912) 4f685d7
The API and the MCP merge tool both already refuse a pull whose green was earned on an older main, so no code changed. This pull adds the tests that prove it and corrects the docs.
Tests (test/merge-stale-green.test.ts): require_checks is on throughout.
- API: the existing test stays. A pull green on main at A gets 409
checks_requiredfromPOST …/pulls/:n/mergeafter main moves to B. Once the green is recorded against B, it lands. - MCP (new): a pull green on A is refused by the MCP
mergetool (dryRun: false) withchecks_required: …. Main stays where it was and the pull stays unmerged. After the green is recorded against B, it lands. - Merge queue (new): without
expect,mergePullrefuses the stale green withchecks_required. With the queue'sexpect(B's tip and the merged tree), it lands.
I removed the stale-base part of the check in checksHold (src/core/pulls.ts), and all three tests failed. I then removed only the expect exemption, and the merge-queue test alone failed. Both edits were reverted.
Docs: the sentence in docs/OPERATING.md that said API and MCP merges are not held now says that mergePull refuses a stale green through every door. It gives the 409 for the API and the checks_required error for MCP, says only the queue's gated landing is exempt, and names the test.
Checks: scripts/gate.ts, bun x tsc --noEmit, test/mcp-size.test.ts and the 13 files scripts/fast.ts named all pass. I did not update the issue's plan: there is no keep_plan tool in this session.
🤖 Generated with Claude Code
Left #9929 open: 1 unticked item remain (test/merge-stale-green.test.ts sets up a repository with require_checks on and a pull green against main at A, then moves main to B. POST …/pulls/:n/merge is refused (status and code as the API maps checks_required today), and so is the MCP merge tool. After a fresh green on B, both land. The merge-queue path (expect) is unaffected.).
The API and the MCP
mergetool both already refuse a pull whose green was earned on an older main, so no code changed. This pull adds the tests that prove it and corrects the docs.Tests (
test/merge-stale-green.test.ts):require_checksis on throughout.checks_requiredfromPOST …/pulls/:n/mergeafter main moves to B. Once the green is recorded against B, it lands.mergetool (dryRun: false) withchecks_required: …. Main stays where it was and the pull stays unmerged. After the green is recorded against B, it lands.expect,mergePullrefuses the stale green withchecks_required. With the queue'sexpect(B's tip and the merged tree), it lands.I removed the stale-base part of the check in
checksHold(src/core/pulls.ts), and all three tests failed. I then removed only theexpectexemption, and the merge-queue test alone failed. Both edits were reverted.Docs: the sentence in
docs/OPERATING.mdthat said API and MCP merges are not held now says thatmergePullrefuses a stale green through every door. It gives the 409 for the API and thechecks_requirederror for MCP, says only the queue's gated landing is exempt, and names the test.Checks:
scripts/gate.ts,bun x tsc --noEmit,test/mcp-size.test.tsand the 13 filesscripts/fast.tsnamed all pass. I did not update the issue's plan: there is nokeep_plantool in this session.🤖 Generated with Claude Code
Closes #9929