fix(site-finder): normalize POI weighted score to 0..100 on backend (#1486) #1674
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lekss361/gendesign#1674
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "fix/poi-score-scale-1486"
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?
Проблема (#1486)
Фронт делал
Math.round(weight*100), считая weight∈[0..1], но backend отдаётweight=cat_weight/(dist+100)≈0.0001–0.06 → сумма ~5/100 для участка с отличной инфраструктурой; пороги badge (≥0.2/0.12/0.08) недостижимы → все POI амбер.Решение (нормировка на backend)
poi_score.py: константы_TOP7_WEIGHT_SUM/_MAX_STRAIGHT_SCORE/_MAX_ROUTING_SCORE; новые поляPoiScoreItem.score_contributionиPoiScoreResponse.poi_weighted_score(0..100). Нормировка обоих режимов (straight/routing) + фикс early-return в routing.site-finder-api.ts: убран*100, рендерит готовые backend-поля.PoiList2Gis.tsx: пороги badge → 0..100 (≥20/12/8), бейдж показываетscore_contribution. Мок обновлён.Verify
ruffclean;pytest tests/test_poi_score.py→ 28 passed (7 новых тестов на шкалу/диапазон/сумму).tsc --noEmit→ 0 ошибок.Closes #1486