{ "intent": "Cover transcribe_fw.py from 0% to 100% line and branch, so the following split of the 302-line file is verified against tests written before the seam existed.", "scope": [ "New: linux_configuration/tests/test_transcribe_fw_{progress,pipeline,main}.py", "Non-goal: any change to transcribe_fw.py, which is byte-identical to HEAD", "Non-goal: _transcribe_diarize.py, still to do" ], "changes": [ "Added 32 tests covering argument parsing and its FW_* environment defaults, device/compute resolution, the progress line, the transcription loop, model loading, diarized output writing, and main()'s three exit paths.", "faster_whisper is reached only through _try_import, so patching that seam covers every path without the package. The output writers and the diarization helper are patched at the transcribe_fw module boundary, which is where main() resolves them.", "_format_progress_line is tested directly rather than through the loop: it is pure, so the percentage clamp, the ETA and the suppression of an ETA longer than a day are each assertable without a model.", "Split across three test files because a single pipeline module reached 321 lines - over the cap this work exists to clear." ], "verification": [ { "command": "git diff --stat -- .../tools/transcribe_fw.py", "result": "pass", "evidence": "No change: this commit adds tests only." }, { "command": "pytest linux_configuration/tests/test_transcribe_fw_*.py --cov=transcribe_fw --cov-branch --cov-report=term-missing", "result": "pass", "evidence": "32 passed. transcribe_fw.py: 131 statements, 0 missing, 32 branches, 0 partial, 100%. The last gap was _try_import itself at lines 38-41, which every other test patches; it is now exercised directly against a real module and a missing one." }, { "command": "pytest linux_configuration/tests/test_transcribe_fw_*.py (count across the test-file split)", "result": "pass", "evidence": "32 passed both before and after splitting the 321-line pipeline module, which is the discriminating check for a test-file split." }, { "command": "pytest linux_configuration/tests/ -q", "result": "pass", "evidence": "275 passed, up from 243 by exactly the 32 tests added; no existing test was altered." }, { "command": "pre-commit run --files ", "result": "pass", "evidence": "All hooks pass. Fixed rather than suppressed: a PT019 warning by renaming the _no_writes fixture to recorded_writes, since its value is used and the leading underscore claimed otherwise, and an ERA001 by rewording a section banner that read as commented-out code. A NameError from using Path at runtime while it was imported only under TYPE_CHECKING was caught by running the tests and fixed without adding a runtime import." }, { "command": "bash ~/utils/scripts/check_file_length.sh --all", "result": "pass", "evidence": "34 files over cap, unchanged by this commit. New test files are 230/204/155 lines, all under 250." } ], "risks": [ "The tests stub faster_whisper entirely, so they prove the control flow, the exit codes and the output paths, not that transcription itself is correct. Deliberate: the package is absent in CI and a real model run is not a unit test.", "The throttle test pins wall-clock time to a constant so the throttle window never elapses. If the throttle were later changed to a segment count rather than a duration, that test would pass vacuously; it asserts an exact line count to limit that." ], "rollback": [ "git revert the commit; the three test files disappear together.", "After rollback, confirm pytest linux_configuration/tests/ reports 243 passed and transcribe_fw.py is unchanged." ] }