feat(media): async diarization pipeline with speaker naming (D1-D4) - #1
Open
Cyb3rb1ade wants to merge 2 commits into
Open
feat(media): async diarization pipeline with speaker naming (D1-D4)#1Cyb3rb1ade wants to merge 2 commits into
Cyb3rb1ade wants to merge 2 commits into
Conversation
added 2 commits
June 23, 2026 00:52
- D1 SpeakerSegment schema / Discord attribution - D2 async batch diarization queue/cache/fallback - D3 ASR/Diarization merge with separate merge_results cache - targetRef/mediaOutputId idempotent enrichment - no D4 naming/enrollment/voiceprints - tests passed
- Add speaker_mappings table + mapping API in diarization DB - formatSpeakerSegments uses speakerDisplayName when confirmed - Embed mediaOutputId as hidden token in formatted transcripts - Add mapping.test.ts and update format.test.ts - No biometric identification / no enrollment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implement phases D1–D4 of the universal audio speaker attribution / diarization pipeline.
D1 — SpeakerSegment Schema / Discord Attribution
SpeakerSegmenttype with source, speakerLabel, speakerDisplayName, timestamps, attributionSource, diarizationModel, asrModel.discord:<userId>segments withattributionSource: "discord_user_stream".D2 — Batch / Non-Realtime Diarization
AudioDiarizationConfigand SQLite-backed job queue/cache.applyMediaUnderstanding: attaches a fallback segment and enqueues an async job.none,mock,sortformerstub.D3 — ASR/Diarization Merge
merge_resultscache keyed by audioHash + diarization provider/model/version + asrModel + asrTextHash + asrWordsHash + mergeConfigVersion.AudioDiarizationJobcarriestargetRef(source, sourceId, mediaOutputId, transcriptId, conversationId, messageId) and ASR text/words.mediaOutputId; a D2 job stayscompletedeven if D3 merge fails.D4 — Speaker Naming / Manual Mapping / Contextual Proposals
speaker_mappingstable with manual / contextual_proposal / enrollment (reserved) sources.formatSpeakerSegmentsrendersspeakerDisplayNamewhen a confirmed mapping exists.mediaOutputIdtoken in formatted transcripts so PLUR1BUS can correlate.speaker-mapping-storebridges OpenClaw's diarization SQLite DB.speaker-proposersuggests names from direct address (German/English) and keeps proposals unconfirmed./speakerchat commands:list,name <label> <name>,proposals,confirm <label>,reject <label>,clear <label>.mediaOutputIdtokens and persists new proposals.Test Coverage
src/media-understanding/diarization/db.test.tssrc/media-understanding/diarization/diarization.test.tssrc/media-understanding/diarization/mapping.test.tssrc/media-understanding/apply.test.tspackages/media-understanding-common/src/format.test.tsextensions/discord/src/voice/prompt.test.tstests/speaker-segment-schema.test.js,tests/speaker-mapping-store.test.js,tests/speaker-proposer.test.js,tests/speaker-mapping-commands.test.jsVerification
npm test: 1889 passed / 0 failed / 1 skippedWhat is NOT included
pnpm typecheckis not defined in this repo; type safety is covered by Vitest runs.