✨ feat(onboard): Mergify's queue draft runs niyam's checks and Guard once per head
Mergify's queue draft now runs niyam's checks and Guard once per head, not once per edit of its description.
The two caller jobs niyam onboard writes get an if: that skips an edit of the draft when all of these hold:
- the event is
edited, and itschangesname neithertitlenorbase; - the draft is known as
mergifyTestsknows it: authormergify[bot]with typeBot, head onmergify/merge-queue/, head repository the repository itself; - the title is not the
stacked on N pull requests aheadform, whose tested pull requests come from the body.
The two jobs are niyam in niyam.yml and niyam-guard in niyam-guard.yml. The expression lives once, in src/queue-draft.ts.
Why a skip here passes no refusal. GitHub reports a skipped caller job under its own name: niyam or niyam-guard. It never reports niyam / PR identity or niyam-guard / judge, so the draft's last verdict at its head stands, a refusal or a 403 included. #683's head shows it: the closed run's skipped niyam job reported niyam alone, beside the earlier niyam / PR identity and niyam-guard / judge runs. athya_mono requires niyam / Work rules, niyam / PR identity, niyam / Design frames and niyam-guard / judge. None of them is ever reported skipped, so nothing relies on Mergify's check-skipped.
Narrower than option A. Option A of athya-hq/athya_mono#3968 also put an if: on shared-guard.yml's judge. This leaves it off. A skipped judge reports niyam-guard / judge as skipped, the newest run of that name, which passes the check over a refusal at that head. #526 rejected that design for this reason. shared-guard.yml changes in its comments alone. Slice #685 says so, and Alok was asked there.
Unchanged:
opened,synchronizeandreopenedjudge every head;- every edit of an ordinary pull request;
- the draft's title and base edits,
merged #Aincluded; - pushes,
closed, and the other jobs.
onboard. It adds the skip to a niyam.yml and a caller written before this, and says so in the plan (skips Mergify's queue-draft edits) and in the pull request. It reads 0.7.20's caller (CALLER_0720, recorded from this repository's own) as its own, with older: true.
README: the paragraph One run per draft head (#685), under Mergify's merge queue.
Beyond the slice's shape: src/guard-caller.ts gets its own suite, src/guard-caller.test.ts. Before this, the mutation gate never judged the file. callerAt and pushBranch now read YAML without the guards that the whole-template comparison already makes, so no equivalent mutant survives. What they accept is unchanged: the onboard and doctor suites pass as they were, and the new suite covers each shape they refuse.
Evidence
pnpm checkexits 0 on this head: 2935 src tests and 138 scripts tests.guard-caller.tsandqueue-draft.tsare at 100% lines, branches and functions.pnpm exec agnipariksha --lane src --files src/guard-caller.ts,src/queue-draft.ts --no-reuse: 228 killed of 228, 0 blocking.pnpm exec agnipariksha --lane src --files src/onboard.ts --no-reuseexits 1: 320 blocking of 3172. All 320 are in lines after 703, the part ofonboard.tsno sweep slice has covered yet. Lines 1–703, which hold the template change (514–522), have 0. None of the 320 is on this pull request's other changed lines (619, 909–913, 947, 1425, 1450).src/queue-draft.test.tsevaluates bothif:s as GitHub does (its expression rules, read 2026-11-26):- a body edit of the draft is skipped;
- each identifying condition failing alone runs: author, type, branch, fork, no head repository, a title change,
merged #A, a base change, the deep-stack title; opened,synchronizeandreopenedrun, and so does an ordinary pull request's edit;closedstill skips theniyamjob, andpushstill runs it.
- Not linted with actionlint, because a hook here refuses to run it.
niyam.yml's newif:runs for real on athya_mono's onboard pull request. The caller's runs from main, so its first proof is the firstniyam-guard / judgerun after that onboard merges.
Slice: #685
🤖 Generated with Claude Code
Summary by cubic
Stops over-running niyam's checks and Guard on every edit of Mergify's queue draft, so the draft is checked once per head instead of once per edit.
- Skips the
niyamandniyam-guardcaller jobs on a draft edit that changes neither title nor base, with the identifying conditions (author, branch, repo) and an exception for deep-stack titles; the expression lives once insrc/queue-draft.ts. - GitHub reports a skipped caller job as
niyamorniyam-guardalone, never asniyam / PR identityorniyam-guard / judge, so the draft's last verdict stands. shared-guard.yml'sjudgegets no skip: a skippedjudgewould pass the required check over a refusal.onboardadds the skip to older workflows and callers it rewrites, and says so in the plan and PR body.guard-caller.tsgains a test suite, andcallerAtandpushBranchnow parse YAML without redundant guards.