[tradein][db][tech-debt] Унификация кадастровой колонки kadastr_num → cadastral_number #732
Closed
opened 2026-05-30 14:25:57 +00:00 by lekss361
·
8 comments
No Branch/Tag specified
main
fix/2013-avito-cohort-null
fix/rbac-test-user2-expired
fix/expire-brusnika-trial-access
feat/tradein-domclick-house-sku-schema
chore/design-sync-tradein
fix/tradein-deploy-scraper-paths-filter
fix/tradein-no-numberless-house-insert
fix/tradein-dedup-fias-pass-no-geoguard
feat/tradein-fias-estimate-frontend
fix/tradein-dedup-by-fias
feat/tradein-fias-tier-matching
fix/tradein-v2-uiux-p1
fix/objective-lots-dedup-1964
fix/audit-followups-1953
feat/concept-house-picker-1965-stage3b
feat/concept-house-catalog-1965-stage3a
feat/concept-live-massing-1965-stage2b
feat/concept-recompute-1965-stage2a
feat/concept-section-1965-stage1
fix/best-layouts-per-object-snapshot-1956
fix/deficit-segmentation-1959
feat/tradein-hedonic-ground-floor
fix/report-map-points-1961
fix/report-microcopy-1963
fix/report-nspd-zoning-1962
fix/report-frontend-display-1953
perf/tradein-estimate-audit
perf/best-layouts-objects-first
fix/171-migration-path
perf/171-objective-crm-report-month-idx
fix/1926-app-log-stdout
fix/estimator-tiebreaker-nanalogs
fix/1917-fetch-json-network-retry
fix/1926-scrape-runs-total-seen
fix/1781-house-fk-source-identity
feat/39-osrm-per-category
feat/1746-utility-infra-map
fix/test-849-savepoint-count
fix/parking-economics-by-class
fix/zouit-engineering-area-gate
fix/zoning-resolution-decouple
feat/dcf-velocity-schedule
feat/zone-regulation-backfill
chore/mock-financial-estimate
fix/finmodel-split-disclosure-threshold
feat/finmodel-financing
feat/finmodel-sitefinder-bridge
feat/finmodel-dcf
feat/finmodel-price-calibration
feat/finmodel-cost-cascade
audit/1871-p2-estimator-dedup-split
audit/1871-p2-avito-coord
audit/1871-p3-uiux
audit/1871-p2-invest-moi
audit/1871-p2-velocity-market
audit/1871-p1-3-isreal-stubs
audit/1871-p1-2-ghost-anchor-guard
audit/1871-p1-scenarios-collapse
revert/site-finder-v2
fix/v2-remove-resource-legend
fix/v2-map-legend-position
feat/site-finder-v2-map-light-polish
rollback/site-finder-home-light
feat/site-finder-v2-cockpit
rollback/sf-old-analysis-design
feat/ptica-tabs-6-6-reports-params
fix/ptica-vri-row
feat/ptica-map-glyphs-sitefinder-dark
fix/ptica-3d-preview-product-verdict
fix/ptica-button-fontsize
fix/ptica-parity-data-mapping
chore/ptica-iso-preview-spin
fix/ptica-inter-map-product
fix/ptica-visual-parity
fix/ptica-left-rail
feat/ptica-cockpit-complete-bottom
feat/ptica-default-and-rich-map
feat/ptica-real-ksit-frontend
feat/tradein-ekb-geoportal-buildings
fix/sf-feedback-batch
feat/avito-newbuilding-sweep
feat/browser-concurrent-pool
fix/backfill-kadastr-column
fix/avito-proactive-ip-rotate
feat/activate-domclick-sweep
feat/avito-newbuilding-capture
fix/house-id-fk-realtime-link
fix/migration-162-table-if-exists
feat/riasurt-sverdl-layers-108
fix/sber-dataset-paths-902
fix/conflict-resolution-freshness-1539
feat/objective-lots-history-writer-307-obj6
feat/velocity-mv-61
fix/objective-mapping-is-reviewed-gate-307-obj2
fix/cian-detail-rich-fields
fix/avito-novostroyki-segment
feat/yandex-novostroyki-newflat
fix/ci-dedup-runner-storm-1709
fix/emiss-pk-granularity-1687
feat/listings-segment-param-1188
fix/inn-regex-word-boundary-1682
fix/excel-deficit-horizon-1590
fix/admin-scrape-validation
fix/admin-leads-interval-cast-1694
fix/dkp-corridor-doc-p10p90-1695
fix/weather-wind-d-allnone
test/residential-zone-rawprops-1681
fix/domrf-badge-regex-narrow-1686
feat/yandex-camoufox-transport
fix/score-sat-factor-1509
fix/base-pace-room-bucket-1593
fix/gate-verdict-no-blocker-1617
fix/confidence-deal-count-window-1637
fix/match-economics-1511-1512
fix/listings-partial-indexes-1398
fix/smart-suggestions-threshold-1503
fix/dkp-corridor-percentile-1520
fix/enrich-economics-window-1513
fix/leads-stats-window-1383
fix/poi-score-scale-1486
fix/geo-weight-floor-1633
fix/inn-regex-context-1640
fix/domrf-status-classify-1609
fix/emiss-period-dedup-1606
fix/cian-paginate-tail-1393
fix/normalize-zero-fill-guard-1638
fix/supply-view-devgroup-key-1650
fix/residential-zone-detect-1353
fix/score-label-threshold-1357
fix/trend-ratio-vprior-zero-1508
fix/district-median-dedup-1352
fix/supply-layers-overlap-1355
fix/pdf-expires-at-1530
fix/quartirography-area-bucket-1406
fix/cad-zones-multipolygon-1344
fix/sold-pct-market-verdict-1407
fix/week-review-finish
fix/week-review-backend-v2
feat/plan-vectorization-spike-299
fix/1668-analyze-confidence
fix/1667-metro-block
fix/1666-layout-velocity-beat
chore/remove-n1-scraper
fix/cian-kitchen-area
feat/yandex-detail-backfill
feat/avito-detail-backfill
fix/best-layouts-bucket-normalization
fix/gknspecial-incremental-commit-per-prefix
fix/okn-objects-full-registry-load
fix/parcel-ird-overlap-except-expand
fix/report-assembler-confounded-keys
fix/job-settings-json-persist-v2
fix/nspd-geo-soft-time-limit-passthrough
fix/nspd-soft-time-limit-v2
fix/pilot-request-modal-validation
fix/recommend-mix-saturation-latest-snapshot
fix/scrape-cadastre-fail-counter-v2
fix/izyatie-ocr-cad-normalize
fix/job-settings-panel-json-state-persist
fix/noise-loader-savepoint-per-row
fix/objective-sync-config-bare-except
fix/parcel-snapshot-mdash-double-escape
fix/poi-loader-leap-year-date-replace
fix/scrape-cadastre-permanent-fail-counter
fix/usermenu-analyst-role-label
feat/location-948b-r
feat/location-entity-948b
feat/insight-entity-948a
feat/analyst-role-audit-962
feat/cbr-inflation-macro-946
feat/cian-zhk-resolve-972
perf/forecast-parallel-horizons-1129
feat/newbuilding-enrich-backfill-972
feat/emiss-macro-indicators-946
feat/rosstat-emiss-macro-946
ci/frontend-vitest-job
chore/frontend-vitest-wkt-tests
feat/forecast-meta-footer
feat/forecast-future-supply-competitors
feat/forecast-docx-pptx-buttons
feat/forecast-scoring-panel
feat/forecast-product-tz-block
feat/market-map-layers-999
feat/forecast-chart-section6
feat/forecast-export-pptx-959
feat/forecast-export-docx-959
feat/forecast-export-ui-959
feat/forecast-export-telegram-959
feat/forecast-export-md-959
feat/analyze-response-contract-961
feat/competitor-velocity-spatial-fallback-968
fix/frontend-healthcheck-hostname
feat/analyze-market-coords-999
fix/site-finder-entry-crash-1001
feat/horizon-selector-996
feat/forecast-section-998
feat/forecast-endpoint-horizon-enqueue
feat/forecast-celery-task-persist
feat/forecast-orchestrator-service
feat/demand-supply-months-of-inventory
feat/wire-district-resolver
feat/district-vocab-reconciliation
fix/affordability-market-spread
fix/backtest-sig-gate
feat/wire-978-almon-rate-regime
feat/backtest-oos-almon-seasonal
ci/forgejo-pytest-gate
fix/tradein-praktika-logo-form-scroll
feat/yandex-exhaustive-price-room
feat/794-sber-time-adjust
chore/bot-harness-tuning
docs/agent-usage-throttle-qa-terminal
fix/avito-sweep-single-run-guard
chore/analyst-inbound-queue-tradein-db
feat/801-preview-full-wt
chore/bot-safety-followups
feat/tradein-avito-imv-fix
feat/tradein-repair-coef-calibration
feat/tradein-avito-houses-fix
feat/tradein-address-precision
feat/tradein-backfill-prioritize-listings
feat/tradein-geocode-deals-nominatim
feat/tradein-geocode-deals-from-houses
feat/tradein-same-building-match
feat/claude-envvars-and-stale-cron
No results found.
Labels
Clear labels
Admin UI / internal tools / pipeline tracker
Аналитика данных / matching
Authentication / authorization / multi-tenancy
Автоматизация / cron / scheduler
Something isn't working
Коммерческая воронка / пилоты / pipeline / реестр ПО
Operational housekeeping
Forgejo Actions / build pipeline
152-ФЗ / реестр ПО / legal / TOS
Data sources, parsers, ETL
Уникальные данные — sales tracker, CRM aggregation
README / runbooks / onboarding
This issue or pull request already exists
Developer experience / build speed
New feature or request
Находки полного мульти-агентного ревью (Claude Fable 5, 2026-06-09)
Feedback from Max (Senior partner)
Generative Design — concept generation engine
Новое ТЗ от Ген Геныча (июнь 2026): Site Finder v2 — ИИ-прогноз продуктовой стратегии девелопера. Актуальный приоритет.
Pending team sync / decision
Human review/decision required
Monitoring / metrics / logs / Sentry / Uptime
Kill-switch — all autonomous bots pause
Latency / throughput / DB query tuning
Critical / production-blocker
High priority
Normal priority
Низкий приоритет (follow-up, tech-debt)
Backend Python — FastAPI, Celery, scrapers
DB migrations, indexes, SQL
docker-compose, Caddy, workflows
Frontend — Next.js, React, TypeScript
Tests, smoke, Playwright
Скрапперы (Avito/Cian/Yandex/Rosreestr)
Security audit / secrets / vulnerabilities
Site Finder scoring quality & data layer
Stage 1: Generative MVP (нед 2-7)
Stage 2: Site Finder MVP (нед 8-12)
Blocked — needs human intervention
Closed, completed
Raw/fuzzy task filed by human — auto-analyst подхватывает: code-archeology + декомпозиция в actionable scope/* + status/ready (или split на под-issues)
Reviewer/QA вернул worker на доработку — worker сам чинит свой PR (fixup), НЕ требует human (в отличие от status/blocked)
PR merged, awaiting smoke test
Ready for pickup by worker bot
PR open, awaiting code review
Work in progress (worker claimed)
Технический долг
Trade-In MVP проект
User experience / responsive / conversion
Week review 1 — находки multi-agent аудита проекта (2026-06-14)
This will not be worked on
Trade-In Estimator — проект оценки вторичного жилья
Исходно-разрешительная документация — слой ограничений участка для analyze-таблицы
admin
Admin UI / internal tools / pipeline tracker
analytics
Аналитика данных / matching
auth
Authentication / authorization / multi-tenancy
automation
Автоматизация / cron / scheduler
bug
Something isn't working
business
Коммерческая воронка / пилоты / pipeline / реестр ПО
chore
Operational housekeeping
ci
Forgejo Actions / build pipeline
compliance
152-ФЗ / реестр ПО / legal / TOS
data
Data sources, parsers, ETL
data-moat
Уникальные данные — sales tracker, CRM aggregation
docs
README / runbooks / onboarding
duplicate
This issue or pull request already exists
dx
Developer experience / build speed
enhancement
New feature or request
Fable 5 ревью
Находки полного мульти-агентного ревью (Claude Fable 5, 2026-06-09)
feedback/max
Feedback from Max (Senior partner)
generative
Generative Design — concept generation engine
GG-форсайт
Новое ТЗ от Ген Геныча (июнь 2026): Site Finder v2 — ИИ-прогноз продуктовой стратегии девелопера. Актуальный приоритет.
needs-discussion
Pending team sync / decision
needs-human
Human review/decision required
observability
Monitoring / metrics / logs / Sentry / Uptime
pause-bots
Kill-switch — all autonomous bots pause
performance
Latency / throughput / DB query tuning
priority/p0
Critical / production-blocker
priority/p1
High priority
priority/p2
Normal priority
priority/p3
Низкий приоритет (follow-up, tech-debt)
scope/backend
Backend Python — FastAPI, Celery, scrapers
scope/db
DB migrations, indexes, SQL
scope/devops
docker-compose, Caddy, workflows
scope/frontend
Frontend — Next.js, React, TypeScript
scope/qa
Tests, smoke, Playwright
scrapers
Скрапперы (Avito/Cian/Yandex/Rosreestr)
security
Security audit / secrets / vulnerabilities
site-finder
Site Finder scoring quality & data layer
stage/1
Stage 1: Generative MVP (нед 2-7)
stage/2
Stage 2: Site Finder MVP (нед 8-12)
status/blocked
Blocked — needs human intervention
status/done
Closed, completed
status/needs-analysis
Raw/fuzzy task filed by human — auto-analyst подхватывает: code-archeology + декомпозиция в actionable scope/* + status/ready (или split на под-issues)
status/needs-fix
Reviewer/QA вернул worker на доработку — worker сам чинит свой PR (fixup), НЕ требует human (в отличие от status/blocked)
status/qa
PR merged, awaiting smoke test
status/ready
Ready for pickup by worker bot
status/review
PR open, awaiting code review
status/wip
Work in progress (worker claimed)
tech-debt
Технический долг
tradein
Trade-In MVP проект
ux
User experience / responsive / conversion
week ревью 1
Week review 1 — находки multi-agent аудита проекта (2026-06-14)
wontfix
This will not be worked on
вторичка
Trade-In Estimator — проект оценки вторичного жилья
ИРД
Исходно-разрешительная документация — слой ограничений участка для analyze-таблицы
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
вторичка
ИРД
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
3 participants
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#732
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Находка (live tradein-БД 2026-05-31)
deals.kadastr_numhouse_metadata.kadastr_numhouse_metadata_kadastr_num_keylistings.kadastr_numlistings_kadastr_idxlistings.cadastral_numberlistings.building_cadastral_numberhouses.cadastral_numberКадастр в tradein фактически мёртв (0% во всех источниках — Cian/Avito/ДКП его не отдают; гео идёт из
cad_buildings, ADRDecision_Dkp_Listing_Linkage_Impossible). Это naming-consistency, НЕ функц.баг.View-зависимости (КРИТИЧНО — иначе ALTER/DROP упадёт)
kadastr_numссылается из (проверено pg_depend):listings_search_mv(MATERIALIZED VIEW) →listings.kadastr_numv_data_quality(VIEW) →listings.kadastr_num+cadastral_numberПеред ALTER/DROP — сохранить их DDL,
DROP MATERIALIZED VIEW listings_search_mv+DROP VIEW v_data_quality, затем пересоздать сcadastral_number.Задача → миграция
tradein-mvp/backend/data/sql/090_cadastral_unify.sql(идемпотентна,IF EXISTS-guard'ы)DROP MATERIALIZED VIEW IF EXISTS listings_search_mv; DROP VIEW IF EXISTS v_data_quality;ALTER TABLE deals RENAME COLUMN kadastr_num TO cadastral_number;ALTER TABLE house_metadata RENAME COLUMN kadastr_num TO cadastral_number;listings:DROP INDEX IF EXISTS listings_kadastr_idx; ALTER TABLE listings DROP COLUMN IF EXISTS kadastr_num;(cadastral_number остаётся; данных 0 → copy не нужен)v_data_quality+listings_search_mv(kadastr_num→cadastral_number в их определении);REFRESH MATERIALIZED VIEW listings_search_mv;Код — заменить SQL-строки на новое имя (это DB-колонка;
Lot-dataclass field — отдельная сущность):tradein-mvp/backend/app/services/search_query.py:87(WHERE kadastr_num IS NOT NULL) +:114("kadastr_num, scraped_at, "в SELECT) — listings →cadastral_numbertradein-mvp/backend/app/services/estimator.py:3069(SELECTkadastr_num) +:3293(row.get("kadastr_num")) — определить таблицу (deals/listings) и переименовать ключtradein-mvp/backend/app/services/scrapers/base.py:252(INSERT-список колонок listings) —kadastr_num→cadastral_numberbase.py:84(Lot.kadastr_numdataclass field),base.py:320/465,cian.py:499(конструктор Lot),conflict_resolution.py:95, комментарии. Переименование Lot-поля — опц. follow-up, в этот scope не входит (не ломать маппинг scraper→DB).Definition of Done (бинарно)
090_cadastral_unify.sqlидемпотентна (повторный прогон без ошибок), применяется и на чистом initdb, и на существующей БД.information_schema.columnsнетkadastr_numни в deals/listings/house_metadata;cadastral_numberесть в deals + house_metadata + listings.SELECT 1 FROM v_data_quality LIMIT 1иSELECT 1 FROM listings_search_mv LIMIT 1— без ошибки (view пересозданы).grep kadastr_num tradein-mvp/backend/app/services/{search_query,estimator}.py(SQL-строки) = 0./estimatesmoke 200;uv run pytestзелёный;uv run ruff checkclean.⚠️ Apply на прод (ops-шаг)
data/sqlсмонтирован в/docker-entrypoint-initdb.d(выполняется только при пустом volume). На существующей прод-БД миграция авто НЕ применится — применить вручную (psql -f 090_cadastral_unify.sql) или через используемый deploy-apply механизм tradein. Воркер пишет+тестирует миграцию на свежем initdb; прод-apply = отдельный ops-шаг после merge.Refs: аудит
TradeinDb_Audit_May30(Часть 2 п.2 + Часть 3 п.2).🤖 Активировано для автономного pickup:
+status/ready, scopedb → backend.Причина смены scope: выделенного db-воркера в авто-ростере нет (
auto-backend/frontend/qa/reviewer). Миграции tradein живут вtradein-mvp/backend/data/sql/NN_*.sqlи их пишет auto-backend → он и подхватит.Для воркера: DDL — только через migration-файл
NN_*.sql(auto-apply на deploy), НЕ черезexecute_sqlна проде. Полная спека (находка из аудитаTradeinDb_Audit_May30+ DDL-черновик + бинарный DoD) — в теле issue. Скоуп — только tradein-БД (своя, не shared gendesign).🚧 Blast radius is much larger than the «только rename/unify, ≤5 строк» framing — flagging for a human scope/timing decision rather than rushing it pre-demo.
grep kadastr_num tradein-mvp= 37 refs across:core/config.py,schemas/search_response.py,schemas/trade_in.py,services/dadata.py,services/estimator.py(incl._fetch_dealsSELECT +_deal_to_analogtier logic),services/matching/conflict_resolution.py,services/scrapers/base.py(persist),services/scrapers/cian.py,services/search_query.py,scripts/backfill_listing_sources.py+ several tests.050_search_optimization.sqlhas an INDEXON listings(kadastr_num) WHERE kadastr_num IS NOT NULLand a VIEW (l.kadastr_num);046_views.sqlanother VIEW;002_core_tables.sqlthe DDL (3 tables incl. a UNIQUE).ScrapedLotalready carries BOTHkadastr_num(base.py:84) andcadastral_number(base.py:451cadastral_number=lot.cadastral_number or lot.kadastr_num). The DoD «grep kadastr_num = 0» implies renaming the Python field too, which ripples into cian scraper, conflict-resolution merge-rules, backfill, and ~6 tests — and first needs thekadastr_num/cadastral_numberfield duality resolved.Cost/benefit: the column is 0% filled / dead (per the issue), so this is purely cosmetic naming, but it's a prod-table column-rename with VIEW+INDEX deps the weekend of the Praktika demo — high-risk-of-a-missed-ref, zero demo value.
Recommendation: defer past the 2026-06-01 demo, and split when picked up: (1) DB migration via database-expert handling DROP INDEX/VIEW → rename → recreate (per sql.md VIEW-dependency rule), idempotent; (2) a coordinated code-rename PR that first collapses the
ScrapedLot.kadastr_num/cadastral_numberduality. Settingneeds-humanfor that scope/timing call; releasing the claim.🧭 Resolver: решение (Anton, 2026-05-30) — отложить до после демо 2026-06-01.
Категория B (приоритизация) → спросил пользователя. Выбрано: defer. Обоснование: p3 naming-консистентность, кадастр заполнен 0% (мёртв), не блокирует ничего; перед демо 06-01 backend-ресурс нужнее на #726 / #647 / #755.
Снимаю
needs-human. НЕ ставлюstatus/ready— issue уходит в бэклог (без pickup-статуса), вернуться после демо. Тело issue уже содержит готовый план (idempotent migration + code refs) — при реактивации просто+status/ready +scope/db.🔍 Рефайн аналитика → status/ready. Спек дополнен по live-схеме: добавлен house_metadata.kadastr_num (был пропущен), matview listings_search_mv + v_data_quality зависимости (ALTER упал бы), все колонки 0% → данные не мигрируем. Точные SQL-рефы в коде + migration 090. Apply на прод = ops-шаг (initdb-only mount).
⚠️ analyst sequencing: брать ПЕРВЫМ из пары #732/#731 (оба создают
090_*.sql+ правятlistings/v_data_quality). #731 ждёт merge этого PR, затем перенумеруется в091_. Этот issue не заблокирован — claimable сразу.⚠️ auto-backend: НЕ беру на demo-eve (demo 2026-06-01 15:00) + поправка к спеку.
Спек неверен про apply-механизм. Тело говорит «data/sql смонтирован init-only, на прод авто НЕ применится». Фактически
.forgejo/workflows/deploy-tradein.yml:206-260авто-применяет каждыйbackend/data/sql/*.sqlчерез_schema_migrations-трекинг на КАЖДОМ деплое (push в main с путямиtradein-mvp/**), strict —failed migration → exit 1.⇒ merge этой миграции → следующий деплой авто-выполнит на проде
DROP MATERIALIZED VIEW listings_search_mv+ recreate +DROP COLUMN kadastr_num+ rename. Любая ошибка в recreate-DDL MV →exit 1→ деплой падает / БД в half-migrated состоянии. На кануне демо это неприемлемый риск ради p3 naming-cleanup на 0%-заполненных мёртвых колонках.Рекомендация: держать до после демо (2026-06-01). Тогда возьму. Если нужно срочно — human/resolver применяет вручную под контролем, не через авто-pipeline.
Status actualize (06.06): влито в
mainчерез PR #891 (commit8df536c, kadastr_num → cadastral_number). Открытых PR нет.status/review→status/qa.Already-done (verified prod 2026-06-13). Унификация кадастровой колонки выполнена:
deals→ толькоcadastral_number(kadastr_num renamed)house_metadata→ толькоcadastral_number(renamed, включая пропущенный в исходном issue)listings→cadastral_number+building_cadastral_number(kadastr_num dropped)Аудит-карта May30 устарела (паттерн как #730/#769). Закрываю.