Skip to content

Add stream type constant stability tests #8

@lanycrost

Description

@lanycrost

Problem statement

transport/stream_types.go defines 16 stream type string constants used across the ecosystem. This file has zero test coverage. While constants themselves can't have bugs, accidental value changes would silently break all consumers.

Proposed change

Add transport/stream_types_test.go with a contract stability test:

func TestStreamTypeConstants_ValuesAreStable(t *testing.T) {
    // These values are part of the wire contract.
    // Changing them requires a coordinated migration.
    tests := map[string]string{
        "StreamTypeSpeechTranscript":  "speech.transcript.v1",
        "StreamTypeSpeechTranslation": "speech.translation.v1",
        // ... all 16 constants
    }
    for name, expected := range tests {
        // use reflect or direct comparison
    }
}

func TestStreamTypeConstants_FollowNamingConvention(t *testing.T) {
    // All values should match pattern: category.type.version
}

This acts as a regression guard — any accidental rename or value change will fail CI.

Affected area

  • Transport stream types

Compatibility / migration

Test-only. No behavior change.

Additional context

These constants are consumed by bubu-sdk-go, bobravoz-grpc, and potentially future Python/TypeScript SDKs. A value change without coordination would silently break packet routing. Identified during QA review.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/transportBobravoz gRPC transport changes.good first issueSmall, well-scoped tasks for new contributors.help wantedLooking for community contributions.kind/testsTesting, CI, or verification-only changes.priority/lowNice-to-have or backlog item.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions