Боевой оркестратор (scrape_pipeline.py) читал только статический
settings.scraper_proxy_url — ни один боевой скрейпер не использовал
proxy_pool/scrape_proxies (git grep "acquire(" = 0 хитов). Бан на общем
IP выносил avito+cian+yandex+domklik разом.
Подключён pool-aware proxy acquisition/rotation в 3 curl-режим Avito
entry points (run_avito_pipeline, run_avito_city_sweep,
run_avito_newbuilding_sweep), за флагом use_proxy_pool_curl (default
False — ship-dark, поведение не меняется пока явно не включат):
- _pool_proxy_dict(): health-filtered acquire() lease, fallback на
статический прокси при пустом пуле/ошибке/флаге off.
- _rotate_pool_proxy(): на бан — mark_health(ok=False) → acquire()
замены → ТОЛЬКО ПОСЛЕ release(current_lease). Порядок принципиален:
release ДО acquire() позволял пулу молча вернуть тот же только что
забаненный прокси (один бан не достигает MAX_CONSECUTIVE_FAILS=3,
leased_by IS NULL фильтр не исключал бы его) — найдено на pre-push
review, воспроизведено и закрыто регрессионным тестом с CURRENT id
ниже GOOD id (оригинальный тест проходил случайно из-за id tie-break).
- run_id прокинут в acquire() на обоих sweep call sites — scrape_proxies
.leased_by несёт реальный run id для диагностики, не NON_RUN_LEASE_MARKER.
Cian/Yandex/DomClick (browser-mode, отдельный сервис) и
run_avito_full_load (использует AvitoScraper напрямую, много вызывающих
кода за пределами scrape_pipeline) — вне скоупа, задокументировано как
follow-up в PR description.
Refs #2202
Group D of the scraper_kit migration epic (#2277). Both legacy modules had no
kit-side equivalent yet (per audit Scraper_Kit_Legacy_Dependency_Audit_0703),
unlike the other 24/26 files which were already strangler-duplicated.
- scraper_kit/providers/domclick/detail.py — Layer B detail-card enrichment
(parse_detail_html/fetch_detail/save_detail_enrichment), no ScraperConfig
injection needed (fetch_detail takes an already-open browser_fetcher).
- scraper_kit/providers/ekb_geoportal/{__init__,client}.py — new subpackage,
first non-listing-site provider in scraper_kit. Legacy module had zero
app.* coupling (only httpx), so the port is near-verbatim.
Parity proven via tests/support/parity.py (assert_parity) against the exact
legacy functions on realistic fixtures (live-card SSR JSON, GeoJSON
FeatureCollection).
Callers of both legacy modules are unchanged (out of scope — ekb_geoportal_ingest
switch is #2310; the only other domclick_detail caller is
scripts/ingest_domclick_jsonl.py, also untouched).
Code-reviewer follow-up on the parity harness (aaaf8179):
- parity.py: plain `==` in the scalar-equality branch let `True == 1` /
`False == 0` silently pass (Python bool is an int subclass). A future
migration bug turning a `bool | None` field into a raw 0/1 would slip
through undetected. Now any type mismatch where exactly one side is a
bool is reported as a diff, regardless of numeric equality.
- test_parity.py: unit test for the new bool-vs-int branch.
- test_avito_detail_kit_parity.py: the existing smoke test only proved the
harness reports "no diff" on two genuinely-identical real dataclass
instances — it never proved the harness catches a real divergence on
this same 30+-field shape (only the toy fixtures in test_parity.py did).
Added a test that mutates `price_rub` via dataclasses.replace() on the
real kit DetailEnrichment and asserts assert_parity raises
ParityMismatchError naming that field.
Stage 0 of the scraper_kit migration epic (#2277): shared test tool for
issues #2305-#2310, which each need to prove their kit-path importer
produces the same output as the legacy path on the same input.
- tests/support/parity.py: assert_parity()/compare_outputs() normalize
dataclass/pydantic outputs to dict/list/scalar before comparing, since
legacy vs kit dataclasses (e.g. DetailEnrichment) are different classes
and dataclass __eq__ always returns False across classes even when all
field values match. Supports ignore_fields (drop non-deterministic
fields like latency_ms/fetched_at) and numeric tolerance (math.isclose)
for float fields, with an assertion listing every differing field
(path + legacy value + kit value) on mismatch.
- tests/support/test_parity.py: unit tests for the harness itself
(identical outputs pass, differing outputs raise with informative
diff, tolerance/ignore_fields options, cross-class dataclass parity).
- tests/scrapers/test_avito_detail_kit_parity.py: end-to-end smoke proof
against real code — app.services.scrapers.avito_detail.parse_detail_html
(legacy, reached via admin.py's scrape_avito_detail debug endpoint
through fetch_detail) vs scraper_kit.providers.avito.detail's copy, on
a fixed HTML fixture.
- tests/support/README.md: usage note for #2305-#2310 migration PRs.
Found while implementing: tests/test_scraper_kit_*_parity.py (9 files,
~3400 lines) already do ad-hoc `dataclasses.asdict(old) == asdict(new)`
parity checks for the already-migrated SERP scraper modules (avito/cian/
domclick/yandex/base/scheduler/pipeline) — this harness generalizes that
repeated pattern for the remaining 12 non-scraper importers, adding
ignore_fields/tolerance which those ad-hoc checks don't have.
Финальный PR issue #2045 (BE-3): GET /api/v1/trade-in/location-coef для
LocationDrawer. FDW foreign table -> локальное зеркало osm_poi_ekb_local
(TRUNCATE+INSERT, тот же паттерн что cad_buildings_local/cadastral_geo_match,
избегает ~1.16s/row FDW round-trip) -> straight-line POI-скоринг, портированный
из Site Finder poi_score.py::compute_poi_weighted_top7 (CATEGORY_WEIGHTS as-is,
радиус 1200м для квартир вместо Ptica 2000м для участков). score->coef -
новая MVP-эвристика (0.95..1.05, не откалибрована на реальных дельтах).
Graceful fallback (не 500, не фабрикуем факторы): пустая/не отрефрешенная
osm_poi_ekb_local или отсутствие lat/lon у оценки -> coef=1.0, factors=[],
geo_source="unavailable".
Scheduler: source=osm_poi_ekb_refresh, daily, зарегистрирован и в боевом
dispatch (scheduler.py), и в kit-registry (product_handlers.py) - иначе
test_kit_registry_completeness падает на ship-dark инварианте (#2192).
Frontend wiring (mappers.ts/LocationDrawer.tsx) - вне scope, отдельная задача
после проверки endpoint'а curl'ом на деплое.
- listings.phones: миграция 166 обнуляет данные; cian.py + scraper-kit
serp.py (golden-parity зеркало) перестают читать offer.get("phones") на
входе — write-path выключен у источника, колонка/поле в модели остаются.
Мёртвая запись "phones" в LISTING_FIELD_PRIORITY убрана.
- trade_in_estimates.client_name/client_phone: миграция 167 дропает колонки;
синхронно убраны из TradeInEstimateInput, обоих INSERT в estimator.py
(основной путь + _empty_estimate), frontend TradeInEstimateInput и
CRM-блока EstimateForm (поля "Имя клиента"/"Телефон").
- sentry_scrub.py и management_companies.phones не тронуты — вне scope.
/me теперь отдаёт display_name/org/email (kopylov -> "Копылов", остальные None).
TopNav использует их вместо фабрикации username-as-name; org/email фолбэк
остаётся прежним для юзеров без известного профиля.
Audit of /trade-in/v2 found the FE-3/FE-4 overlay wiring (mapAnalytics/mapSources
feeding AnalyticsView/SourcesView from useEstimateHouseAnalytics,
useEstimateSellTimeSensitivity, analogs[]/actual_deals[]) already shipped in
267585e3. The remaining gap was BE-1 (#2043, merged 2026-07-02) landing real
cv/source_counts/created_at on AggregatedEstimate AFTER that wiring pass, so
v2/mappers.ts was still FE-approximating cv and duplicating a hardcoded source
label map instead of the single source-registry (#2211).
- mapSources' marketAds.kpi.cv (#2041) now prefers the real estimate.cv
(0..1 ratio from BE-1) and only falls back to the FE coefficient-of-variation
of analog prices for pre-#2043 cached estimates where cv is absent.
- adRows/dealRows source badges (#2041) now resolve via the shared
src/lib/source-registry sourceLabel() instead of a local SOURCE_LABEL map,
picking up etagi/canonical labels and staying in sync with the #2211 roster.
- AnalyticsView (#2040) KPIs/sell-time/price-history/scatterDetail were already
wired to real data with no gaps found against the issue spec.