Fix /find-mergeable-claude-prs empty-conclusion bypass#1435
Conversation
gh returns conclusion="" (empty string, not null) for in-flight checks, so the previous `(.conclusion // .status)` fell through only when conclusion was null and silently returned "" for QUEUED/IN_PROGRESS checks. Those empty strings then never matched the pending-status guard, so PRs with sweeps still running were falsely reported as all-green. Define a `state` helper that treats empty conclusion as missing and falls back to .status, and apply it everywhere the effective check state is consulted. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
LGTM, correct jq fix — // only falls through on null, not empty string, so the explicit non-empty check is the right call.
Extended reasoning...
Overview
This PR makes a one-file change to .claude/commands/find-mergeable-claude-prs.md, a markdown-based slash command. It introduces a state jq helper that treats an empty-string .conclusion as missing and falls back to .status, replacing the previous (.conclusion // .status) expression in the two places it was used.
Security risks
None. This is a slash command definition file consumed by Claude Code locally; it has no impact on production code, auth, or shared infrastructure. The change is purely a logic correction inside a jq expression.
Level of scrutiny
Low. The change is small, self-contained, and the bug being fixed is well-understood: jq's // operator only short-circuits on null and false, so "" // .status evaluates to "" rather than falling through. The new helper if (.conclusion // "") != "" then .conclusion else .status end correctly normalizes both null and "" to the status fallback, and it's applied consistently to both call sites.
Other factors
The bug hunting system found no issues. The PR description includes a concrete observed failure (PR #1422 with 48 still-running sweeps falsely passing) and a sensible manual test plan. No prior reviewer comments in the timeline. Straightforward approve.
Summary
ghreturnsconclusion: ""(empty string, notnull) for QUEUED / IN_PROGRESS checks, so jq's//operator did not fall through to.status— the filter saw""and never matched the pending-status guard.statejq helper that treats empty conclusion as missing and falls back to.status, and apply it wherever the effective check state is consulted.Test plan
/find-mergeable-claude-prsand confirm PRs with QUEUED/IN_PROGRESS sweep jobs are excluded.🤖 Generated with Claude Code