testsAndMisc/docs/superpowers
Krzysztof kuhy Rudnicki fb51e991fe _transcribe_diarize: cover 0% -> 100% before splitting
The largest untested Python file left in the repo, at 356 lines against the
cap. Tests land first so the split that follows is verified against tests
that predate the seam.

63 tests: duration probing through both ffmpeg paths, the transcode fallback
and temp-file cleanup, audio loading's three outcomes, linear resampling,
cosine k-means, the ECAPA classifier loader, per-segment embedding
extraction, and diarize_segments end to end.

numpy is real here, not a double. It is a declared dependency, and the core
of this file is clustering maths - assertions against a mocked numpy would
prove nothing about whether two speakers actually get two labels. The
_try_import seam passes numpy through while stubbing torch and speechbrain,
so the tests still run in CI with neither installed. The clustering tests
assert real properties: two opposed groups separate, magnitude is ignored
because the metric is cosine, and a fixed seed reproduces.

The last three coverage gaps were _load_audio's ffmpeg fallback in both
outcomes, the minimum-slice widening, and the zero-iteration k-means branch.

Split across six test modules after two intermediate arrangements went over
the cap, and one move silently broke a test by separating it from its
doubles - caught by the test count holding at 63 through every rearrangement.
338 tests pass in the directory, up from 275 by exactly the 63 added.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011w2Pj4Ek3ZNMQVYcFHgXDY
2026-08-17 13:54:04 +02:00
..
contracts _transcribe_diarize: cover 0% -> 100% before splitting 2026-08-17 13:54:04 +02:00
evidence _transcribe_diarize: cover 0% -> 100% before splitting 2026-08-17 13:54:04 +02:00
memory style(prettier): apply markdown/json formatting updates 2026-05-07 22:08:00 +02:00
plans feat(phone-focus): add recovery workflow, automation scripts, and docs 2026-05-01 19:07:27 +02:00
sessions chore(agent): add governance checks and artifact workflow scaffolding 2026-05-07 22:03:43 +02:00
specs Bring every markdown file under the cap 2026-08-16 19:25:59 +02:00
workflows chore(agent): add governance checks and artifact workflow scaffolding 2026-05-07 22:03:43 +02:00