Skip to content

test(review): cover extractReviewSummary suggestions-merge + sole-reviewer consensus (#6634)#6674

Closed
real-venus wants to merge 1 commit into
JSONbored:mainfrom
real-venus:test/unified-comment-summary-branches-6634
Closed

test(review): cover extractReviewSummary suggestions-merge + sole-reviewer consensus (#6634)#6674
real-venus wants to merge 1 commit into
JSONbored:mainfrom
real-venus:test/unified-comment-summary-branches-6634

Conversation

@real-venus

Copy link
Copy Markdown
Contributor

Summary

extractReviewSummary (src/review/unified-comment.ts:130-143) had two already-shipped branches with no test coverage:

  • Line 136 folds each reviewer's free-form suggestions array into the rendered nits (both are non-blocking). The shared reviewNote test helper only ever passed the default suggestions: [], so the merge was never exercised through the sole entry point buildUnifiedReviewInput.
  • Line 140 computes consensusBlocker = reviewersWithBlockers >= 2 || (valid.length === 1 && reviewersWithBlockers === 1) — the documented "a sole reviewer's blocker still counts as consensus" rule. The existing single-reviewer-with-blocker case never asserted on .consensusBlocker, leaving that arm unverified.

This adds three cases through buildUnifiedReviewInput (the sole entry point that reaches extractReviewSummary):

  • a non-empty suggestions array surfaces in nits, deduped case-insensitively against an explicit nit;
  • a sole reviewer's blocker → consensusBlocker: true (and derived status blocked) — the valid.length === 1 && reviewersWithBlockers === 1 arm, distinct from the existing dual-review "lone blocker is a split → held" case;
  • a sole reviewer with no blocker → consensusBlocker: false.

No production code changeextractReviewSummary's logic is not in question; this only closes the coverage gap on documented behavior.

Closes #6634

Scope

  • The PR title follows type(scope): short summary Conventional Commit format.
  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked a currently open issue this PR resolves (Closes #6634).

Validation

  • git diff --check
  • npm run typecheck
  • npx vitest run test/unit/unified-comment.test.ts — 101 passing (3 new)

If any required check was skipped, explain why:

  • The change is confined to test/unit/unified-comment.test.ts; no src/** line changes, so codecov/patch has no patch surface to gate, and no OpenAPI/cf-typegen/migration/UI regeneration applies.

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • No auth/cookie/CORS/GitHub App/Cloudflare/session changes.
  • No API/OpenAPI/MCP behavior change.
  • No visible UI changes.
  • No docs/changelog changes.

Notes

  • Test-only coverage closure for an existing branch pair; behavior is unchanged.

…iewer consensus (JSONbored#6634)

extractReviewSummary folds each reviewer's free-form `suggestions` into the rendered `nits`
(unified-comment.ts:136) and treats a sole reviewer's blocker as a consensus blocker
(unified-comment.ts:140) — both already-shipped branches were unexercised: the shared test
helper only ever passed the default `suggestions: []`, and the closest single-reviewer-blocker
case never asserted `.consensusBlocker`.

Adds three cases through the sole entry point `buildUnifiedReviewInput`:
- a non-empty `suggestions` array surfaces in `nits`, deduped case-insensitively against explicit nits
- a sole reviewer's blocker → `consensusBlocker: true` (and derived status `blocked`)
- a sole reviewer with no blocker → `consensusBlocker: false`

No production code change — this closes a coverage gap on documented behavior.

Closes JSONbored#6634
@real-venus
real-venus requested a review from JSONbored as a code owner July 16, 2026 18:16
@superagent-security

Copy link
Copy Markdown
Contributor

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

@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.65%. Comparing base (6ac8c1f) to head (48eb24c).
⚠️ Report is 20 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6674   +/-   ##
=======================================
  Coverage   93.65%   93.65%           
=======================================
  Files         681      681           
  Lines       68086    68094    +8     
  Branches    18688    18695    +7     
=======================================
+ Hits        63764    63772    +8     
  Misses       3347     3347           
  Partials      975      975           
Flag Coverage Δ
shard-1 43.91% <ø> (-0.08%) ⬇️
shard-2 36.95% <ø> (+0.07%) ⬆️
shard-3 32.40% <ø> (-0.03%) ⬇️
shard-4 34.12% <ø> (-0.45%) ⬇️
shard-5 31.40% <ø> (+0.45%) ⬆️
shard-6 45.75% <ø> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 1 file with indirect coverage changes

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 16, 2026
@loopover-orb

loopover-orb Bot commented Jul 16, 2026

Copy link
Copy Markdown

Caution

🛑 LoopOver review result - reject/close recommended

Review updated: 2026-07-16 18:36:24 UTC

1 file · 1 AI reviewer · 1 blocker · CI green · clean

🛑 Suggested Action - Reject/Close

Review summary
This is a pure test-only PR adding three new test cases to test/unit/unified-comment.test.ts that exercise two previously uncovered branches in extractReviewSummary: the suggestions-into-nits merge (with case-insensitive dedup) and the sole-reviewer consensusBlocker arm (both true and false cases). The tests are well-targeted, go through the real entry point buildUnifiedReviewInput rather than mocking internals, and closely match the documented behavior described in the PR body. No production code is touched, and CI passed on this commit.

Nits — 6 non-blocking
  • The dedup assertion `nits.filter((n) => n.toLowerCase() === "document the new property.").toEqual(["Document the new property."])` is a good check but relies on array order; consider asserting `nits.length` alongside it for a stronger guarantee if ordering isn't guaranteed elsewhere in the codebase.
  • The comment style mixes inline explanation with test names already containing '(extractReviewSummary's suggestions-merge and sole-reviewer-consensus branches are untested #6634)' — consider a shared header comment above all three new tests instead of repeating the issue reference in each title, for consistency with the rest of the file if it follows that pattern.
  • Consider adding a fourth case where suggestions duplicate each other across two different reviewers (not just against an explicit nit) to fully pin down cross-reviewer dedup behavior.
  • If the file has a naming convention grouping related tests under a nested describe block, consider grouping the three new sole-reviewer/suggestions tests under one for readability.
  • Pull request duplicates other open work — Check for an existing pull request or issue covering this change and coordinate or consolidate before continuing.
  • Readiness score is below the configured threshold — Use the readiness panel as advisory maintainer context; the score does not block this PR.

Why this is blocked

  • Linked issue overlaps another open PR — Review the related PRs before spending reviewer time on duplicate work.
📋 Copy for AI agents — paste into your coding agent
Fix the following blocker(s) from this PR review:

1. Linked issue overlaps another open PR — Review the related PRs before spending reviewer time on duplicate work.

Decision drivers

  • ❌ Code review — 1 blocker (1 reviewer)
  • ❌ Gate result — Blocking (Repo-configured hard blocker found.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ✅ Linked #6634
Related work ⚠️ Same linked issue: #6673 Another open PR references the same linked issue.
Change scope ❌ 8/20 High review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 156 registered-repo PR(s), 87 merged, 20 issue(s).
Contributor context ✅ Confirmed Gittensor contributor real-venus; Gittensor profile; 156 PR(s), 20 issue(s).
Improvement ℹ️ Insufficient signal risk: low · value: insufficient-signal · LLM: minor
Linked issue satisfaction

Addressed
The PR adds tests that pass a non-empty suggestions array through buildUnifiedReviewInput and assert it merges into nits, plus explicit consensusBlocker true/false assertions for the sole-reviewer case, matching all stated requirements.

Review context
Contributor next steps
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
🧪 Chat with LoopOver

Ask 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.

  • @loopover ask &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat &lt;question&gt; answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover mention with a real question is routed to the closest matching read-only command automatically — no exact syntax required.

Full command reference: https://loopover.ai/docs/loopover-commands

🧪 Experimental — new and may change.

🟩 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.

  • Re-run LoopOver review

@loopover-orb

loopover-orb Bot commented Jul 16, 2026

Copy link
Copy Markdown

LoopOver is closing this pull request on the maintainer's behalf (Linked issue overlaps another open PR; duplicate of open PR #6673). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed.

@loopover-orb loopover-orb Bot closed this Jul 16, 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.

extractReviewSummary's suggestions-merge and sole-reviewer-consensus branches are untested

1 participant