Skip to content

feat(landing): count registered maintainers' merged PRs in repo activity - #1367

Merged
e35ventura merged 1 commit into
testfrom
feat/maintainer-merged-activity
Jul 20, 2026
Merged

feat(landing): count registered maintainers' merged PRs in repo activity#1367
e35ventura merged 1 commit into
testfrom
feat/maintainer-merged-activity

Conversation

@e35ventura

Copy link
Copy Markdown
Collaborator

Problem

Several repos on the landing grid showed "0 prs merged this week" despite real, ongoing work — mini-router/minirouter had 8 PRs merged in the last 7 days on GitHub but read as dead.

The cause: the activity digest is built from /prs, and the scoring pipeline deliberately excludes maintainer-authored PRs from that feed (maintainers are paid through the repo's maintainer_cut carve-out, not per-PR scores). Any repo where the maintainer ships their own work undercounts, all the way down to zero.

Fix

New useMaintainerMergedPrs hook recovers those PRs from the mirror and folds them into the landing-page digest (weekly count, sparkline, active miners). A maintainer's merges count only when the account is both:

  • listed by the mirror as a maintainer of a repo with maintainerCut > 0, and
  • registered as a miner UID

— the same conditions under which the carve-out actually pays them. Merges only count toward repos the account maintains (their contributions elsewhere already flow through /prs), and are deduped by PR number against the feed.

Cost: ~26 extra mirror requests on landing load (15 maintainer lookups + 11 pull feeds), cached 5 minutes via react-query. Mirror failures degrade to feed-only counts rather than blocking the digest.

Before / after

Before After
minirouter (maintainer tmimmanuel, UID 244, 30% cut) before-minirouter after-minirouter
vouch before-vouch after-vouch

Verified against live data (2026-07-20)

Weekly counts that change, simulated with the exact fold logic against prod APIs:

repo feed only with maintainers
mini-router/minirouter 0 8
vouchdev/vouch 1 30
phase-rs/phase 88 207
gittensor-model-hub/sparkdistill 20 61
gittensor-ai-lab/sparkinfer 18 25
gittensor-vanguard/vanguarstew 71 81
jsonbored/loopover 517 851
jsonbored/metagraphed 443 800
jsonbored/awesome-claude 307 314
we-promise/sure 3 6

touchpilot and das-github-mirror still show 0 — correct: GitHub confirms neither merged a PR in the last 7 days.

Note for local dev: VITE_REACT_APP_MIRROR_BASE_URL must be set (it's in .env.example but not .env), otherwise all mirror-backed features — including this one — silently no-op.

@e35ventura
e35ventura changed the base branch from main to test July 20, 2026 22:26
The scoring pipeline excludes maintainer-authored PRs from /prs
(maintainers are paid via the repo's maintainer_cut carve-out, not
per-PR scores), so repos where the maintainer ships their own work
showed '0 prs merged this week' on the landing grid despite real,
paid activity.

Recover those PRs from the mirror and fold them into the activity
digest, restricted to accounts that are both listed as a maintainer
of a repo with maintainerCut > 0 and registered as a miner UID - the
same conditions under which the carve-out actually pays them. Merges
only count toward repos the account maintains; contributions
elsewhere already flow through /prs. Deduped by PR number.
@e35ventura
e35ventura force-pushed the feat/maintainer-merged-activity branch from d7820dd to e0f5c68 Compare July 20, 2026 22:27
@e35ventura
e35ventura merged commit fa7a45b into test Jul 20, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant