Skip to content

fix(notifications): render the dormant maintainer-recap section builders in the digest#8513

Closed
xfodev wants to merge 1 commit into
JSONbored:mainfrom
xfodev:fix/wire-maintainer-recap-sections-8372
Closed

fix(notifications): render the dormant maintainer-recap section builders in the digest#8513
xfodev wants to merge 1 commit into
JSONbored:mainfrom
xfodev:fix/wire-maintainer-recap-sections-8372

Conversation

@xfodev

@xfodev xfodev commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Summary

The maintainer recap digest has four dedicated "content slice" section builders — all fully built and unit-tested — but formatMaintainerRecap never called any of them, instead hand-rolling an inline, uncapped, unsorted per-repo block. So a maintainer running the live recap never saw the Calibration, Gate-outcomes, properly-capped Per-repo, or config-drift sections.

  • Per-repo: replaced the inline per-repo block with buildPerRepoRecapSection({ windowDays, repos }) — now capped/sorted with the (+N more) remainder the inline version lacked — rendered under the same ## Per-repo header via recapSectionLines/redactRecapLine.
  • ## Calibration (new): via buildCalibrationRecapSection({ windowDays, totals }).
  • ## Gate outcomes (new): via buildGateOutcomesRecapSection({ windowDays, totals }).
  • Config-drift plumbing: threaded an optional configDrift through runMaintainerRecap to formatMaintainerRecap, so a caller holding a DriftRecapSection actually renders it. No live drift is sourced here (a code comment notes the cron caller in maintainer-recap-wire.ts supplies none yet, so its live digests stay unchanged).
  • Section order: Summary, Totals, Per-repo, Calibration, Gate outcomes, Config drift (optional, last). RecapReport shape unchanged; the top-contributors section is untouched (it needs a contributors list not present on RecapReport today).

Behavior change (intentional)

The Calibration and Gate-outcomes sections are unconditional (their inputs — reversal/blocked/override totals — are always present on any RecapReport), so every delivered digest now gains those two sections. This is the intended activation of already-built, already-tested dormant code, not a new feature surface.

Tests

test/unit/maintainer-recap-format.test.ts + test/unit/maintainer-recap.test.ts (all maintainer-recap suites green): assert the rendered digest now contains ## Calibration + ## Gate outcomes with the builders' content, that ## Per-repo renders via the capped builder (a 10-repo case shows top-8 + (+2 more)), the empty-window fallbacks, and both sides of the runMaintainerRecap configDrift forward (present → ## Config drift appears; absent → it does not).

Validation

  • tsc --noEmit clean (changed files); all maintainer-recap test files green.
  • Rebased on latest main; no base conflict.
  • No RecapReport shape change; every rendered line still goes through redactRecapLine; no secret/wallet/hotkey/trust/reward terms.

Closes #8372

…ers in the digest

formatMaintainerRecap hand-rolled an inline per-repo block and never called the
four dedicated section builders, so a live maintainer recap never showed the
Calibration, Gate-outcomes, properly-capped Per-repo, or config-drift sections
despite all being built and unit-tested.

Wire them in: render the Per-repo section via buildPerRepoRecapSection
(capped/sorted, with the "(+N more)" remainder the inline version lacked), and add
unconditional Calibration and Gate-outcomes sections via their builders — all
through the same recapSectionLines/redactRecapLine path. Thread an optional
configDrift option through runMaintainerRecap to formatMaintainerRecap so a caller
that has a DriftRecapSection actually renders it (the cron caller supplies none yet;
noted in a comment). Section order: Summary, Totals, Per-repo, Calibration,
Gate outcomes, Config drift. RecapReport shape unchanged; the top-contributors
section is left untouched.

Closes JSONbored#8372
@xfodev
xfodev requested a review from JSONbored as a code owner July 24, 2026 16:57
@superagent-security

Copy link
Copy Markdown
Contributor

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

@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.60%. Comparing base (cc142df) to head (41b906b).
⚠️ Report is 23 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8513      +/-   ##
==========================================
- Coverage   92.52%   89.60%   -2.92%     
==========================================
  Files         791       98     -693     
  Lines       79348    22781   -56567     
  Branches    23969     3893   -20076     
==========================================
- Hits        73413    20414   -52999     
+ Misses       4798     2187    -2611     
+ Partials     1137      180     -957     
Flag Coverage Δ
shard-1 73.33% <66.66%> (+19.69%) ⬆️
shard-2 96.00% <100.00%> (+44.90%) ⬆️
shard-3 4.00% <0.00%> (-54.75%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/services/maintainer-recap.ts 97.33% <100.00%> (+0.45%) ⬆️

... and 693 files with indirect coverage changes

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 24, 2026
@loopover-orb

loopover-orb Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Caution

🛑 LoopOver review result - reject/close recommended

Review updated: 2026-07-24 17:35:11 UTC

3 files · 1 AI reviewer · 1 blocker · CI pending · dirty

🛑 Suggested Action - Reject/Close

Review summary
This PR wires the previously dormant Per-repo/Calibration/Gate-outcomes section builders into formatMaintainerRecap and threads an optional configDrift param through runMaintainerRecap, matching the stated intent to activate already-tested code. The diff is well-tested (new assertions cover the empty-window, populated, and capped/(+N more) arms) and section ordering matches the description (Summary, Totals, Per-repo, Calibration, Gate outcomes, Config drift). The change is a behavior change by design (Calibration/Gate-outcomes now unconditional) and is clearly called out as such rather than hidden.

Nits — 4 non-blocking
  • The PR description doesn't link to an open issue in the issue tracker despite referencing fix(notifications): wire the maintainer-recap's calibration/gate-outcomes/per-repo section builders into the actual digest output #8372 in comments — worth confirming this closes a real tracked issue rather than being unsolicited scope.
  • src/services/maintainer-recap.ts: the empty string "" line between Per-repo and Calibration sections relies on the trailing `.replace(/\n{3,}/g, "\n\n")` collapse to avoid extra blank lines — fragile but tests do cover it (`not.toMatch(/\n{3,}/)`).
  • Consider a brief comment at the Calibration/Gate-outcomes insertion point noting they're intentionally unconditional (already partially done) so a future editor doesn't 'fix' them into conditional the way configDrift is.
  • Double check maintainer-recap-wire.ts's runMaintainerRecapJob call site (shown in reference context) — it does not pass configDrift, matching the PR's stated 'live digests stay unchanged for drift' claim; worth a one-line confirmation in the review thread that this was verified against that file.

Why this is blocked

  • No linked issue detected: The PR cites an issue number, but it could not be verified as a currently open issue. — If this PR is intended to solve an issue, link it explicitly in the PR body.
📋 Copy for AI agents — paste into your coding agent
Fix the following blocker(s) from this PR review:

1. No linked issue detected: The PR cites an issue number, but it could not be verified as a currently open issue. — If this PR is intended to solve an issue, link it explicitly in the PR body.

Decision drivers

  • ❌ Code review — 1 blocker (1 reviewer)
  • ❌ Gate result — Blocking (Repo-configured hard blocker found.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ✅ Linked #8372
Related work ⚠️ Same linked issue: #8511 Another open PR references the same linked issue.
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: 67 registered-repo PR(s), 30 merged, 0 issue(s).
Contributor context ✅ Confirmed Gittensor contributor xfodev; Gittensor profile; 67 PR(s), 0 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: moderate
Linked issue satisfaction

Addressed
The diff wires buildPerRepoRecapSection, buildCalibrationRecapSection, and buildGateOutcomesRecapSection into formatMaintainerRecap unconditionally, replacing the inline per-repo block, and threads an optional configDrift option through runMaintainerRecap to formatMaintainerRecap with a comment noting maintainer-recap-wire.ts doesn't yet supply one, matching all five stated requirements including

Review context
Contributor next steps
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.
🧪 Chat with LoopOver

Ask LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @loopover ask &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat &lt;question&gt; answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover mention with a real question is routed to the closest matching read-only command automatically — no exact syntax required.

Full command reference: https://loopover.ai/docs/loopover-commands

🧪 Experimental — new and may change.

🟩 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 LoopOver, a quiet PR intelligence layer for OSS maintainers.

  • Re-run LoopOver review

@loopover-orb

loopover-orb Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

LoopOver is closing this pull request on the maintainer's behalf (conflicts with the base branch — resolve and open a fresh PR; No linked issue detected). 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.

@loopover-orb loopover-orb Bot closed this Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(notifications): wire the maintainer-recap's calibration/gate-outcomes/per-repo section builders into the actual digest output

1 participant