AntFleet

Disagreement · 528e46ce-anthropic-5

Cron sweep counts outgoing-PR poll failures only when getUpstreamPrState throws, not when GitHub returns inconsistent merged-without-sha state

solo Opus
repo e24ef98c·PR #10·reviewed 1 week ago

Opus finding

Cron sweep counts outgoing-PR poll failures only when getUpstreamPrState throws, not when GitHub returns inconsistent merged-without-sha state

lowbughigh
  • apps/web/lib/outgoing-prs.ts:98-129
  • apps/web/lib/outgoing-prs.test.ts:119-146
When GitHub returns merged=true, mergedAt set, but merge_commit_sha=null (which happens transiently — GitHub finalizes merge_commit_sha after the merge event), the current logic falls through to markClosed because state.state==='closed'. This persistently marks the PR as declined ('closed-without-merge', honest-report says 'not surfaced publicly'), permanently losing the receipt unless an operator manually inspects. The unit test even encodes this as intended behavior, but the underlying data-loss risk is real: a real merge will be recorded as a decline. POLL_INTERVAL_MS is 1 hour; once status='closed' the row no longer matches loadOpenPrs's status='open' filter and will never be re-polled.

Recommendation

When merged=true but mergeSha is null, treat as unchanged (stampPolled only) so a subsequent poll picks up the finalized SHA. Only transition to 'closed' when merged=false AND state=='closed'.

Other reviewer

The other reviewer flagged nothing in this file/line range.

Why this didn't post

This finding didn't meet AntFleet's unanimous agreement threshold. Both frontier models review every PR independently; only findings they both flag with the same severity and category are posted to the PR. This one fell through.

read the methodology →

From the same review

These findings passed the unanimous gate on the same PR review. The disagreement above was filtered out; the findings below were posted.