Skip to content

chore(reco): delete closed ranking experiments and dormant flags - #389

Merged
ohld merged 2 commits into
productionfrom
chore/reco-delete-closed-experiments
Oct 31, 2026
Merged

ohld merged 2 commits into
productionfrom
chore/reco-delete-closed-experiments

Conversation

@ohld

@ohld ohld commented Oct 31, 2026

Copy link
Copy Markdown
Member

Deletion-only cleanup of closed ranking experiments and flags that are off in production. The feed every user gets does not change.

What was deleted

Item Evidence it was dead
recently_liked_blender_v2 (assignment, Redis 7d-LR quartile cache and lock, weights hook) in blender_experiments.py Closed 2026-08-09, enrollment frozen. The weights hook already returned MATURE_BLEND_WEIGHTS for every user, which is what plan.blend_weights holds for mature users. The quartile cache had no other caller.
text_light_blender_v1 weights overlay and _fixed_pos_for_weights meme_queue passed text_light_blender_v1_enabled=False. The fixed-position remap only fired when text_light_lr_smoothed was in the weights, which never happens on the growing or mature plans.
viral_shares engine plus the close-out stub get_mature_blend_weights_with_experiments No blend weight referenced the engine. viral_shares_blender_v1 was killed on 2026-10-30.
cold_start_experiments.py and the fresh-viral branches in meme_queue / pipeline / candidates (max_age_days, the cold_start_explore_fresh* labels) COLD_START_FRESH_VIRAL_EXPERIMENT_ENABLED defaults to false and is explicitly set to false in the prod env. The experiment was killed on 2026-10-30.
Source diversity (diversify_candidates_by_source), shadow score summary, full-payload sampler, Sentry span helpers, and their flags (RECOMMENDATION_SOURCE_DIVERSITY_ENABLED, RECOMMENDATION_SHADOW_SCORING_ENABLED, RECOMMENDATION_DIAGNOSTICS_SAMPLE_RATE) Diversity defaulted to false and is not set in prod. The shadow score and full payload were diagnostics only and never changed ordering.
RECOMMENDATION_BLOCK_DISLIKED_* and block_disliked_sources_sql_filter (11 call sites) Defaults to false and is not set in prod, so every call returned "".
Channel-viral broadcast pick and BROADCAST_CHANNEL_VIRAL_PICK_ENABLED Off since 2026-10-30 (H3c) and not set in prod. The HQ pick is the default.
Tests: test_cold_start_fresh.py, test_block_disliked_sources.py, the v2/text-light cases in test_blender_experiments.py, test_meme_queue.py and test_pipeline.py, and the channel-viral cases in test_broadcast_pick.py They covered the code removed above.

What stays

  • explore_budget_v1 and everything it uses: assignment, fresh_viral engine and filter, bad-fresh drop, idle-return slot, labeling-budget low_sent query.
  • The text_light_lr_smoothed engine, which is the cold-start CS3 weight and fallback.
  • The disliked-source demote policy.
  • The compact recommendation batch diagnostics log line. It still has the fields named in the explore-budget guardrail (selected_count, last_resort_used). It no longer has the keys for the removed features (source_diversity_*, shadow_*, cold_start_fresh_applied, the full_json payload).
  • Analyst SQL and readouts for closed experiments. They read historical DB rows.

Verification

  • Every removed symbol was grepped first. The flag values were checked in the production env.
  • tests/recommendations, tests/feed_turn and tests/broadcasts, plus the sentry, experiment-assignment, redis, tgbot next/start/friend-challenge and crossposting tests: all pass locally (194 + 42 passed, 2 skipped).
  • ruff check and ruff format are clean.

Diff stat

 .env.example                                       |   2 -
 specs/recommendations.md                           |   2 +-
 src/config.py                                      |  18 -
 src/recommendations/blender_experiments.py         | 445 +--------------------
 src/recommendations/broadcast_pick.py              |  86 +---
 src/recommendations/candidates.py                  | 124 +-----
 src/recommendations/cold_start_experiments.py      |  96 -----
 src/recommendations/meme_queue.py                  |  65 +--
 src/recommendations/pipeline.py                    | 440 ++------------------
 src/recommendations/utils.py                       |  46 ---
 tests/recommendations/test_blender_experiments.py  | 338 ----------------
 .../recommendations/test_block_disliked_sources.py | 140 -------
 tests/recommendations/test_broadcast_pick.py       |  72 ----
 tests/recommendations/test_cold_start_fresh.py     | 176 --------
 tests/recommendations/test_engine_contracts.py     |   1 -
 tests/recommendations/test_meme_queue.py           | 184 +--------
 tests/recommendations/test_pipeline.py             | 154 +------
 17 files changed, 70 insertions(+), 2319 deletions(-)

The COLD_START_FRESH_VIRAL_EXPERIMENT_ENABLED=false entry in the prod env can be removed after merge. It is harmless if left.

ohld added 2 commits October 31, 2026 13:04
Remove recently_liked_blender_v2 / text_light_blender_v1 / viral_shares
blender code, cold_start_fresh_viral_v1, source-diversity + shadow-score +
full-payload/Sentry-span diagnostics, the always-off disliked-source block
filter and the disabled channel-viral broadcast pick. explore_budget_v1,
the text_light_lr_smoothed engine, the demote policy and the compact
'recommendation batch diagnostics' log line stay. Feed output unchanged.
@ohld
ohld merged commit c762ee3 into production Oct 31, 2026
2 checks passed
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