feat(notifications): render the maintainer recap digest body (#2240)#4415
Conversation
|
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 #4415 +/- ##
=======================================
Coverage 93.96% 93.97%
=======================================
Files 401 401
Lines 36913 36922 +9
Branches 13497 13499 +2
=======================================
+ Hits 34687 34696 +9
Misses 1570 1570
Partials 656 656
🚀 New features to boost your workflow:
|
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-09 17:22:56 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 4 non-blocking
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🟩 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.
|
Fixes #2240.
Adds
formatMaintainerRecap(report: RecapReport): stringinsrc/services/maintainer-recap.ts— the pure markdown digest-body renderer for the #1963 recap. The builder (buildMaintainerRecap, #2239) and the Discord/Slack embed delivery already exist, but there was no reusable string formatter that turns aRecapReportinto a titled-section body. This is that seam, mirroringformatWeeklyValueReportMarkdown(weekly-value-report.ts): a header plus## Summary,## Totals, and## Per-reposections. No delivery, no I/O.What it does
# Maintainer recap) with generated timestamp, window, and repo count.## Summaryfromreport.summary;## Totalsfromreport.totals(with ann/afalse-positive rate when nothing was blocked);## Per-repofromreport.repos.redactRecapLine, which composes the shared redaction primitives fromsrc/signals/redaction.ts:PUBLIC_LOCAL_PATH_SCRUB_PATTERNscrubs an absolute local path to<redacted-path>, thenPUBLIC_UNSAFE_PATTERNblanks the whole line to<redacted>if any economic/identity term (reward/score/wallet/payout/…) survives. Defense in depth: the builder already sanitizes, but the formatter re-guards every emitted line so a hand-built or future report can never leak a private term into a digest.Tests
test/unit/maintainer-recap-format.test.ts:n/arate;payoutline is fully redacted (arm 2).Covers every added branch (fallback vs populated section, null vs numeric rate, redaction no-op vs path-scrub vs term-blank).