Skip to content

feat: add XP level progression calculator - #651

Merged
TheVicky1 merged 1 commit into
TheVicky1:mainfrom
toyes3429:feat/xp-progression
Oct 24, 2026
Merged

TheVicky1 merged 1 commit into
TheVicky1:mainfrom
toyes3429:feat/xp-progression

Conversation

@toyes3429

@toyes3429 toyes3429 commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

🏛️ PACT Pull Request

1. Related Issue

Closes #605


2. Summary of Changes

  • Added a pure mathematical XP progression calculator in src/lib/gamification/xp-progression.ts.
  • Implemented configurable base XP and exponential scaling.
  • Returns the current level, total XP, XP within the current level, XP required for the next level, progress percentage, and XP remaining.
  • Added 14 unit tests covering level transitions, XP thresholds, custom progression curves, and invalid inputs.

5. Testing & Local Validation

  • npm run lint — ESLint passed with 0 errors
  • npx tsc --noEmit — TypeScript strict check passed with 0 errors
  • npm test — Full authoritative test matrix passed
  • npm run test:file -- xp-progression — Targeted test suite passed
  • node scratch/secret-scan.mjs — Zero secrets detected
  • npm run build — Production build succeeded

Verification performed:

  • npm test -- xp-progression — 14 tests passed, 0 failed.

Only check the boxes for commands you have actually run successfully.


9. Contributor Quality Checklist

  • 🌱 Micro-Contribution Fast-Path
  • My PR has a single, focused scope.
  • I have read and followed the PACT Contributing Guide.
  • I confirm no secrets, API keys, private tokens, or .env.local files are included.
  • My branch was created from the latest upstream/main.
  • My commit follows Conventional Commits format.
  • I have linked the target issue in Section 1.
  • I have reviewed my own diff for stray files or debugging artifacts.

@toyes3429
toyes3429 requested a review from TheVicky1 as a code owner October 21, 2026 17:35
@vercel

vercel Bot commented Oct 21, 2026

Copy link
Copy Markdown

@toyes3429 is attempting to deploy a commit to the Vicky's projects Team on Vercel.

A member of the Team first needs to authorize it.

@toyes3429

Copy link
Copy Markdown
Contributor Author

Hey @TheVicky1 , my other PRs have been merged, but this one is still pending. Is there anything wrong with the code or the PR that I could improve? Or is there any other reason it hasn't been merged yet? I'd appreciate your feedback so I can make the necessary changes.

@TheVicky1
TheVicky1 merged commit b449064 into TheVicky1:main Oct 24, 2026
3 of 4 checks passed
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.

[Gamification] Add Exponential Level & Skill XP Progression Curve Calculator in src/lib/gamification/xp-progression.ts

2 participants