Integrate crew speaker-ID pipeline #11
Loading…
Reference in a new issue
No description provided.
Delete branch "devel"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Integrates the crew speaker-ID pipeline (spec:
docs/specs/2026-09-02-crew-user-system-design.md). When enabled, every final transcription is tagged with the speaker's crew user id, resolved against the separate starfleet-crew service. When disabled (the default), behavior is unchanged.What's in
speaker: str | None = Noneon VADAudio / Transcription / GenerateResponseRequest / TranscriptionCompletedEvent (defaultNone→ fully backwards compatible)computer/userspackage:CrewClient— httpx client for the crew service (registry, health, close)UserRegistry— periodically-pulled user-vector snapshot with atomic swap, 3-state tagging (known / guest / stale), keep-stale on fetch failureSpeakerEmbedder— lazy FunASR CAM++ (192-dim)speaker_taghelpers (GUEST,format_user_turn)SpeakerIDHandler— pipeline handler resolving speakers in parallel with STTspeakerthreaded through the STT layer:output_for_queue+TranscriptionNotifier, including the speculative-revision paths2s_pipeline.py:--users_*CLI args, singleton init, handler insertionPOST /internal/users/enrollon the realtime service (Bearer token, raw PCM s16le 16 kHz mono, 192-dim vector, 401 / 422 / 503)server.sh.examplecommented--users_*block,scripts/smoke_speaker_id.pymanual CAM++ smoke script, README ops notesTest status
scripts/test_audio_path.py::test_live,scripts/test_live_speech.py::test_speech(fixture 'host' not found— live scripts needing a real server)Follow-ups (non-blocking; fail-safe while the feature is disabled, which is the default)
UserRegistry.start()does not self-heal from an initial crew outage (service restart required to recover) — fix before production enable.SpeakerIDHandler._pendingcan retain entries for finals that STT speculative filtering drops — no correctness impact; bound via SESSION_END cleanup or TTL.server.sh.exampleenable-workflow restructure: quote the<llm-host>placeholder before telling users to enable from the example.Verification
uv run pytest,ruff check,ruff format --check,mypyall pass.