fix(market-metrics): window sales by contract_date (#949 CRITICAL) #1036

Merged
bot-backend merged 1 commit from fix/949-absorption-contract-date into main 2026-06-04 05:46:57 +00:00
Collaborator

REOPENED CRITICAL #949 — absorption ~14x overcount.

_SALES_WINDOW_SQL counted window-sales from objective_lots_history, but history is only ~17 days deep (3 snapshots) -> every currently-sold lot had a sold-snapshot in the window -> window-sales = entire cumulative sold stock. Ground-truth (Автовокзал 6mo): buggy 33,245 vs real 2,308; absorption ~235%/mo with confidence=high; fed forecast #950/#952.

Fix: count window-sales from objective_lots.contract_date in window (real sale date, present on 100% of sold lots: 41,091/41,091). Return contract unchanged; downstream formulas untouched; dead history CTE removed. Regression test (41,091 cumulative vs 2,308 window -> absorption 2.35->0.04). 288 tests green.

Verification = prod compute_market_metrics(Автовокзал) post-deploy. Refs #949

REOPENED CRITICAL #949 — absorption ~14x overcount. _SALES_WINDOW_SQL counted window-sales from objective_lots_history, but history is only ~17 days deep (3 snapshots) -> every currently-sold lot had a sold-snapshot in the window -> window-sales = entire cumulative sold stock. Ground-truth (Автовокзал 6mo): buggy 33,245 vs real 2,308; absorption ~235%/mo with confidence=high; fed forecast #950/#952. Fix: count window-sales from objective_lots.contract_date in window (real sale date, present on 100% of sold lots: 41,091/41,091). Return contract unchanged; downstream formulas untouched; dead history CTE removed. Regression test (41,091 cumulative vs 2,308 window -> absorption 2.35->0.04). 288 tests green. Verification = prod compute_market_metrics(Автовокзал) post-deploy. Refs #949
bot-backend added 1 commit 2026-06-04 05:46:53 +00:00
fix(market-metrics): count window sales by contract_date, not 17-day history (#949 CRITICAL)
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
2b3759af6a
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
bot-backend merged commit 2b3759af6a into main 2026-06-04 05:46:57 +00:00
bot-backend deleted branch fix/949-absorption-contract-date 2026-06-04 05:46:57 +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#1036
No description provided.