refactor: move services to a unit of work over repository ports

Services depend only on src/core/ports: async with self.uow is one
transaction, commit is explicit, leaving without it rolls back. A
connection is held per step, the JSON routers keep a shared request
deadline, and rollback runs under the block deadline. Adds
service-tests with fakes, a repo contract run on both the fake and SQL,
and make service_test / service_test_db. API, schema and settings are
unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-31 23:14:16 +03:00
co-authored by Claude Opus 5.5
parent b2fb88f25a
commit 6ba74b18f3
90 changed files with 10882 additions and 2030 deletions
+5 -3
View File
@@ -76,7 +76,7 @@ paths:
compose (стенд `bench/`), а compose берёт его из образа и не
дублирует.
- В образ не попадают `.env`, `config.toml`, секреты, `tests/`,
`student-tests/`, `contracts/`, `evidence/`, `.claude/`, `openspec/`,
`student-tests/`, `service-tests/`, `contracts/`, `evidence/`, `.claude/`, `openspec/`,
`.venv/`. Отличие от bp_proxies: там `config.toml` копируется в образ,
здесь нельзя. Чистый clone его не содержит, и сборка упала бы, а
`Dockerfile.example` (п. 6) запрещает класть конфиг и секреты в образ.
@@ -94,8 +94,10 @@ paths:
## `.dockerignore`
Файл из skeleton дополнять, а не заменять: `config.toml`, `.claude`,
`openspec`, `tests`, `student-tests`, `contracts`, `infra`, `*.md`,
`Makefile`.
`openspec`, `tests`, `student-tests`, `service-tests`, `contracts`, `infra`,
`*.md`, `Makefile`. `Dockerfile` копирует только `src/` и миграции, но контекст
сборки быстрых тестов тоже не тащит (спек `unit-of-work`, «Быстрых тестов нет в
образе»).
`.dockerignore` не заменяет явный `COPY` только нужного.
Паттерн без `**/` действует только в корне контекста: `__pycache__` из