gendesign/backend/tests/services/site_finder
Light1YT 2b3759af6a
All checks were successful
Deploy / changes (push) Successful in 5s
Deploy / build-frontend (push) Has been skipped
Deploy / build-backend (push) Successful in 1m31s
Deploy / build-worker (push) Successful in 2m34s
Deploy / deploy (push) Successful in 57s
fix(market-metrics): count window sales by contract_date, not 17-day history (#949 CRITICAL)
REOPENED. _SALES_WINDOW_SQL derived "sales in window" from objective_lots_history
snapshots, but history is only ~17 days deep — every currently-sold lot had a
sold-snapshot in the window, so window-sales collapsed into the entire cumulative
sold stock (Автовокзал 6mo: 33,245 vs real ~2,308). Inflated absorption_rate
(~235%/mo with confidence=high), months_of_supply, unit_velocity, liquidity,
demand_concentration → contaminated forecast #950/#952.

Count window sales directly from objective_lots by contract_date in the window
(the real sale date — present on 100% of sold lots: 41,091/41,091). Return
contract of _query_sales_window unchanged (units/area/by-room ROLLUP); downstream
formulas untouched. Removed the now-dead objective_lots_history JOIN/CTE.
Regression test: lots sold outside window (contract_date out of range) not counted
(41,091 cumulative vs 2,308 window → absorption 2.35→0.04). 288 tests green.

Verification = prod compute_market_metrics(Автовокзал) post-deploy. Refs #949
2026-06-04 10:46:50 +05:00
..
test_best_layouts.py fix(sf-09): capacity-aware redistribute (round 2) — bounded + correct invariant 2026-05-17 15:30:50 +03:00
test_competitor_relevance.py feat(site-finder): per-competitor relevance_weight (#949 PR B) (#1000) 2026-06-02 19:45:38 +00:00
test_future_supply.py feat(site_finder): future-supply-pressure index (#950 Step 6) (#1006) 2026-06-03 05:10:08 +00:00
test_macro.py feat(site-finder): macro_indicator table + backfill + reader (#945 PR A) (#963) 2026-06-02 18:41:28 +00:00
test_market_metrics.py fix(market-metrics): count window sales by contract_date, not 17-day history (#949 CRITICAL) 2026-06-04 10:46:50 +05:00
test_supply_layers.py fix(supply-layers): thread dev_group_name into L3 upsert key (#970 CRITICAL) 2026-06-04 10:06:30 +05:00