Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Sources/Meeting/LocalMeetingSummarizer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down
41 changes: 41 additions & 0 deletions Tests/LocalMeetingSummarizerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down