Skip to content

Backport v2-dev improvements to v1#647

Merged
dharmab merged 10 commits intomainfrom
backport/v2-improvements
Mar 20, 2026
Merged

Backport v2-dev improvements to v1#647
dharmab merged 10 commits intomainfrom
backport/v2-improvements

Conversation

@dharmab
Copy link
Owner

@dharmab dharmab commented Mar 20, 2026

Summary

Backports non-breaking improvements from the v2-dev branch to main. The v2 model changes (Parakeet STT, Pocket TTS) are excluded since they have quality issues; only bug fixes, code quality improvements, and feature enhancements are included.

Changes

  • Tooling: Update Go directive to 1.26.0, golangci-lint to v2.11.3
  • Lint fixes: Preallocate slices, remove deprecated HasAnyTag()
  • Wideband constant: Extract 16kHz sample rate to pkg/pcm/rate.Wideband
  • numwords fork: Switch to dharmab/numwords with configurable fraction/article/second parsing
  • Callsign parsing: Add digit homophones (won→1, to→2, free→3, for→4, ate→8, niner→9), ordinal stripping (1st→1), STT stutter deduplication (eagle eagle→eagle), ~40 new bogey dope garble entries
  • Trackfile fix: Fix heading double-conversion bug in Course() + comprehensive test suite
  • Radar improvement: Interpolate group track from all contacts using circular mean instead of first contact only; report unknown track when contacts diverge >90 degrees
  • SRS protocol: Nil-safe Client field in Message type, copy-by-value fix in newMessage()

Not included from v2-dev

  • Parakeet/Pocket model changes
  • Model download infrastructure
  • CLI/config interface changes
  • Whisper/Piper/macOS TTS removal
  • minRxDuration reduction (still needed at 1s for Whisper)

Test plan

  • make lint - 0 issues
  • make vet - passes
  • make test - 942 tests pass
  • go mod tidy && git diff --exit-code - clean

🤖 Generated with Claude Code

dharmab and others added 9 commits March 20, 2026 00:13
Update go directive from 1.26 to 1.26.0 and upgrade golangci-lint
from v2.7.1 to v2.11.3 along with its transitive dependencies.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Preallocate slices with known capacity in Tags(), variants(),
sa342Variants(), F32toS16LE(), S16LEToF32LE(), Frequencies(),
Stacks(), and broadcastSunrise(). Remove unused HasAnyTag method.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move the 16kHz wideband sample rate to pkg/pcm/rate.Wideband for
reuse across the codebase instead of duplicating in simpleradio.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The fork adds configuration options to disable fractions, indefinite
articles, and "second" parsing that caused false positives in
aviation brevity parsing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…w garble entries

Add digit homophone handling (won→1, to/too→2, free/tree→3, for/fore→4,
ate→8, niner→9), ordinal suffix stripping (1st→1, 2nd→2), and
consecutive word deduplication for STT stutter (eagle eagle→eagle).
Add ~40 new bogey dope garble replacements observed from Parakeet STT.
Add test cases for Ford 1-1 callsign across all command types.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The Course() method was double-converting the Heading field: it cast
the unit.Angle value to unit.Angle then multiplied by unit.Degree,
producing incorrect bearing values. Now passes Heading directly to
NewTrueBearing.

Add comprehensive trackfile tests covering New, LastKnown, Update,
Course, Direction, Speed, Bullseye, String, and concurrent access.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace the single-contact track direction with a circular mean of
all contacts' courses. When contacts are tracking in directions
spread more than 90 degrees apart, the track is reported as unknown
rather than misleadingly reporting one contact's direction.

Extract CallsignSimilarityThreshold constant for fuzzy matching.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Change Message.Client from ClientInfo to *ClientInfo with omitempty
to correctly handle messages where Client may be absent. Add nil
checks in message handlers to prevent panics. Fix copy-by-value in
newMessage to avoid unintended mutations.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
func sa342Variants() []Aircraft {
vars := []Aircraft{}
vars := make([]Aircraft, 0, 4)
for _, variant := range []string{"L", "M", "Minigun", "Mistral"} {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should factor out the variants list to a var and then use len()

// HasAnyTag returns true if the aircraft has any of the specified tags.
//
// Deprecated: Use slices.Contains instead.
func (a Aircraft) HasAnyTag(tags ...AircraftTag) bool {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't remove public functions within v1

// deduplicateConsecutiveWords removes consecutive duplicate words,
// e.g. "eagle eagle 2 7" → "eagle 2 7". This handles STT stutter
// where words are repeated.
func deduplicateConsecutiveWords(tx string) string {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this isn't an issue with whisper and can be removed for now

- Restore deprecated HasAnyTag (don't remove public APIs in v1)
- Factor sa342 variant names to a local var and use len() for prealloc
- Remove deduplicateConsecutiveWords (not needed for Whisper STT)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dharmab dharmab enabled auto-merge (squash) March 20, 2026 06:37
@dharmab dharmab merged commit 2e97fb8 into main Mar 20, 2026
11 checks passed
@dharmab dharmab deleted the backport/v2-improvements branch March 20, 2026 06:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant