#24 — Retire mockup pages + extract prepare-db AKS Job params¶
Motivation¶
Issue #24 tracks splitting oversized / mixed-responsibility files. Priority 1
(SettingsPanel.tsx) had already shipped in fdd707b. This change addresses two
of the remaining items:
- The
web/src/pages/mockups/design-exploration pages (deletion candidates). - A focused slice of the Priority 2
prepare_db.pyroute → service extraction.
User-facing change¶
None. This is a pure refactor / dead-code removal — no behaviour change, no API
or UI change. The retired /mockups/* routes were design-exploration throwaways
never linked from the app navigation.
What changed¶
Mockups retired (~5,400 lines of dead code removed)¶
- Deleted the four route-only prototype pages:
AksCardMockups,AksCardMockupsRefined,AksCardMockupsPremium,AksCardMockupsSimple(~5,041 lines) and their/mockups/aks-card*routes + imports in web/src/App.tsx. SidecarInspectorMockups.tsxcould not simply be deleted: itsVariantAcomponent andInspectorRequesttype are used in production by HttpInspectorPanel.tsx. Moved the file to web/src/components/cards/SidecarsCard/sidecarRequestInspector.tsx, kept Variant A + its helpers verbatim, and removed the two unshipped variants (B/C), the demo fixture generator, and the demo page wrapper. Updated the two comments that referenced the old mockup paths.
prepare_db.py — env-driven Job params moved to a service¶
- The AKS-fanout
_try_dispatch_aks_modeis a ~490-line function that mixes HTTP validation, RBAC pre-flight, NCBI listing, metadata I/O, locking, and Celery dispatch — most of it tightly coupled toHTTPException, so a wholesale extraction would be high-risk for zero behaviour gain. - Extracted the safe, side-effect-free slice: the
PREPARE_DB_AKS_*environment-knob parsing (~60 lines ofint()/clamp/None-default logic) into api/services/storage/prepare_db_aks_params.pyresolve_aks_job_limits() -> AksJobLimits. The route now calls it and spreadslimits.task_overrides()into the Celery kwargs, preserving the exact "unset/unparsable override → builder default" contract (including thebackoff_limit=0edge case).
API / IaC diff summary¶
- No route, response, or env-var contract change. New pure service module + unit test. No new dependency.
Validation evidence¶
- Backend:
uv run ruff check apiclean;uv run pytest -q api/tests→ 3021 passed, 3 skipped. Newtest_prepare_db_aks_params.py(4 cases);test_prepare_db_hardening.py+test_storage_data.pygreen (no regression). - Frontend:
cd web && npm run buildclean;npx vitest run→ 706 passed; no remainingpages/mockupsimport references.
Remaining #24 work (deliberately deferred, see issue comment)¶
prepare_db.py_try_dispatch_aks_modefull body extraction — high-risk,HTTPException-coupled; warrants its own focused PR with a domain-error / result-object boundary.- Priority 2 frontend splits (
EndpointCard,ProvisionModal,ClusterBento,blast.tstype extraction) — pure structural refactors; risk/value favours separate scoped PRs over batching into this change.