mirror of
https://github.com/kuhyx/testsAndMisc.git
synced 2026-11-11 13:47:47 +01:00
Split along the natural seam now that the file is fully covered:
_transcribe_probes.py 177 _try_import, the four dependency probes,
generate_sine_wav, prepare_model, test_cuda
transcribe_helpers.py 142 the eight _handle_* functions and main()
All 18 top-level definitions verified AST-identical to HEAD, and an AST
scan confirms neither module references a name it does not bind.
transcribe.sh is untouched - it invokes tools/transcribe_helpers.py by
path, and that path still exists with the same name and executable bit.
The CLI tests' patch targets did not move either, because main() dispatches
to names imported into its own namespace.
Verified by running every subcommand and reading the exit status directly,
since those codes are the contract transcribe.sh branches on:
python-version 0, check-faster-whisper 7, check-ctranslate2 1,
check-diarization 0, deps-installed 0; generate-wav writes the same
96044-byte WAV as before the split. 41 tests pass at 100% line and branch
on both modules; 243 pass in the directory. Over-cap files 35 -> 34.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011w2Pj4Ek3ZNMQVYcFHgXDY
19 lines
1.5 KiB
JSON
19 lines
1.5 KiB
JSON
{
|
|
"title": "Split transcribe_helpers.py 289 -> 177 + 142",
|
|
"objective": "transcribe_helpers.py was 289 lines against the 250-line cap. Now that it sits at 100% line and branch coverage, split it along its natural seam: the dependency probes and audio/model operations move to _transcribe_probes.py, while transcribe_helpers.py keeps the CLI dispatch that transcribe.sh invokes by path. Code moves verbatim; the tests predate the seam and are re-pointed, not rewritten.",
|
|
"acceptance_criteria": [
|
|
"Both resulting modules are under 250 lines; the over-cap total falls 35 -> 34",
|
|
"All 18 top-level definitions are AST-identical to the pre-split file",
|
|
"The same 41 tests pass, with both modules at 100% line and branch coverage",
|
|
"Every CLI subcommand returns the same exit code as before the split, since transcribe.sh branches on them",
|
|
"transcribe.sh needs no change: tools/transcribe_helpers.py still exists at the same path with its executable bit",
|
|
"No suppression of any kind"
|
|
],
|
|
"out_of_scope": [
|
|
"transcribe_fw.py (302) and _transcribe_diarize.py (356), which are separate targets",
|
|
"Removing the unreachable dispatch guard, a behaviour change",
|
|
"Moving anything under python_pkg/"
|
|
],
|
|
"verifier": "A throwaway ast.dump identity check against HEAD for the verbatim claim; pytest with --cov=transcribe_helpers --cov=_transcribe_probes --cov-branch; running each CLI subcommand and reading $? directly; bash -n transcribe.sh; bash ~/utils/scripts/check_file_length.sh --all."
|
|
}
|