fix(schemas): expose per-bucket elasticity + velocity_source в RecommendBucket (#1204) #1250
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#1250
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "fix/recommend-bucket-elasticity-fields"
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 #1204 (P2 api-contract). 5 missing полей в
RecommendBucket→ фронтRecommendVelocityPanel.tsxвсегда падал на глобальную эластичность вместо per-bucket.Bug
recommend_mix(analytics_queries.py:2592-2606) кладёт в каждый bucket:elasticity(per-bucket эластичность спроса по цене)elasticity_r2,elasticity_n,elasticity_source(диагностика)velocity_source(hedonic/deals/fallback)Но
RecommendBucketих не объявлял и не имелextra='allow'→ Pydantic v2 молча выкидывает из response. Фронт ждёт их (RecommendVelocityPanel.tsx:68: r.elasticity ?? elasticity), но всегда получалundefined→ fallback на глобальную. Live what-if при движении price-слайдера расходился с сервернымmonths_to_sellout(тот считается per-bucket) и с UI-таблицей «Эластичность по сегментам».Fix
Добавлены 5 опциональных полей в схему. Никаких изменений в
recommend_mixproducer'е или фронте — это restore broken contract.Test plan
pytest tests/ -k recommend→ 113 passed, 1 skipped, 0 failed.ruff check→ All checks passed.?? globalFallback, новые поля = bonus enrichment.Closes #1204