Skip to content

feat(notifications): add per-repo summary section for the maintainer recap - #4320

Merged
JSONbored merged 1 commit into
JSONbored:mainfrom
dhgoal:feat/maintainer-recap-per-repo
Jul 8, 2026
Merged

feat(notifications): add per-repo summary section for the maintainer recap#4320
JSONbored merged 1 commit into
JSONbored:mainfrom
dhgoal:feat/maintainer-recap-per-repo

Conversation

@dhgoal

@dhgoal dhgoal commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Adds a per-repo summary section for the #1963 maintainer recap digest (Closes #2241).

A pure section builder over a RecapReport projection: a compact per-repo breakdown of PRs reviewed / merged / closed in the window, sorted by volume (reviewed = the terminal-outcome sample size) and capped at 8 with a (+N more) remainder line — mirroring listSuffix at src/review/alerts.ts:158. Zero-activity repos (reviewed === 0) are excluded, and every repo label is scrubbed through the shared redaction primitive (PUBLIC_LOCAL_PATH_SCRUB_PATTERN) before emitting.

Ships in its own file (src/services/maintainer-recap-per-repo.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-per-repo.test.ts — sort order, the tie-break (localeCompare) arm, the cap + remainder on both the <=8 and >8 branches, zero-activity exclusion, the empty/no-activity arm, and repo-label redaction. 100% statements / branches / functions / lines on the new module.

@dhgoal
dhgoal requested a review from JSONbored as a code owner July 8, 2026 20:44
@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.94%. Comparing base (46a19f8) to head (6cb8658).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4320   +/-   ##
=======================================
  Coverage   93.94%   93.94%           
=======================================
  Files         397      398    +1     
  Lines       36760    36773   +13     
  Branches    13432    13434    +2     
=======================================
+ Hits        34535    34548   +13     
  Misses       1569     1569           
  Partials      656      656           
Files with missing lines Coverage Δ
src/services/maintainer-recap-per-repo.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.

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

loopover-orb Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Warning

🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-08 21:18:50 UTC

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

⏸️ Suggested Action - Manual Review

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

Review summary
This adds a small, pure section builder (`buildPerRepoRecapSection`) that projects `RecapReport` data into a capped, sorted, redacted per-repo breakdown for the maintainer recap digest, closing #2241. The logic is correct: volume-descending sort with a deterministic `localeCompare` tie-break, exclusion of zero-activity repos, an 8-item cap with an accurate `(+N more)` remainder, and redaction of repo labels via the shared `PUBLIC_LOCAL_PATH_SCRUB_PATTERN` primitive. It stays isolated (new file only, no shared-file edits, no delivery/scheduling wiring), mirrors the existing `MAX_LISTED`/`listSuffix` convention from `src/review/alerts.ts`, and the accompanying test suite exercises every branch (sort, tie-break, both sides of the cap boundary, empty/zero-activity, and redaction) with 100% coverage on the new module.

Nits — 6 non-blocking
  • src/services/maintainer-recap-per-repo.ts:53 — the `.slice(0, 240)` length cap is an unexplained magic number; name it as a constant (e.g. `MAX_LABEL_LENGTH = 240`) like `MAX_LISTED` is above it.
  • src/services/maintainer-recap-per-repo.ts:78 and :96 — `row.repo` is already sanitized when the rows are built, then `lines.map(sanitizeRecapText)` re-sanitizes every line again; harmless but redundant, consider sanitizing once at the point the repo label enters the row and dropping the second pass over `lines`.
  • No test asserts `merged + closed <= reviewed` or that the counts are otherwise self-consistent — not this file's responsibility since it's a pure projection, but worth a one-line comment noting the invariant is assumed from the upstream `RecapReport` producer.
  • Consider extracting the `240`-char cap into a shared constant if other recap sections (e.g. maintainer-recap-calibration.ts) apply the same limit, to keep the value single-sourced.
  • Since this section is decoupled by design with no delivery wiring yet, a short follow-up note (issue or TODO) on where/when it gets registered with the formatter would help track the remaining integration work.
  • Touches a guarded path — held for manual review — A maintainer must review and merge this change.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #2241
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: 118 registered-repo PR(s), 73 merged, 7 issue(s).
Contributor context ✅ Confirmed Gittensor contributor dhgoal; Gittensor profile; 118 PR(s), 7 issue(s).
Gate result ⚠️ Not blocking Advisory; not blocking this PR.
Linked issue satisfaction

Addressed
The PR adds buildPerRepoRecapSection with the exact sort-by-volume/cap-at-8/remainder-line behavior mirroring listSuffix, applies the shared redaction primitive to each repo label, and includes unit tests covering sort order, both cap branches (<=8 and >8), and zero-activity exclusion as required.

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: 118 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

…recap

Pure section builder over a RecapReport projection: a compact per-repo breakdown of
PRs reviewed / merged / closed in the window, sorted by volume and capped at 8 with a
'(+N more)' remainder line (mirroring listSuffix in src/review/alerts.ts). Zero-activity
repos are excluded and every repo label is scrubbed via the shared redaction primitive.

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

Closes JSONbored#2241
@dhgoal
dhgoal force-pushed the feat/maintainer-recap-per-repo branch from a32f0a0 to 6cb8658 Compare July 8, 2026 23:15
@JSONbored
JSONbored merged commit 8800d27 into JSONbored:main Jul 8, 2026
7 of 8 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): per-repo summary section for the maintainer recap

2 participants