AndreyandClaude Opus 4.8 2b97f08b19 🔒 feat(channels): enforce policy invariants P1-P5
SPEC-HUB-0027 §3.2/§12, этап 3. Инварианты включаются на изменении, а не
только на создании: непродуктовый канал больше не может нести checkout,
attribution или обязательную идентичность.

Проверка идёт по итоговому состоянию, а не по переданным полям. Поэтому
снять продукт и выключить коммерческие флаги можно одним запросом, а запрос,
оставляющий канал в запрещённой комбинации, отклоняется целиком — имя из
того же PATCH тоже не сохраняется.

Данные приведены заранее, иначе первый же PATCH имени упёрся бы в ошибку
политики. Отчёт нашёл один нарушитель — непродуктовый канал edevs с
включёнными checkout и attribution. По решению владельца оба флага сняты,
продукт не назначался. Та же миграция чинит дефолты модели, которые сами
нарушали P1-P2: канал создаётся без продукта, а attribution и checkout были
включены по умолчанию.

Нарушения P3-P5 миграция не исправляет, а останавливает выкат с перечнем
каналов: снятие обязательной идентичности меняет смысл канала.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-21 13:06:20 +03:00
2026-06-17 18:14:16 +03:00
2026-07-12 01:17:17 +03:00
2026-06-26 15:10:36 +03:00

CustoCRM

Canonical implementation workspace for hub.edevs.tech.

Local start

Copy-Item .env.example .env
.\scripts\start.ps1

The local compose stack contains:

  • isolated app, platform, and loopback-only admin Django runtimes;
  • background worker;
  • PostgreSQL;
  • Redis;
  • Internal Hub UI;
  • Web Chat UI;
  • local Nginx reverse proxy.

No production secrets are stored in the repository.

Default local URLs:

  • App gateway: http://app.localhost/
  • Platform health: http://platform.localhost/api/v1/health/live/
  • Django admin (loopback only): http://127.0.0.1:18001/admin/
  • Internal Hub UI (direct Vite): http://localhost:5173
  • Web Chat: http://localhost:5175
  • App API (direct): http://localhost:8010/api/v1

Local accounts (TOTP disabled). These credentials are fixed — do not change them:

  • OWNER — owner@edevs.tech / Owner-Local-2026
  • OPERATOR — a.kotova@edevs.tech / Operator-Local-2026

Bootstrap the organization and both accounts:

docker compose run --rm backend-app python manage.py bootstrap_owner --email owner@edevs.tech --password Owner-Local-2026 --name "Иван Петров"

Tests

All suites run in Docker, so no manual environment is required — the test runners auto-detect themselves and relax production hardening (secret-key fail-fast, SSL redirect, throttling) for the duration of the run.

Run everything (backend tests, frontend unit tests, typechecks):

.\scripts\check.ps1

Individual suites:

# Backend (pytest + pytest-django)
docker compose run --rm backend-app pytest

# Frontend unit tests (vitest)
docker compose run --rm frontend npm run test

# End-to-end (Playwright, internal-ui) — auto-starts the dev server
npx playwright install chromium   # one-time
npx playwright test --project=internal-ui

Backend pytest configuration lives in apps/backend/pytest.ini (it must sit next to manage.py so it is also visible inside the backend container).

Languages
Python 41.4%
TypeScript 25.3%
HTML 15.9%
JavaScript 10.7%
CSS 5.9%
Other 0.7%