# Pass 02 — Domain and Database Foundation Final Prompt Implement database/domain foundation after backend health is stable. Required deliverables: - SQLAlchemy setup; - Alembic setup; - PostGIS-compatible geometry model strategy; - models for Project, Area, Dataset, AnalysisRun, Detection, Metric, Export; - Pydantic schemas; - migration instructions; - tests for model import and schema validation. Rules: - Follow `CANONICAL_DOMAIN_MODELS.md`. - Follow `STATE_MACHINES.md`. - Do not store geospatial data as arbitrary JSON when a PostGIS geometry column is the correct target. - If local PostGIS is unavailable, provide graceful test fallback but keep production target PostGIS.