Skip to content

feat: implement multi-factor bounty discovery algorithm#69

Open
zhaog100 wants to merge 1 commit intogbabaisaac:mainfrom
zhaog100:feat/discovery-algorithm-v2
Open

feat: implement multi-factor bounty discovery algorithm#69
zhaog100 wants to merge 1 commit intogbabaisaac:mainfrom
zhaog100:feat/discovery-algorithm-v2

Conversation

@zhaog100
Copy link
Copy Markdown

📊 Summary

Implements a multi-factor bounty discovery algorithm to rank bounties by relevance using a weighted scoring system (0-100 points).

Scoring Factors

Factor Weight Description
📊 Funding 30 pts Piecewise function rewarding well-funded bounties
🎯 Activity 25 pts Diminishing returns for validation claims
Recency 20 pts Exponential decay for freshness
💰 Reward 25 pts Logarithmic scaling to prevent dominance

Algorithm Highlights

  1. Funding Score: Piecewise function

    • 80-100% funded: 25-30 pts (nearly complete)
    • 50-80% funded: 15-25 pts (good momentum)
    • 20-50% funded: 8-15 pts (building)
    • 0-20% funded: 0-8 pts (just started)
  2. Activity Score: Diminishing returns

    • 5+ claims: 25 pts (highly validated)
    • 3-4 claims: 18-22 pts (well validated)
    • 1-2 claims: 8-15 pts (some validation)
    • 0 claims: 0 pts
  3. Recency Score: Exponential decay

    • 0-2 days: 18-20 pts
    • 3-7 days: 10-18 pts
    • 8-14 days: 4-10 pts
    • 15+ days: 0-4 pts
  4. Reward Score: Logarithmic scaling

    • Normalized using log10 to compress range
    • Prevents high rewards from dominating

🔧 Changes

Files Added

  • src/lib/discovery-algorithm.ts - Core algorithm with detailed comments

Files Modified

  • src/app/discovery/page.tsx - Enhanced UI with score breakdown

✨ Features

🧪 Test Results

Bounty Funded Claims Days Score
Auth improvements 90% 4 2 90.0
Notifications overhaul 75% 2 5 71.8
Performance audit 40% 1 1 58.5

✅ Acceptance Criteria

  • List is ordered by score
  • Scores are visible in UI
  • Use provided mock data
  • Explain scoring logic in code comments

Closes #3


Author: 小米粒 (PM + Dev Agent) 🌶️

Implements a comprehensive scoring system for bounty ranking:

## Algorithm Overview
- 4-factor weighted scoring (0-100 total)
- Funding Progress (0-30 pts): Piecewise function rewarding well-funded bounties
- Activity Level (0-25 pts): Diminishing returns for claims
- Recency (0-20 pts): Exponential decay for freshness
- Reward Amount (0-25 pts): Logarithmic scaling to prevent dominance

## Changes
- src/lib/discovery-algorithm.ts: Core scoring functions with detailed comments
- src/app/discovery/page.tsx: Enhanced UI with score breakdown visualization

## Features
- Transparent scoring with visual breakdown
- Ranking badges (gbabaisaac#1, gbabaisaac#2, gbabaisaac#3)
- Responsive score bars
- Color-coded factors

## Test Results
- Auth improvements: 90 pts (90% funded, 4 claims, 2d old)
- Notifications overhaul: 71.8 pts (75% funded, 2 claims, 5d old)
- Performance audit: 58.5 pts (40% funded, 1 claim, 1d old)

Closes gbabaisaac#3

Author: 小米粒 (PM + Dev Agent) 🌶️
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.

Bounty: Discovery Algorithm

1 participant