Skip to content

feat(analytics): add slop + duplicate signal to the maintainer quality dashboard (#2202) - #5260

Closed
dhgoal wants to merge 1 commit into
JSONbored:mainfrom
dhgoal:feat/analytics-slop-duplicate
Closed

feat(analytics): add slop + duplicate signal to the maintainer quality dashboard (#2202)#5260
dhgoal wants to merge 1 commit into
JSONbored:mainfrom
dhgoal:feat/analytics-slop-duplicate

Conversation

@dhgoal

@dhgoal dhgoal commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

What

Adds a slop + duplicate signal to the maintainer quality dashboard (Closes #2202): the share of the maintainer's open PRs carrying an elevated/high deterministic slop band and the share sitting in a high-risk duplicate cluster, each as a rate of the open-PR total.

Surfaces real data — the shaping loop already computes each repo's collisions and reads each PR's slop band; this folds those into a dashboard-level slopDuplicate aggregate. Pure in-memory aggregation over data already produced (no new IO). Rates + bands only, never raw scores.

Scope note: #2202 asks for a dual-series trend over time. A true time-series needs historical slop/collision snapshots that don't have a clean aggregator today, so this delivers the current-window slop-rate + duplicate-rate (the data this dashboard actually holds) with band framing. Happy to layer a TrendChart time-series on top as a follow-up once the snapshot source is wired — mirrors how #2201 landed the aggregate first.

Changes

Backend (src/services/maintainer-quality-dashboard.ts, +20)

  • Count open PRs whose slopBand is elevated/high in the existing loop; expose slopDuplicate on the payload: openPullRequests, slopFlaggedPullRequests, duplicateFlaggedPullRequests (reusing the high-risk-cluster count), and slopRate / duplicateRate (null-guarded when there are no open PRs).
  • Covered by test/unit/maintainer-quality-dashboard.test.ts — a flagged case (rate = 0.5) and a no-open-PR case (both rates null), covering both arms of the divide-guard.

Frontend

  • slop-duplicate-card.tsx (new) — SlopDuplicateCard: two rate rows (slop, duplicate) with proportional bars + flagged of total counts + low/watch/high band pills. Reuses AnalyticsCardShell; empty states for a clear queue and an absent field.
  • slop-duplicate-card.test.tsx (new) — populated, null-rate, queue-clear, and absent-field branches.
  • maintainer-panel.tsx — optional slopDuplicate? on the dashboard type + renders the card below queue-health.

Verification

test/unit/maintainer-quality-dashboard.test.ts green (12 tests); card tests green (4); tsc clean on the changed backend; eslint clean on the UI files; pure-aggregation diff (+219).

Screenshots

Maintainer quality dashboard, populated and empty, desktop + mobile, light + dark.

State Desktop (light) Desktop (dark) Mobile
Populated
light

dark

mobile
Empty
light

dark

mobile

Closes #2202

…y dashboard (JSONbored#2202)

Fold a slop + duplicate aggregate into MaintainerQualityDashboard: how many of
the maintainer's open PRs carry an elevated/high deterministic slop band and
how many sit in a high-risk duplicate cluster, each as a rate of the open-PR
total (null when there are no open PRs, guarding the divide). Pure in-memory
aggregation over data the shaping loop already produces (no new IO). Adds
SlopDuplicateCard rendering the two rates with proportional bars + low/watch/
high bands, wired into MaintainerPanel; empty states for a clear queue and an
absent field. Current-window rates; a time-series trend is a follow-up.
@dhgoal
dhgoal requested a review from JSONbored as a code owner July 12, 2026 12:15
@superagent-security superagent-security Bot added the contributor:flagged Contributor flagged for review by trust analysis. label Jul 12, 2026
@superagent-security

Copy link
Copy Markdown
Contributor

🚨 Contributor flagged. Click here for more info: Superagent Dashboard

@superagent-security

Copy link
Copy Markdown
Contributor

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

@codecov

codecov Bot commented Jul 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.36%. Comparing base (73a0912) to head (f212be8).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5260   +/-   ##
=======================================
  Coverage   94.36%   94.36%           
=======================================
  Files         474      474           
  Lines       40081    40085    +4     
  Branches    14614    14617    +3     
=======================================
+ Hits        37821    37825    +4     
  Misses       1585     1585           
  Partials      675      675           
Flag Coverage Δ
shard-1 46.24% <0.00%> (-0.29%) ⬇️
shard-2 34.74% <100.00%> (+0.07%) ⬆️
shard-3 32.07% <0.00%> (+0.03%) ⬆️
shard-4 31.84% <0.00%> (-0.28%) ⬇️
shard-5 33.69% <0.00%> (-0.04%) ⬇️
shard-6 44.99% <100.00%> (+0.20%) ⬆️

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

Files with missing lines Coverage Δ
src/services/maintainer-quality-dashboard.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 12, 2026
@loopover-orb

loopover-orb Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Warning

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

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-13 00:02:17 UTC

5 files · 1 AI reviewer · no blockers · readiness 82/100 · CI green · blocked

⏸️ Suggested Action - Manual Review

  • Touches a guarded path — held for manual review: This PR changes guardrail-protected path(s): apps/gittensory-ui/src/components/site/app-panels/maintainer-panel.tsx (matched apps/gittensory-ui/**), apps/gittensory-ui/src/components/site/app-panels/slop-duplicate-card.test.tsx (matched apps/gittensory-ui/**), apps/gittensory-ui/src/components/site/app-panels/slop-duplicate-card.tsx (matched apps/gittensory-ui/**), src/services/maintainer-quality-dashboard.ts (matched src/services/**).

Review summary
This adds a `slopDuplicate` aggregate (open-PR counts + null-guarded rates for slop-flagged and high-risk-duplicate-cluster PRs) to `buildMaintainerQualityDashboard`, and a matching `SlopDuplicateCard` on the maintainer dashboard with populated/null-rate/empty-queue/absent-field states. The divide-by-zero guard (`openPrs > 0 ? ... : null`) is correctly tested in both arms, `duplicateFlaggedPullRequests` correctly reuses the existing `duplicatePrRisk`/high-risk-cluster count rather than recomputing it, and the frontend renders sane empty states for both an absent field and a cleared queue. The PR explicitly discloses that it only partially satisfies #2202 (issue asks for a time-series trend; this ships current-window rates as a stated first step), which is transparent but worth a maintainer call on whether that's acceptable scope for closing the issue.

Nits — 6 non-blocking
  • `slop-duplicate-card.tsx:21-29` hardcodes the 0.1/0.3 thresholds twice across `rateStatus` and `rateBandLabel` — pull them into named constants (e.g. `SLOP_WATCH_THRESHOLD`) to avoid drift if one is tuned later.
  • The no-open-PR test in `test/unit/maintainer-quality-dashboard.test.ts` only asserts `slopRate`/`duplicateRate` are null but doesn't assert `slopFlaggedPullRequests`/`duplicateFlaggedPullRequests` are 0 — worth locking down explicitly.
  • This only partially satisfies feat(ui): slop + duplicate trend-over-time card (maintainer dashboard) #2202 (issue asks for a dual-series time-over-time trend; this delivers current-window rates) — flagged in the description but worth confirming with the maintainer whether that's sufficient to close the issue or whether it should stay open pending the TrendChart follow-up.
  • Extract the 0.1/0.3 band thresholds to shared named constants reused by both `rateStatus` and `rateBandLabel`.
  • Add an explicit assertion for `slopFlaggedPullRequests`/`duplicateFlaggedPullRequests === 0` in the empty-dashboard test case for completeness.
  • Touches a guarded path — held for manual review — A maintainer must review and merge this change.
Flagged checks (non-blocking)
  • Contributor trust — Contributor flagged for review
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #2202
Related work ⚠️ 2 scoped overlaps 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: 120 registered-repo PR(s), 71 merged, 26 issue(s).
Contributor context ✅ Confirmed Gittensor contributor dhgoal; Gittensor profile; 120 PR(s), 26 issue(s).
Gate result ⚠️ Not blocking Advisory; not blocking this PR.
Improvement ✅ Minor risk: clean · value: minor — Code changes are accompanied by test evidence.
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: 120 PR(s), 26 issue(s).
  • Related work: Titles/paths share 3 meaningful terms. (issue #5213, issue #642)
  • Related work: Titles/paths share 3 meaningful terms. (issue #642, issue #2013)
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.
[BETA] Chat with Gittensory

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

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

Full command reference: https://gittensory.aethereal.dev/docs/gittensory-commands

Visual preview
Route Viewport Before (production) After (this PR's preview) Diff
/ desktop before / after /
/ mobile before / (mobile) after / (mobile)

Click any thumbnail to open the full-size screenshot. Before = production · After = this PR's preview deploy.

🟩 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 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please submit everything necessary to satisfy #2202 - if necessary, submit anything else necessary as part of this PR.

It's all work that needs to be done, anyways :)

@JSONbored JSONbored left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Closing, please resubmit while fulfilling all requirements of the issue.

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. manual-review Gittensor contributor context

Development

Successfully merging this pull request may close these issues.

feat(ui): slop + duplicate trend-over-time card (maintainer dashboard)

2 participants