fix(tradein): feed raw payload.address to same-building anchor (geocode-independent) #680

Merged
bot-reviewer merged 1 commit from fix/tradein-anchor-raw-address into main 2026-05-29 23:17:09 +00:00
Collaborator

ROOT CAUSE of the live golden coverage being 67/58% (and flaky) while the offline sim was 95%.

The #677/#679 same-building anchor call passed address=geo.full_address (the GEOCODED canonical address). On prod the geocoder frequently returns None (lat/lon/canonical all None — observed for Ткачёва 13, Хохрякова 48, Олимп 13, …), so geo.full_address was empty → _normalize_building_key got nothing → Tier A (same building) never fired → the estimate fell back to the radius tier. The offline validation fed the RAW address directly, so it never hit this.

Fix (1 line): address=payload.address or geo.full_address — use the raw user input (always present, exactly what the normalizer is validated on); geo as fallback. Makes the same-building anchor independent of geocode success.

ruff clean; 30 anchor tests pass. After merge+deploy I will re-run the 53-case live golden E2E; expect the premium/business buildings (Ткачёва 27 comps, Iset 44, Олимп, Сакко) to finally fire Tier A and coverage to jump toward the ~95% sim.

Separately noted: prod geocoder returning None broadly is a distinct issue (possibly the #654 geocode time-budget) — to investigate next; this fix removes the SB anchor's dependence on it.

Refs #651 #677 #679

ROOT CAUSE of the live golden coverage being 67/58% (and flaky) while the offline sim was 95%. The #677/#679 same-building anchor call passed `address=geo.full_address` (the GEOCODED canonical address). On prod the geocoder frequently returns None (lat/lon/canonical all None — observed for Ткачёва 13, Хохрякова 48, Олимп 13, …), so geo.full_address was empty → _normalize_building_key got nothing → Tier A (same building) never fired → the estimate fell back to the radius tier. The offline validation fed the RAW address directly, so it never hit this. Fix (1 line): `address=payload.address or geo.full_address` — use the raw user input (always present, exactly what the normalizer is validated on); geo as fallback. Makes the same-building anchor independent of geocode success. ruff clean; 30 anchor tests pass. After merge+deploy I will re-run the 53-case live golden E2E; expect the premium/business buildings (Ткачёва 27 comps, Iset 44, Олимп, Сакко) to finally fire Tier A and coverage to jump toward the ~95% sim. Separately noted: prod geocoder returning None broadly is a distinct issue (possibly the #654 geocode time-budget) — to investigate next; this fix removes the SB anchor's dependence on it. Refs #651 #677 #679
bot-backend added 1 commit 2026-05-29 23:07:42 +00:00
The #677/#679 same-building anchor was fed geo.full_address (the GEOCODED
canonical address). On prod the geocoder frequently returns None (lat/lon/
canonical all None), so geo.full_address was empty → _normalize_building_key
got nothing → Tier A (same building) never fired → fell back to the radius
tier for every geocode-failing address. That is why live golden coverage was
67/58% (and flaky run-to-run) while the offline sim (which fed the raw address)
showed 95%: Ткачёва 13 / Хохрякова 48 etc. geocode-fail on prod.
Fix: pass payload.address (raw user input, always present, exactly what the
normalizer is validated on) with geo.full_address as fallback. Makes the
same-building anchor independent of geocode success. ruff clean; 30 anchor tests.

Refs #651 #677 #679
bot-reviewer approved these changes 2026-05-29 23:17:08 +00:00
bot-reviewer left a comment
Collaborator

Feed raw payload.address (fallback geo.full_address) to _fetch_anchor_comps. Correct: on prod geocode often returns None so full_address empty -> SB anchor Tier A missed building, fell to radius; raw address always present and is exactly what the #677/#679 normalizer was validated on. Graceful when both empty (no comps -> radius). No pricing-math/median/expected_sold impact; does not touch #674 bug class. Only estimator.py PR this pass. MINOR: no test for the trivial or-fallback (normalizer itself tested in #679). APPROVE.

<!-- gendesign-review-bot: sha=3a25e2c verdict=approve --> Feed raw payload.address (fallback geo.full_address) to _fetch_anchor_comps. Correct: on prod geocode often returns None so full_address empty -> SB anchor Tier A missed building, fell to radius; raw address always present and is exactly what the #677/#679 normalizer was validated on. Graceful when both empty (no comps -> radius). No pricing-math/median/expected_sold impact; does not touch #674 bug class. Only estimator.py PR this pass. MINOR: no test for the trivial or-fallback (normalizer itself tested in #679). APPROVE.
bot-reviewer merged commit 351ec88104 into main 2026-05-29 23:17:09 +00:00
bot-reviewer deleted branch fix/tradein-anchor-raw-address 2026-05-29 23:17:09 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lekss361/gendesign#680
No description provided.