diff --git a/Sources/Meeting/LocalMeetingSummarizer.swift b/Sources/Meeting/LocalMeetingSummarizer.swift index 06a6b8c0..1a01984d 100644 --- a/Sources/Meeting/LocalMeetingSummarizer.swift +++ b/Sources/Meeting/LocalMeetingSummarizer.swift @@ -35,6 +35,10 @@ struct LocalMeetingSummarySections: Equatable, Sendable { accuracyNotes: accuracyNotes ) } + + func withTranscriptParticipants(from transcript: String) -> LocalMeetingSummarySections { + withParticipants(LocalMeetingSummaryParticipantExtractor.participants(from: transcript)) + } } enum LocalMeetingSummaryError: LocalizedError, Equatable { @@ -1039,9 +1043,8 @@ struct LocalMeetingSummarizer: @unchecked Sendable { try Task.checkCancellation() let normalizedBody = LocalMeetingSummaryNormalizer.normalized(summaryBody) - let participants = LocalMeetingSummaryParticipantExtractor.participants(from: transcript) let sections = LocalMeetingSummaryNormalizer.sections(in: normalizedBody) - .withParticipants(participants) + .withTranscriptParticipants(from: transcript) let latestMarkdown = try String(contentsOf: transcriptURL, encoding: .utf8) let latestTranscript = LocalMeetingTranscriptExtractor.transcriptText(from: latestMarkdown) guard latestTranscript == transcript else { @@ -1151,6 +1154,7 @@ struct AppleFoundationMeetingSummarizer: @unchecked Sendable { try Task.checkCancellation() let normalizedBody = LocalMeetingSummaryNormalizer.normalized(summaryBody) let sections = LocalMeetingSummaryNormalizer.sections(in: normalizedBody) + .withTranscriptParticipants(from: transcript) let latestMarkdown = try String(contentsOf: transcriptURL, encoding: .utf8) let latestTranscript = LocalMeetingTranscriptExtractor.transcriptText(from: latestMarkdown) guard latestTranscript == transcript else { diff --git a/Tests/LocalMeetingSummarizerTests.swift b/Tests/LocalMeetingSummarizerTests.swift index 927870c3..40941f49 100644 --- a/Tests/LocalMeetingSummarizerTests.swift +++ b/Tests/LocalMeetingSummarizerTests.swift @@ -317,6 +317,47 @@ func testLocalMeetingSummarizer() async { ) } + runSuite("LocalMeetingSummarySections uses transcript participants for every provider") { + let transcript = """ + **00:01** [Mic/Justin] + Justin opened the meeting. + + **00:04** [System/Maya] + Maya joined from Zoom. + """ + let sections = LocalMeetingSummaryNormalizer.sections(in: """ + # Title + Launch Review + + # Participants + None found. + + # Summary + Team reviewed launch work. + + # Decisions + None found. + + # Action Items + None found. + + # Open Questions + None found. + + # Risks or Follow-ups + None found. + + # Accuracy Notes + None found. + """).withTranscriptParticipants(from: transcript) + + assertEqual( + sections.participants, + "- Justin\n- Maya", + "summary providers should write canonical participants from transcript speaker labels" + ) + } + runSuite("LocalMeetingSummaryNormalizer extracts generated titles") { let normalized = LocalMeetingSummaryNormalizer.normalized(""" # Title