fix: MAGA (Make Argentina Great Again) - #36
Open
lorenzotomasdiez wants to merge 1 commit into
Open
Conversation
lorenzotomasdiez
force-pushed
the
feat/argentinidad-boost
branch
from
August 14, 2026 03:26
894e054 to
3748b56
Compare
MAGA: Make Argentina Great Again. Adds an optional scalar multiplier that boosts posts of Argentine origin, applied alongside the existing author-diversity and out-of-network multipliers in both the MPN and weighted scoring paths. The repo carries no author-country signal, so the boost keys off the post itself: the Argentine flag emoji in any language, or a small list of high-signal markers (che, mate, asado, milei, messi, maradona, ...) in posts already tagged as Spanish. Matching is on whole words after lowercasing and stripping diacritics, so "che" inside "noche" and "mate" inside "matematica" do not match, while "!MILEI!" and "el mejor pais del mundo" do. Off by default (rust_home_mixer_enable_maga_boost = false), so this is a no-op until the switch is turned on.
lorenzotomasdiez
force-pushed
the
feat/argentinidad-boost
branch
from
August 14, 2026 03:28
3748b56 to
eb42b17
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
MAGA: Make Argentina Great Again.
Adds an optional scalar multiplier that boosts posts of Argentine origin, applied alongside the existing author-diversity and out-of-network multipliers.
Two new feature switches, both off / no-op by default:
rust_home_mixer_enable_maga_boost(bool, defaultfalse)rust_home_mixer_maga_boost_factor(f64, default1.15)How
PostCandidatecarries no author-country signal, so the boost keys off the post itself (home-mixer/scorers/maga.rs):che,boludo,mate,asado,milei,messi,maradona,quilombo,argentina,el mejor pais del mundo- but only for posts already taggedlanguage_code == "es"Text is normalized first: lowercased, diacritics folded, and everything non-alphanumeric collapsed to single spaces. Markers are then matched on word boundaries, which gives three properties worth calling out:
cheinsidenoche/lecheandmateinsidematemáticaare rejected.¡MILEI!andel mejor país del mundoboth match.Markers that read as ordinary words elsewhere (
mate,messi,argentina) are gated behind the Spanish tag, so "thanks mate" does not match.Wired into
RankingScorer::scoreat the point whereeffective_oonand the diversity multipliers are already combined, in both the MPN path and the weighted path, so the two stay consistent.Tests
maga.rs(single-word and multi-word markers, accent and punctuation folding, flag-in-any-language, whole-word matching, language gating, unmarked Spanish, untagged language, empty text)ranking_scorer.rs: boost applies at the configured factor with the switch on, and is an exact no-op with it off