ROOT CAUSE
User reported the Python edition showed "только пустой терминал" — empty
terminal — when launched. Three compounding issues:
1. `tts.py` called `torch.hub.load(...)` at MODULE IMPORT time. On first
use this downloads a 60MB Silero model with no progress output beyond
one "Using cache found in..." line. With no prior banner the user
couldn't tell if it crashed or was loading.
2. main.py's startup banner (`print("=" * 60)...J.A.R.V.I.S. v...`)
appeared AFTER all the heavy imports. So even when nothing was wrong,
visible feedback was delayed by 10-60 seconds.
3. If `pip install -r requirements.txt` failed for any package
(`simpleaudio` notoriously needs MSVC to build), `import simpleaudio`
crashed the whole process with a raw ModuleNotFoundError.
FIXES
- `tts.py`: Silero model load moved into `_ensure_model()` called lazily
from `synthesize()`. First synth pays the load cost (with a one-line
progress hint) — everything before that is visible immediately.
- `main.py`: print "J.A.R.V.I.S. loading..." banner BEFORE any heavy
imports. User sees the terminal is alive within ~100ms.
- `main.py`: scan required deps before importing them; if any are
missing, print "Run: pip install -r requirements.txt" with the
specific list and exit cleanly (exit code 2) instead of stack-tracing.
- `main.py`: `simpleaudio` is now soft-optional. Falls back to stdlib
`winsound` on Windows installs that couldn't build the C extension.
Sound cues still work; only the precise wait_done semantics are
slightly different.
VERIFIED LOCALLY
`.venv\Scripts\python.exe main.py` now prints:
```
============================================================
J.A.R.V.I.S. loading (Python edition)...
Heavy modules (vosk / torch / pvrecorder) take a few seconds.
============================================================
[scheduler] thread started (1 tasks loaded)
============================================================
J.A.R.V.I.S. v0.4.1 [Python edition]
Total commands: 200
============================================================
Using device: Микрофон (5- Fifine Microphone)
Jarvis (v0.4.1) начал свою работу ...
Yes, sir.
```
Total time to first banner: ~100ms (was 10-60s of nothing).
All 104 pytest tests still pass.