Landing policy: main's landed commits are never a PR's own
A pull_request event's base SHA can predate a main that the PR branch later merged in. The landing policy then counted main's own landed merge commits as the PR's agent commits and refused them for the missing co-author trailer. #1098 hit this after merging current main: 9892b4c646 … agent commit missing alfonso-aft co-author trailer, where 9892b4c646 is main's merge of #1137.
- Fix:
check_eventforpull_requestalso excludes commits reachable from the fetchedorigin/main. Those commits passed this policy when they landed, and a PR can't changeorigin/main. Without a fetched main, the stricter event base alone applies, as before. - Tests:
PullRequestBaseBehindMergedMainTestbuilds exactly that case. Its main-merge test fails on the old code with the live refusal and passes with the fix, and a second test checks that a missingorigin/mainstill refuses. The fixture runs git without the agent shell's commit hook, which otherwise adds the trailer to every fixture commit and made the first version of the test meaningless.
Verified: all 92 tests in test_merge_queue_workflow.py and test_pr_landing.py passed.
Summary by cubic
Fixes the landing policy so main's own landed commits are never counted as a PR's commits when reviewing pull_request events. The event's base SHA can predate a main the branch later merged in, which made the policy flag main's own merge commits for a missing co-author trailer and refuse the PR.
Bug Fixes
check_eventforpull_requestnow excludes commits reachable from the fetchedorigin/main; without a fetched main, the stricter event base alone still applies.- New
PullRequestBaseBehindMergedMainTestcovers a PR whose base is behind a merged main and the missing-origin/mainfallback. - The test fixture runs git without the agent shell's commit hook so fixture commits can control which carry the co-author trailer.
- Adds a non-ranking search slice descriptor so CI covers the landing-policy script and its tests.