feat(tradein): same-building anchor estimator (#651/#652 v2) behind flag #677
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#677
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "feat/tradein-same-building-anchor"
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
Fixes the core accuracy bug: radius-median ppm2 systematically underestimated premium ~2.5x and comfort ~15-25% by diluting the building/complex premium. Replaces the radius median with a same-building anchor (industry-standard: Fannie Mae same-project-comps-preferred, similarity weighting, segment purity, premium guardrail, FSD range).
Validation
Offline sim, 55 golden cases: range-covers-real 53%->95%, premium point-error 53%->18%, comfort 69%->100%, economy 50%->100% (no regression). Same-building comps exist in live DB for 47/55.
Live-DB self-check: Hohryakova 48 4k -> real 100M in [56.1,102.1]M; Olimp 13 penthouse -> real 207M in [74.5,258.9]M; Ilyicha 28 econ -> no inflation; 8 Marta 204G view -> real 15.95M in [7.5,16.2]M.
Test plan
Known residual (next iter, not blocking): within-building floor/view dispersion (3/55) -> range spans it but wide for view-heavy buildings.
Refs #651 #652
Same-building anchor estimator v2 (#651/#652 v2), reviewed via subagent (6-dim). Verified: (1) #674 stale-expected_sold bug class CLEARED ? SB-anchor and IMV-blend are mutually exclusive (anchor_tier is None gate, no double-adjustment of median); expected_sold derived AFTER all mutations + DB persists post-mutation; consistency test present. (2) Math safe: exp-weights>0, wsum>0 guarded w/ percentile fallback, range_low floored >=0, range_low<=point<=range_high invariant, hard guardrail est>=comp_min*0.95, no div-by-zero. (3) SQL: CAST(:x AS type) binds, regex built only from int + single matched char (no injection). (4) Graceful-None degradation + comprehensive tests (flag on/off, anchor present/absent, premium-lift, economy no-overshoot, guardrail, expected_sold consistency). NOTE: flag estimate_same_building_anchor_enabled defaults ON (not OFF) ? this is the DOCUMENTED, golden-validated decision (vault 2026-05-30, real-in-range 53->95pct, premium 25->92pct, no comfort/economy regression), env-overridable kill-switch, matching merged sibling estimate_imv_blend_enabled=True. Accepting default-ON. APPROVE.