gendesign/backend/tests/services/site_finder
Light1YT a0e61a38b4
All checks were successful
Deploy / changes (push) Successful in 5s
Deploy / build-frontend (push) Has been skipped
Deploy / build-backend (push) Successful in 1m37s
Deploy / build-worker (push) Successful in 2m25s
Deploy / deploy (push) Successful in 1m7s
feat(forecasting): §9.x→§22 orchestrator + fix supply-side district resolution (3a)
Add build_site_finder_report (orchestrator.py): computes the §9.x layers (market
metrics, supply layers, future-supply pressure, demand/supply forecast, scenarios,
score card, special indices, recommendation overlay) with their heterogeneous
signatures and feeds the PURE assemble_report → §22 SiteFinderReport. Default segment
= modal competitor class; each §9.x call _safe_call-wrapped (graceful). Standalone —
no endpoint/Celery/persistence (that is 3b).

Prod ground-truth of the orchestrator surfaced a false-BUY bug: future_supply
(compute_future_supply_pressure) read the mixed-vocab persisted view
v_supply_layers_latest by a SCALAR admin district_name, missing all Layer-1
micro-keyed rows → admin parcel (Кировский) got supply=0 → false +1.0 deficit →
'Строить: недонасыщен' headline despite ~45k competing units. Fix: resolve
admin→micros, filter district_name = ANY(CAST(:names AS text[])) where names =
micros (L1) + admin (L2/L3), with :has_district EKB-wide guard (extends PR #1054's
resolver to the persisted-view path it missed). future_supply is the only
v_supply_layers_latest consumer on the forecast path (verified).

Prod after: Кировский supply 0→~42953, deficit +1.0→−1.0 (honest oversupply),
MOI 0→116.6, false-BUY headline gone, overall 0.734→0.42. 80 module tests pass
(signature-trap + resolver-regression guards genuine); ruff clean. Refs #961 #969.
2026-06-05 08:21:04 +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_district_resolver.py feat(forecast): resolve admin district -> micro set in §9.x market/supply/sales filters 2026-06-05 07:03:37 +05:00
test_future_supply.py feat(forecasting): §9.x→§22 orchestrator + fix supply-side district resolution (3a) 2026-06-05 08:21:04 +05:00
test_macro.py fix(#945): indicator-aware default region in macro reader + document debt data-quality 2026-06-04 11:49:41 +05:00
test_market_metrics.py feat(forecast): resolve admin district -> micro set in §9.x market/supply/sales filters 2026-06-05 07:03:37 +05:00
test_supply_layers.py feat(forecast): resolve admin district -> micro set in §9.x market/supply/sales filters 2026-06-05 07:03:37 +05:00