feat(notifications): add the pure maintainer-recap builder (#2239) - #4210
Conversation
…#2239) Foundation for the JSONbored#1963 recap digest: a pure, injected-inputs builder that folds a window of gittensory's own review-outcome data across repos into a serializable RecapReport — per-repo reviewed/merged/closed counts plus top-line gate false- positive / override / recommendation-reversal totals and an aggregate false- positive rate. No delivery, no scheduling, no I/O, no model call — just the data- shaping seam, mirroring weekly-value-report.ts's buildWeeklyValueReport. It reuses the already-computed GatePrecisionReport (services/gate-precision.ts) and OutcomeCalibration (services/outcome-calibration.ts) aggregators the caller injects, so no new D1 queries are added. Distinct from services/review-recap.ts's buildReviewRecap, which is single-repo and sourced from gate merge-PREDICTION precision; this is multi-repo and sourced from the realized gate-block + recommendation-outcome calibration ledgers. Closes JSONbored#2239
|
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 #4210 +/- ##
=======================================
Coverage 93.75% 93.76%
=======================================
Files 389 390 +1
Lines 36499 36531 +32
Branches 13376 13379 +3
=======================================
+ Hits 34221 34253 +32
Misses 1621 1621
Partials 657 657
🚀 New features to boost your workflow:
|
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-08 17:39:46 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 6 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.
|
Summary
The foundation slice for the #1963 maintainer recap digest: a pure builder that folds a window of gittensory's own review-outcome data across repos into a single serializable
RecapReport. No delivery, no scheduling, no I/O, no model call — just the data-shaping seam, exactly mirroring howsrc/services/weekly-value-report.ts:129buildWeeklyValueReporttakes injected inputs and returns a report.Closes #2239
Design
src/services/maintainer-recap.ts(new):buildMaintainerRecap(inputs)folds each repo's already-computedGatePrecisionReport+OutcomeCalibrationinto per-repo counts (reviewed/merged/closed) plus top-line gate/reversal totals (gateFalsePositives= blocked-then-merged,gateOverrides,reversals) and an aggregategateFalsePositiveRate(null when nothing was blocked). The two aggregators are injected by the caller — the same pairsrc/review/ops-wire.tsalready loads together — so no new D1 queries are added here.src/types.ts: addsRecapReport+MaintainerRecapRepoalongsideWeeklyValueReport/ReviewRecap, per the deliverable.PUBLIC_LOCAL_PATH_SCRUB_PATTERN, and the window is clamped via the same 1–90-day / 7-default boundsreview-recap.tsuses.Why this is NOT a duplicate of
review-recap.tsservices/review-recap.ts'sbuildReviewRecap/ReviewRecapis single-repo and sourced from gate merge-prediction precision (computeGateEval.mergePrecision). ThisbuildMaintainerRecap/RecapReportis multi-repo and sourced from the realized gate-block + recommendation-outcome calibration ledgers (GatePrecisionReport.overall.blockedThenMerged/perGateType[].overridden,OutcomeCalibration.recommendations.negative) — it carries false-positive / override / reversal totals thatReviewRecaphas no field for. They are complementary seams for the same parent epic (#1963), not the same builder.Tests
test/unit/maintainer-recap.test.ts: empty-window (zeroed totals + null false-positive rate + default window), single-repo fold with the computed 20% false-positive rate, multi-repo aggregation (including a repo with no slop bands), window clamping (0 → min, 999 → max), and local-path scrubbing of the repo name. Covers both arms of every branch — theblocked > 0rate computation vs the null-rate path, and the finite vs non-finite window normalization.Validation
git diff --check— clean.npm run typecheck— clean.npm run test:coverage(full, unsharded) — no logic failures;codecov/patch= 100% of the changedsrc/**lines and branches (33/33). Only the known Windowsspawn claude/codex/docker ENOENTenv suites fail locally (green on Linux CI).If any required check was skipped, explain why:
test:workers/build:mcp/ui:*/actionlint/npm auditwere not run locally — this is a purely additivesrc/servicesbuilder + twosrc/typesadditions, imported by nothing yet, touching no worker entrypoint, MCP package, UI, workflow, or dependency; CI covers them.Safety
UI Evidence
N/A — pure backend data-shaping function; no visible UI, frontend, docs, or extension surface.
Notes
RecapReport— this PR ships only the builder + type so those can land on top.