fix(analytics): rolling 6mo/6mo окна в _district_velocity_trend (#1203) #1265
No reviewers
Labels
No labels
admin
analytics
auth
automation
bug
business
chore
ci
compliance
data
data-moat
docs
duplicate
dx
enhancement
Fable 5 ревью
feedback/max
generative
GG-форсайт
needs-discussion
needs-human
observability
pause-bots
performance
priority/p0
priority/p1
priority/p2
priority/p3
scope/backend
scope/db
scope/devops
scope/frontend
scope/qa
scrapers
security
site-finder
stage/1
stage/2
status/blocked
status/done
status/needs-analysis
status/needs-fix
status/qa
status/ready
status/review
status/wip
tech-debt
tradein
ux
week ревью 1
wontfix
вторичка
ИРД
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lekss361/gendesign#1265
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "fix/recommend-velocity-trend-rolling-window"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Closes #1203 (P2 silent correctness, prod).
_district_velocity_trendиспользовал захардкоженные даты 2025 → trend_factor навсегда упёрся в кап 2.0 →bucket_velocity ×2,months_to_selloutзанижен ×2 в recommend_mix.Bug
objective_corpus_room_monthобновляется еженедельно (ETLperiod_monthбез капа). На 2026-06 recent ≈ 11–12 месяцев vs prior=6 → при плоском рынкеratio ≈ 1.83, дальше навсегда упирается вclamp(_, 2.0)→ trend-сигнал мёртв,macro_velocity_mult ×2 → bucket_velocity ×2 → months_to_selloutзанижен ~1.8–2x. Искажение растёт с каждым месяцем.Fix
Rolling 6mo/6mo окна относительно
NOW():Равные окна, без хардкода. Plain rolling.
Test plan
pytest -k "velocity_trend or recommend_mix"→ 29 passed, 1 skipped.ruff check→ clean.Closes #1203
_district_velocity_trend сравнивал recent vs prior, но окна были ЗАХАРДКОЖЕНЫ датами 2025: recent = report_month >= 2025-07-01 (без верхней границы!) prior = report_month BETWEEN 2025-01-01 AND 2025-06-30 objective_corpus_room_month обновляется еженедельно (objective_etl, period_month без капа). На 2026-06 recent-окно ≈ 11-12 месяцев vs prior=6 → при плоском рынке ratio ≈ 1.83, дальше навсегда упирается в clamp(_, 2.0) → trend_factor=2.0 → macro_velocity_mult ×2 → bucket_velocity ×2 → months_to_sellout занижен в ~1.8-2x. Искажение растёт с каждым месяцем; trend-сигнал мёртв. Patch: rolling 6mo/6mo окна относительно NOW(): recent = report_month >= NOW() - INTERVAL '6 months' prior = report_month >= NOW() - INTERVAL '12 months' AND report_month < NOW() - INTERVAL '6 months' Равные окна, plain rolling, без хардкода. 29/29 velocity_trend + recommend_mix тестов зелёные. ruff clean. Closes #1203