AntFleet

Disagreement · be39e8a7-anthropic-2

loadCrossRepoReceipts total count includes merged rows missing mergedAt/mergeSha — UI count can drift from displayed rows

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

Opus finding

loadCrossRepoReceipts total count includes merged rows missing mergedAt/mergeSha — UI count can drift from displayed rows

mediumbughigh
  • apps/web/lib/outgoing-prs.ts:192-245
The displayed `recent` list filters out merged rows that have null mergedAt or null mergeSha (a defensive guard). However, the `total` value is a raw COUNT(*) over status='merged' which does NOT apply the same filter. If a row ever reaches status='merged' without both fields (e.g. a partial write, or a future state in markMerged that gets interrupted), the page's total will overstate what's actually displayable. Today markMerged is the only writer of status='merged' and it sets both fields atomically in one UPDATE, so divergence requires a future bug or manual SQL. Still, the invariants should match: either both should filter, or the schema should NOT NULL the fields when status='merged' (CHECK constraint).

Recommendation

Either (a) make the COUNT query include `AND merged_at IS NOT NULL AND merge_sha IS NOT NULL`, or (b) add a CHECK constraint at the DB level enforcing the invariant when status='merged'.

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 →