feat(concept): каталог типовых домов + program-placement (#1965 Stage 3a) #2029
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#2029
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "feat/concept-house-catalog-1965-stage3a"
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?
#1965 Stage 3a (эпик #1953) — backend для выбора типов домов вместо max-FAR-застройки. deep-code-reviewer ✅ APPROVE (рефактор подтверждён эквивалентным построчно). Аддитивно, backward-compatible.
Что
catalog.py(NEW):HOUSE_TYPES— 5 типовых RU-секций (панель-эконом 24×15/9эт, монолит-комфорт 21×18/14, башня-бизнес 18×18/25, малоэтажка 30×14/3, таунхаус 12×10/3), footprint+этажи+класс. Документирован как sane-default (промоут в БД позже).get_house_type/available_section_types.BuildingProgramItem {section_type, floors 1-40, count 1-50}+ConceptInput.building_program: list | None = None(аддитивно; None → существующий greedy, byte-identical)._Placer(вынесен общий движок collision/STRtree/setback — greedy и program используют его; greedy семантически НЕ изменён) +place_program(раскладывает ровноcountсекций каждого типа) +place_program_variant(агрегирует ТЭП per-floor-group: GFA=Σ area×floors, квартиры=Σ floor(resid/avg), парковка пересчитана).building_programset → один program-вариант; иначе 3 greedy-стратегии без изменений.placed_count/requested_count(не 422); zero-fit → 422 (не врём). Unknown section_type → 422 до placement.Качество
test_greedy_output_matches_golden_pin— замороженные литералы greedy-вывода (features/built_area/apartments per strategy) → любой будущий дрейф placement упадёт (закрыл MEDIUM из ревью).:name::type; 158 passed. Blast-radius (dxf/pdf-экспортёры, /recompute, фронт) — не задет (ревью подтвердило).Stage 3b (следующий, финал #1965): frontend picker «выбери дом» (count/floors по типам) →
building_programв create_concept. Refs #1965.Extend the concept generator so ConceptInput can carry an optional building_program (list of typed houses from a catalog). When present, placement lays out EXACTLY that program — for each item, place `count` sections of the catalog footprint at the item's floors — instead of the greedy max-FAR coverage-cap sweep. When absent, the existing greedy behavior is unchanged (byte-for-byte backward-compatible). - catalog.py: hardcoded HOUSE_TYPES (panel_econom, monolith_comfort, tower_business, lowrise_comfort, townhouse) — sane-default catalog, promote to DB later; get_house_type / available_section_types lookups. - schema: additive BuildingProgramItem {section_type, floors, count} and ConceptInput.building_program (default None -> greedy). ConceptVariant gains optional placed_count / requested_count (partial-fit signal). - placement: shared _Placer (collision/STRtree/setback machine extracted from greedy sweep, reused — no duplication); place_program + place_program_variant; branch in place_all_strategies on building_program. Mixed-floor TEAP via exact per-floor-group aggregation (GFA = sum(area_i * floors_i), no rounding drift). - partial fit: when the parcel can't fit all sections, place as many as fit and report placed_count < requested_count (no hard-422); zero-fit still raises ParcelGeometryError (-> 422). - API: validate program section_type keys against the catalog (unknown -> 422) before placement. - tests: catalog integrity, greedy backward-compat, exact 2-item program + TEAP reflection, over-packed partial placement, API program path. - regenerate frontend api-types.ts (OpenAPI codegen gate stays green).