- Зачем:
- шаг 5 плана: нужен рабочий CLI-happy path, связывающий utils / transcriber / formatter.
- ревью этапов 4–5 выявило два medium-бага в formatter и отсутствие тестов для CLI.
- Что:
- cli.py: все опции по PRD 3.2 (--model, --language, --output, --device, --compute-type, --verbose),
rich Status + stderr-консоль, предупреждение на пустую речь, статистика времени.
- transcriber.py: добавлена ensure_model_available() с проверкой кэша HF и валидацией
локальной директории; on_status callback для передачи прогресса в CLI; обработка
ImportError при отсутствии socksio через SOCKS proxy.
- formatter.py: исправлен overflow в format_timestamp (0.995 → 00:01.00 вместо 00:00.100);
сегменты теперь пишутся с явным пробелом и strip() независимо от whisper-формата текста.
- deps: добавлен socksio>=1.0.0 для поддержки SOCKS proxy при загрузке модели.
- tests: test_cli.py (8 тестов на CLI-контракт), расширены test_formatter.py и test_transcriber.py.
- Проверка:
- uv run pytest — 42 passed.
- uv run transcribe --help показывает все опции.
1.1 KiB
1.1 KiB
Review: Stages 4-5 (Rerun)
Executive Summary
| Severity | Count |
|---|---|
| CRITICAL | 0 |
| HIGH | 0 |
| MEDIUM | 0 |
| LOW | 0 |
Overall Risk: LOW Recommendation: APPROVE
What Was Rechecked
src/local_transcriber/formatter.pysrc/local_transcriber/cli.pytests/test_formatter.pytests/test_cli.py
Result
No new findings.
Previously reported issues for stages 4-5 are addressed:
- centisecond carry in
format_timestamp()is fixed - transcript formatting no longer depends on leading whitespace in
seg.text - CLI now has automated tests for happy path, options, empty speech warning, output path handling, and error exit code
Verification
uv run pytest-> 31 passed.venv/bin/transcribe --help-> works- spot checks:
format_timestamp(0.995)->00:01.00format_timestamp(59.995)->01:00.00format_timestamp(3599.995, use_hours=True)->01:00:00.00
Residual Risk
- Step 6 error-handling polish is still not implemented, so user-facing error formatting remains intentionally incomplete at this stage