Route package hardening¶
Motivation¶
Several FastAPI route modules had grown beyond a comfortable review size. The first BLAST split also showed that route order and monkeypatch/import compatibility needed explicit tests before continuing the package refactor.
User-facing change¶
No intended API or UI behavior change. Existing /api/blast/* and /api/monitor/* paths remain registered in the same public surface.
API / IaC diff summary¶
- Added route contract tests for
/api/blastimport compatibility, result route ordering, and API-before-frontend catch-all registration. - Split
api/routes/blast/__init__.pyinto focused submodules:jobs.py,submit.py,databases.py,taxonomy.py,schedules.py, andresults.py. - Moved BLAST submit body normalization into
api/services/blast_submit_payload.pywhile keeping_blast_shared.pyre-exports for existing tests/imports. - Promoted
api/routes/monitor.pyinto theapi/routes/monitor/package with focused AKS, metrics, storage, ACR, terminal, cluster, jobs, sidecars, and common modules. - Kept
api.routes.monitor._SIDECAR_BROADCASTER,_SidecarBroadcaster,collect_snapshot,get_credential, and_gracefulre-exported for lifespan hooks and existing tests. - No IaC changes.
Validation evidence¶
uv run ruff check apiPYTHONPATH=$PWD uv run pytest -q api/tests— 705 passed.