Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions home-mixer/scorers/ranking_scorer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,16 @@ impl ScoringWeights {
}

fn recompute_sums(&mut self) {
// Negative action weights are configured as negative floats (e.g., -43.2).
// Asserting non-positive magnitude prevents sign inversion misconfigurations.
debug_assert!(
self.not_interested <= 0.0
&& self.block_author <= 0.0
&& self.mute_author <= 0.0
&& self.report <= 0.0
&& self.not_dwelled <= 0.0,
"Negative action weights must be non-positive values"
);
let positive_sum = self.favorite
+ self.reply
+ self.retweet
Expand Down Expand Up @@ -241,6 +251,10 @@ impl ScoringWeights {
!self.post_unexplored_in_network_only || candidate.in_network == Some(true)
}

/// Determines if a post candidate is eligible for the mutual follow boost.
/// Excludes replies (`in_reply_to_tweet_id`) and retweets (`retweeted_tweet_id`).
/// Note: Quote tweets are intentionally eligible because they contain new original commentary
/// authored by the mutual-follow user.
fn bidirectional_boost_eligible(candidate: &PostCandidate) -> bool {
candidate.in_reply_to_tweet_id.is_none()
&& candidate.retweeted_tweet_id.is_none()
Expand Down