The plain transcribe command still used chunk overlap speaker matching, so users had to discover a model flag or supply a known speaker count to get the improved voice comparison behavior. Enable OpenRouter voice comparison with automatic speaker counting for normal text and SRT invocations. Keep --speakers and --speaker-model as optional overrides, and let --no-diarization disable both provider labels and voice comparison. Make the basic command the documentation entry point and clarify the defaults in CLI help and repository guidance. Cover bare invocations across one and multiple uploads, default SRT, optional count constraints, opt-out ordering, and atomic output when the default comparison fails. Test Plan: - python3 -B -m unittest -v: all 85 tests passed. - bash -n transcribe: passed. - git diff --cached --check: passed. - Tests use real audio encoding with fake provider responses. Live voice accuracy remains unverified; no live API request was made for this change.
2.3 KiB
Repository instructions
Automatic commits are mandatory
- Automatically commit each completed, validated change before finishing a task. Do not wait for the user to ask for a commit or request confirmation.
- Keep commits focused. Include the implementation, regression tests, and relevant documentation together; commit independent changes separately.
- Inspect staged and unstaged changes before committing. Stage only files that belong to the task. Do not commit user recordings, generated transcripts, credentials, or unrelated changes.
- Use Conventional Commit subjects and explain the change and validation in
the commit body, including a
Test Plan:section. - Run the relevant checks, including
python3 -B -m unittest -v,bash -n transcribefor shell changes, andgit diff --cached --check. Report any validation that could not be completed; never claim a mocked provider test proves live API behavior. - After committing, inspect the commit and working tree, and report the commit hash with any remaining work. Do not push unless requested.
Project layout
transcribe: CLI options, audio preparation, and transcription requests.chunks.py: upload boundaries and ordered overlap stitching.subtitles.py: timestamp validation and SRT cue formatting.transcript.py: readable text paragraphs and speaker markers.diarization.py: automatic OpenRouter audio sample comparison and speaker ID reconciliation.test_*.pyandtests/fake_provider.py: local regression tests without real credentials or provider requests.
Keep the CLI and its four Python helpers together. Preserve transcript order
and emit stdout only after all chunks and output conversion succeed. Provider
speaker IDs are request-local; reuse transcript IDs across requests only with
supporting overlap or explicit shared-audio comparison evidence. Voice comparison
must preserve transcription text and timestamps, validate complete sample
assignments, and leave uncertain or conflicting identities separate. Keep chunk
details out of the final transcript.
Progress, processing details, and errors belong on stderr.
The normal command detects the speaker count and reconciles voices automatically;
--speakers and --speaker-model are optional overrides. --no-diarization
disables both provider diarization and the voice comparison request.