-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Discribtion
1. Context
We have encountered a critical logic error in the Evergreeners system regarding how "absolute absence" and contribution consistency are calculated. The current system is too lenient regarding broken streaks and fails to account for private contribution settings accurately.
2. The Problems
A. The "Two-Day" Gap Error (Streak Logic)
Current Behavior: The system currently only flags a broken streak if the user has been inactive for two consecutive days.
Expected Behavior: The system must detect absolute absence. If a user misses a single day (a 24-hour gap between the last contribution date and the current date), the streak should immediately be marked as broken/reset.
B. Private Contribution Detection
Current Behavior: The system tracks public contributions but fails to validate private contributions properly, specifically when they are "locked" or not accessible via the current token scope.
Expected Behavior: The system needs to:
Accurately count private contributions towards the streak.
Detect if private contributions are "locked" (hidden from the public profile) and handle this state gracefully, ensuring the user is credited if they have provided a valid token.
3. Technical Areas to Check
Backend / API Route: Check the date comparison logic. Look for conditions like if (daysSinceLastCommit > 1) and change to strict checking (e.g., checking if lastCommitDate != yesterday AND lastCommitDate != today).
GitHub API Query: Verify the GraphQL/REST query includes privacy: PRIVATE or checks the user's includePrivateContributions status.
- Acceptance Criteria
[ ] Logic updated to flag a broken streak after 1 day of inactivity.
[ ] Private contributions are accurately detected and counted.
[ ] System handles/notifies if private contributions are undetectable due to token permissions.