fix(sf-17): rosreestr velocity fallback via cad_quarter (~100% EKB coverage) #289
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#289
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "fix/sf-17-rosreestr-velocity-fallback"
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
Task #44 Part D = SF FixList #17 (Wave 3). После Part A (PR #286) mapping coverage поднялась до ~20%, но 80% ЖК ЕКБ всё равно без Objective data → их velocity = 0 (правильно но не useful). Этот PR добавляет independent fallback через
rosreestr_dealsJOIN поcad_quarter— даёт 100% coverage по кварталам.Audit (postgres MCP)
rosreestr_dealsEKB: 244,970 сделок, 11,445 уникальных кварталовdomrf_kn_objectsEKB: 237 уникальных cad_quarter66:41:0702048(для test_cad66:41:0702048:27): 10 сделок за 12 месИзменения
backend/app/services/site_finder/velocity.py:VelocityResult.velocity_source: Literal['objective', 'rosreestr_fallback', 'none']_OBJECTIVE_COVERAGE_MIN_RATIO = 0.50— порог переключения на fallback_compute_rosreestr_fallback()—SELECT COUNT(*) FROM rosreestr_deals WHERE quarter_cad_number = :cad_quarter AND doc_type IN ('ДДУ', 'ДКП')compute_velocity(cad_quarter, ...)— новый param, проверка mapped_ratio, fallback при <50% mapped ИЛИ no databackend/app/api/v1/parcels.py:_cad_quarter(первые 3 сегментаcad_num), передача вcompute_velocityfrontend/src/types/site-finder.ts:Velocity.velocity_source?: 'objective' | 'rosreestr_fallback' | 'none'frontend/src/components/site-finder/VelocityBlock.tsx:bg-amber-50 text-amber-800) когдаvelocity_source === 'rosreestr_fallback'fixes/Fix_SF_Velocity_RosreestrFallback_May17.mdTest plan
POST /api/v1/parcels/66:41:0702048:27/analyze→velocity.velocity_sourceприсутствуетvelocity_source = 'rosreestr_fallback',velocity_data_available = true, amber badge виденvelocity_source = 'objective', badge не показываетсяRelated: epic #271 item #17 · task #44 Part D · завершает A+D combo
Combined coverage после deploy:
?v2=truecurl after deploy)Merged via deep-code-reviewer — APPROVE.
Проверено:
CAST(:window_interval AS interval)корректно66:41:0702048(6mo): 52ms, partition prune работает (только2025q4+2026q1), индексrosreestr_deals_region_cq_idxиспользованcad_quarter: str | None = None— 12 callers вtest_velocity.py+ старыйparcels.pyне сломалисьlen(_cad_parts) >= 3 else None,n_total_comps > 0 else 0.0,db.begin_nested()SAVEPOINTfixes/Fix_SF_Velocity_RosreestrFallback_May17.mdприсутствуетSmoke post-deploy:
POST /api/v1/parcels/66:41:0702048:27/analyze→velocity.velocity_sourceприсутствует в JSONvelocity_source='rosreestr_fallback'+ amber badge "Источник: квартальные сделки"?v2=truemapping run) + Part D (auto-active) → ~100% velocity coverage по EKBNit (отдельным PR, не блокер):
region_code = 66в WHERE для full index использования(region_code, quarter_cad_number)— сейчас 52ms ок, но prefix-only scan.