Skip to content

feat(review): surface aggregate review-effort in maintainer stats (#2155) - #4024

Merged
JSONbored merged 1 commit into
JSONbored:mainfrom
claytonlin1110:feat/review-effort-maintainer-stats-2155
Jul 8, 2026
Merged

feat(review): surface aggregate review-effort in maintainer stats (#2155)#4024
JSONbored merged 1 commit into
JSONbored:mainfrom
claytonlin1110:feat/review-effort-maintainer-stats-2155

Conversation

@claytonlin1110

Copy link
Copy Markdown
Contributor

Summary

  • Add reviewEffort (avgBand + totalEstimatedMinutes) to the bearer-gated maintainer stats payload in src/review/stats.ts.
  • Read persisted reviewEffortMinutes from audit_events (same source as public-stats) within the stats window, deduplicating per PR and mapping minutes back to bands via bandFromMinutes.
  • Degrade to { avgBand: null, totalEstimatedMinutes: 0 } when the effort query is empty or fails; public-stats remains unchanged.

Closes #2155

Scope

  • The PR title follows type(scope): short summary Conventional Commit format, for example fix(api): restore profile access checks.
  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked a currently open issue this PR resolves (e.g. Closes #123) — a linked open issue is required for every contributor PR.

Validation

  • git diff --check
  • npm run actionlint
  • npm run typecheck
  • npm run test:coverage locally; codecov/patch requires ≥99% coverage of the lines AND branches you changed (aim for 100% on your diff so CI variance does not fail near the threshold). Global coverage is a non-blocking trend with a loose 90% backstop, not the gate.
  • npm run test:workers
  • npm run build:mcp
  • npm run test:mcp-pack
  • npm run ui:openapi:check
  • npm run ui:lint
  • npm run ui:typecheck
  • npm run ui:build
  • npm audit --audit-level=moderate
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries

If any required check was skipped, explain why:

  • Full npm run test:ci could not be completed locally: cf-typegen:check requires wrangler on PATH (ENOENT), and the local tree reports unrelated processors.ts parse errors on main. Scoped tests pass: npx vitest run test/unit/stats.test.ts test/unit/review-effort.test.ts (41 tests). Changed-source coverage for stats.ts is 100% lines / 100% branches on the new paths.

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests.
  • API/OpenAPI/MCP behavior is updated and tested where needed.
  • UI changes use live API data or real empty/error/loading states, not production mock/demo fallbacks.
  • Visible UI changes include a UI Evidence section below with JPG/JPEG or PNG screenshots arranged as organized, captioned, clickable thumbnails. SVG screenshots are not used as review evidence. Review-only screenshots or recordings are not committed to the repository.
  • Public docs/changelogs are updated where needed; changelogs are only edited for release-prep PRs.

UI Evidence

N/A — backend-only maintainer stats payload change; no visible UI.

Notes

Part of #1955. The aggregate is intentionally limited to the bearer-gated /stats/data feed, not getPublicStats.

@claytonlin1110
claytonlin1110 requested a review from JSONbored as a code owner July 7, 2026 10:47
@superagent-security

Copy link
Copy Markdown
Contributor

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

@codecov

codecov Bot commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.68%. Comparing base (c2c6eb3) to head (8764e63).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4024   +/-   ##
=======================================
  Coverage   93.68%   93.68%           
=======================================
  Files         384      384           
  Lines       35997    36007   +10     
  Branches    13212    13213    +1     
=======================================
+ Hits        33723    33733   +10     
  Misses       1618     1618           
  Partials      656      656           
Files with missing lines Coverage Δ
src/review/review-effort.ts 100.00% <100.00%> (ø)
src/review/stats.ts 98.73% <100.00%> (+0.16%) ⬆️
🚀 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 7, 2026
@loopover-orb

loopover-orb Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Warning

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

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-07 13:27:30 UTC

4 files · no blockers · readiness 96/100 · CI pending · blocked

⏸️ Suggested Action - Manual Review

Signal Result Evidence
Code review ✅ No blockers No AI review summary
Linked issue ✅ Linked #2155, #123
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (draft PR; 2 linked issues).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 442 registered-repo PR(s), 303 merged, 102 issue(s).
Contributor context ✅ Confirmed Gittensor contributor claytonlin1110; Gittensor profile; 442 PR(s), 102 issue(s).
Gate result ✅ Passing No configured blocker found.
Review context
  • Author: claytonlin1110
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: Python, JavaScript, TypeScript, Rust
  • Official Gittensor activity: 442 PR(s), 102 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Mark ready when done.
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

Copy link
Copy Markdown
Owner

Sorry, marked this as draft when we previously had failing CI, so that it wasn't incorrectly closed with a failing review. Should be safe to flip back to ready to review whenever you're ready - thanks @claytonlin1110

…ONbored#2155)

Expose avg band and total estimated minutes on the bearer-gated stats feed by
reading persisted reviewEffortMinutes from audit_events, matching the public
stats estimator source while keeping the aggregate maintainer-only.

Co-authored-by: Cursor <cursoragent@cursor.com>
@JSONbored
JSONbored force-pushed the feat/review-effort-maintainer-stats-2155 branch from 3de463b to 8764e63 Compare July 8, 2026 05:50
@JSONbored
JSONbored merged commit 470d5fe into JSONbored:main Jul 8, 2026
8 checks passed
@loopover-orb loopover-orb Bot added gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. and removed gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. labels Jul 8, 2026
@JSONbored JSONbored added gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. and removed gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. labels Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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(review): surface aggregate review-effort in the self-host maintainer stats feed

2 participants