Repository navigation
Description
Implementation: FlyBot (ours) — PR follows within 24h. Do not pick up without a pickup-ok comment on this issue.
Written-by: FlyBot Lead
Claimed-by: FlyBot Lead
Claim-Id: b3d2e07d9f7f48d6948aadef5b830ec5
Branch: dev/5-t1-auto-queue
Base: faf7792
At: 2026-11-20T05:06:10Z
Implementation: FlyBot (ours) — PR follows within 24h. Do not pick up without a pickup-ok comment.
Written-by: FlyBot Lead
Bot: FlyBot Dev-5
Tier: T3 (.github/scripts/** + .github/workflows/**)
The gap
A T2/T3 pull request enters the merge queue after its pass label appears, and that label is written by pass-label.yml from a counting Verdict: PASS at <sha>. T0/T1 needs no verdict, so no label ever appears and nothing triggers the queue: every T1 today is added by a person pressing "Add to merge queue". Measured over 2026-11-13T00:00Z → 2026-11-20T04:10Z: 12 T1 pull requests merged, 5 of them entered only by a manual press (no pass label at enqueue time), ready-comment → enqueue 17–37 minutes. Owner decided on 2026-11-20 to add a trigger rather than keep the manual step.
What to build (owner-approved design)
Three new files, no existing gate file touched:
.github/scripts/auto-queue-t1.mjs— a pure decision function plus a thin CLI. Input: the open pull requests, each one's changed files, computed risk tier, head sha, labels, check runs at that head, and whether it is already in the queue. Output: enqueue or refuse with one reason. It enqueues withgh pr merge <n> --auto --squash --match-head-commit <sha>and treatsalready queued to mergeas success. Compute the tier by importingrisk-gate.mjs; do not copy its rules..github/scripts/auto-queue-t1.test.mjs— fixture-only tests for the decision function, one per refusal..github/workflows/auto-queue-t1.yml— triggers:workflow_run: [Test] completed(fast path),scheduleevery 5 minutes (safety net),workflow_dispatch. Permissions:contents: read,pull-requests: write,checks: read,actions: read. After a successful enqueue, dispatch the main CI once (workflow_dispatchis one of the two eventsGITHUB_TOKENmay fire; aGITHUB_TOKENmerge does not start the push pipeline by itself).
Enqueue only when every condition holds: tier is T0 or T1; the pull request is not a draft; no hold label; tests-ok is success at that exact head; merge-gate is success; enqueue-guard is success when the check exists; the changed files contain no gate file, and not this workflow or this script; and the pull request is not already queued.
Refusals are written to the job summary only — no PR comment, no label change, no body edit.
Four hard constraints (owner, 2026-11-20)
- Report mode first: for the first day it only writes "would enqueue / refused + reason" to the job summary and presses nothing. Executing mode is switched on by FlyBot Lead after the owner reads the summary.
- Re-read the head after deciding and pin it with
--match-head-commit; if the tip moved, drop the round and wait for the next one — no chase, no comment. - Refuse three more cases outright: a pull request whose head lives in a fork; a changed file that is this workflow or this script; and no
admin/forceflag anywhere in any command. - Never comment on the pull request, never touch labels, never edit the body.
Acceptance
- Red first: the test file fails on a clean base for the stated reason before the script exists.
- Green: the decision tests pass;
npm run verifyexit 0; lint clean;arch-docsOK. - The workflow file passes actionlint (
.github/workflowsis linted bytest.yml), with actions pinned by full sha as the other workflows are. - Report-mode run recorded in the pull request as a job-summary excerpt showing at least one "would enqueue" and one refusal with its reason.
Dedupe
Live main faf77929 has no .github/scripts/auto-queue-t1.mjs and no workflow of that name; no open pull request or issue covers a T0/T1 queue trigger (searched the tree for enqueuePullRequest, --auto, auto-queue; the only queue path today is the pass label plus a manual press). The five frozen gate pull requests (#2547, #2875, #3067, #3088, #3092) are unrelated: they are gate-file changes waiting on a human Policy-sign: comment, not on this trigger.
Why this does not take the signature wall
policy/gates.json lists the gate files by exact path: eight .github/scripts/*.mjs (including enqueue-rules.mjs, enqueue-guard.mjs, pass-label.mjs, merge-gate.mjs, review-gate.mjs, risk-gate.mjs, policy-sign.mjs, gate-check.mjs), scripts/self-test-catalog.mjs, four workflows (test.yml, merge-gate.yml, enqueue-guard.yml, docker.yml) and all of policy/. A new file under .github/scripts/ and a new workflow under .github/workflows/ are outside that list, so this pull request needs no Policy-sign: line. Follow-up work, deliberately separate: once the trigger runs, a second pull request adds both new paths to gateFiles — a gate file may not be introduced by the change it governs, and that follow-up does need a human signature.
Activity