feat(ai): namespace local voiceprints - #407
Open
abroa01 wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces an optional voiceprintNamespace that scopes on-device voiceprint persistence (WHO speaker centroids + WHAT wake phrase templates) so multiple users sharing the same browser profile don’t bleed enrollment into one another, while preserving legacy unscoped behavior.
Changes:
- Added a namespaced storage key helper and extended WHAT voiceprint load/save/clear to support optional namespaces (with legacy migration only for unscoped reads).
- Plumbed
voiceprintNamespacethrough HandsFreeChat → Hey Ozwell hooks/components → SpeakerVerify runtime, including namespace-aware hydration and readiness gating. - Added focused tests validating namespace isolation and legacy/unscoped behavior.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/components/AI/voiceprintStore.ts | Adds voiceprintStorageKey and updates WHAT voiceprint persistence APIs to be namespace-aware. |
| src/components/AI/voiceprintStore.test.ts | Adds tests for namespace isolation, selective clearing, and legacy unscoped behavior. |
| src/components/AI/HeyOzwell/VoiceSetup.tsx | Exposes voiceprintNamespace prop and forwards it into useVoiceSetup. |
| src/components/AI/HeyOzwell/VoiceManager.tsx | Exposes voiceprintNamespace, scopes speaker verify + WHAT clearing, and forwards into enrollment UI. |
| src/components/AI/HeyOzwell/useVoiceSetup.ts | Uses namespaced speaker verify and loads/saves WHAT prints per namespace. |
| src/components/AI/HeyOzwell/useHeyOzwell.ts | Loads WHAT prints by namespace and attempts to clear runtime templates on namespace changes. |
| src/components/AI/HeyOzwell/SpeakerVerify/useSpeakerVerify.ts | Adds namespace option, loads the namespace explicitly, and gates readiness on correct namespace hydration. |
| src/components/AI/HeyOzwell/SpeakerVerify/lib/speaker-verify.js | Implements namespace-aware WHO persistence via shared IndexedDB helpers and adds loadNamespace. |
| src/components/AI/HeyOzwell/HandsFreeChat.tsx | Exposes voiceprintNamespace and forwards it into useHeyOzwell and VoiceManager. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+18
to
+23
| export function voiceprintStorageKey(key: string, namespace?: string): string { | ||
| if (namespace === undefined) return key; | ||
| if (namespace.trim().length === 0) | ||
| throw new Error('Voiceprint namespace must not be empty'); | ||
| return `${key}:${encodeURIComponent(namespace)}`; | ||
| } |
Comment on lines
+601
to
605
| wakeRef.current?.setVoiceprint('hey-ozwell', []); | ||
| wakeRef.current?.setVoiceprint("ozwell-i'm-done", []); | ||
| void loadWhatPrints(voiceprintNamespace).then((loaded) => { | ||
| if (cancelled) return; | ||
| for (const k in loaded) wakeRef.current?.setVoiceprint(k, loaded[k]); |
Deploying ui with
|
| Latest commit: |
5b69382
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://3b498fa2.ui-6d0.pages.dev |
| Branch Preview URL: | https://feat-namespaced-voiceprints.ui-6d0.pages.dev |
garrity-miepub
self-requested a review
September 1, 2026 23:55
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
voiceprintNamespaceacross Hey Ozwell verification, enrollment, and voice managementSecurity
Voiceprints remain on-device in IndexedDB. The namespace separates local records; speaker verification remains a wake filter and is not an authentication mechanism.
Validation
pnpm typecheckpnpm lintpnpm format