Achievement badge system — unlock badges#358
Open
clintjeff2 wants to merge 5 commits into
Hidden character warning
The head ref may contain hidden characters: "Achievement-badge-system-\u2014-unlock-badges"
Open
Conversation
Add achievement badge system (catalog, engine, API, UI, SSE integration)
- Update Next.js Route Handlers to use Promise for params (Next.js 15+ requirement). - Install missing peer dependencies @base-org/account and @metamask/connect-evm for @wagmi/connectors. - Fix ESLint errors: unescaped entities in OfflinePage and unsafe declaration merging/ts-ignore in validator-client. - Ensure all CI checks (Typecheck, tests, build, lint, size-limit, secret scan) pass. Co-authored-by: clintjeff2 <119521983+clintjeff2@users.noreply.github.com>
…134008 Fix CI failures (Typecheck, Build, and Lint)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Motivation
Description
lib/gamification/badges.tsthat tracks per-agent progress, evaluates unlock conditions, persists unlocked badges in-memory, and emitsbadge.unlockedsystem events when appropriate.processBadgeEvent()fromlib/events/system-events.tsafter publishing non-badge events so badge checks run automatically.GET /api/badgesandGET /api/agents/:id/badgesthat return the full catalog and an agent's unlocked badges respectively (app/api/badges/route.ts,app/api/agents/[id]/badges/route.ts).components/badges-panel.tsxand a newBadgessidebar tab (hooked incomponents/sidebar-panel.tsx) plus runtime state updates incomponents/open-stellar/open-stellar-hub.tsxto show unlock overlays/toasts/particles when badges unlock.AgentBadgetype tolib/types.tsand initializedbadges: []inlib/data.tsso agents can hold unlocked badges.lib/gamification/badges.test.tscovering initial unlock, repeated unlock prevention, milestone progression and multi-tasker detection.Testing
npm test -- lib/gamification/badges.test.tsand they passed (4 tests).npm test -- __tests__/api/events.test.ts lib/gamification/badges.test.tsand those passed (8 tests across the two files).npm test; this failed due to 3 pre-existing task-drain tests unrelated to the badge changes (failures stem from queue/pending caps and an existing test timing/destructuring assumption), so those require a separate fix in the task-queue/test expectations.npm run lint) and typecheck (npx tsc --noEmit) were executed and surfaced pre-existing lint/type issues in unrelated parts of the repo (e.g.,app/offline/page.tsx,lib/passport/validator-client.ts, and a missing@wagmi/connectorstyping); these were not introduced by the badge changes.Closes #33