SpeakTrue

Legacy Runtime Inventory

Reader: future engineers and agents selecting the next legacy-web extraction seam. After reading, they should be able to choose the next wrapper group to extract without using ignored planning artifacts.

Purpose and scope

This inventory names the remaining responsibilities still owned by the legacy Flask runtime module and separates them from service boundaries that already moved out. It is grounded in tracked legacy-web source modules, route wrappers, focused services, and verifier scripts.

The document intentionally lists module and function names only. It does not include auth headers, API tokens, draft bodies, transcript contents, audio contents, or provider payload bodies.

Compatibility alias policy

gb_tts_app.py remains only a compatibility alias for older imports and tests that still need the historical module name. It is not a deployment entrypoint and is not a new import target for internal source.

Internal legacy-web source should import focused src.services.* modules or focused route dependency providers. After M013, app startup, job storage, TTS, STT, voice-clone, settings, categories, Soundboard, and legacy compatibility routes are off legacy_runtime_adapter; the adapter remains only as a transitional service module with no production route imports.

Remaining legacy_runtime.py responsibility groups

S04 complete: legacy_runtime.py is retired to an import-compatible shim for runtime construction ownership. Runtime globals are owned by explicit bootstrap/runtime services through legacy_runtime_bootstrap_service; no import-time Flask app, storage provider, connection-pool, ffmpeg/STT capability, cache/job/regen, upload limiter, or auth-bootstrap construction remains directly owned by legacy_runtime.py.

S04 owns construction retirement after S03; do not re-expand cache/job/category/draft/pronunciation wrappers while addressing remaining compatibility names. The historical runtime globals import surface remains documented here as runtime globals compatibility scope, but construction ownership is explicit-service owned.

S03 complete: cache/job and category/draft/pronunciation compatibility groups are thinned. S04 owns runtime-global/final-shim retirement while preserving historical import names.

Extracted service boundaries already owned by S01/S02/S03/S04

Next extraction candidates

Historical marker for older deterministic guards: future legacy_runtime.py retirement work now means preserving the compatibility shim while preventing any wrapper from reacquiring service-owned behavior.

  1. Continue retiring remaining route-facing compatibility bodies only after root render, login/OAuth, Soundboard, cache/job, category, draft, pronunciation, default-model, and storage-provider verifier bundles all pass.
  2. Keep cache/job and category/draft/pronunciation wrappers as S03-thinned delegates unless S04 replaces their import surface outright.

Blockers to retiring legacy_runtime.py

M007 local retirement proof remains valid for runtime construction ownership, but full compatibility-module deletion is still blocked after M013 by the historical src.legacy_runtime / gb_tts_app import surface and monkeypatch-heavy tests, not by production route adapter imports. legacy_runtime.py is an import-compatible shim whose runtime globals are service-owned compatibility exports; legacy_runtime_adapter.py remains only as a transitional service module and is no longer imported by production routes.

Post-retirement caveats for future agents:

M013 seam-deletion guards

Additional current guards after M013:

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/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 \
  web/python-web-app/tests/unit/test_runtime_import_boundaries.py \
  web/python-web-app/tests/api/test_runtime_entrypoint_closure.py -q

Local verification commands

Run these checks after changing the inventory, import policy, or any listed wrapper group:

web/python-web-app/venv/bin/pytest web/python-web-app/tests/unit/test_runtime_import_boundaries.py -q
python3 scripts/verify_m006_s05_validation_coverage.py
python3 scripts/verify_m006_s01_bootstrap_static.py
python3 scripts/verify_m006_s02_auth_bootstrap.py
python3 scripts/verify_m006_s03_user_settings.py
python3 scripts/verify_m006_s04_speech_service.py
python3 scripts/verify_m007_s01_storage_config.py
python3 scripts/verify_m007_s02_soundboard_wrappers.py
python3 scripts/verify_m005_s04_import_boundaries.py
python3 scripts/verify_m005_s04_runtime_closure.py
python3 scripts/verify_m005_s02_cache_job_extraction.py
python3 scripts/verify_m005_s03_low_risk_extraction.py
python3 scripts/verify_m007_s03_wrapper_thinning.py

For runtime-facing changes, also run a root-route render or browser auth bootstrap smoke before claiming the Flask entrypoints still render and authenticate.