gendesign/backend/app
lekss361 b08597ba61 fix(parcels): SAVEPOINT around velocity compute → не abort outer tx
Production POST /parcels/{cad}/analyze падает с 500:
  sqlalchemy.exc.InternalError: (psycopg.errors.InFailedSqlTransaction)
  current transaction is aborted, commands ignored until end of transaction block

## Root cause

`compute_velocity()` SQL fails (probably на cad's без conkurrentов / sparse
sale_graph data) → exception caught в try/except → НО db.rollback() отсутствует
→ transaction остаётся в aborted state.

Следующая query (_geotech_risk на line 828) пытается выполниться → крашится
с InFailedSqlTransaction.

## Fix

Wrap velocity в `with db.begin_nested()` — SAVEPOINT pattern (consistent
with PR #124 pzz_loader fix). Failure внутри savepoint:
- Rollbacks ТОЛЬКО savepoint
- Outer transaction остаётся clean
- Subsequent queries (_geotech_risk и пр.) работают

Pattern matches feedback_subagent_delegation audit recommendation для
in-loop / per-section exception handling.

## Impact

POST /parcels/{cad}/analyze больше не 500 при velocity failure. Возвращает
`velocity: null` + остальные fields normal.

Refs: user report 2026-05-15 InFailedSqlTransaction
2026-05-15 08:26:40 +03:00
..
api fix(parcels): SAVEPOINT around velocity compute → не abort outer tx 2026-05-15 08:26:40 +03:00
core refactor(admin): extract _check_token into shared AdminTokenAuth dep (#133) 2026-05-14 23:45:44 +03:00
models feat(jobs): centralized job_settings API + DB-driven beat schedule 2026-05-11 15:38:13 +03:00
schemas feat(analytics): recommend_mix v3.1-v3.4 - noise + 2D competitors + 24m cap + success-driven 2026-05-11 22:19:41 +03:00
services fix(site-finder): SQLAlchemy syntax error :weights::jsonb → CAST(:weights AS jsonb) (#152) 2026-05-15 08:12:18 +03:00
workers refactor(workers): split celery_app.py god-object into 3 modules (#135) 2026-05-15 00:09:38 +03:00
__init__.py init 2026-04-25 13:45:19 +03:00
main.py feat(site-finder): weight profiles endpoints + analyze integration (#114 sub-PR 3/4) (#138) 2026-05-15 00:40:06 +03:00