Skip to content

Implement the Contributor Freshness time-decay algorithm #27

Description

@SHAURYASANYAL3

🛑 The Problem

A contributor who made 1,000 commits 5 years ago is far less relevant to the current 'Resilience' of a project than a contributor who made 50 commits yesterday. If we don't account for time, our Health Scores will falsely report abandoned projects as highly resilient.

💡 The Solution

We must apply an exponential time-decay formula to a contributor's weight.

🛠️ Implementation Details

  1. Implement the mathematical formula: Weight = InitialValue * Math.exp(-lambda * timeElapsed).
  2. Define the half-life (e.g., 180 days). This means a commit made 6 months ago is worth exactly half of a commit made today.
  3. Apply this multiplier to the raw commit counts before passing them into the Bus Factor and Maintenance algorithms.

✅ Acceptance Criteria

  • Older commits mathematically contribute less to the final score.
  • The half-life is configurable via an environment variable or constant.
  • Comprehensive unit tests prove the decay curve behaves correctly.

Ready to tackle this? Comment .take below to get automatically assigned!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    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