Skip to content

fix(review): stop restating blockers twice in the PR review comment - #5378

Merged
JSONbored merged 1 commit into
mainfrom
claude/fix-duplicate-blocker-comment
Jul 12, 2026
Merged

fix(review): stop restating blockers twice in the PR review comment#5378
JSONbored merged 1 commit into
mainfrom
claude/fix-duplicate-blocker-comment

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

  • Confirmed on PR feat(miner): add schema-version migration runner across local stores #5347's live review comment: the "Blockers" bullet under "Suggested Action" and the "Why this is blocked" section further down showed byte-identical text.
  • Root cause: gateVerdictReason() (src/review/unified-comment-bridge.ts) fell back to gate.summary for the top-level reason line. evaluateGateCheckCore's summary for a "failure" conclusion is literally gate.blockers restated as one joined string (title + + action per finding, joined with "; "). The "Why this is blocked" section a few lines below independently renders those same gate.blockers (folded in via buildDualReviewNotes's gateBlockers param) — so a blocked/reject-close comment printed the identical blocker text twice.
  • The existing test suite's gate() helper always hand-set a short, generic summary string ("A hard blocker was found.") rather than the realistic blockers-restated value evaluateGateCheckCore actually produces in production, so this slipped past every existing test.

Fix

gateVerdictReason now only falls back to gate.summary/gate.title when gate.blockers is empty. Structurally, evaluateGateCheckCore only ever returns a non-empty blockers array on a "failure" conclusion (every neutral/success branch explicitly sets blockers: []), so this is scoped precisely to the case that duplicates — the held/neutral case (which has no "Why this is blocked" section to duplicate against) is unaffected and still shows its own top-level reason exactly as before.

Test plan

  • npm run typecheck — clean
  • Added a regression test using the REALISTIC gate.summary shape (blockers restated), proving the blocker text now appears exactly once
  • Added a coverage test confirming the held/neutral case (no gate blockers) is unaffected
  • Updated one pre-existing test that had encoded the buggy duplicate-fallback behavior as an expected assertion
  • npx vitest run test/unit/unified-comment-bridge.test.ts test/unit/unified-comment.test.ts test/unit/unified-comment-parity.test.ts — 170/170 passing
  • npx vitest run test/unit/queue.test.ts test/unit/queue-2.test.ts test/unit/queue-3.test.ts test/unit/queue-4.test.ts test/unit/queue-5.test.ts (downstream comment-building callers) — 671/671 passing
  • Targeted coverage run across all touching test files: src/review/unified-comment-bridge.ts is 100% lines / 99.6% branches (the one uncovered branch is on an untouched, pre-existing line, not part of this diff)
  • npm run test:engine-parity — clean (this file isn't part of any hand-duplicated twin pair, confirmed)

gateVerdictReason() fell back to gate.summary for the top "Suggested
Action" reason line -- but evaluateGateCheckCore's summary for a
"failure" conclusion is literally gate.blockers restated as one joined
string (title + action per finding). The "Why this is blocked" section
a few lines below independently renders those SAME gate.blockers
(folded in via buildDualReviewNotes), so every blocked/reject PR
comment printed the identical blocker text twice.

The existing test suite's gate() mock always hand-set a short generic
summary ("A hard blocker was found."), never the realistic
blockers-restated value evaluateGateCheckCore actually produces, so
this never got caught locally -- it surfaced live on PR #5347.

Only fall back to gate.summary/title when gate.blockers is empty (the
neutral/held case, which has no "Why this is blocked" section to
duplicate against and is the only state that still needs a top-level
reason).
@superagent-security

Copy link
Copy Markdown
Contributor

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

@codecov

codecov Bot commented Jul 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.37%. Comparing base (a0639fd) to head (94f3b69).
⚠️ Report is 5 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5378      +/-   ##
==========================================
- Coverage   94.41%   94.37%   -0.04%     
==========================================
  Files         551      551              
  Lines       44168    44169       +1     
  Branches    14632    14633       +1     
==========================================
- Hits        41702    41686      -16     
- Misses       1791     1808      +17     
  Partials      675      675              
Flag Coverage Δ
shard-1 43.76% <100.00%> (-0.38%) ⬇️
shard-2 34.14% <100.00%> (-0.41%) ⬇️
shard-3 32.18% <0.00%> (+0.63%) ⬆️
shard-4 31.22% <100.00%> (-0.06%) ⬇️
shard-5 33.11% <0.00%> (-0.21%) ⬇️
shard-6 43.62% <0.00%> (+0.21%) ⬆️

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

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

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JSONbored JSONbored self-assigned this Jul 12, 2026
@JSONbored
JSONbored merged commit f23886d into main Jul 12, 2026
15 checks passed
@JSONbored
JSONbored deleted the claude/fix-duplicate-blocker-comment branch July 12, 2026 15:38
@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant