Skip to content

Add live evidence-linked contributor leaderboard - #2

Open
gorajing wants to merge 1 commit into
mainfrom
codex/contributor-leaderboard
Open

Add live evidence-linked contributor leaderboard#2
gorajing wants to merge 1 commit into
mainfrom
codex/contributor-leaderboard

Conversation

@gorajing

@gorajing gorajing commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add a MongoDB-backed contributor × subsystem review-confidence leaderboard to the real GitHub live screen
  • compute every score from linked PR, revert, corrective re-land or verified-evidence events
  • preserve blocked → recovered PR history through append-only verdict events
  • seed a disclosed Aug 6–13 mongodb/mongo public sample and mark gorajing as the live fork contributor
  • keep contributor scores from bypassing baseline review controls

Verification

  • root test suite: 15/15
  • receipts test suite: 9/9
  • React production build: passed
  • isolated Atlas seed: passed without deleting data
  • rendered browser proof: gorajing = 90 from two live blocked fork PR receipts

Merge safety

This branch was refreshed against main at 9125f5a immediately before commit. It does not touch the teammates untracked shared-worktree files.

Summary by CodeRabbit

  • New Features
    • Added a responsive contributor confidence leaderboard organized by contributor and subsystem.
    • Displays scores, rankings, score movement, evidence bands, profile links, and related review events.
    • Live pages now refresh leaderboard data automatically as new review activity arrives.
    • Added public demo data, provenance links, and append-only recovery history.
  • Documentation
    • Updated project guidance and live demo documentation to explain leaderboard scoring and evidence-linked signals.
  • Bug Fixes
    • Review records now consistently capture blocked, approved, and concerns outcomes for leaderboard activity.

@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c41aab18-fb4e-4017-af90-7a03cf504d21

📥 Commits

Reviewing files that changed from the base of the PR and between 9125f5a and f2b0253.

📒 Files selected for processing (11)
  • PLAN.md
  • README.md
  • receipts/public/live.html
  • receipts/src/github.js
  • receipts/src/leaderboard.js
  • receipts/src/ops.js
  • receipts/src/reviewer.js
  • receipts/src/schema.js
  • receipts/src/seed-github-demo.js
  • receipts/src/server.js
  • receipts/test/leaderboard.test.js

📝 Walkthrough

Walkthrough

The change adds an evidence-linked contributor-by-subsystem leaderboard. It records review events, computes scores and trends, exposes leaderboard data through /api/live and SSE, renders the leaderboard in the live page, seeds demo data, and documents the signal.

Changes

Contributor leaderboard

Layer / File(s) Summary
Event scoring and leaderboard rows
receipts/src/leaderboard.js, receipts/test/leaderboard.test.js
Adds event normalization, baseline scoring, score bands, contributor-by-subsystem rows, sorting, movement, evidence metadata, and coverage for scoring and recovery history.
Review event persistence and demo data
receipts/src/schema.js, receipts/src/reviewer.js, receipts/src/seed-github-demo.js, receipts/src/github.js
Adds receipt review-event storage, leaderboard profile access and indexing, review-event updates, seeded profiles, legacy receipt backfill, and updated reviewer attribution text.
Live API and event delivery
receipts/src/ops.js, receipts/src/server.js
Adds contributorLeaderboard(), includes leaderboard rows in /api/live, and broadcasts leaderboard SSE events for profile changes.
Leaderboard presentation and documentation
receipts/public/live.html, README.md, PLAN.md
Adds responsive leaderboard rendering, scoring details, evidence links, sample provenance, recovery history, and scope disclaimers.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Mergeability Score: ⚪ Minimal · up to f2b02

The PR adds the contributor leaderboard and related live evidence handling, with the supplied checks passing and no actionable merge-blocking risk remaining after normal review.

Sequence Diagram(s)

sequenceDiagram
  participant Browser
  participant LiveServer
  participant LeaderboardOperation
  participant MongoDB
  Browser->>LiveServer: Request /api/live
  LiveServer->>LeaderboardOperation: Fetch contributor leaderboard
  LeaderboardOperation->>MongoDB: Load profiles and GitHub receipts
  MongoDB-->>LeaderboardOperation: Return source records
  LeaderboardOperation-->>LiveServer: Return scored rows
  LiveServer-->>Browser: Return live data
  MongoDB-->>LiveServer: Emit leaderboard_profiles change
  LiveServer-->>Browser: Send leaderboard SSE event
Loading

Suggested reviewers: lachenbach, nihalnihalani

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding a live evidence-linked contributor leaderboard.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/contributor-leaderboard

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f2b0253e89

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

function eventKind(status) {
if (status === 'blocked') return 'missing-evidence';
if (status === 'concerns') return 'review-concerns';
if (status === 'approved') return 'verified-evidence';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Restrict verified-evidence credit to actual evidence

When a PR has no active contract, the standard review path can approve it without checking any evidence, yet this status-only mapping records a verified-evidence event and adds +3. Consequently, ordinary approved GitHub PRs inflate the public evidence-readiness score even when receipt.evidence is empty; create this event only when the reviewer has actually validated the required evidence, and leave ordinary approvals unscored.

Useful? React with 👍 / 👎.

Comment thread receipts/src/reviewer.js
{ prNum: pr.prNum },
{
$set: { status: 'blocked', review },
$push: { reviewEvents: reviewEventForReceipt(pr, 'blocked', new Date()) },

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Deduplicate repeated verdict events for the same receipt

When GitHub sends an edited, reopened, or ready_for_review delivery without a new head SHA, processGitHubDelivery reuses the existing receipt, resets it to submitted, and retains reviewEvents; this unconditional $push then scores the same blocked verdict again. Routine metadata edits can therefore repeatedly subtract 5 points from one unchanged PR (and the approval branch can similarly add points), so append only a genuinely new evidence/verdict transition or use an idempotency key.

Useful? React with 👍 / 👎.

Comment thread receipts/public/live.html
return
}
byId('leaderboard').innerHTML = rows.map((row, index) => {
const latest = row.events?.[row.events.length - 1]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Render links for every event included in the score

For any row with multiple scored events, selecting only latest hides all earlier evidence links and transitions even though those events still contribute to the displayed total. For example, the documented two-blocked-PR row shows a −10 movement but exposes only the second PR's 95→90 transition, preventing users from auditing the first −5; render the full event list or otherwise provide access to every contributing event.

Useful? React with 👍 / 👎.

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