Skip to content

fix(review): stop the Code review row contradicting itself when AI never ran#7946

Merged
JSONbored merged 1 commit into
mainfrom
fix/code-review-blocker-mislabel
Jul 21, 2026
Merged

fix(review): stop the Code review row contradicting itself when AI never ran#7946
JSONbored merged 1 commit into
mainfrom
fix/code-review-blocker-mislabel

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

  • Fixes a real UX bug found while investigating metagraphed PR test(selfhost): add unit-test seam for validate-selfhost-sourcemap #7491: when AI review never runs at all (e.g. a concurrent duplicate pass defers) but a deterministic gate blocker is still present (buildDualReviewNotes's FIX D1 deliberately folds gate blockers into the same list), the unified comment rendered a self-contradictory "1 blocker (No AI review summary)" line — reading as an AI pass that silently found something, when actually AI review never ran and something else entirely is blocking the PR.
  • codeReviewRow now says so plainly: "1 blocker (no AI review ran — blocker is from a non-AI gate check)" when reviewerCount is 0 and a blocker is present. The zero-blocker case ("No blockers (No AI review summary)") is unchanged.

Scope

  • Single function + its doc comment, plus tests. No behavior change to the gate's actual merge/close decision — this only fixes what the comment says about it.

Validation

  • npm run typecheck
  • npx vitest run test/unit/unified-comment.test.ts — 105 passed (2 new)
  • Coverage check confirmed zero uncovered statements/branches in the changed function; no existing test asserted the old contradictory string, so nothing broke.

Notes

…ver ran

buildDualReviewNotes (FIX D1) deliberately folds the gate's own
deterministic hard blockers into the same blocker list AI findings
use, so a non-AI gate failure still populates "Why this is blocked"
even with zero AI reviewers. But codeReviewRow's evidence text stayed
"No AI review summary" unconditionally, so a PR blocked purely by a
deterministic check (AI review inconclusive, e.g. a concurrent
duplicate pass) rendered "1 blocker (No AI review summary)" -- reading
as an AI pass that silently found something, not "AI review never ran;
a separate check is what's blocking this."

A blocker present with reviewerCount 0 can only be that deterministic
fold-in (a fresh ai_consensus_defect needs an actual review pass to
exist), so the evidence text now says so plainly in that case.
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.12%. Comparing base (4482d47) to head (a390bf1).
⚠️ Report is 2 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7946      +/-   ##
==========================================
- Coverage   91.83%   89.12%   -2.71%     
==========================================
  Files         735       91     -644     
  Lines       75433    21762   -53671     
  Branches    22950     3819   -19131     
==========================================
- Hits        69272    19396   -49876     
+ Misses       5083     2187    -2896     
+ Partials     1078      179     -899     
Flag Coverage Δ
shard-1 75.58% <100.00%> (+17.24%) ⬆️
shard-2 84.10% <100.00%> (+31.98%) ⬆️
shard-3 96.51% <100.00%> (+46.49%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/review/unified-comment.ts 99.61% <100.00%> (+<0.01%) ⬆️

... and 644 files with indirect coverage changes

@JSONbored JSONbored self-assigned this Jul 21, 2026
@JSONbored
JSONbored merged commit 002a864 into main Jul 21, 2026
14 checks passed
@JSONbored
JSONbored deleted the fix/code-review-blocker-mislabel branch July 21, 2026 20:36
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