Skip to content

feat(review): add a category-tally line to the unified review comment (#2150) - #3865

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
nickmopen:feat/category-breakdown-line
Jul 6, 2026
Merged

feat(review): add a category-tally line to the unified review comment (#2150)#3865
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
nickmopen:feat/category-breakdown-line

Conversation

@nickmopen

Copy link
Copy Markdown
Contributor

Closes #2150.

Adds a compact, deterministic one-liner of the finding mix (e.g. 2 correctness · 1 security · 1 style) to the unified comment, so maintainers see the category spread at a glance. Pure aggregation + render — no AI, no gate impact.

What's here

  • unified-comment.ts — pure tallyFindingCategories(findings): counts categorized findings, ordered by count desc then category name asc (deterministic). A local UnifiedFindingCategory type keeps this renderer self-contained (no cross-module import, matching the module's convention). Rendered as a one-line summary right after the blockers section; omitted entirely when no finding carries a category ⇒ byte-identical. A new optional UnifiedReviewInput.inlineFindings (structural { category? } shape, so an InlineFinding[] is assignable without importing it) supplies the data — absent by default ⇒ byte-identical.
  • Tests — tally ordering (count desc, name-tie asc), single category, uncategorized ignored, empty; render line present with categorized findings and omitted (byte-identical) when none.

Validation

Full suite (npm run test):

Test Files  532 passed | 2 skipped (534)
     Tests  10577 passed | 7 skipped   (0 failed)

Typecheck clean.

…JSONbored#2150)

Adds a compact, deterministic one-liner of the finding mix (e.g.
"2 correctness · 1 security · 1 style") to the unified comment so maintainers see the
category spread at a glance. Pure aggregation + render; no AI, no gate impact.

- unified-comment.ts: pure tallyFindingCategories(findings) — counts CATEGORIZED
  findings, ordered by count desc then category name asc (deterministic); a local
  UnifiedFindingCategory type keeps this renderer self-contained (no cross-module
  import). Rendered as a one-line summary right after the blockers section; omitted
  entirely when no finding carries a category ⇒ byte-identical. New optional
  UnifiedReviewInput.inlineFindings (structural { category? } shape) supplies it.
- Tests: tally ordering (count desc, name-tie asc), single category, uncategorized
  ignored, empty; render line present with categorized findings, omitted (byte-identical)
  when none.

Verified: full suite (npm run test) green — 10577 passed, 0 failed.
@nickmopen
nickmopen requested a review from JSONbored as a code owner July 6, 2026 20:20
@superagent-security

Copy link
Copy Markdown
Contributor

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

@loopover-orb loopover-orb Bot added the gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. label Jul 6, 2026
@loopover-orb

loopover-orb Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Tip

🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩

✅ Gittensory review result - approve/merge recommended

Review updated: 2026-07-06 20:29:01 UTC

2 files · 1 AI reviewer · no blockers · readiness 82/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This adds a pure, deterministic tally of categorized inline findings (tallyFindingCategories) and renders it as an optional one-line summary in the unified comment, guarded to be fully byte-identical when no categorized findings are supplied. The sort (count desc, category name asc) and omission-when-empty logic are both correctly implemented and covered by tests for ordering, ties, uncategorized-ignore, and byte-identical absence. The change is additive, presentation-only, and has no gate/AI impact, matching its stated scope.

Nits — 5 non-blocking
  • src/review/unified-comment.ts: the local UnifiedFindingCategory type is a hand-duplicated copy of the enum in finding-category-classify.ts; if that source enum gains/removes a category, this copy can silently drift out of sync since nothing enforces parity.
  • No test covers all six categories tallied together or a three-way tie, though the two-way tie and basic ordering cases give reasonable confidence the sort is correct.
  • The render test only asserts the tally line's presence/content, not its position relative to the blockers and failing-CI-checks blocks; a full-comment ordering snapshot would make regressions in block order more visible.
  • Consider importing/deriving UnifiedFindingCategory from finding-category-classify.ts (e.g., via `import type`) instead of duplicating the literal union, even if the runtime tally logic stays self-contained — this keeps the type in sync without adding a runtime cross-module dependency.
  • Add one test case with all six categories present to lock in the full sort order end-to-end.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #2150
Related work ⚠️ 1 scoped overlap Top overlaps are listed below; lower-confidence bulk is hidden.
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: 150 registered-repo PR(s), 101 merged, 9 issue(s).
Contributor context ✅ Confirmed Gittensor contributor nickmopen; Gittensor profile; 150 PR(s), 9 issue(s).
Gate result ✅ Passing No configured blocker found.
Review context
  • Author: nickmopen
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: TypeScript
  • Official Gittensor activity: 150 PR(s), 9 issue(s).
  • Related work: Titles/paths share 6 meaningful terms. (issue #2159, issue #2150)
Contributor next steps
  • Review top overlaps.
  • Add a concise scope and risk note.
  • Check active issues and PRs before submitting.
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.

🟩 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 Gittensory, a quiet PR intelligence layer for OSS maintainers.

  • Re-run Gittensory review

@codecov

codecov Bot commented Jul 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.48%. Comparing base (9778413) to head (5b123cf).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3865   +/-   ##
=======================================
  Coverage   93.48%   93.48%           
=======================================
  Files         333      333           
  Lines       33172    33182   +10     
  Branches    12134    12138    +4     
=======================================
+ Hits        31011    31021   +10     
  Misses       1530     1530           
  Partials      631      631           
Files with missing lines Coverage Δ
src/review/unified-comment.ts 99.54% <100.00%> (+0.02%) ⬆️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@loopover-orb loopover-orb Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gittensory approves — the gate is satisfied and CI is green.

@loopover-orb
loopover-orb Bot merged commit 6a0fb60 into JSONbored:main Jul 6, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(review): category breakdown line in the unified review comment

1 participant