fix(estimator): ghost-anchor — confidence='low' when radius analogs empty (#1871) #1920
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#1920
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "fix/1871-ghost-anchor-confidence-guard"
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?
#1871 P1 (Ghost-anchor) — fabricated confidence
When the same-building anchor replaces the headline estimate, the code sets
confidence = anchor["confidence"]and overwritesn_analogs = anchor["n"](>0). With zero radius analogs (listings_clean == []) this yieldedhigh/mediumconfidence on an estimate built only on same-building comps (sometimes a singleyandex_valuation, e.g. median 38.4M) — UI rendered «Высокая · 0 объектов» = выдумка-как-факт.Root: the defensive
_enforce_zero_analog_lowonly fires onn_analogs == 0, butn_analogswas already overwritten toanchor["n"](>0), so it never caught this path.Fix: inline guard inside the
if anchor is not None:block, right aftern_analogs = anchor["n"](estimator.py:2495) — whenlistings_cleanis empty and confidence isn't alreadylow, downgrade tolow, log a warning, and append an honest caveat. Sits before the result is finalized → propagates to the response. +18 lines, nothing else touched.Test:
tests/test_estimator_ghost_anchor_radius_empty_1871.py— tight-spread anchor that would behigh+ empty radius → assertslow+ caveat; caveat appended not replacing; non-empty-radius control NOT downgraded. 56 passed (-k estimator/ghost/anchor/confidence/1871), ruff clean on touched files.Audit #1871 verification note (this session)
Re-checked 4 core-estimator audit defects vs current code — only ghost-anchor was still real. Already-fixed since 06-22: velocity fallback 4500→750 (
adf3ec7), radius-path dedup (rn_dup window +estimate_radius_dedup_enabled=True confirmed in prod + migration 133), avito non-EKB coords (non-issue —ST_DWithin(geom::geography)excludes NULL/out-of-radius).Refs #1871