## Context - FastAPI app at `src/my_deepagent/api/app.py` needs a lightweight liveness/readiness probe. - Response shape: `{"status": "ok", "db": }`; `db` reflects a fast `SELECT 1` round-trip. - Must degrade gracefully: DB failure returns `db: false`, not a 500. ## Phases - Locate existing DB session/engine helper used elsewhere in the app. - Confirm sync vs async session pattern to match endpoint signature. - Add `ping_db()` helper running `SELECT 1` with short timeout. - Wrap helper in try/except; return `False` on any DB exception. - Register `GET /healthz` route on the FastAPI app instance. - Endpoint calls `ping_db()` and returns the JSON payload. - Keep endpoint unauthenticated and excluded from rate limits. - Add response model or `dict[str, Any]` annotation for clarity. ## Verification - Unit test: mock DB success, assert `{"status": "ok", "db": true}` and 200. - Unit test: mock DB raising, assert `{"status": "ok", "db": false}` and 200. - Manual: `curl /healthz` with DB up, then with DB stopped. - Static checks: `ruff`, `mypy`/`pyright`, `pytest` all pass. - Confirm no new warnings and CHANGELOG `[Unreleased]` updated.