Reject incomplete speakers at construction #129

Merged
mike merged 4 commits from mike-bot/speaker-init into master 2026-11-23 16:07:01 -05:00 AGit
Collaborator

NewSpeaker(id, name) requires a defined SpeakerID and a non-empty SpeakerName. Callers read those values through ID() and Name(), and use IsInitialized() to distinguish a valid speaker from the zero value. Speaker ID 0 remains valid. Transcripts reject uninitialized speakers.

Speaker fixtures use testutil.MustCreate2, a generic test helper for two-argument constructors.

`NewSpeaker(id, name)` requires a defined `SpeakerID` and a non-empty `SpeakerName`. Callers read those values through `ID()` and `Name()`, and use `IsInitialized()` to distinguish a valid speaker from the zero value. Speaker ID `0` remains valid. Transcripts reject uninitialized speakers. Speaker fixtures use `testutil.MustCreate2`, a generic test helper for two-argument constructors.
Reject incomplete speakers at construction
All checks were successful
ci/crow/pr/build Pipeline was successful
1491bf8e16
Previously, callers could build a speaker without an ID or a name. The transcript constructor rejected those values only after callers assembled a transcript.

Now callers use NewSpeaker with a defined ID and a non-empty name, and read those values through accessors. Transcripts reject zero-value speakers, while speaker ID 0 remains valid and distinct from an unassigned speaker.

AI-Model: openai/gpt-6.2-sol-fast
AI-Model: openai/gpt-6-luna-fast
mike-bot changed title from Reject incomplete speakers at construction to WIP: Reject incomplete speakers at construction 2026-11-23 15:58:56 -05:00
Make the WebVTT speaker fixtures easier to read
All checks were successful
ci/crow/pr/build Pipeline was successful
c71b4c506e
AI-Model: openai/gpt-6.2-sol-fast
mike-bot changed title from WIP: Reject incomplete speakers at construction to Reject incomplete speakers at construction 2026-11-23 16:01:01 -05:00
Callers pass a typed ID and name to NewSpeaker without wrapping them in SpeakerParams. Validation and zero-value behavior stay the same.

AI-Model: openai/gpt-6.2-sol-fast
AI-Model: openai/gpt-6-luna-fast
Build speaker fixtures with a reusable two-argument helper
All checks were successful
ci/crow/pr/build Pipeline was successful
a249c3e2f4
Tests can use MustCreate2 for any two-argument constructor rather than defining a separate helper for each fixture type. This follows the multi-parameter example at https://mtlynch.io/notes/go-must-create-pattern/

AI-Model: openai/gpt-6.2-sol-fast
AI-Model: openai/gpt-6-luna-fast
mike merged commit 77010c7b25 into master 2026-11-23 16:07:01 -05:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
oe/transcripts!129
No description provided.