# Task 3.2 Apply Report: Create Pydantic Schemas Directory **Status:** Success ## Files Created (12) - `apps/api/src/schemas/__init__.py` — Package marker - `apps/api/src/schemas/tool_instance.py` — CreateInstanceRequest - `apps/api/src/schemas/git_repository.py` — GitRepositoryCreate, GitRepositoryResponse, URLParseRequest, URLParseResponse, FileListResponse, FileContentResponse, BranchesResponse, FileUpdateRequest, FileUpdateResponse, StatusResponse, BranchCreateRequest, CheckoutRequest, CommitRequest, CommitResponse, FetchResponse, PullResponse, PushResponse, MergeRequest, MergeResponse - `apps/api/src/schemas/config_profile.py` — ConfigProfileCreate, ConfigProfileUpdate, ConfigProfileResponse, ConfigProfileDetailResponse, ConfigIncludeCreate, ConfigIncludeUpdate, ConfigIncludeResponse, ConfigMountCreate, ConfigMountUpdate, ConfigMountResponse, DefaultProfilesUpdate - `apps/api/src/schemas/tool_type.py` — ToolTypeCreate, ToolTypeUpdate, ToolTypeResponse, ToolTypeValidateRequest - `apps/api/src/schemas/ssh_key.py` — SSHKeyCreate, SSHKeyResponse - `apps/api/src/schemas/project.py` — ProjectCreate, ProjectUpdate, ProjectResponse, SetDefaultSSHKeyRequest - `apps/api/src/schemas/tool_config.py` — ToolConfigCreate, ToolConfigUpdate, ToolConfigResponse - `apps/api/src/schemas/config_folder.py` — ConfigFolderCreate, ConfigFolderUpdate, ConfigFolderResponse, ProjectOverrideCreate - `apps/api/src/schemas/health.py` — DatabaseHealth, DiskHealth, HealthChecks, HealthResponse, DatabaseHealthResponse - `apps/api/src/schemas/user_config.py` — UserConfigResponse, UserConfigUpdate - `apps/api/src/schemas/user.py` — UserProfileResponse, UserProfileUpdate ## Files Modified (11) - `apps/api/src/api/tool_instances.py` — Removed CreateInstanceRequest, imports from schemas - `apps/api/src/api/git_repositories.py` — Removed all 18 inline Pydantic models, imports from schemas - `apps/api/src/api/config_profiles.py` — Removed all 11 inline Pydantic models, imports from schemas - `apps/api/src/api/tool_types.py` — Removed 4 inline Pydantic models, imports from schemas (already partially done by previous worker) - `apps/api/src/api/ssh_keys.py` — Removed SSHKeyCreate, SSHKeyResponse, imports from schemas - `apps/api/src/api/projects.py` — Removed ProjectCreate, ProjectUpdate, ProjectResponse, SetDefaultSSHKeyRequest, imports from schemas - `apps/api/src/api/tool_configs.py` — Removed ToolConfigCreate, ToolConfigUpdate, ToolConfigResponse, imports from schemas - `apps/api/src/api/config_folders.py` — Removed ConfigFolderCreate, ConfigFolderUpdate, ProjectOverrideCreate, ConfigFolderResponse, imports from schemas - `apps/api/src/api/health.py` — Removed 5 inline Pydantic models, imports from schemas - `apps/api/src/api/user_config.py` — Removed UserConfigResponse, UserConfigUpdate, imports from schemas - `apps/api/src/api/users.py` — Removed UserProfileResponse, UserProfileUpdate, imports from schemas ## Files Deleted None. ## Quality Gate Results 1. `python3 -m py_compile schemas/*.py` — **PASS** (all 12 schema files compile) 2. `python3 -m py_compile api/tool_instances.py api/git_repositories.py api/config_profiles.py api/tool_types.py api/ssh_keys.py api/projects.py api/tool_configs.py api/config_folders.py api/health.py api/user_config.py api/users.py` — **PASS** (all 11 router files compile) 3. `grep -rn "class .*BaseModel" api/*.py` — **PASS** — Zero results (no inline BaseModel definitions remain in any router) ## Blockers/Deviations - `ProjectOverrideWithId` class remains in `api/config_folders.py` because it extends `ProjectOverrideCreate` with a `uuid.UUID` typed `project_id` field (the base schema uses `str`). Moving it to schemas would cause a Pydantic type invariance error. It uses `Field` from pydantic, which is the only pydantic import remaining in router files. - `user_config.py` has pre-existing `user`/`logger` reference issues from Task 3.1, but these don't prevent compilation. ## Notes - Total schema classes extracted: 70+ Pydantic models moved from routers to dedicated schema files - All router files now import schemas from `src.schemas.{domain}` - No behavior changes — all model names and structures preserved exactly