fix(tradein/estimator): ghost-anchor invariant guard — n_analogs=0 forces low (audit #1871 P1.2) #1874
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#1874
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "audit/1871-p1-2-ghost-anchor-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?
Summary
Audit-issue #1871 пункт P1.2 — Ghost-anchor:
confidence='high'приn_analogs=0.Факт по prod-DB (
tradein): ghost5fcc1e99(n=0, high, 38.45M ₽,yandex_valuation) — единственная legacy-строка от 2026-05-30, давно expired (TTL оценок = 1 день; все 66high/medium-с-n<5строк expired). Текущий live-код уже честен (_compute_confidence→ low при median=0;#755 capn<5→не high). Живого инцидента нет — фикс делает инвариант явным и вечным против будущих external-valuation-blend / rehydrate / migration путей.Изменения (4 файла, +173/-6)
estimator.py: helper_enforce_zero_analog_lowфорситlow+ caveat когдаn_analogs==0 and confidence!='low'. Идемпотентен, не трогаетhigh+N>0, реальный median сохраняется (no fake),logger.warningдля observability. Вызов перед сборкойAggregatedEstimateвestimate_quality(единственный уязвимый return;_empty_estimateхардкодит low). +5 unit-тестов.HeroSummary.tsx/HeroTransparency.tsx/history/page.tsx:effectiveConfidence = n_analogs===0 ? 'low' : confidence— defensive depth. Caveat из backendconfidence_explanation(не хардкод). Type-safe.Honesty contract
Реальный median внешнего сервиса НЕ подменяется фейком — только понижается confidence + добавляется caveat «оценка без сопоставимых аналогов рядом». Никаких выдуманных коэффициентов.
Test plan
.nextкэш, pre-existing)deploy-tradein.ymlpytest-gate зелёныйDeploy
Триггерит
deploy-tradein.yml(отдельный pipeline наtradein-mvp/**), не основной gendesign.Refs #1871
🤖 Generated with Claude Code