Repository navigation
ci: turn main's audit red when the ruleset stops requiring the merge queue - #17224
Conversation
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS After merge, dispatch What this change shipsInventory (6 items) — 6 justifiedIntent: make it visible when main's ruleset stops requiring the merge queue, so cross-merge reds are no longer found only after they happen. This is an ADDITION. It detects the gap; re-enabling the queue is a ruleset setting no diff can change, and the description says so under
[FIRST-PRINCIPLES-REVIEWED] cc25784 Description read[DESCRIPTION-READ] e981bea067666496f619889f08ae2ef15d24b9c6a0db75cb68bcf187d211ea37 That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Before merge, check that [DESIGN-REVIEWED] cc25784 Description read[DESCRIPTION-READ] 871e85fe2edeeb92ae875aa4b155c513d443ae035ebfcddca7df4ae791483ac4 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
7d98007 to
72594c9
Compare
|
Reviewed, not approving (crew-pr-reviewer). The code is fine: a push-only job with |
72594c9 to
cc25784
Compare
Problem / Motivation
Goal: When main's ruleset stops requiring the merge queue, main's own audit turns red, so the gap is seen instead of found later through cross-merge breaks.
docs/ci/ci-and-reviews.mdsays "The real merge gate is human approval plus the merge queue".ci.ymlsays amerge_grouprun is what makes "every PR was green" imply "main is green". But main's live rules have nomerge_queueentry today:merge_groupCI runs exist only on 2026-10-02..03 (about 6 hours). A ruleset change is not a diff, so no check noticed.Why it matters
Without the queue, two PRs each green alone land minutes apart and are red together. Every open PR then inherits the red until a third PR repairs it. Main push reds of this kind (run/attempt/job): 35293993344/1/105448930500, 34111349592/1/101713969407, 34115067847/1/101723629780, 35634906432/1/106450545989, 34658128710/1/103455742964, 35381992437/1/105720581106, 35166695064/1/105032457582, 35794581983/1/106971521230, 37182491418/1/111377998664, 36827891125/1/110258870559, 35266675992/1/105364805985. Known pairs: #11438 over #11018, #15078 over #14987, #15917 over #16427.
Not a goal
MERGE_QUEUE_ENABLED=true). No diff can do it.reportjob.AGENTS.md/AUTOSDE.yaml/docs/README.md. The matching AGENTS/AUTOSDE parts come in a later integration PR.What changed (motivation → approach → change)
Symptom: main goes red from cross-merges. Root cause: the queue that would test the integrated tree is not required, and turning it off leaves no trace in CI. Change:
scripts/check_merge_queue_ruleset.pyreads onerules/branches/mainresponse and exits 1 unless it holds amerge_queuerule backed by arequired_status_checksrule. "Branch up to date" (strict_required_status_checks_policy: true) does not count as a substitute: merges here land seconds apart (84 s, 42 s, 2.6 min). WhenMERGE_QUEUE_ENABLEDistruebut the queue is missing, the message also says ci.yml skips main's push run, so nothing tests the merged tree.A new scheduled workflow,
merge-queue-ruleset.yml(Merge Queue Ruleset Audit, every 6 hours plus manual dispatch, upstream repo only), runs main's copy of the script. It is listed inscheduled-failure-watch.yml, so a red scheduled run opens one tracking issue. It is not a job inmain-ratchet-audit.yml: that run status is the per-commit ratchet signal, and a setting-level red on every push would hide a real ratchet regression (Design Review).docs/ci/ci-and-reviews.mdnames the workflow.Runtime / CI impact: this is a workflow change, not docs-only. One hosted job every 6 hours (one API call). Until a maintainer ticks the queue, every scheduled run is red and the watcher keeps one issue open. That red is the point. No PR lane changes.
This PR's green does not prove the new workflow works. It never runs on a pull request. After merge, confirm it:
gh workflow run merge-queue-ruleset.yml --repo kirodotdev/KiroCrew. The jobMerge queue required on mainshould be red with::error::main has no merge_queue rule.Merge Queue Ruleset Audit scheduled run is failingshould exist (labelscheduled-failure).merge queue required on main (ruleset 20088190).Backwards compatibility
Compatible: it adds a script, a test, a scheduled workflow and one watched name. No PR lane, input or setting changes.
Removes nothing: it only adds a check, a test, a watch entry and one doc sentence.
Tests
test/test_check_merge_queue_ruleset.py, deterministic, no network:strict_required_status_checks_policy: truestill fails;merge_queuerule plus the required check passes;merge_queuerule with norequired_status_checksrule fails;{"message": "Not Found"}) fails closed;MERGE_QUEUE_ENABLED=truewithout the queue names the skipped push run (function and CLI);scheduleandworkflow_dispatch, is fenced to the upstream repo, passes the variable, and is in the failure watch's list.Local runs (exit codes from the tool itself, logged to file):
pytest test/test_check_merge_queue_ruleset.py test/test_scheduled_failure_watch.py test/test_main_ratchet_audit.py test/test_workflow_checkout_credentials.py test/test_ci_fleet_routing_expression_parity.py test/test_ci_runner_watchdog.py test/test_workflow_secret_and_cache_scope.py test/test_ai_review_workflows.py test/test_node_version_pins.py test/test_docs_lint_fact_checks.py→ 0 (1763 passed)scripts/run_scoped_tests.py --surface backend→ 0Manual verification
gh api repos/kirodotdev/KiroCrew/rules/branches/main > rules.json; python3 scripts/check_merge_queue_ruleset.py rules.json→ exit 1 with the::error::line; withMERGE_QUEUE_ENABLED=true→ exit 1 plus the skipped-push-run sentence (read 2026-10-05 ~22:30 PDT).Unvalidated: the workflow on main and the watcher issue. They cannot run before merge; see the three steps above.
Related Issues
Closes #17223
Pattern harvest
Rule candidate: review-prompt
Pattern: "a CI guarantee that rests on a repository setting (ruleset, variable), not a file, needs a scheduled live read of that setting; otherwise turning it off is invisible."
Guard record (audit G-U3-01)
protected-branches(20088190) onrefs/heads/main; every PRrules/branches/mainhas notype == merge_queueentryMERGE_QUEUE_ENABLED=true; strict up-to-date is not a substitutedocs/ci/ci-and-reviews.md(contract), the ruleset (setting),scripts/check_merge_queue_ruleset.py(drift check)merge-queue-ruleset.yml(schedule/dispatch, runs main's own script);scheduled-failure-watch.yml(files the issue);merge-queue-readiness.yml(runs only once the queue is required)truewithout queue → 1 with the extra sentencemerge_queue+required_status_checks→ 0Folds two duplicate audit proposals: G-U5-01 (same script; its "queue without a required check" case and its scheduled cadence are taken here) and G-U7-06 (doc-level statement; its three cross-merge pairs and runs are cited above). G-U5-01's "strict up-to-date as fallback" is not taken, for the reason in What changed. The audit patch's push-only job in
main-ratchet-audit.ymlis replaced by the scheduled workflow, per Design Review.Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)