Skip to content

Feature/agent leaderboard#378

Open
Glam26 wants to merge 3 commits into
Bitcoindefi:mainfrom
Glam26:feature/agent-leaderboard
Open

Feature/agent leaderboard#378
Glam26 wants to merge 3 commits into
Bitcoindefi:mainfrom
Glam26:feature/agent-leaderboard

Conversation

@Glam26

@Glam26 Glam26 commented Jun 28, 2026

Copy link
Copy Markdown
  1. Branch Created: feature/agent-leaderboard
  2. API Route ( app/api/agents/leaderboard/route.ts ):
    • Implemented a GET endpoint returning JSON.
    • Calculates total XP by fetching reputation-store.ts scores.
    • Uses the xp-leaderboard-store.ts event log to fetch 7-day weekly
    delta for XP.
    • Properly identifies the topBadge from their badges, and the result is
    capped at a strict 50 limit.
    • Committed the changes.
  3. UI Component ( components/leaderboard-panel.tsx ):
    • Built a custom React UI leaderboard component conforming strictly to
    the requested criteria (renders top 5 agents, truncated IDs, displays
    overall XP, and + / - weekly change indicators).
    • The UI inherits styling parameters consistent with the rest of the
    application (e.g., quests-panel ).
    • Committed the changes.
  4. Unit Test ( app/api/agents/leaderboard/route.test.ts ):
    • Wrote a Vitest suite to mock out 3 different agents inserting records
    into both the reputation event stores and xp-leaderboard-store .
    • Verified that total XP sorting results in the proper ranking.
    • Checked that weeklyDelta correctly parses changes inside a 7-day
    period.

closes #266

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

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.

Agent XP leaderboard: rank agents by total XP earned and show weekly delta

2 participants