From 0e87fde0a314b084fdf3ea7ebeb44f05640e5b6a Mon Sep 17 00:00:00 2001 From: "Molecule AI Dev Engineer A (Kimi)" Date: Sat, 6 Jun 2026 17:26:42 +0000 Subject: [PATCH 1/2] fix(merge-queue): reject volume-skipped pending as genuine soft-fail (sop-checklist HOLD) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit _is_tier_low_pending_ok now inspects the status description for [volume-skipped] and returns False, keeping the PR in queue until a human splits bot-relay history. A partial comment view is NOT an honest tier:low soft-fail — the gate stopped parsing before it could verify acks. Diff-proof: 53/53 gitea-merge-queue tests pass. Refs: internal#219 §1, RFC#351 --- .gitea/scripts/gitea-merge-queue.py | 13 ++++++++- .../scripts/tests/test_gitea_merge_queue.py | 29 +++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/.gitea/scripts/gitea-merge-queue.py b/.gitea/scripts/gitea-merge-queue.py index 29b561a60..76505a702 100644 --- a/.gitea/scripts/gitea-merge-queue.py +++ b/.gitea/scripts/gitea-merge-queue.py @@ -304,13 +304,24 @@ def _is_tier_low_pending_ok( sop-checklist posts state=pending when acks are satisfied (missing manager/ceo acks are informational only). The queue should accept pending instead of waiting for success. + + FAIL-CLOSED: volume-skipped pending (partial comment view) is NOT a + genuine soft-fail — the script stopped parsing before verifying acks. + See sop-checklist.py:1179-1187. Reject so the PR stays in queue until + a human splits bot-relay history and the gate can evaluate honestly. """ if "tier:low" not in pr_labels: return False if "sop-checklist" not in context: return False status = latest_statuses.get(context) or {} - return status_state(status) == "pending" + if status_state(status) != "pending": + return False + desc = status.get("description") or "" + # Reject volume-skipped pending — partial view is not a genuine soft-fail. + if "[volume-skipped]" in desc: + return False + return True def required_contexts_green( diff --git a/.gitea/scripts/tests/test_gitea_merge_queue.py b/.gitea/scripts/tests/test_gitea_merge_queue.py index 83740b6a5..127d94abd 100644 --- a/.gitea/scripts/tests/test_gitea_merge_queue.py +++ b/.gitea/scripts/tests/test_gitea_merge_queue.py @@ -44,6 +44,35 @@ def test_required_contexts_green_rejects_missing_and_pending(): ] +def test_required_contexts_green_rejects_volume_skipped_even_for_tier_low(): + """volume-skipped pending is a partial view, not a genuine soft-fail. + + Per sop-checklist.py:1179-1187, volume_skipped posts pending with a + '[volume-skipped]' prefix. The merge queue must NOT treat this as an + acceptable soft-fail for tier:low — the gate did not finish evaluating. + """ + latest = mq.latest_statuses_by_context([ + {"context": "CI / all-required (pull_request)", "status": "success"}, + { + "context": "sop-checklist / all-items-acked (pull_request)", + "status": "pending", + "description": "[volume-skipped] comment-cap=1000 hit; please file ...", + }, + ]) + + ok, missing_or_bad = mq.required_contexts_green( + latest, + [ + "CI / all-required (pull_request)", + "sop-checklist / all-items-acked (pull_request)", + ], + pr_labels={"tier:low"}, + ) + + assert ok is False + assert "sop-checklist / all-items-acked (pull_request)=pending" in missing_or_bad + + def test_choose_next_pr_sorts_by_queue_label_timestamp_then_number(): issues = [ { -- 2.52.0 From 63c25d4c3f25b2ea5f0fc9bf5ebcbe13c813b12c Mon Sep 17 00:00:00 2001 From: "Molecule AI Dev Engineer A (Kimi)" Date: Sat, 6 Jun 2026 17:38:37 +0000 Subject: [PATCH 2/2] fix(merge-queue): remove generic tier:low pending-as-green override (#2368 RC) _is_tier_low_pending_ok() now always returns False per Researcher + CR2 RC: ANY pending/non-success required sop-checklist must HOLD and appear in missing_or_bad, not pass. The prior soft-fail accepted all pending sop-checklist for tier:low, which was a fail-open. Diff-proof: 54/54 gitea-merge-queue tests pass. Refs: core#2368, Researcher RC + CR2 RC. --- .gitea/scripts/gitea-merge-queue.py | 30 ++++++++++------------------- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/.gitea/scripts/gitea-merge-queue.py b/.gitea/scripts/gitea-merge-queue.py index 76505a702..5fafebe22 100644 --- a/.gitea/scripts/gitea-merge-queue.py +++ b/.gitea/scripts/gitea-merge-queue.py @@ -300,28 +300,18 @@ def _is_tier_low_pending_ok( ) -> bool: """Return True if tier:low PR can tolerate sop-checklist pending state. - Per sop-checklist-config.yaml tier_failure_mode, tier:low uses soft-fail: - sop-checklist posts state=pending when acks are satisfied (missing - manager/ceo acks are informational only). The queue should accept - pending instead of waiting for success. + GENERIC PENDING-AS-GREEN REMOVED (Researcher + CR2 RC on #2368): + The prior soft-fail accepted ANY pending sop-checklist for tier:low, + which allowed required checks to pass without genuine verification. + Pending required sop-checklist must now always HOLD and appear in + missing_or_bad. This function is retained as a policy hook but + currently always returns False so pending never counts green. - FAIL-CLOSED: volume-skipped pending (partial comment view) is NOT a - genuine soft-fail — the script stopped parsing before verifying acks. - See sop-checklist.py:1179-1187. Reject so the PR stays in queue until - a human splits bot-relay history and the gate can evaluate honestly. + If a positively identifiable genuine soft-fail state is defined in + future (e.g., a specific check-run conclusion), implement it here + with strict positive identification — never default to pass. """ - if "tier:low" not in pr_labels: - return False - if "sop-checklist" not in context: - return False - status = latest_statuses.get(context) or {} - if status_state(status) != "pending": - return False - desc = status.get("description") or "" - # Reject volume-skipped pending — partial view is not a genuine soft-fail. - if "[volume-skipped]" in desc: - return False - return True + return False def required_contexts_green( -- 2.52.0