chore(tradein/backtest): --resolve-house-id flag to measure Tier-S + IMV anchor (#2002) #2025

Merged
lekss361 merged 1 commit from chore/tradein-harness-resolve-houseid into main 2026-06-27 19:44:39 +00:00
Owner

Summary

Adds a --resolve-house-id flag to the backtest harness so the canonical Tier-S analog path + the Avito-IMV anchor — which prod fires per estimate but the harness hard-coded to None — become measurable against ground-truth. Measurement tooling only: flag defaults off → regression gate byte-identical.

When on, each deal resolves its house via match_house_readonly(address, lat, lon) and threads the id into the 4 _fetch_analogs calls (Tier-S) + _fetch_house_imv_anchor. Emits a house_id_resolution: {resolved, total, imv_reachable} block in --json.

What it measured (700 deals, prod) — a measured dead-end

  • Resolution: 303/700 (43%) resolve a house_id; only 59 (8.4%) are IMV-reachable.
  • Per-segment expected_sold: OFF vs ON essentially identical — overall MAPE 14.52→14.49 (noise), бизнес −14.97→−14.97, элит −28.56→−28.56 (zero movement on the underpriced segments).
  • Why: Avito-IMV covers mid-market, not elite (doesn't reach the underpriced elite deals); Tier-S canonical feeds the radius-median pool that already underprices elite. → house-resolution is inert for accuracy — the 5th measured dead-end (after g(es), tier-ratio, corridor-clamp, outlier-filter).

The flag stays as a permanent measurement capability (re-measure if Avito-IMV coverage grows).

Test plan

  • regression gate byte-identical (flag defaults off)
  • import scripts.backtest_estimator clean; --help shows the flag
  • 4 new flag/accumulator tests; test_backtest_estimator + roundtrip → 65 passed
  • ran on prod (docker cp) — resolution block + deltas above; original harness restored
  • ruff strict clean

Refs #2002

## Summary Adds a `--resolve-house-id` flag to the backtest harness so the canonical Tier-S analog path + the Avito-IMV anchor — which prod fires per estimate but the harness hard-coded to `None` — become **measurable** against ground-truth. **Measurement tooling only: flag defaults off → regression gate byte-identical.** When on, each deal resolves its house via `match_house_readonly(address, lat, lon)` and threads the id into the 4 `_fetch_analogs` calls (Tier-S) + `_fetch_house_imv_anchor`. Emits a `house_id_resolution: {resolved, total, imv_reachable}` block in `--json`. ## What it measured (700 deals, prod) — a measured dead-end - **Resolution: 303/700 (43%) resolve a house_id; only 59 (8.4%) are IMV-reachable.** - **Per-segment expected_sold: OFF vs ON essentially identical** — overall MAPE 14.52→14.49 (noise), бизнес −14.97→−14.97, элит −28.56→−28.56 (zero movement on the underpriced segments). - Why: Avito-IMV covers mid-market, not elite (doesn't reach the underpriced elite deals); Tier-S canonical feeds the radius-median pool that already underprices elite. → house-resolution is **inert for accuracy** — the 5th measured dead-end (after g(es), tier-ratio, corridor-clamp, outlier-filter). The flag stays as a permanent measurement capability (re-measure if Avito-IMV coverage grows). ## Test plan - [x] regression gate **byte-identical** (flag defaults off) - [x] `import scripts.backtest_estimator` clean; `--help` shows the flag - [x] 4 new flag/accumulator tests; `test_backtest_estimator` + roundtrip → 65 passed - [x] ran on prod (docker cp) — resolution block + deltas above; original harness restored - [x] ruff strict clean Refs #2002
lekss361 added 1 commit 2026-06-27 19:44:29 +00:00
chore(tradein/backtest): --resolve-house-id flag to measure Tier-S + IMV anchor (#2002)
All checks were successful
CI / changes (pull_request) Successful in 8s
CI / backend-tests (pull_request) Has been skipped
CI / frontend-tests (pull_request) Has been skipped
CI / openapi-codegen-check (pull_request) Has been skipped
00e121056a
lekss361 merged commit ec0f113d4f into main 2026-06-27 19:44:39 +00:00
lekss361 deleted branch chore/tradein-harness-resolve-houseid 2026-06-27 19:44:39 +00:00
lekss361 added the
priority/p2
scope/backend
tradein
labels 2026-06-27 19:44:39 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
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#2025
No description provided.