Milestone: M013-2hi504
Generated: 2026-05-01
Purpose: Track remaining legacy_runtime_adapter users while deleting the compatibility seam in safe batches.
Current production users after the first S01 migration:
| File | Adapter imports | Status | Notes |
|---|---|---|---|
web/python-web-app/src/app.py |
0 | migrated | Uses legacy_runtime_state_service.get_legacy_runtime_state() directly. |
web/python-web-app/src/jobs/job_store.py |
0 | migrated | Calls persistent_job_service using process runtime state directly. |
web/python-web-app/src/routes/tts.py |
0 | migrated | Uses speech_route_dependencies; provider bridges runtime state and transitional public monkeypatch overrides without importing the adapter. |
web/python-web-app/src/routes/stt.py |
0 | migrated | Uses speech_route_dependencies; STT preprocessing/runtime values come from runtime state with transitional public overrides. |
web/python-web-app/src/routes/voice_clone.py |
0 | migrated | Uses voice_clone_route_dependencies; provider owns upload-rate constants/signatures, runtime state, storage/provider access, auth resolution, and temporary public monkeypatch overrides. |
web/python-web-app/src/routes/settings.py |
0 | migrated | Uses settings_route_dependencies; settings/user-settings wrappers read runtime state and transitional public monkeypatch overrides without importing the adapter. |
web/python-web-app/src/routes/categories.py |
0 | migrated | Uses category_route_dependencies; category runtime helpers read focused services/runtime state and transitional public monkeypatch overrides without importing the adapter. |
web/python-web-app/src/routes/soundboard.py |
0 | migrated | Uses soundboard_route_dependencies; the route context reads runtime state and transitional public monkeypatch overrides without importing the adapter. |
web/python-web-app/src/routes/legacy.py |
0 | migrated | Uses legacy_route_dependencies; legacy compatibility routes read the historical public surface and runtime state without importing the adapter. |
S01 introduced src.services.legacy_runtime_state_service as the shared process-state owner. This lets startup and focused wrappers consume the existing bootstrap state without importing gb_tts_app.py, src.legacy_runtime, or legacy_runtime_adapter.
Migrated in S01:
src.app.create_app() now registers blueprints on get_legacy_runtime_state().app.src.jobs.job_store now calls persistent_job_service directly using get_legacy_runtime_state() for connection pool, job registry, and job lock.src.legacy_runtime now consumes the same state singleton, avoiding duplicate runtime construction.Migrated in S02:
src.routes.tts now uses src.services.speech_route_dependencies instead of legacy_runtime_adapter.src.routes.stt now uses src.services.speech_route_dependencies instead of legacy_runtime_adapter.speech_route_dependencies exposes speech constants/functions from focused services and runtime state, with transitional support for public legacy-module monkeypatch overrides so existing tests and compatibility expectations continue to work during the deletion sequence.Migrated in S03:
src.routes.voice_clone now uses src.services.voice_clone_route_dependencies instead of legacy_runtime_adapter.voice_clone_route_dependencies owns the voice-clone upload constants/signatures and temp cleanup helper that were previously only available through the legacy runtime namespace, while still reading process state from legacy_runtime_state_service.Migrated in S04:
src.routes.settings now uses src.services.settings_route_dependencies instead of legacy_runtime_adapter.settings_route_dependencies exposes settings/user-settings/API-key runtime dependencies from focused services and runtime state, with transitional support for public legacy-module monkeypatch overrides.Migrated in S05:
src.routes.categories now uses src.services.category_route_dependencies instead of legacy_runtime_adapter.category_route_dependencies exposes category management, legacy category path/slug helpers, cache invalidation, and storage-prefix helpers from focused services and runtime state, with transitional support for public legacy-module monkeypatch overrides.Migrated in S06:
src.routes.soundboard now uses src.services.soundboard_route_dependencies instead of legacy_runtime_adapter.soundboard_route_dependencies provides the runtime context expected by extracted Soundboard services from focused state where available, while preserving transitional public legacy-module monkeypatch overrides for deeper Soundboard callables.Migrated in S07:
src.routes.legacy now uses src.services.legacy_route_dependencies instead of legacy_runtime_adapter.legacy_route_dependencies preserves the broad compatibility bridge expected by root/auth/drafts/cache/default-model/pronunciation/Soundboard wrapper routes while avoiding route imports of the adapter module.Deferred after S07:
legacy_runtime_adapter.py remains as a tracked transitional service module for compatibility, but no production route imports it. Future work can delete it once external/internal references to the adapter module itself are confirmed absent or intentionally migrated.python3 scripts/verify_m013_s01_adapter_allowlist.py
PYTHONPATH=web/python-web-app web/python-web-app/venv/bin/python - <<'PY'
from src.app import create_app
app = create_app()
client = app.test_client()
assert client.get('/health').status_code == 200
assert client.get('/').status_code == 200
print('wsgi smoke OK')
PY
web/python-web-app/venv/bin/pytest \
web/python-web-app/tests/unit/test_runtime_import_boundaries.py \
web/python-web-app/tests/unit/test_persistent_job_service.py \
web/python-web-app/tests/api/test_runtime_entrypoint_closure.py \
web/python-web-app/tests/api/test_tts.py \
web/python-web-app/tests/api/test_stt.py \
web/python-web-app/tests/api/test_models.py \
web/python-web-app/tests/api/test_voices.py \
web/python-web-app/tests/api/test_speech_contract_hardening.py \
web/python-web-app/tests/api/test_voice_clone.py \
web/python-web-app/tests/unit/test_legacy_runtime_speech_service_delegation.py -q