Repository navigation
Description
Context
runSpeechProviderContract (packages/ui-sdk/src/testing/speech-contract.ts:49-59) always registers a provider declaring SMART transcription mints a serializable session for each mode. For a provider whose capabilities.smartTranscription is not true, the case returns at line 52 before any assertion, so it reports a pass that proves nothing.
Test-health run th-20261110163814-571eb3 (cluster 3) measured this: in packages/ui-server/tests/external-speech.test.ts the case SpeechProvider contract: external keyless provider > a provider declaring SMART transcription mints a serializable session for each mode passed in 10 of 10 runs with zero assertions executed. Every consumer whose provider is not SMART gets the same empty pass (packages/ui-server/tests/speech-provider-conformance.test.ts:5, :31, and any third-party provider using the public @schlessera/brain-ui-sdk/testing kit).
Cited at main b77987afb.
Scope
- Make the SMART case either assert something for every provider or not be registered as a passing case for a provider that does not declare SMART transcription. One acceptable shape: for a non-SMART provider, assert that
createSessionwithout amodestill mints a serializable session, or that the declared capability is exactlyfalse/absent. Another: register the case only when the probe's provider declares SMART, keeping the case name stable for SMART providers.
Note on the second shape: runSpeechProviderContract registers its cases inside describe, before any probe exists. Reading the capability at registration time means calling harness.create() during collection, and some probes install a fetch spy when created (deepgramProbe, packages/ui-server/tests/speech-provider-conformance.test.ts:11-30). A collection-time probe must be disposed before any case runs. The first shape avoids this.
Out of scope
- No change to any speech provider, the session route or the
SpeechProvidertype. - No change to the other contract cases.
- No skip, todo or conditional test registration that hides a case from a SMART provider.
Acceptance criteria
- For a non-SMART provider, the contract run contains no case that passes with zero assertions (check with
bun scripts/test-health.ts measure packages/ui-server/tests/external-speech.test.ts:zeroAssertionCasesis empty). - For a SMART provider (the Gemini probe in
packages/ui-server/tests/gemini-speech.test.ts:62; Gemini declaressmartTranscription: trueatpackages/ui-server/src/voice/gemini-speech.ts:92), the SMART case still runs both modes, and a mutation that breaks one mode's session fails it. - The public testing export keeps its signature.
Verification
bun run test ./packages/ui-server/tests/external-speech.test.ts ./packages/ui-server/tests/gemini-speech.test.ts ./packages/ui-server/tests/speech-provider-conformance.test.ts, plus the measure command above, plus a mutation receipt.
Contract impact
None expected. A @schlessera/brain-ui-sdk changeset is needed, because the public testing kit's behaviour changes for consumers: @schlessera/brain-ui-sdk/testing keeps its exported function and options. If the case list a consumer sees changes, say so in the changeset.
Activity
schlessera commentedon Nov 10, 2026
Triage, 2026-11-10, at
main91e54be37: citations checked. Gemini declares SMART (gemini-speech.ts:92), so the SMART acceptance criterion now applies without condition. Added a note on the second shape: reading the capability at registration time means creating a probe during collection. The contract section now asks for a@schlessera/brain-ui-sdkchangeset. Attached to #2963, which covers weak or misleading oracles. Priority p2, ready.