Skip to content

Add reputation-based credit airdrop for new users#10

Open
krandder wants to merge 1 commit into
core/apifrom
feature/reputation-airdrop
Open

Add reputation-based credit airdrop for new users#10
krandder wants to merge 1 commit into
core/apifrom
feature/reputation-airdrop

Conversation

@krandder

Copy link
Copy Markdown
Contributor

Summary

  • New core/reputation.py — pure calculate_credits() function mapping GitHub profile to 100–5000 credits
  • Formula: account age (0–200 pts) + public repos (0–100 pts) + followers (0–200 pts) → score 0–500 → credits 100–5000
  • core/auth.py now extracts created_at, public_repos, followers from existing GET /user response (no extra API calls)
  • Both auth endpoints (auth_github, auth_device_poll) use reputation credits for new users instead of flat INITIAL_CREDITS
  • Existing users keep their current balance on re-auth (no double airdrop)
  • 8 new tests covering the formula edge cases and auth integration
Profile Age Repos Followers Credits
Brand new bot 0 0 0 100
New dev (6mo) 0.5 3 1 ~200
Active dev (3yr) 3 30 15 ~900
Senior dev (7yr) 7 60 100 ~2000
Open source veteran 10+ 100+ 500+ 5000

Test plan

  • pytest core/test_api.py — all 56 tests pass (48 existing + 8 new)
  • pytest core/test_core.py — all 37 core tests still pass
  • New account with brand-new GitHub profile gets 100 credits
  • Veteran account gets 5000 credits
  • Re-auth same user → balance unchanged

🤖 Generated with Claude Code

Replace flat INITIAL_CREDITS with a reputation score derived from the
GitHub profile (account age, public repos, followers). Credits range
from 100 (brand new) to 5000 (10yr+ veteran). Existing users keep
their current balance on re-auth.
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