Skip to content

T0/T1 needs a queue trigger: every T1 today waits for a person to press the button #3248

Closed

Description

@HugoXK

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:

  1. .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 with gh pr merge <n> --auto --squash --match-head-commit <sha> and treats already queued to merge as success. Compute the tier by importing risk-gate.mjs; do not copy its rules.
  2. .github/scripts/auto-queue-t1.test.mjs — fixture-only tests for the decision function, one per refusal.
  3. .github/workflows/auto-queue-t1.yml — triggers: workflow_run: [Test] completed (fast path), schedule every 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_dispatch is one of the two events GITHUB_TOKEN may fire; a GITHUB_TOKEN merge 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)

  1. 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.
  2. 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.
  3. 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/force flag anywhere in any command.
  4. 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 verify exit 0; lint clean; arch-docs OK.
  • The workflow file passes actionlint (.github/workflows is linted by test.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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions