fix: cap forum post engagement time depreciation with min instead of max
calculateEngagement applies a time-based depreciation to reddit and hacker-news posts older than depreciatePostsOlderThanHours. The ramp used math.Max(elapsed-threshold, maxDepreciationAfterHours), which is always >= maxDepreciationAfterHours, so the depreciation factor was always >= 1. As a result every post past the 7h threshold was immediately hit with the full maxDepreciation (0.9), defeating the gradual decay, and posts older than threshold+maxDepreciationAfterHours got a factor > 1, producing negative engagement scores. Use math.Min so the factor ramps from 0 to 1 over maxDepreciationAfterHours and is capped there, restoring the intended gradual decay and flooring engagement at 1-maxDepreciation. Co-Authored-By: Claude <noreply@anthropic.com>
T
TowyTowy committed
646a7f54de391e1ddbc7fb1d7deb2a01df80b943
Parent: c8dc5bb