Skip to content

Design and implement a contribution scoring engine (deferred area) #270

Description

@Lakes41

Difficulty: Advanced
Type: feature

Background
The README explicitly lists "Contribution scoring engine" as a deferred, intentionally-not-implemented area, alongside a note that "clear interfaces and TODOs are left where appropriate" for future extension.

Problem
There is currently no way to track or score member contributions (e.g., activity, engagement, moderation actions) that could feed into role eligibility, badges, or future reward distribution — a foundational piece several other deferred features (rewards, streaks) would depend on.

Expected outcome
A packages/contribution-scoring package (or similarly scoped module) defines a pluggable scoring strategy interface, a Prisma model for recording scoring events and running totals per member/community, and at least one reference scoring strategy (e.g., simple point-per-action with decay over time) wired into the outbox event stream so scoring reacts to existing domain events (MEMBERSHIP_CREATED, ROLE_ASSIGNED, etc.).

Suggested implementation

  • Design a ScoringStrategy interface (score(event, currentTotal): number) in a new package, following the existing monorepo package conventions (packages/policy-engine as a model).
  • Add a Prisma model (contribution_scores or similar) tracking per-member, per-community running totals and a contribution_events log for auditability.
  • Consume relevant outbox event types to update scores (subscribe via the existing pluggable OutboxEventHandler pattern, or a dedicated consumer).
  • Expose a read endpoint (e.g., GET /v1/members/:wallet/score) for the current score/breakdown.
  • Document the scoring model, decay strategy, and extension points in docs/.

Acceptance criteria

  • Scoring strategy interface is pluggable (a second strategy could be added without touching call sites)
  • Scores update correctly in response to relevant domain events
  • New read endpoint documented in OpenAPI spec
  • Design documented in docs/

Likely affected files/directories

  • packages/ (new contribution-scoring package)
  • apps/access-api/prisma/schema.prisma
  • apps/access-api/src/routes/
  • docs/

Metadata

Metadata

Assignees

Labels

GrantFox OSSGrantFox Open Source Sponsorship program tagMaybe RewardedIssue may qualify for a reward upon successful completion per campaign rulesOfficial Campaign | FWC26Official FWC26 campaign issue — eligible for campaign scoring and rewardsadvancedAdvanced difficulty tasks requiring significant domain knowledge and implementation effortfeatureNew feature, enhancement, or functional addition

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions