feat(insights): manual-entry Insight entity CRUD + §19 audit (#948 part A) #1164
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
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lekss361/gendesign#1164
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "feat/insight-entity-948a"
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?
Что
#948 Part A — сущность «Инсайт» (ручная, ACL-гейт, §7.13/§8.9). Аналитик пишет free-form intel про локацию/участок с пометкой «непублично». Часть #944. (Part B — «Локация» как first-class entity §8.2 — отдельный follow-up, это больший district-рефактор.)
Разблокировано #962 (циклическая зависимость EPIC18↔EPIC4 разорвана — roles теперь есть).
Содержимое
data/sql/145_insight.sql— таблицаinsight(idempotent; geom GENERATED из lon/lat; индексы). Аддитивно расширяет CHECKaudit_log.action += insight_write(тот жеck_audit_log_action, to_regclass-guarded, superset — не ломает #962-аудит, не правит applied 144).api/v1/insights.py+services/insights.py(raw-SQL, зеркало custom_pois) +schemas/insight.py(Pydantic v2). CRUD: POST/GET(list+filters+pagination)/GET{id}/PUT/DELETE.audit_middleware.classify_path(#962, моё): method-aware →insight_writeдля POST/PUT/DELETE (GET не аудируется), обратно совместимо.created_byизX-Authenticated-User(не из тела — спуфинг автора невозможен). Backend rbac_guard hard-блокирует только /api/v1/admin/*; pilot отсекается frontend RouteGuard+Caddy (как parcels/custom_pois).is_confidential— пометка без per-record backend-гейта (analyst видит, per #962).Качество
code-reviewer: ✅ APPROVE — оба гейта: cross-migration CHECK ALTER корректен (правильное имя constraint, idempotent, guarded, superset → #962-аудит цел) + zero SQL-injection (всё bind, CAST not ::, pagination 1-200). Author-integrity airtight. Docstrings исправлены на точную ACL-формулировку. 86 тестов (28 insight + 5 audit), ruff, без новых deps.parcels.pyне тронут (NON-colliding).Deploy/verify
145 применяется до нового кода (стандартный
_schema_migrationsorder). #962+#948A backend-деплой пока в очереди раннера — проверю обе на проде когда backend пересоберётся.Refs #948 (Part A; Part B Location — follow-up).