Skip to content

fix(root): early-exit iyarc-prune cron only for open PRs - #9648

Open
ralph-bitgo[bot] wants to merge 1 commit into
masterfrom
wcn-2575-iyarc-prune-open-pr-exit
Open

fix(root): early-exit iyarc-prune cron only for open PRs#9648
ralph-bitgo[bot] wants to merge 1 commit into
masterfrom
wcn-2575-iyarc-prune-open-pr-exit

Conversation

@ralph-bitgo

@ralph-bitgo ralph-bitgo Bot commented Sep 3, 2026

Copy link
Copy Markdown

What

  • Rewrites the "Early exit" section of the iyarc-prune agent prompt
    (.claude/agents/iyarc-prune.md) so only an open PR on an
    osv-scanner-prune/* head branch blocks a run.
  • Replaces the search-based check
    (gh pr list --state open --search "head:osv-scanner-prune/") with a
    state-filtered JSON + jq command whose empty / non-empty output maps
    directly to "continue" / "stop and report".
  • Explicitly forbids inferring an open PR from branch existence or from
    --state all / --state merged listings — branches from merged prune
    PRs linger until deleted and must not trigger the early exit.

Why

The 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
merges, every subsequent weekly run would keep exiting early, the cron
stalls indefinitely, and stale osv-scanner.toml exclusions go unpruned —
defeating the purpose of the weekly prune.
Ticket: WCN-2575

Observed in run 33363611227:
the agent ended the run in 2 turns after matching an existing PR instead of
evaluating exclusions.

Test plan

Ticket: WCN-2575

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
@linear-code

linear-code Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

WCN-2575

@ralph-bitgo
ralph-bitgo Bot force-pushed the wcn-2575-iyarc-prune-open-pr-exit branch from 8093312 to a51d64f Compare September 3, 2026 17:53
@zahin-mohammad
zahin-mohammad marked this pull request as ready for review September 3, 2026 17:58
@zahin-mohammad
zahin-mohammad requested review from a team as code owners September 3, 2026 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants