Skip to content

feat(notifications): add top-N contributor summary section for the maintainer recap - #4343

Merged
JSONbored merged 1 commit into
JSONbored:mainfrom
dhgoal:feat/maintainer-recap-top-contributors
Jul 9, 2026
Merged

feat(notifications): add top-N contributor summary section for the maintainer recap#4343
JSONbored merged 1 commit into
JSONbored:mainfrom
dhgoal:feat/maintainer-recap-top-contributors

Conversation

@dhgoal

@dhgoal dhgoal commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Adds a top-N contributor summary section for the #1963 maintainer recap digest (Closes #2244).

A pure section builder over a RecapReport projection: a leaderboard of the window's most-merged contributor logins with merged-PR counts only — no scoring / reward / trust internals. Every emitted line (login: N merged) is gated through isPublicSafeText (src/signals/redaction.ts) before it can surface, so a login carrying an economic/identity term (or a local path) is dropped and counted. Survivors are sorted by merged descending, ties broken by login ascending, then capped at the limit (default 8).

Ships in its own file (src/services/maintainer-recap-top-contributors.ts), mirroring the calibration section (#2243) so it stays decoupled from the foundation builder (#2239) and sibling sections — no shared-file edits, no delivery, no scheduling.

Test

test/unit/maintainer-recap-top-contributors.test.ts — sort order, the tie-break (localeCompare) arm, the cap, both public-safe gate arms (kept vs a reward/score-bearing login dropped), the empty / all-dropped / non-positive-limit arms, and the default limit. 100% statements / branches / functions / lines on the new module.

@dhgoal
dhgoal requested a review from JSONbored as a code owner July 8, 2026 23:49
@superagent-security superagent-security Bot added the contributor:flagged Contributor flagged for review by trust analysis. label Jul 8, 2026
@superagent-security

Copy link
Copy Markdown
Contributor

🚨 Contributor flagged. Click here for more info: Superagent Dashboard

@superagent-security

Copy link
Copy Markdown
Contributor

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

@codecov

codecov Bot commented Jul 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.96%. Comparing base (ca5576f) to head (a7b4f20).
⚠️ Report is 19 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4343   +/-   ##
=======================================
  Coverage   93.96%   93.96%           
=======================================
  Files         401      402    +1     
  Lines       36869    36881   +12     
  Branches    13480    13482    +2     
=======================================
+ Hits        34644    34656   +12     
  Misses       1569     1569           
  Partials      656      656           
Files with missing lines Coverage Δ
src/services/maintainer-recap-top-contributors.ts 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…intainer recap

Pure section builder over a RecapReport projection: a leaderboard of the window's
most-merged contributor logins with merged-PR counts only — no scoring/reward/trust
internals. Every emitted line is gated through isPublicSafeText before it can surface,
so a login carrying an economic/identity term (or a local path) is dropped. Sorted by
merged descending, ties broken by login, capped at the limit.

Own file (maintainer-recap-top-contributors.ts) mirroring the calibration section, so
it stays decoupled from the foundation builder and sibling sections.

Closes JSONbored#2244
@dhgoal
dhgoal force-pushed the feat/maintainer-recap-top-contributors branch from d22f704 to a7b4f20 Compare July 9, 2026 07:40
@loopover-orb loopover-orb Bot added the gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. label Jul 9, 2026
@loopover-orb

loopover-orb Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Caution

🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥

🛑 Gittensory review result - fixes required

Review updated: 2026-07-09 11:41:08 UTC

2 files · 1 AI reviewer · no blockers · readiness 82/100 · CI failing · unstable

🛑 Suggested Action - Fix Blockers

  • Touches a guarded path — held for manual review: This PR changes guardrail-protected path(s): src/services/maintainer-recap-top-contributors.ts (matched src/services/**).

Review summary
This adds a small, self-contained pure function (buildTopContributorsRecapSection) plus a matching test file, mirroring the existing calibration-section pattern (#2243). Logic is correct: stable descending sort on merged count with login-ascending tiebreak, a public-safe gate (isPublicSafeText) applied per-line before inclusion, and Math.max(0, limit) correctly handles non-positive limits. Tests hit 100% branch coverage including both gate arms, the tie-break arm, empty/all-dropped/zero-limit arms, and the default-limit arm — genuinely exercising the real code path, not fabricated states. The module isn't wired into any delivery/scheduling path yet, but that's consistent with the stated intent (mirrors #2243's decoupled section pattern) rather than a defect.

Nits — 6 non-blocking
  • The fallback line `No contributor activity in the last N day(s).` fires both when there truly was zero activity and when all contributors were dropped by the public-safe gate (src/services/maintainer-recap-top-contributors.ts:63-66) — worth distinguishing 'no activity' from 'activity redacted' in the copy so a maintainer isn't misled into thinking the window was silent.
  • isPublicSafeText's exact contract (what patterns it flags) isn't visible in this diff — confirm it's designed for arbitrary free-text lines like `login: N merged` and not just isolated tokens, since a false negative here is the only thing standing between a login and a leaked term.
  • The JSDoc blocks are fairly verbose for a small, self-explanatory pure function — consider trimming to keep the file scannable, though this is purely stylistic.
  • Confirm this section is intended to stay unwired for now (per the calibration-section precedent) and that a follow-up PR will handle composing it into the actual recap delivery path — worth a one-line note in the PR description if that's the plan.
  • Consider asserting `section.dropped` explicitly in the sort/tie-break/cap tests (currently only the gate test checks `dropped`) to make the invariant `withLines.length === rows.length + dropped` explicit across all scenarios.
  • Touches a guarded path — held for manual review — A maintainer must review and merge this change.

CI checks failing

  • Contributor trust — Contributor flagged for review
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #2244
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: 99 registered-repo PR(s), 64 merged, 7 issue(s).
Contributor context ✅ Confirmed Gittensor contributor dhgoal; Gittensor profile; 99 PR(s), 7 issue(s).
Gate result ⚠️ Not blocking Advisory; not blocking this PR.
Linked issue satisfaction

Addressed
The diff adds buildTopContributorsRecapSection with sorted {login, merged} rows capped at a limit (default 8), ties broken by login ascending, and gates every emitted line through isPublicSafeText, dropping and counting unsafe lines exactly as specified.

Review context
  • Author: dhgoal
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: not available
  • Official Gittensor activity: 99 PR(s), 7 issue(s).
  • Related work: Titles/paths share 7 meaningful terms. (issue #2240, issue #2244)
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

@loopover-orb

loopover-orb Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Gittensory is closing this pull request on the maintainer's behalf (CI is failing (Contributor trust)). 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.

@JSONbored
JSONbored merged commit fa37b62 into JSONbored:main Jul 9, 2026
14 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor:flagged Contributor flagged for review by trust analysis. gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

Development

Successfully merging this pull request may close these issues.

feat(notifications): top-N contributor summary section for the maintainer recap (public-safe)

2 participants