feat(deploy): add an isolated demo stand with synthetic seed and guarded reset

This commit is contained in:
shira committed 2026-10-09 14:46:18 +03:00
1 parent bd23c839fd
commit e1df4ff77c
26 files changed
+3292 -2

No files matched your search

+30
View File
@@ -359,6 +359,36 @@ make -C backend policy-publish ARGS='matching --actor operator:<handle>'
- The new version takes effect at once for new searches and changes no stored result. It is also a new version of the whole product policy, so a category opening pinned to the earlier version has to be opened again (and attested again on a demonstration stand, see above) before new assessment attempts are created. Publish it before the candidates start attempts, or repeat the opening and the attestation afterwards.
- The demo values (the coefficients of the PRD, the limit of 10 entries per group, and the small specialization-to-technology taxonomy) are in [architecture](ARCHITECTURE.md#product-policy-versions); they are not calibrated. The isolated browser fixture publishes the same section itself.
## Isolated demo stand
The demo stand is a separate Compose project with synthetic data only: the jury and the team sign in with prepared accounts of both roles, without waiting for mail. It is not the working stand, and real people must not register on it.
```sh
make -C deploy demo-seed DEMO_MODE=isolated
make -C deploy demo-reset DEMO_MODE=isolated
make -C deploy demo-down DEMO_MODE=isolated
```
- Every target requires `DEMO_MODE=isolated` and refuses before any Docker command without it. It acts only on the project `DEMO_PROJECT` (default `lincodex-demo`), whose name must contain `demo` and differ from `APP_PROJECT`; the ordinary project and its volumes are never addressed. The project is `docker-compose.yml` with `docker-compose.demo.yml`, built from the current sources. The overlay sets `ASSESSMENT_DEMO_CATEGORIES_ENABLED=true` on the demo backend, so a full test taken there assigns an uncalibrated synthetic category like the prepared ones (see [Demonstration categories on a stand](#demonstration-categories-on-a-stand)). It reads the secrets from the root `.env` (`ENV_FILE`) and overrides the project name, networks, `APP_HTTP_PORT` (`DEMO_HTTP_PORT`, default 8090), `APP_PUBLIC_URL` (`DEMO_PUBLIC_URL`, default `http://localhost:8090`), and the pinned subnet (`DEMO_SUBNET` 172.29.84.0/24, `DEMO_FRONTEND_IP`), so it can run next to the ordinary stand. The bind address stays `APP_HTTP_BIND`. Behind the edge, set `DEMO_PUBLIC_URL` to the public origin. The mail transport is the one in `.env`; the prepared accounts need no mail.
- `demo-seed` starts the project when needed, waits for the backend readiness (migrations and the startup policy are done by then), runs the `demo-seed seed` command in a separate container, and prints the inventory of the seeded records. A second run creates nothing and prints the same inventory. `demo-down` stops the project and keeps its volumes.
- `demo-reset` first runs `demo-seed check-reset` against the demo database. It refuses, and deletes nothing, when the database holds any account outside the reserved domain `@demo.lincodex.test`, for example a visitor's own registration: such an account is ordinary data. Otherwise it removes the demo project with its volumes (`down --volumes` of `DEMO_PROJECT` only), starts it again, and seeds it. The demo overlay labels the PostgreSQL, SeaweedFS, and Kafka volumes with `org.lincodex.demo-mode=isolated` when it creates them; every target refuses a volume of the project without that label, so a volume of an ordinary stand is never adopted or discarded. A stand that the reset refuses can only be cleared by a deliberate manual decision of the operator.
- The password of every synthetic account is `DEMO_ACCOUNT_PASSWORD` from `deploy/demo/demo.env`, or from the checked-in `deploy/demo/demo.env.example` when that file does not exist. The example value is a published demo credential, not a secret; for a stand reachable from outside, copy the example to `demo.env` (ignored by Git) and hand the new password to the jury separately. The password applies when an account is created; change it with a reset. The commands print the logins and never the password.
What the seed creates (all names carry a synthetic marker; addresses are on `@demo.lincodex.test`, which never receives mail):
| Login | Role and state |
| --- | --- |
| `employer-alpha@demo.lincodex.test` | Employer. Owner of "Демо-компания «Альфа»" and recruiter in "Демо-компания «Бета»": full owner access in one organization and the owner-only denial of the minimal release in the other |
| `employer-beta@demo.lincodex.test` | Employer. Owner of "Демо-компания «Бета»" |
| `candidate@demo.lincodex.test` | Candidate for the jury's own run: C1 and C3, a manual profile without an FSP ID, the Backend Junior questionnaire with Go, no attempt, no publication. Runs the express and starts the full test |
| `prepared-1@` to `prepared-6@demo.lincodex.test` | Candidates with a prepared full attempt: C1, C2, C3, the same profile and questionnaire, one finished `demo_basic` attempt with its synthetic demonstration category Backend Junior and evidence, and a published card |
- Accounts are confirmed by the seed itself: it stores the account, the C1 grant of a registration, and the verification time in one transaction, like the e2e fixtures. Ordinary registration is unchanged and still needs the email link; on a stand with `EMAIL_PROVIDER=disabled` a self-registered account cannot sign in.
- Policy and bank: over the unchanged startup version 1 the seed publishes the demo policy `DemoProductPolicyV4` (explicit `demo_basic` settings, the separate express training section, the review band, and the matching section); a stand whose latest policy is anything else is refused. It imports and publishes 25 synthetic families of the category `demo-backend-junior` (author `ai:demo-seed-synthetic-bank`, reviewer label `operator:demo-seed-bank-reviewer`; the families are not subject-reviewed), opens the category for Backend Junior with Go, and attests it as a synthetic demonstration source. Express mode has its own three families in the category `demo-express` and its own training binding; an express run never creates a category, a percentile, or evidence.
- Prepared attempts run through the ordinary attempt operations: create, answer every frozen item (all but the last one correctly), and finalize, so the result, the category, the history, and the evidence projection come from the same code and triggers as a candidate's attempt. They are not three demonstration questions. They are labelled in the profile of each prepared candidate ("Полная попытка теста подготовлена командой demo-seed"), in the seed output (attempt IDs), and as uncalibrated `synthetic_demo` categories. The database has no separate provenance flag on a result yet. The answers are given within seconds, so the manual-review band of these attempts can show the speed signals.
- Six identical prepared cards exist because a card is shown only in a cohort of at least five; the sixth keeps the search non-empty after one prepared candidate hides an organization or unpublishes. The search of Alpha's owner returns the six entries; the recruiter's search in Beta answers 403. The seed creates no need: an employer creates one during the demonstration.
- The seed refuses a stand that holds ordinary accounts but none of its own, never edits a record it did not create, and leaves its own records alone on a repeat (for example a profile a visitor changed); use the reset to restore them. It refuses an address of the reserved domain that belongs to an unconfirmed or other-role account. `demo-seed` needs `DATABASE_URL` and `DEMO_MODE=isolated`, plus `DEMO_ACCOUNT_PASSWORD` for `seed`; it reads no dotenv file and checks all of them before it connects. The actor `operator:<handle>` (`DEMO_ACTOR`, default `operator:demo-seed`) is recorded as the author of the policy version, the publisher of the families, the opener of the category, and the attestor; it is an audit label, not authentication. `make -C backend demo-seed ARGS='inventory'` runs the same command from a host that reaches the database; `make -C backend demo-seed-build` builds `backend/bin/demo-seed`. The command is built by `backend/Dockerfile.demo-seed`; the backend and release images do not contain it.
## Separate ML Compose project
ML uses a separate Compose file and project; it does not require or start Redis or SeaweedFS in the current scaffold. Its default host bind is 127.0.0.1:8000. Set ML_BIND_ADDRESS only after choosing a private address and preparing firewall rules. Prometheus does not scrape remote ML while ML_METRICS_TARGET is empty.
+18
View File
@@ -479,6 +479,24 @@ Browser test: `frontend/e2e/notifications.spec.ts` runs in `make -C deploy test-
What these tests do not show: a real invitation (none produces an event yet), the behavior of the inbox when the mail provider fails (the handler reads no mail state by construction, and the unit test covers an unverified address), delivery latency or load, push or live updates, and the layout and the screen-reader behavior of the page (no automated check).
## Demo seed tests
`backend/internal/usecase/demoseed/seeder_test.go` checks without a database that a reset is allowed only for a database without accounts or with synthetic accounts only, that the synthetic bundles pass the loader rules and are identical between builds (so a repeated import changes nothing), that the prepared answers have the intended correctness, and that the dataset has two employers on the synthetic domain, one self-service candidate, and a cohort of at least five prepared candidates. `backend/internal/adapter/primary/cli/demoseed/command_test.go` checks the argument parsing, that every subcommand refuses without `DEMO_MODE=isolated` before it reads the database settings, that a short password is refused without echoing it, that the seed output names the logins and the prepared attempts but never the password, that failures become safe messages, and that `check-reset` fails on any account outside the synthetic domain.
`TestDemoSeedCommand` in `backend/integration_test/demo_seed_test.go` uses `bootstrap(t, postgresService)` and runs the operator command against migrated databases that carry the startup policy:
- Without the isolated mode, also against an unreachable database, every subcommand refuses, and nothing is written.
- A database with an ordinary account and no seed is refused by both the seed and the reset check; the account and the policy stay as they were.
- The first seed creates nine confirmed synthetic accounts, two organizations, three memberships (the owner of Alpha is a recruiter of Beta), six prepared attempts with results, current synthetic categories, evidence, and published cards, the seed policy version, 28 published families, one opening, one attestation, and one training binding. A second seed by another operator creates nothing and prints the same inventory.
- Every organization, profile name, and prepared profile carries its synthetic or prepared marker, and every category is an uncalibrated `synthetic_demo` category.
- The owner of Alpha sees exactly the six prepared cards through the card listing that the search uses, and not the unpublished self-service candidate.
- A perfect express run of the self-service candidate through the attempt operations draws three items from the training category, ends as `demonstration`, and adds no category and no evidence; the same candidate can then start the full test.
- After an ordinary account registers on the seeded database, the reset check refuses and counts it, a repeated seed still creates nothing, and the account is unchanged.
`make -C deploy check-demo` (part of `make -C deploy check`) runs `deploy/scripts/demo.sh` against a recording stub of the docker CLI: every action refuses without `DEMO_MODE=isolated`, with a project name that equals `APP_PROJECT` or lacks `demo`, with an invalid actor, or without the env file, before any Docker command; a project volume without the demo label is refused before any Compose command; a refused reset check stops the reset before `down`; a reset addresses only the demo project and seeds again; `down` keeps the volumes. With the docker CLI it also renders the overlay: only the frontend is published, on loopback; the seed container has only the default network, a read-only root, and the explicit profile; every volume carries the demo label; the demo backend enables synthetic categories; and the backend images do not contain the command.
The tests do not run the Make targets against a real stack. A manual check on a throwaway project: `make -C deploy demo-seed DEMO_MODE=isolated DEMO_PROJECT=lincodex-demo-check DEMO_HTTP_PORT=18090` twice with identical inventories, a sign-in of the prepared accounts with mail disabled, an express run and the start of the full test, then `demo-reset` refused after a visitor registered. Remove the project afterwards with `docker compose -p lincodex-demo-check down --volumes` and the same variables. The tests do not validate the content of the synthetic bank or any grade, and the browser route of the jury is not covered here. Integration tests need Docker.
## Future software validation
Go unit tests should exercise domain/usecase rules with explicit inputs, results, and errors. Integration tests should use a real PostgreSQL at the same major version, apply goose migrations, and exercise sqlc, constraints, transactions, rollback, and concurrent transitions. The HTTP path should use chi, middleware, usecases, and the database; replace external ML with a controlled HTTP fake and email with a test adapter.
+30
View File
@@ -361,6 +361,36 @@ make -C backend policy-publish ARGS='matching --actor operator:<handle>'
- Новая версия действует для новых поисков сразу и не меняет сохраненных результатов. Это также новая версия всей политики product, поэтому открытие категории, привязанное к прежней версии, нужно открыть заново (и аттестовать заново на демонстрационном стенде, см. выше), прежде чем создавать новые попытки оценки. Публикуйте ее до начала попыток кандидатов либо повторите открытие и аттестацию после.
- Демонстрационные значения (коэффициенты PRD, предел 10 записей на группу и небольшая таксономия «специализация - технология») описаны в [архитектуре](ARCHITECTURE.md#версии-продуктовой-политики); они не калиброваны. Изолированный браузерный стенд публикует тот же раздел сам.
## Изолированный демонстрационный стенд
Демонстрационный стенд - отдельный Compose-проект только с синтетическими данными: жюри и команда входят в подготовленные аккаунты обеих ролей без ожидания письма. Это не рабочий стенд, и реальные люди не должны на нем регистрироваться.
```sh
make -C deploy demo-seed DEMO_MODE=isolated
make -C deploy demo-reset DEMO_MODE=isolated
make -C deploy demo-down DEMO_MODE=isolated
```
- Каждая цель требует `DEMO_MODE=isolated` и без него отказывает до любой команды Docker. Она работает только с проектом `DEMO_PROJECT` (по умолчанию `lincodex-demo`), имя которого должно содержать `demo` и отличаться от `APP_PROJECT`; к обычному проекту и его томам цели не обращаются. Проект собирается из `docker-compose.yml` и `docker-compose.demo.yml` по текущим исходникам. Overlay включает `ASSESSMENT_DEMO_CATEGORIES_ENABLED=true` в демонстрационном backend, поэтому полный тест на нем присваивает неоткалиброванную синтетическую категорию, как и подготовленные попытки (см. [Демонстрационные категории на стенде](#демонстрационные-категории-на-стенде)). Секреты берутся из корневого `.env` (`ENV_FILE`), а имя проекта, сети, `APP_HTTP_PORT` (`DEMO_HTTP_PORT`, по умолчанию 8090), `APP_PUBLIC_URL` (`DEMO_PUBLIC_URL`, по умолчанию `http://localhost:8090`) и закрепленная подсеть (`DEMO_SUBNET` 172.29.84.0/24, `DEMO_FRONTEND_IP`) переопределяются, поэтому стенд может работать рядом с обычным. Адрес привязки остается `APP_HTTP_BIND`. За edge укажите в `DEMO_PUBLIC_URL` публичный origin. Почтовый транспорт берется из `.env`; подготовленным аккаунтам почта не нужна.
- `demo-seed` при необходимости запускает проект, ждет готовности backend (к этому моменту миграции и стартовая политика уже применены), выполняет команду `demo-seed seed` в отдельном контейнере и печатает перечень созданных записей. Повторный запуск ничего не создает и печатает тот же перечень. `demo-down` останавливает проект и сохраняет тома.
- `demo-reset` сначала выполняет `demo-seed check-reset` против демонстрационной базы. Цель отказывает и ничего не удаляет, если в базе есть хотя бы один аккаунт вне зарезервированного домена `@demo.lincodex.test`, например собственная регистрация посетителя: такой аккаунт - обычные данные. Иначе она удаляет демонстрационный проект вместе с томами (`down --volumes` только для `DEMO_PROJECT`), запускает его снова и заполняет. Overlay при создании помечает тома PostgreSQL, SeaweedFS и Kafka меткой `org.lincodex.demo-mode=isolated`; каждая цель отказывает при томе проекта без этой метки, поэтому том обычного стенда никогда не будет использован или удален. Стенд, сброс которого отклонен, очищается только сознательным ручным решением оператора.
- Пароль всех синтетических аккаунтов - `DEMO_ACCOUNT_PASSWORD` из `deploy/demo/demo.env`, а без этого файла - из закоммиченного `deploy/demo/demo.env.example`. Значение из примера - опубликованные демонстрационные учетные данные, а не секрет; для стенда, доступного извне, скопируйте пример в `demo.env` (Git его игнорирует) и передайте новый пароль жюри отдельно. Пароль применяется при создании аккаунта; меняется он через сброс. Команды печатают логины и никогда не печатают пароль.
Что создает seed (все названия содержат пометку о синтетических данных; адреса на `@demo.lincodex.test`, который никогда не получает почту):
| Логин | Роль и состояние |
| --- | --- |
| `employer-alpha@demo.lincodex.test` | Работодатель. Владелец «Демо-компания «Альфа»» и рекрутер в «Демо-компания «Бета»»: полный доступ владельца в одной организации и отказ по правилу «только владелец» минимального выпуска в другой |
| `employer-beta@demo.lincodex.test` | Работодатель. Владелец «Демо-компания «Бета»» |
| `candidate@demo.lincodex.test` | Кандидат для самостоятельного прохождения жюри: C1 и C3, ручной профиль без ФСП ID, опрос Backend Junior с Go, без попыток и без публикации. Проходит экспресс-тест и начинает полный тест |
| `prepared-1@` - `prepared-6@demo.lincodex.test` | Кандидаты с подготовленной полной попыткой: C1, C2, C3, такие же профиль и опрос, одна завершенная попытка `demo_basic` с синтетической демонстрационной категорией Backend Junior и доказательством, опубликованная карточка |
- Аккаунты подтверждает сам seed: в одной транзакции он сохраняет аккаунт, выдачу C1 при регистрации и время подтверждения, как e2e-фикстуры. Обычная регистрация не меняется и по-прежнему требует ссылку из письма; на стенде с `EMAIL_PROVIDER=disabled` самостоятельно зарегистрированный аккаунт войти не может.
- Политика и банк: поверх неизмененной стартовой версии 1 seed публикует демонстрационную политику `DemoProductPolicyV4` (явные настройки `demo_basic`, отдельный раздел учебного экспресс-режима, полоса ручной проверки и раздел подбора); стенд с любой другой последней версией политики отклоняется. Seed импортирует и публикует 25 синтетических семейств категории `demo-backend-junior` (автор `ai:demo-seed-synthetic-bank`, метка проверяющего `operator:demo-seed-bank-reviewer`; предметной проверки семейства не проходили), открывает категорию для Backend Junior с Go и аттестует ее как синтетический демонстрационный источник. У экспресс-режима свои три семейства в категории `demo-express` и своя учебная привязка; экспресс-прохождение никогда не создает категорию, перцентиль или доказательство.
- Подготовленные попытки проходят через обычные операции попытки: создание, ответ на каждое закрепленное задание (все, кроме последнего, верно) и завершение, поэтому результат, категория, история и проекция доказательств получаются тем же кодом и теми же триггерами, что и у попытки кандидата. Это не три демонстрационных вопроса. Они помечены в профиле каждого подготовленного кандидата («Полная попытка теста подготовлена командой demo-seed»), в выводе seed (идентификаторы попыток) и как неоткалиброванные категории `synthetic_demo`. Отдельного признака происхождения у результата в базе пока нет. Ответы даются за секунды, поэтому полоса ручной проверки этих попыток может показать сигналы скорости.
- Подготовленных карточек шесть одинаковых, потому что карточка показывается только в когорте не меньше пяти; шестая сохраняет непустой поиск, если один подготовленный кандидат скроет организацию или снимет публикацию. Поиск владельца «Альфы» возвращает шесть записей; поиск рекрутера в «Бете» отвечает 403. Потребность seed не создает: работодатель создает ее во время демонстрации.
- Seed отклоняет стенд, где есть обычные аккаунты, но нет ни одного его собственного, никогда не меняет записи, которые не создавал, и при повторе не трогает свои записи (например, профиль, измененный посетителем); для восстановления используйте сброс. Seed отклоняет адрес зарезервированного домена, принадлежащий неподтвержденному аккаунту или аккаунту другой роли. Команде `demo-seed` нужны `DATABASE_URL` и `DEMO_MODE=isolated`, а для `seed` еще `DEMO_ACCOUNT_PASSWORD`; dotenv-файл она не читает и проверяет все значения до подключения. Исполнитель `operator:<handle>` (`DEMO_ACTOR`, по умолчанию `operator:demo-seed`) записывается как автор версии политики, публикатор семейств, открывший категорию и аттестующий; это метка аудита, а не аутентификация. `make -C backend demo-seed ARGS='inventory'` запускает ту же команду с хоста, у которого есть доступ к базе; `make -C backend demo-seed-build` собирает `backend/bin/demo-seed`. Команду собирает `backend/Dockerfile.demo-seed`; backend- и release-образы ее не содержат.
## Отдельный ML Compose
ML имеет отдельный Compose-файл и проект; Redis и SeaweedFS ему пока не требуются и здесь не запускаются. По умолчанию он слушает на 127.0.0.1:8000. Настройте ML_BIND_ADDRESS только если выбранный приватный адрес и firewall уже подготовлены. Метрики удаленного ML target не собираются, пока ML_METRICS_TARGET пуст.
+18
View File
@@ -479,6 +479,24 @@ Unit-тесты (`make -C backend test`) проверяют правила жу
Чего эти тесты не показывают: настоящее приглашение (пока ни одно не создает событие), поведение inbox при сбое почтового провайдера (по построению обработчик не читает состояние почты, а модульный тест покрывает неподтвержденный адрес), задержку доставки и нагрузку, push и живые обновления, а также вёрстку и работу страницы со скринридером (автоматической проверки нет).
## Тесты демонстрационного seed
`backend/internal/usecase/demoseed/seeder_test.go` без базы проверяет, что сброс разрешен только для базы без аккаунтов или только с синтетическими аккаунтами, что синтетические наборы проходят правила загрузчика и совпадают между сборками (поэтому повторный импорт ничего не меняет), что подготовленные ответы имеют задуманную правильность и что в наборе данных два работодателя на синтетическом домене, один кандидат для самостоятельного прохождения и когорта не меньше чем из пяти подготовленных кандидатов. `backend/internal/adapter/primary/cli/demoseed/command_test.go` проверяет разбор аргументов, отказ каждой подкоманды без `DEMO_MODE=isolated` до чтения настроек базы, отказ при коротком пароле без вывода его значения, то, что вывод seed называет логины и подготовленные попытки, но никогда не пароль, безопасные сообщения об ошибках и отказ `check-reset` при любом аккаунте вне синтетического домена.
`TestDemoSeedCommand` в `backend/integration_test/demo_seed_test.go` использует `bootstrap(t, postgresService)` и запускает операторскую команду против баз с миграциями и стартовой политикой:
- Без изолированного режима, в том числе против недоступной базы, каждая подкоманда отказывает и ничего не записывает.
- База с обычным аккаунтом и без seed отклоняется и seed, и проверкой сброса; аккаунт и политика остаются прежними.
- Первый seed создает девять подтвержденных синтетических аккаунтов, две организации, три членства (владелец «Альфы» - рекрутер «Беты»), шесть подготовленных попыток с результатами, текущими синтетическими категориями, доказательствами и опубликованными карточками, версию политики seed, 28 опубликованных семейств, одно открытие, одну аттестацию и одну учебную привязку. Повторный seed от другого оператора ничего не создает и печатает тот же перечень.
- Каждая организация, имя профиля и подготовленный профиль содержат пометку о синтетических данных или о подготовке, а каждая категория - неоткалиброванная категория `synthetic_demo`.
- Владелец «Альфы» видит ровно шесть подготовленных карточек через тот же список карточек, что использует поиск, и не видит неопубликованного кандидата для самостоятельного прохождения.
- Безошибочное экспресс-прохождение этого кандидата через операции попытки берет три задания из учебной категории, завершается результатом `demonstration` и не добавляет ни категории, ни доказательства; после этого тот же кандидат может начать полный тест.
- После регистрации обычного аккаунта в заполненной базе проверка сброса отказывает и учитывает его, повторный seed по-прежнему ничего не создает, а аккаунт не меняется.
`make -C deploy check-demo` (часть `make -C deploy check`) запускает `deploy/scripts/demo.sh` с записывающей заглушкой docker CLI: каждое действие отказывает без `DEMO_MODE=isolated`, с именем проекта, равным `APP_PROJECT` или без `demo`, с неверным исполнителем или без env-файла, до любой команды Docker; том проекта без демонстрационной метки отклоняется до любой команды Compose; отказ проверки сброса останавливает сброс до `down`; сброс обращается только к демонстрационному проекту и заново заполняет его; `down` сохраняет тома. При наличии docker CLI тест также рендерит overlay: опубликован только frontend и только на loopback; у контейнера seed только сеть default, корень только для чтения и явный профиль; у каждого тома есть демонстрационная метка; демонстрационный backend включает синтетические категории; backend-образы команду не содержат.
Тесты не запускают Make-цели против настоящего стека. Ручная проверка на одноразовом проекте: дважды `make -C deploy demo-seed DEMO_MODE=isolated DEMO_PROJECT=lincodex-demo-check DEMO_HTTP_PORT=18090` с одинаковыми перечнями, вход подготовленными аккаунтами при выключенной почте, экспресс-прохождение и начало полного теста, затем отказ `demo-reset` после регистрации посетителя. После проверки удалите проект командой `docker compose -p lincodex-demo-check down --volumes` с теми же переменными. Тесты не проверяют содержание синтетического банка или какой-либо грейд, а браузерный маршрут жюри здесь не покрыт. Интеграционным тестам нужен Docker.
## Будущая программная валидация
Для Go unit tests нужны правила domain/usecase с конкретными входами, результатами и ошибками. Интеграционные тесты используют настоящую PostgreSQL той же major версии, применяют goose migrations и проверяют sqlc, ограничения, транзакции, rollback и конкурентные переходы. Для HTTP путь собирается через chi, middleware, usecase и БД; внешний ML заменяется контролируемым HTTP fake, почта - тестовым адаптером.