fix(week-review): backend-аудит v2 — 82 фиксов #1660
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
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lekss361/gendesign#1660
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "fix/week-review-backend-v2"
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?
Фиксы 2-го аудита backend/app/** (label week ревью 1), после merge #1543.
Итог
Closes #1560
Closes #1561
Closes #1562
Closes #1563
Closes #1564
Closes #1565
Closes #1566
Closes #1567
Closes #1570
Closes #1571
Closes #1572
Closes #1573
Closes #1574
Closes #1576
Closes #1577
Closes #1578
Closes #1579
Closes #1580
Closes #1581
Closes #1582
Closes #1583
Closes #1584
Closes #1585
Closes #1586
Closes #1587
Closes #1588
Closes #1589
Closes #1591
Closes #1592
Closes #1594
Closes #1595
Closes #1596
Closes #1597
Closes #1598
Closes #1599
Closes #1600
Closes #1601
Closes #1602
Closes #1603
Closes #1604
Closes #1605
Closes #1607
Closes #1608
Closes #1610
Closes #1611
Closes #1612
Closes #1613
Closes #1614
Closes #1615
Closes #1616
Closes #1618
Closes #1619
Closes #1620
Closes #1621
Closes #1622
Closes #1623
Closes #1624
Closes #1625
Closes #1626
Closes #1627
Closes #1628
Closes #1629
Closes #1630
Closes #1631
Closes #1632
Closes #1634
Closes #1636
Closes #1639
Closes #1641
Closes #1643
Closes #1644
Closes #1645
Closes #1646
Closes #1647
Closes #1648
Closes #1649
Closes #1651
Closes #1652
Closes #1653
Closes #1654
Closes #1655
Closes #1656
Deep Code Review — REQUEST_CHANGES (verdict: 🟠 blocker — CI red)
Bulk audit-fix PR (82 fixes, 50 files, +1302/-377). Security tripwire clean, ~12 hot/high-risk files audited individually, all production logic looks sound. But CI
backend-testsis RED on heade0fff9c, and I reproduced 3 deterministic failures locally (worktree at the PR head,uv run pyteston touched modules). All three are deliberate behavior changes where a pre-existing test was NOT updated — exactly the class py_compile can't catch.🟠 Blockers (3 failing tests — must fix before merge)
tests/services/forecasting/test_affordability.py:272TestPaymentAtScenario::test_scenario_payment_per_horizonaffordability.py:351now adds_KEY_RATE_MARKET_SPREAD_PP(4.5pp) to the scenario rate before the annuity. The test still asserts the bare-rate annuity →assert 68168.43 == 50186.40.test_default_market_path(line ~240) WAS updated for the spread; this scenario test was missed. Production code is arguably correct; the test must be updated to expect_annuity(principal, 8.0 + _KEY_RATE_MARKET_SPREAD_PP, _ANNUITY_TERM_MONTHS)(and 20.0 + spread).tests/services/test_nspd_denorm.py:307test_denorm_dump_empty_featuresnspd_denorm.denorm_dumpnow returns a 4th key"skipped". Test asserts the old 3-key dict{parcels,buildings,errors}→Left contains 1 more item: {'skipped': 0}."skipped": 0.tests/services/test_nspd_denorm.py:322test_denorm_dump_no_cad_num_counted_as_errorcad_numfromerrors→skipped. Test still assertscounts["errors"] == 1→ got0(it's now inskipped).counts["skipped"] == 1andcounts["errors"] == 0.✅ What passed (no changes needed)
redaction.pySTRENGTHENS redaction (adds RU local-phone format #1641 + INN checksum gate #1640 — the checksum only suppresses false-positive large-number redaction, valid INNs still redacted).llm/client.py/provider.pyaddfinish_reasonpropagation + tolerant token coercion.main.pyaddsbefore_send=scrub_sensitive_queryto Sentry (improvement). No literal secret/key/token anywhere in the diff.models/parcel.py: removedParcelORM model — verified zero importers ofapp.models.parcel.Parcelrepo-wide; only kills a phantomCREATE TABLE parcelsin alembic autogen. Safe.api/v1/parcels.py: #1561 persist-after-forecast reordering is correct (jsonb snapshot now matches live response; forecast enqueue reads the run at execution time ~30-180s later, no race).run_in_threadpoolfor sync DB-IO in async handlers is the right asyncio fix.placement.py:place_strategy -> ConceptVariant | None+place_all_strategiesraisingParcelGeometryError(mapped to 422 in concepts.py:30) — sole caller is internal; existing tests use normal parcels, still pass (421 site_finder + placement tests green).regression.py#1636 confounded-flag,competitors.py#1615 price gap-fill SQL (no psycopg::typetrap — casts glued to), the allowed form;CAST(:radius AS float)correct),dxf.pyinterior-ring support +TextEntityAlignmentenum (ezdxf 1.4.3 has it),domrf_kn.pypagination +_to_float,ekburg_permits.pyworkbooktry/finally close,thumbs.pyatomic write — all sound.Cross-file impact
schemas/chat.pyswapsmax_length(422) for truncating validator (looser — no FE break);schemas/concept.pyaddsge=0to optionalland_cost_rub(negative now 422 — nonsensical value, low risk).Recommended next steps
backend-testsgreen → I re-review and merge (squash, delete branch).Complexity / blast radius
(Note: PR #1661 dependency satisfied — it merged. Holding #1660 merge per gate: CI red.)