Skip to content

feat: Add contributor reputation score service - #1114

Open
sojetunde8 wants to merge 2 commits into
ritik4ever:mainfrom
sojetunde8:fix/issue-787
Open

sojetunde8 wants to merge 2 commits into
ritik4ever:mainfrom
sojetunde8:fix/issue-787

Conversation

@sojetunde8

Copy link
Copy Markdown

Closes #787

Summary

  • Added a new reputationService that computes a 0–100 reputation score for any contributor based on completed bounties, dispute outcomes, and response times.
  • Added GET /api/contributors/:address/reputation endpoint returning the aggregate score and per-factor breakdown.
  • Scoring formula documented in code comments: base 50 + completion (0–60) + disputes (-30 to +20) + response time (0–20), clamped to 0–100.
  • Contributors with no history receive a neutral score of 50.

Scope

Does not touch existing bounty lifecycle, leaderboard, or notification systems — out of scope for this issue.

Testing

  • npx tsc --noEmit — passed (zero errors)
  • npx eslint "src/**/*.ts" "test/**/*.ts" — passed (no new warnings; 7 pre-existing no-console warnings in other files)
  • npx vitest run test/reputationService.test.ts — 6/6 tests passed
  • npx vitest run test/openapi.snapshot.test.ts — snapshot updated and passes
  • Full suite: 242/281 tests pass; 39 failures are all pre-existing (lockfile/data issues unrelated to this change)

Files changed

  • backend/src/services/reputationService.ts — new service with scoring logic
  • backend/src/app.ts — registered the new reputation endpoint
  • backend/src/docs/openapi.ts — OpenAPI documentation for the new endpoint
  • docs/openapi.generated.json — regenerated OpenAPI spec
  • backend/test/reputationService.test.ts — unit tests for the service
  • backend/test/__snapshots__/openapi.snapshot.test.ts.snap — updated snapshot

Add a new reputation scoring system that computes a 0–100 score for any
contributor based on three factors: completed bounties (0–60), dispute
resolution outcomes (-30 to +20), and response time performance (0–20).
A neutral score of 50 is returned for contributors with no history.

Implements GET /api/contributors/:address/reputation returning the
aggregate score, per-factor breakdown, and supporting counts.
@drips-wave

drips-wave Bot commented Aug 28, 2026

Copy link
Copy Markdown

@sojetunde8 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@vercel

vercel Bot commented Aug 28, 2026

Copy link
Copy Markdown

@sojetunde8 is attempting to deploy a commit to the ritik4ever's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added documentation Improvements or additions to documentation backend labels Aug 28, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Add contributor reputation score service

1 participant