Skip to content

feat(notifications): add gate-outcomes section for the maintainer recap#4321

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

feat(notifications): add gate-outcomes section for the maintainer recap#4321
JSONbored merged 1 commit into
JSONbored:mainfrom
dhgoal:feat/maintainer-recap-gate-outcomes

Conversation

@dhgoal

@dhgoal dhgoal commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Adds a gate-outcomes section for the #1963 maintainer recap digest (Closes #2242).

A pure section builder over a RecapReport projection: summarize the gate's window — blocked count, maintainer overrides, and the blocked-then-merged false-positive count plus a rate line. The false-positive rate is nulled below MIN_SAMPLE (5) exactly as gate-precision.ts:103 (a 1-of-few false positive is noise, not a precision signal), which also guards the divide-by-zero (blocked === 0) arm.

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

Test

test/unit/maintainer-recap-gate-outcomes.test.ts — the enough-samples numeric-rate arm, the too-few-samples null arm, the blocked === MIN_SAMPLE boundary, the empty/divide-by-zero arm, three-decimal rounding (mirroring gate-precision.ts), and per-line redaction. 100% statements / branches / functions / lines on the new module.

Pure section builder over a RecapReport projection: summarize the gate's window —
blocked count, maintainer overrides, and the blocked-then-merged false-positive count
plus rate. The false-positive rate is nulled below MIN_SAMPLE (5) exactly as
gate-precision.ts, which also guards the divide-by-zero (blocked === 0) arm.

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

Closes JSONbored#2242
@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

@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 (d329591) to head (ad855ea).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4321   +/-   ##
=======================================
  Coverage   93.94%   93.94%           
=======================================
  Files         397      398    +1     
  Lines       36736    36745    +9     
  Branches    13428    13430    +2     
=======================================
+ Hits        34511    34520    +9     
  Misses       1569     1569           
  Partials      656      656           
Files with missing lines Coverage Δ
src/services/maintainer-recap-gate-outcomes.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

Warning

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

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-08 21:19:53 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-gate-outcomes.ts (matched src/services/**).

Review summary
This adds a small, pure section-builder module (`buildGateOutcomesRecapSection`) that summarizes blocked/overridden/false-positive gate counts for the maintainer recap digest, closing #2242. The false-positive rate is nulled below MIN_SAMPLE=5 (also covering the blocked===0 divide-by-zero case), mirroring the documented gate-precision.ts convention, and the accompanying test suite exercises every branch (enough-samples, too-few, the MIN_SAMPLE boundary, empty/zero, rounding, and redaction) with the exact expected output strings. The module is fully decoupled (no shared-file edits, no new queries) and the logic traced against the diff is correct with no can't-occur branches or fabricated tests.

Nits — 6 non-blocking
  • No caller/consumer of `buildGateOutcomesRecapSection` is visible in this diff — confirm it's actually wired into the foundation builder (feat(notifications): pure maintainer-recap builder — aggregate review activity into a RecapReport #2239) in a follow-up rather than shipping as unused dead code for a release cycle.
  • src/services/maintainer-recap-gate-outcomes.ts:48 — the 240-char slice in `sanitizeRecapText` has no direct test exercising truncation; low risk since current inputs are numeric-templated, but worth a one-line test if the function is ever fed free text.
  • Percent line does a second `Math.round` on an already-3dp-rounded value (`Math.round(falsePositiveRate*100)`) rather than rounding the raw ratio directly to a percent — matches the mirrored gate-precision.ts convention per the tests, but a comment noting this is intentional double-rounding (not a bug) would help future readers.
  • If the foundation builder (feat(notifications): pure maintainer-recap builder — aggregate review activity into a RecapReport #2239) or a digest-assembly module already exists, add or point to the call site that composes this section into the final recap output, since a standalone builder with no wiring silently no-ops in production.
  • Consider extracting the shared MIN_SAMPLE/round mirroring logic (duplicated from gate-precision.ts) into a common util if a third recap section needs the same low-sample-null pattern, to avoid drift between the two copies.
  • 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 #2242
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 buildGateOutcomesRecapSection with blocked/overridden/false-positive counts and a rate line, nulls the rate below MIN_SAMPLE(5) exactly mirroring gate-precision.ts's guard (also covering the divide-by-zero case), and includes unit tests covering the enough-samples, too-few-samples, boundary, and empty-report branches as requested.

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

@JSONbored
JSONbored merged commit 4d0aef1 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): gate-outcomes section for the maintainer recap (blocked / overridden / false-positive)

2 participants