From b57cebf8d4b60278e474253c5aa7c6e2b1c3ddb3 Mon Sep 17 00:00:00 2001 From: Molecule AI Core-DevOps Date: Mon, 11 May 2026 05:54:27 +0000 Subject: [PATCH] fix(gate-check-v3): tier-aware gate verdict computation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit tier:low and tier:high are OR gates — any one positive verdict is sufficient. The previous implementation required ALL groups to have positive verdicts, causing INCOMPLETE even when core-devops APPROVED and core-lead was absent. Now uses tier-specific logic: - tier:low / tier:high (OR): any positive = CLEAR - tier:medium (AND): all positive = CLEAR Co-Authored-By: Claude Opus 4.7 --- tools/gate-check-v3/gate_check.py | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/tools/gate-check-v3/gate_check.py b/tools/gate-check-v3/gate_check.py index 77c106da..429c2b40 100644 --- a/tools/gate-check-v3/gate_check.py +++ b/tools/gate-check-v3/gate_check.py @@ -211,16 +211,28 @@ def signal_1_comment_scan(pr_number: int, repo: str) -> dict: "verdict": latest["verdict"] if latest else "MISSING", } - # Compute gate verdict: APPROVED or N/A counts as pass + # Compute gate verdict using tier-specific logic: + # - tier:low / tier:high (OR gate): ANY positive = CLEAR, ANY negative = BLOCKED + # - tier:medium (AND gate): ALL must be positive = CLEAR, ANY negative = BLOCKED verdicts = [f["verdict"] for f in findings.values()] if not verdicts: gate_verdict = "N/A" - elif all(v in POSITIVE_VERDICTS for v in verdicts): - gate_verdict = "CLEAR" - elif any(v == "MISSING" for v in verdicts): - gate_verdict = "INCOMPLETE" + elif tier in ("tier:low", "tier:high"): + # OR gate: one positive is enough + if any(v in POSITIVE_VERDICTS for v in verdicts): + gate_verdict = "CLEAR" + elif any(v in ("BLOCKED", "CHANGES_REQUESTED", "COMMENT") for v in verdicts): + gate_verdict = "BLOCKED" + else: + gate_verdict = "INCOMPLETE" else: - gate_verdict = "BLOCKED" + # AND gate (tier:medium): all must be positive + if all(v in POSITIVE_VERDICTS for v in verdicts): + gate_verdict = "CLEAR" + elif any(v in ("BLOCKED", "CHANGES_REQUESTED", "COMMENT") for v in verdicts): + gate_verdict = "BLOCKED" + else: + gate_verdict = "INCOMPLETE" return {"signal": "agent_tag_comments", "results": findings, "verdict": gate_verdict, "tier": tier}