fix(review): stop silently dropping blockers/nits past 12 in the unified comment - #9766
Conversation
…ied comment `dedupeLines` defaulted to a hard cap of 12, so the blockers and nits lists were truncated to 12 items *before* the disclosed truncation stage. Two consequences: the human list was cut with no "+N more" footer (the overflow looked like it did not exist), and the "Copy for AI agents" block — which promises *every* blocker — never received findings 13+. The `changedFiles` status chip and the code-review signal row also counted the raw, un-deduped `input.blockers`, so a duplicate blocker could inflate the chip past what the rendered section actually lists. Make `dedupeLines` un-capped by default and keep the 12-item display cap at the `truncateFindingsForDisplay` call site (the disclosed-truncation stage), so overflow now renders a real "+N more" footer while the AI-context block stays complete. Derive both blocker counts from the deduped set. Closes JSONbored#9670
|
🚨 Contributor flagged. Click here for more info: Superagent Dashboard |
|
Warning ⏸️ LoopOver review result - manual review recommendedReview updated: 2026-07-29 07:27:54 UTC
Review summary Nits — 3 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. Decision record
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9766 +/- ##
===========================================
- Coverage 90.27% 76.68% -13.59%
===========================================
Files 904 283 -621
Lines 113213 59689 -53524
Branches 26859 8593 -18266
===========================================
- Hits 102202 45773 -56429
- Misses 9680 13630 +3950
+ Partials 1331 286 -1045
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Held for manual review: the gate and required CI are green, but GitHub reports this pull request's mergeable state as |
What & why
The unified review comment's
dedupeLineshelper defaulted to a hard cap of 12, and both the blockers and nits lists were passed through it before the disclosed truncation stage (truncateFindingsForDisplay). That produced three user-visible defects:changedFilesstatus chip and the code-review signal row counted the raw, un-dedupedinput.blockers, so a case-insensitive duplicate could make the chip claim a higher number (e.g.`3 blockers`) than the rendered "Why this is blocked" section actually lists.The fix
dedupeLinesis now un-capped by default (cap = Number.POSITIVE_INFINITY); callers that want a genuine hard cap (e.g.actionReasonBullets'dedupeLines(reasons, 8)) still pass one explicitly.truncateFindingsForDisplaycall site (?? DEFAULT_FINDINGS_DISPLAY_CAP) — the disclosed-truncation stage — so an unsetmaxFindingsCapsstill caps the human list, but now with a real "+N more" footer instead of silent loss, whilebuildAiContextBlockreceives the full deduped set.dedupeLines(input.blockers ?? []).length), so duplicates can no longer inflate them past what the section renders.Behavior is unchanged when a list already fits within the cap (verified byte-identical), and explicit
maxFindingsCapsvalues still win.Tests
Added a
#9670sub-suite totest/unit/unified-comment.test.ts:+1 morefooter, while the AI-context block lists all 13.+1 morefooter and the section label counts all 13.`2 blockers`, never`3 blockers`).Each new test fails against the un-patched source (regression-proven), and the whole
renderUnifiedReviewCommentdiff is at 100% line and branch coverage locally.Validation
npm run test:cigreen (unified-comment + full suite).git diff --checkclean; no generated-artifact, schema, wrangler, or migration changes — nothing to regenerate.src/review/unified-comment.ts+ its unit test.Closes #9670