feat(voice): add in-tree lifecycle hooks#5552
Draft
MADPANDA3D wants to merge 1 commit into
Draft
Conversation
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
Adds a small core-owned browser contract for in-tree voice experiments: a hidden app-owned mount, bounded versioned lifecycle signals for capture/chat/TTS, and a fixed same-origin module map for the existing recorder and TTS modules. This does not add a Voice Orb UI, runtime discovery, arbitrary script loading, a plugin wheel, or an external compatibility promise.
Target branch
dev, notmain.Linked Issue
Part of #5549. Related to #4118 and the direction discussion #4439.
Type of Change
Checklist
dev.How to Test
node tests/voice_lifecycle.test.mjs. It exercises fail-closed payload validation, the fixed module allowlist, recorder-unavailable signaling, and TTS start/idle signaling.python -m pytest -q tests/test_voice_lifecycle_hooks.py tests/test_app_static_mime.py.uvicorn app:app, load/, and import/static/js/voiceLifecycle.jsfrom DevTools. ConfirmgetVoiceSurfaceRoot()returns the hidden app-owned root,listVoiceStaticModules()returns onlyrecorderandtts, and an emitted event has the frozen v1 payload.Local validation also ran
node --checkon every changed JavaScript module,git diff --check, direct HTTP readback of the app shell/module, and a headless Chromium page load with no page errors. The full Python suite produced 4,618 passes, 4 skips, and four failures; an untouchedc80462eworktree reproduced the exact same four failures with 4,615 passes. Three failures are caused by the reused virtualenv path containing spaces, and one is the existing order-sensitivesrc.agent_tools.admin_toolsimport-state failure.Visual / UI changes
The only HTML change is an empty
hiddenmount witharia-hidden="true"; it has no visible rendering, CSS, spacing, mobile, or interaction change. Headless Chromium confirmed the root remained hidden and the page raised no JavaScript errors.