Skip to content

feat(app): expose experimental diarization tuning in Settings (#165 phase 5)#180

Open
pasrom wants to merge 2 commits into
mainfrom
worktree-agent-ab63bc5d4c79200dc
Open

feat(app): expose experimental diarization tuning in Settings (#165 phase 5)#180
pasrom wants to merge 2 commits into
mainfrom
worktree-agent-ab63bc5d4c79200dc

Conversation

@pasrom
Copy link
Copy Markdown
Owner

@pasrom pasrom commented May 7, 2026

Summary

  • Adds an "Experimental: Diarization Tuning" DisclosureGroup in Settings → Speakers, exposing 5 OfflineDiarizerConfig knobs (clusterThreshold, warmStartFa, warmStartFb, minSegmentDurationSeconds, excludeOverlap).
  • Red warning banner + Reset to defaults button to mitigate footgun: warm-start values are research-tuned and changing them blindly degrades quality. A small orange dot next to the disclosure label keeps a non-default state visible even when the group is collapsed.
  • New OfflineDiarizerTuning struct decouples FluidOfflineProcessor from AppSettings/UserDefaults so the plumbing is unit-testable.

Implements phase 5 of #165 (Variant C: power-user, with safety rails).

Choices worth flagging

  • The disclosure renders only when diarizerMode == .offline. The 5 knobs are all on the offline pipeline; surfacing them while Sortformer is active would be misleading since they have no effect.
  • Reset button uses settings.diarizerTuningIsAllDefaults (a computed Bool) for its disabled state. The same flag drives the orange "non-default" dot.

Test plan

  • AppSettings round-trip + reset tests (new testDiarizerTuningDefaults, testDiarizerTuningRoundTrip, testResetDiarizerTuningRestoresDefaults).
  • OfflineDiarizerTuning.defaults matches FluidAudio's Clustering.community / Embedding.community exactly (testTuningStructDefaults).
  • OfflineDiarizerTuning.apply(to:) and FluidOfflineProcessor.makeConfig produce expected configs without disturbing other knobs.
  • DisclosureGroup collapsed by default; Reset button disabled when at defaults / enabled when changed; section hidden for Sortformer.
  • swift test green outside the pre-existing flaky MenuBarIconSnapshotTests (also failing on stashed main).
  • ./scripts/lint.sh clean.

View in Codesmith
Need help on this PR? Tag @codesmith with what you need.

  • Let Codesmith autofix CI failures and bot reviews

pasrom and others added 2 commits May 7, 2026 07:43
Adds 5 new persisted settings (clusterThreshold, warmStartFa, warmStartFb,
minSegmentDurationSeconds, excludeOverlap) backed by UserDefaults. Defaults
mirror FluidAudio's `Clustering.community` and `Embedding.community`.

Introduces a small `OfflineDiarizerTuning` value type so `FluidOfflineProcessor`
can be configured without depending on AppSettings or UserDefaults — keeping
the diarizer plumbing unit-testable. AppState wires settings into the
diarizer factory; resetDiarizerTuning() restores all 5 to defaults in one
call and is the source of truth shared with the upcoming Settings UI.

Implements phase 5 of #165 (variant C: power-user knobs).

Co-authored-by: pasrom <[email protected]>
Adds a collapsed-by-default DisclosureGroup at the bottom of the Diarization
section that exposes the 5 OfflineDiarizerConfig tunables behind a red
warning banner: cluster threshold, warm-start Fa/Fb, min segment duration,
exclude overlap. Each control has an inline help icon with a short tooltip
explaining its effect.

Includes a "Reset to defaults" button (disabled while settings already match
defaults) and a small orange dot next to the disclosure label whenever the
user is in non-default territory, so the deviation stays visible even when
the disclosure is collapsed. Hidden in Sortformer mode since those knobs
only apply to the offline diarizer.

Co-authored-by: pasrom <[email protected]>
@github-actions github-actions Bot added the enhancement New feature or request label May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant