From a51d64f8abe3828ce5b49e9a2a9a09e7d38d1ad2 Mon Sep 17 00:00:00 2001 From: Zahin Mohammad Date: Thu, 3 Sep 2026 17:52:44 +0000 Subject: [PATCH] fix(root): early-exit iyarc-prune cron only for open PRs The weekly iyarc-prune cron exited early whenever it found a PR on an osv-scanner-prune/* branch, even when that PR was already merged or closed. Once a prune PR merged, every later cron run would stall indefinitely and osv-scanner.toml exclusions would go unpruned. The prompt's early-exit section now states that only an OPEN PR on an osv-scanner-prune/* head branch blocks the run, and replaces the search-based check with a state-filtered JSON + jq command whose empty or non-empty output maps directly to continue/stop. It also forbids inferring an open PR from branch existence (branches from merged prune PRs linger until deleted) and from --state all/merged listings. Ticket: WCN-2575 Session-Id: c19d17dd-71af-4883-b007-1e7d84e7b2a6 Task-Id: b92fbe0d-d3ea-4662-8f6a-6f12627a5251 --- .claude/agents/iyarc-prune.md | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/.claude/agents/iyarc-prune.md b/.claude/agents/iyarc-prune.md index 774ed456f4..61c1057d3b 100644 --- a/.claude/agents/iyarc-prune.md +++ b/.claude/agents/iyarc-prune.md @@ -45,10 +45,22 @@ over an unsafe or unverified bump. ## Early exit (do this first) -If an open PR already exists on a branch matching `osv-scanner-prune/*`, stop and -report — do not open a second: +Only an OPEN pull request whose head branch matches `osv-scanner-prune/*` blocks +this run. A merged or closed PR does NOT block — proceed with the rest of this +run even if such a PR, or the stale `osv-scanner-prune/*` branch it leaves +behind, still exists. - gh pr list --state open --search "head:osv-scanner-prune/" +Run this check and decide on the parsed state, never on "a PR row exists": + + gh pr list --state open --json number,state,headRefName --jq '.[] | select(.headRefName | startswith("osv-scanner-prune/"))' + +- Non-empty output: an open prune PR exists — stop and report — do not open a + second. Name the open PR number(s) and head branch(es) in the report. +- Empty output: no open prune PR — continue with the rest of this run. + +Do not use `--state all` / `--state merged` for this check, and do not infer an +open PR from the mere existence of an `osv-scanner-prune/*` branch: branches +from merged prune PRs linger until deleted and must not trigger this early exit. ## Read context first