Repository navigation
Closed
Labels
enhancementNew feature or requestgithub_actionsPull requests that update GitHub Actions codeplannedImplementation plan approved
Description
Summary
Turn on GitHub merge queue for main in place of the strict "require branches to be up to date" setting. On a busy main, strict mode puts every open PR into a loop: merge main, wait for CI, repeat.
Current State
- Ruleset
CC(id 12393605, gate(owner): apply themainruleset — target~DEFAULT_BRANCH, require thetestcheck, strict up-to-date #1109) hasrequired_status_checkswith strict up-to-date, and nomerge_queuerule. - 37 "Merge branch main into …" commits across the last 40 merged PRs. Each one costs a CI run of about 8 min.
- During guard wave 1 (2026-09-20), merging 7 PRs took 7 serial rounds of merge-main → resolve → push → CI → merge.
ci.ymltriggers onpushandpull_requestonly.
Proposed Change
- Add
merge_group:to theon:block of every workflow whose checks are required (ci.yml:test,canary). Without it, queued PRs never get their checks run. (GitHub docs) - Add the
merge_queuerule to the ruleset throughscripts/ruleset-main.shand its docdocs/internal/graph-2026-09-guard/ruleset.md. Drop strict up-to-date: the queue tests each PR against the latestmainitself. - Merge queue is free for public repos owned by an org, which covers
sequant-io/sequant. - Update anything that merges PRs (
/merger,/releaseStep 6,gh pr mergesites in skills) to queue the PR (gh pr merge --auto) instead of merging directly. - This does not fix
CHANGELOG.mdconflicts. A conflicting PR is removed from the queue. See the linked changelog-fragments issue.
Acceptance Criteria
- AC-1:
ci.ymlruns onmerge_groupand the job namestestandcanaryare unchanged — Evidence:grep -n "merge_group" .github/workflows/ci.yml - AC-2:
scripts/ruleset-main.sh --printemits amerge_queuerule and no strict up-to-date flag — Evidence:scripts/ruleset-main.sh --print | jq '.rules[].type' - AC-2b: the script's
merge_queuerule merges by squash, and nothing applies it in this PR (it ships--printoutput and docs only) — Evidence:scripts/ruleset-main.sh --print | jq '.rules[] | select(.type=="merge_queue")' AC-3 / AC-4moved to gate(owner): enable the main merge queue after /release waits for queued merges (#1350 follow-up) #1368 by the owner, 2026-10-08: applying the queue waits until/releaseStep 6 waits for a queued merge (it would tag the wrong commit), and skill edits wait for the plugin-directory review (plugin/freeze). No file under.claude/skills,templates/skillsorplugin/changes in this issue.
Context
- Location:
.github/workflows/ci.yml,scripts/ruleset-main.sh, merge sites in skills - Type: Infrastructure
- Effort: Quick win → Medium (AC-3 is an owner action)
- Identified by:
/improveanalysis (tooling research, 2026-10-07)
Related
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestgithub_actionsPull requests that update GitHub Actions codeplannedImplementation plan approved
Activity
admarble commentedon Oct 7, 2026
Paired with #1351 (changelog fragments). The queue fixes the up-to-date loop, but a CHANGELOG conflict still removes a PR from the queue.
admarble commentedon Oct 8, 2026
Runner note (sequant run, 2026-10-08):
.claude/skills,templates/skills,plugin/).plugin/is frozen while the directory review is open, and skill edits mirror into it. The skill-side work is gate(owner): enable the main merge queue after /release waits for queued merges (#1350 follow-up) #1368.scripts/ruleset-main.shand its doc only; applying the queue is owner-gated in gate(owner): enable the main merge queue after /release waits for queued merges (#1350 follow-up) #1368.merge_groupmust reach every workflow that produces a required check (ci.yml:test,canary; see the matrix warning at the top ofci.yml). Checkgitleaks.ymlalready has it.npm test; CI runs it. Run your changed and AC-named tests foreground withtimeout 590. Commit every ~10 minutes.admarble commentedon Oct 8, 2026
Complexity: Standard (3 ACs, 3 directories)
AC Quality Check
grep -n merge_group ci.yml) fails today, so it gates something. It does not check the job names. Tighten: alsogrep -nE '^ (test|canary):' .github/workflows/ci.ymlreturns both.jq '.rules[].type') only lists types and cannot fail. Tighten:scripts/ruleset-main.sh --print | jq -e '([.rules[].type]|index("merge_queue")) != null and ([.rules[]|select(.type=="required_status_checks").parameters.strict_required_status_checks_policy]|first) != true'.merge_method. Tighten: pipe tojq -e '.parameters.merge_method=="SQUASH"'. "Nothing applies it" is checked bygrep -n 'gh api.*-X PUT\|--method PUT' scripts/ruleset-main.shreturning nothing..claude/skills,templates/skillsorplugin/.Scope Assessment
Non-Goals:⚠️ No Non-Goals section in the issue. Implied from the runner note: no skill edits, no applying the ruleset, no changelog fragments (#1351).
.github/workflows,scripts,docs/internal) plusCLAUDE.mdVerdict: ✅ SCOPE_OK
Acceptance Criteria
AC-1:
ci.ymlruns onmerge_group, job names unchangedVerification: Unit Test (file-content assertion) plus the grep
Scenario: Given
ci.yml→ When theon:block is parsed → Then it hasmerge_groupand the jobstestandcanarystill exist with nostrategy.matrixAssumptions:
merge_grouptakes nobranches:filter in the same form aspull_request. Leave it bare, asgitleaks.ymlalready does.AC-2:
--printemits amerge_queuerule and no strict flagVerification: Integration Test (run the script, parse the JSON)
Scenario: Given the script → When
--printruns → Thenrules[].typeincludesmerge_queueandrequired_status_checks.parameters.strict_required_status_checks_policyisfalse/absentAssumptions: The GitHub API still accepts
required_status_checksalongsidemerge_queue. Therequired_status_checksrule stays, since the queue uses it to decide which checks gate a merge group.AC-2b: queue merges by squash, nothing applied
Verification: Integration Test
Scenario: Given
--print→ When filtered to themerge_queuerule → Thenparameters.merge_method=="SQUASH"and the script has no mutating callAssumptions: Other parameters take explicit values so the payload is reviewable:
grouping_strategy: ALLGREEN,max_entries_to_build: 5,max_entries_to_merge: 5,min_entries_to_merge: 1,min_entries_to_merge_wait_minutes: 5,check_response_timeout_minutes: 60.Implementation Plan
Phase 1: Workflow
.github/workflows/ci.yml: addmerge_group:toon:. Extend the load-bearing-job comment (lines 10-23) to say the queue also needs these contexts to report onmerge_group.gitleaks.ymlalready hasmerge_group, so no change.opencode-smoke.ymlispull_request-only with path filters and is not a required check, so leave it.scorecard.yml,plugin-install-test.ymlandplugin-eval.ymlare not required.Phase 2: Ruleset script and doc
scripts/ruleset-main.sh: setstrict_required_status_checks_policytofalseand add themerge_queuerule with the parameters above. Update the header comment and theREQUIRED_CHECK_CONTEXTcomment, which cite strict mode as the reason a renamed job blocksmain. The reason is now the queue timeout.docs/internal/graph-2026-09-guard/ruleset.md: update the field table (strict row, newmerge_queuerows), the "context name" paragraph, and "Applying it". State that applying waits on gate(owner): enable the main merge queue after /release waits for queued merges (#1350 follow-up) #1368. Do not add an apply command to the script.CLAUDE.md: the Branch protection and Red main paragraphs say "strict up-to-date". Reword to describe the queue. Mark that the text applies once gate(owner): enable the main merge queue after /release waits for queued merges (#1350 follow-up) #1368 lands, since the live ruleset is unchanged until then.Phase 3: Tests
scripts/ruleset-main.test.ts, named so it runs in the integration project. Cover the AC-1 file-content checks and the AC-2/AC-2b JSON checks. Scope theci.ymlassertions to theon:block, not the whole file. Mutation-verify per CLAUDE.md: deletemerge_group, confirm the AC-1 test fails; removemerge_queue, confirm AC-2 fails; set merge_method toMERGE, confirm AC-2b fails. Record theMutation-verified:markers in the PR body with the file path first.Design Review
ci.yml. The ruleset payload lives inruleset-main.sh, which is the single producer of that payload.merge_group:and one rule object. Rejected alternative: keep strict and add a merge-main bot. That still costs a CI run per PR.mainruleset — target~DEFAULT_BRANCH, require thetestcheck, strict up-to-date #1109.git log -S strict_required_status_checks_policyshows only ci(gate): required checks on main, up-to-date rule, red-main revert, and mechanical proof for any "pre-existing failure" claim #1093 and gate(owner): apply themainruleset — target~DEFAULT_BRANCH, require thetestcheck, strict up-to-date #1109, so fewer than 2 fixes and no class to fix.canarytoo?" See Open Question 1. "Doesmerge_grouprunteston a stale base?" No, the queue builds a temp branch on the latestmain.ruleset-main/strict_required: producer isscripts/ruleset-main.sh. Consumers areci.yml(comment),ruleset.md,CLAUDE.md,PLAN.md,issue-graph.md(historical, leave) andscripts/preexisting-claim-gate.test.ts:144(asserts the script path in a section, unaffected). One producer, so no parity test is needed.Feature Quality Planning
All standard checks pass. Notable items:
testandcanary, but the script and doc require onlytest. A queue gating ontestalone would merge withoutcanary.gitleaksalready runs onmerge_group. If it becomes a required check, it must report there; it does.merge_groupstalls the queue untilcheck_response_timeout_minutes.Open Questions
canarytorequired_status_checksin the payload? — Recommendation: yes, as the issue's Current State implies it is already required. Impact: if the live ruleset requires onlytest, adding it changes behaviour at apply time; the owner sees it in the diff step. Confirm what is live withgh api repos/sequant-io/sequant/rulesets/12393605.Recommended Workflow
Phases: exec → qa
Quality Loop: disabled
Reasoning: Small infra change, three files plus docs. Tests are file-content and JSON assertions written alongside the change, so testgen adds nothing. No UI. Do not run the full
npm test(runner note); run only the new test file.Label Review
Current: enhancement, github_actions
Recommended: enhancement, github_actions, planned
Quality Loop: Won't auto-enable (SCOPE_OK)
admarble commentedon Oct 8, 2026
QA Verdict: AC_MET_BUT_NOT_A_PLUS
AC coverage: 2/3 met
Gaps:
Suggestions:
expect(execFileSync("bash", ["-n", SCRIPT])).toBeDefined()always passes.execFileSyncthrows on a syntax error, so the call itself is the check and theexpectadds nothing.ruleset.md§Applying has one long unwrapped line ("…strict up-to-date. An agent never applies it: …").canaryas a required check. If the live ruleset requires onlytest, that changes what blocks a merge. Step 1 of the docs now tells the owner to check this before step 2.fix(#1350): CHANGELOG entry; the bash -n check asserts no throw inste…
feat(#1350): improve(ci): merge queue on main instead of strict up-to…