Repository navigation
[exploration] Voice schema option: span points - #2617
Draft
kev (kevchoi) wants to merge 2 commits into
Draft
kev (kevchoi) wants to merge 2 commits into
kev (kevchoi) wants to merge 2 commits into
Conversation
Voice evidence is logged as points on the spans that observed it (user_turn, assistant_turn, llm_response, tool, call) instead of voice.timeline rows. Adds the zod contract, cascaded and realtime examples, and a test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
End the first cascaded user turn at its commit, state which points fall back to the call span, and correct citations and wording. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
This is an exploration draft: option 4 of the voice-trace schema options kept for review. It is not for merge. It is stacked on #2612 (call timeline), so the diff shows only what span points change.
Problem
Call timeline (#2612) gives one precise log for latency, overlap and missing evidence. But the log sits in
voice.timelinerows of its own, away from the turn, LLM and tool spans a customer browses. Two cases also stay implicit:Proposed contract
Integrations log #2612's events as points on the ordinary span that observed each one, in
metadata["voice.points"], a map keyed by the per-callseq:user_turnend_of_turnand the callermessageassistant_turntruncateand the agentmessagellm_responseresponse_starttool_call/tool_resultvoice.points_version: 1andcall_endllm_response(generation) ortts(synthesis).span_idfor generation and tools, and the toolname.speech_end.interrupted_bynames the caller utterance that cut the agent off.user_turnwith noend_of_turnmarks speech nothing answered.seqgaps across spans andcall_end.Main tradeoff
The evidence and answers are #2612's, and the raw trace shows speech on the turn spans again. What changes:
interrupted_byseparates barge-in from talk-over without a heuristic, and an unanswered turn is visible.user_turn/assistant_turnspans the LiveKit and Pipecat reference integrations already emit. Points fall back to the call span when an owner is missing.seqkey is its own JSON path, which needs a Brainstore owner's check.LiveKit 1.9.2 cascaded tool replies reuse the speech handle (
agent_activity.ts:4391-4421), sollm-1andllm-2both startspeech_1here. #2612's cascaded example gives the reply its own handle; #2612 is unchanged.Implemented vs sketched
Implemented:
js/src/instrumentation/livekit/voice-schema/span-points.ts, not exported);docs/voice-schema/span-points/examples/: 14 and 11 rows, 30 and 28 points). They have normal LLM and tool inputs and outputs, and a recording attachment with channel sources. The cascaded example adds a barge-in and a separate talk-over under a non-interruptible reply;seqacross spans, owners, one owner per utterance, start/end pairing,interrupted_by, and barge-in versus talk-over.Sketched in
docs/voice-schema/span-points/README.md:No instrumentation emits points yet.
Lingua mapping: implemented in the companion PR, [exploration] Voice schema option: span points (Lingua mapping) lingua#495.
Checks
pnpm exec vitest run src/instrumentation/livekit/voice-schema(injs/): 21 passed, 11 of them new.pnpm exec tsc --noEmit -p .: passed.pnpm exec eslintonspan-points.ts: passed. The test file is outside the lint config.prettier --checkon the new docs, examples and sources: passed.Companion PR: braintrustdata/lingua#495
🤖 Generated with Claude Code