Skip to content

fix: MAGA (Make Argentina Great Again) - #36

Open
lorenzotomasdiez wants to merge 1 commit into
xai-org:mainfrom
lorenzotomasdiez:feat/argentinidad-boost
Open

fix: MAGA (Make Argentina Great Again)#36
lorenzotomasdiez wants to merge 1 commit into
xai-org:mainfrom
lorenzotomasdiez:feat/argentinidad-boost

Conversation

@lorenzotomasdiez

@lorenzotomasdiez lorenzotomasdiez commented Aug 14, 2026

Copy link
Copy Markdown

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, default false)
  • rust_home_mixer_maga_boost_factor (f64, default 1.15)

How

PostCandidate carries no author-country signal, so the boost keys off the post itself (home-mixer/scorers/maga.rs):

  • the Argentine flag emoji, accepted in any language
  • a short list of high-signal markers - che, boludo, mate, asado, milei, messi, maradona, quilombo, argentina, el mejor pais del mundo - but only for posts already tagged language_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:

  1. Substrings do not match. che inside noche / leche and mate inside matemática are rejected.
  2. Accents and punctuation do not matter. ¡MILEI! and el mejor país del mundo both match.
  3. Multi-word markers work the same way as single words, so the list can hold phrases without a separate code path.

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::score at the point where effective_oon and the diversity multipliers are already combined, in both the MPN path and the weighted path, so the two stay consistent.

Tests

  • 9 unit tests on the detector in 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)
  • 2 tests in ranking_scorer.rs: boost applies at the configured factor with the switch on, and is an exact no-op with it off

@lorenzotomasdiez
lorenzotomasdiez force-pushed the feat/argentinidad-boost branch from 894e054 to 3748b56 Compare August 14, 2026 03:26
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
lorenzotomasdiez force-pushed the feat/argentinidad-boost branch from 3748b56 to eb42b17 Compare August 14, 2026 03:28
@lorenzotomasdiez lorenzotomasdiez changed the title Add Argentinidad boost to RankingScorer fix: MAGA (Make Argentina Great Again) Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant