This commit is contained in:
2026-09-29 00:17:58 +03:00
parent 2f8d4098c5
commit da32158789
38 changed files with 3106 additions and 10 deletions
+22 -7
View File
@@ -9,7 +9,7 @@ Guidance for ZCode agents working in this repository.
Фотографии, блобы признаков, реестр зданий и аудит принадлежат **основному сервису**
(отдельный репозиторий) и S3 — этот сервис ничего не хранит и не имеет доступа к S3/БД/диску.
**Проект находится на стадии анализа: кода нет, вся проектная документация — в `docs/`.**
**Проект реализован по документации в `docs/` (MVP); ключевые контракты — там же.**
## Documentation-first workflow
@@ -52,12 +52,27 @@ Guidance for ZCode agents working in this repository.
## Current state — what does and does not exist
- No `requirements.txt`, `pyproject.toml`, `setup.py`, or lockfile. Do not assume
any package manager (pip/poetry/uv/pdm); confirm with the user before adding one.
- No test framework, linter, or type-checker is configured. Planned per docs:
pytest + httpx; `.gitignore` anticipates pytest, mypy, and ruff caches.
- Планируемый стек (см. docs/03): FastAPI, opencv-python-headless, numpy, Pillow.
БД/ORM отсутствуют по архитектуре — не добавлять.
- Service is **implemented** (Python 3.12, FastAPI): `app/api` (transport layer)
and `app/cv` (pure CV core; layer rule `api → cv` — see «Fixed technology
decisions»).
- Dependencies: `requirements.txt` (runtime) and `requirements-dev.txt`
(+pytest/httpx) via **pip**; local venv in `.venv/` (gitignored).
Do not introduce another package manager (poetry/uv/pdm) without user
confirmation.
- Test framework: **pytest** (configured in `pytest.ini`, `testpaths=tests`).
Unit tests in `tests/unit` (UT-01..18), integration in `tests/api` (IT-01..17)
per `docs/08`; fixtures are synthetic OpenCV images (`tests/synth.py`) —
real photos are never committed (docs/08 §8.6).
- Common commands (from repo root):
- run tests: `.venv/bin/python -m pytest`
- run dev server: `APP_API_KEY=... .venv/bin/uvicorn app.main:create_app --factory --no-access-log`
- prod: `docker compose up -d` (multi-stage Dockerfile, python:3.12-slim,
`opencv-python-headless`, non-root `appuser`, port 8000, env from `.env`).
- Planned but **not implemented**: acceptance dataset/calibration script
(docs/08 §8.4), Prometheus metrics (outside MVP), v2 extensions
(`/identify`, embeddings).
- No linter/type-checker configured yet (`.gitignore` anticipates ruff/mypy).
- БД/ORM/S3-клиент отсутствуют по архитектуре — не добавлять.
- Virtual environments (`venv/`, `.venv/`, `env/`) and `.env` files are gitignored;
never commit them or secrets within them.