feat(forecasting): §9.x→§22 orchestrator (3a) + supply-side district resolution fix #1056
No reviewers
Labels
No labels
admin
analytics
auth
automation
bug
business
chore
ci
compliance
data
data-moat
docs
duplicate
dx
enhancement
Fable 5 ревью
feedback/max
generative
GG-форсайт
needs-discussion
needs-human
observability
pause-bots
performance
priority/p0
priority/p1
priority/p2
priority/p3
scope/backend
scope/db
scope/devops
scope/frontend
scope/qa
scrapers
security
site-finder
stage/1
stage/2
status/blocked
status/done
status/needs-analysis
status/needs-fix
status/qa
status/ready
status/review
status/wip
tech-debt
tradein
ux
week ревью 1
wontfix
вторичка
ИРД
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lekss361/gendesign#1056
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "feat/forecast-orchestrator-service"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What — Step 3a: §9.x→§22 orchestrator + a false-BUY bug it surfaced
Orchestrator (
forecasting/orchestrator.py, new):build_site_finder_report(db, *, analyze, cad_num, district, obj_class=None, horizons)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 PUREassemble_report→ §22SiteFinderReport. Default segment = modal competitor class; each §9.x call_safe_call-wrapped (graceful). Standalone — no endpoint/Celery/persistence (that's 3b).Bug surfaced by prod ground-truth + fixed (
future_supply.py):compute_future_supply_pressureread the mixed-vocab persisted viewv_supply_layers_latestby a SCALAR admindistrict_name, missing all Layer-1 MICRO-keyed rows → admin parcel Кировский got supply=0 → false +1.0 deficit → "Строить: недонасыщен" (FALSE BUY) despite ~45k competing units. Fix: resolve admin→micros, filterdistrict_name = ANY(CAST(:names AS text[]))where names = micros (L1) + admin (L2/L3), with:has_districtEKB-wide guard. Extends PR #1054's resolver to the persisted-view path it missed; future_supply is the ONLY such consumer on the forecast path (verified).Prod ground-truth (parcel 66:41:0702048:27 / Кировский)
§22 assembles, no crash, segment=Комфорт (modal), confidence low (honest). Container restored to deployed code after the test.
Quality
ANY(CAST(:names AS text[]))), only view consumer, orchestrator's 8 §9.x kwargs all correct (signature-trap tests assert wrong-kwarg-absent), graceful + modal-class genuine. 80 module tests pass; ruff clean.This is the measure-first discipline working: the orchestrator ground-truth caught a false-BUY signal before any endpoint wiring (3b). Refs #961 #969.