diff --git a/.github/labels.yml b/.github/labels.yml index 237c12332..b316634cd 100644 --- a/.github/labels.yml +++ b/.github/labels.yml @@ -117,6 +117,14 @@ description: Trigger Claude Code automation color: "b41d8f" +- name: claude:review:passed + description: Automated Claude PR review found no blocking issues on the current head commit + color: "0e8a16" + +- name: claude:review:failed + description: Automated Claude PR review found blocking issues on the current head commit + color: "b60205" + - name: copilot description: GitHub Copilot related color: "e6dac6" diff --git a/.github/workflows/claude-code-automation-pr-review.yml b/.github/workflows/claude-code-automation-pr-review.yml index 55d5f5929..dfbeb2bb1 100644 --- a/.github/workflows/claude-code-automation-pr-review.yml +++ b/.github/workflows/claude-code-automation-pr-review.yml @@ -214,6 +214,49 @@ jobs: Use `gh pr comment` with your Bash tool to leave your comprehensive review as a comment on the PR. + ## Machine-Readable Verdict (MANDATORY) + + After posting your review comment, you MUST emit a single-label verdict on the PR. This label is consumed by branch-protection rules to gate auto-merge — it is the only deterministic signal of your review outcome. + + **Verdict criteria** (all must hold for PASS): + + - No blocking findings under "CRITICAL CHECKS" — i.e. no missing test markers, no coverage drop below 85%, no `make lint` failures, no conventional-commit violations. + - No blocking architecture or security violations under "Repository-Specific Review Areas". + - Suggestions / nice-to-haves do NOT block the verdict. + + If any blocking finding remains: verdict is **FAIL**. + Otherwise: verdict is **PASS**. + + **Apply the label** (the two labels are mutually exclusive — always remove the opposite one): + + ```bash + # PASS: + gh pr edit ${{ github.event.pull_request.number }} \ + --add-label "claude:review:passed" \ + --remove-label "claude:review:failed" + + # FAIL: + gh pr edit ${{ github.event.pull_request.number }} \ + --add-label "claude:review:failed" \ + --remove-label "claude:review:passed" + ``` + + Note: `--remove-label` is a no-op if the label is not present, so it is safe to always include it. + + Also include the verdict as the final line of your sticky review comment, formatted exactly as: + + ``` + **Verdict**: ✅ claude:review:passed + ``` + + or + + ``` + **Verdict**: ❌ claude:review:failed + ``` + + This makes the verdict visible to humans without scrolling through all findings. + --- **Remember**: This is medical device software. Insist on highest standards. Be thorough, actionable, and kind.