Skip to content

Fix: freeze recently liked v2 enrollment - #334

Merged
ohld merged 1 commit into
productionfrom
fix/ffm-1917-freeze-recently-liked-v2
Jul 23, 2026
Merged

Fix: freeze recently liked v2 enrollment#334
ohld merged 1 commit into
productionfrom
fix/ffm-1917-freeze-recently-liked-v2

Conversation

@ohld

@ohld ohld commented Jul 23, 2026

Copy link
Copy Markdown
Member

Fixes FFM-1917.

What changed

  • Added an explicit freeze gate for recently_liked_blender_v2 new enrollment after the existing assignment read.
  • Existing assignment rows still return their saved variant, so Analyst can keep the passive watch on already-assigned users.
  • Unassigned mature users now fall back to control mature-feed weights without inserting control/treatment/excluded experiment rows.
  • Updated the active experiment record with the freeze timestamp and rollback path.

Root cause

The assignment path still inserted new recently_liked_blender_v2 experiment rows after the July 22 checkpoint showed the 1,000-per-arm gate was no longer reachable in a useful window.

Freeze record

  • Freeze recorded at: 2026-07-23T18:05:54Z
  • Effective freeze point: after this PR is merged and deployed from production
  • Rollback path: set RECENTLY_LIKED_BLENDER_V2_ENROLLMENT_FROZEN = False and redeploy.

Validation

  • ruff check --fix src/ tests/
  • ruff format src/ tests/
  • env DATABASE_URL=postgresql+asyncpg://postgres:postgres@localhost:65432/postgres REDIS_URL=redis://localhost:36379/0 CORS_ORIGINS='["*"]' CORS_HEADERS='["*"]' TELEGRAM_BOT_TOKEN=test TELEGRAM_BOT_USERNAME=test_bot TELEGRAM_BOT_WEBHOOK_SECRET=test MEME_STORAGE_TELEGRAM_CHAT_ID=1 UPLOADED_MEMES_REVIEW_CHAT_ID=2 ADMIN_LOGS_CHAT_ID=3 ENVIRONMENT=testing python3 -m pytest tests/recommendations/test_blender_experiments.py -q

Reviewer notes

Staff Engineer should verify the gate placement preserves existing assignments and does not touch cold-start routing, cold_start_candidate_filter, moderator low-sent quota, or unrelated engines. FFM-1918 remains the Analyst post-deploy passive watch.

@ohld

ohld commented Jul 23, 2026

Copy link
Copy Markdown
Member Author

STAFF ENGINEER REVIEW: APPROVED — clean structural review. Freeze gate is placed after existing assignment lookup and before metrics/assignment insert, preserving existing variants while preventing new enrollment; new unassigned mature users fall back to control weights without experiment rows. Local targeted tests passed: tests/recommendations/test_blender_experiments.py 16/16. Codex review found no P1 issues. CI lint/test are green.

@ohld
ohld merged commit ab3c4f5 into production Jul 23, 2026
3 checks passed
@ohld

ohld commented Jul 23, 2026

Copy link
Copy Markdown
Member Author

✅ Approved + merged.

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