Skip to content

ui-sdk: the speech contract's SMART case passes with no assertion for a non-SMART provider #3885

Open

Description

@schlessera

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 createSession without a mode still mints a serializable session, or that the declared capability is exactly false/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 SpeechProvider type.
  • 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: zeroAssertionCases is empty).
  • For a SMART provider (the Gemini probe in packages/ui-server/tests/gemini-speech.test.ts:62; Gemini declares smartTranscription: true at packages/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

  1. added
    type: testCoverage, harness or proof work with no behaviour change.
    area: ui-sdkWire protocol, runtime schemas, the server and client SDK surfaces.
    on Nov 10, 2026
  2. schlessera commented on Nov 10, 2026

    @schlessera
    OwnerAuthor

    Triage, 2026-11-10, at main 91e54be37: 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-sdk changeset. Attached to #2963, which covers weak or misleading oracles. Priority p2, ready.

  3. added
    priority: p2Wanted, not scheduled. Pulled in when a milestone has room.
    agent-readyContext and acceptance criteria are complete enough for an agent to take this unattended.
    on Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readyContext and acceptance criteria are complete enough for an agent to take this unattended.area: ui-sdkWire protocol, runtime schemas, the server and client SDK surfaces.priority: p2Wanted, not scheduled. Pulled in when a milestone has room.type: testCoverage, harness or proof work with no behaviour change.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions