Skip to content

feat: Make character class thresholds configurable #199

@madjin

Description

@madjin

Summary

Move character class thresholds from hardcoded values to config/example.json for per-deployment customization.

Current State

Thresholds are hardcoded in src/lib/pipelines/export/exportLeaderboardAPI.ts:

const types = [
  { key: "prs", name: "Builder", threshold: 50 },
  { key: "issues", name: "Hunter", threshold: 25 },
];
const hasHighReviews = distribution.reviews.percentage >= 25;

Proposed Config

{
  "characterSystem": {
    "thresholds": {
      "builder": { "prs": 50 },
      "hunter": { "issues": 25 },
      "maintainer": { "reviews": 25 },
      "scribe": { "docsFocus": 40 }
    },
    "tiers": {
      "beginner": 0,
      "regular": 50,
      "active": 200,
      "veteran": 500,
      "elite": 1000,
      "legend": 5000
    }
  }
}

Benefits

  • Fork-friendly: Different orgs have different contribution patterns
  • PM-friendly: No code changes to tune thresholds
  • Consistent with existing config patterns (scoring rules, bot exclusions)

Acceptance Criteria

  • Add characterSystem section to config schema
  • Load thresholds from config in deriveCharacterClass()
  • Update documentation
  • Add example config values

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions