"""Speaker-name identification (ยง4.5 enhancement). In a 1-on-1 interview the host introduces the guest by name at the top. Reading the transcript head with the LLM, we attach a real NAME to each diarized speaker โ†’ voiceprints.person_label. This gives the independence graph a SECOND, orthogonal overlap signal: the same NAMED guest across two shows is a shared_guest edge even when the voiceprints don't cluster (different mic/codec/room). It complements voiceprint cosine matching and is robust to fingerprint drift โ€” exactly the case the operator flagged. """ from __future__ import annotations import json import logging log = logging.getLogger(__name__) _SYS = ( 'You identify the speakers in a podcast/interview transcript. Each line is "LABEL: text". ' "Using the introduction and context, determine each LABEL's real full name and role. In an " "interview the host normally introduces themselves and the guest within the first minute. Only " "assert a name you can actually support from the text โ€” if you cannot tell, use null. " 'Return ONLY JSON: {"speakers": {"