Skip to content

feat(ambient): Tier-1 capture-quality gate (drop far-field blips / hallucinated-language) - #43

Merged
WingedGuardian merged 1 commit into
mainfrom
feat/ambient-capture-gate
Jul 26, 2026
Merged

feat(ambient): Tier-1 capture-quality gate (drop far-field blips / hallucinated-language)#43
WingedGuardian merged 1 commit into
mainfrom
feat/ambient-capture-gate

Conversation

@WingedGuardian

@WingedGuardian WingedGuardian commented Jul 26, 2026

Copy link
Copy Markdown
Owner

Summary

A 5-day soak of a live SenseVoice ambient capture (~6k rows) showed ~30% of stored rows are far-field garbage: sub-second blips that SenseVoice hallucinates CJK text on, and absent languages (tags for languages measured absent at the deploy site) invented on noise/silence. This adds an opt-in Tier-1 capture gate that drops those before they become rows, so every downstream stage (and the future ambient-memory nursery) works on cleaner input.

Change

  • config.py — three knobs, all defaulting to a no-op so existing installs are byte-for-byte unaffected; a multilingual/far-field edge opts in via a systemd drop-in:
    • AMBIENT_MIN_UTTERANCE_S — duration floor (real speech is ~4s, garbage ~0.7s).
    • AMBIENT_ASR_DROP_LANGS — a deny-list of language tags measured absent at the deploy site (their appearance ⇒ SenseVoice hallucinated). Deliberately not an allow-list, which would false-drop real speech mis-tagged as a neighbouring language.
    • AMBIENT_DROP_BGM — drop rows SenseVoice tags as background music (see caveat below).
  • pipeline.py — a pure, unit-testable _passes_capture_gate() called in _process_sync right after the ASR / empty-text skip. Placement is diarization-safe: it mirrors the existing if not text: continue, before the diar-window bookkeeping.
  • Docs + 7 tests (gate truth table + knob parsing).

Why the deny-list, and why DROP_BGM ships OFF here

Measured on the real rows: of 1,275 rows tagged with absent-or-neighbouring languages only 31 were long+substantial; the truly-absent-language tags are all hallucinated garbage, but several rows tagged as a neighbouring dialect are real primary-language speech mis-tagged — so an allow-list would delete real speech. And an offline replay of the gate over the full soak set found DROP_BGM=1 false-dropping ~30 real speech-with-background rows (far-field speech over TV/music gets an event=BGM tag). So the deny-list is scoped to the truly-absent tags only, and DROP_BGM stays off on far-field installs (knob retained + documented for installs with cleanly-separated music).

Testing

  • Full ambient suite green (169 tests) incl. 7 new; ruff clean.
  • Offline E2E replaying the actual gate over ~6k real capture rows at the intended edge settings (min=1.0s, drop_langs=<absent-tags>, drop_bgm=0): 28% dropped, all genuine garbage, zero false-drops of real speech; every real-language row retained.

Deploy

No-op for existing installs (defaults). A far-field edge sets AMBIENT_MIN_UTTERANCE_S=1.0, AMBIENT_ASR_DROP_LANGS to the site's measured-absent tags, AMBIENT_DROP_BGM=0 via a drop-in and restarts the ambient bridge.

🤖 Generated with Claude Code

…ucinated-lang)

Soak analysis of live SenseVoice capture (5 days, ~6k rows) showed ~30% is
far-field garbage: sub-second blips SenseVoice hallucinates CJK on, and absent
languages (ja/ko in a Mandarin+English house) invented on noise. Add an opt-in
Tier-1 gate that drops these before they become rows.

- config: min_utterance_s (blip floor), asr_drop_langs (DENY-list of KNOWN-ABSENT
  languages — never an allow-list, which false-drops mis-tagged real speech like
  Mandarin tagged "yue"), drop_bgm. All default to no-op → existing installs
  unchanged; the edge opts in via drop-in.
- pipeline: pure _passes_capture_gate() called after the ASR/empty-text skip in
  _process_sync (diar-safe — mirrors the existing `if not text: continue`).
- 7 tests (gate truth table + knob parsing); README documents the knobs.

Offline E2E over the real soak rows (min=1.0s, drop_langs=ja,ko, drop_bgm=0):
28% dropped, all genuine garbage, ZERO false-drops of real speech. drop_bgm stays
OFF here — SenseVoice mis-tags far-field speech-over-background as BGM.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@WingedGuardian
WingedGuardian merged commit c096fd8 into main Jul 26, 2026
4 checks passed
@WingedGuardian
WingedGuardian deleted the feat/ambient-capture-gate branch July 26, 2026 06:03
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