feat(site-finder): OSRM road-distance in /analyze behind flag (#39 A2) #1932
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#1932
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "feat/39-osrm-analyze-distances"
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
ST_Distance(geom::geography)в POI-скоринге/analyzeреальным дорожным расстоянием центроид→POI из локального OSRM, за флагом.GET http://osrm:5000/table/v1/driving/{lon0},{lat0};{lon1},{lat1};...?sources=0&annotations=distance→{"code":"Ok","distances":[[0, d1, d2, ...]]}(метры). Читаемdistances[0][1:](пропуская self origin→origin = 0). НЕ durations×скорость, НЕ POST-body (это ORS).use_osrm_distancesdefault OFF → деплой поведенчески-нейтрален. При OFF OSRM не дёргается вообще,/analyzeбайт-в-байт как сегодня.code!=Ok/ битая форма / рассинхрон длины) →OsrmLocalUnavailableError→ straight-line по всем POI./analyzeне падает в 500. Недостижимый POI (nullот OSRM) сохраняет straight-line.osm_poi_ekb), и для custom POI (user_custom_pois).distance_mуже вscore_breakdown,AnalyzeResponse=extra="allow") → codegen НЕ нужен.Files
backend/app/core/config.py—use_osrm_distances: bool = False,osrm_local_url,osrm_distance_timeout_s.backend/app/services/site_finder/osrm_client_local.py— новый клиент (get_road_distances_m,OsrmLocalUnavailableError).backend/app/api/v1/parcels.py— flag-gated применение road-distance в POI-блоках + helper_apply_osrm_road_distances.backend/tests/test_osrm_client_local.py,backend/tests/api/v1/test_analyze_osrm_distances.py— юнит + интеграция.Test plan
uv run pytest -k "osrm or analyze or poi" -q→ 195 passed, 3 skipped, 0 faileduv run pytest -q→ 3567 passed, 51 skipped, 0 faileduv run ruff check→ cleanRefs #39