Fix: add cold-start candidate guardrails - #331
Conversation
|
Found two correctness blockers in the cold-start guardrail segmentation:
Tests/verification run: targeted pytest for new guardrail tests passed with |
|
STAFF ENGINEER REVIEW: CHANGES REQUESTED — Found two correctness blockers in the cold-start guardrail segmentation:
Tests/verification run: targeted pytest for new guardrail tests passed with |
|
STAFF ENGINEER REVIEW: CHANGES REQUESTED — CI is red on the recommendation path changed by this PR. Please fix the guarded-segment underfill/fallback behavior or update the affected test harness intentionally, then push a new commit. Raw SQL security check: the new source filter is parameterized ( |
|
STAFF ENGINEER REVIEW: CHANGES REQUESTED — Latest head The new Please fix the fallback support detection or update the test contract intentionally, then push another commit. Auto-merge remains disabled. |
|
STAFF ENGINEER REVIEW: CHANGES REQUESTED — rollback is not immediate for already queued guarded recommendations. Blocking issue:
Please discard or reject guarded queued payloads when the guardrail flag is off, or otherwise make the rollback path stop treatment delivery immediately. Verification I ran:
|
|
STAFF ENGINEER REVIEW: APPROVED — Clean review on latest head ae2dbb0. Verified prior blockers are fixed: guarded queue rollback now discards existing guarded payloads when disabled, queued items are included in position-window math, guarded underfill routes to fallback instead of leaking unguarded cold-start candidates, and fallback support detection preserves dynamic test retrievers. Local targeted pytest passed (51 tests), ruff passed, git diff --check passed, diff secret scan found only public source URLs/test env text, CSO SQL/config pass found no injection or secret issue, and Codex review found no blockers. |
|
✅ Approved + merged. |
Fixes FFM-1882.
Summary
COLD_START_CANDIDATE_GUARDRAILS_ENABLEDrollback flag for the cold-start candidate filter experiment.cold_start_explore/cold_start_adaptcandidate SQL for true-new positions 2-10 only, including mixed initial batches where position 1 remains control.cold_start_explore_guarded/cold_start_adapt_guardedand include those engines in the first-10 readout.text_light_lr_smoothed/best_uploaded_memesfallbacks when guarded cold-start pools are empty.Rollback
Set
COLD_START_CANDIDATE_GUARDRAILS_ENABLED=falsein production env.Verification
ruff check --fix src/ tests/ && ruff format src/ tests/DATABASE_URL=postgresql+asyncpg://user:pass@localhost/test REDIS_URL=redis://localhost:6379/0 CORS_ORIGINS='[]' CORS_HEADERS='[]' pytest tests/recommendations/test_cold_start_candidate_guardrails.py tests/recommendations/test_pipeline.py tests/recommendations/test_meme_queue.py tests/stats/test_cold_start_quality.py::test_readout_includes_guarded_cold_start_treatment_engines -qNotes for Analyst / QA
user_meme_reaction.recommended_by IN ('cold_start_explore_guarded', 'cold_start_adapt_guarded')and fallback diagnostics viacold_start_candidate_guardrails_applied+fallback_used.