|
141 | 141 | * agreed to. It is printed loudly as an informational line so a reader is |
142 | 142 | * never surprised by it. Widening it is a one-line maintainer decision. |
143 | 143 | * |
| 144 | + * ## The ENQUEUE leg — the maintainer's own enqueue IS the review (2026-10-26) |
| 145 | + * |
| 146 | + * The maintainer, on the phone, where the button is "Merge when ready" (an |
| 147 | + * enqueue) and the queue guard then still wanted a separate Approve — verbatim |
| 148 | + * and untranslated (#26066): |
| 149 | + * |
| 150 | + * > 也就是说推送到我的手机上,以前都是需要我点一下核准,然后再点合并,以后我可以直接点合并是吗 |
| 151 | + * > 大部分我还是希望入队,但是我想省掉 Approve |
| 152 | + * |
| 153 | + * and the logins behind that click: 「os-zhuang 或 hotlong」 — both already in |
| 154 | + * `GOVERNED_APPROVERS`, which stays the single source and does not grow. So the |
| 155 | + * `merge_group` leg passes a governed pull request iff EITHER an authorized |
| 156 | + * account holds a latest-decisive APPROVED review (the 2026-09-04 predicate |
| 157 | + * above, unchanged and read FIRST) OR the account that put this entry in the |
| 158 | + * queue is an authorized one. Everything else stands: an enqueue by any other |
| 159 | + * account still needs the approval, Tier S still lands on its record, a fork is |
| 160 | + * still lifted by nothing, and the bypass-rules direct merge is still the other |
| 161 | + * landing. |
| 162 | + * |
| 163 | + * ⭐ WHY THIS IS NOT THE ACTOR-FIELD ATTRIBUTION #11704 RETRACTED. That |
| 164 | + * retraction refused to read "who pushed or merged" as a review. The ruling |
| 165 | + * that founded this regime (2026-08-18, carried in `check-governed-merges.mjs`) |
| 166 | + * already named the enqueue as the record — 「人工合并即人工审核:governed PR 的审核 |
| 167 | + * 记录 = 你按下合并/入队那个动作本身」 — and the identity concern behind the |
| 168 | + * retraction is answered for this leg exactly as it is for the approval leg, |
| 169 | + * normatively: ⛔ no agent seat enqueues or arms auto-merge on an unapproved |
| 170 | + * governed PR, under ANY account (AGENTS.md Prime Directive #14). An entry an |
| 171 | + * authorized account made can therefore only be the human's click, as an |
| 172 | + * authorized approval can only be the human's review. With this leg that |
| 173 | + * prohibition carries the same weight the approval-side one does: it is the |
| 174 | + * ONLY thing between an agent seat holding an authorized account and a governed |
| 175 | + * landing it cleared for itself, and the post-merge audit reads the enqueuer |
| 176 | + * the way it reads the approver. |
| 177 | + * |
| 178 | + * ⭐ THE READING, MEASURED on this repository on 2026-10-26 (REST): the actor |
| 179 | + * of the NEWEST `added_to_merge_queue` timeline event. "Merge when ready" with |
| 180 | + * checks pending ARMS auto-merge and the platform enqueues later; the add |
| 181 | + * event's actor is then the account that armed it (#26154, #26011). A direct |
| 182 | + * enqueue leaves an add event and never sets `auto_merge` (#26166). The pull |
| 183 | + * object's `auto_merge.enabled_by` therefore answers the first path only, is |
| 184 | + * null on the second and after a merge, and is not read. The timeline route |
| 185 | + * answers `X-Accepted-GitHub-Permissions: issues=read; pull_requests=read`, so |
| 186 | + * the workflow's existing `pull-requests: read` covers it. |
| 187 | + * |
| 188 | + * ⛔ UNDETERMINED IS NEVER A PASS, and never a refusal of its own: no add event, |
| 189 | + * an add with no actor, an unreadable or truncated timeline (the newest event is |
| 190 | + * on the LAST page), and a newest queue event that is a REMOVAL — the entry this |
| 191 | + * build judges not yet on the timeline, so the add before it is an entry that |
| 192 | + * already left — all leave the approval leg to decide alone, on its own exit |
| 193 | + * code. ⚖️ The accepted cost, stated where it is paid: as with an approval on |
| 194 | + * any commit, a push made after the click and before the entry lands is not |
| 195 | + * re-reviewed here; and the click counts for THAT entry only — a seat's |
| 196 | + * re-enqueue after an ejection is a new entry by a seat account, which needs |
| 197 | + * the approval or another such click. |
| 198 | + * |
| 199 | + * ⚖️ THE COST: one timeline read per governed pull request the approval did |
| 200 | + * not satisfy — never for one it did (MONOTONE, read SECOND, and a Tier S |
| 201 | + * record is consulted only after it). The SIZE leg follows the same predicate |
| 202 | + * through the sibling's lift (`sizeLiftFrom`, which reads the enqueue reading |
| 203 | + * handed to it beside the approval verdict); an oversized pull request the |
| 204 | + * governed leg already read costs no second timeline read. |
| 205 | + * |
144 | 206 | * ## Ordering: the path test runs FIRST, and a clear diff costs zero API calls |
145 | 207 | * |
146 | 208 | * ⛔ Fail-open on an API error is WRONG in this file — this guard exists |
|
429 | 491 | * |
430 | 492 | * 0 CLEAR — nothing governed in the diff (no API call was made), or every |
431 | 493 | * governed PR carries an authorized APPROVED review (on ANY |
432 | | - * commit — 2026-09-04), or this is the `pull_request` |
| 494 | + * commit — 2026-09-04) or was enqueued by an authorized |
| 495 | + * account (2026-10-26), or this is the `pull_request` |
433 | 496 | * early-warning run. |
434 | 497 | * 3 REFUSED — governed, and at least one governed PR carries no authorized |
435 | 498 | * APPROVED review (none at all, unauthorized account, dismissed |
436 | | - * or superseded) — and, on the references tier, no review of |
437 | | - * record on its current head either. |
| 499 | + * or superseded) and was not enqueued by an authorized account |
| 500 | + * (another account, or an UNDETERMINED enqueuer) — and, on the |
| 501 | + * references tier, no review of record on its current head |
| 502 | + * either. |
438 | 503 | * Deliberately 3, the same code the sibling's `--test` |
439 | 504 | * answers "GOVERNED" with, so the two tools agree on the number |
440 | 505 | * that means "this diff is governed and unsatisfied". |
|
456 | 521 | * `HUMAN_MERGE_LINE_THRESHOLD`, generated files included |
457 | 522 | * (#19036, the 2026-09-18 ruling) — and NO authorized APPROVED |
458 | 523 | * review lifts it (none, unauthorized, dismissed/superseded, or |
459 | | - * the review list could not be read; 2026-09-27, #20153). The |
| 524 | + * the review list could not be read; 2026-09-27, #20153), nor |
| 525 | + * an enqueue by an authorized account (2026-10-26). The |
460 | 526 | * SIZE leg, not the governed one; its remedies are an authorized |
461 | 527 | * approval and then the owning seat's landing, or a human merge. |
462 | 528 | * 9 REFUSED — the SIZE leg could not READ a queued pull request's size (the |
@@ -5084,7 +5150,10 @@ export async function selfTest() { |
5084 | 5150 | 'drifting back to a bare click, and passing with the reading PRINTED when the field is unreadable — and the ' + |
5085 | 5151 | 'queued pull-back: every refusal kind on both legs sends the queued pull request to the maintainer\'s manual ' + |
5086 | 5152 | 'removal, disarms it and confirms from the remote, and no rendering claims a DRAFT conversion dequeues it, ' + |
5087 | | - 'with a detector control that fires on every listed spelling.', |
| 5153 | + 'with a detector control that fires on every listed spelling — and the 2026-10-26 ENQUEUE leg: an entry an ' + |
| 5154 | + 'account in GOVERNED_APPROVERS put in the queue clears with no APPROVED review and lifts the size limb through ' + |
| 5155 | + 'the sibling, a seat enqueue still refuses, an UNDETERMINED enqueuer (no add, a removal newest, an unreadable or ' + |
| 5156 | + 'truncated timeline) is never a pass, and the approval is still read first.', |
5088 | 5157 | ); |
5089 | 5158 |
|
5090 | 5159 | selfTestReachedVerdict = true; |
|
0 commit comments