Repository navigation
ci: give a T0/T1 pull request its own queue entry (#3248) - #3252
Conversation
…lowLab#3248) The trigger refused every fork head, and every pull request this team opens has its head in `HugoXK/FlyBot`, so the trigger could not reach its own work. The owner's decision is a conjunction: a forked head is started only when `head repo == HugoXK/FlyBot` AND `author == HugoXK`; every other fork, and the same repository name under another author, is refused with a sentence naming both halves. A branch of this repository keeps the plain answer it always had. The three directions are pinned as tests, and the rule is written where a reader looks for it: the workflow's header comment and the pull request body. `actions: write` is documented as the one deliberate escalation, scoped to the single `Test` dispatch after an enqueue lands. Docs-not-needed: `.github/**` and `docs/testing-layers.*` are not owned paths of any subsystem page; the new workflow's row is in `docs/testing-layers.json` and `docs/testing-layers.md` is the table `--write` generated from it.
|
Verdict: PASS at 9840358 Ran at this tip: 2026-11-20T05:52Z read, T3 path (tarball of 9840358) Red first, at this tip's tree, implementation removed and nothing else changed: 29 green → 1 run, pass 0, fail 1, Gates at this tip (REST Scope ( Can it bypass the Failure behaviour is refusal-only: a reason line in the job summary, no comment, no label, no body edit, no state change. Execute mode is the only writer — a single Cost and schedule: Tests cover what the brief asks: refusal without a T0/T1-green gate at the head, the fork rule in both directions (our fork starts, a stranger's fork refuses, the same repository name under another author refuses), idempotence ( Docs row is accurate: Merge strategy impact: the only PRs this can move are T0/T1 whose own required checks are already green at that head and that are mergeable; it adds no label, writes no review, and cannot waive Not run: the workflow's own events (a branch cannot schedule), the live |
Fixes #3248
Owner: Dev-5
Reviewer: Reviewer
Tier: T3 (
.github/scripts/**+.github/workflows/**, fromrisk-gate.mjs)Claim-Id: b3d2e07d9f7f48d6948aadef5b830ec5
Bot: Dev-5
What this adds
Three new files, plus the one manifest row an existing gate requires:
.github/scripts/auto-queue-t1.mjs.github/scripts/auto-queue-t1.test.mjs.github/workflows/auto-queue-t1.ymlTestcompleted, every 5 minutes,workflow_dispatchdocs/testing-layers.json,docs/testing-layers.md--writeNo rule is copied: the tier comes from
risk-gate.mjs's ownjudge(), the checks are the check runs atthat exact head, and the files a T0/T1 pull request may not touch come from
policy/gates.json.Which heads it may start
head repo == HugoXK/FlyBotANDauthor == HugoXK. Every other fork is refused, and so is a head whoserepository carries that name under a different author; a branch of this repository keeps the plain answer
it always had. The rule is written in the workflow's header comment, in the script and here, and the three
directions are pinned as tests (our fork starts, a stranger's fork is refused, the same repository name
under another author is refused).
The conjunction is the point, not a detail: the repository name alone would start a stranger's pull
request opened from a same-named fork, and the author alone would start any branch that login pushes.
actions: writeis one deliberate escalationIt exists only for the single
Testdispatch onmainafter an enqueue lands — a merge made with aGITHUB_TOKENstarts no push pipeline by itself. No other write happens in this job, and the permissionbelongs to this job alone: the workflow's header says not to copy it into another job or widen it elsewhere.
Report mode is what ships
The switch is an explicit input or repository variable, not a later code edit:
AUTO_QUEUE_T1_MODE=executeon the repository, or a single
workflow_dispatchwithmode: execute. Anything else — including anunreadable value — is report mode. In report mode the decision goes to the job summary and nothing else is
written: no comment, no label, no body edit.
--snapshotis report-only by construction, so a replay cannever act.
Report-mode rounds, on real data
Round 1, the ten open pull requests at the
2026-11-20T05:39:15Zread of the API, decided by the samefunction the workflow calls (the snapshot path, because this branch's box has no
gh). One T1 is liveright now and gets a would-enqueue line:
Round 2, a replay of the last tip of six merged pull requests that never carried a
passlabel — theirfiles and check runs as they were — is where the trigger shows what it is for. Five of the six would have
started without a person pressing the button, and one of those five is a fork head of ours:
The first real round runs on
mainafter this merges: GitHub startsworkflow_runandscheduleworkflows from the default branch only, so a branch cannot produce one. Report mode ships as the default,
so that first round presses nothing, and its job summary goes to FlyBot Lead verbatim before anyone flips
the switch. The two rounds above call the same decision function with the same inputs the API hands it.
What it refuses, and one test for each
A head that is not this repository by the fork rule (and a head whose repository is gone), the
holdlabel, a draft, a base that is not
main, a tier of T2 or T3, a changed gate file, a change to thisworkflow or this script,
tests-okabsent / pending / red / green only on another head,merge-gateabsent or red,
enqueue-guardwhen it reports and is red, and a pull request already in the merge queue.Two more pins: no decision can produce a command with
--adminor a force flag, and the newest run at ahead decides when a check was re-run — a stale failure does not outvote the re-run that fixed it, and a
newer failure is not outvoted by an older success.
Red first
faf77929with only the test file added, the suite failed for the stated reason:Error [ERR_MODULE_NOT_FOUND]: Cannot find module '.../.github/scripts/auto-queue-t1.mjs' imported from .../auto-queue-t1.test.mjs—not ok 1 - .github/scripts/auto-queue-t1.test.mjs,# tests 1 / # pass 0 / # fail 1, exit 1.4a515482) fail on the behaviour itself,not on a missing module:
not ok 7 - the team's own fork is started when the head repository and the author both match(expected: 'enqueue',actual: 'refuse'), andnot ok 9 - the trusted fork repository name under another author is refused(actual: 'the head lives in a fork (HugoXK/FlyBot), not in ThinkFlowLab/FlyBot', a blanket sentence that names neither half).Evidence at this tip
Ran:
node --test .github/scripts/auto-queue-t1.test.mjs(29 pass, 0 fail) ·TZ=UTC npm run verify(exit 0: core 3376,
.github/scripts+policy715 with these 29 included, plane 25, social 758, tree 152,timeline 172, workflow 538, project 151, interop 37, live-e2e 34) ·
node .github/scripts/testing-layers.mjs --check(every test file and workflow classified) ·node core/scripts/check-arch-docs.mjs(OK, 5 changedfiles) ·
actionlint1.7.7 over.github/workflows/(clean, actions pinned by full sha as in the otherworkflows).
Not run: the workflow's own events (a branch cannot schedule or push), and the live
ghpath of the CLI —the snapshots above are the same decision code, and no enqueue was pressed anywhere.
Read at
32b1e720155fafb859503c7c55ff95b0d98f7f81(tree557f7aa29188a006b5baa61bc1f956b81c61dbeb), pushed as98403580f4a3093309e2d96c781845ecf35e4262— the same tree, with the commit re-created by the fork's API push path.Checkpoint
{
"pr": 3252,
"claim": "Dev-5",
"issue": 3248,
"summary": "Adds the missing trigger for T0/T1: a pure decision function that enqueues only when the tier, tests-ok, merge-gate and enqueue-guard agree at one head, and a workflow that runs it when Test ends and every five minutes. A forked head is started only when head repo is HugoXK/FlyBot AND the author is HugoXK; every other fork is refused, and the three directions are pinned as tests. Report mode ships: the decision reaches the job summary and nothing is pressed. No comment, label or body edit; a moved tip is dropped, not chased; no command carries admin or force.",
"files": [
".github/scripts/auto-queue-t1.mjs",
".github/scripts/auto-queue-t1.test.mjs",
".github/workflows/auto-queue-t1.yml",
"docs/testing-layers.json",
"docs/testing-layers.md"
],
"checks": {
"ran": "TZ=UTC npm run verify",
"result": "green",
"at": "32b1e720155fafb859503c7c55ff95b0d98f7f81"
},
"next": "report mode ships; the first real round on main goes to FlyBot Lead verbatim, and the switch to executing is his call after that"
}
Docs-not-needed:
.github/**anddocs/testing-layers.*are not owned paths of any subsystem page; the newworkflow's row is added to
docs/testing-layers.json, and the table indocs/testing-layers.mdis the one--writegenerated from it.