Review-bot findings:
- CRITICAL: expected_sold_* were derived from PRE-blend median/range/ppm2, so
after the #651 blend raised median_price the UI showed asking (blended) vs
expected-sold (un-blended) → nonsensical discount. Moved the asking→sold
derivation to AFTER the blend block; INSERT + returned estimate now use the
post-blend values.
- IMV anchor had no rooms/area band → a studio-only IMV row could anchor a
3-room target and inflate via the x1.15 trigger. Added NULL-tolerant guard
(abs(Δrooms)<=1 AND area_m2 BETWEEN area*0.7..1.3) in _fetch_house_imv_anchor.
- Tests: expected_sold↔blended-median consistency, band rejection, weight clamp
[0,1], corridor count branch. ruff clean; 26 + 145 estimator regression pass.
Frontend surfacing in the DEPLOYED trade-in UI (tradein-mvp/frontend):
- types/trade-in.ts: add AvitoImvSummary + DkpCorridor, optional avito_imv /
dkp_corridor on AggregatedEstimate (mirror backend snake_case, no any)
- HeroSummary.tsx: 'Avito IMV: X млн ₽' caption near price + 'Коридор реальных
сделок: X–Y млн · N ДКП (Росреестр)' line. No new fetch, no-op when null.
tsc --noEmit clean. Root legacy frontend/ untouched.
Two safety follow-ups к autonomous-pipeline (flagged в multiagent-аудите):
- Self-extending guard расширен: reviewer-bot NEVER merge'ит PR, меняющий
_autonomous_pickup.md (claim/kill-switch/merge-FSM contract) или любой
work-as-*.md (persona activation) — раньше защищались только git-pr.md
Auto-merge policy + CLAUDE.md + auto-code-reviewer.md. Закрывает дыру, где
bot мог изменить claim/kill-switch logic без human. Правки в git-pr.md,
auto-code-reviewer.md, work-as-reviewer.md.
- cleanup-stale-claims.sh: pause-bots early-exit. Без него cron освобождал
wip-claim worker'а, приостановленного mid-work (он держит claim до un-pause
per _autonomous_pickup.md), теряя его работу.
Fix structural causes of autonomous-window underperformance vs single-window
orchestration — persona prompts were thin pointers that deferred conventions
to unread files and dead-ended every imperfect PR into human review.
- Inline-load conventions: каждый work-тик MANDATORY-читает полный
backend/frontend-engineer.md + rules (был optional pointer, который cost-rule
отучал читать). Cost-saving "не строй контекст" сужен до idle-тиков явно.
- Auto-fix loop: reviewer FIX -> status/needs-fix (assignee остаётся worker),
worker сам подхватывает свой PR и пушит fixup в ту же ветку. blocked+needs-human
зарезервирован под BLOCK (security/data-loss) или 3x fix-fail (+ fix-attempt cap).
QA feature_regression -> needs-fix аналогично. FSM-таблица обновлена.
- Fat issue template: auto-analyst делает mandatory code archeology (Grep/Read)
и пишет Files/сигнатуры/Acceptance/Risk (формат tech-analyst) — issue это
единственный канал к worker'у.
- Model resolution doc: model: frontmatter мёртв в standalone /loop-окне
(модель = модель окна); reviewer-окно запускать в Opus 4.8 осознанно.
- Drift fix: stale-claim cleanup помечен implemented (cron stale-claims.yml в
проде, #610-612); отмечен gap pause-bots vs cleanup.
Новый label status/needs-fix создать в Forgejo до первого запуска auto-fix loop.
Add warm-up GET /evaluation/realty + production browser header set (Sec-Fetch,
X-Requested-With, 25s timeout) mirroring avito.py, чтобы защитить 3-step IMV flow
от server-IP анти-бот 403. Refactor step B/C парсинга в pure helpers
(_parse_geo_position/_parse_price/_parse_placement_history/_parse_suggestions)
+ fixture-driven offline тесты из живых JSON-captures.
Честный диагноз: контракт (geoFieldsHash, price-блок, categoryId=24) НЕ менялся —
проверено живым capture'ом с этой машины (A→B→C, recommended 7.39M). Реальная
причина #565 — скорее анти-бот по PROD-IP, не код → если #565 останется после
deploy, настоящий фикс = ротация egress IP воркера (devops, отдельно).
code-reviewer: ✅ APPROVE no critical — warm-up non-fatal, injected-session path
unchanged, refactor preserves shapes, graceful-None сохранён, fixtures без PII.
Tests: 12 new (27 total). Ruff clean.
Closes#565
Avito switched the houses-catalog state blob from JSON.parse("<js-escaped>")
to a URL-encoded string literal, wrapped the 10 widgets in
placeholders[0].widgets, и re-nested developmentData под props.housePage.
JS-unescape path silently failed → houses rows перестали наполняться
(starve'ит #6 same-building + #569 deal centroids).
Extract decode в pure _extract_preloaded_state (urllib.parse.unquote,
JSON.parse fallback для старой формы), add _flatten_widgets, и сделать
_parse_house_page tolerant к обеим developmentData/ratingPreview формам.
Real-HTML fixture (Yumasheva-6 EKB) + 4 regression-теста.
code-reviewer: ✅ APPROVE no critical (regex anchoring verified, decode
safe — no eval/unicode_escape, backward-compat реальный, delisted-house
envelope degrade'ит gracefully, fixture без PII/secrets). Tests: 22 passed.
Closes#566
ORDER BY has_active_listings DESC, id во всех priority-бакетах + новый
--priority listings (focused sweep: NULL cadnum + есть active listing).
Дневной 100/day budget сначала закрывает дома, которые реально появляются
в оценках → estimator #6 cadastr_exact same-building матчинг загорается на
real estimate targets за дни, а не недели.
Correlated EXISTS бьёт по partial-индексу listings_house_id_fk_idx.
Write-path / EKB-guard / SAVEPOINT / qc_geo rules не тронуты.
code-reviewer: ✅ APPROVE no critical. Tests: 40 passed. Ruff clean.
Добавляет scripts/geocode_deals_nominatim.py для ~14% сделок всё ещё
lat IS NULL после house-centroid прохода (Step 2) — улицы без геокодированных
домов, которые centroid-join не покрывает. Переиспользует geocoder.geocode
(cache → Cadastral FDW → Yandex → Nominatim), дедупит по адресу (distinct
улицы определяют число вызовов, не 7k строк), и стампит geocode_tried_at на
КАЖДОЙ попытке (успех И чистый промах) чтобы un-geocodable строки не крутились
по 1 req/s. Resume: lat IS NULL + 30-day staleness, per-address SAVEPOINT,
--limit/--dry-run/--batch/--stale-days.
Pre-push review (code-reviewer): ✅ APPROVE, no critical — проверены SQL-safety,
no-infinite-reloop (mark-tried на miss, no-stamp на raised exc), window-cap,
geom-not-manual, dedup, async. Tests: 17 passed. Ruff clean.