Skip to content

Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.

docs(wake): document the transcript-content ghost-filter trap (AP-27 / BUG-037)

Ruben Lütkeb8edc97e055c
diff --git a/AGENTS.md b/AGENTS.md
index 9a0eb08929..9c85b5ddf7 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -148,7 +148,7 @@ Four tiers: `safe` / `monitor` / `ask` / `block`, priority **blacklist > whiteli
| AP-24 | Call a shared native inference engine (ctranslate2 / faster-whisper, an ONNX / torch session) concurrently from two callers, OR "recover" a hung inference with only a timeout that re-polls the SAME wedged engine | `WhisperModel.transcribe` is NOT thread-safe: the wake poll loop + the VAD probe sharing one provider hung it forever; a hung `to_thread` can't be cancelled, so a timeout only BOUNDS, never RECOVERS. Fix: a non-blocking per-instance inference lock (2nd call → skip) + a `recover()` that rebuilds a FRESH model after N failures (BUG-036) |
| AP-25 | Run the always-on wake/keyword Whisper on the **GPU** via CTranslate2/faster-whisper, or auto-upgrade a custom-phrase (`stt_match`) wake to `large-v3-turbo/cuda` | On the maintainer's NVIDIA Blackwell GPU (RTX 5070 Ti / sm_120) CTranslate2 `model.transcribe` **HANGS on every inference** (8 s timeout → self-heal drops+rebuilds the model → the cold rebuild hangs again → a vicious cycle that leaves the wake **permanently DEAF**). The same hang also appears on `base`/`cpu` when ctranslate2's auto thread-pool deadlocks against PyTorch's OpenMP in the shared process. Keep the wake on `base`/`cpu` with a FIXED `cpu_threads` (bounds ctranslate2 vs torch); `[stt].wake_high_accuracy` GPU turbo is **OFF by default** and opt-in ONLY on a GPU verified not to hang. Truly instant+accurate custom-word wake needs a trained neural KWS model (openWakeWord `custom_onnx`), NOT transcription (2026-06-30 live-log forensic; see `docs/local-wakeword/WAKE-RELIABILITY-DEEPDIVE.md`) |
| AP-26 | Put a new feature's init/import on the startup critical path (before `APP_INTERACTIVE` / `VOICE_USABLE`) — a synchronous load in `_run_backend`, the `WebServer` ctor, `_start_speech_and_orb`, or a module-level heavy import | Boot creep: every feature "only adds a second" until the app takes 30+ s to become usable (TTU forensic 2026-07-02: one wake change put a 114.7 s load cascade on boot). New subsystems hook into `_heavy_backend_bg`, a deferred registry scan, or a post-ready task; heavy imports stay lazy or get a `warmup_prefetch` daemon thread; routes answer a graceful 503/None while their subsystem warms. **Enforced fail-closed by the pre-push BOOT BUDGET gate** (`scripts/ci/check_boot_budget.py`: one real cold boot; window ≤ 8 s, voice-usable + app-interactive ≤ 20 s). Doctrine + how-to: `docs/diagnostics/BOOT-TTU-NOTES.md` |
-| AP-27 | Suppress `stt_match` wake ghosts by tightening TRANSCRIPT CONTENT — require the bias-echo confirm's unbiased pass to reproduce the wake word, raise the phrase-matcher strictness on the confirm, or add any second content check that must contain the phrase | Kills recognition ENTIRELY, so "fires on silence" flips into "never fires". A bias-primed local Whisper (`initial_prompt=<phrase>`, needed for proper-noun recall) HALLUCINATES the phrase on silence AND GARBLES it on real speech (`'Mythos'`→`'Mütos'`/`'Hey, Mut!'`, `'Fable'`→`'Farbe'`); the unprimed base model literally cannot spell a hard custom wake — that is the whole reason the bias exists — so NO transcript-content rule separates ghost from wake without rejecting every genuine wake (live 2026-07-02: an unbiased-corroboration check made the wake "stop working at all"). The ONLY word-agnostic discriminator is raw audio ENERGY. Fix: suppress silence at the match site with the RMS gate (`RollingWhisperWake._match_min_rms`, ghost cluster ≤ 0.0043 vs quiet-mic recall 0.009); keep the bias-echo confirm PERMISSIVE ("heard any real speech → genuine", fail-open) and SKIP it on a clearly-loud window (`_ECHO_CONFIRM_SKIP_RMS`, latency). Recall guard: `tests/unit/speech/test_rolling_whisper_wake_silence_ghost.py::test_loud_wake_fires_even_when_unbiased_pass_garbles_the_hard_word` |
+| AP-27 | Suppress `stt_match` wake ghosts by tightening TRANSCRIPT CONTENT — require the bias-echo confirm's unbiased pass to reproduce the wake word, raise the phrase-matcher strictness on the confirm, or add any second content check that must contain the phrase | Kills recognition ENTIRELY, so "fires on silence" flips into "never fires". A bias-primed local Whisper (`initial_prompt=<phrase>`, needed for proper-noun recall) HALLUCINATES the phrase on silence AND GARBLES it on real speech (`'Mythos'`→`'Mütos'`/`'Hey, Mut!'`, `'Fable'`→`'Farbe'`); the unprimed base model literally cannot spell a hard custom wake — that is the whole reason the bias exists — so NO transcript-content rule separates ghost from wake without rejecting every genuine wake (live 2026-07-02: an unbiased-corroboration check made the wake "stop working at all"). The ONLY word-agnostic discriminator is raw audio ENERGY. Fix: suppress silence at the match site with the RMS gate (`RollingWhisperWake._match_min_rms`, ghost cluster ≤ 0.0043 vs quiet-mic recall 0.009); keep the bias-echo confirm PERMISSIVE ("heard any real speech → genuine", fail-open) and SKIP it on a clearly-loud window (`_ECHO_CONFIRM_SKIP_RMS`, latency). Recall guard: `tests/unit/speech/test_rolling_whisper_wake_silence_ghost.py::test_loud_wake_fires_even_when_unbiased_pass_garbles_the_hard_word` | <!-- i18n-allow: forensic quotes of the German STT-garble tokens under test -->
---
@@ -164,7 +164,7 @@ Detail in [`docs/BUGS.md`](docs/BUGS.md). Recognize the signal, apply the defens
6. **Watchdog stale cross-unit counter** (BUG-032): a stall watchdog reads a process-global counter never reset per unit → fires spuriously between units. Defense: reset the counter at unit start; re-arm the "not started" guard per unit.
7. **Loop on an unexpected teardown error** (AP-20): a socket loop `continue`s on a non-`WebSocketDisconnect` error → spins on a dead socket. Defense: treat any read error as terminal — `break`.
8. **Wedged un-cancellable native inference** (BUG-036): a shared ctranslate2/faster-whisper model called concurrently hangs unrecoverably; every later transcribe re-polls the dead engine forever. Defense: serialize with a non-blocking lock; self-heal by rebuilding a fresh model (AP-24).
-9. **Hallucinating-ASR wake precision/recall trap** (AP-27, BUG-037): the `stt_match` wake transcribes with a bias prompt; the primed model INVENTS the phrase on silence and GARBLES it on speech, so **"fires on silence" and "stops working" share ONE root** and any transcript-content ghost filter that tightens the wake also rejects real wakes. Signal: a "ghost fix" lands and the wake stops triggering for a hard custom word (`Mythos`→`Mütos`), or vice-versa. Defense: gate silence on raw ENERGY (word-agnostic RMS at the match site), NEVER on transcript content; keep the confirm permissive + skip it when loud (latency); the recall guard test must stay green. Truly-instant + zero-ghost custom wake needs a neural KWS model, not transcription (AP-25).
+9. **Hallucinating-ASR wake precision/recall trap** (AP-27, BUG-037): the `stt_match` wake transcribes with a bias prompt; the primed model INVENTS the phrase on silence and GARBLES it on speech, so **"fires on silence" and "stops working" share ONE root** and any transcript-content ghost filter that tightens the wake also rejects real wakes. Signal: a "ghost fix" lands and the wake stops triggering for a hard custom word (`Mythos`→`Mütos`), or vice-versa. Defense: gate silence on raw ENERGY (word-agnostic RMS at the match site), NEVER on transcript content; keep the confirm permissive + skip it when loud (latency); the recall guard test must stay green. Truly-instant + zero-ghost custom wake needs a neural KWS model, not transcription (AP-25). <!-- i18n-allow: forensic quote of the German STT-garble token under test -->
---
diff --git a/CLAUDE.md b/CLAUDE.md
index 9a0eb08929..9c85b5ddf7 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -148,7 +148,7 @@ Four tiers: `safe` / `monitor` / `ask` / `block`, priority **blacklist > whiteli
| AP-24 | Call a shared native inference engine (ctranslate2 / faster-whisper, an ONNX / torch session) concurrently from two callers, OR "recover" a hung inference with only a timeout that re-polls the SAME wedged engine | `WhisperModel.transcribe` is NOT thread-safe: the wake poll loop + the VAD probe sharing one provider hung it forever; a hung `to_thread` can't be cancelled, so a timeout only BOUNDS, never RECOVERS. Fix: a non-blocking per-instance inference lock (2nd call → skip) + a `recover()` that rebuilds a FRESH model after N failures (BUG-036) |
| AP-25 | Run the always-on wake/keyword Whisper on the **GPU** via CTranslate2/faster-whisper, or auto-upgrade a custom-phrase (`stt_match`) wake to `large-v3-turbo/cuda` | On the maintainer's NVIDIA Blackwell GPU (RTX 5070 Ti / sm_120) CTranslate2 `model.transcribe` **HANGS on every inference** (8 s timeout → self-heal drops+rebuilds the model → the cold rebuild hangs again → a vicious cycle that leaves the wake **permanently DEAF**). The same hang also appears on `base`/`cpu` when ctranslate2's auto thread-pool deadlocks against PyTorch's OpenMP in the shared process. Keep the wake on `base`/`cpu` with a FIXED `cpu_threads` (bounds ctranslate2 vs torch); `[stt].wake_high_accuracy` GPU turbo is **OFF by default** and opt-in ONLY on a GPU verified not to hang. Truly instant+accurate custom-word wake needs a trained neural KWS model (openWakeWord `custom_onnx`), NOT transcription (2026-06-30 live-log forensic; see `docs/local-wakeword/WAKE-RELIABILITY-DEEPDIVE.md`) |
| AP-26 | Put a new feature's init/import on the startup critical path (before `APP_INTERACTIVE` / `VOICE_USABLE`) — a synchronous load in `_run_backend`, the `WebServer` ctor, `_start_speech_and_orb`, or a module-level heavy import | Boot creep: every feature "only adds a second" until the app takes 30+ s to become usable (TTU forensic 2026-07-02: one wake change put a 114.7 s load cascade on boot). New subsystems hook into `_heavy_backend_bg`, a deferred registry scan, or a post-ready task; heavy imports stay lazy or get a `warmup_prefetch` daemon thread; routes answer a graceful 503/None while their subsystem warms. **Enforced fail-closed by the pre-push BOOT BUDGET gate** (`scripts/ci/check_boot_budget.py`: one real cold boot; window ≤ 8 s, voice-usable + app-interactive ≤ 20 s). Doctrine + how-to: `docs/diagnostics/BOOT-TTU-NOTES.md` |
-| AP-27 | Suppress `stt_match` wake ghosts by tightening TRANSCRIPT CONTENT — require the bias-echo confirm's unbiased pass to reproduce the wake word, raise the phrase-matcher strictness on the confirm, or add any second content check that must contain the phrase | Kills recognition ENTIRELY, so "fires on silence" flips into "never fires". A bias-primed local Whisper (`initial_prompt=<phrase>`, needed for proper-noun recall) HALLUCINATES the phrase on silence AND GARBLES it on real speech (`'Mythos'`→`'Mütos'`/`'Hey, Mut!'`, `'Fable'`→`'Farbe'`); the unprimed base model literally cannot spell a hard custom wake — that is the whole reason the bias exists — so NO transcript-content rule separates ghost from wake without rejecting every genuine wake (live 2026-07-02: an unbiased-corroboration check made the wake "stop working at all"). The ONLY word-agnostic discriminator is raw audio ENERGY. Fix: suppress silence at the match site with the RMS gate (`RollingWhisperWake._match_min_rms`, ghost cluster ≤ 0.0043 vs quiet-mic recall 0.009); keep the bias-echo confirm PERMISSIVE ("heard any real speech → genuine", fail-open) and SKIP it on a clearly-loud window (`_ECHO_CONFIRM_SKIP_RMS`, latency). Recall guard: `tests/unit/speech/test_rolling_whisper_wake_silence_ghost.py::test_loud_wake_fires_even_when_unbiased_pass_garbles_the_hard_word` |
+| AP-27 | Suppress `stt_match` wake ghosts by tightening TRANSCRIPT CONTENT — require the bias-echo confirm's unbiased pass to reproduce the wake word, raise the phrase-matcher strictness on the confirm, or add any second content check that must contain the phrase | Kills recognition ENTIRELY, so "fires on silence" flips into "never fires". A bias-primed local Whisper (`initial_prompt=<phrase>`, needed for proper-noun recall) HALLUCINATES the phrase on silence AND GARBLES it on real speech (`'Mythos'`→`'Mütos'`/`'Hey, Mut!'`, `'Fable'`→`'Farbe'`); the unprimed base model literally cannot spell a hard custom wake — that is the whole reason the bias exists — so NO transcript-content rule separates ghost from wake without rejecting every genuine wake (live 2026-07-02: an unbiased-corroboration check made the wake "stop working at all"). The ONLY word-agnostic discriminator is raw audio ENERGY. Fix: suppress silence at the match site with the RMS gate (`RollingWhisperWake._match_min_rms`, ghost cluster ≤ 0.0043 vs quiet-mic recall 0.009); keep the bias-echo confirm PERMISSIVE ("heard any real speech → genuine", fail-open) and SKIP it on a clearly-loud window (`_ECHO_CONFIRM_SKIP_RMS`, latency). Recall guard: `tests/unit/speech/test_rolling_whisper_wake_silence_ghost.py::test_loud_wake_fires_even_when_unbiased_pass_garbles_the_hard_word` | <!-- i18n-allow: forensic quotes of the German STT-garble tokens under test -->
---
@@ -164,7 +164,7 @@ Detail in [`docs/BUGS.md`](docs/BUGS.md). Recognize the signal, apply the defens
6. **Watchdog stale cross-unit counter** (BUG-032): a stall watchdog reads a process-global counter never reset per unit → fires spuriously between units. Defense: reset the counter at unit start; re-arm the "not started" guard per unit.
7. **Loop on an unexpected teardown error** (AP-20): a socket loop `continue`s on a non-`WebSocketDisconnect` error → spins on a dead socket. Defense: treat any read error as terminal — `break`.
8. **Wedged un-cancellable native inference** (BUG-036): a shared ctranslate2/faster-whisper model called concurrently hangs unrecoverably; every later transcribe re-polls the dead engine forever. Defense: serialize with a non-blocking lock; self-heal by rebuilding a fresh model (AP-24).
-9. **Hallucinating-ASR wake precision/recall trap** (AP-27, BUG-037): the `stt_match` wake transcribes with a bias prompt; the primed model INVENTS the phrase on silence and GARBLES it on speech, so **"fires on silence" and "stops working" share ONE root** and any transcript-content ghost filter that tightens the wake also rejects real wakes. Signal: a "ghost fix" lands and the wake stops triggering for a hard custom word (`Mythos`→`Mütos`), or vice-versa. Defense: gate silence on raw ENERGY (word-agnostic RMS at the match site), NEVER on transcript content; keep the confirm permissive + skip it when loud (latency); the recall guard test must stay green. Truly-instant + zero-ghost custom wake needs a neural KWS model, not transcription (AP-25).
+9. **Hallucinating-ASR wake precision/recall trap** (AP-27, BUG-037): the `stt_match` wake transcribes with a bias prompt; the primed model INVENTS the phrase on silence and GARBLES it on speech, so **"fires on silence" and "stops working" share ONE root** and any transcript-content ghost filter that tightens the wake also rejects real wakes. Signal: a "ghost fix" lands and the wake stops triggering for a hard custom word (`Mythos`→`Mütos`), or vice-versa. Defense: gate silence on raw ENERGY (word-agnostic RMS at the match site), NEVER on transcript content; keep the confirm permissive + skip it when loud (latency); the recall guard test must stay green. Truly-instant + zero-ghost custom wake needs a neural KWS model, not transcription (AP-25). <!-- i18n-allow: forensic quote of the German STT-garble token under test -->
---
diff --git a/docs/BUGS.md b/docs/BUGS.md
index 5d9251fe05..1cf425e4e2 100644
--- a/docs/BUGS.md
+++ b/docs/BUGS.md
@@ -2727,7 +2727,7 @@ bias is a double-edged sword:
verbatim (live log: `rms=0.0036 text='Hey Fable'`, below idle hiss) → ghost
activation (#1).
- **On real speech** the *unprimed* base model cannot spell the word — `Mythos`
- → `Mütos` / `Hey, Mut!`, `Fable` → `Farbe`. That is exactly why the bias
+ → `Mütos` / `Hey, Mut!`, `Fable` → `Farbe`. That is exactly why the bias <!-- i18n-allow: forensic quotes of the German STT-garble tokens under test -->
exists.
So any ghost fix that tightens **transcript content** — e.g. requiring the
diff --git a/docs/local-wakeword/WAKE-RELIABILITY-DEEPDIVE.md b/docs/local-wakeword/WAKE-RELIABILITY-DEEPDIVE.md
index 4d7a0bab29..19a363154b 100644
--- a/docs/local-wakeword/WAKE-RELIABILITY-DEEPDIVE.md
+++ b/docs/local-wakeword/WAKE-RELIABILITY-DEEPDIVE.md
@@ -96,7 +96,7 @@ If a custom voice ever over-triggers, set `[stt].wake_high_accuracy = false`.
The `stt_match` wake primes Whisper with `initial_prompt=<phrase>` for recall.
Consequence: the primed model **invents** the phrase on silence (ghost) and the
-unprimed model **garbles** it on speech (`Mythos`→`Mütos`, `Fable`→`Farbe`). So
+unprimed model **garbles** it on speech (`Mythos`→`Mütos`, `Fable`→`Farbe`). So <!-- i18n-allow: forensic quotes of the German STT-garble tokens under test -->
any ghost fix that gates on *transcript content* — most tempting, "make the
unbiased confirm pass also say the word" — rejects every genuine wake. "Fires
on silence" and "never fires" are the same bug from opposite ends.