fix: keep chunk details out of speaker headers

Render transcript-wide speaker numbers instead of exposing upload chunks in
reader-facing headers. Reconcile adjacent requests using at least two
unambiguous word-and-time matches in their shared audio, including when
provider speaker IDs change between requests. Reject conflicting mappings
and never treat matching numeric provider IDs as identity evidence.

Assign fresh IDs where continuity cannot be established and report that
uncertainty on stderr. Number only speakers retained after overlap trimming.
Document that overlap matching cannot identify a returning speaker who was
absent from the overlap, and add the reader-facing boundary to AGENTS.md.

Test Plan:
- python3 -B -m unittest -v: all 46 tests passed, including swapped IDs,
  ambiguous evidence, continuity across three requests, and plain headers.
- git diff --cached --check: passed.
- Tests use synthetic speaker labels; live diarization accuracy was not
  verified because provider credentials are unavailable in this environment.
This commit is contained in:
ddidderr committed 2026-09-12 09:30:46 +02:00
1 parent 6e94379a25
commit 5dd1b5811b
7 files changed
+129 -32

No files matched your search

-3
View File
@@ -17,9 +17,6 @@ SENTENCE_END = re.compile(r'[.!?…]["\u201d\u2019\u0027)]*$')
def speaker_marker(speaker):
if speaker is None:
return "[Speaker unknown]"
if isinstance(speaker, tuple):
chunk, speaker = speaker
return f"[Chunk {chunk + 1}, Speaker {speaker}]"
return f"[Speaker {speaker}]"