Skip to content

fix(pr-management-triage): filter action_required runs server-side - #1088

Open
potiuk wants to merge 1 commit into
apache:mainfrom
potiuk:fix/action-required-run-index
Open

fix(pr-management-triage): filter action_required runs server-side#1088
potiuk wants to merge 1 commit into
apache:mainfrom
potiuk:fix/action-required-run-index

Conversation

@potiuk

@potiuk potiuk commented Aug 13, 2026

Copy link
Copy Markdown
Member

fetch-and-batch.md builds the repo-wide action_required index from an
unfiltered event=pull_request listing, post-filtered on conclusion and
capped at the first three pages, justified by the claim that
?status=action_required "matches no runs in this state and silently returns
an empty result"
.

The claim is incorrect, and the framework already contradicts itself —
SKILL.md Golden rule 1b uses ?status=action_required&head_sha=<SHA>.

Measured impact

Full triage sweep against a large adopter repo (2026-08):

approach pending head SHAs found
?status=action_required, paginated 322
documented 3-page event=pull_request post-filter 9

?status=action_required reported 1109 matching runs. The 3-page window
reached back only ~12 hours, because that repo produces ~300 pull_request
runs in that time. Every PR in the ~313-SHA gap whose rollup was green from bot
checks alone (Mergeable, WIP, DCO) classified as passing and became a
mark-ready candidate — the precise false-positive class this index exists to
prevent, and the one Golden rule 1b is written to stop.

Changes

  • fetch-and-batch.md: filter server-side, walk every page, and note the
    1000-result listing cap with the created:-window workaround. The incorrect
    rationale is replaced with the measured one.
  • actions.md: the two per-PR lookups are scoped to a single head SHA and were
    never affected by the truncation. Their code is unchanged; only the
    inaccurate claim in the comments is corrected, with a pointer to why the
    repo-wide case differs.

A conclusion post-filter over the filtered set is kept as belt-and-braces,
and stays correct for a host whose API build ignores status.


Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Opus 5)

Generated-by: Claude Code (Opus 5)

The repo-wide pending-approval index is documented as an unfiltered
`event=pull_request` listing, post-filtered on `conclusion` and capped
at the first three pages, on the stated grounds that
`?status=action_required` "matches no runs in this state". That premise
is wrong — the parameter does match, and SKILL.md Golden rule 1b
already depends on it, so the two files contradict each other.

The consequence is a silent under-report rather than an error. The
listing is newest-first across all states, so on a busy repository
three pages reach back only a few hours while the approval backlog is
unbounded. A sweep on a large adopter repo saw 9 of 322 pending head
SHAs; every PR in the gap whose rollup was green from bot checks alone
classified as passing and became a mark-ready candidate, which is the
exact false-positive the index exists to prevent.

The per-PR lookups in actions.md are scoped to a single head SHA and
were never affected by the truncation, so their code is left alone and
only the inaccurate rationale is corrected.

Generated-by: Claude Code (Opus 5)
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.

1 participant