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.

test(wake): guard against branded wake artifacts returning

Ruben Lütkeb434be82eb7b
diff --git a/jarvis/speech/wake_phrase.py b/jarvis/speech/wake_phrase.py
index e5cfab8356..91b9292ede 100644
--- a/jarvis/speech/wake_phrase.py
+++ b/jarvis/speech/wake_phrase.py
@@ -279,10 +279,9 @@ class WakeWordPlan:
"""Concrete, resolved wake configuration the pipeline can act on.
Note: in the graceful-degrade case (an arbitrary phrase on a box without
- local Whisper) ``phrase`` keeps the user's *requested* word (e.g. "Computer")
- while ``engine``/``oww_keyword``/``matcher`` are all "Hey Rhasspy" and
- ``degraded`` is True — so ``phrase != oww_keyword`` is a valid, intentional
- state. ``phrase`` is what to show the user; ``oww_keyword`` is what fires.
+ a usable local engine) ``phrase`` keeps the user's *requested* word
+ (e.g. "Computer") while ``engine`` is "none" and ``degraded`` is True.
+ ``phrase`` is what to show the user; ``oww_keyword`` is what fires.
"""
phrase: str
@@ -483,9 +482,9 @@ def resolve_wake_plan(
verify_prefix=False,
)
- # 5. No local model for the user's OWN word. The product rule (2026-07-04)
- # forbids silently substituting a branded fallback (the old 'Hey Rhasspy'
- # degrade made the app listen for a word the user never says). Instead we
+ # 4. No local model for the user's OWN word. The product rule (2026-07-04)
+ # forbids silently substituting a branded fallback (the retired degrade
+ # made the app listen for a word the user never says). Instead we
# return wake_available=False: the app arms NO wake detector, and the honest
# alternative is hotkey / push-to-talk activation. The user's requested phrase
# is preserved; installing the local speech pack (works for ANY word) or
diff --git a/tests/unit/speech/test_no_branded_wake_artifacts.py b/tests/unit/speech/test_no_branded_wake_artifacts.py
new file mode 100644
index 0000000000..2897923e52
--- /dev/null
+++ b/tests/unit/speech/test_no_branded_wake_artifacts.py
@@ -0,0 +1,52 @@
+"""Guard: the shipped product contains no branded wake-word artifact.
+
+Design spec 2026-07-07 (one-full-install-generic-wake): the wake system is
+fully generic. Bundled assets may only be the word-agnostic openWakeWord
+backbones; the resolver must not expose a brand map, an upstream-model probe,
+or a special-cased wake pattern. If this test fails, a branded wake artifact
+is creeping back in.
+"""
+from __future__ import annotations
+
+import re
+from pathlib import Path
+
+import jarvis.speech.wake_constants as wake_constants
+
+_REPO = Path(__file__).resolve().parents[3]
+_ASSETS = _REPO / "jarvis" / "assets" / "wakeword"
+_WAKE_SOURCES = [
+ *(_REPO / "jarvis" / "speech").glob("wake*.py"),
+ *(_REPO / "jarvis" / "speech" / "rolling_whisper_wake.py",),
+ *(_REPO / "jarvis" / "plugins" / "wake").glob("*.py"),
+ _REPO / "jarvis" / "assets" / "__init__.py",
+]
+# Underscore model tokens + third-party brand names. Deliberately NOT plain
+# "jarvis" (the product's own name appears in prose) and NOT "rhasspy"-free
+# prose exemptions — any of these tokens in a wake source is a regression.
+_BRANDS = re.compile(r"hey_jarvis|hey_rhasspy|alexa|mycroft|rhasspy", re.IGNORECASE)
+
+
+def test_only_word_agnostic_backbones_are_bundled() -> None:
+ onnx = sorted(p.name for p in _ASSETS.glob("*.onnx"))
+ assert onnx == ["embedding_model.onnx", "melspectrogram.onnx"]
+
+
+def test_brand_map_probe_and_special_case_are_gone() -> None:
+ assert not hasattr(wake_constants, "KNOWN_OWW_MODELS")
+ assert not hasattr(wake_constants, "match_known_oww_model")
+ assert not hasattr(wake_constants, "resolve_oww_model_path")
+ assert not hasattr(wake_constants, "JARVIS_WAKE_PATTERN")
+ assert wake_constants.INSTANT_WAKE_PHRASES == ()
+ assert wake_constants.DEFAULT_WAKE_PHRASE == ""
+
+
+def test_wake_sources_carry_no_brand_tokens() -> None:
+ offenders: list[str] = []
+ for src in _WAKE_SOURCES:
+ if not src.is_file():
+ continue
+ for i, line in enumerate(src.read_text(encoding="utf-8").splitlines(), 1):
+ if _BRANDS.search(line):
+ offenders.append(f"{src.name}:{i}: {line.strip()}")
+ assert not offenders, "branded wake tokens found:\n" + "\n".join(offenders)