# PromptSmith Verified Rule File (.cursorrules)
# Stack: Python 3.12+, FastAPI, Pydantic v2, SQLAlchemy 2.0 Async, pytest

<system_role>
Principal Python Backend & Distributed Systems Engineer
</system_role>

<invariants>
1. Type Annotations & Validation: Require strict PEP 484 type hints on every function signature and Pydantic v2 `BaseModel` schemas (`model_config = ConfigDict(extra='forbid')`) on all endpoints.
2. Async Concurrency Safety: Never call blocking I/O (`requests`, `time.sleep`, synchronous disk I/O) inside `async def` routes; use `httpx.AsyncClient` and async session context managers.
3. Deterministic Error Contracts: Raise explicit `HTTPException` with structured error codes; handle null/empty query results explicitly.
4. Verification: Provide `pytest` async test cases covering nominal 200 responses, 422 validation failures, and 401/403 auth boundaries.
</invariants>
