Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/whisper-transcribe#21
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Post-merge composition audit of #8 (long-file streaming) against #16 / #19 (chunk resume). Both are on
main(4a0b976); this issue carries the three items the audit found missing. Source card: kanbant_02afa75b(fixit board). Full audit writeup:~/.hermes/kanban/boards/fixit/workspaces/t_d5c5d159/README-t_02afa75b-integration.md.Already verified — no work needed
Chunk indices are stable across runs.
chunking.plan_chunksis a pure function of(duration_sec, chunk_minutes)— no wall clock, norandom, no ordering dependence. Confirmed empirically:plan_chunks(10h, 30min)yields 20 chunks, identical over repeated calls; a +0.5sffprobeduration jitter shifts only the final chunk'send_secand leaves every non-final(index, start_sec)byte-identical, so a resume after a duration re-probe still joins on index. The one case that would break the join — the user changing--chunk-minutesbetween runs — is already hard-rejected by thechunk_seconds mismatchguard instate.validate_state(src/whisper_transcribe/state.py:396). Nothing to change here.1. Add a
--state-file PATHoverrideToday the state file location is controlled only by
--workdir DIR; the filename is the fixedSTATE_FILENAMEconstant (transcribe.state.json). There is no way to point at an explicit path.Plumbing note — this is not a one-line addition.
state.pyderives every path from a workdir today (state_path,chunk_json_path,cleanup_state,find_stale_state_workspaces,purge_stale_state_workspaces). Two viable shapes:state_file: Path | Nonethrough_run_transcriptionand havestate_path(workdir)become the fallback when it isNone. Cleanest semantics; touches everystate.pyhelper signature.--state-file /x/y/custom.jsonimplies workdir/x/yplus a non-default state filename, keeping per-chunk JSONs (transcribe.chunk_NNNN.json) alongside it. Smaller diff; keeps the one-directory-per-job invariant that--clean-stalescanning relies on.Shape (b) is preferred unless there is a reason to let the state file and its per-chunk JSONs diverge.
Acceptance:
--state-file PATHsets the state-file path explicitly and takes precedence over--workdir.--state-filetogether with--workdiris either a usage error (EXIT_USAGE) or documented precedence — pick one and test it.job_workdir.mkdir(parents=True, exist_ok=True)atcli.py:1050.--freshand--clean-stalerespect the override.--helplists the flag (mirror the existing assertions intests/test_resume.py:463/:473).2. Decide + document the default state-file location
The source card that generated this issue asks for the state file to be co-located with the output file by default. The shipped behaviour is source-audio-adjacent (
cli._resolve_workdir,cli.py:761), anddocs/state-file.md§1 states that requirement deliberately: "The state file lives in the workdir, not next to every output JSON, so--outpaths can move freely without invalidating resume."The tension is real:
--outbetween runs does not throw away 7 hours of completed chunks.Recommendation: keep the shipped source-adjacent default — resume correctness is the entire point of #16, and output-adjacency loses it the moment
--outmoves — and treat the read-only-source-dir case as what--state-file(item 1) is for. Flipping the default is a behaviour change for anyone with state files already on disk, so it needs an explicit decision rather than a silent change.Acceptance: whichever way this is decided,
docs/state-file.md§1 and the--workdir/--state-filehelp text state the same rule, and a test pins it.3. Add the combined 10h streaming + resume integration test
The existing
tests/test_resume.py:614 test_resume_picks_up_after_interrupthas the right shape but the wrong scale: 120-minute stubbed duration (4 chunks), crash on the 4th chunk, 3 done / 1 pending. The card's acceptance criterion is a 10h file crashing at hour 7.Acceptance for the new test:
probe_duration -> 36000.0in line with the existing monkeypatch pattern; do not generate 10h of real audio).start_sec=25200.0,end_sec=27000.0).done.--resumere-processes exactly the 6 remaining chunks (14-19) and no others.audio_stream.decode_chunkis currently only covered in isolation against a 1-second ffmpeg sine (tests/test_audio_stream.py), never jointly with the resume loop. Mark the test@requires_ffmpegif it needs real decoding, matchingtests/conftest.py.Notes
ruff check src testsclean, suite285 passed, 16 skipped(excludingtests/test_benchmark_gpu_sizing.py).