AntFleet

Disagreement · bdb225d0-anthropic-5

`outgoingPrs.mergeSha` lacks a CHECK or NOT NULL constraint despite the receipts loader treating it as required

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

Opus finding

`outgoingPrs.mergeSha` lacks a CHECK or NOT NULL constraint despite the receipts loader treating it as required

lowdata-losshigh
  • apps/web/db/schema.ts:175-195
  • apps/web/lib/receipts.ts:100-130
The schema allows a row to be `status='merged'` while mergeSha or mergedAt is null. mapMergedRowsToReceipts defensively skips such rows, but they would silently disappear from /receipts without any operator-visible warning. A CHECK constraint pinning (status='merged' implies mergeSha IS NOT NULL AND mergedAt IS NOT NULL) would surface bad writes at insert time. The author acknowledges this in a code comment ('the table has no CHECK constraint pinning that invariant').

Recommendation

Add a CHECK constraint: `CHECK ((status <> 'merged') OR (merge_sha IS NOT NULL AND merged_at IS NOT NULL))`.

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 →